ResourcePopup.vue 3.33 KB
<template>
  <van-popup
    v-model="show"
    round
    position="bottom"
    class="popup"
    @close="close"
  >
    <div class="content">
      <div class="title flex">
        会员套餐名称
        <div class="all flex">
          <template v-if="true">
            <div class="sprite-icon icon-active"></div>
          </template>
          <template v-else>
            <div class="radio"></div>
          </template>
          全选
        </div>
      </div>
      <div class="img-box">
        <template v-for="(item,ind) in 17">
          <div
            :key="ind"
            class="item"
          >
            <img src="@/assets/images/test.jpg">
            <div class="radio-box">
              <template v-if="item.active">
                <div class="sprite-icon icon-active"></div>
              </template>
              <template v-else>
                <div class="radio">

                </div>
              </template>
            </div>
          </div>
        </template>
      </div>
      <div class="footer flex">
        <div
          class="cancel text-center"
          @click="close"
        >取消</div>
        <div class="confirm text-center">确定</div>
      </div>
    </div>
  </van-popup>
</template>

<script type='text/ecmascript-6'>
export default {
  name: 'ResourcePopup',
  props: ['value'],
  data () {
    return {
      show: false
    }
  },
  watch: {
    'value' (n) {
      this.show = n
    }
  },
  mounted () {
  },
  methods: {
    close () {
      this.show = false
      this.$emit('close')
    }
  }
}
</script>

<style scoped lang='scss'>
.popup {
  height: 510px;
  .content {
    height: 100%;
    .title {
      height: 56px;
      padding: 0 16px;
      font-weight: 500;
      font-size: 16px;
      color: #333333;
      .all {
        margin-left: auto;
        font-weight: 400;
        color: #3a3a3a;
        font-size: 14px;
        .radio {
          width: 20px;
          height: 20px;
          box-sizing: border-box;
          border: 1.5px solid #999999;
          border-radius: 100%;
          overflow: hidden;
        }
        .sprite-icon,
        .radio {
          margin-right: 4px;
        }
      }
    }
    .img-box {
      padding: 4px 26px;
      display: flex;
      flex-wrap: wrap;
      box-sizing: border-box;
      height: 405px;
      overflow-y: scroll;
      .item {
        width: 102px;
        height: 102px;
        margin-bottom: 10px;
        margin-right: 8px;
        position: relative;
        &:nth-of-type(3n + 3) {
          margin-right: 0;
        }
        .radio-box {
          position: absolute;
          bottom: 2px;
          right: 2px;
          .radio {
            width: 20px;
            height: 20px;
            background: #999999;
            box-sizing: border-box;
            border: 1.5px solid #fff;
            border-radius: 100%;
            overflow: hidden;
          }
        }
      }
    }
    .footer {
      height: 49px;
      padding: 0 16px;
      justify-content: space-between;
      div {
        width: 164px;
        height: 38px;
        border: 1px solid transparent;
        font-size: 14px;
        border-radius: 100px;
      }
      .cancel {
        border-color: #dcdee0;
        color: #323233;
      }
      .confirm {
        border-color: #3975C6;
        color: #fff;
        background: #3975C6;
      }
    }
  }
}
</style>