<template>
  <div class="get-red" @click="_showRed(5, info.redpacketId)">
    <div class="tip">
      <i class="icon"></i>
      {{ info.userNick }}领取了
      <em>{{ info.redFrom }}</em>
      的一个商家红包
      <em>{{ info.money }}</em>
      元
    </div>
  </div>
</template>

<script>
import { mapMutations } from 'vuex';
export default {
  name: 'pc-chat-red-business-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>
