diff --git a/pkg_join/views/experienceStore.vue b/pkg_join/views/experienceStore.vue index 38ca70d..ecb4844 100644 --- a/pkg_join/views/experienceStore.vue +++ b/pkg_join/views/experienceStore.vue @@ -520,6 +520,7 @@ export default { onLoad(opts) { this.partnerId = opts.partnerId || '' this.promoterUid = opts.promoterUid || '' + uni.showLoading({ title: '加载中...', mask: true }) this.queryCity() getShopData({partnerId: this.partnerId, promoterUid: this.promoterUid}).then(({ data }) => { this.notice = formatRichText(data.merchantApplyNotice) @@ -530,6 +531,8 @@ export default { this.experienceStoreCategoryIndex = 0 } this.initInfo() + }).catch(() => { + uni.hideLoading() }) }, onUnload() { @@ -576,6 +579,8 @@ export default { }).catch(() => { this.form.isDraft = 1 this.show = true + }).finally(() => { + uni.hideLoading() }) }, changeAgree(e) { diff --git a/pkg_join/views/shop.vue b/pkg_join/views/shop.vue index d9c2737..924f5f0 100644 --- a/pkg_join/views/shop.vue +++ b/pkg_join/views/shop.vue @@ -707,6 +707,7 @@ export default { } }, init() { + uni.showLoading({ title: '加载中...', mask: true }) getCity().then(({data}) => { this.district = data }) @@ -726,6 +727,8 @@ export default { }).catch(() => { this.initInfo() }) + }).catch(() => { + uni.hideLoading() }) }, @@ -801,6 +804,8 @@ export default { this.form.position = this.$forceToDecimal(this.form.longitude, 6) + ',' + this.$forceToDecimal(this.form.latitude, 6) this.form.area = `${this.form.provinceName} ${this.form.cityName} ${this.form.areaName}` } + }).finally(() => { + uni.hideLoading() }) }, chooseLogoImg(target) { diff --git a/pkg_join/views/supplier.vue b/pkg_join/views/supplier.vue index d356d24..b7cad3d 100644 --- a/pkg_join/views/supplier.vue +++ b/pkg_join/views/supplier.vue @@ -889,6 +889,7 @@ export default { } }, init() { + uni.showLoading({ title: '加载中...', mask: true }) getCity().then(({data}) => { this.district = data }) @@ -897,6 +898,8 @@ export default { this.columnsSupplierType = data.supplierTypeList this.notice = formatRichText(data.merchantApplyNotice) this.initInfo() + }).catch(() => { + uni.hideLoading() }) }, initInfo() { @@ -978,6 +981,8 @@ export default { this.formSupplier.position = this.$forceToDecimal(this.formSupplier.longitude, 6) + ',' + this.$forceToDecimal(this.formSupplier.latitude, 6) this.formSupplier.area = `${this.formSupplier.provinceName || ''} ${this.formSupplier.cityName || ''} ${this.formSupplier.areaName || ''}` } + }).finally(() => { + uni.hideLoading() }) }, chooseLogoImg(target) { diff --git a/pkg_join/views/travelResidence.vue b/pkg_join/views/travelResidence.vue index 115a25f..7ee0010 100644 --- a/pkg_join/views/travelResidence.vue +++ b/pkg_join/views/travelResidence.vue @@ -469,10 +469,13 @@ export default { onLoad(opts) { this.partnerId = opts.partnerId || '' this.promoterUid = opts.promoterUid || '' + uni.showLoading({ title: '加载中...', mask: true }) this.queryCity() getShopData({partnerId: this.partnerId, promoterUid: this.promoterUid}).then(({data}) => { this.notice = formatRichText(data.merchantApplyNotice) this.initInfo() + }).catch(() => { + uni.hideLoading() }) }, // onShow() { @@ -571,6 +574,8 @@ export default { } }).catch(err => { // uni.$u.toast(err.msg) + }).finally(() => { + uni.hideLoading() }) }, /** diff --git a/pkg_join/views/wholesaler.vue b/pkg_join/views/wholesaler.vue index b62e2cc..d9c16a2 100644 --- a/pkg_join/views/wholesaler.vue +++ b/pkg_join/views/wholesaler.vue @@ -155,33 +155,16 @@ @@ -269,7 +252,7 @@ import CitySelect from '@/components/CitySelect' import {getShopData, getWholesaler, removeApply, saveWholesaler, saveWholesalerDraft} from '@/api/join' import {getCity, registerVerify} from '@/api/user' -import {chooseImage, formatRichText} from '@/utils' +import {chooseImage, uploadImage, formatRichText} from '@/utils' import { pageListenMixins } from '@/mixins/pageListenMixins' export default { @@ -344,7 +327,7 @@ export default { }, district: [], address: {}, - qualificationArr: [], + quaPics: [], isAgree: false, show: false, notice: '', @@ -411,12 +394,15 @@ export default { } }, init() { + uni.showLoading({ title: '加载中...', mask: true }) getCity().then(({data}) => { this.district = data }) getShopData({partnerId: this.partnerId, promoterUid: this.promoterUid}).then(({data}) => { this.notice = formatRichText(data.merchantApplyNotice) this.initInfo() + }).catch(() => { + uni.hideLoading() }) }, initInfo() { @@ -448,35 +434,48 @@ export default { } if (data.wholesalerInfo) { this.form = data.wholesalerInfo + this.quaPics = [] if (this.form.qualification) { - this.qualificationArr = this.form.qualification.split(',') + this.form.qualification.split(',').map(item => { + if (item) { + this.quaPics.push({url: item}) + } + }) } this.form.position = this.$forceToDecimal(this.form.longitude, 6) + ',' + this.$forceToDecimal(this.form.latitude, 6) this.form.area = [this.form.provinceName, this.form.cityName, this.form.areaName].filter(Boolean).join(' ') } + }).finally(() => { + uni.hideLoading() }) }, chooseLogoImg(target) { if (this.reviewing) return chooseImage(img => { - switch (target) { - case 'avatar': - this.form.avatar = img - break - case 'licence': - this.form.qualification = img - this.qualificationArr = [img] - break + if (target === 'avatar') { + this.form.avatar = img } }) }, - // 删除图片 - deleteImg(target, index) { + // 删除头像 + deleteImg(target) { if (target === 'avatar') { this.form.avatar = '' - } else if (target === 'qualification') { - this.qualificationArr.splice(index, 1) - this.form.qualification = this.qualificationArr.join(',') + } + }, + // 删除商家资质图片 + quaDeletePic(event) { + this[`${event.name}`].splice(event.index, 1) + }, + // 商家资质批量上传 + quaAfterRead(event) { + const that = this + if (event.file.length > 0) { + event.file.map(item => { + uploadImage(item.url, img => { + that.quaPics.push({url: img}) + }) + }) } }, // 省市区 @@ -495,7 +494,7 @@ export default { this.form.areaId = values.district.id }, onSubmit() { - + this.buildQualification() this.$refs.wholesalerForm.validate().then(res => { // 校验通过 saveWholesaler(this.form).then(res => { @@ -564,7 +563,16 @@ export default { }, saveDraft() { if (this.reviewing) return + this.buildQualification() saveWholesalerDraft(this.form) + }, + buildQualification() { + this.form.qualification = '' + const tempArr = [] + this.quaPics.map(item => { + item.url && tempArr.push(item.url) + }) + this.form.qualification = tempArr.join(',') } } }