From 66b004d6bfdb89f79bf11a11bb2c3b975ae64e4d Mon Sep 17 00:00:00 2001 From: fuchao <2577131060@qq.com> Date: Tue, 9 Dec 2025 14:28:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=EF=BC=9A=E6=B8=B8=E5=AE=A2?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E3=80=81=E6=88=91=E7=9A=84=E6=B9=96=E5=88=86?= =?UTF-8?q?=E3=80=81=E6=88=91=E7=9A=84=E8=AF=81=E4=B9=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 60 +++++--- api/config.ts | 4 +- api/modules/common.ts | 6 +- api/modules/course.ts | 6 +- api/modules/cousre_subject_classification.ts | 5 +- api/modules/user.ts | 28 ++++ locale/en.json | 6 +- locale/zh-Hans.json | 6 +- pages.json | 23 ++++ pages/course/index.vue | 84 ++++++++--- pages/login/login.vue | 8 +- pages/user/certificate/index.vue | 134 ++++++++++++++++++ pages/user/hufen/forDetails.vue | 113 +++++++++++++++ pages/user/hufen/index.vue | 69 ++++++++++ pages/user/index.vue | 72 ++++++++-- pages/visitor/index.vue | 138 +++++++++++++++++++ static/contact-person.png | Bin 0 -> 1362 bytes static/moments.png | Bin 0 -> 1245 bytes 18 files changed, 702 insertions(+), 60 deletions(-) create mode 100644 pages/user/certificate/index.vue create mode 100644 pages/user/hufen/forDetails.vue create mode 100644 pages/user/hufen/index.vue create mode 100644 pages/visitor/index.vue create mode 100644 static/contact-person.png create mode 100644 static/moments.png diff --git a/App.vue b/App.vue index 636e4c4..0b6516b 100644 --- a/App.vue +++ b/App.vue @@ -1,29 +1,55 @@ + .container { + padding: 15px; + } + \ No newline at end of file diff --git a/api/config.ts b/api/config.ts index 5b3a64c..11478ba 100644 --- a/api/config.ts +++ b/api/config.ts @@ -7,8 +7,8 @@ export const ENV = process.env.NODE_ENV || 'development'; */ const BASE_URL_MAP = { development: { - // MAIN: 'http://192.168.110.100:9300/pb/', // 张川川 - MAIN: 'https://global.nuttyreading.com/', // 线上 + MAIN: 'http://192.168.110.100:9300/pb/', // 张川川 + //MAIN: 'https://global.nuttyreading.com/', // 线上 // PAYMENT: 'https://dev-pay.example.com', // 暂时用不到 // CDN: 'https://cdn-dev.example.com', // 暂时用不到 }, diff --git a/api/modules/common.ts b/api/modules/common.ts index 1e3a5dc..28837c8 100644 --- a/api/modules/common.ts +++ b/api/modules/common.ts @@ -2,6 +2,9 @@ import { mainClient } from '@/api/clients/main' import type { IApiResponse } from '@/api/types' import type { IAgreement } from '@/types/user' +import { useUserStore } from '@/stores/user' + + export const commonApi = { /** @@ -36,8 +39,9 @@ export const commonApi = { * @returns 消息列表 */ getMessageList(isBook: number, isMedical: number, isSociology: number) { + const userStore = useUserStore() return mainClient.request({ - url: 'common/message/listByPage', + url: userStore.token ? 'common/message/listByPage' : '/visitor/listByPage', method: 'POST', data: { isBook, isMedical, isSociology } }) diff --git a/api/modules/course.ts b/api/modules/course.ts index eb411f1..e906c2d 100644 --- a/api/modules/course.ts +++ b/api/modules/course.ts @@ -14,6 +14,9 @@ import type { } from '@/types/course' import type { ISearchRequest, ISearchResponse } from '@/types/search' import type { ICommentListResponse, IAddCommentResponse, IComment } from '@/types/comment' +import { useUserStore } from '@/stores/user' + + const client = createRequestClient({ baseURL: SERVICE_MAP.MAIN }) @@ -57,8 +60,9 @@ export const courseApi = { page: number, limit: number }) { + const userStore = useUserStore() return client.request({ - url: 'medical/home/getMarketCourseList', + url: userStore.token ? 'medical/home/getMarketCourseList' : 'visitor/getMarketCourseList', method: 'POST', data }) diff --git a/api/modules/cousre_subject_classification.ts b/api/modules/cousre_subject_classification.ts index 40c85df..59a5500 100644 --- a/api/modules/cousre_subject_classification.ts +++ b/api/modules/cousre_subject_classification.ts @@ -7,6 +7,8 @@ import type { IMarketCourseListResponse, ICourseMedicalLabelsResponse } from '@/types/course' +import { useUserStore } from '@/stores/user' + const client = createRequestClient({ baseURL: SERVICE_MAP.MAIN }) @@ -20,8 +22,9 @@ export const courseSubjectClassificationApi = { * @returns 分类数据 */ getCourseMedicalTree() { + const userStore = useUserStore() return client.request({ - url: 'medical/home/getCourseMedicalTree', + url: userStore.token ? 'medical/home/getCourseMedicalTree' : '/visitor/getCourseMedicalTree', method: 'POST', data: {} }) diff --git a/api/modules/user.ts b/api/modules/user.ts index ac6a8a6..dc36bd1 100644 --- a/api/modules/user.ts +++ b/api/modules/user.ts @@ -313,4 +313,32 @@ export async function migrateUserData(data: { tel: string, code: string }) { data }) return res +} + +/** + * 我的湖分 + * @return + */ +export async function getUserContributionData() { + const res = await mainClient.request({ + url: 'common/userContribution/getUserContribution', + method: 'POST' + }) + return res +} + +/** + * 湖分列表 + * @param current 当前页码 + * @param limit 每页数量 + * @param type 湖分类型 + * @return + */ +export async function getUserContributionByTypeList(current : number, limit : number, type : string,) { + const res = await mainClient.request({ + url: 'common/userContribution/getUserContributionByType', + method: 'POST', + data: { current, limit, type, } + }) + return res } \ No newline at end of file diff --git a/locale/en.json b/locale/en.json index 4de83c9..0c7aff9 100644 --- a/locale/en.json +++ b/locale/en.json @@ -227,7 +227,11 @@ "instruction2": "After data migration is complete, the chinese account data will be cleared, and all purchased Tianyi Coins, points, courses, E-book, VIP, certificate, and User Contribution will be transferred to the current account", "instruction3": "The migration process may take a few minutes, please be patient.", "instruction4": "If you encounter any issues, please contact customer service for assistance.", - "closeWindow": "Close the payment pop-up window" + "closeWindow": "Close the payment pop-up window", + "certificate": "My certificate", + "iHufen": "My lake", + "hufenRecord": "Lake division record", + "hufen": "Hufen" }, "book": { "title": "My Books", diff --git a/locale/zh-Hans.json b/locale/zh-Hans.json index 54d1fc9..20e4798 100644 --- a/locale/zh-Hans.json +++ b/locale/zh-Hans.json @@ -228,7 +228,11 @@ "instruction2": "数据迁移完成后,旧账号数据将被清空,已购买的天医币、积分、课程、电子书、VIP、证书、湖分将转移到当前账号。", "instruction3": "迁移过程可能需要几分钟时间,请耐心等待。", "instruction4": "如遇到问题,请联系客服获取帮助。", - "closeWindow": "关闭支付弹窗" + "closeWindow": "关闭支付弹窗", + "certificate": "我的证书", + "iHufen": "我的湖分", + "hufenRecord": "湖分记录", + "hufen": "湖分" }, "book": { "title": "我的书单", diff --git a/pages.json b/pages.json index 62e8d4f..a9072f9 100644 --- a/pages.json +++ b/pages.json @@ -67,6 +67,24 @@ "navigationBarTitleText": "%user.feedback%", "navigationStyle": "custom" } + },{ + "path": "pages/user/certificate/index", + "style": { + "navigationBarTitleText": "%user.certificate%", + "navigationStyle": "custom" + } + },{ + "path": "pages/user/hufen/index", + "style": { + "navigationBarTitleText": "%user.hufen%", + "navigationStyle": "custom" + } + },{ + "path": "pages/user/hufen/forDetails", + "style": { + "navigationBarTitleText": "%user.hufen%", + "navigationStyle": "custom" + } }, { "path": "pages/user/recharge/index", "style": { @@ -219,6 +237,11 @@ "animationDuration": 200 } } + }, { + "path": "pages/visitor/index", + "style": { + "navigationStyle": "custom" + } } ], "tabBar": { diff --git a/pages/course/index.vue b/pages/course/index.vue index 5d58734..50bc7c8 100644 --- a/pages/course/index.vue +++ b/pages/course/index.vue @@ -211,7 +211,9 @@ import { commonApi } from '@/api/modules/common' import { getNotchHeight } from '@/utils/system' // import { onPageJump } from '@/utils' import type { IMedicalTag, ICourse, INews } from '@/types/course' +import { useUserStore } from '@/stores/user' +const userStore = useUserStore() const { t } = useI18n() // 系统信息 @@ -239,18 +241,21 @@ const selectedFirstLevel = ref('医学') // 当前选中的一级分类 * 学科点击处理 */ const handleFirstLevelClick = (item: string) => { - selectedFirstLevel.value = item - switch (item) { - case '医学': - getMedicalTags() - break - case '心理学': - getSoulCateList() - break - case '国学': - getSociologyCateList() - break - } + getPrompt() + if(!userStore.token) return + selectedFirstLevel.value = item + switch (item) { + case '医学': + getMedicalTags() + break + case '心理学': + getSoulCateList() + break + case '国学': + getSociologyCateList() + break + } + } /** * 医学 @@ -326,15 +331,19 @@ const getSociologyCateList = async () => { * 终极分类点击处理 */ const curseClickJump = (item: IMedicalTag) => { - uni.navigateTo({ - url: `/pages/course/list/category?id=${item.id}&title=${item.title}&pid=${item.pid}&subject=${selectedFirstLevel.value}` - }) + getPrompt() + if(!userStore.token) return + uni.navigateTo({ + url: `/pages/course/list/category?id=${item.id}&title=${item.title}&pid=${item.pid}&subject=${selectedFirstLevel.value}` + }) } /** * 页面跳转统一处理 */ const onPageJump = (url: string, id?: number, title?: string) => { + getPrompt() + if(!userStore.token) return let targetUrl = url if (id !== undefined) { targetUrl += `?id=${id}` @@ -381,9 +390,12 @@ const getNewsList = async () => { * 新闻点击处理 */ const newsClick = (item: INews) => { - uni.navigateTo({ - url: `/pages/news/details?newsId=${item.id}&url=${item.url}&type=${item.type}` - }) + getPrompt() + if(!userStore.token) return + uni.navigateTo({ + url: `/pages/news/details?newsId=${item.id}&url=${item.url}&type=${item.type}` + }) + } // 精彩试听 @@ -406,31 +418,59 @@ const getTryListenList = async () => { } } +/** + * 登录提示语 + */ + const getPrompt = () => { + if(!userStore.token) { + uni.showModal({ + title: '提示', + content: '请先登录后访问该页面', + confirmText: '去登录', + success: (res) => { + console.log(res, 'res'); + if (res.confirm) uni.navigateTo({ + url: '/pages/login/login' + }); + } + }); + } + } + /** * 统一请求所有数据 */ const requestAll = async () => { - getLearnCourse() - getMedicalTags() - getTryListenList() - getNewsList() + if(userStore.token){ + getLearnCourse() + } + getMedicalTags() + getTryListenList() + getNewsList() } /** * 页面挂载 */ onMounted(() => { + if(!userStore.token) { + uni.navigateTo({ + url: '/pages/login/login' + }); + } // 重置分类索引 currentIndex.value = 0 // 请求所有数据 requestAll() + console.log('进来了2'); }) /** * 页面显示 */ onShow(() => { + console.log('进来了1'); // 检查是否有固定的分类选择状态 const fixed = uni.getStorageSync('fixed') if (fixed && currentItem.value) { diff --git a/pages/login/login.vue b/pages/login/login.vue index 5c85b8c..4a48f97 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -115,11 +115,11 @@ - + @@ -399,7 +399,7 @@ const yszc = () => { * 页面跳转 */ const onPageJump = (url: string) => { - uni.navigateTo({ + uni.switchTab({ url: url, }) } diff --git a/pages/user/certificate/index.vue b/pages/user/certificate/index.vue new file mode 100644 index 0000000..c60f62d --- /dev/null +++ b/pages/user/certificate/index.vue @@ -0,0 +1,134 @@ + + + + + \ No newline at end of file diff --git a/pages/user/hufen/forDetails.vue b/pages/user/hufen/forDetails.vue new file mode 100644 index 0000000..6e0b74d --- /dev/null +++ b/pages/user/hufen/forDetails.vue @@ -0,0 +1,113 @@ + + + + + \ No newline at end of file diff --git a/pages/user/hufen/index.vue b/pages/user/hufen/index.vue new file mode 100644 index 0000000..e4ad0fd --- /dev/null +++ b/pages/user/hufen/index.vue @@ -0,0 +1,69 @@ + + + + + \ No newline at end of file diff --git a/pages/user/index.vue b/pages/user/index.vue index 3cd324b..3afa085 100644 --- a/pages/user/index.vue +++ b/pages/user/index.vue @@ -1,5 +1,5 @@ @@ -394,6 +436,16 @@ border-radius: 15rpx; overflow: hidden; box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05); + + .menu-list-hufen { + font-size: 36rpx; + color: #007bff; + + text { + font-size: 26rpx; + } + } + } .chong_btn { diff --git a/pages/visitor/index.vue b/pages/visitor/index.vue new file mode 100644 index 0000000..eb9645a --- /dev/null +++ b/pages/visitor/index.vue @@ -0,0 +1,138 @@ + + + + + \ No newline at end of file diff --git a/static/contact-person.png b/static/contact-person.png new file mode 100644 index 0000000000000000000000000000000000000000..50b87012cb87f82821424c2c560d7504f73ee38b GIT binary patch literal 1362 zcmV-Y1+DstP)fck{NsDMF&F&Yz+zF>?-ebV>AC0pe6ggPTYF1~+XLUX^ZR|z?|#lX_x7H1O8^i*7PsA4AtEj9I;04*D8&xD+LCf4 zI2KK5O z88)kL)X+e#2&D4Yvc%$qYc+h@9b5UmV{EPmkoFDiUf|cTt2>7ZgZGT)QrpYp z%-r#7>eQA$v;Ex)@|g*R*ev;dcwj@VfEAx&B|I|5Y{aCOp~v2~bS|-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