<template>
  <div class="conversationDetail">
    <AiTopFixed>
      <u-tabs :list="tabList" :is-scroll="false" :current="currentTabs" height="96" bg-color="#ffffff"
        inactive-color="#666666" :bar-style="barStyle" :active-item-style="activeStyle" active-color="#3975C6 " @change="change">
      </u-tabs>
      <div class="top-search">
        <div class="left">
          <!-- <div class="color-999">开始时间-结束时间</div> -->
          <div>2023-03-01至2023-03-10</div>
        </div>
        <div class="right">
          <u-search v-model="keyword" :clearabled="true" placeholder="请输入关键词" :show-action="false" bg-color="#F5F5F5"
            search-icon-color="#999" color="#999" height="58" @search="getListInit" @clear="getListInit">
          </u-search>
        </div>
      </div>
    </AiTopFixed>
    <div class="conversation-list">
      <div v-for="(item, index) in list" :key="index">
        <div class="item item-left" v-if="item.type">
          <img src="./img/user-img.png" alt="" class="user-img">
          <div class="content">
            <span></span>
            <p>{{item.content}}</p>
          </div>
          <img src="./img/fail-icon.png" alt="" class="fail-img">
        </div>
        <div class="item item-right" v-else>
          <div class="content">
            <span></span>
            <p>{{item.content}}</p>
          </div>
          <img src="./img/user-img.png" alt="" class="user-img">
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "conversationDetail",
  data() {
    return {
      tabList: [
        {name: '全部'},
        {name: '图片/视频'},
        {name: '语音'},
        {name: '文件'}
      ],
      currentTabs: 0,
      barStyle: {
        'width': '24px',
        'height': '2px',
        'border-radius': '0',
        'bottom': '5px'
      },
      activeStyle: {
        'font-weight' : '400',
        'color': '#000000'
      },
      keyword: '',
      list: [
        {type: 0, content: '123全部全部全部全部全部全部全部全部全部全部全部全部'},
        {type: 1, content: '123'},
        {type: 0, content: '456'},
        {type: 0, content: '123'},
        {type: 1, content: '123'},
      ]
    };
  },
  onShow() {
    document.title = '会话详情'
  },
  methods: {
    change(index) {
      this.keyword = ''
      this.currentTabs = index
      this.getListInit()
    },
    getListInit() {

    },
  },
};
</script>

<style lang="scss" scoped>
.conversationDetail {
  height: 100%;
  ::v-deep .AiTopFixed {
    .placeholder {
      .content {
        padding: 0 !important;
      }
    }
    .fixed {
      margin: 0 !important;
      .content {
        padding: 0 !important;
      }
    }
  }
  .top-search {
    padding: 20px 32px;
    display: flex;
    .left {
      width: 360px;
      div {
        line-height: 64px;
      }
    }
    .right {
      width: calc(100% - 360px);
    }
  }
  .conversation-list {
    padding: 48px 32px;
    // background-color: #EBECF0;
    .item {
      margin-bottom: 48px;
      display: flex;
      .user-img {
        width: 72px;
        height: 72px;
        margin-right: 20px;
      }
      .content {
        max-width: calc(100% - 144px);
        position: relative;
        span {
          width: 0px;
          height: 0px;
          border: 10px solid transparent;
          position: absolute;
          top: 20px;
        }
        p {
          display: inline-block;
          padding: 14px 54px 14px 32px;
          background-color: #fff;
          font-family: PingFangSC-Regular;
          font-size: 32px;
          color: #333;
          word-break: break-all;
        }
      }
      .fail-img {
        width: 32px;
        height: 32px;
        margin: auto 0 auto 24px;
      }
    }
    .item-left {
      .content {
        span {
          left: -18px;
          border-right-color: #fff;
        }
      }
    }
    .item-right {
      width: 100%;
      justify-content: right;
      .user-img {
        margin: 0 0 0 20px;
      }
      .content {
        span {
          border-left-color: #C7E7FE;
          right: -18px;
        }
        p {
          background-color: #C7E7FE;
          padding: 14px 32px 14px 54px;
        }
      }
    }
  }
}
</style>