Fix:3256 【商城小程序】收货地址页面,给当前选择的地址增加一个标识,放在地址右下角
This commit is contained in:
+2
-2
@@ -412,7 +412,7 @@ export default {
|
|||||||
const cartChooseAddress = uni.getStorageSync('cartChooseAddress') || {}
|
const cartChooseAddress = uni.getStorageSync('cartChooseAddress') || {}
|
||||||
if (cartChooseAddress.id) {
|
if (cartChooseAddress.id) {
|
||||||
this.addressInfo = cartChooseAddress
|
this.addressInfo = cartChooseAddress
|
||||||
uni.setStorageSync('cartChooseAddress', {})
|
// uni.setStorageSync('cartChooseAddress', {})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.getAddress()
|
this.getAddress()
|
||||||
@@ -452,7 +452,7 @@ export default {
|
|||||||
getAddressList({page: 1, limit: 9999}).then(res => {
|
getAddressList({page: 1, limit: 9999}).then(res => {
|
||||||
const { data = [] } = res
|
const { data = [] } = res
|
||||||
this.addressList = data
|
this.addressList = data
|
||||||
this.addressInfo = data.find(e => e.isDefault == 1) || (data && data[0]) || null
|
this.addressInfo = data.find(e => e.isDefault == 1) || uni.getStorageSync('cartChooseAddress') || (data && data[0]) || null
|
||||||
if (!this.addressInfo.id) {
|
if (!this.addressInfo.id) {
|
||||||
this.addressInfo = data.find(e => e.isDefault == 1) || (data && data[0]) || null
|
this.addressInfo = data.find(e => e.isDefault == 1) || (data && data[0]) || null
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -23,6 +23,9 @@
|
|||||||
item.district
|
item.district
|
||||||
}}{{ item.detail }}
|
}}{{ item.detail }}
|
||||||
</view>
|
</view>
|
||||||
|
<view v-if="currentId === item.id && choosMode" class="tip-icon">
|
||||||
|
<u-icon name="checkbox-mark" color="#C52733" size="20"></u-icon>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="!choosMode" class="operation acea-row row-between-wrapper">
|
<view v-if="!choosMode" class="operation acea-row row-between-wrapper">
|
||||||
<view class="select-btn">
|
<view class="select-btn">
|
||||||
@@ -93,6 +96,13 @@ export default {
|
|||||||
pageKeyId: Object.freeze('userAddressIndex')
|
pageKeyId: Object.freeze('userAddressIndex')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
// 当前地址id
|
||||||
|
currentId() {
|
||||||
|
const current = uni.getStorageSync('cartChooseAddress') || {}
|
||||||
|
return current.id || null
|
||||||
|
}
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.AddressList()
|
this.AddressList()
|
||||||
},
|
},
|
||||||
@@ -116,6 +126,8 @@ 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)
|
||||||
@@ -229,4 +241,9 @@ export default {
|
|||||||
margin-left: 32rpx;
|
margin-left: 32rpx;
|
||||||
margin-right: 32rpx;
|
margin-right: 32rpx;
|
||||||
}
|
}
|
||||||
|
.tip-icon{
|
||||||
|
position: absolute;
|
||||||
|
right: 10rpx;
|
||||||
|
bottom: 10rpx;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user