<template>
  <div class="get-red" @click="_showRed(2, info.redpacketId)">
    <div class="tip">
      <i class="icon"></i>
      {{ info.userNick }}通过分享获得了
      <em>{{ info.money }}</em>
      元红包
    </div>
  </div>
</template>

<script>
import { mapMutations } from 'vuex';
export default {
  name: 'pc-chat-red-share-tip',
  props: {
    info: {}
  },
  methods: {
    ...mapMutations({
      set_showRedInfo: 'set_showRedInfo'
    }),
    _showRed(type, id) {
      const obj = {
        type: type,
        id: id
      };
      this.set_showRedInfo(obj);
    }
  }
};
</script>

<style lang="less" scoped>
.get-red {
  .tip {
    line-height: 25px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--chat-color);
    background: var(--chat-bg);
    .icon {
      display: inline-block;
      vertical-align: middle;
      width: 22px;
      height: 22px;
      background-image: url('./img/icon-red.png');
      background-repeat: no-repeat;
      background-size: 20px auto;
      background-position: center center;
    }
    em {
      color: #d84e43;
    }
  }
}
</style>
