settled.vue 36 KB

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