enter.vue 9.2 KB

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