Fix:3815 【商城小程序】购买流程出现异常页面
This commit is contained in:
@@ -280,6 +280,7 @@ export default {
|
||||
icon: 'success',
|
||||
title: '修改成功!'
|
||||
})
|
||||
uni.setStorageSync('sourceAddress', chooseAddress)
|
||||
_this.changeType()
|
||||
}).finally(() => {
|
||||
uni.hideLoading()
|
||||
|
||||
@@ -502,9 +502,10 @@ export default {
|
||||
...mapGetters(["userInfo"])
|
||||
},
|
||||
onShow() {
|
||||
const _this = this
|
||||
const chooseAddress = uni.getStorageSync('chooseAddress') || {}
|
||||
const addressId = chooseAddress.id || ''
|
||||
console.log(addressId, 'addressId');
|
||||
|
||||
// 监听到选择收货地址
|
||||
if (addressId) {
|
||||
uni.setStorageSync('chooseAddress', {})
|
||||
@@ -519,13 +520,14 @@ export default {
|
||||
uni.showLoading()
|
||||
editAddress({
|
||||
addressId,
|
||||
orderId: _this.orderInfo.orderId
|
||||
orderId: this.orderInfo.orderId
|
||||
}).then(res => {
|
||||
uni.showToast({
|
||||
icon: 'success',
|
||||
title: '修改成功!'
|
||||
})
|
||||
_this.getDetail()
|
||||
uni.setStorageSync('sourceAddress', chooseAddress)
|
||||
this.getDetail()
|
||||
}).finally(() => {
|
||||
uni.hideLoading()
|
||||
})
|
||||
@@ -536,8 +538,8 @@ export default {
|
||||
}
|
||||
})
|
||||
} else {
|
||||
_this.id = _this.$yroute.query.id;
|
||||
_this.getDetail();
|
||||
this.id = this.$yroute.query.id;
|
||||
this.getDetail();
|
||||
}
|
||||
},
|
||||
// inject: ["app"],
|
||||
|
||||
@@ -414,6 +414,31 @@ export default {
|
||||
_this.getCartInfo()
|
||||
//获取用户信息
|
||||
_this.$store.dispatch("getUser", true)
|
||||
// 监听到选择收货地址
|
||||
const chooseAddress = uni.getStorageSync('chooseAddress') || {}
|
||||
const sourceAddress = uni.getStorageSync('sourceAddress') || uni.getStorageSync('chooseAddress')
|
||||
// 监听到选择收货地址
|
||||
if (chooseAddress.id && (chooseAddress.id !== sourceAddress.id)) {
|
||||
uni.showModal({
|
||||
title:'确定修改地址吗?',
|
||||
content: '',
|
||||
showCancel: true,
|
||||
cancelText: '取消',
|
||||
confirmText: '确认',
|
||||
success: (res) => {
|
||||
if(res.confirm) {
|
||||
_this.addressInfo = chooseAddress
|
||||
// 地址切换也要重新计算一下
|
||||
uni.setStorageSync('sourceAddress', _this.addressInfo || '')
|
||||
_this.computedPrice('onLoad chooseAddress')
|
||||
}
|
||||
},
|
||||
complete: () => {
|
||||
uni.hideLoading()
|
||||
uni.setStorageSync('chooseAddress', {})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
@@ -505,32 +530,11 @@ export default {
|
||||
if(_this.$yroute.query.address !== undefined ) {
|
||||
_this.addressInfo = JSON.parse(_this.$yroute.query.address) || {}
|
||||
} else {
|
||||
_this.addressInfo = uni.getStorageSync('chooseAddress') ? uni.getStorageSync('chooseAddress') : data.addressInfo || {}
|
||||
}
|
||||
const chooseAddress = uni.getStorageSync('chooseAddress') || {}
|
||||
const sourceAddress = uni.getStorageSync('sourceAddress') || data.addressInfo || uni.getStorageSync('chooseAddress')
|
||||
// 监听到选择收货地址
|
||||
if (chooseAddress.id && (chooseAddress.id !== sourceAddress.id)) {
|
||||
uni.showModal({
|
||||
title:'确定修改地址吗?',
|
||||
content: '',
|
||||
showCancel: true,
|
||||
cancelText: '取消',
|
||||
confirmText: '确认',
|
||||
success: (res) => {
|
||||
if(res.confirm) {
|
||||
_this.addressInfo = chooseAddress
|
||||
// 地址切换也要重新计算一下
|
||||
uni.setStorageSync('sourceAddress', _this.addressInfo || '')
|
||||
_this.computedPrice('onLoad chooseAddress')
|
||||
}
|
||||
},
|
||||
complete: () => {
|
||||
uni.hideLoading()
|
||||
// uni.setStorageSync('chooseAddress', {})
|
||||
}
|
||||
})
|
||||
_this.addressInfo = uni.getStorageSync('sourceAddress') || data.addressInfo || {}
|
||||
console.log(data.addressInfo);
|
||||
|
||||
}
|
||||
|
||||
_this.systemStore = data.systemStore || {}
|
||||
_this.storeSelfMention = data.storeSelfMention
|
||||
_this.computedPrice()
|
||||
@@ -684,7 +688,7 @@ export default {
|
||||
storeId: this.storeItems ? this.storeItems.id : this.systemStore.id,
|
||||
...from
|
||||
}
|
||||
|
||||
uni.setStorageSync('chooseAddress', {})
|
||||
//余额支付的支付密码
|
||||
if (this.active == 'yue') {
|
||||
params.passwordPay = this.payPassword;
|
||||
|
||||
@@ -172,7 +172,7 @@ export default {
|
||||
this.loadend = res.data.length < this.limit
|
||||
this.page = this.page + 1
|
||||
if (this.choosMode === 1) {
|
||||
this.currentId = uni.getStorageSync('chooseAddress') ? uni.getStorageSync('chooseAddress').id : this.addressList.find(e => e.isDefault === 1) ? this.addressList.find(e => e.isDefault === 1).id : null
|
||||
this.currentId = uni.getStorageSync('sourceAddress') ? uni.getStorageSync('sourceAddress').id : this.addressList.find(e => e.isDefault === 1) ? this.addressList.find(e => e.isDefault === 1).id : null
|
||||
}
|
||||
// 来源购物车
|
||||
if (this.choosMode === 2) {
|
||||
|
||||
Reference in New Issue
Block a user