position.vue 1.4 KB
<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>