<view class="content">
      <view :class="index==colin?'c-contents':'c-content'" v-for="(item, index) in hswt" :key="item.id" @tap="dhsaa":data-msgs="item">
          <text :class="index==colin?'c-content2':'c-content1'" >{{item.value}}</text>
      </view>
      <view class="confrim-btn" >
                进入投放
      </view>
 </view>
export default {
        data() {
            return {
                colin:0, //选中的某项
                item: {}, //柜子的信息
                munber: 6, //柜子数量
                show: false, //弹框
                hswt: [{
                        id: 1,
                        value: '一件套'
                    },
                    {
                        id: 2,
                        value: '四件套'
                    },
                    {
                        id: 3,
                        value: '六件套'
                    }
                ]

            }
        },
        }
 dhsaa(e) {
       let item = e.currentTarget.dataset.msgs
       console.log(item, 'item')
       this.colin = item.id-1
  },

    .content {
        width: 640rpx;
        height: 460rpx;
        background: #F6F6F6;
        border-radius: 14rpx;

        display: flex;
        /*   justify-content: center; */
        flex-direction: column;
        align-items: center;
        align-self: center;
    }

    .c-contents {
        display: flex;
        align-items: center;
        align-self: center;
        justify-content: center;
        flex-direction: column;
        width: 500rpx;
        height: 80rpx;
        border: 1rpx solid #46C1D5;
        background: #EFEFEF;
        border-radius: 12rpx;
        margin-top: 20rpx;
    }

    .c-content {
        display: flex;
        align-items: center;
        align-self: center;
        justify-content: center;
        flex-direction: column;
        width: 500rpx;
        height: 80rpx;
        background: #EFEFEF;
        border-radius: 12rpx;
        margin-top: 20rpx;

    }

    .c-content1 {
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 28rpx;
        font-family: PingFang SC;
        font-weight: 500;
        color: #5D5F5B;
    }

    .c-content2 {
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 28rpx;
        font-family: PingFang SC;
        font-weight: 500;
        color: #46C1D5;
    }
Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐