Fix:3262 【礼品功能】每次领取礼品时输入新地址,都会把上一次保存的地址覆盖掉,设置新地址也要保留上一次的地址
This commit is contained in:
@@ -10,22 +10,25 @@
|
|||||||
@open="open"
|
@open="open"
|
||||||
>
|
>
|
||||||
<view class="v12-text-center v12-font-bold v12-mt-3">收货地址</view>
|
<view class="v12-text-center v12-font-bold v12-mt-3">收货地址</view>
|
||||||
<view class="address-list">
|
<view class="address-list"
|
||||||
|
>
|
||||||
<!-- 地址列表 -->
|
<!-- 地址列表 -->
|
||||||
<view
|
<view
|
||||||
|
v-for="(item, index) in addressList"
|
||||||
|
:key="index"
|
||||||
class="address-item"
|
class="address-item"
|
||||||
>
|
>
|
||||||
<view class="address-wrap" @click="handleSelect(addressList)">
|
<view class="address-wrap" @click="handleSelect(item)">
|
||||||
<view class="v12-font-28 v12-font-bold">
|
<view class="v12-font-28 v12-font-bold">
|
||||||
收货地址:
|
收货地址:
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<view class="info">
|
<view class="info">
|
||||||
<text class="v12-font-28 v12-font-bold v12-dark-text">{{ addressList.realName }}</text>
|
<text class="v12-font-28 v12-font-bold v12-dark-text">{{ item.realName }}</text>
|
||||||
<text class="v12-font-28 v12-font-bold v12-dark-text v12-ml-1">{{ addressList.phone }}</text>
|
<text class="v12-font-28 v12-font-bold v12-dark-text v12-ml-1">{{ item.phone }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="address v12-font-bold v12-font-28 v12-dark-text v12-mt-3 v12-mb-4">
|
<view class="address v12-font-bold v12-font-28 v12-dark-text v12-mt-3 v12-mb-4">
|
||||||
{{ addressList.province + addressList.city + addressList.district + addressList.detail }}
|
{{ item.province + item.city + item.district + item.detail }}
|
||||||
<view @click.stop="editAddress">
|
<view @click.stop="editAddress">
|
||||||
<u-icon :name="webUrl+'/orderIcon/edit02.png'" color="#C52733"></u-icon>
|
<u-icon :name="webUrl+'/orderIcon/edit02.png'" color="#C52733"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
@@ -45,8 +48,8 @@
|
|||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
addressList: {
|
addressList: {
|
||||||
type: Object,
|
type: Array,
|
||||||
default: () => {}
|
default: () => []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -106,6 +109,8 @@ export default {
|
|||||||
.address-list {
|
.address-list {
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
width: 640rpx;
|
width: 640rpx;
|
||||||
|
height: 800rpx;
|
||||||
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.address-item {
|
.address-item {
|
||||||
@@ -141,6 +146,7 @@ export default {
|
|||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border: 1rpx solid #ddd;
|
border: 1rpx solid #ddd;
|
||||||
border-radius: 100rpx;
|
border-radius: 100rpx;
|
||||||
|
position: sticky;
|
||||||
|
bottom: 0;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -76,7 +76,7 @@ export default {
|
|||||||
// 组件数据
|
// 组件数据
|
||||||
giftNotice: '',
|
giftNotice: '',
|
||||||
isReceive: false,
|
isReceive: false,
|
||||||
address: {},
|
address: [],
|
||||||
order: ''
|
order: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -84,7 +84,8 @@ export default {
|
|||||||
addr: {
|
addr: {
|
||||||
handler(newVal, oldVal) {
|
handler(newVal, oldVal) {
|
||||||
if (newVal && newVal.id) {
|
if (newVal && newVal.id) {
|
||||||
this.address = newVal
|
// this.address = newVal
|
||||||
|
this.setAddress()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
deep: true
|
deep: true
|
||||||
@@ -132,7 +133,7 @@ export default {
|
|||||||
if (res.data.length === 0) {
|
if (res.data.length === 0) {
|
||||||
this.$refs.addressDialog.open()
|
this.$refs.addressDialog.open()
|
||||||
} else {
|
} else {
|
||||||
this.address = res.data.filter(item => item.isDefault === 1).length === 0 ? res.data[0] : res.data.filter(item => item.isDefault === 1)[0]
|
this.address = res.data
|
||||||
this.$refs.AddressList.open()
|
this.$refs.AddressList.open()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user