<template>
  <div id="list-1">
    <van-col span="24" class="main">
      <van-col span="24" class="list" v-for="(item, index) in list" :key="index">
        <van-col span="24" class="other">
          <van-col span="24" class="otherInfo">
            <span>{{ item.content || '暂无' }}</span>
          </van-col>
          <van-col span="24" class="otherInfo">
            发送时间：<span>{{ item.create_time || '暂无' }}</span>
          </van-col>
          <van-col span="24" class="otherInfo">
            是否已读：<span>{{ item.is_read ? '已读' : '未读' }}</span>
          </van-col>
        </van-col>
        <van-col span="24" class="btn" v-if="item.is_read == false">
          <van-button size="small" type="info" @click="update(item)">取消提醒</van-button>
        </van-col>
      </van-col>
    </van-col>
  </div>
</template>

<script>
import { mapState, createNamespacedHelpers } from 'vuex';
export default {
  name: 'list-1',
  props: {
    list: { type: Array },
  },
  components: {},
  data: function () {
    return {};
  },
  created() {},
  methods: {
    update(data) {
      this.$emit('update', data);
    },
  },
  computed: {
    ...mapState(['user']),
  },
  metaInfo() {
    return { title: this.$route.meta.title };
  },
  watch: {
    test: {
      deep: true,
      immediate: true,
      handler(val) {},
    },
  },
};
</script>

<style lang="less" scoped>
.main {
  padding: 8px 0 0 0;
  .list {
    background-color: #fff;
    margin: 0 0 8px 0;
    padding: 8px;
    border-radius: 5px;
    .title {
      font-size: 16px;
      font-weight: bold;
      margin: 0 0 5px 0;
    }
    .other {
      margin: 0 0 5px 0;
      .otherInfo {
        font-size: 14px;
        color: #666;
        margin: 0 0 5px 0;
        span {
          color: #000;
          line-height: 20px;
        }
      }
    }
    .btn {
      text-align: center;
      .van-button {
        margin: 0 5px;
      }
    }
  }
}
</style>
