<template>
|
<uni-popup ref="date" background-color="#fff">
|
<view class="date">
|
<view class="title">
|
<text>店铺标签</text>
|
<view class="title_icon" @click="closeDate">
|
<uni-icons color="#CCCCCB" type="closeempty" size="20"></uni-icons>
|
</view>
|
</view>
|
<view class="content">
|
<view
|
v-for="(item, index) in labels"
|
:key="index"
|
class="label-item"
|
:class="selectLabel.includes(index)?'label-sel':''"
|
@click="selectLabelAcation(index)"
|
>{{ item }}</view>
|
</view>
|
<view class="submit" @click="updata">确定</view>
|
</view>
|
</uni-popup>
|
</template>
|
|
<script>
|
export default {
|
props: {
|
labels: {
|
type: Array,
|
default: () => []
|
}
|
},
|
data() {
|
return {
|
selectLabel: [],
|
indicatorStyle: `height: 50px;`
|
}
|
},
|
methods: {
|
open() {
|
this.$refs.date.open('bottom')
|
},
|
updata() {
|
this.$emit('updata', this.selectLabel)
|
this.$refs.date.close()
|
},
|
closeDate() {
|
this.$refs.date.close()
|
},
|
selectLabelAcation(index) {
|
if (this.selectLabel.includes(index)) {
|
this.selectLabel.splice(this.selectLabel.findIndex(item => item == index), 1)
|
} else {
|
this.selectLabel.push(index)
|
}
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.date {
|
padding: 44rpx 32rpx;
|
background-color: #FFFFFF;
|
box-sizing: border-box;
|
.title {
|
width: 100%;
|
text-align: center;
|
position: relative;
|
text {
|
font-size: 32rpx;
|
font-family: PingFang SC-Semibold, PingFang SC;
|
font-weight: 600;
|
color: #333333;
|
}
|
.title_icon {
|
position: absolute;
|
right: 0;
|
top: 0;
|
}
|
}
|
.content {
|
width: 100%;
|
margin-top: 80rpx;
|
max-height: 600rpx;
|
overflow-y: scroll;
|
display: flex;
|
flex-wrap: wrap;
|
justify-content: space-between;
|
.label-item {
|
height: 70rpx;
|
background: #F2F2F2;
|
border-radius: 36rpx;
|
width: calc(33.33% - 12rpx);
|
text-align: center;
|
font-size: 26rpx;
|
font-weight: 400;
|
color: #333333;
|
line-height: 70rpx;
|
margin-bottom: 24rpx;
|
}
|
.label-sel {
|
background: #D20A0A;
|
color: #fff;
|
}
|
}
|
.submit {
|
width: 100%;
|
height: 72rpx;
|
line-height: 72rpx;
|
text-align: center;
|
background: linear-gradient(270deg, #D20A0A 0%, #D95A5A 100%);
|
border-radius: 36rpx;
|
font-size: 32rpx;
|
font-family: PingFang SC-Medium, PingFang SC;
|
font-weight: 500;
|
color: #FFFFFF;
|
margin-top: 50rpx;
|
}
|
}
|
|
|
</style>
|