From b671e8d76c9de46c789a27926306fb073db5d9a6 Mon Sep 17 00:00:00 2001 From: chenghuan Date: Mon, 8 Dec 2025 14:34:18 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=EF=BC=9A=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=BF=81=E7=A7=BB=E5=8A=9F=E8=83=BD=E5=AE=8C=E5=96=84?= =?UTF-8?q?=EF=BC=9B=EF=BC=88=E6=95=B0=E6=8D=AE=E8=BF=81=E7=A7=BB=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=B7=B2=E6=B3=A8=E9=87=8A=EF=BC=8C=E6=9A=82=E4=B8=8D?= =?UTF-8?q?=E4=B8=8A=E7=BA=BF=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/config.ts | 4 ++-- locale/en.json | 3 +++ locale/zh-Hans.json | 3 +++ pages/user/index.vue | 2 +- pages/user/migrate/index.vue | 39 +++++++++++++++++++++++++++++++----- style/tailwind.css | 14 +++++++++++++ 6 files changed, 57 insertions(+), 8 deletions(-) diff --git a/api/config.ts b/api/config.ts index 5b3a64c..98494ac 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/locale/en.json b/locale/en.json index 4de83c9..8370f54 100644 --- a/locale/en.json +++ b/locale/en.json @@ -227,6 +227,9 @@ "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.", + "alreadyMigrated": "You have already migrated:", + "notMigration": "This migration:", + "migratedCompleted": "You have completed all migrations:", "closeWindow": "Close the payment pop-up window" }, "book": { diff --git a/locale/zh-Hans.json b/locale/zh-Hans.json index 54d1fc9..5494e8e 100644 --- a/locale/zh-Hans.json +++ b/locale/zh-Hans.json @@ -228,6 +228,9 @@ "instruction2": "数据迁移完成后,旧账号数据将被清空,已购买的天医币、积分、课程、电子书、VIP、证书、湖分将转移到当前账号。", "instruction3": "迁移过程可能需要几分钟时间,请耐心等待。", "instruction4": "如遇到问题,请联系客服获取帮助。", + "alreadyMigrated": "您已迁移过:", + "notMigration": "本次迁移:", + "migratedCompleted": "您已迁移过所有可迁移数据:", "closeWindow": "关闭支付弹窗" }, "book": { diff --git a/pages/user/index.vue b/pages/user/index.vue index 3cd324b..5b80905 100644 --- a/pages/user/index.vue +++ b/pages/user/index.vue @@ -255,7 +255,7 @@ $theme-color: #54a966; .user-page { - min-height: 100vh; + min-height: calc(100vh - 50px); background-color: #f7faf9; } diff --git a/pages/user/migrate/index.vue b/pages/user/migrate/index.vue index 387c28d..b3b1503 100644 --- a/pages/user/migrate/index.vue +++ b/pages/user/migrate/index.vue @@ -3,10 +3,20 @@ - {{ $t('user.migrateWarning') }} + + {{ $t('user.alreadyMigrated') }}{{ migrateInfo.alreadyMigration }} + {{ $t('user.notMigration') }}{{ migrateInfo.notMigration }} + + + + + + + + {{ $t('user.migrateWarning') }} - + + + \ No newline at end of file diff --git a/pages/course/details/course.vue b/pages/course/details/course.vue index 067cd5d..4ec91c9 100644 --- a/pages/course/details/course.vue +++ b/pages/course/details/course.vue @@ -20,10 +20,8 @@ v-if="catalogueList.length > 0" :catalogues="catalogueList" :userVip="userVip" - @getFreeCourse="handleGetFreeCourse" - @purchase="handlePurchase" @toVip="goToVip" - @renew="handleRenew" + @loadPageData="loadPageData" @toDetail="handleToDetail" /> @@ -89,55 +87,14 @@ /> --> - - - - - - - 温馨提示 - - - 用户您好,本软件对于一个用户名及密码仅允许一部电子设备登陆,多部设备使用同一用户名操作软件的行为属于违规操作,发现违规一次将提出警告,再次违规您的用户名将被封号,无法正常登陆,如因此对您使用带来不便,敬请谅解。 - - - 课程购买之后一年内不打开,此一年内不会计算有效学习时间,一年后会自动开始计算有效学习时间。 - - - 本课程一经购买,暂不支持退款,敬请谅解。 - - 注: - - 1.手机、pad、电脑均为可登陆电子设备,均有唯一标识码,一个用户名仅允许在一个手机或一个ipad或一个电脑登陆,请根据您的使用习惯自行选择。
- 2.如若申请变更登陆设备请联系客服,
- 客服电话:021-08371305
- 客服微信号:yilujiankangkefu
- 3.如因违反上述使用规定...概不退款,本公司保留追究用户相关法律责任的权利。
- 4.点击“同意”按钮即表示您同意遵守以上条款。 -
-
- - 不同意 - 同意 - -
-
- - + /> --> @@ -153,7 +110,6 @@ import { useUserStore } from '@/stores/user' import { courseApi } from '@/api/modules/course' import CourseInfo from './components/CourseInfo.vue' import CatalogueList from './components/CatalogueList.vue' -import GoodsSelector from '@/components/order/GoodsSelector.vue' import CommentList from '@/components/comment/CommentList.vue' import CommentEditor from '@/components/comment/CommentEditor.vue' import type { ICourseDetail, ICatalogue, IChapter, IVipInfo } from '@/types/course' @@ -172,14 +128,6 @@ const vipModuleList = ref([]) const learningProgress = ref(0) const relatedBooks = ref([]) -// 商品选择 -const showGoodsSelector = ref(false) -const goodsList = ref([]) -const selectedGoods = ref(null) -const showProtocol = ref(false) -const isFudu = ref(false) -const fuduCatalogueId = ref(0) - // 评论相关 const commentList = ref([]) const commentsLoading = ref(false) @@ -301,92 +249,6 @@ const goToVip = () => { }) } -/** - * 领取免费课程 - */ -const handleGetFreeCourse = async (catalogue: ICatalogue) => { - if (!catalogue) return - - const res = await courseApi.startStudyForMF(catalogue.id) - if (res.code === 0) { - uni.showToast({ title: '领取成功', icon: 'success' }) - // 刷新页面数据 - loadPageData() - } else { - uni.showToast({ title: res.msg || '领取失败', icon: 'none' }) - } -} - -/** - * 购买课程 - */ -const handlePurchase = async (catalogue: ICatalogue) => { - if (!catalogue) return - - isFudu.value = false - const res = await courseApi.getProductListForCourse(catalogue.id) - if (res.code === 0 && res.productList.length > 0) { - goodsList.value = res.productList - showGoodsSelector.value = true - } else { - uni.showToast({ title: '此课程暂无购买方式', icon: 'none' }) - } -} - -/** - * 续费/复读 - */ -const handleRenew = async () => { - // if (!currentCatalogue.value) return - - // isFudu.value = true - // fuduCatalogueId.value = currentCatalogue.value.id - // const res = await courseApi.getRenewProductList(currentCatalogue.value.id) - // if (res.code === 0 && res.productList.length > 0) { - // goodsList.value = res.productList - // showGoodsSelector.value = true - // } else { - // uni.showToast({ title: '暂无复读方案', icon: 'none' }) - // } -} - -/** - * 选择商品 - */ -const handleGoodsSelect = (goods: IGoods) => { - selectedGoods.value = goods -} - -/** - * 确认购买 - */ -const handleGoodsConfirm = () => { - showGoodsSelector.value = false - showProtocol.value = true -} - -/** - * 关闭商品选择器 - */ -const closeGoodsSelector = () => { - showGoodsSelector.value = false -} - -/** - * 确认购买协议 - */ -const confirmPurchase = () => { - showProtocol.value = false - if (!selectedGoods.value) return - - showProtocol.value = false - - // 跳转到确认订单页 - uni.navigateTo({ - url: `/pages/order/goodsConfirm?goods=${selectedGoods.value.productId}` - }) -} - /** * 跳转到书籍详情 */ @@ -740,40 +602,6 @@ onReachBottom(() => { } } -.protocol-popup { - width: 600rpx; - padding: 40rpx; - background-color: #fff; - border-radius: 12rpx; - - .protocol-title { - font-size: 32rpx; - font-weight: 500; - color: #333; - text-align: center; - margin-bottom: 30rpx; - } - - .protocol-content { - max-height: 60vh; - overflow-y: auto; - font-size: 26rpx; - line-height: 1.8; - color: #666; - margin-bottom: 30rpx; - - text { - display: block; - margin-bottom: 20rpx; - } - } - - .protocol-actions { - display: flex; - gap: 20rpx; - } -} - :deep(.back-top) { background-color: #fff !important; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1); diff --git a/pages/order/goodsConfirm.vue b/pages/order/goodsConfirm.vue index 8d5d702..325e14d 100644 --- a/pages/order/goodsConfirm.vue +++ b/pages/order/goodsConfirm.vue @@ -91,22 +91,29 @@ const orderType = computed(() => { * 页面加载 */ onLoad(async (options: any) => { - if (options.goods) { - try { + try { + if (options.isRelearn == 1) { + uni.$on('selectedGoods', async (data: IOrderGoods) => { + // 获取用户信息 + await getUserInfo() + + // 处理商品数据 + console.log('监听到传入的商品数据:', data) + goodsList.value = [ data ] + }) + } else if (options.goods) { // 获取用户信息 await getUserInfo() - // 根据商品ID获取商品详细信息 goodsIds.value = options.goods || '' - isRelearn.value = options.isRelearn == '1' getGoodsList() - } catch (error) { - console.error('解析商品数据失败:', error) - uni.showToast({ - title: '商品数据错误', - icon: 'none' - }) } + } catch (error) { + console.error('解析商品数据失败:', error) + uni.showToast({ + title: '商品数据错误', + icon: 'none' + }) } }) diff --git a/pages/order/vipConfirm.vue b/pages/order/vipConfirm.vue index b4d1081..1a2ab47 100644 --- a/pages/order/vipConfirm.vue +++ b/pages/order/vipConfirm.vue @@ -56,10 +56,10 @@ const orderType = ref('') /** * 页面加载 */ -onLoad(async () => { +onLoad(() => { try { // 获取商品列表 - await uni.$on('selectedGoods', async (data: IOrderGoods) => { + uni.$on('selectedGoods', async (data: IOrderGoods) => { // 获取用户信息 await getUserInfo() diff --git a/types/user.ts b/types/user.ts index 4497965..390b05c 100644 --- a/types/user.ts +++ b/types/user.ts @@ -116,3 +116,15 @@ export interface IPageData { pages: number [key: string]: any } + +/** + * 订单接口 + */ +export interface IOrder { + id: number + orderType: string // 订单类型 + changeAmount: number + remark: string + createTime: string + [key: string]: any +} \ No newline at end of file