enter.vue 9.7 KB

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