Fix:5808 【商城小程序】【商户入驻-文玩供应商】入驻详情页填写资料后返回商户入驻列表页,再次进入时已填写的店铺资料未自动保存
This commit is contained in:
+12
-31
@@ -474,6 +474,7 @@ import {
|
||||
getShopInfo,
|
||||
removeApply,
|
||||
saveShop,
|
||||
saveHotelDraft,
|
||||
getHotelInfo,
|
||||
getCountyFamousHotelType
|
||||
} from '@/api/join'
|
||||
@@ -631,39 +632,10 @@ export default {
|
||||
onLoad(options) {
|
||||
this.partnerId = options.partnerId || ''
|
||||
this.promoterUid = options.promoterUid || ''
|
||||
const local_form = uni.getStorageSync('merchantApplyHotel' + '_form') || {}
|
||||
this.quaPics = uni.getStorageSync('merchantApplyHotel' + '_quaPics') || []
|
||||
if(!local_form.serviceTime) {
|
||||
local_form.serviceTime = '00:00'
|
||||
}
|
||||
if(!local_form.serviceEndTime) {
|
||||
local_form.serviceEndTime = '23:59'
|
||||
}
|
||||
this.form = !this.reviewing ? local_form : {
|
||||
name: '',
|
||||
cover: '',
|
||||
coverVideo: '',
|
||||
coverType: 1, // coverType: 1-图片,2-视频
|
||||
logo: '',
|
||||
qualification: '',
|
||||
type: 0,
|
||||
typeText: '',
|
||||
isCountyFamous: 0,
|
||||
countyFamousHotelType: null,
|
||||
phone: '',
|
||||
captcha: '',
|
||||
area: '',
|
||||
address: '',
|
||||
position: '',
|
||||
content: '',
|
||||
serviceTime: '00:00',
|
||||
serviceEndTime: '23:59'
|
||||
}
|
||||
this.init()
|
||||
},
|
||||
onUnload() {
|
||||
uni.setStorageSync('merchantApplyHotel'+'_quaPics', this.quaPics)
|
||||
uni.setStorageSync('merchantApplyHotel' + '_form', this.form)
|
||||
this.saveDraft()
|
||||
},
|
||||
onReady() {
|
||||
this.$refs.shopForm.setRules(this.rules)
|
||||
@@ -1005,7 +977,7 @@ export default {
|
||||
changeAgree(event) {
|
||||
this.isAgree = event.detail.value.length > 0
|
||||
},
|
||||
save() {
|
||||
buildPostData() {
|
||||
this.form.pics = ''
|
||||
const picsLength = this.pics.length
|
||||
if (picsLength > 0) {
|
||||
@@ -1028,6 +1000,10 @@ export default {
|
||||
if (postData.coverType === 2) {
|
||||
postData.cover = postData.coverVideo
|
||||
}
|
||||
return postData
|
||||
},
|
||||
save() {
|
||||
const postData = this.buildPostData()
|
||||
saveShop(postData, this.partnerId, this.promoterUid).then(res => {
|
||||
if (res.status === 200) {
|
||||
uni.showToast({
|
||||
@@ -1048,6 +1024,11 @@ export default {
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
saveDraft() {
|
||||
if (this.reviewing) return
|
||||
const postData = this.buildPostData()
|
||||
saveHotelDraft(postData, this.partnerId, this.promoterUid)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user