From f2d8f098e6e315b4cdd2c4847d47fb2912f2fe2f Mon Sep 17 00:00:00 2001 From: shenhan Date: Mon, 3 Mar 2025 17:58:26 +0800 Subject: [PATCH] update --- .env.dev | 2 + .env.pro | 2 + Dockerfile | 24 + app/components.d.ts | 5 +- app/components/BaseComment.vue | 16 +- app/components/EditUserInfo.vue | 8 +- app/components/Empty.vue | 14 + app/components/Header.vue | 172 ++--- app/components/HeaderSearchInput.vue | 83 ++- app/components/IntPayment.vue | 2 +- app/components/LoginModal.vue | 5 +- app/components/MenuFold.vue | 42 ++ app/components/ModelList.vue | 23 +- app/components/Payment.vue | 8 +- app/components/PersonalCenterCard.vue | 13 +- app/components/PersonalCenterPublishCard.vue | 204 ++++++ app/components/PictureDetail.vue | 50 +- app/components/PictureList.vue | 50 +- app/components/Publish-picture.vue | 10 +- app/components/Report.vue | 111 ++++ app/components/WangEditor.vue | 75 ++- app/components/WechatLoginQr.vue | 23 +- app/components/WorkFlowList.vue | 37 +- app/components/fans/index.vue | 13 + app/components/message/AttentionMsg.vue | 14 +- app/components/message/LikeMsg.vue | 57 +- app/components/message/ReplyMsg.vue | 45 +- app/components/publishModel/CreateModels.vue | 9 +- app/components/publishModel/EditVersion.vue | 14 +- app/components/publishModel/UploadImg.vue | 10 +- .../publishWorkFlow/EditVersion.vue | 18 +- app/components/publishWorkFlow/UploadImg.vue | 176 +++--- app/constants/index.ts | 7 +- app/layouts/default.vue | 239 +++++-- app/middleware/auth.global.ts | 3 + app/pages/fans/index.vue | 13 + app/pages/member-center/index.vue | 11 +- app/pages/message/index.vue | 2 +- app/pages/model-details/[id].vue | 403 ++++++++---- app/pages/model-square.vue | 43 +- app/pages/order-management/index.vue | 140 +++++ app/pages/personal-center/index.vue | 585 +++++++++++------- app/pages/personal-publish/index.vue | 449 ++++++++++++++ app/pages/picture-square.vue | 4 +- app/pages/publish-model/index.vue | 24 +- app/pages/search/index.vue | 169 +++++ app/pages/work-square.vue | 4 +- app/pages/workflow-details/[id].vue | 185 +++++- app/stores/modal.ts | 27 + app/stores/user.ts | 4 - app/utils/request.ts | 26 +- app/utils/uploadImg.ts | 4 +- nuxt.config.ts | 11 +- package.json | 10 +- pnpm-lock.yaml | 357 +++++------ 55 files changed, 3093 insertions(+), 962 deletions(-) create mode 100644 .env.dev create mode 100644 .env.pro create mode 100644 Dockerfile create mode 100644 app/components/Empty.vue create mode 100644 app/components/MenuFold.vue create mode 100644 app/components/PersonalCenterPublishCard.vue create mode 100644 app/components/Report.vue create mode 100644 app/components/fans/index.vue create mode 100644 app/pages/fans/index.vue create mode 100644 app/pages/order-management/index.vue create mode 100644 app/pages/personal-publish/index.vue create mode 100644 app/pages/search/index.vue diff --git a/.env.dev b/.env.dev new file mode 100644 index 0000000..9d8fd99 --- /dev/null +++ b/.env.dev @@ -0,0 +1,2 @@ +NODE_ENV = 'development' +VITE_NUXT_ENV = 'http://1.13.246.108:8080/' \ No newline at end of file diff --git a/.env.pro b/.env.pro new file mode 100644 index 0000000..be17dc1 --- /dev/null +++ b/.env.pro @@ -0,0 +1,2 @@ +NODE_ENV = 'production' +VITE_NUXT_ENV = 'http://1.13.246.108:8080/' \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..59aa89e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM node:20-slim --platform=linux/amd64 AS base +ENV TZ=Asia/Shanghai + +WORKDIR /app + +# Build +FROM base AS build + +COPY . . +RUN npm config set registry https://registry.npmmirror.com +RUN npm install -g pnpm +RUN pnpm install --registry=https://registry.npmmirror.com +RUN pnpm run build + +# Run +FROM base + +ENV PORT=3000 +ENV NODE_ENV=production + +COPY --from=build /app/.output /app/.output + +EXPOSE 3000 +CMD [ "node", ".output/server/index.mjs" ] \ No newline at end of file diff --git a/app/components.d.ts b/app/components.d.ts index 8d450bb..9619d73 100644 --- a/app/components.d.ts +++ b/app/components.d.ts @@ -8,18 +8,16 @@ export {} declare module 'vue' { export interface GlobalComponents { NAvatar: typeof import('naive-ui')['NAvatar'] - NBadge: typeof import('naive-ui')['NBadge'] NButton: typeof import('naive-ui')['NButton'] + NCard: typeof import('naive-ui')['NCard'] NCarousel: typeof import('naive-ui')['NCarousel'] NCascader: typeof import('naive-ui')['NCascader'] NCheckbox: typeof import('naive-ui')['NCheckbox'] - NCheckboxGroup: typeof import('naive-ui')['NCheckboxGroup'] NConfigProvider: typeof import('naive-ui')['NConfigProvider'] NDatePicker: typeof import('naive-ui')['NDatePicker'] NDropdown: typeof import('naive-ui')['NDropdown'] NEllipsis: typeof import('naive-ui')['NEllipsis'] NEmpty: typeof import('naive-ui')['NEmpty'] - NFor: typeof import('naive-ui')['NFor'] NForm: typeof import('naive-ui')['NForm'] NFormItem: typeof import('naive-ui')['NFormItem'] NIcon: typeof import('naive-ui')['NIcon'] @@ -30,7 +28,6 @@ declare module 'vue' { NModal: typeof import('naive-ui')['NModal'] NQrCode: typeof import('naive-ui')['NQrCode'] NRadio: typeof import('naive-ui')['NRadio'] - NRadioButton: typeof import('naive-ui')['NRadioButton'] NRadioGroup: typeof import('naive-ui')['NRadioGroup'] NSelect: typeof import('naive-ui')['NSelect'] NSpace: typeof import('naive-ui')['NSpace'] diff --git a/app/components/BaseComment.vue b/app/components/BaseComment.vue index 7ac8ecb..eb2bf5b 100644 --- a/app/components/BaseComment.vue +++ b/app/components/BaseComment.vue @@ -29,7 +29,7 @@ const commentParams = ref({ content: '', parentId: '', replyUserId: '', - userId: userStore.userInfo.userId, + userId: userStore?.userInfo?.userId, workFlowId: props.detailsInfo.id, }) function commentParamsInit() { @@ -44,9 +44,9 @@ const sortType = ref(1) // 获取列表 const urlList = ref({ - workflow: '/WorkFlowComment/comment?', - pictrue: '/imageComment/comment?', - model: '/ModelComment/comment?', + workflow: '/WorkFlowComment/getComment?', + pictrue: '/imageComment/getComment?', + model: '/ModelComment/getComment?', }) // 点赞 const likeList = ref({ @@ -253,10 +253,10 @@ function changeType(type: string) {
-
+
avatar
@@ -304,7 +304,7 @@ function changeType(type: string) { {{ item.likeNum }}
回复 - 删除 + 删除
@@ -351,7 +351,7 @@ function changeType(type: string) { {{ ele.likeNum }} 回复 - 删除 + 删除 diff --git a/app/components/EditUserInfo.vue b/app/components/EditUserInfo.vue index 4e14f35..9eea70a 100644 --- a/app/components/EditUserInfo.vue +++ b/app/components/EditUserInfo.vue @@ -1,6 +1,6 @@ + + diff --git a/app/components/Header.vue b/app/components/Header.vue index 36dee94..25e4d2d 100644 --- a/app/components/Header.vue +++ b/app/components/Header.vue @@ -45,7 +45,9 @@ function onSearch(value: any) { console.log("搜索:", value); // 执行搜索逻辑 } - +function initSearch(){ + console.log( 'initSearch'); +} // 用户下拉选项 const notificationOptions = [ { @@ -85,20 +87,20 @@ const publishOptions = [ const userOptions = ref([ { label: "我的模型", - key: "model", + key: "0", }, { label: "我的作品", - key: "project", + key: "2", }, { label: "我的点赞", key: "like", }, - { - label: "账号设置", - key: "userSettings", - }, + // { + // label: "账号设置", + // key: "userSettings", + // }, { label: "退出登录", key: "logout", @@ -115,24 +117,32 @@ async function handleUserSelect(key: string) { } catch (error) { console.error("Logout failed:", error); } + }else if(key === "like"){ + router.push(`/personal-center?type=${key}`) + }else{ + router.push(`/personal-center?status=${key}`) } } // 发布下拉选项 async function handlePublishSelect(key: string) { - if (key === "picture") { - isShowPublishPicture.value = true; - if (PublishPictureRef.value) { - PublishPictureRef.value.isVisible = true; - } + if (!userStore.isLoggedIn) { + modalStore.showLoginModal(); } else { - const baseUrl = window.location.origin; - window.open(`${baseUrl}/${key}?type=add`, "_blank", "noopener,noreferrer"); - // router.push({ - // path: `/${key}`, - // query: { - // type: 'add', - // }, - // }) + if (key === "picture") { + isShowPublishPicture.value = true; + if (PublishPictureRef.value) { + PublishPictureRef.value.isVisible = true; + } + } else { + const baseUrl = window.location.origin; + window.open(`${baseUrl}/${key}?type=add`, "_blank", "noopener,noreferrer"); + // router.push({ + // path: `/${key}`, + // query: { + // type: 'add', + // }, + // }) + } } } function closePublishImg() { @@ -147,6 +157,7 @@ function handleLogin() { } const msgList = ref([]); +const isRead = ref('0') async function getAllMessage() { try { const res = await request.get("/advice/getAllMsg"); @@ -157,12 +168,12 @@ async function getAllMessage() { console.log(err); } } -getAllMessage(); +// getAllMessage(); // 跳转到消息详情 -function toDetail(){ - const baseUrl = window.location.origin - window.open(`${baseUrl}/message`, '_blank', 'noopener,noreferrer') +function toDetail() { + const baseUrl = window.location.origin; + window.open(`${baseUrl}/message`, "_blank", "noopener,noreferrer"); } onMounted(() => {}); @@ -179,7 +190,12 @@ onMounted(() => {});
- 魔创未来 + + +
@@ -196,10 +212,13 @@ onMounted(() => {}); - +
PC客户端 - +
+ @@ -207,12 +226,17 @@ onMounted(() => {}); 教程专区 + + - + 发布 @@ -235,56 +259,62 @@ onMounted(() => {}); --> -
- -