<template>
  <div v-if="list.length > 0">
    <van-cell v-for="item in list" :key="item.linkId"
      @click="$router.push({ name: 'communicate-detail', query: { linkId: item.linkId } })">
      <div class="d-flex justify-content-between">
        <div class="name1 text-start">
          <van-tag :class="item.tagColor" size="medium">{{ item.linkTypeName }}</van-tag>
        </div>
        <div class="name1 stockNames balck-text-color">{{ item.stockNames ? item.stockNames : '' }}</div>
      </div>
      <div class="d-flex justify-content-between my-2">
        <div class="van-ellipsis name2 flex-1 text-start balck-text-color">{{ item.cusName }}</div>
        <div class="van-ellipsis name2 flex-1 text-end balck-text-color">{{ item.cusUserName }}</div>
      </div>
      <div class="van-multi-ellipsis--l2 note my-2 text-start">{{ item.linkNote }}</div>
    </van-cell>
  </div>
  <van-empty v-else description="暂无沟通" />
</template>
<script setup lang="ts">
defineProps({
  list: {
    type: Array<any>,
    default: []
  }
})
</script>

<style lang="scss" scoped>
.van-cell {
  .name1 {
    font-size: 16px;
    line-height: 22px;
    font-weight: 500;
    flex: 1;
  }
  .stockNames {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .note {
    font-size: 12px;
    line-height: 14px;
  }
}
.empty {
  color: #808080;
  font-size: 14px;
}
.my-2 {
  margin: 2px 0;
}
:deep(.van-empty__image) {
  width: 80px;
  height: 80px;
}
</style>