enter.vue 12 KB

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