<template>
  <div class="list-box">
    <div class="title">My download</div>
    <div class="list">
      <div class="item" v-for="(v,i) in 3" :key="i">
        <img src="" alt="">
        <div class="item_content">
          <div class="item_content_title">
            <img src="" alt="">
            <div>
              China Industrial Park Industry Market In-depth Research and Investment Strategy Planning Report 2024-2030
            </div>
          </div>
          <div class="item_content_format"> Download file format： <span>PDF</span></div>
        </div>
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { ref, reactive, onMounted } from "vue";
import { NButton, NPagination, NEmpty, createDiscreteApi } from "naive-ui";
import { useRouter, useRoute } from "vue-router";
const router = useRouter(); // 传递参数
const props = defineProps({
  isMobile: {
    type: Boolean,
    default: false,
  },
});

const queryParams = reactive({
  pageNo: 1,
  pageSize: 5,
});

const pageData = ref({});

onMounted(() => {
  getList();
});

const message = createDiscreteApi(["message"]);

const getList = async () => {
  const { code, data } = await getMyDoen_Api(queryParams);
  if (code === 200) {
    pageData.value = data;
  }
};

const toDetail = (item: object) => {
  router.push({
    name: "bulletinDetail",
    params: {
      webTitle: item?.report?.webTitle + "-" + item?.report?.id,
    },
  });
};

// 改变页数
const changePage = (page: number) => {
  document.documentElement.scrollTop = 0;
  queryParams.pageNo = page;
  getList();
};
</script>

<style lang="scss" scoped>
@import "~/assets/css/tool.scss";
.list-box {
  .title {
    font-size: var(--size-24);
    font-family: Arial, Arial-Bold;
    font-weight: 700;
    color: #1a1a1a;
    line-height: var(--size-44);
    padding-bottom: var(--size-7);
    border-bottom: var(--size-1) solid #e6e6e6;
  }
  .list {
    margin-top: var(--size-45);
    .item {
      padding: var(--size-30) var(--size-25);
      display: flex;
      border: var(--size-1) solid #e6e6e6;
      margin-bottom: var(--size-30);
      &:last-child {
        margin-bottom: 0;
      }
      img {
        width: var(--size-148);
        height: var(--size-216);
        object-fit: contain;
      }
      .item_content {
        margin-left: var(--size-40);
        .item_content_title {
          font-size: var(--size-21);
          font-family: Arial, Arial-Regular;
          color: #1a1a1a;
          line-height: var(--size-28);
          margin-top: var(--size-10);
          overflow: hidden;
          text-overflow: ellipsis;
          display: -webkit-box;
          -webkit-line-clamp: 2;
          -webkit-box-orient: vertical;
          > img {
            display: none;
          }
        }
        .item_content_format {
          display: flex;
          font-size: var(--size-16);
          font-family: Arial, Arial-Regular;
          color: #1a1a1a;
          line-height: var(--size-44);
          letter-spacing: 0.05px;
          span {
            color: #808080;
          }
        }
      }
    }
  }
}
@include responseTo("phone") {
  .list-box {
    .list {
      margin-top: var(--size-20);
      .item {
        padding: var(--size-10);
        > img {
          display: none;
        }
        .item_content {
          padding: var(--size-10);
          margin: 0;
          .item_content_title {
            display: flex;
            > div {
              font-size: var(--size-18);
              line-height: var(--size-26);
              overflow: hidden;
              text-overflow: ellipsis;
              display: -webkit-box;
              -webkit-line-clamp: 4;
              -webkit-box-orient: vertical;
            }
            > img {
              width: var(--size-74);
              height: var(--size-108);
              object-fit: contain;
              margin-right: var(--size-10);
              display: block;
            }
          }
          .item_content_format {
            font-size: var(--size-14);
          }
          .item_content_amount {
            font-size: var(--size-14);
            line-height: var(--size-30);
            span {
              font-size: var(--size-26);
            }
          }
        }
        .btnBox {
          position: static;
          width: 100%;
          justify-content: center;
          padding-bottom: var(--size-20);
        }
      }
    }
  }
}
</style>
