<template>
    <div class="liuyanlist">
      <back title="留言列表" buttonText="发表" buttonUrl="/LiuYan"></back>
      <div class="list" v-for="(item,index) in list" :key="index">
        <div class="shijian">
          <p>{{item.create_time}}</p>
          <p @click="goDetail(item.id)">查看详情</p>
        </div>
        <p class="neirong" v-text="item.content"></p>
      </div>
    </div>
</template>

<script>
  import Back from "../common/Back"
  import { getStore } from '@/utils/storage'
  import { Toast } from "mint-ui"
    export default {
      name: "LiuYanList",
      components:{Back},
      data(){
        return{
          list:[]
        }
      },
      mounted(){
        this.getPageData();
      },
      methods:{
        goDetail (id){
          this.$router.push({path: '/LiuYanListDetail?id=' + id});
        },
        getPageData(){
          this.getData('/Member/messageList',{token:getStore('token')}).then(
            data=>{
              if(data.code==1){
                this.list = data.data;
              }else{
                Toast(data.msg);
              }
            },
            err=>{  })
        },
      }
    }
</script>

<style lang="scss" scoped>
  .liuyanlist{
    padding-top: 5rem;
    .list{
      width: 90%;
      margin: 0.5rem  auto;
      border-bottom: 0.05rem solid #9C9C9C;
      text-align: left;
      padding-bottom: 1rem;
      .shijian{
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size:1.46rem;
        font-family:MicrosoftYaHei;
        font-weight:400;
        margin-bottom: 1rem;
        p:nth-child(1){
          color: #9E9E9E;
        }
      }
      .neirong{
        font-size:1.35rem;
        font-family:MicrosoftYaHei;
        font-weight:400;
        word-break: break-word;
      }
    }
  }
</style>
