EvaluateItem.vue 2.08 KB
<template>
  <div :class="['share-item', { hideBorder }]">
    <div class="content">
      <div class="user-info flex">
        <div>
          <img class="icon-head" :src="item.imageUrl" />
          <!-- <div v-else class="sprite-icon icon-avatar"></div> -->
        </div>
        {{ item.name }}
      </div>
      <div :class="['text', { 'text-two-line': indexType }]" v-text="item.experience"></div>
      <div :class="['img-box', { four: indexType }]">
        <template v-for="(i, index) in item.activityExperienceImgs">
          <div @click="jumpPreview(index)" v-if="indexType ? index < 4 : true" class="img-item" :key="index">
            <img :src="i.imageUrl" />
          </div>
        </template>
      </div>
    </div>
  </div>
</template>

<script type="text/ecmascript-6">
export default {
  name: 'EvaluateItem',
  props: {
    hideBorder: Boolean,
    indexType: Boolean,
    item: {
      type: Object,
      default: () => { }
    },
    num: Number,
    // 显示默认或真实数据头像和昵称,1-默认;2-真实数据
    showAvatarNicknameFlag: Number
  },
  data() {
    return {
    }
  },
  mounted() {
  },
  methods: {
    jumpPreview(index) {
      let { activityExperienceImgs, experience } = this.item, item = []
      activityExperienceImgs.map(e => item.push(e.imageUrl))
      this.to('crowdfunding.imagePreview', { item, index, experience })
    }
  }
}
</script>

<style scoped lang="scss">
@import '@/assets/css/sharegoods.scss';
.user-info {
  padding: 14px 0 10px;
  font-size: 16px;
  font-weight: 600;
  color: #282829;
  .sprite-icon {
    margin-right: 8px;
  }
}
.icon-head {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin-right: 8px;
}
.text {
  font-size: 14px;
  color: #282829;
  line-height: 20px;
  margin-bottom: 13px;
  word-break: break-all;
  line-break: anywhere;
}
.img-box {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  .img-item {
    width: 110px;
    height: 110px;
    border-radius: 4px;
    overflow: hidden;
  }
}
.img-box.four {
  gap: 8px;
  flex-wrap: nowrap;
  .img-item {
    width: 75px;
    height: 75px;
  }
}
</style>