enter.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  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="navBack1">返回</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. uni.navigateBack()
  163. },
  164. navBack() {
  165. this.$api.doRequest('post','/settledCompanyInfo/api/addSettledCompanyInfo',this.deptList).then(res => {
  166. if(res.data.code==200){
  167. uni.navigateBack(-1)
  168. }
  169. })
  170. },
  171. upload() {
  172. uni.navigateTo({
  173. url: `/`
  174. })
  175. },
  176. perfect() {
  177. uni.navigateTo({
  178. url: `/pages/grain_pulse/perfect`
  179. })
  180. },
  181. submit() {
  182. var that = this
  183. // if (!this.deptList.title) {
  184. // this.$api.msg('标题不能为空')
  185. // return
  186. // }
  187. // this.show = true
  188. // return
  189. this.deptList.mainBusinessType=this.mainBusinessType.toString()
  190. this.deptList.longitude='40.22077'
  191. this.deptList.latitude='116.23128'
  192. this.deptList.createPhone=this.userInfo.phone
  193. uni.showModal({
  194. content: "确定提交企业信息??",
  195. showCancel: true,
  196. confirmText: '确定',
  197. success: function(res) {
  198. if (res.confirm) {
  199. that.show = true
  200. // that.$api.doRequest('post','/settledCompanyInfo/api/addSettledCompanyInfo',that.deptList).then(res => {
  201. // if(res.data.code==200){
  202. // }
  203. // })
  204. // //成功后
  205. // if (res.data.code == 200) {
  206. // uni.showToast({
  207. // title: '提交成功',
  208. // icon: 'none',
  209. // duration: 2000
  210. // })
  211. // }
  212. }
  213. },
  214. })
  215. }
  216. }
  217. }
  218. </script>
  219. <style lang='scss' scoped>
  220. .center {
  221. padding: 10rpx 20rpx;
  222. width: 100vw;
  223. height: 100vh;
  224. overflow: scroll;
  225. background: url(../../static/img/liangmai/bg@3x.png);
  226. background-size: 100%;
  227. background-repeat: no-repeat;
  228. }
  229. .c-row {
  230. display: -webkit-box;
  231. display: -webkit-flex;
  232. display: flex;
  233. -webkit-box-align: center;
  234. -webkit-align-items: center;
  235. align-items: center;
  236. padding: 20rpx 30rpx;
  237. position: relative;
  238. }
  239. .con-list {
  240. -webkit-box-flex: 1;
  241. -webkit-flex: 1;
  242. flex: 1;
  243. display: -webkit-box;
  244. display: -webkit-flex;
  245. display: flex;
  246. -webkit-box-orient: vertical;
  247. -webkit-box-direction: normal;
  248. -webkit-flex-direction: column;
  249. flex-direction: column;
  250. line-height: 40rpx;
  251. text-align: right;
  252. padding-right: 20rpx;
  253. font-size: 14px;
  254. }
  255. .con-list input {
  256. font-size: 14px !important;
  257. }
  258. .back-btn {
  259. position: absolute;
  260. left: 40upx;
  261. z-index: 9999;
  262. padding-top: var(--status-bar-height);
  263. top: 40upx;
  264. font-size: 40upx;
  265. color: #fff;
  266. }
  267. .title1 {
  268. position: absolute;
  269. left: 50%;
  270. transform: translateX(-50%);
  271. top: 40upx;
  272. padding-top: var(--status-bar-height);
  273. z-index: 9999;
  274. color: #fff;
  275. font-size: 36rpx;
  276. }
  277. .choice {
  278. margin-top: 10px;
  279. display: inline-block;
  280. margin-bottom: 6px;
  281. }
  282. .title {
  283. margin-left: 20rpx;
  284. color: #71747C;
  285. }
  286. .types {
  287. width: 55px;
  288. height: 30px;
  289. background-color: #F4FAF8;
  290. text-align: center;
  291. line-height: 32px;
  292. border-radius: 20px;
  293. margin-left: 14px;
  294. }
  295. .types1 {
  296. width: 55px;
  297. height: 30px;
  298. background-color: #22C572;
  299. text-align: center;
  300. line-height: 32px;
  301. border-radius: 20px;
  302. margin-left: 14px;
  303. color: #FFFFFF;
  304. }
  305. .write {
  306. margin-right: 20px;
  307. color: #71747C;
  308. }
  309. .commit {
  310. margin-top: 20px;
  311. border: 0px;
  312. border-radius: 20px;
  313. }
  314. .modular {
  315. background-color: #FFFFFF;
  316. border-radius: 20px;
  317. margin-top: 20px;
  318. }
  319. .forList {
  320. margin-top: 40px;
  321. }
  322. .titleUp {
  323. color: #FFFFFF;
  324. font-size: 44rpx;
  325. margin-top: 80px;
  326. margin-left: 10px;
  327. }
  328. .upload {
  329. text-align: center;
  330. margin: 20px 0;
  331. margin-bottom: 20px;
  332. }
  333. .popups {
  334. width: 280px;
  335. height: 290px;
  336. border-radius: 20px;
  337. }
  338. .successImg {
  339. width: 90px;
  340. height: 90px;
  341. margin: 30px auto;
  342. }
  343. .successText {
  344. text-align: center;
  345. margin: 0 auto;
  346. font-size: 16px;
  347. }
  348. </style>