enter.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  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
  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="navBack">返回</view>
  78. </u-popup>
  79. </view>
  80. </view>
  81. </template>
  82. <script>
  83. import upload from '@/components/upload.vue';
  84. export default {
  85. components: {
  86. upload
  87. },
  88. name: "buy",
  89. data() {
  90. return {
  91. action: this.$uploadUrl,
  92. maxSize: 5 * 1024 * 1024,
  93. btnLoading: false,
  94. isAdd: true,
  95. uploadOptions: {
  96. "text": "上传封面图片",
  97. "bgc": ""
  98. },
  99. uploadOptions1: {
  100. "text": "上传营业执照",
  101. "bgc": ""
  102. },
  103. mainBusinessType:[],
  104. uploadCustom: true,
  105. deptList: {},
  106. management: [
  107. {name:"粮库",checked:false},
  108. {name:"加工厂",checked:false},
  109. {name:"烘干厂",checked:false},
  110. {name:"饲料厂",checked:false},
  111. {name:"养殖场",checked:false},
  112. {name:"粮贸",checked:false},
  113. {name:"期货",checked:false},
  114. ],
  115. types: [],
  116. show: false,
  117. // anNiuCss:"types",
  118. anNiuCss: [],
  119. license1: "../../static/img/authentication/business@3x.png",
  120. license2: "../../static/img/authentication/business@3x.png",
  121. }
  122. },
  123. methods: {
  124. getImgUrl(res){
  125. console.log(res)
  126. this.deptList.attachmentAddress=res
  127. },
  128. getImgUrl1(res){
  129. console.log(res)
  130. this.deptList.licenseAddress=res
  131. },
  132. singleClick(item) {
  133. if(this.mainBusinessType.indexOf(item)==-1){
  134. this.mainBusinessType.push(item.name)
  135. item.checked=true
  136. }
  137. },
  138. filterFileType(index, lists) {
  139. if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
  140. lists.splice(index, 1);
  141. // 当前文件不支持
  142. uni.showModal({
  143. title: '暂不支持当前图片类型',
  144. showCancel: false
  145. });
  146. } else {
  147. this.isAdd = false;
  148. }
  149. },
  150. navBack() {
  151. this.$api.doRequest('post','/settledCompanyInfo/api/addSettledCompanyInfo',this.deptList).then(res => {
  152. if(res.data.code==200){
  153. uni.navigateBack(1)
  154. }
  155. })
  156. },
  157. upload() {
  158. uni.navigateTo({
  159. url: `/`
  160. })
  161. },
  162. perfect() {
  163. uni.navigateTo({
  164. url: `/pages/grain_pulse/perfect`
  165. })
  166. },
  167. submit() {
  168. var that = this
  169. // if (!this.deptList.title) {
  170. // this.$api.msg('标题不能为空')
  171. // return
  172. // }
  173. // this.show = true
  174. // return
  175. this.deptList.mainBusinessType=this.mainBusinessType.toString()
  176. this.deptList.longitude='40.22077'
  177. this.deptList.latitude='116.23128'
  178. uni.showModal({
  179. content: "确定提交企业信息??",
  180. showCancel: true,
  181. confirmText: '确定',
  182. success: function(res) {
  183. if (res.confirm) {
  184. this.show = true
  185. // that.$api.doRequest('post','/settledCompanyInfo/api/addSettledCompanyInfo',that.deptList).then(res => {
  186. // if(res.data.code==200){
  187. // }
  188. // })
  189. // //成功后
  190. // if (res.data.code == 200) {
  191. // uni.showToast({
  192. // title: '提交成功',
  193. // icon: 'none',
  194. // duration: 2000
  195. // })
  196. // }
  197. }
  198. },
  199. })
  200. }
  201. }
  202. }
  203. </script>
  204. <style lang='scss' scoped>
  205. .center {
  206. padding: 10rpx 20rpx;
  207. width: 100vw;
  208. height: 100vh;
  209. overflow: scroll;
  210. background: url(../../static/img/liangmai/bg@3x.png);
  211. background-size: 100%;
  212. background-repeat: no-repeat;
  213. }
  214. .c-row {
  215. display: -webkit-box;
  216. display: -webkit-flex;
  217. display: flex;
  218. -webkit-box-align: center;
  219. -webkit-align-items: center;
  220. align-items: center;
  221. padding: 20rpx 30rpx;
  222. position: relative;
  223. }
  224. .con-list {
  225. -webkit-box-flex: 1;
  226. -webkit-flex: 1;
  227. flex: 1;
  228. display: -webkit-box;
  229. display: -webkit-flex;
  230. display: flex;
  231. -webkit-box-orient: vertical;
  232. -webkit-box-direction: normal;
  233. -webkit-flex-direction: column;
  234. flex-direction: column;
  235. line-height: 40rpx;
  236. text-align: right;
  237. padding-right: 20rpx;
  238. font-size: 14px;
  239. }
  240. .con-list input {
  241. font-size: 14px !important;
  242. }
  243. .back-btn {
  244. position: absolute;
  245. left: 40upx;
  246. z-index: 9999;
  247. padding-top: var(--status-bar-height);
  248. top: 40upx;
  249. font-size: 40upx;
  250. color: #fff;
  251. }
  252. .title1 {
  253. position: absolute;
  254. left: 50%;
  255. transform: translateX(-50%);
  256. top: 40upx;
  257. padding-top: var(--status-bar-height);
  258. z-index: 9999;
  259. color: #fff;
  260. font-size: 36rpx;
  261. }
  262. .choice {
  263. margin-top: 10px;
  264. display: inline-block;
  265. margin-bottom: 6px;
  266. }
  267. .title {
  268. margin-left: 20rpx;
  269. color: #71747C;
  270. }
  271. .types {
  272. width: 55px;
  273. height: 30px;
  274. background-color: #F4FAF8;
  275. text-align: center;
  276. line-height: 32px;
  277. border-radius: 20px;
  278. margin-left: 14px;
  279. }
  280. .types1 {
  281. width: 55px;
  282. height: 30px;
  283. background-color: #22C572;
  284. text-align: center;
  285. line-height: 32px;
  286. border-radius: 20px;
  287. margin-left: 14px;
  288. color: #FFFFFF;
  289. }
  290. .write {
  291. margin-right: 20px;
  292. color: #71747C;
  293. }
  294. .commit {
  295. margin-top: 20px;
  296. border: 0px;
  297. border-radius: 20px;
  298. }
  299. .modular {
  300. background-color: #FFFFFF;
  301. border-radius: 20px;
  302. margin-top: 20px;
  303. }
  304. .forList {
  305. margin-top: 40px;
  306. }
  307. .titleUp {
  308. color: #FFFFFF;
  309. font-size: 44rpx;
  310. margin-top: 80px;
  311. margin-left: 10px;
  312. }
  313. .upload {
  314. text-align: center;
  315. margin: 20px 0;
  316. margin-bottom: 20px;
  317. }
  318. .popups {
  319. width: 280px;
  320. height: 290px;
  321. border-radius: 20px;
  322. }
  323. .successImg {
  324. width: 90px;
  325. height: 90px;
  326. margin: 30px auto;
  327. }
  328. .successText {
  329. text-align: center;
  330. margin: 0 auto;
  331. font-size: 16px;
  332. }
  333. </style>