<template>
  <view>
    <view class="Evaluate-content">
      <view v-for="(item, index) in comments" :key="index">
        <view class="commnet-user flex">
          <image :src="item.user.avatar" style="width: 40px; height: 40px; border-radius: 50%" />
          <view class="commnet-user-middle flex">
            <view class="name flex">{{ item.user.nickname }}</view>
            <u-rate
              class="rate"
              :value="item.score"
              readonly
              :size="12"
              gutter="1"
              active-color="#ffa500"
            />
          </view>
          <view class="time">{{ item.createTime }}</view>
        </view>
        <view class="commnet-text">{{ item.content }}</view>
        <view class="commnet-img">
          <image
            class="img"
            v-for="(img, index) in item.attachments"
            :key="index"
            :src="url"
            mode="widthFix"
          />
        </view>
      </view>

      <u-empty
        v-if="comments.length == 0"
        mode="message"
        icon="http://cdn.uviewui.com/uview/empty/message.png"
      ></u-empty>
    </view>
  </view>
</template>

<script>
export default {
  props: {
    comments: {
      type: Array,
      default: [],
    },
  },
};
</script>

<style lang="less" scoped></style>
