Refactor API requests and update component imports
This commit is contained in:
@ -43,7 +43,8 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, PropType, watch, nextTick } from 'vue'
|
||||
import type { PropType} from 'vue'
|
||||
import { ref, watch, nextTick } from 'vue'
|
||||
// @ts-ignore
|
||||
import { Swiper, SwiperSlide } from 'swiper/vue'
|
||||
|
||||
|
||||
@ -12,17 +12,17 @@
|
||||
|
||||
<div class="ml-23px flex flex-1 text-18px text-[#FFFFFF] font-normal">
|
||||
<div class="h-60px w-160px flex cursor-pointer items-center justify-center rounded-8px bg-[#1A65FF]" @click="handleDownload">
|
||||
<img src="@/assets/images/download.png" alt="" srcset="" class="mr-4px h-22px w-27px" />
|
||||
<img src="~/assets/images/download.png" alt="" srcset="" class="mr-4px h-22px w-27px" />
|
||||
{{ detail.points === 0 ? '免费下载' : '立即下载' }}
|
||||
</div>
|
||||
<div
|
||||
v-if="!detail.favoriteId"
|
||||
class="ml-11px h-60px flex flex-1 cursor-pointer items-center justify-center rounded-8px bg-[#E7B03B]"
|
||||
@click="handleCollect"
|
||||
><img src="@/assets/images/collect.png" alt="" srcset="" class="mr-4px h-24px w-24px" /> 收藏</div
|
||||
><img src="~/assets/images/collect.png" alt="" srcset="" class="mr-4px h-24px w-24px" /> 收藏</div
|
||||
>
|
||||
<div v-else class="ml-11px h-60px flex flex-1 cursor-pointer items-center justify-center rounded-8px bg-[#E7B03B]" @click="handleCollect"
|
||||
><img src="@/assets/images/wjx2.png" alt="" srcset="" class="mr-4px h-18px w-18px" /> 已收藏</div
|
||||
><img src="~/assets/images/wjx2.png" alt="" srcset="" class="mr-4px h-18px w-18px" /> 已收藏</div
|
||||
>
|
||||
|
||||
<div class="ml-11px h-60px flex flex-1 cursor-pointer items-center justify-center rounded-8px bg-[#F56C6C]" @click="handleReport"
|
||||
@ -52,7 +52,7 @@
|
||||
</div>
|
||||
<div>
|
||||
<div v-for="item in detail.files" :key="item.id" class="flex items-center justify-between border-b-1px border-b-[#eee] border-b-solid py-10px">
|
||||
<!-- <img src="@/assets/images/avater.png" alt="" srcset="" class="h-30px w-30px" /> -->
|
||||
<!-- <img src="~/assets/images/avater.png" alt="" srcset="" class="h-30px w-30px" /> -->
|
||||
<div>
|
||||
<span class="ml-10px cursor-pointer" @click="handleDownloadPreview(item)">{{ item.title }}</span>
|
||||
<span v-if="item.size" class="ml-200px color-#999">{{ item.size || '-' }}</span>
|
||||
@ -107,7 +107,7 @@
|
||||
<div class="mb-10px">软件分类:{{ detail.editionsName }}</div>
|
||||
</div>
|
||||
<div class="mt-20px w-398px border border-[#EEEEEE] border-rd-[10px_10px_0px_0px] border-solid bg-[#FFFFFF]">
|
||||
<img src="@/assets/images/banner.png" alt="" srcset="" class="w-100%" />
|
||||
<img src="~/assets/images/banner.png" alt="" srcset="" class="w-100%" />
|
||||
<div class="box-border border border-[#EEEEEE] border-rd-[10px_10px_0px_0px] border-solid border-t-none bg-[#FFFFFF] pa-18px">
|
||||
<div class="flex flex-wrap items-start">
|
||||
<div v-if="userInfo.nickname" class="mt-10px text-18px text-[#333333] font-bold">{{ userInfo.nickname }}</div>
|
||||
@ -123,13 +123,13 @@
|
||||
<div class="flex items-center gap-40px">
|
||||
<div class="flex items-center">
|
||||
<div class="h-20px">
|
||||
<img src="@/assets/images/folder.png" alt="works" class="w-80%" />
|
||||
<img src="~/assets/images/folder.png" alt="works" class="w-80%" />
|
||||
</div>
|
||||
<div class="ml-8px mt--4px text-14px text-[#666] font-normal">作品: {{ userInfo.projectCount || 0 }}</div>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<div class="h-20px">
|
||||
<img src="@/assets/images/user4.png" alt="fans" class="w-80% rounded-full vertical-top" />
|
||||
<img src="~/assets/images/user4.png" alt="fans" class="w-80% rounded-full vertical-top" />
|
||||
</div>
|
||||
<div class="relative top--3px ml-8px text-14px text-[#666] font-normal">粉丝: {{ userInfo.fansCount || 0 }}</div>
|
||||
</div>
|
||||
@ -170,18 +170,18 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import dayjs from 'dayjs'
|
||||
import { downloadFile } from '@/utils/utils'
|
||||
import { useMessage } from '@/utils/useMessage'
|
||||
import { downloadFile } from '~/utils/utils'
|
||||
import { useMessage } from '~/utils/useMessage'
|
||||
import { Warning } from '@element-plus/icons-vue'
|
||||
import CardPicture from '@/components/kl-card-picture/index.vue'
|
||||
import { getDetail, getRelationRecommend, report, getUserInfo, getMainWork, createContent, createUserProject, deleteProject } from '@/api/drawe-detail/index'
|
||||
import KlNavTab from '@/components/kl-nav-tab/index.vue'
|
||||
import CardPicture from '~/components/kl-card-picture/index.vue'
|
||||
import { getDetail, getRelationRecommend, report, getUserInfo, getMainWork, createContent, createUserProject, deleteProject } from '~/api/drawe-detail/index'
|
||||
import KlNavTab from '~/components/kl-nav-tab/index.vue'
|
||||
import ThumBnail from './components/swiper.vue'
|
||||
import CommentSection from '@/components/comment-section/index.vue'
|
||||
import CommentSection from '~/components/comment-section/index.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { ref } from 'vue'
|
||||
import { ProjectRespVO, ProjectDrawPageRespVO, UserExtendSimpleRespDTO, ProjectDrawMemberRespVO } from '@/api/drawe-detail/types'
|
||||
import useUserStore from '@/store/user'
|
||||
import type { ProjectRespVO, ProjectDrawPageRespVO, UserExtendSimpleRespDTO, ProjectDrawMemberRespVO } from '~/api/drawe-detail/types'
|
||||
import useUserStore from '~/store/user'
|
||||
const message = useMessage()
|
||||
const userStore = useUserStore()
|
||||
// 获取路由参数
|
||||
@ -244,7 +244,7 @@
|
||||
}
|
||||
const handleDownloadPreview = (item: any) => {
|
||||
// 预览pdf
|
||||
window.open(`/pdf-preview?url=${item.url}`)
|
||||
navigateTo(`/pdf-preview?url=${item.url}`)
|
||||
}
|
||||
|
||||
/** 获取下载类型 */
|
||||
@ -341,7 +341,7 @@
|
||||
}
|
||||
|
||||
const handleClick = (id: string | number) => {
|
||||
window.open(`/down-drawe-detail?id=${id}`, '_blank') // 修改为在新窗口打开
|
||||
navigateTo(`/down-drawe-detail?id=${id}`) // 修改为在新窗口打开
|
||||
}
|
||||
|
||||
const handleDownloadFile = (url: string, name: string) => {
|
||||
|
||||
Reference in New Issue
Block a user