<template>
  <div class='top'>
    <div class="releaseRecord" @click="gotoRecord">
        <svg-icon class="releaseRecord-icon" name="pulishIcon" />
        <div class="releaseRecord-text">发布记录</div>
    </div>
    <div class="search">
      <svg-icon class="search-icon" name="search" />
      <span>搜索</span>
    </div>
    <div class="publish">发布</div>
  </div>

  <div class="content">
    <div class="content-item" v-for="item in 10">
      <div class="item-header">
        <van-image class="avatar" round src="https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg"/>
        <div class="user-info">
          <div class="nickname">丝竹绵绵</div>
          <div class="desc">阳光玫瑰葡萄爆汁 + 埃塞冷萃一口喝到夏天穿白衬衫的少年感🍃👉 今天前20杯送“发呆专用”杯套</div>
          <van-image class="main-img" round src="https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg"/>
          <div class="item-footer">
            <div class="time">8小时前23分钟前</div>
            <svg-icon class="actions-icon" name="more1" />
          </div>
          <div class="like-row">
            <van-image v-for="n in 4" :key="n" class="like-avatar" round src="https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg"/>
          </div>
          <div class="comment-list">
              <div class="comment-item">
                <van-image class="comment-avatar" round src="https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg"/>
                  <span class="comment-nickname">甘比</span>
                  <span class="comment-time">12:34</span>
                  <div class="comment-content">可以送我一杯吗</div>
              </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
const router = useRouter();
const gotoRecord = () => {
  router.push('record')
}
</script>

<style lang="less" scoped>
.top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  .releaseRecord{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 112px;
    height: 32px;
    background: #FFFFFF;
    border-radius: 23px;
    text-align: center;
    box-sizing: border-box;

    .releaseRecord-icon {
      width: 24px;
      height: 24px;
      margin-top: 8px;
      margin-right: 2px;
    }
    .releaseRecord-text {
      font-family: PingFang SC, PingFang SC;
      font-weight: 400;
      font-size: 15px;
      color: #000000;
    }
  }

  .search{
    flex: 1;
    height: 32px;
    background: #FFFFFF;
    border-radius: 23px;
    opacity: 0.5;
    padding: 6px;
    box-sizing: border-box;
    margin: 0 12px;
    font-family: PingFang SC, PingFang SC;
    font-weight: 500;
    font-size: 15px;
    color: #95A9ED;
    display: flex;
    align-items: center;
    .search-icon{
      height: 24px;
      width: 24px;
      margin-right: 2px;
    }
  }

  .publish{
    width: 62px;
    height: 32px;
    line-height: 32px;
    background: #4765DD;
    border-radius: 23px;
    text-align: center;
    font-family: PingFang SC, PingFang SC;
    font-weight: 500;
    font-size: 15px;
    color: #FFFFFF;
    font-style: normal;
    text-transform: none;
    box-sizing: border-box;
  }
}

.content {
  flex: 1;
  overflow: auto;
  margin-top: 16px;
  .content-item {
    background: #FFFFFF;
    border-radius: 16px;
    margin: 0 16px 16px;
    padding: 12px;
    box-sizing: border-box;
    .item-header {
      display: flex;
      align-items: flex-start;

      .avatar {
        width: 42px;
        height: 42px;
        margin-right: 12px;
        flex-shrink: 0;
      }

      .user-info {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        min-width: 0;

        .nickname {
          font-family: PingFang SC, PingFang SC;
          font-weight: 500;
          font-size: 15px;
          color: #4765DD;
          margin-bottom: 4px;
        }

        .desc {
          font-family: PingFang SC, PingFang SC;
          font-weight: 400;
          font-size: 12px;
          color: #000000;
          margin-bottom: 3px;
          line-height: 1.5;
          word-break: break-all;
        }

        .main-img {
          width: 134px;
          height: 120px;
          border-radius: 8px;
          margin-bottom: 10px;
        }

        .item-footer {
          display: flex;
          justify-content: space-between;
          align-items: center;
          width: 100%;
          margin-bottom: 10px;

          .time {
            font-family: PingFang SC, PingFang SC;
            font-weight: 400;
            font-size: 10px;
            color: #8D8D8D;
          }
          .actions-icon{
            width: 12px;
            height: 10px;
          }
        }

        .like-row {
          display: flex;
          align-items: center;
          margin-bottom: 8px;
          .like-avatar {
            width: 18px;
            height: 18px;
            margin-right: 4px;
          }
        }

        .comment-list {
            width: 267px;
            background: #F2F2F2;
            border-radius: 8px;
            padding: 8px;
          .comment-item {
            display: flex;
            align-items: center;
            flex-wrap: wrap;

            .comment-avatar {
              width: 18px;
              height: 18px;
              margin-right: 8px;
            }
            .comment-nickname {
                font-family: PingFang SC, PingFang SC;
                font-weight: 400;
                font-size: 12px;
                color: #4765DD;
                text-align: left;
                font-style: normal;
                text-transform: none;
            }
            .comment-time {
                font-family: PingFang SC, PingFang SC;
                font-weight: 400;
                font-size: 12px;
                color: #8D8D8D;
                font-style: normal;
                text-transform: none;
                margin-left: auto;
            }
            .comment-content {
                width: 100%;
                font-family: PingFang SC, PingFang SC;
                font-weight: 400;
                font-size: 12px;
                color: #000000;
                margin-left: 32px;
                margin-top: 4px;
                word-break: break-all;
                white-space: normal;
            }
          }
        }
      }
    }
  }
}
.content::-webkit-scrollbar{
  width: 0;
}
</style>