<template>
  <div class="msg-tips" :class="showTips ? 'show-tips' : 'hide-tips'">
    <el-card class="tips-card">
      <div class="tips-wr">
        <div class="tips-wr-title">通知提醒</div>
        <div class="tips-wr-name">{{ info.typeName }}</div>
        <div class="tips-wr-desc">{{ info.content }}</div>
        <div class="tips-wr-time">{{ info.remindTime }}</div>
        <div class="tips-btn">
          <el-button type="text" size="small" @click="handleClose">我知道了</el-button>
          <el-button class="diy-button--search" size="small" @click="handleLook">查看详情</el-button>
        </div>
      </div>
    </el-card>
  </div>
</template>

<script>
export default {
  props: {
    show: {
      type: Boolean,
      default: true
    },
    info: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      showTips: false
    }
  },
  created() {
    this.showTips = this.show
  },
  methods: {
    handleClose() {
      this.showTips = false
      this.$emit('close')
    },
    handleLook() {
      this.$emit('look')
    }
  }
}
</script>

<style lang="scss" scoped>
.msg-tips {
  position: fixed;
  right: 0;
  z-index: 999;
  transition: bottom .5s;
  .tips-card {
    width: 400px;
    height: 200px;
    background: #fff;
  }
  .tips-wr-title {
    font-size: 16px;
    color: #3E8EF7;
  }
  .tips-wr-name {
    margin-top: 10px;
    padding-left: 20px;
    font-weight: bold;
  }
  .tips-wr-desc {
    width: 100%;
    height: 33px;
    margin-top: 10px;
    padding-left: 20px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;

  }
  .tips-wr-time {
    margin-top: 10px;
    padding-left: 20px;
  }
  .tips-btn {
    display: flex;
    align-items: center;
    justify-content: space-around;
    width: 100%;
    box-sizing: border-box;
    margin-top: 10px;
    padding: 0 20px;
    text-align: center;
  }
}
.hide-tips {
  bottom: -220px;
  
}
.show-tips {
  bottom: 0px;
}
</style>