enter.vue 9.6 KB

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