enter.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. <template>
  2. <view class="center">
  3. <!-- <view class=""> -->
  4. <view class="back-btn cuIcon-back" @click="navBack"></view>
  5. <!-- <view class='title1'>入驻</view> -->
  6. <view class="titleUp">
  7. 请完善入驻信息
  8. </view>
  9. <u-form class="forList">
  10. <view class="modular">
  11. <u-form-item label="公司名称" label-width="30%" class="title Regular">
  12. <u-input v-model="deptList.compName" input-align="right" class="write Medium" placeholder="请输入公司名称" />
  13. </u-form-item>
  14. <view>
  15. <view class="title Regular" style="margin-top: 15rpx;">主要类型(可多选,必须为真实经营类型)</view>
  16. <view v-for="(item,index) in management" class="choice">
  17. <!-- <u-tag :type="types[index] == null ? 'info' : types[index]" :text="item" show="show"
  18. @click="singleClick(index)"></u-tag> -->
  19. <view :class="!item.checked ? '' : 'types1'" class='types' @click="singleClick(item)">
  20. {{item.name}}
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="modular">
  26. <u-form-item label="标题" label-width="30%" class="title Regular">
  27. <u-input v-model="deptList.title" input-align="right" class="write Regular"
  28. placeholder="用于封面展示,2-16个字" />
  29. </u-form-item>
  30. <u-form-item label="公司简介" label-width="30%" class="title Regular">
  31. <u-input v-model="deptList.companyProfile" input-align="right" class="write Regular" type="textarea"
  32. placeholder="请输入企业简介,如经营项目、产品类型、企业规模等,10-60个字" />
  33. </u-form-item>
  34. </view>
  35. <view class="modular">
  36. <u-form-item label="上传坐标" label-width="30%" class="title Regular">
  37. <text @click='naviageToPage("/pages/grain_pulse/localtion/coordinate")'
  38. class="con-list Regular">{{deptList.buyer == null ? "未上传":deptList.buyer}}<text
  39. class='tip_text cuIcon-right'></text></text>
  40. </u-form-item>
  41. <u-form-item label="所在区域" label-width="30%" class="title Regular">
  42. <u-input v-model="deptList.name" input-align="right" class="write Regular" disabled
  43. placeholder="自动获取" />
  44. </u-form-item>
  45. <u-form-item label="详细地址" label-width="30%" class="title Regular">
  46. <u-input v-model="deptList.detailedAddress" input-align="right" class="write Regular"
  47. placeholder="如街道和门牌号,2-12个字" maxlength="12" />
  48. </u-form-item>
  49. <view>
  50. <view class="title Regular" style="margin-top: 15rpx;">上传图片</view>
  51. <view v-if="license1 != ''">
  52. <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
  53. :size-type="['compressed']" @on-success="getImgUrl" @on-error="onError"
  54. @on-remove="onRemove" @on-uploaded="isAdd = true" :before-upload="filterFileType"
  55. :options="uploadOptions" :custom="uploadCustom" @on-progress="onProgress"></upload>
  56. </view>
  57. <view v-if="license2 != ''">
  58. <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
  59. :size-type="['compressed']" @on-success="getImgUrl1" @on-error="onError"
  60. @on-remove="onRemove" @on-uploaded="isAdd = true" :before-upload="filterFileType"
  61. :options="uploadOptions1" :custom="uploadCustom" @on-progress="onProgress"></upload>
  62. </view>
  63. </view>
  64. </view>
  65. <!-- :disabled="true" -->
  66. <u-button @click="submit" class="commit" type="success">提交</u-button>
  67. </u-form>
  68. <view v-if="show == true">
  69. <u-popup v-model="show" mode="center" border-radius="20" width="560rpx" height="560rpx">
  70. <view class="successImg">
  71. <image src="../../static/img/liangmai/tijiaochenggong@3x.png" mode=""
  72. style="width: 180rpx;height: 180rpx;"></image>
  73. </view>
  74. <view class="successText">提交成功,等待平台审核。</view>
  75. <u-button type="success" style="width: 400rpx; margin: 20rpx auto; " shape="circle" @click="perfect">
  76. 完善更多信息</u-button>
  77. <view style="color: #AFB3BF;text-align: center;" @click="navBack">返回</view>
  78. </u-popup>
  79. </view>
  80. </view>
  81. </template>
  82. <script>
  83. import {
  84. mapState
  85. } from 'vuex';
  86. import upload from '@/components/upload.vue';
  87. export default {
  88. components: {
  89. upload
  90. },
  91. name: "buy",
  92. data() {
  93. return {
  94. action: this.$uploadUrl,
  95. maxSize: 5 * 1024 * 1024,
  96. btnLoading: false,
  97. isAdd: true,
  98. uploadOptions: {
  99. "text": "上传封面图片",
  100. "bgc": ""
  101. },
  102. uploadOptions1: {
  103. "text": "上传营业执照",
  104. "bgc": ""
  105. },
  106. mainBusinessType:[],
  107. uploadCustom: true,
  108. deptList: {},
  109. management: [
  110. {name:"粮库",checked:false},
  111. {name:"加工厂",checked:false},
  112. {name:"烘干厂",checked:false},
  113. {name:"饲料厂",checked:false},
  114. {name:"养殖场",checked:false},
  115. {name:"粮贸",checked:false},
  116. {name:"期货",checked:false},
  117. ],
  118. types: [],
  119. show: false,
  120. // anNiuCss:"types",
  121. anNiuCss: [],
  122. license1: "../../static/img/authentication/business@3x.png",
  123. license2: "../../static/img/authentication/business@3x.png",
  124. }
  125. },
  126. computed: {
  127. ...mapState(['hasLogin', 'userInfo'])
  128. },
  129. methods: {
  130. getImgUrl(res){
  131. console.log(res)
  132. this.deptList.attachmentAddress=res
  133. },
  134. naviageToPage(item){
  135. uni.navigateTo({
  136. url:item
  137. })
  138. },
  139. getImgUrl1(res){
  140. console.log(res)
  141. this.deptList.licenseAddress=res
  142. },
  143. singleClick(item) {
  144. if(this.mainBusinessType.indexOf(item)==-1){
  145. this.mainBusinessType.push(item.name)
  146. item.checked=true
  147. }
  148. },
  149. filterFileType(index, lists) {
  150. if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
  151. lists.splice(index, 1);
  152. // 当前文件不支持
  153. uni.showModal({
  154. title: '暂不支持当前图片类型',
  155. showCancel: false
  156. });
  157. } else {
  158. this.isAdd = false;
  159. }
  160. },
  161. navBack() {
  162. this.$api.doRequest('post','/settledCompanyInfo/api/addSettledCompanyInfo',this.deptList).then(res => {
  163. if(res.data.code==200){
  164. uni.navigateBack(-1)
  165. }
  166. })
  167. },
  168. upload() {
  169. uni.navigateTo({
  170. url: `/`
  171. })
  172. },
  173. perfect() {
  174. uni.navigateTo({
  175. url: `/pages/grain_pulse/perfect`
  176. })
  177. },
  178. submit() {
  179. var that = this
  180. // if (!this.deptList.title) {
  181. // this.$api.msg('标题不能为空')
  182. // return
  183. // }
  184. // this.show = true
  185. // return
  186. this.deptList.mainBusinessType=this.mainBusinessType.toString()
  187. this.deptList.longitude='40.22077'
  188. this.deptList.latitude='116.23128'
  189. this.deptList.createPhone=this.userInfo.phone
  190. uni.showModal({
  191. content: "确定提交企业信息??",
  192. showCancel: true,
  193. confirmText: '确定',
  194. success: function(res) {
  195. if (res.confirm) {
  196. that.show = true
  197. // that.$api.doRequest('post','/settledCompanyInfo/api/addSettledCompanyInfo',that.deptList).then(res => {
  198. // if(res.data.code==200){
  199. // }
  200. // })
  201. // //成功后
  202. // if (res.data.code == 200) {
  203. // uni.showToast({
  204. // title: '提交成功',
  205. // icon: 'none',
  206. // duration: 2000
  207. // })
  208. // }
  209. }
  210. },
  211. })
  212. }
  213. }
  214. }
  215. </script>
  216. <style lang='scss' scoped>
  217. .center {
  218. padding: 10rpx 20rpx;
  219. width: 100vw;
  220. height: 100vh;
  221. overflow: scroll;
  222. background: url(../../static/img/liangmai/bg@3x.png);
  223. background-size: 100%;
  224. background-repeat: no-repeat;
  225. }
  226. .c-row {
  227. display: -webkit-box;
  228. display: -webkit-flex;
  229. display: flex;
  230. -webkit-box-align: center;
  231. -webkit-align-items: center;
  232. align-items: center;
  233. padding: 20rpx 30rpx;
  234. position: relative;
  235. }
  236. .con-list {
  237. -webkit-box-flex: 1;
  238. -webkit-flex: 1;
  239. flex: 1;
  240. display: -webkit-box;
  241. display: -webkit-flex;
  242. display: flex;
  243. -webkit-box-orient: vertical;
  244. -webkit-box-direction: normal;
  245. -webkit-flex-direction: column;
  246. flex-direction: column;
  247. line-height: 40rpx;
  248. text-align: right;
  249. padding-right: 20rpx;
  250. font-size: 14px;
  251. }
  252. .con-list input {
  253. font-size: 14px !important;
  254. }
  255. .back-btn {
  256. position: absolute;
  257. left: 40upx;
  258. z-index: 9999;
  259. padding-top: var(--status-bar-height);
  260. top: 40upx;
  261. font-size: 40upx;
  262. color: #fff;
  263. }
  264. .title1 {
  265. position: absolute;
  266. left: 50%;
  267. transform: translateX(-50%);
  268. top: 40upx;
  269. padding-top: var(--status-bar-height);
  270. z-index: 9999;
  271. color: #fff;
  272. font-size: 36rpx;
  273. }
  274. .choice {
  275. margin-top: 10px;
  276. display: inline-block;
  277. margin-bottom: 6px;
  278. }
  279. .title {
  280. margin-left: 20rpx;
  281. color: #71747C;
  282. }
  283. .types {
  284. width: 55px;
  285. height: 30px;
  286. background-color: #F4FAF8;
  287. text-align: center;
  288. line-height: 32px;
  289. border-radius: 20px;
  290. margin-left: 14px;
  291. }
  292. .types1 {
  293. width: 55px;
  294. height: 30px;
  295. background-color: #22C572;
  296. text-align: center;
  297. line-height: 32px;
  298. border-radius: 20px;
  299. margin-left: 14px;
  300. color: #FFFFFF;
  301. }
  302. .write {
  303. margin-right: 20px;
  304. color: #71747C;
  305. }
  306. .commit {
  307. margin-top: 20px;
  308. border: 0px;
  309. border-radius: 20px;
  310. }
  311. .modular {
  312. background-color: #FFFFFF;
  313. border-radius: 20px;
  314. margin-top: 20px;
  315. }
  316. .forList {
  317. margin-top: 40px;
  318. }
  319. .titleUp {
  320. color: #FFFFFF;
  321. font-size: 44rpx;
  322. margin-top: 80px;
  323. margin-left: 10px;
  324. }
  325. .upload {
  326. text-align: center;
  327. margin: 20px 0;
  328. margin-bottom: 20px;
  329. }
  330. .popups {
  331. width: 280px;
  332. height: 290px;
  333. border-radius: 20px;
  334. }
  335. .successImg {
  336. width: 90px;
  337. height: 90px;
  338. margin: 30px auto;
  339. }
  340. .successText {
  341. text-align: center;
  342. margin: 0 auto;
  343. font-size: 16px;
  344. }
  345. </style>