<template>
  <div class="reward-info">
    <div class="tip">
      <i class="icon"></i>
      <em>{{ info.userNick }}</em>
      赠送
      <img :src="giftImg" />
      {{ gift.name }}
      <em>* {{ gift.num }}</em>
    </div>
  </div>
</template>
<script>
export default {
  name: 'pc-chat-reward-gift',
  props: {
    info: {}
  },
  computed: {
    gift() {
      return JSON.parse(this.info.filterContent || '{}');
    },
    giftImg() {
      return this.gift.img || `${process.env.DEF_OSS}/static/reward/gift-${this.gift.imgType}.png`;
    }
  }
};
</script>

<style lang="less" scoped>
.reward-info {
  .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;
      vertical-align: middle;
      width: 22px;
      height: 22px;
      background-image: url('./img/icon-gift.png');
      background-repeat: no-repeat;
      background-size: 20px auto;
      background-position: center center;
    }
    em {
      color: #d84e43;
    }
    img {
      vertical-align: middle;
      height: 30px;
    }
  }
}
</style>
