Compare commits

...

9 Commits

23 changed files with 161 additions and 65 deletions

View File

@ -132,14 +132,14 @@ export const getOwnContentPage = (params: { pageNo: number; pageSize: number; ty
* 下架
*/
export const offShelf = (params: { id: number }) => {
return useDollarFetchRequest.put<IResponse<boolean>>('/prod-api/app-api/business/app/project-draw/down', params)
return useDollarFetchRequest.put<IResponse<boolean>>('/prod-api/app-api/business/app/project-draw/down?id=' + params.id, params)
}
/**
* 删除资源
*/
export const deleteResource = (params: { id: number }) => {
return useDollarFetchRequest.del<IResponse<boolean>>('/prod-api/app-api/business/app/project-draw/delete', params)
return useDollarFetchRequest.del<IResponse<boolean>>('/prod-api/app-api/business/app/project-draw/delete?id=' + params.id, params)
}
/**

View File

@ -11,7 +11,7 @@
placeholder="电子产品"
:prefix-icon="Search"
class="search-input h-[40px] w-[328px]"
@focus="handleHot(), (showHotList = true)"
@focus="(handleHot(), (showHotList = true))"
@input="handleInput"
></el-input>
<!-- 搜索框 获取到焦点 显示热门列表 -->
@ -67,11 +67,11 @@
import { top } from '~/api/home/index'
import type { ProjectDrawStatisticAppRespVO } from '~/api/home/type'
import { Search } from '@element-plus/icons-vue'
import refreshToken from "~/utils/RefreshToken";
import refreshToken from '~/utils/RefreshToken'
import useUserStore from '~/stores/user'
const userStore = useUserStore()
const app = useNuxtApp()
const props = defineProps({
active: {
type: String,
@ -131,22 +131,25 @@
}
const handleHotItem = (item: ProjectDrawStatisticAppRespVO) => {
const normal = { id: '0', name: '图纸库', isChildren: false }
const level = item.pairs?.filter(Boolean).map((item) => ({ id: item?.id, name: item?.name, isChildren: false })) || []
level.unshift(normal)
// const normal = { id: '0', name: '图纸库', isChildren: false }
// const level = item.pairs?.filter(Boolean).map((item) => ({ id: item?.id, name: item?.name, isChildren: false })) || []
// level.unshift(normal)
if (item.type === 1) {
navigateTo(`/drawe?level=${JSON.stringify(level)}&keywords=${item.title || ''}`)
navigateTo(`/drawe/${item.projectType}/1/12/-1`)
// navigateTo(`/drawe?level=${JSON.stringify(level)}&keywords=${item.title || ''}`)
} else if (item.type === 2) {
navigateTo(`/text?level=${JSON.stringify(level)}&keywords=${item.title || ''}`)
navigateTo(`/text/${item.projectType}/1/12/-1`)
// navigateTo(`/text?level=${JSON.stringify(level)}&keywords=${item.title || ''}`)
} else if (item.type === 3) {
navigateTo(`/model?level=${JSON.stringify(level)}&keywords=${item.title || ''}`)
navigateTo(`/model/${item.projectType}/1/12/-1`)
// navigateTo(`/model?level=${JSON.stringify(level)}&keywords=${item.title || ''}`)
}
}
const handleClick = (item: string) => {
switch (item) {
case '首页':
navigateTo({ path: '/'}) // 修改为在新窗口打开
navigateTo({ path: '/' }) // 修改为在新窗口打开
break
case '图纸':
navigateTo('/drawe') // 修改为在新窗口打开

View File

@ -116,16 +116,17 @@
}
const handleHotItem = (item: ProjectDrawStatisticAppRespVO) => {
const normal = { id: '0', name: '图纸库', isChildren: false }
const level = item.pairs?.filter(Boolean).map((item) => ({ id: item?.id, name: item?.name, isChildren: false })) || []
level.unshift(normal)
if (item.type === 1) {
navigateTo(`/drawe?level=${JSON.stringify(level)}&keywords=${item.title || ''}`,)
} else if (item.type === 2) {
navigateTo(`/text?level=${JSON.stringify(level)}&keywords=${item.title || ''}`,)
} else if (item.type === 3) {
navigateTo(`/model?level=${JSON.stringify(level)}&keywords=${item.title || ''}`,)
}
// const normal = { id: '0', name: '图纸库', isChildren: false }
// const level = item.pairs?.filter(Boolean).map((item) => ({ id: item?.id, name: item?.name, isChildren: false })) || []
// level.unshift(normal)
// if (item.type === 1) {
// navigateTo(`/drawe?level=${JSON.stringify(level)}&keywords=${item.title || ''}`,)
// } else if (item.type === 2) {
// navigateTo(`/text?level=${JSON.stringify(level)}&keywords=${item.title || ''}`,)
// } else if (item.type === 3) {
// navigateTo(`/model?level=${JSON.stringify(level)}&keywords=${item.title || ''}`,)
// }
navigateTo(`/drawe/${item.projectType}/1/12/-1`)
}
onMounted(() => {

View File

@ -16,9 +16,9 @@
})
useHead({
title: `${props.title}`,
title: `${props.title} - 图夕夕`,
meta: [
{ name: 'description', content: props.description },
{ name: 'description', content: `${props.description}`},
{ name: 'keywords', content: props.keywords },
],
})

0
layouts/m.vue Normal file
View File

22
middleware/auth.global.ts Normal file
View File

@ -0,0 +1,22 @@
// 区分是手机端还是移动端
export default defineNuxtRouteMiddleware((to, from) => {
if (import.meta.client) {
// 在客户端处理路由
// 是否是移动端设备
const isMobile = /(Android|webOS|iPhone|iPod|tablet|BlackBerry|Mobile)/i.test(navigator.userAgent)
// 是否是手机端路由开头
const isRouterMobile = to.path.startsWith('/m')
console.log(isMobile, isRouterMobile);
// 移动端并且 不是/m开头路由
if (isMobile && !isRouterMobile) {
return navigateTo(`/m`)
}
// 不是移动端 是/m开头路由
if (!isMobile && isRouterMobile) {
return navigateTo(`/`)
}
}
})

View File

@ -1 +0,0 @@
// 从微信登录重定向到项目 需要获取code值

View File

@ -1,5 +1,6 @@
// import { base_api } from '~/constants/index'
// https://nuxt.com/docs/api/configuration/nuxt-config
import postcsspxtoviewport from 'postcss-px-to-viewport'
export default defineNuxtConfig({
// devServer: {
// port: 6188,
@ -12,6 +13,9 @@ export default defineNuxtConfig({
ssr: true,
modules: ['@unocss/nuxt', '@pinia/nuxt', '@element-plus/nuxt', 'pinia-plugin-persistedstate/nuxt'],
unocss: {
nuxtLayers: true,
},
elementPlus: {
importStyle: 'scss', // 或 'css',确保样式被全局导入
themes: ['dark'], // 按需配置主题
@ -26,12 +30,22 @@ export default defineNuxtConfig({
},
postcss: {
plugins: [
// postCssPxToRem({
// rootValue: 16, // 结果为:设计稿元素尺寸/16比如元素宽320px,最终页面会换算成 20rem
// mediaQuery: false, //布尔值允许在媒体查询中转换px。
// // exclude: /node_modules/, //node_modules目录下样式全部不转义
// propList: ['*'] //需要做转化处理的属性如`hight`、`width`、`margin`等,`*`表示全部
// })
postcsspxtoviewport({
unitToConvert: 'px', // 要转化的单位
viewportWidth: 750, // UI设计稿的宽度
unitPrecision: 6, // 转换后的精度,即小数点位数
propList: ['*'], // 指定转换的css属性的单位*代表全部css属性的单位都进行转换
viewportUnit: 'vw', // 指定需要转换成的视窗单位默认vw
fontViewportUnit: 'vw', // 指定字体需要转换成的视窗单位默认vw
selectorBlackList: ['el-'], // 指定不转换为视窗单位的类名,例如van-vantUI组件
minPixelValue: 1, // 默认值1小于或等于1px则不进行转换
mediaQuery: true, // 是否在媒体查询的css代码中也进行转换默认false
replace: true, // 是否转换后直接更换属性值
exclude: [/node_modules/, /^(?!.*\/pages\/m\/).*$/], // 排除node_modules和非pages/m目录下的文件
landscape: false, // 是否处理横屏情况
// 只转换pages下的m文件
include: [/pages\/m/],
}),
],
},
},
@ -77,20 +91,20 @@ export default defineNuxtConfig({
{ name: 'keywords', content: '图纸,图纸下载,设计素材,图纸大全,设计图纸,,工程图纸,cad图纸' },
{ name: 'author', content: '图夕夕' },
// SEO meta tags
{
property: 'og:title',
content: '图纸,图纸下载,设计素材,图纸大全,设计图纸,,工程图纸,cad图纸',
},
{
property: 'og:description',
content: '图夕夕是一家图纸素材分享交易平台提供AutoCAD/ProE/Creo/CATIA/UG/inventor/CAXA/等建筑图纸的素材下载及免费教程。',
},
{ property: 'og:type', content: 'website' },
{ property: 'og:url', content: 'https://www.xlcig.cn' },
{ property: 'og:site_name', content: 'xlCig' },
{ name: 'theme-color', content: '#00f5ff' },
// robots meta
{ name: 'robots', content: 'index, follow' },
// {
// property: 'og:title',
// content: '图纸,图纸下载,设计素材,图纸大全,设计图纸,,工程图纸,cad图纸',
// },
// {
// property: 'og:description',
// content: '图夕夕是一家图纸素材分享交易平台提供AutoCAD/ProE/Creo/CATIA/UG/inventor/CAXA/等建筑图纸的素材下载及免费教程。',
// },
// { property: 'og:type', content: 'website' },
// { property: 'og:url', content: 'https://www.xlcig.cn' },
// { property: 'og:site_name', content: 'xlCig' },
// { name: 'theme-color', content: '#00f5ff' },
// // robots meta
// { name: 'robots', content: 'index, follow' },
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon2.ico' },

View File

@ -20,6 +20,7 @@
"nuxt": "^3.18.1",
"pdfjs-dist": "^5.4.54",
"pinia": "^3.0.3",
"postcss-px-to-viewport": "^1.1.1",
"qrcode.vue": "^3.6.0",
"vue": "^3.5.18",
"vue-pdf-embed": "^2.1.3",
@ -32,7 +33,9 @@
"@pinia-plugin-persistedstate/nuxt": "^1.2.1",
"@types/prettier": "^3.0.0",
"@unocss/nuxt": "^66.4.2",
"@vant/nuxt": "^1.0.7",
"element-plus": "^2.10.7",
"postcss": "^8.5.6",
"prettier": "3.6.2",
"sass": "^1.90.0",
"unocss": "^66.4.2"

View File

@ -1,4 +1,5 @@
<template>
<SeoHead :title="detail?.title" :description="detail?.description" :keywords="detail?.labels?.toString()" />
<KlNavTab />
<div class="ml-auto mr-auto mt-[20px] w-[1440px]">
<div class="flex items-center">
@ -178,6 +179,7 @@
import { downloadFile } from '~/utils/utils'
import { useMessage } from '~/utils/useMessage'
import { Warning } from '@element-plus/icons-vue'
import SeoHead from '~/components/seo-head/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'

View File

@ -1,5 +1,6 @@
<template>
<!-- 导航 -->
<SeoHead title="工程设计图纸下载_CAD设计图纸资源库" />
<KlNavTab active="图纸" :type="1" />
<div class="ma-auto w-[1440px]">
<!-- 图纸分类 -->

View File

@ -1,5 +1,6 @@
<template>
<!-- 导航 -->
<SeoHead title="工程设计图纸下载_CAD设计图纸资源库" />
<KlNavTab active="图纸" :type="1" />
<div class="ma-auto w-[1440px]">
<!-- 图纸分类 -->

View File

@ -50,7 +50,7 @@
>免费注册</div
>
</div>
<div v-else class="mt-[26px] box-border flex justify-between px-[18px]">
<div v-else class="mt-[24px] box-border flex justify-between px-[18px]">
<div
class="h-[37px] w-[101px] cursor-pointer border border-[#1A65FF] rounded-[2px] border-solid bg-[#1A65FF] text-center text-[14px] text-[#FFFFFF] font-normal line-height-[37px]"
@click="handleDrawe"
@ -141,7 +141,7 @@
}
watchEffect(() => {
if (isLogin.value) {
if (isLogin.value && import.meta.client) {
fetchUserStatistics()
}
})

View File

@ -169,7 +169,7 @@
.menu-item {
/* position: relative; */
text-align: center;
padding: 11px 24px;
padding: 10px 24px;
cursor: pointer;
/* transition: all 0.3s ease; */
color: #333;

11
pages/m/index.vue Normal file
View File

@ -0,0 +1,11 @@
<template>
<div>
<h1>Mobile Page</h1>
</div>
</template>
<script setup lang="ts">
// Mobile specific logic can be added here
</script>
<style lang="scss" scoped></style>

View File

@ -1,5 +1,6 @@
<template>
<!-- 导航 -->
<SeoHead title="工程设计模型下载_CAD设计图纸资源库" />
<KlNavTab active="模型" :type="3" />
<div class="ma-auto w-[1440px]">
<!-- 图纸分类 -->

View File

@ -1,5 +1,6 @@
<template>
<!-- 导航 -->
<SeoHead title="工程设计模型下载_CAD设计图纸资源库" />
<KlNavTab active="模型" :type="3" />
<div class="ma-auto w-[1440px]">
<!-- 图纸分类 -->

View File

@ -1,5 +1,6 @@
<template>
<!-- 导航 -->
<SeoHead title="工程设计文本下载_CAD设计图纸资源库" />
<KlNavTab active="文本" :type="2" />
<div class="ma-auto w-[1440px]">
<!-- 图纸分类 -->

View File

@ -1,5 +1,6 @@
<template>
<!-- 导航 -->
<SeoHead title="工程设计文本下载_CAD设计图纸资源库" />
<KlNavTab active="文本" :type="2" />
<div class="ma-auto w-[1440px]">
<!-- 图纸分类 -->

View File

@ -1,12 +1,12 @@
<template>
<KlNavTab />
<div class="mx-auto mt-30px box-border w-1200px border border-[#EEEEEE] rounded-12px border-solid bg-white px-30px py-40px">
<div class="mx-auto mt-[30px] box-border w-[1200px] border border-[#EEEEEE] rounded-[12px] border-solid bg-white px-[30px] py-[40px]">
<el-form ref="formRef" :model="form" label-width="110px" size="large">
<el-form-item label-width="110px" label="标题:" prop="title" :rules="{ required: true, message: '请输入标题', trigger: ['blur', 'change'] }">
<el-input v-model="form.title" placeholder="请输入标题" class="w-361px!" maxlength="128"></el-input>
<el-input v-model="form.title" placeholder="请输入标题" class="w-[361px]!" maxlength="128"></el-input>
</el-form-item>
<el-form-item label-width="110px" label="分类:" prop="projectType" :rules="{ required: true, message: '请选择分类', trigger: ['blur', 'change'] }">
<el-select v-model="form.projectType" placeholder="请选择分类" class="w-361px!" multiple>
<el-select v-model="form.projectType" placeholder="请选择分类" class="w-[361px]!" multiple>
<el-option v-for="(item, index) in projectTypeList" :key="index" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
@ -20,13 +20,13 @@
filterable
remote
placeholder="请输入搜索标签"
class="w-361px!"
class="w-[361px]!"
>
<el-option v-for="(item, index) in labelsList" :key="index" :label="item" :value="item" />
</el-select>
</el-form-item>
<el-form-item label-width="110px" label="金币:" prop="points" :rules="{ required: true, message: '请输入金币', trigger: ['blur', 'change'] }">
<el-input-number v-model="form.points" :controls="false" :precision="0" :min="0" placeholder="请输入金币" class="w-361px! text-left!"></el-input-number>
<el-input-number v-model="form.points" :controls="false" :precision="0" :min="0" placeholder="请输入金币" class="w-[361px]! text-left!"></el-input-number>
</el-form-item>
<el-form-item
@ -43,9 +43,9 @@
tips="上传图片支持jpg/gif/png格式、第一张为封面图片、每张图片大小不得超过1M"
@validate="formRef.validateField('coverImages')"
>
<div class="h-77px w-161px flex items-center justify-center border border-[#cdd0d6] rounded-1px border-dashed bg-[#fafafa]">
<div class="h-[77px] w-[161px] flex items-center justify-center border border-[#cdd0d6] rounded-[1px] border-dashed bg-[#fafafa]">
<el-icon class="text-[#999999]"><Plus /></el-icon>
<div class="ml-4px mt-2px text-14px text-[#999999] font-normal">上传图纸</div>
<div class="ml-[4px] mt-[2px] text-[14px] text-[#999999] font-normal">上传图纸</div>
</div>
</KlUploader>
</el-form-item>
@ -72,7 +72,7 @@
},
]"
>
<el-input v-model="form.description" type="textarea" :rows="6" placeholder="请输入描述" class="w-361px!" minlength="70" show-word-limit></el-input>
<el-input v-model="form.description" type="textarea" :rows="6" placeholder="请输入描述" class="w-[361px]!" minlength="70" show-word-limit></el-input>
</el-form-item>
<!-- 添加预览和保存按钮 -->
<el-form-item label-width="110px" label=" ">
@ -92,6 +92,7 @@
import { parent, keywords, labels } from '~/api/upnew/index'
import { create } from '~/api/toolbox/index.js'
import type { TcreateReq } from '~/api/toolbox/types'
const router = useRouter() // 导入路由实例,用于跳转页面
const form = reactive<TcreateReq>({
title: '',
@ -170,9 +171,10 @@
console.log(res)
if (res.code === 0) {
ElMessage.success('发布成功')
window.setTimeout(() => {
window.close()
}, 1000)
router.back()
// window.setTimeout(() => {
// window.close()
// }, 1000)
}
})
.finally(() => {

View File

@ -33,6 +33,7 @@
import type { TcreateReq } from '~/api/upnew/types'
import { create } from '~/api/upnew/index'
const router = useRouter() // 导入路由实例,用于跳转页面
const form = reactive<TcreateReq>({
activeName: '', // 标签
@ -92,10 +93,11 @@
if (code === 0) {
// 弹窗提示
ElMessage.success('操作成功')
router.back()
// 关闭弹窗
setTimeout(() => {
window.close()
}, 300)
// setTimeout(() => {
// window.close()
// }, 300)
}
})
.finally(() => {

2
types/global.d.ts vendored
View File

@ -42,3 +42,5 @@ declare module '@wangeditor/editor-for-vue' {
export const Editor: DefineComponent<any, any, any>
export const Toolbar: DefineComponent<any, any, any>
}
declare module 'postcss-px-to-viewport'

View File

@ -1009,7 +1009,7 @@
which "^5.0.0"
ws "^8.18.3"
"@nuxt/kit@3.18.1", "@nuxt/kit@^3.12.2", "@nuxt/kit@^3.13.2", "@nuxt/kit@^3.15.4", "@nuxt/kit@^3.17.6", "@nuxt/kit@^3.9.0":
"@nuxt/kit@3.18.1", "@nuxt/kit@^3.12.2", "@nuxt/kit@^3.13.2", "@nuxt/kit@^3.14.159", "@nuxt/kit@^3.15.4", "@nuxt/kit@^3.17.6", "@nuxt/kit@^3.9.0":
version "3.18.1"
resolved "https://registry.npmmirror.com/@nuxt/kit/-/kit-3.18.1.tgz"
integrity sha512-z6w1Fzv27CIKFlhct05rndkJSfoslplWH5fJ9dtusEvpYScLXp5cATWIbWkte9e9zFSmQTgDQJjNs3geQHE7og==
@ -2187,6 +2187,15 @@
"@uppy/utils" "^4.1.2"
nanoid "^3.1.25"
"@vant/nuxt@^1.0.7":
version "1.0.7"
resolved "https://registry.npmmirror.com/@vant/nuxt/-/nuxt-1.0.7.tgz#02ca3fe67be1d59c3d4f5e35316521d6ce5dfa3d"
integrity sha512-YVRJIDVlCCjWBhi0a/YBY0M04XmGwAqCkDSEIDIcbvzNN2z178iqKS23Py+c4hUv570LoKaIZMCQ75IJphJkTw==
dependencies:
"@nuxt/kit" "^3.14.159"
magic-string "^0.29.0"
unplugin "^1.16.0"
"@vercel/nft@0.29.4", "@vercel/nft@^0.29.4":
version "0.29.4"
resolved "https://registry.npmmirror.com/@vercel/nft/-/nft-0.29.4.tgz"
@ -4870,6 +4879,13 @@ magic-string@^0.27.0:
dependencies:
"@jridgewell/sourcemap-codec" "^1.4.13"
magic-string@^0.29.0:
version "0.29.0"
resolved "https://registry.npmmirror.com/magic-string/-/magic-string-0.29.0.tgz#f034f79f8c43dba4ae1730ffb5e8c4e084b16cf3"
integrity sha512-WcfidHrDjMY+eLjlU+8OvwREqHwpgCeKVBUpQ3OhYYuvfaYCUgcbuBzappNzZvg/v8onU3oQj+BYpkOJe9Iw4Q==
dependencies:
"@jridgewell/sourcemap-codec" "^1.4.13"
magic-string@^0.30.12, magic-string@^0.30.17, magic-string@^0.30.3, magic-string@^0.30.8:
version "0.30.17"
resolved "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.17.tgz"
@ -5406,6 +5422,11 @@ nypm@^0.6.0, nypm@^0.6.1:
pkg-types "^2.2.0"
tinyexec "^1.0.1"
object-assign@>=4.0.1:
version "4.1.1"
resolved "https://registry.npmmirror.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==
object-inspect@^1.13.3:
version "1.13.4"
resolved "https://registry.npmmirror.com/object-inspect/-/object-inspect-1.13.4.tgz"
@ -5922,6 +5943,14 @@ postcss-ordered-values@^7.0.2:
cssnano-utils "^5.0.1"
postcss-value-parser "^4.2.0"
postcss-px-to-viewport@^1.1.1:
version "1.1.1"
resolved "https://registry.npmmirror.com/postcss-px-to-viewport/-/postcss-px-to-viewport-1.1.1.tgz#a25ca410b553c9892cc8b525cc710da47bf1aa55"
integrity sha512-2x9oGnBms+e0cYtBJOZdlwrFg/mLR4P1g2IFu7jYKvnqnH/HLhoKyareW2Q/x4sg0BgklHlP1qeWo2oCyPm8FQ==
dependencies:
object-assign ">=4.0.1"
postcss ">=5.0.2"
postcss-reduce-initial@^7.0.4:
version "7.0.4"
resolved "https://registry.npmmirror.com/postcss-reduce-initial/-/postcss-reduce-initial-7.0.4.tgz"
@ -5974,7 +6003,7 @@ postcss-values-parser@^6.0.2:
is-url-superb "^4.0.0"
quote-unquote "^1.0.0"
postcss@^8.5.1, postcss@^8.5.6:
postcss@>=5.0.2, postcss@^8.5.1, postcss@^8.5.6:
version "8.5.6"
resolved "https://registry.npmmirror.com/postcss/-/postcss-8.5.6.tgz"
integrity sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==
@ -7061,7 +7090,7 @@ unplugin-vue-router@^0.15.0:
unplugin-utils "^0.2.4"
yaml "^2.8.0"
unplugin@^1.10.0, unplugin@^1.15.0:
unplugin@^1.10.0, unplugin@^1.15.0, unplugin@^1.16.0:
version "1.16.1"
resolved "https://registry.npmmirror.com/unplugin/-/unplugin-1.16.1.tgz"
integrity sha512-4/u/j4FrCKdi17jaxuJA0jClGxB1AvU2hw/IuayPc4ay1XGaJs/rbb4v5WKwAjNifjmXK9PIFyuPiaK8azyR9w==