From 55cd86a45fcaa6516446075d281ab2e3bdd08f3b Mon Sep 17 00:00:00 2001 From: tangxinyue <524779910@qq.com> Date: Fri, 24 Jul 2026 14:15:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AF=B9=E6=8E=A5=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=EF=BC=8C=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 4 +- src/api/authService.js | 25 +- src/components/LoginDialog.vue | 7 +- src/components/PaymentDialog.vue | 228 ++++-- src/components/{ => common}/AppFooter.vue | 0 src/components/{ => common}/AppHeader.vue | 44 +- src/components/{ => common}/BaseDialog.vue | 6 +- src/components/{ => common}/WarningFooter.vue | 2 +- src/components/simulator/PhoneMockup.vue | 8 +- src/components/simulator/SimulatorLayout.vue | 2 +- src/public/article/back-bg.png | Bin 0 -> 2222 bytes src/public/article/date.png | Bin 0 -> 679 bytes src/public/article/eye.png | Bin 0 -> 720 bytes src/public/article/hot.png | Bin 0 -> 3608 bytes src/public/article/left.png | Bin 0 -> 997 bytes src/public/article/right.png | Bin 0 -> 970 bytes src/public/article/start.png | Bin 0 -> 530 bytes src/public/article/tuijian.png | Bin 0 -> 1420 bytes src/public/header/shengjihuiyuan.png | Bin 0 -> 22728 bytes src/public/header/zunguihuiyuan.png | Bin 0 -> 22492 bytes src/router/index.js | 10 +- src/stores/user.js | 32 +- src/utils/appUtils.js | 44 +- src/utils/requestService.js | 6 +- src/views/About.vue | 2 +- src/views/Home.vue | 128 ---- src/views/Login.vue | 174 ----- src/views/PaymentResult.vue | 142 ---- src/views/Profile.vue | 115 ++- src/views/Register.vue | 168 ----- src/views/Works.vue | 139 ---- src/views/article/detail.vue | 653 ++++++++++++++++++ src/views/article/list.vue | 310 +++++++++ src/views/index/index.vue | 2 +- src/views/other/gongzidan.vue | 2 +- src/views/work/works.vue | 2 +- src/views/{ => wxPage}/BalanceEdit.vue | 20 +- src/views/{ => wxPage}/ChatEdit.vue | 14 +- 38 files changed, 1343 insertions(+), 946 deletions(-) rename src/components/{ => common}/AppFooter.vue (100%) rename src/components/{ => common}/AppHeader.vue (90%) rename src/components/{ => common}/BaseDialog.vue (93%) rename src/components/{ => common}/WarningFooter.vue (97%) create mode 100644 src/public/article/back-bg.png create mode 100644 src/public/article/date.png create mode 100644 src/public/article/eye.png create mode 100644 src/public/article/hot.png create mode 100644 src/public/article/left.png create mode 100644 src/public/article/right.png create mode 100644 src/public/article/start.png create mode 100644 src/public/article/tuijian.png create mode 100644 src/public/header/shengjihuiyuan.png create mode 100644 src/public/header/zunguihuiyuan.png delete mode 100644 src/views/Home.vue delete mode 100644 src/views/Login.vue delete mode 100644 src/views/PaymentResult.vue delete mode 100644 src/views/Register.vue delete mode 100644 src/views/Works.vue create mode 100644 src/views/article/detail.vue create mode 100644 src/views/article/list.vue rename src/views/{ => wxPage}/BalanceEdit.vue (95%) rename src/views/{ => wxPage}/ChatEdit.vue (99%) diff --git a/src/App.vue b/src/App.vue index 7ae1872..68fd092 100644 --- a/src/App.vue +++ b/src/App.vue @@ -12,8 +12,8 @@ diff --git a/src/views/Login.vue b/src/views/Login.vue deleted file mode 100644 index ff13312..0000000 --- a/src/views/Login.vue +++ /dev/null @@ -1,174 +0,0 @@ - - - - - diff --git a/src/views/PaymentResult.vue b/src/views/PaymentResult.vue deleted file mode 100644 index 2192784..0000000 --- a/src/views/PaymentResult.vue +++ /dev/null @@ -1,142 +0,0 @@ - - - - - diff --git a/src/views/Profile.vue b/src/views/Profile.vue index 00c368d..07decb6 100644 --- a/src/views/Profile.vue +++ b/src/views/Profile.vue @@ -6,18 +6,20 @@
- - {{ userInfo.username?.charAt(0)?.toUpperCase() || 'U' }} + + {{ (userInfo.name || userInfo.username || userStore.username || 'U').charAt(0).toUpperCase() }}
- {{ userInfo.username || '用户' }} -
尊贵会员
+ {{ userInfo.name || userInfo.username || userStore.username || '用户' }} +
尊贵会员
普通用户
@@ -53,14 +55,14 @@
- {{ planLabel(o.plan_type) }} - {{ formatDate(o.created_at) }} + {{ planLabel(o.goods_name) }} + {{ formatDate(o.pay_time) }}
- ¥{{ o.amount }} - + ¥{{ o.total_fee }} +
@@ -83,14 +85,14 @@
- {{ planLabel(o.plan_type) }} - {{ formatDate(o.created_at) }} + {{ planLabel(o.goods_name) }} + {{ formatDate(o.pay_time) }}
- ¥{{ o.amount }} - + ¥{{ o.total_fee }} +
@@ -107,8 +109,9 @@ import { ElMessage, ElMessageBox } from 'element-plus' import api from '@/api' import { useUserStore } from '@/stores/user' import { checkUserVip } from '@/utils/appUtils' -import BaseDialog from '@/components/BaseDialog.vue' -import WarningFooter from '@/components/WarningFooter.vue' +import BaseDialog from '@/components/common/BaseDialog.vue' +import WarningFooter from '@/components/common/WarningFooter.vue' +import authService from '@/api/authService.js' const router = useRouter() const userStore = useUserStore() @@ -119,38 +122,7 @@ const userInfo = reactive({ membership_expire_at: null, created_at: '' }) -const defaultOrder = [ - { - plan_type: '月卡会员', - created_at: '2026.6.1-2026.7.1', - amount: '19.90', - status: '进行中' - }, - { - plan_type: '月卡会员', - created_at: '2026.1.1-2026.2.1', - amount: '19.90', - status: '已过期' - }, - { - plan_type: '月卡会员', - created_at: '2026.1.1-2026.2.1', - amount: '19.90', - status: '已过期' - }, - { - plan_type: '月卡会员', - created_at: '2026.1.1-2026.2.1', - amount: '19.90', - status: '已过期' - }, - { - plan_type: '月卡会员', - created_at: '2026.1.1-2026.2.1', - amount: '19.90', - status: '已过期' - }, -] +const defaultOrder = [] const isVip = ref(false) const dialogVisible = ref(false) const worksCount = ref(1) @@ -158,26 +130,35 @@ const ordersCount = ref(0) const orders = ref(defaultOrder) const productMap = ref({}) // productId -> productName 映射 -onMounted(() => { - // 优先从 userStore 读取(注册/登录时已设置),立即显示页面 - if (userStore.username) { - userInfo.username = userStore.username - userInfo.avatar_url = userStore.avatarUrl || '' - isVip.value = userStore.isVip - // 静默请求补充 email/created_at 等字段,失败不弹提示 - api.auth.profileSilent().then(res => { - Object.assign(userInfo, res) - isVip.value = !!res.is_vip - }).catch(() => { }) - } else { - api.auth.profileSilent().then(res => { - Object.assign(userInfo, res) - isVip.value = !!res.is_vip - }).catch(() => { }) - } - loadStats() +onMounted(async () => { + try { + const data = await userStore.fetchProfile() + if (data) { + Object.assign(userInfo, data) + } + } catch (e) { } + + // 从本地缓存补全 userInfo 视图属性 + try { + const local = JSON.parse(localStorage.getItem('user_info') || '{}') + Object.assign(userInfo, local) + } catch (e) { } + + loadStats(); + getOrders(); }) +async function getOrders() { + try { + const res = await authService.getOrder({ status: 2 }) + if (res.code == 0 && res.data) { + console.log("订单列表", res.data) + orders.value = res.data + ordersCount.value = res.data.length + } + } catch (error) { } +} + async function loadStats() { // try { // const [wRes, oRes, pRes] = await Promise.all([ diff --git a/src/views/Register.vue b/src/views/Register.vue deleted file mode 100644 index 8620f00..0000000 --- a/src/views/Register.vue +++ /dev/null @@ -1,168 +0,0 @@ - - - - - diff --git a/src/views/Works.vue b/src/views/Works.vue deleted file mode 100644 index e6b6eed..0000000 --- a/src/views/Works.vue +++ /dev/null @@ -1,139 +0,0 @@ - - - - - diff --git a/src/views/article/detail.vue b/src/views/article/detail.vue new file mode 100644 index 0000000..e9c3da1 --- /dev/null +++ b/src/views/article/detail.vue @@ -0,0 +1,653 @@ + + + + + \ No newline at end of file diff --git a/src/views/article/list.vue b/src/views/article/list.vue new file mode 100644 index 0000000..ba7894f --- /dev/null +++ b/src/views/article/list.vue @@ -0,0 +1,310 @@ + + + + + \ No newline at end of file diff --git a/src/views/index/index.vue b/src/views/index/index.vue index 09784c0..fc37ec0 100644 --- a/src/views/index/index.vue +++ b/src/views/index/index.vue @@ -55,7 +55,7 @@