<template>
<div class='container'>
  <navigator class='assess-item' v-for="(comment,k) in commentList" :key="k">
    <div class='head'>
      <img src='/static/imgs/avatar.png'>
      <div>
        <span class='name'>{{comment.wxUser.wx_Name}}</span><span class="type">[问题类别：{{comment.consultantTag.lawCategory.cate_Name}}]</span>
        <p class='time'>{{comment.createDate}}</p>
      </div>
    </div>
    <div class='way'>
      <span>响应速度：</span>
      <image src='/static/imgs/flower_on.png' v-for="n in comment.reponspeed" :key="n"></image>
      <image src='/static/imgs/flower.png' v-for="m in 5-comment.reponspeed" :key="m"></image>
    </div>
    <div class='way'>
      <span>服务态度：</span>
      <image src='/static/imgs/flower_on.png' v-for="n in comment.serviceatd" :key="n"></image>
      <image src='/static/imgs/flower.png' v-for="n in 5-comment.serviceatd" :key="m"></image>
    </div>
    <div class='way'>
      <span>解决问题：</span>
      <image src='/static/imgs/flower_on.png' v-for="n in comment.solvePrm" :key="n"></image>
      <image src='/static/imgs/flower.png' v-for="n in 5-comment.solvePrm" :key="m"></image>
    </div>
    <div class='assess'>{{comment.eltdescription}}</div>
    <div class='question'>
      <div class='title'>{{comment.qainfo.consultant_Content}}</div>
      <div class='time'>{{comment.qainfo.replay_Date}}</div>
      <div class='content'><span>我的回复：</span>{{comment.qainfo.consultant_Reply}}</div>
    </div>
  </navigator>
 <!-- <NoData v-if='loaded && commentList.length==0' paddingTop=176 />-->
  </div>
</template>
<script>
  import NoData from '@/components/NoData'
  export default {
    components: {NoData},
    data() {
      return {
        commentList: [],
        loaded: false
      }
    },
    methods: {
      loadComment() {
        this.loaded = false
        wx.showLoading({title: '正在加载'})
        wx.request({
          url: this.rootUrl + '/comment/list',
          data: {sessionID: wx.getStorageSync('sessionID')},
          success: res => {
            if (res.statusCode == '500') {
              this.service.getUnionId(this.rootAvatar, this.rootUrl).then(res => this.loadComment())
            } else {
              console.log(res.data)
              this.commentList = []
              var commentList = res.data
              commentList.forEach(v => {
                // const timeObj = this.service.formatDate(new Date(v.createDate))
                v.createDate = this.service.correctTime(v.createDate, 'full')
                // v.createDate = timeObj
                v.qainfo.replay_Date = this.service.correctTime(v.qainfo.replay_Date, 'full')
                // const timeObjtwo = this.service.formatDate(new Date(v.qainfo.replay_Date))
                // v.qainfo.replay_Date = timeObjtwo
              })
              this.commentList = res.data
              this.loaded = true
              wx.hideLoading()
            }
          },
          fail: res => {
            wx.hideLoading()
            wx.showToast({title: '加载失败', icon: 'none'})
          }
        })
      },
    },
    onLoad() {
      this.loadComment()
    }
  }
</script>
<style lang="stylus" scoped>
.container
  position absolute
  min-height 100%
  width 100%
  Background()
.assess-item
  padding 25rpx
  margin-bottom 20rpx
  background white
.head
  Flex(flex, , center)
  img
    Height_Width(80rpx)
    border-radius 50%
    margin-right 20rpx
  div
    .name
      Font(30rpx)
    .type
      margin-left 20rpx
      color #aa001a
      font-size 28rpx
    .time
      margin-top 15rpx
      Font(26rpx)
      color #777
.way
  margin-top 15rpx
  width 100%
  display flex
  align-items center
.way span
  margin-right 10rpx
  color #333
  font-size 30rpx
.way image
  margin-right 20rpx
  width 40rpx
  height 40rpx
.assess
  Font(30rpx,45rpx)
  margin 20rpx 0
  text-align justify
.question
  padding 25rpx
  background #f6f6f6
  border 1rpx solid #eee
  Font(28rpx)
  .title
    Font(30rpx, 35rpx, bold)
  .time
    Font(28rpx)
    color #888
    margin 20rpx 0
  .content
    text-overflow ellipsis
    line-height 40rpx
    text-align justify
    span
      color #777
</style>

