2020-06-02 11:42:13 +08:00
|
|
|
<template>
|
|
|
|
<view class="address">
|
2020-06-03 09:14:04 +08:00
|
|
|
<u-radio-group v-model="current" @change="changeDefault" size="29" active-color="#FF780F">
|
2020-06-02 11:42:13 +08:00
|
|
|
<view v-for="(item, index) in addressList" :key="index" class="address-item">
|
|
|
|
<view class="item-top">
|
|
|
|
<view class="user-info">
|
|
|
|
<view class="user-name">王先生</view>
|
|
|
|
<view class="user-pnone">174****7492</view>
|
|
|
|
</view>
|
|
|
|
<view class="user-address">山东省临沂市兰山区金雀山街道巴啦啦小区三号楼101室</view>
|
|
|
|
</view>
|
|
|
|
<view class="item-bottom">
|
|
|
|
<view class="item-default">
|
2020-06-03 09:14:04 +08:00
|
|
|
<u-radio
|
|
|
|
:name="item"
|
|
|
|
shape="circle"
|
|
|
|
label-size="22"
|
|
|
|
>
|
|
|
|
<view :class="[item == current ? 'radio-default' : 'radio-others']">
|
|
|
|
{{ item == current ? '已设为默认' : '设为默认' }}
|
|
|
|
</view>
|
|
|
|
</u-radio>
|
2020-06-02 11:42:13 +08:00
|
|
|
</view>
|
|
|
|
<view class="address-operate">
|
2020-06-04 08:21:34 +08:00
|
|
|
<view @click="editAddress">
|
2020-06-08 15:23:23 +08:00
|
|
|
<image src="@/pageE/static/mine/24.png"></image>
|
2020-06-02 11:42:13 +08:00
|
|
|
<view>编辑</view>
|
|
|
|
</view>
|
|
|
|
<view>
|
2020-06-08 15:23:23 +08:00
|
|
|
<image src="@/pageE/static/mine/25.png"></image>
|
2020-06-02 11:42:13 +08:00
|
|
|
<view>删除</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
2020-06-03 09:14:04 +08:00
|
|
|
</u-radio-group>
|
|
|
|
<view class="address-btn" @click="addAddress">添加地址</view>
|
2020-06-02 11:42:13 +08:00
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
export default {
|
2020-06-02 15:35:19 +08:00
|
|
|
name: 'address-item',
|
2020-06-02 11:42:13 +08:00
|
|
|
data() {
|
|
|
|
return {
|
2020-06-02 15:35:19 +08:00
|
|
|
current: 0
|
2020-06-02 11:42:13 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
addressList: Array
|
|
|
|
},
|
|
|
|
onLoad() {
|
|
|
|
console.log(22)
|
2020-06-02 15:35:19 +08:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
editAddress() {
|
|
|
|
uni.navigateTo({
|
2020-06-08 15:23:23 +08:00
|
|
|
url: '/pageE/more/EditAddress'
|
2020-06-02 15:35:19 +08:00
|
|
|
});
|
|
|
|
},
|
2020-06-03 09:14:04 +08:00
|
|
|
addAddress() {
|
|
|
|
uni.navigateTo({
|
2020-06-08 15:23:23 +08:00
|
|
|
url: '/pageE/more/AddAddress'
|
2020-06-03 09:14:04 +08:00
|
|
|
});
|
|
|
|
},
|
2020-06-02 15:35:19 +08:00
|
|
|
changeDefault(event) {
|
|
|
|
console.log(event)
|
2020-06-03 09:14:04 +08:00
|
|
|
// this.current = event
|
2020-06-02 15:35:19 +08:00
|
|
|
}
|
|
|
|
},
|
2020-06-02 11:42:13 +08:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.address {
|
2020-06-04 08:21:34 +08:00
|
|
|
padding: 1rpx 0 40rpx;
|
2020-06-03 09:14:04 +08:00
|
|
|
.u-radio-group {
|
|
|
|
display: block;
|
2020-06-04 08:21:34 +08:00
|
|
|
.address-item {
|
|
|
|
background-color: #ffffff;
|
|
|
|
margin-bottom: 20rpx;
|
|
|
|
padding: 30rpx;
|
|
|
|
.item-top {
|
|
|
|
position: relative;
|
|
|
|
padding-bottom: 30rpx;
|
|
|
|
&::after {
|
|
|
|
content: "";
|
|
|
|
position: absolute;
|
|
|
|
width: 690rpx;
|
|
|
|
height: 2rpx;
|
|
|
|
background: rgba(241,241,241,1);
|
|
|
|
bottom: 0;
|
|
|
|
left: 50%;
|
|
|
|
transform: translate(-50%,0);
|
|
|
|
}
|
|
|
|
.user-info {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
margin-bottom: 30rpx;
|
|
|
|
.user-name {
|
|
|
|
font-size: 32rpx;
|
|
|
|
font-weight: 500;
|
|
|
|
color: rgba(51,51,51,1);
|
|
|
|
margin-right: 13rpx;
|
|
|
|
}
|
|
|
|
.user-pnone {
|
|
|
|
font-size: 28rpx;
|
|
|
|
color: rgba(51,51,51,1);
|
|
|
|
}
|
2020-06-02 15:35:19 +08:00
|
|
|
}
|
2020-06-04 08:21:34 +08:00
|
|
|
.user-address {
|
|
|
|
font-size: 26rpx;
|
2020-06-02 15:35:19 +08:00
|
|
|
color: rgba(51,51,51,1);
|
|
|
|
}
|
|
|
|
}
|
2020-06-04 08:21:34 +08:00
|
|
|
.item-bottom {
|
|
|
|
padding-top: 30rpx;
|
2020-06-02 15:35:19 +08:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2020-06-04 08:21:34 +08:00
|
|
|
justify-content: space-between;
|
|
|
|
.item-default {
|
2020-06-02 15:35:19 +08:00
|
|
|
display: flex;
|
2020-06-04 08:21:34 +08:00
|
|
|
align-items: center;
|
|
|
|
font-size: 22rpx;
|
|
|
|
.radio-default {
|
|
|
|
color: rgba(255,119,15,1);
|
|
|
|
}
|
|
|
|
.radio-others {
|
|
|
|
color:rgba(153,153,153,1);
|
2020-06-02 15:35:19 +08:00
|
|
|
}
|
2020-06-04 08:21:34 +08:00
|
|
|
}
|
|
|
|
.address-operate {
|
|
|
|
display: flex;
|
|
|
|
font-size: 24rpx;
|
|
|
|
color: rgba(152,152,152,1);
|
|
|
|
> view {
|
|
|
|
display: flex;
|
|
|
|
&:not(:last-child) {
|
|
|
|
margin-right: 30rpx;
|
|
|
|
}
|
2020-06-08 15:23:23 +08:00
|
|
|
> image {
|
2020-06-04 08:21:34 +08:00
|
|
|
margin-right: 15rpx;
|
2020-06-08 15:23:23 +08:00
|
|
|
flex-shrink: 0;
|
|
|
|
}
|
|
|
|
&:first-child {
|
|
|
|
> image {
|
|
|
|
width: 23rpx;
|
|
|
|
height: 23rpx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
&:nth-child(2) {
|
|
|
|
> image {
|
|
|
|
width: 17rpx;
|
|
|
|
height: 21rpx;
|
|
|
|
}
|
2020-06-04 08:21:34 +08:00
|
|
|
}
|
2020-06-02 15:35:19 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-06-02 11:42:13 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
.address-btn {
|
2020-06-04 08:21:34 +08:00
|
|
|
margin: 322rpx auto 0;
|
2020-06-02 11:42:13 +08:00
|
|
|
width: 690rpx;
|
|
|
|
height: 98rpx;
|
|
|
|
background: rgba(255,119,15,1);
|
|
|
|
border-radius: 49rpx;
|
|
|
|
font-size: 36rpx;
|
|
|
|
color: rgba(255,255,255,1);
|
2020-06-02 15:35:19 +08:00
|
|
|
line-height: 98rpx;
|
2020-06-02 11:42:13 +08:00
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|