settled.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. <template>
  2. <view>
  3. <cu-custom :isBack="true">
  4. <block slot="content">申请入驻</block>
  5. </cu-custom>
  6. <view v-if="tab == 1">
  7. <form>
  8. <view class="cu-form-group ">
  9. <!-- <mySelect label="选择所属供应商" ></mySelect> -->
  10. <view class="title">选择所属供应商</view>
  11. <picker @change="PickerChange" :value="form.purveyorId" range-key="purveyorName"
  12. :range="supplierOption">
  13. <view class="picker">
  14. {{ form.purveyorId ? supplierOption.find(e => e.id == form.purveyorId).purveyorName : '请选择'
  15. }}
  16. </view>
  17. </picker>
  18. </view>
  19. <view class="flex cu-form-group margin-top">
  20. <view class="content ">
  21. <text class="text-bold">账户信息</text>
  22. </view>
  23. <view class="action">
  24. <text class="text-bold">1/3</text>
  25. </view>
  26. </view>
  27. <view class="cu-form-group">
  28. <view class="title">姓名</view>
  29. <input placeholder="请输入联系人姓名" v-model="form.name" name="input"></input>
  30. </view>
  31. </form>
  32. <view class="padding flex flex-direction">
  33. <button class="cu-btn bg-blue " @click="tab = 2">保存并下一步</button>
  34. </view>
  35. </view>
  36. <view v-if="tab == 2">
  37. <form>
  38. <view class="flex cu-form-group margin-top">
  39. <view class="content ">
  40. <text class="text-bold">提交经营主体资料</text>
  41. </view>
  42. <view class="action">
  43. <text class="text-bold">2/3</text>
  44. </view>
  45. </view>
  46. <view class="cu-form-group">
  47. <view class="title">主体类型</view>
  48. <radio-group @change="typeChang($event, 'type')" v-model="form.type">
  49. <label class="margin-left-sm">
  50. <radio class="blue radio" value="1" checked></radio>
  51. <text class="margin-left-sm">普通企业</text>
  52. </label>
  53. <label class="margin-left-sm">
  54. <radio class="blue radio" value="2"></radio>
  55. <text class="margin-left-sm">个体工商户</text>
  56. </label>
  57. </radio-group>
  58. </view>
  59. <view class="cu-form-group">
  60. <view class="title">公司名称</view>
  61. <input placeholder="请输入公司名称" v-model="form.corporateName" name="input"></input>
  62. </view>
  63. <view class="cu-form-group">
  64. <view class="title">统一社会信用代码</view>
  65. <input placeholder="请输入统一社会信用代码" v-model="form.creditCode" name="input"></input>
  66. </view>
  67. <view class="cu-form-group">
  68. <view class="title">有效期</view>
  69. <radio-group @change="typeChang($event, 'lifespan')" v-model="form.lifespan">
  70. <label class="margin-left-sm">
  71. <radio class="blue radio" value="1" checked></radio>
  72. <text class="margin-left-sm">长期有效</text>
  73. </label>
  74. <label class="margin-left-sm">
  75. <radio class="blue radio" value="2"></radio>
  76. <text class="margin-left-sm">固定期限</text>
  77. </label>
  78. </radio-group>
  79. </view>
  80. <view class="cu-form-group" v-if="form.lifespan == 2">
  81. <view class="title">日期开始时间</view>
  82. <picker mode="date" :value="form.lifespanBegin" @change="typeChang($event, 'lifespanBegin')">
  83. <view class="picker">
  84. {{ form.lifespanBegin ? form.lifespanBegin : '请选择' }}
  85. </view>
  86. </picker>
  87. </view>
  88. <view class="cu-form-group" v-if="form.lifespan == 2">
  89. <view class="title">日期结束时间</view>
  90. <picker mode="date" :value="form.lifespanEnd" @change="typeChang($event, 'lifespanEnd')">
  91. <view class="picker">
  92. {{ form.lifespanEnd ? form.lifespanEnd : '请选择' }}
  93. </view>
  94. </picker>
  95. </view>
  96. <view class="customize">
  97. <view class="title">营业执照</view>
  98. <view class="business-img flex align-center">
  99. <image :src="businessLicenseImg ? businessLicenseImg : '/static/login/yingyezhizhao.png'" mode=""
  100. @click="businessChange('businessLicense')">
  101. </image>
  102. </view>
  103. </view>
  104. <view class="cu-form-group margin-top">
  105. <view class="title">法人姓名</view>
  106. <input placeholder="请输入法人姓名" v-model="form.legalPerson" name="input"></input>
  107. </view>
  108. <view class="cu-form-group">
  109. <view class="title">法人证件号</view>
  110. <input placeholder="请输入法人证件号" v-model="form.legalPersonCode" name="input"></input>
  111. </view>
  112. <view class="customize">
  113. <view class="title">法人证件照片</view>
  114. <view class="flex upload justify-between">
  115. <view class="imgOcr-border">
  116. <image :src="identityOneImg ? identityOneImg : '/static/login/code1.png'" mode=""
  117. @click="businessChange('identityOne')"></image>
  118. </view>
  119. <view class="imgOcr-border">
  120. <image :src="identityTwoImg ? identityTwoImg : '/static/login/code2.png'" mode=""
  121. @click="businessChange('identityTwo')"></image>
  122. </view>
  123. </view>
  124. </view>
  125. </form>
  126. <view class="padding flex justify-around ">
  127. <button class="cu-btn bg-blue " @click="tab = 1">上一步</button>
  128. <button class="cu-btn bg-blue " @click="tab = 3">保存并下一步</button>
  129. </view>
  130. </view>
  131. <view v-if="tab == 3">
  132. <form>
  133. <view class="flex cu-form-group margin-top">
  134. <view class="content ">
  135. <text class="text-bold">提交门店信息</text>
  136. </view>
  137. <view class="action">
  138. <text class="text-bold">3/3</text>
  139. </view>
  140. </view>
  141. <view class="cu-form-group">
  142. <view class="title">门店名称</view>
  143. <input placeholder="实际经营门店信息" v-model="form.storeName" name="input"></input>
  144. </view>
  145. <view class="cu-form-group" @click="$refs.picker.show()">
  146. <view class="title">所在地区</view>
  147. <input placeholder="请输入所在地区" name="input" v-model="country" disabled="true"></input>
  148. <w-picker :visible.sync="visible" ref="picker" mode="region" :value="country"
  149. @confirm="onConfirm($event, 'region')"></w-picker>
  150. </view>
  151. <view class="cu-form-group">
  152. <view class="title">门店地址</view>
  153. <input placeholder="请输入门店地址详细地址" v-model="form.address" name="input"></input>
  154. </view>
  155. <view class="customize">
  156. <view class="title">门头照片</view>
  157. <view class="grid col-4 grid-square flex-sub img-border">
  158. <view class="bg-img" v-for="(item, index) in imgList" :key="index" @tap="ViewImage"
  159. :data-url="imgList[index]">
  160. <image :src="imgList[index]" mode="aspectFill"></image>
  161. <view class="cu-tag bg-red" @tap.stop="DelImg" :data-index="index">
  162. <text class='cuIcon-close'></text>
  163. </view>
  164. </view>
  165. <view class="solids" @tap="ChooseImage" v-if="imgList.length < 4">
  166. <text class='cuIcon-cameraadd'></text>
  167. </view>
  168. </view>
  169. </view>
  170. </form>
  171. <view class="padding flex justify-around ">
  172. <button class="cu-btn bg-blue " @click="tab = 2">上一步</button>
  173. <button class="cu-btn bg-blue " @click="sumbit">提交申请</button>
  174. </view>
  175. </view>
  176. </view>
  177. </template>
  178. <script>
  179. import configService from '../../common/service/config.service'
  180. import { ACCESS_TOKEN } from '@/common/util/constants.js'
  181. import regionPicker from "../../components/w-picker/region-picker.vue"
  182. export default {
  183. components: {
  184. regionPicker,
  185. },
  186. data() {
  187. return {
  188. form: {
  189. purveyorId: 0,
  190. type: 1,
  191. lifespan: 1,
  192. lifespanBegin: null,
  193. lifespanEnd: null,
  194. headPhoto: null,
  195. passWord:uni.getStorageSync('password'),
  196. phone:uni.getStorageSync('phone'),
  197. },
  198. tab: 1,
  199. supplierOption: [],
  200. businessLicenseImg: '',
  201. identityOneImg: '',
  202. identityTwoImg: '',
  203. visible: false,
  204. imgList: [],
  205. imgList1: [],
  206. index: -1,
  207. country: '',
  208. }
  209. },
  210. async onLoad() {
  211. let res = await this.$http.get("/merchant/app/allList")
  212. if (res.data.success) {
  213. this.supplierOption = res.data.result
  214. } else {
  215. this.$tip.toast(res.data.message);
  216. }
  217. },
  218. methods: {
  219. ChooseImage() {
  220. uni.chooseImage({
  221. // count: 4, //默认9
  222. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  223. sourceType: ['album'], //从相册选择
  224. success: (res) => {
  225. if (res) {
  226. // this[type + 'Img'] = chooseImageRes.tempFilePaths[0];
  227. uni.uploadFile({
  228. url: configService.apiUrl + '/sys/common/upload',
  229. filePath: res.tempFilePaths[0],
  230. name: "file",
  231. success: (files) => {
  232. let data = JSON.parse(files.data);
  233. if (data.success) {
  234. if (this.imgList.length != 0) {
  235. this.imgList = this.imgList.concat(res.tempFilePaths)
  236. this.form.headPhoto.push(data.message)
  237. } else {
  238. this.imgList = res.tempFilePaths
  239. this.form.headPhoto=[data.message]
  240. }
  241. // this.form.headPhoto =this.form.headPhoto+'/'+ data.message
  242. }
  243. }
  244. })
  245. }
  246. }
  247. });
  248. },
  249. ViewImage(e) {
  250. uni.previewImage({
  251. urls: this.imgList,
  252. current: e.currentTarget.dataset.url
  253. });
  254. },
  255. DelImg(e) {
  256. uni.showModal({
  257. title: '提示',
  258. content: '确定要删除?',
  259. cancelText: '取消',
  260. confirmText: '确定',
  261. success: res => {
  262. if (res.confirm) {
  263. this.imgList.splice(e.currentTarget.dataset.index, 1)
  264. this.form.headPhoto.splice(e.currentTarget.dataset.index, 1)
  265. }
  266. }
  267. })
  268. },
  269. onConfirm(e) {
  270. console.log("confirm", e)
  271. this.country = e.result
  272. this.form.country = e.value[e.value.length - 1]
  273. },
  274. PickerChange(e) {
  275. this.form.purveyorId = this.supplierOption[e.detail.value].id
  276. },
  277. typeChang(e, val) {
  278. this.form[val] = e.detail.value
  279. },
  280. async businessChange(type) {
  281. let [chooseImageErr, chooseImageRes] = await uni.chooseImage({
  282. count: 1,
  283. sizeType: ['compressed']
  284. });
  285. let size = chooseImageRes.tempFiles[0].size / 1024 / 1024 < 5;
  286. if (!size) {
  287. this.$refs.uToast.show({
  288. title: '上传图片大小不能超过 5MB!',
  289. type: 'error',
  290. })
  291. return false
  292. }
  293. if (chooseImageRes) {
  294. this[type + 'Img'] = chooseImageRes.tempFilePaths[0];
  295. uni.uploadFile({
  296. url: configService.apiUrl + '/sys/common/upload',
  297. filePath: chooseImageRes.tempFilePaths[0],
  298. name: "file",
  299. success: (files) => {
  300. let data = JSON.parse(files.data);
  301. if (data.success) {
  302. this.form[type] = data.message
  303. // uni.uploadFile({
  304. // url: this.$base.baseUrl + '/order/identify/drivingPermit',
  305. // filePath: chooseImageRes.tempFilePaths[0],
  306. // name: "image2",
  307. // header: {
  308. // Authorization: store.state.token,
  309. // },
  310. // success: (uploadFileRes) => {
  311. // let data1 = JSON.parse(uploadFileRes.data).data;
  312. // this.carback = {
  313. // vehicleweight: data1.carInfo
  314. // .grossMass, //总质量
  315. // completeKerbMass: data1.carInfo
  316. // .unladenMass, //整备质量
  317. // seatCount: data1.carInfo
  318. // .approvedPassengersCapacity, //核定载客数
  319. // limitLoad: data1.carInfo
  320. // .limitLoad, //核定载质量
  321. // }
  322. // this.lodingshow = false;
  323. // }
  324. // });
  325. }
  326. }
  327. });
  328. } else {
  329. }
  330. },
  331. sumbit() {
  332. let headPhoto=this.form.headPhoto?this.form.headPhoto.join('/'):null
  333. this.$http.post('/merchant/app/add',{...this.form,source:2,headPhoto}).then(res=>{
  334. if(res.data.success){
  335. this.$tip.success(res.data.result||'成功')
  336. this.$Router.push({name:"login"})
  337. }
  338. else{
  339. this.$tip.error(res.data.message);
  340. }
  341. })
  342. }
  343. }
  344. }
  345. </script>
  346. <style scoped lang="scss">
  347. .customize {
  348. background-color: #fff;
  349. border-top: 0.5px solid #eee;
  350. .title {
  351. font-size: 15px;
  352. padding-right: 15px;
  353. padding: 15px;
  354. padding-bottom: 0;
  355. }
  356. }
  357. .business-img{
  358. height: 218upx;
  359. width: 360upx;
  360. padding: 14upx;
  361. background: url('/static/login/yingye2.png');
  362. image {
  363. width: 100%;
  364. height: 100%;
  365. }
  366. }
  367. .img-border{
  368. padding: 15px 20px;
  369. }
  370. .upload {
  371. width: 100%;
  372. height: 182upx;
  373. // padding: 15px 20px;
  374. background-color: white;
  375. .imgOcr-border {
  376. position: relative;
  377. width: 48%;
  378. height: 100%;
  379. padding: 12upx;
  380. // background-color: #fff;
  381. background: url('/static/login/code3.png');
  382. // box-shadow: 0px 4px 10px 0px #DAE3F4;
  383. image {
  384. width: 100%;
  385. // border-radius: 4px;
  386. height: 100%;
  387. }
  388. }
  389. }
  390. </style>