92 lines
2.3 KiB
Vue
92 lines
2.3 KiB
Vue
<template>
|
|
<uni-popup ref="address" type="bottom" :safe-area="fales">
|
|
<view class="content">
|
|
<view class="ml20 ft16 ftw500 flex" style="height: 80rpx; line-height: 80rpx;">
|
|
<view>更换地址</view>
|
|
<view @click="quxiao" style="margin-left: auto;padding-right: 30rpx; " class="ft14 ftw500 cl-999">取消</view>
|
|
</view>
|
|
<view class="ml20 mr15">
|
|
<scroll-view scroll-y class="" style="height: 240px;margin-bottom: 4rpx;">
|
|
<view class="pt10 pb10 item" style="padding-left: 10rpx;" :class="{'itemtype':quantity.id == item.id}" v-for="(item,index) in datalist" :key="index" @click="selectdata(item)">
|
|
<view class="flex alcenter">
|
|
<text class="ft14 ftw500 cl-333">{{item.accept_name}}</text>
|
|
<text class="ft14 ftw500 cl-333 pl20">{{item.show_mobile}}</text>
|
|
</view>
|
|
<view class="ft14 ftw500 cl-999" style="margin-top: 12rpx;">
|
|
{{item.accept_province}}{{item.accept_city}}{{item.accept_exp_area}}{{item.accept_address}}
|
|
</view>
|
|
</view>
|
|
</scroll-view>
|
|
</view>
|
|
<view class="button" style="padding: 20rpx 0;" @click="determine">确定</view>
|
|
</view>
|
|
</uni-popup>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
quantity: "",
|
|
datalist: []
|
|
}
|
|
},
|
|
methods: {
|
|
addressshop(data) {
|
|
this.getlist()
|
|
console.log(data);
|
|
this.quantity = data
|
|
},
|
|
quxiao() {
|
|
this.$refs.address.close()
|
|
},
|
|
getlist() {
|
|
this.$httpRequest({
|
|
url: '/api/delivery/address/list',
|
|
data: this.data,
|
|
methods: "POST",
|
|
}).then(res => {
|
|
if (res.code == 1) {
|
|
this.datalist = res.data.list
|
|
this.$refs.address.open()
|
|
}
|
|
}).catch(err => {
|
|
console.log('bind user err');
|
|
console.log(err);
|
|
})
|
|
},
|
|
selectdata(item) {
|
|
console.log(item);
|
|
this.quantity = item
|
|
},
|
|
determine(){
|
|
this.quxiao()
|
|
this.$emit("replacement",this.quantity)
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.content {
|
|
background-color: #fff;
|
|
height: 680rpx;
|
|
border-radius: 24rpx 24rpx 0rpx 0rpx;
|
|
}
|
|
.button {
|
|
margin: 0 30rpx;
|
|
height: 80rpx;
|
|
/* width: 312rpx; */
|
|
background: linear-gradient(123deg, #00E075 0%, #09D89E 100%);
|
|
border-radius: 40rpx;
|
|
text-align: center;
|
|
color: #FFFFFF;
|
|
}
|
|
.item{
|
|
border: 2rpx solid transparent;
|
|
}
|
|
.itemtype{
|
|
border: 2rpx solid #09d89e;
|
|
border-radius: 14rpx;
|
|
}
|
|
</style> |