Fix:3256 【商城小程序】收货地址页面,给当前选择的地址增加一个标识,放在地址右下角
This commit is contained in:
@@ -431,7 +431,7 @@ export default {
|
|||||||
},
|
},
|
||||||
complete: () => {
|
complete: () => {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
uni.setStorageSync('chooseAddress', {})
|
// uni.setStorageSync('chooseAddress', {})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -526,7 +526,7 @@ export default {
|
|||||||
if(_this.$yroute.query.address !== undefined ) {
|
if(_this.$yroute.query.address !== undefined ) {
|
||||||
_this.addressInfo = JSON.parse(_this.$yroute.query.address) || {}
|
_this.addressInfo = JSON.parse(_this.$yroute.query.address) || {}
|
||||||
} else {
|
} else {
|
||||||
_this.addressInfo = data.addressInfo || {}
|
_this.addressInfo = uni.getStorageSync('chooseAddress') ? uni.getStorageSync('chooseAddress') : data.addressInfo || {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -93,16 +93,22 @@ export default {
|
|||||||
loading: false,
|
loading: false,
|
||||||
loadend: false,
|
loadend: false,
|
||||||
isWechat: isWeixin(),
|
isWechat: isWeixin(),
|
||||||
pageKeyId: Object.freeze('userAddressIndex')
|
pageKeyId: Object.freeze('userAddressIndex'),
|
||||||
}
|
currentId: null
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
// 当前地址id
|
|
||||||
currentId() {
|
|
||||||
const current = uni.getStorageSync('cartChooseAddress') || {}
|
|
||||||
return current.id || null
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// computed: {
|
||||||
|
// // 当前地址id
|
||||||
|
// currentId: {
|
||||||
|
// set(val) {
|
||||||
|
|
||||||
|
// },
|
||||||
|
// get() {
|
||||||
|
// const current = uni.getStorageSync('cartChooseAddress') || {}
|
||||||
|
// return current.id || null
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// },
|
||||||
mounted() {
|
mounted() {
|
||||||
this.AddressList()
|
this.AddressList()
|
||||||
},
|
},
|
||||||
@@ -126,8 +132,6 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
tapAddress(item) {
|
tapAddress(item) {
|
||||||
console.log(item);
|
|
||||||
|
|
||||||
// 来源订单创建页面
|
// 来源订单创建页面
|
||||||
if (this.choosMode === 1) {
|
if (this.choosMode === 1) {
|
||||||
uni.setStorageSync('chooseAddress', item)
|
uni.setStorageSync('chooseAddress', item)
|
||||||
@@ -155,19 +159,29 @@ export default {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
AddressList() {
|
AddressList() {
|
||||||
const that = this
|
|
||||||
// 阻止下次请求(false可以进行请求)
|
// 阻止下次请求(false可以进行请求)
|
||||||
if (that.loading) return
|
if (this.loading) return
|
||||||
// 阻止结束当前请求(false可以进行请求)
|
// 阻止结束当前请求(false可以进行请求)
|
||||||
if (that.loadend) return
|
if (this.loadend) return
|
||||||
that.loading = true
|
this.loading = true
|
||||||
getAddressList({page: that.page, limit: that.limit}).then(res => {
|
getAddressList({page: this.page, limit: this.limit}).then(res => {
|
||||||
that.loading = false
|
this.loading = false
|
||||||
// apply();js将一个数组插入另一个数组
|
// apply();js将一个数组插入另一个数组
|
||||||
that.addressList.push.apply(that.addressList, res.data)
|
this.addressList.push.apply(this.addressList, res.data)
|
||||||
// 判断所有数据是否加载完成
|
// 判断所有数据是否加载完成
|
||||||
that.loadend = res.data.length < that.limit
|
this.loadend = res.data.length < this.limit
|
||||||
that.page = that.page + 1
|
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
|
||||||
|
}
|
||||||
|
// 来源购物车
|
||||||
|
if (this.choosMode === 2) {
|
||||||
|
this.currentId = uni.getStorageSync('cartChooseAddress') ? uni.getStorageSync('cartChooseAddress').id : this.addressList.find(e => e.isDefault === 1) ? this.addressList.find(e => e.isDefault === 1).id : null
|
||||||
|
}
|
||||||
|
// 来源礼物
|
||||||
|
if (this.choosMode === 3) {
|
||||||
|
this.currentId = uni.getStorageSync('giftChooseAddress') ? uni.getStorageSync('giftChooseAddress').id : this.addressList.find(e => e.isDefault === 1) ? this.addressList.find(e => e.isDefault === 1).id : null
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user