position.vue
1.4 KB
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
<template>
<view class="minBox">
<view class="flexA">
<image src="/static/BulkLocation@2x.png" mode="" style="width: 48rpx;height: 48rpx;"></image>
<view class="city">定位城市</view>
</view>
<view class="underConstruction">
(其他城市门店正在建设中)
</view>
<view class="citiList">
<view class="cityBox flexC" v-for="(item,index) in cityList" :key="item.id" @click="selectCity(index)" :class="bgColor==index?'color':'colors'">
{{item.name}}
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
cityList: [{id:1,name:'北京'},{id:2,name:'天津'},{id:3,name:'上海'}],
bgColor:0,
}
},
methods: {
selectCity(index) {
console.log(index)
this.bgColor = index
}
},
}
</script>
<style lang="scss">
.minBox{
margin: 32rpx;
}
.city{
color: rgba(0,0,0,0.9);
font-size: 32rpx;
font-weight: 700;
margin-left: 24rpx;
margin-bottom: 2rpx;
}
.color{
background-color: #EBF9ED;
}
.colors{
background-color: #F6F6F6;
}
.underConstruction{
color: rgba(0,0,0,0.4);
font-size: 24rpx;
font-weight: 400;
margin:16rpx 0 48rpx 72rpx;
}
.citiList{
display: flex;
justify-content:space-between;
flex-wrap: wrap;
.cityBox {
color: rgba(0,0,0,0.9);
font-size: 32rpx;
font-weight: 700;
width: 218rpx;
height: 104rpx;
border-radius: 0 20rpx 0 20rpx;
}
}
</style>