diff --git a/nuxt.config.ts b/nuxt.config.ts index e07251b..f307dd4 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -11,13 +11,7 @@ export default defineNuxtConfig({ debug: process.env.NODE_ENV === 'development', // 开启详细调试日志 ssr: true, - modules: [ - '@unocss/nuxt', - '@pinia/nuxt', - '@element-plus/nuxt', - 'pinia-plugin-persistedstate/nuxt', - 'nuxt-swiper', - ], + modules: ['@unocss/nuxt', '@pinia/nuxt', '@element-plus/nuxt', 'pinia-plugin-persistedstate/nuxt', 'nuxt-swiper'], css: ['@unocss/reset/tailwind.css', 'element-plus/dist/index.css', '~/assets/scss/app.scss'], vite: { css: { @@ -74,8 +68,7 @@ export default defineNuxtConfig({ { name: 'viewport', content: 'width=device-width, initial-scale=1' }, { name: 'description', - content: - '图夕夕是一家图纸素材分享交易平台,提供AutoCAD/ProE/Creo/CATIA/UG/inventor/CAXA/等建筑图纸的素材下载及免费教程。', + content: '图夕夕是一家图纸素材分享交易平台,提供AutoCAD/ProE/Creo/CATIA/UG/inventor/CAXA/等建筑图纸的素材下载及免费教程。', }, { name: 'keywords', content: '图纸,图纸下载,设计素材,图纸大全,设计图纸,,工程图纸,cad图纸' }, { name: 'author', content: '图夕夕' }, @@ -86,8 +79,7 @@ export default defineNuxtConfig({ }, { property: 'og:description', - content: - '图夕夕是一家图纸素材分享交易平台,提供AutoCAD/ProE/Creo/CATIA/UG/inventor/CAXA/等建筑图纸的素材下载及免费教程。', + content: '图夕夕是一家图纸素材分享交易平台,提供AutoCAD/ProE/Creo/CATIA/UG/inventor/CAXA/等建筑图纸的素材下载及免费教程。', }, { property: 'og:type', content: 'website' }, { property: 'og:url', content: 'https://www.xlcig.cn' }, @@ -96,7 +88,16 @@ export default defineNuxtConfig({ // robots meta { name: 'robots', content: 'index, follow' }, ], - link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon2.ico' }], + link: [ + { rel: 'icon', type: 'image/x-icon', href: '/favicon2.ico' }, + { rel: 'stylesheet', type: 'text/css', href: 'https://unpkg.com/swiper@8/swiper-bundle.css' }, + ], + script: [ + { + type: 'text/javascript', + src: 'https://unpkg.com/swiper@8/swiper-bundle.js', + }, + ], }, }, diff --git a/pages/down-drawe-detail/[id].vue b/pages/down-drawe-detail/[id].vue index 87ef878..c59bee1 100644 --- a/pages/down-drawe-detail/[id].vue +++ b/pages/down-drawe-detail/[id].vue @@ -1,375 +1,369 @@ - - - \ No newline at end of file + + const res = detail.value?.favoriteId + ? await deleteProject({ id: detail.value.favoriteId }) + : await createContent({ + projectId: detail.value?.projectId, + drawId: detail.value?.id, + }) + if (res.code === 0) { + ElMessage.success(`${detail.value?.favoriteId ? '取消' : '收藏'}成功`) + refreshDetail() + } + } + + const handleClick = (id: string | number) => { + navigateTo(`/down-drawe-detail/${id}`) // 修改为在新窗口打开 + } + + const handleDownloadFile = (url: string, name: string) => { + downloadFile(url, name) + } + diff --git a/pages/down-drawe-detail/components/swiper.vue b/pages/down-drawe-detail/components/swiper.vue index 2940acf..46d5409 100644 --- a/pages/down-drawe-detail/components/swiper.vue +++ b/pages/down-drawe-detail/components/swiper.vue @@ -1,74 +1,32 @@