<template>
  <div class="seeRed" :class="{ 'z-lock': onlySeeRed }" @click="_toggle">
    <i class="icon"></i>
    <span class="t">红包</span>
  </div>
</template>
<script>
import { mapGetters, mapMutations } from 'vuex';

export default {
  name: 'suspension-seeRed',
  data() {
    return {
      info: {}
    };
  },
  computed: {
    ...mapGetters({
      onlySeeRed: 'onlySeeRed'
    })
  },
  methods: {
    ...mapMutations({
      set_onlySeeRed: 'set_onlySeeRed'
    }),
    _toggle() {
      this.set_onlySeeRed(!this.onlySeeRed);
    }
  }
};
</script>
<style lang="less" scoped>
.seeRed {
  padding: 0.02rem;
  width: 0.8rem;
  height: 0.32rem;
  background-color: #c8c8c8;
  border-radius: 0.32rem;
  font-size: 0;
  white-space: nowrap;
  cursor: pointer;
  .icon {
    vertical-align: middle;
    display: inline-block;
    width: 0.28rem;
    height: 0.28rem;
    border-radius: 100%;
    background-color: #fff;
    background-image: url(./img/unlock.png);
    background-repeat: no-repeat;
    background-position: center center;
    background-size: auto 0.2rem;
  }
  .t {
    vertical-align: middle;
    display: inline-block;
    padding-left: 0.06rem;
    line-height: 0.28rem;
    font-size: 0.16rem;
    color: #fff;
  }
  &.z-lock {
    background-color: #ff4040;
    .icon {
      background-image: url(./img/lock.png);
    }
  }
}
</style>
