<template>
<div class='container'>
  <!--未读列表-->
  <!-- <navigator url='../noticeInfo/main'>
    <div class="list">
      <p>汉阳司法局将于2019年10月30日09:00~11:00在鹦鹉花园社区进行法律知识讲座</p>
      <span>2019-10-28 10:44</span><span class="line">|</span><span>汉阳司法局</span>
    </div>
  </navigator> -->
  <navigator v-for='(v,i) in noticeList' :key='i' :url="'../noticeInfo/main?id='+v.data.sysMessage.id" >
    <div class="list">
      <p> {{v.data.sysMessage.messageTitle}}</p>
      <span>{{v.data.sysMessage.sendDate}}</span><span class="line">|</span><span>{{v.data.sysMessage.publishingUnit}}</span>
      <div v-if='v.data.readState==1' class="read"></div>
    </div>
  </navigator>
  <!--未读列表-->
  <!--已读列表-->
  <!-- <div class="list">
    <p>汉阳司法局将于2019年10月30日09:00~11:00在鹦鹉花园社区进行法律知识讲座</p>
    <span>2019-10-28 10:44</span><span class="line">|</span><span>汉阳司法局</span>
    <div class="read"></div>
  </div> -->
  <!--已读列表-->
  <!--已读列表-->
  <!-- <div class="list">
    <p>汉阳司法局将于2019年10月30日09:00~11:00在鹦鹉花园社区进行法律知识讲座</p>
    <span>2019-10-28 10:44</span><span class="line">|</span><span>汉阳司法局</span>
    <div class="read"></div>
  </div> -->
  <!--已读列表-->
  <!--已读列表-->
  <!-- <div class="list">
    <p>汉阳司法局将于2019年10月30日09:00~11:00在鹦鹉花园社区进行法律知识讲座</p>
    <span>2019-10-28 10:44</span><span class="line">|</span><span>汉阳司法局</span>
    <div class="read"></div>
  </div> -->
  <!--已读列表-->
  <NoData v-if='loaded && noticeList.length==0' paddingTop=182 />
</div>
</template>

<script>
import NoData from '@/components/NoData'
export default {
  components: { NoData },
  data() {
    return {
      loaded: false,
      noticeList: null
    }
  },
  methods: {
    // 取通知公告列表
    getNoticeList()  {
      this.loaded = false
      wx.request({
        url: this.rootUrl + '/notice/getNoticeList',
        data: { sessionID: wx.getStorageSync('sessionID'),
          sendType: "1"
        },
        success: res => {
          console.log(res.data)
          this.loaded = true
          this.noticeList=res.data
          if(undefined != res.data && null != res.data){
            this.noticeList.forEach(v=>{
              v.data.sysMessage.sendDate = this.service.correctTime(v.data.sysMessage.sendDate,'full')
            })
          }
        }
      })
    }
  },
  onShow() {
    this.getNoticeList()
  }
}
</script>
<style lang="stylus" scoped>
.container
  position absolute
  Height_Width(100%)
  Background()
.list
  margin 20rpx
  width calc(100% - 40rpx)
  box-sizing border-box
  padding 20rpx
  border-radius 12rpx
  background-color #fff
  position relative
.list p
  margin-bottom 10rpx
  line-height 50rpx
  overflow hidden
  text-overflow ellipsis
  display -webkit-box
  -webkit-line-clamp 2
  -webkit-box-orient vertical
.list span
  font-size 28rpx
  color #999
.line
  margin 0 20rpx
  color #999
.read
  width 100%
  height 100%
  position absolute
  top 0
  left 0
  z-index 100
  background-color rgba(255,255,255,.5)
</style>

