settled.vue 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009
  1. <template>
  2. <view>
  3. <cu-custom :bgColor="title == '申请入驻' ? 'bg-gradual-blue1' : 'bg-fff'" :isBack="true">
  4. <block slot="content">{{ title }}</block>
  5. </cu-custom>
  6. <view class="progress" v-if="title == '申请入驻'">
  7. <view class="progress-style progress-bag">
  8. <view v-if="tab == 1" class="progress-icon"></view>
  9. <view v-if="tab == 2" class="progress-style progress-bag1">
  10. <view class="progress-icon1"></view>
  11. </view>
  12. <view v-if="tab == 3" class="progress-style progress-bag2">
  13. <view class="progress-icon1"></view>
  14. </view>
  15. </view>
  16. <view class="progress-title flex justify-between">
  17. <view :class="tab == '1' ? 'color' : ''">账户信息</view>
  18. <view :class="tab == '2' ? 'color' : ''">提交资料</view>
  19. <view :class="tab == '3' ? 'color' : ''">门店信息</view>
  20. </view>
  21. </view>
  22. <status v-else :status="form.status" :updateTime="form.updateTime" :remark="form.remark"></status>
  23. <view v-if="tab == 1" :class="title == '申请入驻'?'tab-top':''">
  24. <form>
  25. <view class="borderRadiu">
  26. <view class="flex cu-form-group margin-top1 ">
  27. <view class="content ">
  28. <text class="text-bold">推荐人邀请码</text>
  29. <i class="text-bg "></i>
  30. </view>
  31. </view>
  32. <view class=" cu-form-group ">
  33. <view class="title"> <span>*</span> 邀请码</view>
  34. <input placeholder="输入邀请码(选填)" v-model="form.referenceCode" name="input"></input>
  35. </view>
  36. </view>
  37. <view class="borderRadiu" style="height: 67vh;overflow-y: auto;">
  38. <view class="flex cu-form-group margin-top1">
  39. <view class="content ">
  40. <text class="text-bold">提交经营主体资料</text>
  41. <i class="text-bg"></i>
  42. </view>
  43. </view>
  44. <view class="customize">
  45. <view class="title" style="text-align: center;">营业执照</view>
  46. <view style="border-bottom: 1px solid #EEEEEE;">
  47. <view class="business-img flex align-center">
  48. <image :src="businessLicenseImg ? businessLicenseImg : '/static/login/yingyezhizhao.png'" mode=""
  49. @click="businessChange('businessLicense')">
  50. </image>
  51. </view>
  52. </view>
  53. <view class="business-prompt">
  54. 请上传营业执照照片或复印件,复印件需加盖公司公章,仅支持jpg、png格式;图片需清晰、完整、无反光、无PS、无不相关水印、非拍屏
  55. </view>
  56. </view>
  57. <view class=" cu-form-group">
  58. <view class="title">主体类型</view>
  59. <view style="display: flex;width: 74%;justify-content: space-between;" @click="showSelectLocality = true">
  60. <view style="font-size: 30rpx;">
  61. <text v-if="typeLabel"> {{ typeLabel }}</text>
  62. <text v-else style="color: grey">请选择主体类型</text>
  63. </view>
  64. <u-icon name="arrow-right" style="margin-left: 17rpx;color: #C7C6CA"></u-icon>
  65. </view>
  66. <!-- <u-select v-model="showSelectLocality" :list="selectLocality" @confirm="confirmLocality"></u-select> -->
  67. </view>
  68. <view class="cu-form-group">
  69. <view class="title">公司名称</view>
  70. <input placeholder="请输入公司名称" v-model="form.corporateName" name="input"></input>
  71. </view>
  72. <view class="cu-form-group">
  73. <view class="title">统一代码</view>
  74. <input placeholder="请输入统一社会信用代码" v-model="form.creditCode" name="input"></input>
  75. </view>
  76. <view class="cu-form-group">
  77. <view class="title">证件期限 </view>
  78. <!-- <uni-data-checkbox v-model="form.lifespan" :localdata="lifespanOption"></uni-data-checkbox> -->
  79. <radio-group @change="typeChang($event, 'lifespanType')" v-model="form.lifespanType">
  80. <label class="margin-left-sm">
  81. <radio :class="form.lifespanType == '1' ? 'checked blue' : ''"
  82. :checked="form.lifespanType == '1' ? true : false" value="1"></radio>
  83. <!-- <checkbox class=' blue' :class="form.type?'checked':''" :checked="form.type?true:false" value="1"></checkbox> -->
  84. <text class="margin-left-sm">长期有效</text>
  85. </label>
  86. <label class="margin-left-sm">
  87. <radio :class="form.lifespanType == '2' ? 'checked blue' : ''"
  88. :checked="form.lifespanType == '2' ? true : false" value="2"></radio>
  89. <text class="margin-left-sm">固定期限</text>
  90. </label>
  91. </radio-group>
  92. </view>
  93. <view class="cu-form-group" v-if="form.lifespanType == 2">
  94. <view class="title">有效期起</view>
  95. <view style="display: flex;width: 74%;justify-content: space-between;" @click="selectDate">
  96. <view style="font-size: 30rpx;">
  97. <text v-if="form.lifespanBegin"> {{ form.lifespanBegin }}--{{form.lifespanEnd}}</text>
  98. <text v-else style="color: grey">请选择</text>
  99. </view>
  100. <u-icon name="arrow-right" style="margin-left: 17rpx;color: #C7C6CA"></u-icon>
  101. </view>
  102. <rangTime ref="rangTime" :mode="mode" @onSubmit="onEndTimeChange" />
  103. </view>
  104. <view class="cu-form-group" style="display: block;">
  105. <view class="title">经营范围</view>
  106. <view class="scope" style="width: 100%;height: auto;">
  107. <u-input v-model="form.businessScope" type="textarea"
  108. style="width: 100%;min-height: 165rpx;max-height: 300rpx; background-color:#F7F8FC;padding: 0 16rpx;margin: 0;overflow-y: auto;" />
  109. </view>
  110. </view>
  111. </view>
  112. </form>
  113. </view>
  114. <view v-if="tab == 2" :class="title=='申请入驻'?'tab-top':''" :style="title == '店铺信息' ? 'margin-top: 120upx' : ''">
  115. <form>
  116. <view class="borderRadiu">
  117. <view class="flex cu-form-group margin-top1 ">
  118. <view class="content ">
  119. <text class="text-bold">法人信息</text>
  120. <i class="text-bg "></i>
  121. </view>
  122. </view>
  123. <view class="cu-form-group ">
  124. <view class="title">法人姓名</view>
  125. <input placeholder="请输入法人姓名" v-model="form.legalPerson" name="input"></input>
  126. </view>
  127. <view class="cu-form-group">
  128. <view class="title">法人证件号</view>
  129. <input placeholder="请输入法人证件号" v-model="form.legalPersonCode" name="input"></input>
  130. </view>
  131. <view class="customize">
  132. <view class="title">法人证件照片</view>
  133. <view style="padding: 16upx 0;border-bottom: 1px solid #EEEEEE;">
  134. <view class="flex upload justify-between">
  135. <view class="imgOcr-border">
  136. <image :src="identityOneImg ? identityOneImg : '/static/login/code1.png'" mode=""
  137. @click="businessChange('identityOne')"></image>
  138. </view>
  139. <view class="imgOcr-border">
  140. <image :src="identityTwoImg ? identityTwoImg : '/static/login/code2.png'" mode=""
  141. @click="businessChange('identityTwo')"></image>
  142. </view>
  143. </view>
  144. </view>
  145. <view class="business-prompt">
  146. <view>请上传中国大陆公民.身份证照片,仅支持jpg、png格式</view>
  147. <view>1、需提供与主体证照上一致的法人证件照片</view>
  148. <view>2、图片需清晰、完整、无反光、无PS、无不相关水印、非拍屏</view>
  149. <view>3、证件未过期</view>
  150. </view>
  151. </view>
  152. </view>
  153. </form>
  154. <view class="borderRadiu">
  155. <view class="flex cu-form-group margin-top1">
  156. <view class="content ">
  157. <text class="text-bold">提交门店负责人信息</text>
  158. <i class="text-bg "></i>
  159. </view>
  160. </view>
  161. <view class="cu-form-group">
  162. <view class="title">姓名</view>
  163. <input placeholder="门店负责人姓名" v-model="form.leaderName" name="input"></input>
  164. </view>
  165. <view class="cu-form-group">
  166. <view class="title">手机号</view>
  167. <input placeholder="门店负责人手机号" v-model="form.leaderPhone" name="input"></input>
  168. </view>
  169. </view>
  170. </view>
  171. <view v-if="tab == 3" :class="title == '申请入驻'?'tab-top':''" :style="title == '店铺信息' ? 'margin-top: 120upx' : ''">
  172. <form>
  173. <!-- <view class="borderRadiu">
  174. <view class="flex cu-form-group margin-top1">
  175. <view class="content ">
  176. <text class="text-bold">提交门店信息</text>
  177. <i class="text-bg "></i>
  178. </view>
  179. </view>
  180. <view class="cu-form-group">
  181. <view class="title">门店名称</view>
  182. <input placeholder="请输入门店名称" v-model="form.storeName" name="input"></input>
  183. </view>
  184. <view class="cu-form-group">
  185. <view class="title">所在地区</view>
  186. <view style="display: flex;width: 74%;justify-content: space-between;" @click="$refs.picker.show()">
  187. <view style="font-size: 30rpx;">
  188. <text v-if="form.locality"> {{ form.locality }}</text>
  189. <text v-else style="color: grey">请选择所在地区</text>
  190. </view>
  191. <u-icon name="arrow-right" style="margin-left: 17rpx;color: #C7C6CA"></u-icon>
  192. </view>
  193. </view>
  194. <view class="cu-form-group">
  195. <view class="title">门店地址</view>
  196. <input placeholder="请输入门店地址详细地址" v-model="form.address" name="input"></input>
  197. </view>
  198. </view> -->
  199. </form>
  200. </view>
  201. <view v-if="tab == 1" class="padding flex flex-direction sub-bottom">
  202. <button class="cu-btn bg-blue round " @click="tab = 2">保存并下一步</button>
  203. </view>
  204. <view v-if="tab == 2 && title == '申请入驻'" class="padding flex sub-bottom">
  205. <button class="cu-btn round line-blue shadow" @click="tab = 1">上一步</button>
  206. <button style="margin-left: 12upx;width:77%" class="cu-btn bg-blue round " @click="tab = 3">保存并下一步</button>
  207. </view>
  208. <view v-if="tab == 2 && title == '店铺信息'" class="padding flex sub-bottom" style="justify-content: space-around;">
  209. <button class="cu-btn line-gray shadow" style="width: 40%;" @click="$Router.push({ name: 'settings' })">取消</button>
  210. <button style="margin-left: 12upx;width:40%" class="cu-btn bg-blue " @click="sumbit">提交审核</button>
  211. <!-- <button style="margin-left: 12upx;width:77%" class="cu-btn line-blue round shadow" @click="tab = 3">下一页</button> -->
  212. </view>
  213. <view v-if="tab == 3" class="padding flex sub-bottom">
  214. <button class="cu-btn round line-blue shadow" @click="tab = 2">{{ title == '申请入驻' ? '上一步' : '上一页' }}</button>
  215. <button style="margin-left: 12upx;width:77%" class="cu-btn bg-blue round " @click="sumbit">提交审核</button>
  216. </view>
  217. <view class="cu-load load-modal" v-if="lodingshow">
  218. <image src="/static/logo.png" mode="aspectFit"></image>
  219. <view class="gray-text">加载中...</view>
  220. </view>
  221. <w-picker class="picker-style" :visible.sync="visible" ref="picker" mode="region" :value="form.locality"
  222. @confirm="onConfirm($event, 'region')"></w-picker>
  223. <selectType v-if="showSelectLocality" @transmitType="confirmLocality" @cutPopup="showSelectLocality = false">
  224. </selectType>
  225. </view>
  226. </template>
  227. <script>
  228. import {
  229. watch
  230. } from 'vue'
  231. import configService from '../../common/service/config.service'
  232. import regionPicker from "../../components/w-picker/region-picker.vue"
  233. import selectType from "../../components/selectType.vue"
  234. // import aMap from "./map.vue"
  235. import status from "../store/components/status.vue"
  236. import {
  237. ACCESS_TOKEN,
  238. USER_INFO
  239. } from "@/common/util/constants";
  240. import * as $p from "@/uni_modules/uni-easyinput/components/uni-easyinput/common";
  241. import rangTime from '../../components/dengrq-datetime-picker/dateSelector/index.vue'
  242. export default {
  243. components: {
  244. regionPicker,
  245. status,
  246. rangTime,
  247. selectType
  248. // aMap
  249. },
  250. data() {
  251. return {
  252. imageList: [],
  253. mapIsHidden: false,
  254. latitude: 37.827066,
  255. longitude: 112.34988,
  256. // latitude: null, // 默认中心纬度(例如北京)
  257. // longitude: null, // 默认中心经度
  258. marker: [], // 初始为空数组
  259. title: '申请入驻',
  260. lodingshow: false,
  261. form: {
  262. name: null,
  263. type: 1,
  264. corporateName: null,
  265. creditCode: null,
  266. lifespanType: 1,
  267. // lifespanBegin: this.timestampToTime(),
  268. // lifespanEnd: '9999-12-31',
  269. lifespanBegin: null,
  270. lifespanEnd: null,
  271. businessLicense: null,
  272. legalPerson: null,
  273. legalPersonCode: null,
  274. storeName: null,
  275. country: null,
  276. locality: '',
  277. address: null,
  278. headPhoto: '',
  279. passWord: uni.getStorageSync('password'),
  280. phone: uni.getStorageSync('phone'),
  281. ordinaryUserId: null,
  282. },
  283. formName: {
  284. // name: '姓名',
  285. type: '主体类型',
  286. corporateName: '公司名称',
  287. creditCode: '统一代码',
  288. lifespanType: '有效期',
  289. // headPhoto: '门头照片',
  290. legalPerson: '法人姓名',
  291. legalPersonCode: '法人证件号',
  292. storeName: '门店名称',
  293. locality: '所在地区',
  294. address: '门店地址',
  295. businessLicense: '营业执照',
  296. businessScope: '经营范围',
  297. leaderName: '负责人姓名',
  298. leaderPhone: '负责人手机号'
  299. },
  300. tab: 1,
  301. supplierOption: [],
  302. businessLicenseImg: '',
  303. identityOneImg: '',
  304. identityTwoImg: '',
  305. visible: false,
  306. index: -1,
  307. // markers:[{
  308. // latitude: 37.827066,
  309. // longitude: 112.34988,
  310. // iconPath: '../../static/avatar_girl.png'
  311. // }]
  312. markers: [],
  313. headPhotoImg: [],
  314. loginType: '',
  315. showSelectLocality: false, //选择主体类型弹窗显隐
  316. mode: 1,
  317. typeLabel: ''
  318. }
  319. },
  320. watch: {
  321. visible(val) {
  322. if (!val) {
  323. this.mapIsHidden = 'block'
  324. }
  325. }
  326. },
  327. computed() {
  328. },
  329. onShow() {
  330. this.getCurrentLocation();
  331. this.markers = uni.getStorageSync('address') ? [Object.assign(uni.getStorageSync('address'), {
  332. iconPath: '../../static/boiaoji.png'
  333. })] : []
  334. },
  335. async onLoad(data) {
  336. if (data.loginType) {
  337. // data.loginType =2 需要根据merchantId查询商户临时数据
  338. // data.loginType =3 不需要回显
  339. this.loginType = data.loginType;
  340. if (data.loginType === '3') {
  341. this.form.ordinaryUserId = data.ordinaryUserId;
  342. this.form.name = (data.name == null || data.name == 'null') ? "" : data.name,
  343. this.form.passWord = data.passWord;
  344. this.form.phone = data.phone;
  345. }
  346. } else {
  347. if (data.params) {
  348. let obj = JSON.parse(decodeURIComponent(data.params));
  349. console.log(obj)
  350. this.title = '店铺信息'
  351. this.tab = 2
  352. obj.lifespanType = obj.lifespanType ? obj.lifespanType : '1'
  353. this.markers = this.form.longitude && this.form.latitude ? [{
  354. longitude: this.form.longitude,
  355. latitude: this.form.latitude,
  356. iconPath: '../../static/boiaoji.png'
  357. }] : []
  358. this.businessLicenseImg = configService.apiUrl + '/' + obj.businessLicense
  359. this.identityOneImg = obj.identityOne
  360. this.identityTwoImg = obj.identityTwo
  361. console.log(this.identityOneImg)
  362. this.headPhotoImg = obj.headPhoto ? obj.headPhoto.split(',').filter(id => id !== '') : []
  363. obj.headPhoto = obj.headPhoto ? obj.headPhoto.split(',').filter(id => id !== '') : []
  364. obj.locality = obj.locality ? obj.locality : ''
  365. this.form = obj
  366. }
  367. }
  368. },
  369. methods: {
  370. //选择主题类型
  371. confirmLocality(data) {
  372. this.form.type = data.value
  373. this.typeLabel = data.label
  374. this.showSelectLocality = false
  375. },
  376. //选择证件有效时间
  377. onEndTimeChange(val) {
  378. console.log(val)
  379. this.form.lifespanBegin = val.startDate
  380. this.form.lifespanEnd = val.endDate
  381. this.$forceUpdate(); // 强制刷新视图
  382. },
  383. //选择时间显示
  384. selectDate() {
  385. // this.isSelectDate = true
  386. this.$refs.rangTime.open()
  387. },
  388. getCurrentLocation() {
  389. uni.getStorage({
  390. key: 'currentAddress',
  391. success: (res) => {
  392. if (res.data && res.data.location) {
  393. let temp = res.data.location.split(',');
  394. this.latitude = temp[1];
  395. this.longitude = temp[0];
  396. this.marker = [{
  397. id: 0,
  398. latitude: temp[1],
  399. longitude: temp[0],
  400. title: res.data.name || '当前位置',
  401. iconPath: '../../static/boiaoji.png',
  402. width: 30,
  403. height: 30,
  404. callout: { // 添加标注说明
  405. content: res.data.name || '当前位置',
  406. color: '#000',
  407. fontSize: 12,
  408. borderRadius: 10,
  409. bgColor: '#fff',
  410. padding: 5,
  411. display: 'ALWAYS'
  412. }
  413. }];
  414. this.$forceUpdate();
  415. }
  416. },
  417. fail: () => {
  418. // 如果没有存储的位置,可以设置默认位置
  419. this.setDefaultLocation();
  420. }
  421. });
  422. },
  423. setDefaultLocation() {
  424. let that = this
  425. uni.getLocation({
  426. type: 'gcj02',
  427. success: function(res) {
  428. that.latitude = res.latitude;
  429. that.longitude = res.longitude;
  430. that.marker = [{
  431. id: 0,
  432. latitude: that.latitude,
  433. longitude: that.longitude,
  434. title: '默认位置',
  435. iconPath: '../../static/boiaoji.png',
  436. width: 30,
  437. height: 30
  438. }];
  439. },
  440. fail() {
  441. }
  442. });
  443. },
  444. handleMarkerTap() {
  445. const queryString = uni.getStorageSync('address') ? encodeURIComponent(JSON.stringify(uni.getStorageSync(
  446. 'address'))) : ''
  447. uni.navigateTo({
  448. url: `/pages/login/map?position=${queryString}`
  449. // url:'/pages/login/map'
  450. })
  451. },
  452. getFile(e) {
  453. let path = ''
  454. uni.uploadFile({
  455. url: configService.apiUrl + '/sys/common/upload',
  456. filePath: e,
  457. name: "file",
  458. formData: {
  459. 'biz': 'temp',
  460. },
  461. success: (files) => {
  462. let data = JSON.parse(files.data);
  463. if (data.success) {
  464. path = res.tempFilePaths
  465. }
  466. }
  467. })
  468. console.log(path, 88);
  469. return path
  470. },
  471. uploadAll() {
  472. if (this.imageList.length === 0) {
  473. uni.showToast({
  474. title: '请先选择图片',
  475. icon: 'none'
  476. });
  477. return;
  478. }
  479. uni.showLoading({
  480. title: '上传中...',
  481. mask: true
  482. });
  483. const uploadPromises = this.imageList.map((path, index) => {
  484. return new Promise((resolve, reject) => {
  485. uni.uploadFile({
  486. url: configService.apiUrl + '/sys/common/upload', // 替换为实际接口
  487. filePath: path,
  488. formData: {
  489. 'biz': 'temp',
  490. },
  491. name: 'file',
  492. success: (files) => {
  493. resolve(configService.apiUrl + '/' + JSON.parse(files.data).message)
  494. },
  495. fail: reject
  496. });
  497. });
  498. });
  499. Promise.all(uploadPromises)
  500. .then(results => {
  501. uni.hideLoading();
  502. this.imageList = []; // 清空已上传列表
  503. this.headPhotoImg = this.headPhotoImg.concat(results)
  504. this.form.headPhoto = this.form.headPhoto.concat(results)
  505. })
  506. .catch(error => {
  507. uni.hideLoading();
  508. });
  509. },
  510. ChooseImage() {
  511. uni.chooseImage({
  512. count: 5 - Number(this.headPhotoImg.length),
  513. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  514. sourceType: ['album'], //从相册选择
  515. success: (res) => {
  516. if (res) {
  517. this.imageList = [...this.imageList, ...res.tempFilePaths];
  518. this.uploadAll()
  519. }
  520. }
  521. });
  522. },
  523. ViewImage(e) {
  524. uni.previewImage({
  525. urls: this.headPhotoImg,
  526. current: e.currentTarget.dataset.url
  527. });
  528. },
  529. DelImg(e) {
  530. uni.showModal({
  531. title: '提示',
  532. content: '确定要删除?',
  533. cancelText: '取消',
  534. confirmText: '确定',
  535. success: res => {
  536. if (res.confirm) {
  537. this.headPhotoImg.splice(e.currentTarget.dataset.index, 1)
  538. this.form.headPhoto.splice(e.currentTarget.dataset.index, 1)
  539. }
  540. }
  541. })
  542. },
  543. onConfirm(e) {
  544. this.mapIsHidden = false
  545. this.form.locality = e.result
  546. this.form.country = e.value[e.value.length - 1]
  547. },
  548. PickerChange(e) {
  549. this.form.purveyorId = this.supplierOption[e.detail.value].id
  550. },
  551. typeChang(e, val) {
  552. this.form[val] = e.detail.value
  553. },
  554. async businessChange(type) {
  555. let [chooseImageErr, chooseImageRes] = await uni.chooseImage({
  556. count: 1,
  557. sizeType: ['compressed']
  558. });
  559. let size = chooseImageRes.tempFiles[0].size / 1024 / 1024 < 5;
  560. if (!size) {
  561. this.$refs.uToast.show({
  562. title: '上传图片大小不能超过 5MB!',
  563. type: 'error',
  564. })
  565. return false
  566. }
  567. if (chooseImageRes) {
  568. this.lodingshow = true;
  569. // this.$tip.loading()
  570. this[type + 'Img'] = chooseImageRes.tempFilePaths[0];
  571. uni.uploadFile({
  572. url: configService.apiUrl + '/sys/common/upload',
  573. filePath: chooseImageRes.tempFilePaths[0],
  574. name: "file",
  575. formData: {
  576. 'biz': 'temp',
  577. },
  578. success: (files) => {
  579. let data = JSON.parse(files.data);
  580. if (data.success) {
  581. this.form[type] = data.message
  582. if (type == 'businessLicense' || type == 'identityOne') {
  583. uni.uploadFile({
  584. url: configService.apiUrl +
  585. `${type == 'businessLicense' ? '/order/identify/businessLicense' : '/order/identify/idCard'}`,
  586. filePath: chooseImageRes.tempFilePaths[0],
  587. name: "image1",
  588. success: (uploadFileRes) => {
  589. let data1 = JSON.parse(uploadFileRes.data).result;
  590. let obj = {}
  591. if (type == 'businessLicense') {
  592. obj = {
  593. corporateName: data1.company ? data1.company : '', //公司名称
  594. creditCode: data1.socialCreditCode ? data1.socialCreditCode : '', //统一社会信用代码
  595. businessScope: data1.businessScope ? data1.businessScope : '', //经营范围
  596. lifespanBegin: data1.registerDate ? data1.registerDate.substr(0,
  597. 4) + '-' + data1.registerDate.substr(5, 2) + '-' + data1.registerDate
  598. .substr(8, 2) : '',
  599. lifespanEnd: data1.effectiveDate && data1.effectiveDate.includes('年') ? data1
  600. .effectiveDate.substr(0,
  601. 4) + '-' + data1.effectiveDate.substr(5, 2) + '-' + data1.effectiveDate
  602. .substr(8, 2) : '9999-12-31',
  603. lifespanType: data1.registerDate || data1.effectiveDate ? '2' : '1',
  604. }
  605. } else {
  606. obj = {
  607. legalPerson: data1.customerInfo.name ? data1.customerInfo.name : '', //法人姓名
  608. legalPersonCode: data1.customerInfo.identifyNumber ? data1.customerInfo
  609. .identifyNumber : '', //法人证件号
  610. }
  611. }
  612. this.$nextTick(() => {
  613. this.form = {
  614. ...this.form,
  615. ...obj,
  616. }
  617. // this.$set(this.form, obj);
  618. // this.form=Object.assign(this.form,obj)
  619. console.log(obj, this.form, 88888);
  620. })
  621. this.lodingshow = false;
  622. }
  623. });
  624. } else {
  625. this.lodingshow = false;
  626. }
  627. }
  628. }
  629. });
  630. } else {
  631. this.lodingshow = false;
  632. }
  633. },
  634. timestampToTime(timestamp) {
  635. // let date = new Date(timestamp * 1000);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
  636. let date = new Date(new Date()); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
  637. let Y = date.getFullYear() + '-';
  638. let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
  639. let D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + ' ';
  640. return Y + M + D;
  641. },
  642. sumbit() {
  643. if (this.title == '申请入驻') {
  644. if (this.loginType) {
  645. if (this.loginType === '3') {
  646. //普通用户没有商户新增
  647. for (let j in this.form) {
  648. console.log(j)
  649. console.log(this.form[j])
  650. console.log(this.formName[j])
  651. if (!this.form[j]) {
  652. if (this.form['lifespanType'] == 2 && (this.form['lifespanBegin'] == null || this.form[
  653. 'lifespanEnd'] ==
  654. null)) {
  655. // this.$tip.alert('请选择日期!')
  656. uni.showToast({
  657. icon: 'none',
  658. title: '请选择日期!'
  659. })
  660. return
  661. }
  662. if (this.form['businessLicense'] == null) {
  663. // this.$tip.alert('请上传营业执照!')
  664. uni.showToast({
  665. icon: 'none',
  666. title: '请上传营业执照!'
  667. })
  668. return
  669. }
  670. if (this.formName[j]) {
  671. // this.$tip.alert(`请填写${this.formName[j]}!`)
  672. uni.showToast({
  673. icon: 'none',
  674. title: `请填写${this.formName[j]}!`
  675. })
  676. return
  677. }
  678. }
  679. }
  680. let data = {
  681. ...this.form,
  682. source: 2,
  683. headPhoto: Array.isArray(this.form.headPhoto) ? this.form.headPhoto.join(',') : this.form.headPhoto,
  684. longitude: this.markers.length > 0 ? this.markers[0].longitude : '',
  685. latitude: this.markers.length > 0 ? this.markers[0].latitude : ''
  686. }
  687. this.$http.post('/merchant/app/add', data).then(res => {
  688. if (res.data.code == 200) {
  689. //放入session
  690. const result = res.data.result
  691. const userInfo = result.userInfo
  692. uni.setStorageSync(ACCESS_TOKEN, result.token);
  693. uni.setStorageSync(USER_INFO, userInfo);
  694. this.$store.commit('SET_TOKEN', result.token)
  695. this.$store.commit('SET_NAME', {
  696. username: userInfo.username,
  697. realname: userInfo.realname
  698. })
  699. this.$store.commit('SET_AVATAR', userInfo.avatar)
  700. // #ifdef APP-PLUS
  701. uni.switchTab({
  702. url: '/pages/index/index'
  703. })
  704. // #endif
  705. // #ifndef APP-PLUS
  706. // this.$tip.success('登录成功!')
  707. uni.showToast({
  708. icon: 'none',
  709. title: '登录成功'
  710. })
  711. this.$Router.replaceAll({
  712. name: 'index'
  713. })
  714. // #endif
  715. } else {
  716. // this.$tip.error(res.data.message);
  717. uni.showToast({
  718. icon: 'none',
  719. title: res.data.message
  720. })
  721. }
  722. })
  723. }
  724. }
  725. } else {
  726. // this.form.identityOne = configService.apiUrl+'/'+this.form.identityOne
  727. // this.form.identityTwo = configService.apiUrl+'/'+this.form.identityTwo
  728. const isHttpOrHttpsone = /^https?:\/\//.test(this.form.identityOne)
  729. const isHttpOrHttpstwo = /^https?:\/\//.test(this.form.identityOne)
  730. if(!isHttpOrHttpsone){
  731. this.form.identityOne = configService.apiUrl+'/'+this.form.identityOne
  732. }
  733. if(!isHttpOrHttpstwo){
  734. this.form.identityTwo = configService.apiUrl+'/'+this.form.identityTwo
  735. }
  736. let data = {
  737. ...this.form,
  738. source: 2,
  739. headPhoto: Array.isArray(this.form.headPhoto) ? this.form.headPhoto.join(',') : this.form.headPhoto,
  740. // longitude: this.markers.length > 0 ? this.markers[0].longitude : '',
  741. // latitude: this.markers.length > 0 ? this.markers[0].latitude : ''
  742. }
  743. // this.$http.post('/merchant/localMerchantInfo/edit', data).then(res => {
  744. this.$http.post('/merchant/localMerchantInfo/editMerchantInfo', data).then(res => {
  745. console.log(res)
  746. if (res.data.success) {
  747. // this.$tip.success(res.data.result || '成功')
  748. uni.showToast({
  749. icon: 'none',
  750. title: res.data.result || '成功'
  751. })
  752. uni.navigateBack({
  753. delta: 1 // 返回的页面数,默认为1
  754. })
  755. } else {
  756. // this.$tip.error(res.data.message);
  757. uni.showToast({
  758. icon: 'none',
  759. title: res.data.message
  760. })
  761. }
  762. })
  763. }
  764. }
  765. }
  766. }
  767. </script>
  768. <style scoped lang="scss">
  769. page {
  770. background: #F8F8FA;
  771. }
  772. .cu-form-group .title {
  773. width: 154rpx;
  774. padding: 0;
  775. span {
  776. color: red;
  777. }
  778. }
  779. .cu-bg {
  780. background: linear-gradient(180deg, #D6E9FF 0%, #FFFFFF 100%);
  781. }
  782. .tab-top {
  783. margin-top: 78upx;
  784. padding: 26upx;
  785. }
  786. .borderRadiu {
  787. height: auto;
  788. border-radius: 8px;
  789. padding-bottom: 10px;
  790. background-color: #ffffff;
  791. // border-bottom: 1px solid #eee;
  792. }
  793. .sub-bottom {
  794. position: fixed;
  795. width: 100%;
  796. bottom: 0;
  797. background: #FFFFFF;
  798. border-top: 1px solid #EEEEEE;
  799. }
  800. .progress-status {
  801. position: fixed;
  802. width: 100%;
  803. z-index: 9999;
  804. padding: 26upx 42upx;
  805. background: #FFFFFF;
  806. .status {
  807. font-size: 38upx;
  808. color: #F6863E;
  809. font-weight: 500;
  810. margin-bottom: 10upx;
  811. text {
  812. margin-left: 5upx
  813. }
  814. image {
  815. vertical-align: text-top;
  816. width: 42upx;
  817. height: 42upx;
  818. }
  819. }
  820. }
  821. .progress {
  822. position: fixed;
  823. height: 96upx;
  824. width: 100%;
  825. z-index: 9999;
  826. background: #FFFFFF;
  827. padding: 20upx 30upx;
  828. .progress-title {
  829. margin-top: 16upx;
  830. font-size: 24upx;
  831. color: #999999;
  832. .color {
  833. color: #333333;
  834. }
  835. }
  836. .progress-style {
  837. width: 100%;
  838. height: 10upx;
  839. border-radius: 5px 5px 5px 5px;
  840. }
  841. .progress-bag {
  842. position: relative;
  843. background: rgba(68, 154, 255, 0.05);
  844. .progress-icon {
  845. position: absolute;
  846. margin-top: -1px;
  847. width: 12upx;
  848. height: 12upx;
  849. background: #449AFF;
  850. border-radius: 50%;
  851. box-shadow: 0px 0px 0px 7upx rgba(68, 154, 255, 0.3);
  852. }
  853. .progress-icon1 {
  854. position: absolute;
  855. margin-top: -1px;
  856. width: 12upx;
  857. height: 12upx;
  858. background: #449AFF;
  859. border-radius: 50%;
  860. left: 99%;
  861. box-shadow: 0px 0px 0px 7upx rgba(68, 154, 255, 0.3);
  862. }
  863. .progress-bag1 {
  864. width: 50%;
  865. position: absolute;
  866. background: rgba(68, 154, 255, 0.8);
  867. }
  868. .progress-bag2 {
  869. position: absolute;
  870. background: rgba(68, 154, 255, 0.8);
  871. }
  872. }
  873. }
  874. .customize {
  875. background-color: #fff;
  876. // border-top: 0.5px solid #eee;
  877. margin: 16upx 18upx;
  878. .title {
  879. font-size: 30upx;
  880. // padding: 10px;
  881. }
  882. .business-img {
  883. height: 218upx;
  884. width: 360upx;
  885. padding: 16upx;
  886. // padding-bottom: 16upx;
  887. background: url('/static/login/yingye2.png');
  888. margin: 16upx auto;
  889. background-size: cover;
  890. image {
  891. width: 100%;
  892. height: 100%;
  893. }
  894. }
  895. .business-prompt {
  896. padding-top: 16upx;
  897. font-size: 20upx;
  898. color: #999999;
  899. }
  900. }
  901. .booder-top {
  902. border-bottom: 1px solid rgb(238, 238, 238);
  903. padding-top: 7px;
  904. }
  905. .img-border {
  906. padding: 15px 20px;
  907. }
  908. .upload {
  909. width: 100%;
  910. height: 188upx;
  911. // padding: 15px 20px;
  912. background-color: white;
  913. .imgOcr-border {
  914. position: relative;
  915. width: 48%;
  916. height: 100%;
  917. padding: 12upx;
  918. // background-color: #fff;
  919. background: url('/static/login/code3.png');
  920. background-size: cover;
  921. // box-shadow: 0px 4px 10px 0px #DAE3F4;
  922. image {
  923. width: 100%;
  924. // border-radius: 4px;
  925. height: 100%;
  926. }
  927. }
  928. }
  929. .picker-style {
  930. .w-picker-cnt .visible {
  931. position: absolute;
  932. z-index: 100000;
  933. }
  934. }
  935. ::v-deep .cu-form-group uni-textarea {
  936. margin: 0;
  937. }
  938. </style>