Fix:5824 【商城小程序】【商户入驻】进入任意接口入驻页面时,先闪现未填写资料界面,过几秒才会显示已填写的资料页面
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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()
|
||||
})
|
||||
},
|
||||
/**
|
||||
|
||||
@@ -155,33 +155,16 @@
|
||||
<view class="licence-image">
|
||||
<u-cell :border="false">
|
||||
<template #title>
|
||||
<view class="box-upload" @click="chooseLogoImg('licence')">
|
||||
<view
|
||||
v-if="!form.qualification"
|
||||
class="btn-upload"
|
||||
>上传图片</view>
|
||||
<view v-else>
|
||||
<view v-if="qualificationArr.length > 0" class="flex">
|
||||
<view
|
||||
v-for="(item, index) in qualificationArr"
|
||||
:key="index"
|
||||
class="img-wrap"
|
||||
>
|
||||
<image
|
||||
:src="item"
|
||||
class="img-preview"
|
||||
/>
|
||||
<view
|
||||
v-if="!reviewing"
|
||||
class="delete-badge"
|
||||
@click.stop="deleteImg('qualification', index)"
|
||||
>
|
||||
x
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-upload
|
||||
:maxCount="9"
|
||||
:fileList="quaPics"
|
||||
:disabled="reviewing"
|
||||
:deletable="!reviewing"
|
||||
name="quaPics"
|
||||
multiple
|
||||
@afterRead="quaAfterRead"
|
||||
@delete="quaDeletePic"
|
||||
/>
|
||||
</template>
|
||||
</u-cell>
|
||||
</view>
|
||||
@@ -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(',')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user