settled.vue 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855
  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="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">供应商</view>
  34. <picker @change="PickerChange" :value="form.purveyorId" range-key="purveyorName"
  35. :range="supplierOption">
  36. <view class="picker" v-if="form.purveyorId">
  37. {{ supplierOption.find(e => e.id == form.purveyorId).purveyorName }}
  38. </view>
  39. <view class="picker" v-else style="color: #999999;">
  40. 请选择
  41. </view>
  42. </picker>
  43. </view>
  44. </view> -->
  45. <view class="borderRadiu">
  46. <view class="flex cu-form-group margin-top1 ">
  47. <view class="content ">
  48. <text class="text-bold">账户信息</text>
  49. <i class="text-bg "></i>
  50. </view>
  51. </view>
  52. <view class=" cu-form-group ">
  53. <view class="title">姓名</view>
  54. <input placeholder="请输入联系人姓名" v-model="form.name" name="input"></input>
  55. </view>
  56. </view>
  57. </form>
  58. </view>
  59. <view v-if="tab == 2" class="tab-top" :style="title == '店铺信息' ? 'margin-top: 120upx' : ''">
  60. <form>
  61. <view class="borderRadiu">
  62. <view class="flex cu-form-group margin-top1">
  63. <view class="content ">
  64. <text class="text-bold">提交经营主体资料</text>
  65. <i class="text-bg "></i>
  66. </view>
  67. </view>
  68. <view class=" cu-form-group">
  69. <view class="title">主体类型</view>
  70. <!-- <uni-data-checkbox v-model="form.type" :localdata="hobby"></uni-data-checkbox> -->
  71. <radio-group @change="typeChang($event, 'type')" v-model="form.type">
  72. <label class="margin-left-sm">
  73. <radio :class="form.type == '1' ? 'checked blue' : ''"
  74. :checked="form.type == '1' ? true : false" value="1"></radio>
  75. <!-- <checkbox class=' blue' :class="form.type?'checked':''" :checked="form.type?true:false" value="1"></checkbox> -->
  76. <text class="margin-left-sm">普通企业</text>
  77. </label>
  78. <label class="margin-left-sm">
  79. <radio :class="form.type == '2' ? 'checked blue' : ''"
  80. :checked="form.type == '2' ? true : false" value="2"></radio>
  81. <text class="margin-left-sm">个体工商户</text>
  82. </label>
  83. </radio-group>
  84. </view>
  85. <view class="cu-form-group">
  86. <view class="title">公司名称</view>
  87. <input placeholder="请输入公司名称" v-model="form.corporateName" name="input"></input>
  88. </view>
  89. <view class="cu-form-group">
  90. <view class="title">统一代码</view>
  91. <input placeholder="请输入统一社会信用代码" v-model="form.creditCode" name="input"></input>
  92. </view>
  93. <view class="cu-form-group">
  94. <view class="title">有效期 </view>
  95. <!-- <uni-data-checkbox v-model="form.lifespan" :localdata="lifespanOption"></uni-data-checkbox> -->
  96. <radio-group @change="typeChang($event, 'lifespanType')" v-model="form.lifespanType">
  97. <label class="margin-left-sm">
  98. <radio :class="form.lifespanType == '1' ? 'checked blue' : ''"
  99. :checked="form.lifespanType == '1' ? true : false" value="1"></radio>
  100. <!-- <checkbox class=' blue' :class="form.type?'checked':''" :checked="form.type?true:false" value="1"></checkbox> -->
  101. <text class="margin-left-sm">长期有效</text>
  102. </label>
  103. <label class="margin-left-sm">
  104. <radio :class="form.lifespanType == '2' ? 'checked blue' : ''"
  105. :checked="form.lifespanType == '2' ? true : false" value="2"></radio>
  106. <text class="margin-left-sm">固定期限</text>
  107. </label>
  108. </radio-group>
  109. <!-- <radio-group @change="typeChang($event, 'lifespan')" v-model="form.lifespan">
  110. <label class="margin-left-sm">
  111. <radio class="blue radio" value="1" checked></radio>
  112. <text class="margin-left-sm">长期有效</text>
  113. </label>
  114. <label class="margin-left-sm">
  115. <radio class="blue radio" value="2"></radio>
  116. <text class="margin-left-sm">固定期限</text>
  117. </label>
  118. </radio-group> -->
  119. </view>
  120. <view class="cu-form-group" v-if="form.lifespanType == 2">
  121. <view class="title">有效期起</view>
  122. <picker mode="date" :value="form.lifespanBegin" @change="typeChang($event, 'lifespanBegin')">
  123. <view class="picker" v-if="form.lifespanBegin">
  124. {{ form.lifespanBegin }}
  125. </view>
  126. <view class="picker" v-else style="color: #999999;">
  127. 请选择
  128. </view>
  129. </picker>
  130. </view>
  131. <view class="cu-form-group" v-if="form.lifespanType == 2">
  132. <view class="title">有效期止</view>
  133. <picker mode="date" :value="form.lifespanEnd" @change="typeChang($event, 'lifespanEnd')">
  134. <view class="picker" v-if="form.lifespanEnd">
  135. {{ form.lifespanEnd }}
  136. </view>
  137. <view class="picker" v-else style="color: #999999;">
  138. 请选择
  139. </view>
  140. </picker>
  141. </view>
  142. <view class="customize">
  143. <view class="title">营业执照</view>
  144. <view style="border-bottom: 1px solid #EEEEEE;">
  145. <view class="business-img flex align-center">
  146. <image
  147. :src="businessLicenseImg ? businessLicenseImg : '/static/login/yingyezhizhao.png'"
  148. mode="" @click="businessChange('businessLicense')">
  149. </image>
  150. </view>
  151. </view>
  152. <view class="business-prompt">
  153. 请上传营业执照照片或复印件,复印件需加盖公司公章,仅支持jpg、png格式;图片需清晰、完整、无反光、无PS、无不相关水印、非拍屏
  154. </view>
  155. </view>
  156. </view>
  157. <view class="borderRadiu" style="margin-bottom: 114upx;">
  158. <view class="flex cu-form-group margin-top1 ">
  159. <view class="content ">
  160. <text class="text-bold">法人信息</text>
  161. <i class="text-bg "></i>
  162. </view>
  163. </view>
  164. <view class="cu-form-group ">
  165. <view class="title">法人姓名</view>
  166. <input placeholder="请输入法人姓名" v-model="form.legalPerson" name="input"></input>
  167. </view>
  168. <view class="cu-form-group">
  169. <view class="title">法人证件号</view>
  170. <input placeholder="请输入法人证件号" v-model="form.legalPersonCode" name="input"></input>
  171. </view>
  172. <view class="customize">
  173. <view class="title">法人证件照片</view>
  174. <view style="padding: 16upx 0;border-bottom: 1px solid #EEEEEE;">
  175. <view class="flex upload justify-between">
  176. <view class="imgOcr-border">
  177. <image :src="identityOneImg ? identityOneImg : '/static/login/code1.png'" mode=""
  178. @click="businessChange('identityOne')"></image>
  179. </view>
  180. <view class="imgOcr-border">
  181. <image :src="identityTwoImg ? identityTwoImg : '/static/login/code2.png'" mode=""
  182. @click="businessChange('identityTwo')"></image>
  183. </view>
  184. </view>
  185. </view>
  186. <view class="business-prompt">
  187. <view>请上传中国大陆公民.身份证照片,仅支持jpg、png格式</view>
  188. <view>1、需提供与主体证照上一致的法人证件照片</view>
  189. <view>2、图片需清晰、完整、无反光、无PS、无不相关水印、非拍屏</view>
  190. <view>3、证件未过期</view>
  191. </view>
  192. </view>
  193. </view>
  194. </form>
  195. </view>
  196. <view v-if="tab == 3" class="tab-top" :style="title == '店铺信息' ? 'margin-top: 120upx' : ''">
  197. <form>
  198. <view class="borderRadiu" style="margin-bottom: 114upx;">
  199. <view class="flex cu-form-group margin-top1">
  200. <view class="content ">
  201. <text class="text-bold">提交门店信息</text>
  202. <i class="text-bg "></i>
  203. </view>
  204. </view>
  205. <view class="cu-form-group">
  206. <view class="title">门店名称</view>
  207. <input placeholder="请输入门店名称" v-model="form.storeName" name="input"></input>
  208. </view>
  209. <view class="cu-form-group">
  210. <view class="title">所在地区</view>
  211. <view style="display: flex;width: 74%;justify-content: space-between;"
  212. @click="$refs.picker.show()">
  213. <!-- <u-input readonly placeholder="去设置" v-model="form.locality" @click="$refs.picker.show()" /> -->
  214. <view style="font-size: 30rpx;">
  215. <text v-if="form.locality"> {{ form.locality }}</text>
  216. <text v-else style="color: grey">请选择所在地区</text>
  217. </view>
  218. <u-icon name="arrow-right" style="margin-left: 17rpx;color: #C7C6CA"></u-icon>
  219. </view>
  220. <!-- <input disabled="true" @mousedown="$refs.picker.show()" placeholder="请选择所在地区" ref="inputRef"
  221. name="input" v-model="form.locality"></input>
  222. <text class='cuIcon-right' style="color: #C7C6CA ;" @click="$refs.picker.show();mapIsHidden='none'"></text> -->
  223. </view>
  224. <view class="cu-form-group">
  225. <view class="title">门店地址</view>
  226. <input placeholder="请输入门店地址详细地址" v-model="form.address" name="input"></input>
  227. </view>
  228. <view class="customize">
  229. <view class="title">地理位置</view>
  230. <view class=" booder-top" style="padding-bottom: 16upx" :style="{ 'display': mapIsHidden }">
  231. <map style="width: 100%; height: 218upx;" :latitude="latitude" scale="14" zIndex="100"
  232. :longitude="longitude" :markers="markers" @tap="handleMarkerTap"></map>
  233. </view>
  234. <!-- <aMap class=" booder-top" style="padding-bottom: 7px;"></aMap> -->
  235. <view class="business-prompt">
  236. 若位置有误直接影响客户到店,请在地图中仔细核对,可拖拽地图确保位置正确
  237. </view>
  238. </view>
  239. <view class="customize">
  240. <view class="title">门头照片</view>
  241. <view class="grid col-3 grid-square flex-sub booder-top">
  242. <view class="bg-img" v-for="(item, index) in headPhotoImg" :key="index" @tap="ViewImage"
  243. :data-url="headPhotoImg[index]">
  244. <image :src="headPhotoImg[index]" mode="aspectFill"></image>
  245. <view class="cu-tag bg-red" @tap.stop="DelImg" :data-index="index">
  246. <text class='cuIcon-close'></text>
  247. </view>
  248. </view>
  249. <view class="solids" @tap="ChooseImage" v-if="headPhotoImg.length <= 4">
  250. <text class='cuIcon-cameraadd'></text>
  251. </view>
  252. </view>
  253. <view class="business-prompt">
  254. 门店照片需包含完整的门店入口和招牌名称,建议现场拍摄门头照;最多可上传5张,支持格式bmp、png、jpeg、jpg,单个图片不超过5MB,建议尺寸在2000*1500px以上
  255. </view>
  256. </view>
  257. </view>
  258. </form>
  259. </view>
  260. <view v-if="tab == 1" class="padding flex flex-direction sub-bottom">
  261. <button class="cu-btn bg-blue round " @click="tab = 2">保存并下一步</button>
  262. </view>
  263. <view v-if="tab == 2 && title == '申请入驻'" class="padding flex sub-bottom">
  264. <button class="cu-btn round line-blue shadow" @click="tab = 1">上一步</button>
  265. <button style="margin-left: 12upx;width:77%" class="cu-btn bg-blue round " @click="tab = 3">保存并下一步</button>
  266. </view>
  267. <view v-if="tab == 2 && title == '店铺信息'" class="padding flex sub-bottom">
  268. <button class="cu-btn round line-gray shadow" @click="$Router.push({ name: 'settings' })">取消</button>
  269. <button style="margin-left: 12upx;width:77%" class="cu-btn line-blue round shadow"
  270. @click="tab = 3">下一页</button>
  271. </view>
  272. <view v-if="tab == 3" class="padding flex sub-bottom">
  273. <button class="cu-btn round line-blue shadow" @click="tab = 2">{{ title == '申请入驻' ? '上一步' : '上一页'
  274. }}</button>
  275. <button style="margin-left: 12upx;width:77%" class="cu-btn bg-blue round " @click="sumbit">提交审核</button>
  276. </view>
  277. <view class="cu-load load-modal" v-if="lodingshow">
  278. <image src="/static/logo.png" mode="aspectFit"></image>
  279. <view class="gray-text">加载中...</view>
  280. </view>
  281. <w-picker class="picker-style" :visible.sync="visible" ref="picker" mode="region" :value="form.locality"
  282. @confirm="onConfirm($event, 'region')"></w-picker>
  283. </view>
  284. </template>
  285. <script>
  286. import { watch } from 'vue'
  287. import configService from '../../common/service/config.service'
  288. import regionPicker from "../../components/w-picker/region-picker.vue"
  289. // import aMap from "./map.vue"
  290. import status from "../store/components/status.vue"
  291. export default {
  292. components: {
  293. regionPicker, status
  294. // aMap
  295. },
  296. data() {
  297. return {
  298. imageList: [],
  299. mapIsHidden: false,
  300. latitude: 37.827066,
  301. longitude: 112.34988,
  302. title: '申请入驻',
  303. lodingshow: false,
  304. form: {
  305. name: null,
  306. type: 1,
  307. corporateName: null,
  308. creditCode: null,
  309. lifespanType: 1,
  310. lifespanBegin: this.timestampToTime(),
  311. lifespanEnd: '9999-12-31',
  312. businessLicense: null,
  313. legalPerson: null,
  314. legalPersonCode: null,
  315. storeName: null,
  316. country: null,
  317. locality: '',
  318. address: null,
  319. headPhoto: '',
  320. passWord: uni.getStorageSync('password'),
  321. phone: uni.getStorageSync('phone'),
  322. },
  323. formName: {
  324. headPhoto: '门头照片',
  325. name: '姓名',
  326. corporateName: '公司名称',
  327. creditCode: '统一代码',
  328. legalPerson: '法人姓名',
  329. legalPersonCode: '法人证件号',
  330. storeName: '门店名称',
  331. locality: '所在地区',
  332. address: '门店地址',
  333. },
  334. tab: 1,
  335. supplierOption: [],
  336. businessLicenseImg: '',
  337. identityOneImg: '',
  338. identityTwoImg: '',
  339. visible: false,
  340. index: -1,
  341. // markers:[{
  342. // latitude: 37.827066,
  343. // longitude: 112.34988,
  344. // iconPath: '../../static/avatar_girl.png'
  345. // }]
  346. markers: [],
  347. headPhotoImg: [],
  348. }
  349. },
  350. watch: {
  351. visible(val) {
  352. if (!val) {
  353. this.mapIsHidden = 'block'
  354. }
  355. }
  356. },
  357. onShow() {
  358. this.markers = uni.getStorageSync('address') ?
  359. [Object.assign(uni.getStorageSync('address'), { iconPath: '../../static/boiaoji.png' })]
  360. : []
  361. },
  362. async onLoad(data) {
  363. if (data.params) {
  364. let obj = JSON.parse(decodeURIComponent(data.params));
  365. this.title = '店铺信息'
  366. this.tab = 2
  367. obj.lifespanType = obj.lifespanType ? obj.lifespanType : '1'
  368. this.markers = this.form.longitude && this.form.latitude ?
  369. [{ longitude: this.form.longitude, latitude: this.form.latitude, iconPath: '../../static/boiaoji.png' }]
  370. : []
  371. this.businessLicenseImg = configService.apiUrl + '/' + obj.businessLicense
  372. this.identityOneImg = configService.apiUrl + '/' + obj.identityOne
  373. this.headPhotoImg = obj.headPhoto ? obj.headPhoto.split(',').filter(id => id !== '') : []
  374. obj.headPhoto = obj.headPhoto ? obj.headPhoto.split(',').filter(id => id !== '') : []
  375. this.identityTwoImg = configService.apiUrl + '/' + obj.identityTwo
  376. obj.locality=obj.locality?obj.locality:''
  377. this.form = obj
  378. }
  379. // let res = await this.$http.get("/merchant/app/allList")
  380. // if (res.data.success) {
  381. // this.supplierOption = res.data.result
  382. // } else {
  383. // this.$tip.toast(res.data.message);
  384. // }
  385. },
  386. methods: {
  387. handleMarkerTap() {
  388. const queryString = uni.getStorageSync('address') ? encodeURIComponent(JSON.stringify(uni.getStorageSync('address'))) : ''
  389. uni.navigateTo({
  390. url: `/pages/login/map?position=${queryString}`
  391. })
  392. },
  393. getFile(e) {
  394. let path = ''
  395. uni.uploadFile({
  396. url: configService.apiUrl + '/sys/common/upload',
  397. filePath: e,
  398. name: "file",
  399. formData: {
  400. 'biz': 'temp',
  401. },
  402. success: (files) => {
  403. let data = JSON.parse(files.data);
  404. if (data.success) {
  405. path = res.tempFilePaths
  406. }
  407. }
  408. })
  409. console.log(path, 88);
  410. return path
  411. },
  412. uploadAll() {
  413. if (this.imageList.length === 0) {
  414. uni.showToast({ title: '请先选择图片', icon: 'none' });
  415. return;
  416. }
  417. uni.showLoading({ title: '上传中...', mask: true });
  418. const uploadPromises = this.imageList.map((path, index) => {
  419. return new Promise((resolve, reject) => {
  420. uni.uploadFile({
  421. url: configService.apiUrl + '/sys/common/upload',// 替换为实际接口
  422. filePath: path,
  423. formData: {
  424. 'biz': 'temp',
  425. },
  426. name: 'file',
  427. success: (files)=>{
  428. resolve(configService.apiUrl + '/' +JSON.parse(files.data).message)
  429. },
  430. fail: reject
  431. });
  432. });
  433. });
  434. Promise.all(uploadPromises)
  435. .then(results => {
  436. uni.hideLoading();
  437. this.imageList = []; // 清空已上传列表
  438. this.headPhotoImg = this.headPhotoImg.concat(results)
  439. this.form.headPhoto = this.form.headPhoto.concat(results)
  440. })
  441. .catch(error => {
  442. uni.hideLoading();
  443. });
  444. },
  445. ChooseImage() {
  446. uni.chooseImage({
  447. count: 5-Number(this.headPhotoImg.length) ,
  448. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  449. sourceType: ['album'], //从相册选择
  450. success: (res) => {
  451. if (res) {
  452. this.imageList = [...this.imageList, ...res.tempFilePaths];
  453. this.uploadAll()
  454. }
  455. }
  456. });
  457. },
  458. ViewImage(e) {
  459. uni.previewImage({
  460. urls: this.headPhotoImg,
  461. current: e.currentTarget.dataset.url
  462. });
  463. },
  464. DelImg(e) {
  465. uni.showModal({
  466. title: '提示',
  467. content: '确定要删除?',
  468. cancelText: '取消',
  469. confirmText: '确定',
  470. success: res => {
  471. if (res.confirm) {
  472. this.headPhotoImg.splice(e.currentTarget.dataset.index, 1)
  473. this.form.headPhoto.splice(e.currentTarget.dataset.index, 1)
  474. }
  475. }
  476. })
  477. },
  478. onConfirm(e) {
  479. this.mapIsHidden = false
  480. this.form.locality = e.result
  481. this.form.country = e.value[e.value.length - 1]
  482. },
  483. PickerChange(e) {
  484. this.form.purveyorId = this.supplierOption[e.detail.value].id
  485. },
  486. typeChang(e, val) {
  487. this.form[val] = e.detail.value
  488. },
  489. async businessChange(type) {
  490. let [chooseImageErr, chooseImageRes] = await uni.chooseImage({
  491. count: 1,
  492. sizeType: ['compressed']
  493. });
  494. let size = chooseImageRes.tempFiles[0].size / 1024 / 1024 < 5;
  495. if (!size) {
  496. this.$refs.uToast.show({
  497. title: '上传图片大小不能超过 5MB!',
  498. type: 'error',
  499. })
  500. return false
  501. }
  502. if (chooseImageRes) {
  503. this.lodingshow = true;
  504. // this.$tip.loading()
  505. this[type + 'Img'] = chooseImageRes.tempFilePaths[0];
  506. uni.uploadFile({
  507. url: configService.apiUrl + '/sys/common/upload',
  508. filePath: chooseImageRes.tempFilePaths[0],
  509. name: "file",
  510. formData: {
  511. 'biz': 'temp',
  512. },
  513. success: (files) => {
  514. let data = JSON.parse(files.data);
  515. if (data.success) {
  516. this.form[type] = data.message
  517. if (type == 'businessLicense' || type == 'identityOne') {
  518. uni.uploadFile({
  519. url: configService.apiUrl + `${type == 'businessLicense' ? '/order/identify/businessLicense' : '/order/identify/idCard'}`,
  520. filePath: chooseImageRes.tempFilePaths[0],
  521. name: "image1",
  522. success: (uploadFileRes) => {
  523. let data1 = JSON.parse(uploadFileRes.data).result;
  524. let obj = {}
  525. if (type == 'businessLicense') {
  526. obj = {
  527. corporateName: data1.company ? data1.company : '', //公司名称
  528. creditCode: data1.socialCreditCode ? data1.socialCreditCode : '', //统一社会信用代码
  529. lifespanBegin: data1.registerDate ? data1.registerDate.substr(0,
  530. 4) + '-' + data1.registerDate.substr(5, 2) + '-' + data1.registerDate
  531. .substr(8, 2) : '',
  532. lifespanEnd: data1.effectiveDate && data1.effectiveDate.includes('年') ? data1.effectiveDate.substr(0,
  533. 4) + '-' + data1.effectiveDate.substr(5, 2) + '-' + data1.effectiveDate
  534. .substr(8, 2) : '9999-12-31',
  535. lifespanType: data1.registerDate || data1.effectiveDate ? '2' : '1',
  536. }
  537. }
  538. else {
  539. obj = {
  540. legalPerson: data1.customerInfo.name ? data1.customerInfo.name : '', //法人姓名
  541. legalPersonCode: data1.customerInfo.identifyNumber ? data1.customerInfo.identifyNumber : '', //法人证件号
  542. }
  543. }
  544. this.$nextTick(() => {
  545. this.form = {
  546. ...this.form,
  547. ...obj,
  548. }
  549. // this.$set(this.form, obj);
  550. // this.form=Object.assign(this.form,obj)
  551. console.log(obj, this.form, 88888);
  552. })
  553. this.lodingshow = false;
  554. }
  555. });
  556. }
  557. else {
  558. this.lodingshow = false;
  559. }
  560. }
  561. }
  562. });
  563. } else {
  564. this.lodingshow = false;
  565. }
  566. },
  567. timestampToTime(timestamp) {
  568. // let date = new Date(timestamp * 1000);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
  569. let date = new Date(new Date());//时间戳为10位需*1000,时间戳为13位的话不需乘1000
  570. let Y = date.getFullYear() + '-';
  571. let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
  572. let D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + ' ';
  573. return Y + M + D;
  574. },
  575. sumbit() {
  576. if (this.title == '申请入驻') {
  577. for (let j in this.form) {
  578. if (!this.form[j]) {
  579. if (this.form['lifespanType'] == 2 && (this.form['lifespanBegin'] == null || this.form['lifespanEnd'] == null)) {
  580. this.$tip.alert('请选择日期!')
  581. return
  582. }
  583. if (this.form['businessLicense'] == null) {
  584. this.$tip.alert('请上传营业执照!')
  585. return
  586. }
  587. this.$tip.alert(`请填写${this.formName[j]}!`)
  588. return
  589. }
  590. }
  591. let data = {
  592. ...this.form,
  593. source: 2,
  594. headPhoto: Array.isArray(this.form.headPhoto)?this.form.headPhoto.join(','):this.form.headPhoto,
  595. longitude: this.markers.length > 0 ? this.markers[0].longitude : '',
  596. latitude: this.markers.length > 0 ? this.markers[0].latitude : ''
  597. }
  598. this.$http.post('/merchant/app/add', data).then(res => {
  599. if (res.data.success) {
  600. this.$tip.success(res.data.result || '成功')
  601. this.$Router.push({ name: "login" })
  602. }
  603. else {
  604. this.$tip.error(res.data.message);
  605. }
  606. })
  607. }
  608. else {
  609. let data = {
  610. ...this.form,
  611. source: 2,
  612. headPhoto: Array.isArray(this.form.headPhoto)?this.form.headPhoto.join(','):this.form.headPhoto,
  613. longitude: this.markers.length > 0 ? this.markers[0].longitude : '',
  614. latitude: this.markers.length > 0 ? this.markers[0].latitude : ''
  615. }
  616. console.log(this.form.headPhoto,88);
  617. this.$http.post('/merchant/localMerchantInfo/edit', data).then(res => {
  618. if (res.data.success) {
  619. this.$tip.success(res.data.result || '成功')
  620. uni.navigateBack({
  621. delta: 1 // 返回的页面数,默认为1
  622. })
  623. }
  624. else {
  625. this.$tip.error(res.data.message);
  626. }
  627. })
  628. }
  629. }
  630. }
  631. }
  632. </script>
  633. <style scoped lang="scss">
  634. page {
  635. background: #F8F8FA;
  636. }
  637. .cu-form-group .title {
  638. width: 190upx;
  639. }
  640. .cu-bg {
  641. background: linear-gradient(180deg, #D6E9FF 0%, #FFFFFF 100%);
  642. }
  643. .tab-top {
  644. margin-top: 78upx;
  645. padding: 26upx;
  646. }
  647. .borderRadiu {
  648. border-radius: 8px;
  649. padding-bottom: 10px;
  650. background-color: #ffffff;
  651. // border-bottom: 1px solid #eee;
  652. }
  653. .sub-bottom {
  654. position: fixed;
  655. width: 100%;
  656. bottom: 0;
  657. background: #FFFFFF;
  658. border-top: 1px solid #EEEEEE;
  659. }
  660. .progress-status {
  661. position: fixed;
  662. width: 100%;
  663. z-index: 9999;
  664. padding: 26upx 42upx;
  665. background: #FFFFFF;
  666. .status {
  667. font-size: 38upx;
  668. color: #F6863E;
  669. font-weight: 500;
  670. margin-bottom: 10upx;
  671. text {
  672. margin-left: 5upx
  673. }
  674. image {
  675. vertical-align: text-top;
  676. width: 42upx;
  677. height: 42upx;
  678. }
  679. }
  680. }
  681. .progress {
  682. position: fixed;
  683. height: 96upx;
  684. width: 100%;
  685. z-index: 9999;
  686. background: #FFFFFF;
  687. padding: 20upx 30upx;
  688. .progress-title {
  689. margin-top: 16upx;
  690. font-size: 24upx;
  691. color: #999999;
  692. .color {
  693. color: #333333;
  694. }
  695. }
  696. .progress-style {
  697. width: 100%;
  698. height: 10upx;
  699. border-radius: 5px 5px 5px 5px;
  700. }
  701. .progress-bag {
  702. position: relative;
  703. background: rgba(68, 154, 255, 0.05);
  704. .progress-icon {
  705. position: absolute;
  706. margin-top: -1px;
  707. width: 12upx;
  708. height: 12upx;
  709. background: #449AFF;
  710. border-radius: 50%;
  711. box-shadow: 0px 0px 0px 7upx rgba(68, 154, 255, 0.3);
  712. }
  713. .progress-icon1 {
  714. position: absolute;
  715. margin-top: -1px;
  716. width: 12upx;
  717. height: 12upx;
  718. background: #449AFF;
  719. border-radius: 50%;
  720. left: 99%;
  721. box-shadow: 0px 0px 0px 7upx rgba(68, 154, 255, 0.3);
  722. }
  723. .progress-bag1 {
  724. width: 50%;
  725. position: absolute;
  726. background: rgba(68, 154, 255, 0.8);
  727. }
  728. .progress-bag2 {
  729. position: absolute;
  730. background: rgba(68, 154, 255, 0.8);
  731. }
  732. }
  733. }
  734. .customize {
  735. background-color: #fff;
  736. // border-top: 0.5px solid #eee;
  737. margin: 16upx 18upx;
  738. .title {
  739. font-size: 30upx;
  740. // padding: 10px;
  741. }
  742. .business-img {
  743. height: 218upx;
  744. width: 360upx;
  745. padding: 16upx;
  746. // padding-bottom: 16upx;
  747. background: url('/static/login/yingye2.png');
  748. margin: 16upx auto;
  749. background-size: cover;
  750. image {
  751. width: 100%;
  752. height: 100%;
  753. }
  754. }
  755. .business-prompt {
  756. padding-top: 16upx;
  757. font-size: 20upx;
  758. color: #999999;
  759. }
  760. }
  761. .booder-top {
  762. border-bottom: 1px solid rgb(238, 238, 238);
  763. padding-top: 7px;
  764. }
  765. .img-border {
  766. padding: 15px 20px;
  767. }
  768. .upload {
  769. width: 100%;
  770. height: 188upx;
  771. // padding: 15px 20px;
  772. background-color: white;
  773. .imgOcr-border {
  774. position: relative;
  775. width: 48%;
  776. height: 100%;
  777. padding: 12upx;
  778. // background-color: #fff;
  779. background: url('/static/login/code3.png');
  780. background-size: cover;
  781. // box-shadow: 0px 4px 10px 0px #DAE3F4;
  782. image {
  783. width: 100%;
  784. // border-radius: 4px;
  785. height: 100%;
  786. }
  787. }
  788. }
  789. .picker-style {
  790. .w-picker-cnt .visible {
  791. position: absolute;
  792. z-index: 100000;
  793. }
  794. }
  795. </style>