zhangwei
2024-08-27 71d2e42ae642cecb5e8f6776c702cd20bafe6c01
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<template>
    <view>
        <view class="item" v-for="(res, index) in siteList" :key="res.id">
            <view class="top">
                <view class="name">{{ res.name }}</view>
                <view class="phone">{{ res.phone }}</view>
                <view class="tag">
                    <text v-for="(item, index) in res.tag" :key="index" :class="{red:item.tagText=='默认'}">{{ item.tagText }}</text>
                </view>
            </view>
            <view class="bottom">
                广东省深圳市宝安区 自由路66号
                <up-icon name="edit-pen" :size="40" color="#999999"></up-icon>
            </view>
        </view>
        <view class="addSite" @tap="toAddSite">
            <view class="add">
                <up-icon name="plus" color="#ffffff" class="icon" :size="30"></up-icon>新建收货地址
            </view>
        </view>
    </view>
</template>
 
<script>
export default {
    data() {
        return {
            siteList: []
        };
    },
    onLoad() {
        this.getData();
    },
    methods: {
        getData() {
            this.siteList = [
                {
                    id: 1,
                    name: '游X',
                    phone: '183****5523',
                    tag: [
                        {
                            tagText: '默认'
                        },
                        {
                            tagText: '家'
                        }
                    ],
                    site: '广东省深圳市宝安区 自由路66号'
                },
                {
                    id: 2,
                    name: '李XX',
                    phone: '183****5555',
                    tag: [
                        {
                            tagText: '公司'
                        }
                    ],
                    site: '广东省深圳市宝安区 翻身路xx号'
                },
                {
                    id: 3,
                    name: '王YY',
                    phone: '153****5555',
                    tag: [],
                    site: '广东省深圳市宝安区 平安路13号'
                }
            ];
        },
        toAddSite(){
            uni.navigateTo({
                url: '/pages/template/address/addSite'
            });
        }
    }
};
</script>
 
<style lang="scss" scoped>
.item {
    padding: 40rpx 20rpx;
    .top {
        display: flex;
        font-weight: bold;
        font-size: 34rpx;
        .phone {
            margin-left: 60rpx;
        }
        .tag {
            display: flex;
            font-weight: normal;
            align-items: center;
            text {
                display: block;
                width: 60rpx;
                height: 34rpx;
                line-height: 34rpx;
                color: #ffffff;
                font-size: 20rpx;
                border-radius: 6rpx;
                text-align: center;
                margin-left: 30rpx;
                background-color:rgb(49, 145, 253);
            }
            .red{
                background-color:red
            }
        }
    }
    .bottom {
        display: flex;
        margin-top: 20rpx;
        font-size: 28rpx;
        justify-content: space-between;
        color: #999999;
    }
}
.addSite {
    display: flex;
    justify-content: space-around;
    width: 600rpx;
    line-height: 100rpx;
    position: absolute;
    bottom: 30rpx;
    left: 80rpx;
    background-color: red;
    border-radius: 60rpx;
    font-size: 30rpx;
    .add{
        display: flex;
        align-items: center;
        color: #ffffff;
        .icon{
            margin-right: 10rpx;
        }
    }
}
</style>