enter.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477
  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(options) {debugger
  168. console.log(options)
  169. console.log("options",JSON.parse(options.position))
  170. },
  171. computed: {
  172. ...mapState(['hasLogin', 'userInfo'])
  173. },
  174. methods: {
  175. getImgUrl(res) {
  176. console.log(res)
  177. this.deptList.attachmentAddress = res
  178. },
  179. naviageToPage(item) {
  180. uni.navigateTo({
  181. url: item
  182. })
  183. },
  184. getImgUrl1(res) {
  185. console.log(res)
  186. this.deptList.licenseAddress = res
  187. },
  188. singleClick(item) {
  189. if (this.mainBusinessType.indexOf(item) == -1) {
  190. this.mainBusinessType.push(item.name)
  191. item.checked = true
  192. }
  193. },
  194. filterFileType(index, lists) {
  195. if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
  196. lists.splice(index, 1);
  197. // 当前文件不支持
  198. uni.showModal({
  199. title: '暂不支持当前图片类型',
  200. showCancel: false
  201. });
  202. } else {
  203. this.isAdd = false;
  204. }
  205. },
  206. navBack() {
  207. uni.navigateBack()
  208. },
  209. navBack1() {
  210. this.$api.doRequest('post', '/settledCompanyInfo/api/addSettledCompanyInfo', this.deptList).then(res => {
  211. if (res.data.code == 200) {
  212. uni.navigateBack(1)
  213. }
  214. })
  215. },
  216. upload() {
  217. uni.navigateTo({
  218. url: `/`
  219. })
  220. },
  221. perfect() {
  222. this.show=false
  223. uni.navigateTo({
  224. url: `/pages/grain_pulse/perfect?deptList=`+JSON.stringify(this.deptList)
  225. })
  226. },
  227. submit() {
  228. var that = this
  229. if (!this.deptList.compName) {
  230. this.$api.msg('公司名称不能为空')
  231. return
  232. }
  233. if (this.mainBusinessType.length==0) {
  234. this.$api.msg('至少选择一个主营类型')
  235. return
  236. }
  237. if (!this.deptList.title) {
  238. this.$api.msg('标题不能为空')
  239. return
  240. }
  241. if (!this.deptList.companyProfile) {
  242. this.$api.msg('企业简介不能为空')
  243. return
  244. }
  245. if (!this.deptList.longitude&&!this.deptList.longitude) {
  246. this.$api.msg('上传坐标不能为空')
  247. return
  248. }
  249. if (!this.deptList.detailedAddress) {
  250. this.$api.msg('详细地址不能为空')
  251. return
  252. }
  253. if (!this.deptList.attachmentAddress) {
  254. this.$api.msg('封面照片不能为空')
  255. return
  256. }
  257. if (!this.deptList.licenseAddress) {
  258. this.$api.msg('营业执照不能为空')
  259. return
  260. }
  261. if (this.deptList.compName.length<2||this.deptList.compName.length>25) {
  262. this.$api.msg('公司名称输入错误')
  263. return
  264. }
  265. if (this.deptList.title.length<2||this.deptList.title.length>16) {
  266. this.$api.msg('标题长度2-16个字')
  267. return
  268. }
  269. if (this.deptList.companyProfile.length<10||this.deptList.companyProfile.length>60) {
  270. this.$api.msg('简介长度10-60个字')
  271. return
  272. }
  273. if (this.deptList.detailedAddress.length<2||this.deptList.detailedAddress.length>12) {
  274. this.$api.msg('详细地址2-12个字')
  275. return
  276. }
  277. // this.show = true
  278. // return
  279. this.deptList.mainBusinessType=this.mainBusinessType.toString()
  280. this.deptList.longitude='40.22077'
  281. this.deptList.latitude='116.23128'
  282. this.deptList.createPhone=this.userInfo.phone
  283. uni.showModal({
  284. content: "确定提交企业信息??",
  285. showCancel: true,
  286. confirmText: '确定',
  287. success: function(res) {
  288. if (res.confirm) {
  289. that.show = true
  290. // that.$api.doRequest('post','/settledCompanyInfo/api/addSettledCompanyInfo',that.deptList).then(res => {
  291. // if(res.data.code==200){
  292. // }
  293. // })
  294. // //成功后
  295. // if (res.data.code == 200) {
  296. // uni.showToast({
  297. // title: '提交成功',
  298. // icon: 'none',
  299. // duration: 2000
  300. // })
  301. // }
  302. }
  303. },
  304. })
  305. }
  306. }
  307. }
  308. </script>
  309. <style lang='scss' scoped>
  310. .center {
  311. padding: 10rpx 20rpx;
  312. width: 100vw;
  313. height: 100vh;
  314. overflow: scroll;
  315. position:relative;z-index:2;
  316. }
  317. .bg{
  318. position:absolute;
  319. width:100%;
  320. left: 0;
  321. top:0;
  322. }
  323. .c-row {
  324. display: -webkit-box;
  325. display: -webkit-flex;
  326. display: flex;
  327. -webkit-box-align: center;
  328. -webkit-align-items: center;
  329. align-items: center;
  330. padding: 20rpx 30rpx;
  331. position: relative;
  332. }
  333. .con-list {
  334. -webkit-box-flex: 1;
  335. -webkit-flex: 1;
  336. flex: 1;
  337. display: -webkit-box;
  338. display: -webkit-flex;
  339. display: flex;
  340. -webkit-box-orient: vertical;
  341. -webkit-box-direction: normal;
  342. -webkit-flex-direction: column;
  343. flex-direction: column;
  344. line-height: 40rpx;
  345. text-align: right;
  346. padding-right: 20rpx;
  347. font-size: 14px;
  348. }
  349. .con-list input {
  350. font-size: 14px !important;
  351. }
  352. .back-btn {
  353. position: absolute;
  354. left: 40upx;
  355. z-index: 9999;
  356. padding-top: var(--status-bar-height);
  357. top: 40upx;
  358. font-size: 40upx;
  359. color: #fff;
  360. }
  361. .title1 {
  362. position: absolute;
  363. left: 50%;
  364. transform: translateX(-50%);
  365. top: 40upx;
  366. padding-top: var(--status-bar-height);
  367. z-index: 9999;
  368. color: #fff;
  369. font-size: 36rpx;
  370. }
  371. .choice {
  372. margin-top: 10px;
  373. display: inline-block;
  374. }
  375. .title {
  376. color: #71747C;
  377. }
  378. .types {
  379. background-color: #F4FAF8;
  380. text-align: center;
  381. border-radius: 20px;
  382. margin-left: 5px;
  383. padding:8px 19px;
  384. }
  385. .types1 {
  386. background-color: #22C572;
  387. text-align: center;
  388. border-radius: 20px;
  389. color: #FFFFFF;
  390. }
  391. .write {
  392. margin-right: 20px;
  393. color: #71747C;
  394. }
  395. .commit {
  396. margin-top: 20px;
  397. border: 0px;
  398. border-radius: 20px;
  399. }
  400. .modular {
  401. background-color: #FFFFFF;
  402. border-radius: 10px;
  403. margin-top: 10px;
  404. position:relative;z-index:2;
  405. padding:0 12.5px;
  406. }
  407. .forList {
  408. margin-top: 20px;
  409. }
  410. .titleUp {
  411. color: #FFFFFF;
  412. font-size: 44rpx;
  413. margin-top: 80px;
  414. margin-left: 10px;
  415. position: relative;
  416. z-index:2;
  417. }
  418. .upload {
  419. text-align: center;
  420. margin: 20px 0;
  421. margin-bottom: 20px;
  422. }
  423. .popups {
  424. width: 280px;
  425. height: 290px;
  426. border-radius: 20px;
  427. }
  428. .successImg {
  429. width: 90px;
  430. height: 90px;
  431. margin: 30px auto;
  432. }
  433. .successText {
  434. text-align: center;
  435. margin: 0 auto;
  436. font-size: 16px;
  437. }
  438. .companyProfilewrap{
  439. position:relative;
  440. width:100%;
  441. }
  442. .companyProfile{
  443. width:90%;height:138px;
  444. background:#F9F9FA;
  445. font-size:13px;
  446. padding:13px;
  447. border-radius:5px;
  448. }
  449. .companyProfilecontent{
  450. position:absolute;
  451. bottom:10px;
  452. right:15px;
  453. font-size:13px;
  454. }
  455. </style>