From 3175c6e8ae82a309777ee8c544aafa6e612edc42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=96=B9=E6=88=90?= Date: Sun, 28 Dec 2025 00:23:55 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E9=87=8D=E6=9E=84=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E7=BB=93=E6=9E=84=EF=BC=8C=E5=B0=86=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=8C=89=E6=A8=A1=E5=9D=97=E6=8B=86=E5=88=86=E8=87=B3pages-use?= =?UTF-8?q?r=E3=80=81pages-activity=E7=AD=89=E7=9B=AE=E5=BD=95=E5=B9=B6?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=9B=B8=E5=85=B3=E9=85=8D=E7=BD=AE=E5=92=8C?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/appUser.js | 4 +- components/PaymentPopup.vue | 2 +- components/activity/CabinetPreviewPopup.vue | 27 +- manifest.json | 86 +++--- .../activity/duiduipeng/index.vue | 109 ++++++- .../activity/list/index.vue | 8 +- .../activity/pata/index.vue | 2 +- .../activity/wuxianshang/index.vue | 2 +- .../activity/yifanshang/index.vue | 2 +- .../composables}/index.js | 0 .../composables}/useActivity.js | 0 .../composables}/useIssues.js | 0 .../composables}/useRecords.js | 0 .../composables}/useRewards.js | 0 .../game/minesweeper/index.vue | 2 +- {pages => pages-game}/game/webview.vue | 0 {pages => pages-shop}/shop/detail.vue | 0 {pages => pages-user}/address/edit.vue | 0 {pages => pages-user}/address/index.vue | 4 +- {pages => pages-user}/address/submit.vue | 0 {pages => pages-user}/agreement/purchase.vue | 0 {pages => pages-user}/agreement/user.vue | 0 {pages => pages-user}/coupons/index.vue | 0 {pages => pages-user}/help/index.vue | 4 +- {pages => pages-user}/invite/landing.vue | 4 +- {pages => pages-user}/invites/index.vue | 0 {pages => pages-user}/item-cards/index.vue | 0 {pages => pages-user}/orders/detail.vue | 6 +- {pages => pages-user}/orders/index.vue | 8 +- {pages => pages-user}/points/index.vue | 0 {pages => pages-user}/tasks/index.vue | 0 pages.json | 280 ++++++++++-------- pages/cabinet/index.vue | 171 +++-------- pages/index/index.vue | 16 +- pages/login/index.vue | 4 +- pages/mine/index.vue | 22 +- pages/shop/index.vue | 2 +- static/logo.png | Bin 318786 -> 93819 bytes static/share_invite.png | Bin 530345 -> 44714 bytes 39 files changed, 396 insertions(+), 369 deletions(-) rename {pages => pages-activity}/activity/duiduipeng/index.vue (93%) rename {pages => pages-activity}/activity/list/index.vue (95%) rename {pages => pages-activity}/activity/pata/index.vue (99%) rename {pages => pages-activity}/activity/wuxianshang/index.vue (99%) rename {pages => pages-activity}/activity/yifanshang/index.vue (99%) rename {composables => pages-activity/composables}/index.js (100%) rename {composables => pages-activity/composables}/useActivity.js (100%) rename {composables => pages-activity/composables}/useIssues.js (100%) rename {composables => pages-activity/composables}/useRecords.js (100%) rename {composables => pages-activity/composables}/useRewards.js (100%) rename {pages => pages-game}/game/minesweeper/index.vue (99%) rename {pages => pages-game}/game/webview.vue (100%) rename {pages => pages-shop}/shop/detail.vue (100%) rename {pages => pages-user}/address/edit.vue (100%) rename {pages => pages-user}/address/index.vue (98%) rename {pages => pages-user}/address/submit.vue (100%) rename {pages => pages-user}/agreement/purchase.vue (100%) rename {pages => pages-user}/agreement/user.vue (100%) rename {pages => pages-user}/coupons/index.vue (100%) rename {pages => pages-user}/help/index.vue (82%) rename {pages => pages-user}/invite/landing.vue (98%) rename {pages => pages-user}/invites/index.vue (100%) rename {pages => pages-user}/item-cards/index.vue (100%) rename {pages => pages-user}/orders/detail.vue (99%) rename {pages => pages-user}/orders/index.vue (98%) rename {pages => pages-user}/points/index.vue (100%) rename {pages => pages-user}/tasks/index.vue (100%) diff --git a/api/appUser.js b/api/appUser.js index c0b7cd3..bfb4284 100644 --- a/api/appUser.js +++ b/api/appUser.js @@ -5,8 +5,8 @@ export function wechatLogin(code, invite_code) { return request({ url: '/api/app/users/weixin/login', method: 'POST', data }) } -export function getInventory(user_id, page = 1, page_size = 20) { - return authRequest({ url: `/api/app/users/${user_id}/inventory`, method: 'GET', data: { page, page_size } }) +export function getInventory(user_id, page = 1, page_size = 20, params = {}) { + return authRequest({ url: `/api/app/users/${user_id}/inventory`, method: 'GET', data: { page, page_size, ...params } }) } export function bindPhone(user_id, code, extraHeader = {}) { diff --git a/components/PaymentPopup.vue b/components/PaymentPopup.vue index 957a867..d3b9e1d 100644 --- a/components/PaymentPopup.vue +++ b/components/PaymentPopup.vue @@ -163,7 +163,7 @@ function onCardChange(e) { function openAgreement() { uni.navigateTo({ - url: '/pages/agreement/purchase' // 假设协议页面路径,如果没有请替换为实际路径 + url: '/pages-user/agreement/purchase' // 假设协议页面路径,如果没有请替换为实际路径 }) } diff --git a/components/activity/CabinetPreviewPopup.vue b/components/activity/CabinetPreviewPopup.vue index 283f132..67c9855 100644 --- a/components/activity/CabinetPreviewPopup.vue +++ b/components/activity/CabinetPreviewPopup.vue @@ -76,29 +76,22 @@ async function loadItems() { try { const userId = uni.getStorageSync('user_id') if (!userId) { items.value = []; total.value = 0; return } - const res = await getInventory(userId, 1, 50) + const res = await getInventory(userId, 1, 50, { status: 1 }) let list = [] let rawTotal = 0 if (res && Array.isArray(res.list)) { list = res.list; rawTotal = res.total || 0 } else if (res && Array.isArray(res.data)) { list = res.data; rawTotal = res.total || 0 } else if (Array.isArray(res)) { list = res; rawTotal = res.length } - const filtered = list.filter(item => Number(item.status) === 1 && !item.has_shipment) - const aggregated = new Map() - filtered.forEach(item => { - const key = String(item.product_id || item.id) - if (aggregated.has(key)) { - aggregated.get(key).count += 1 - } else { - aggregated.set(key, { - id: key, - name: (item.product_name || item.name || '').trim() || '未知物品', - image: cleanUrl(item.product_images || item.image), - count: 1 - }) - } - }) - items.value = Array.from(aggregated.values()) + // 后端已按 status=1 过滤,这里只需要排除前端正在处理的项 + // 后端已经按 status=1 过滤并聚合,直接映射 + const displayRes = list.map(item => ({ + id: item.product_id, + name: (item.product_name || '未知商品').trim(), + image: cleanUrl(item.product_images || item.image), + count: item.count + })) + items.value = displayRes total.value = rawTotal } catch (e) { console.error('[CabinetPreviewPopup] 加载失败', e) diff --git a/manifest.json b/manifest.json index d787c0a..c659be6 100644 --- a/manifest.json +++ b/manifest.json @@ -1,28 +1,28 @@ { - "name" : "app_client", - "appid" : "", - "description" : "", - "versionName" : "1.0.0", - "versionCode" : "100", - "transformPx" : false, + "name": "app_client", + "appid": "", + "description": "", + "versionName": "1.0.0", + "versionCode": "100", + "transformPx": false, /* 5+App特有相关 */ - "app-plus" : { - "usingComponents" : true, - "nvueStyleCompiler" : "uni-app", - "compilerVersion" : 3, - "splashscreen" : { - "alwaysShowBeforeRender" : true, - "waiting" : true, - "autoclose" : true, - "delay" : 0 + "app-plus": { + "usingComponents": true, + "nvueStyleCompiler": "uni-app", + "compilerVersion": 3, + "splashscreen": { + "alwaysShowBeforeRender": true, + "waiting": true, + "autoclose": true, + "delay": 0 }, /* 模块配置 */ - "modules" : {}, + "modules": {}, /* 应用发布信息 */ - "distribute" : { + "distribute": { /* android打包配置 */ - "android" : { - "permissions" : [ + "android": { + "permissions": [ "", "", "", @@ -41,36 +41,40 @@ ] }, /* ios打包配置 */ - "ios" : {}, + "ios": {}, /* SDK配置 */ - "sdkConfigs" : {} + "sdkConfigs": {} } }, /* 快应用特有相关 */ - "quickapp" : {}, + "quickapp": {}, /* 小程序特有相关 */ - "mp-weixin" : { - "appid" : "wx26ad074017e1e63f", - "setting" : { - "urlCheck" : false, - "minified" : true, - "es6" : true, - "postcss" : true + "mp-weixin": { + "appid": "wx26ad074017e1e63f", + "setting": { + "urlCheck": false, + "minified": true, + "es6": true, + "postcss": true }, - "usingComponents" : true + "usingComponents": true, + "lazyCodeLoading": "requiredComponents", + "optimization": { + "subPackages": true + } }, - "mp-alipay" : { - "usingComponents" : true + "mp-alipay": { + "usingComponents": true }, - "mp-baidu" : { - "usingComponents" : true + "mp-baidu": { + "usingComponents": true }, - "mp-toutiao" : { - "usingComponents" : true, - "appid" : "ttf031868c6f33d91001" + "mp-toutiao": { + "usingComponents": true, + "appid": "ttf031868c6f33d91001" }, - "uniStatistics" : { - "enable" : false + "uniStatistics": { + "enable": false }, - "vueVersion" : "3" -} + "vueVersion": "3" +} \ No newline at end of file diff --git a/pages/activity/duiduipeng/index.vue b/pages-activity/activity/duiduipeng/index.vue similarity index 93% rename from pages/activity/duiduipeng/index.vue rename to pages-activity/activity/duiduipeng/index.vue index ff2272c..2beeae0 100644 --- a/pages/activity/duiduipeng/index.vue +++ b/pages-activity/activity/duiduipeng/index.vue @@ -170,6 +170,13 @@ v-model:visible="cabinetVisible" :activity-id="activityId" /> + + + @@ -186,6 +193,7 @@ import RewardsPopup from '@/components/activity/RewardsPopup.vue' import RecordsList from '@/components/activity/RecordsList.vue' import RulesPopup from '@/components/activity/RulesPopup.vue' import CabinetPreviewPopup from '@/components/activity/CabinetPreviewPopup.vue' +import LotteryResultPopup from '@/components/activity/LotteryResultPopup.vue' import { getActivityDetail, getActivityIssues, getActivityIssueRewards, getUserCoupons, getItemCards, createWechatOrder, getMatchingCardTypes, createMatchingPreorder, checkMatchingGame, getIssueDrawLogs, getMatchingGameCards } from '../../../api/appUser' import { levelToAlpha } from '@/utils/activity' @@ -211,6 +219,8 @@ const selectedCardTypeCode = ref('') const rewardsVisible = ref(false) const rulesVisible = ref(false) const cabinetVisible = ref(false) +const resultVisible = ref(false) +const resultItems = ref([]) const resumeGame = ref(null) const resumeIssueId = ref('') const hasResumeGame = computed(() => { @@ -928,15 +938,96 @@ async function finishAndReport() { const entry = gameEntry.value || null const gameId = entry && entry.game_id ? String(entry.game_id) : '' if (!gameId) return - await checkMatchingGame(gameId, Number(totalPairs.value || 0)) - clearMatchingGameCacheEntry(aid, issueId) - gameFinished.value = true - closeGame() - uni.showModal({ - title: '游戏结束', - content: `总对数:${Number(totalPairs.value || 0)}`, - showCancel: false - }) + + try { + const checkRes = await checkMatchingGame(gameId, Number(totalPairs.value || 0)) + clearMatchingGameCacheEntry(aid, issueId) + gameFinished.value = true + closeGame() + + console.log('[对对碰] checkRes:', JSON.stringify(checkRes)) + console.log('[对对碰] currentIssueRewards:', currentIssueRewards.value?.length, 'items') + console.log('[对对碰] rewardsMap keys:', Object.keys(rewardsMap.value || {})) + + // 解析中奖结果 - 后端返回格式是 { reward: { reward_id, name, level } } + let wonItems = [] + + // 后端返回单个 reward 对象的情况 + if (checkRes?.reward && checkRes.reward.reward_id) { + const reward = checkRes.reward + console.log('[对对碰] 检测到reward对象:', reward) + // 从本地 rewardsMap 查找图片 + const allRewards = rewardsMap.value[issueId] || currentIssueRewards.value || [] + console.log('[对对碰] 本地奖励数据:', allRewards.length, 'items') + const foundReward = allRewards.find(r => + String(r.id) === String(reward.reward_id) || + String(r.reward_id) === String(reward.reward_id) + ) + console.log('[对对碰] 匹配到的奖励:', foundReward) + wonItems = [{ + title: reward.name || foundReward?.name || foundReward?.title || '神秘奖励', + image: foundReward?.image || foundReward?.pic || foundReward?.img || foundReward?.product_image || '', + reward_id: reward.reward_id + }] + } + // 处理数组格式(兼容) + else if (Array.isArray(checkRes) && checkRes.length > 0) { + wonItems = checkRes + } else if (checkRes?.list && checkRes.list.length > 0) { + wonItems = checkRes.list + } else if (checkRes?.data && Array.isArray(checkRes.data) && checkRes.data.length > 0) { + wonItems = checkRes.data + } else if (checkRes?.rewards && checkRes.rewards.length > 0) { + wonItems = checkRes.rewards + } else if (checkRes?.items && checkRes.items.length > 0) { + wonItems = checkRes.items + } + + console.log('[对对碰] wonItems:', wonItems) + + // 转换为 LotteryResultPopup 需要的格式 + if (wonItems.length > 0) { + const allRewards = rewardsMap.value[issueId] || currentIssueRewards.value || [] + resultItems.value = wonItems.map(item => { + // 如果已经有 title,直接使用 + if (item.title) return item + // 否则尝试从本地数据匹配 + const found = allRewards.find(r => + String(r.id) === String(item.reward_id) || + String(r.reward_id) === String(item.reward_id) + ) + return { + title: item.title || item.name || found?.name || found?.title || '神秘奖励', + image: item.image || item.img || found?.image || found?.pic || found?.product_image || '', + reward_id: item.reward_id || item.id + } + }) + } else { + resultItems.value = [] + } + + console.log('[对对碰] resultItems:', resultItems.value) + + // 显示结果弹窗 + if (resultItems.value.length > 0) { + resultVisible.value = true + } else { + // 没有中奖物品时显示简单提示 + uni.showModal({ + title: '游戏结束', + content: `总对数:${Number(totalPairs.value || 0)}`, + showCancel: false + }) + } + } catch (e) { + console.error('finishAndReport error', e) + uni.showToast({ title: e?.message || '结算失败', icon: 'none' }) + } +} + +function onResultClose() { + resultVisible.value = false + resultItems.value = [] } async function advanceOne() { diff --git a/pages/activity/list/index.vue b/pages-activity/activity/list/index.vue similarity index 95% rename from pages/activity/list/index.vue rename to pages-activity/activity/list/index.vue index 161abca..368f9e7 100644 --- a/pages/activity/list/index.vue +++ b/pages-activity/activity/list/index.vue @@ -94,10 +94,10 @@ function onActivityTap(a) { let path = '' // Navigate to DETAIL, not list - if (name.includes('一番赏')) path = '/pages/activity/yifanshang/index' - else if (name.includes('无限赏')) path = '/pages/activity/wuxianshang/index' - else if (name.includes('对对碰')) path = '/pages/activity/duiduipeng/index' - else if (name.includes('爬塔')) path = '/pages/activity/pata/index' + if (name.includes('一番赏')) path = '/pages-activity/activity/yifanshang/index' + else if (name.includes('无限赏')) path = '/pages-activity/activity/wuxianshang/index' + else if (name.includes('对对碰')) path = '/pages-activity/activity/duiduipeng/index' + else if (name.includes('爬塔')) path = '/pages-activity/activity/pata/index' if (path && id) { uni.navigateTo({ url: `${path}?id=${id}` }) diff --git a/pages/activity/pata/index.vue b/pages-activity/activity/pata/index.vue similarity index 99% rename from pages/activity/pata/index.vue rename to pages-activity/activity/pata/index.vue index 79703a6..020d947 100644 --- a/pages/activity/pata/index.vue +++ b/pages-activity/activity/pata/index.vue @@ -93,7 +93,7 @@ function onStartChallenge() { const gameUrl = 'http://localhost:5174/' uni.navigateTo({ - url: `/pages/game/webview?url=${encodeURIComponent(gameUrl)}&ticket=${ticketId.value}` + url: `/pages-game/game/webview?url=${encodeURIComponent(gameUrl)}&ticket=${ticketId.value}` }) } diff --git a/pages/activity/wuxianshang/index.vue b/pages-activity/activity/wuxianshang/index.vue similarity index 99% rename from pages/activity/wuxianshang/index.vue rename to pages-activity/activity/wuxianshang/index.vue index 1d786c2..ae556df 100644 --- a/pages/activity/wuxianshang/index.vue +++ b/pages-activity/activity/wuxianshang/index.vue @@ -130,7 +130,7 @@ import LotteryResultPopup from '@/components/activity/LotteryResultPopup.vue' import DrawLoadingPopup from '@/components/activity/DrawLoadingPopup.vue' import PaymentPopup from '@/components/PaymentPopup.vue' // Composables -import { useActivity, useIssues, useRewards, useRecords } from '@/composables' +import { useActivity, useIssues, useRewards, useRecords } from '../../composables' // API import { joinLottery, createWechatOrder, getLotteryResult, getItemCards, getUserCoupons } from '@/api/appUser' diff --git a/pages/activity/yifanshang/index.vue b/pages-activity/activity/yifanshang/index.vue similarity index 99% rename from pages/activity/yifanshang/index.vue rename to pages-activity/activity/yifanshang/index.vue index d2f4324..54f7356 100644 --- a/pages/activity/yifanshang/index.vue +++ b/pages-activity/activity/yifanshang/index.vue @@ -131,7 +131,7 @@ import CabinetPreviewPopup from '@/components/activity/CabinetPreviewPopup.vue' import FlipGrid from '@/components/FlipGrid.vue' import YifanSelector from '@/components/YifanSelector.vue' // Composables -import { useActivity, useIssues, useRewards, useRecords } from '@/composables' +import { useActivity, useIssues, useRewards, useRecords } from '../../composables' // Utils import { formatDateTime, parseTimeMs } from '@/utils/format' diff --git a/composables/index.js b/pages-activity/composables/index.js similarity index 100% rename from composables/index.js rename to pages-activity/composables/index.js diff --git a/composables/useActivity.js b/pages-activity/composables/useActivity.js similarity index 100% rename from composables/useActivity.js rename to pages-activity/composables/useActivity.js diff --git a/composables/useIssues.js b/pages-activity/composables/useIssues.js similarity index 100% rename from composables/useIssues.js rename to pages-activity/composables/useIssues.js diff --git a/composables/useRecords.js b/pages-activity/composables/useRecords.js similarity index 100% rename from composables/useRecords.js rename to pages-activity/composables/useRecords.js diff --git a/composables/useRewards.js b/pages-activity/composables/useRewards.js similarity index 100% rename from composables/useRewards.js rename to pages-activity/composables/useRewards.js diff --git a/pages/game/minesweeper/index.vue b/pages-game/game/minesweeper/index.vue similarity index 99% rename from pages/game/minesweeper/index.vue rename to pages-game/game/minesweeper/index.vue index 1d9829f..4ce851a 100644 --- a/pages/game/minesweeper/index.vue +++ b/pages-game/game/minesweeper/index.vue @@ -124,7 +124,7 @@ export default { // 跳转到webview uni.navigateTo({ - url: `/pages/game/webview?url=${encodeURIComponent(gameUrl)}` + url: `/pages-game/game/webview?url=${encodeURIComponent(gameUrl)}` }) } catch (e) { uni.showToast({ diff --git a/pages/game/webview.vue b/pages-game/game/webview.vue similarity index 100% rename from pages/game/webview.vue rename to pages-game/game/webview.vue diff --git a/pages/shop/detail.vue b/pages-shop/shop/detail.vue similarity index 100% rename from pages/shop/detail.vue rename to pages-shop/shop/detail.vue diff --git a/pages/address/edit.vue b/pages-user/address/edit.vue similarity index 100% rename from pages/address/edit.vue rename to pages-user/address/edit.vue diff --git a/pages/address/index.vue b/pages-user/address/index.vue similarity index 98% rename from pages/address/index.vue rename to pages-user/address/index.vue index 8772444..d815e88 100644 --- a/pages/address/index.vue +++ b/pages-user/address/index.vue @@ -112,12 +112,12 @@ async function fetchList() { function toAdd() { uni.removeStorageSync('edit_address') - uni.navigateTo({ url: '/pages/address/edit' }) + uni.navigateTo({ url: '/pages-user/address/edit' }) } function toEdit(item) { uni.setStorageSync('edit_address', item) - uni.navigateTo({ url: `/pages/address/edit?id=${item.id}` }) + uni.navigateTo({ url: `/pages-user/address/edit?id=${item.id}` }) } function onDelete(item) { diff --git a/pages/address/submit.vue b/pages-user/address/submit.vue similarity index 100% rename from pages/address/submit.vue rename to pages-user/address/submit.vue diff --git a/pages/agreement/purchase.vue b/pages-user/agreement/purchase.vue similarity index 100% rename from pages/agreement/purchase.vue rename to pages-user/agreement/purchase.vue diff --git a/pages/agreement/user.vue b/pages-user/agreement/user.vue similarity index 100% rename from pages/agreement/user.vue rename to pages-user/agreement/user.vue diff --git a/pages/coupons/index.vue b/pages-user/coupons/index.vue similarity index 100% rename from pages/coupons/index.vue rename to pages-user/coupons/index.vue diff --git a/pages/help/index.vue b/pages-user/help/index.vue similarity index 82% rename from pages/help/index.vue rename to pages-user/help/index.vue index badcb41..391d13e 100644 --- a/pages/help/index.vue +++ b/pages-user/help/index.vue @@ -14,8 +14,8 @@ diff --git a/pages/invite/landing.vue b/pages-user/invite/landing.vue similarity index 98% rename from pages/invite/landing.vue rename to pages-user/invite/landing.vue index cd27107..1ab0032 100644 --- a/pages/invite/landing.vue +++ b/pages-user/invite/landing.vue @@ -122,8 +122,8 @@ function toggleAgreement() { agreementChecked.value = !agreementChecked.value } -function toUserAgreement() { uni.navigateTo({ url: '/pages/agreement/user' }) } -function toPurchaseAgreement() { uni.navigateTo({ url: '/pages/agreement/purchase' }) } +function toUserAgreement() { uni.navigateTo({ url: '/pages-user/agreement/user' }) } +function toPurchaseAgreement() { uni.navigateTo({ url: '/pages-user/agreement/purchase' }) } function goLogin() { uni.navigateTo({ url: '/pages/login/index' }) diff --git a/pages/invites/index.vue b/pages-user/invites/index.vue similarity index 100% rename from pages/invites/index.vue rename to pages-user/invites/index.vue diff --git a/pages/item-cards/index.vue b/pages-user/item-cards/index.vue similarity index 100% rename from pages/item-cards/index.vue rename to pages-user/item-cards/index.vue diff --git a/pages/orders/detail.vue b/pages-user/orders/detail.vue similarity index 99% rename from pages/orders/detail.vue rename to pages-user/orders/detail.vue index 6a242a5..50dae82 100644 --- a/pages/orders/detail.vue +++ b/pages-user/orders/detail.vue @@ -338,11 +338,11 @@ function navigateToGame(ord) { let url = '' if (playType === 'match') { - url = `/pages/activity/duiduipeng/index?activity_id=${activityId}` + url = `/pages-activity/activity/duiduipeng/index?activity_id=${activityId}` } else if (playType === 'ichiban') { - url = `/pages/activity/yifanshang/index?activity_id=${activityId}` + url = `/pages-activity/activity/yifanshang/index?activity_id=${activityId}` } else if (playType === 'infinity') { - url = `/pages/activity/wuxianshang/index?activity_id=${activityId}` + url = `/pages-activity/activity/wuxianshang/index?activity_id=${activityId}` } if (url) { diff --git a/pages/orders/index.vue b/pages-user/orders/index.vue similarity index 98% rename from pages/orders/index.vue rename to pages-user/orders/index.vue index 1effbb0..4f3a551 100644 --- a/pages/orders/index.vue +++ b/pages-user/orders/index.vue @@ -399,7 +399,7 @@ async function fetchAllOrders() { function goOrderDetail(item) { // 跳转订单详情页 uni.navigateTo({ - url: `/pages/orders/detail?id=${item.id}&order_no=${item.order_no}` + url: `/pages-user/orders/detail?id=${item.id}&order_no=${item.order_no}` }) } @@ -476,11 +476,11 @@ function navigateToGame(item) { let url = '' if (playType === 'match') { - url = `/pages/activity/duiduipeng/index?activity_id=${activityId}` + url = `/pages-activity/activity/duiduipeng/index?activity_id=${activityId}` } else if (playType === 'ichiban') { - url = `/pages/activity/yifanshang/index?activity_id=${activityId}` + url = `/pages-activity/activity/yifanshang/index?activity_id=${activityId}` } else if (playType === 'infinity') { - url = `/pages/activity/wuxianshang/index?activity_id=${activityId}` + url = `/pages-activity/activity/wuxianshang/index?activity_id=${activityId}` } if (url) { diff --git a/pages/points/index.vue b/pages-user/points/index.vue similarity index 100% rename from pages/points/index.vue rename to pages-user/points/index.vue diff --git a/pages/tasks/index.vue b/pages-user/tasks/index.vue similarity index 100% rename from pages/tasks/index.vue rename to pages-user/tasks/index.vue diff --git a/pages.json b/pages.json index 449c7bb..77f6603 100644 --- a/pages.json +++ b/pages.json @@ -18,12 +18,6 @@ "navigationBarTitleText": "商城" } }, - { - "path": "pages/shop/detail", - "style": { - "navigationBarTitleText": "商品详情" - } - }, { "path": "pages/cabinet/index", "style": { @@ -35,135 +29,163 @@ "style": { "navigationBarTitleText": "我的" } + } + ], + "subPackages": [ + { + "root": "pages-activity", + "pages": [ + { + "path": "activity/yifanshang/index", + "style": { + "navigationBarTitleText": "一番赏" + } + }, + { + "path": "activity/wuxianshang/index", + "style": { + "navigationBarTitleText": "无限赏" + } + }, + { + "path": "activity/duiduipeng/index", + "style": { + "navigationBarTitleText": "对对碰" + } + }, + { + "path": "activity/list/index", + "style": { + "navigationBarTitleText": "活动列表" + } + }, + { + "path": "activity/pata/index", + "style": { + "navigationBarTitleText": "爬塔" + } + } + ] }, { - "path": "pages/points/index", - "style": { - "navigationBarTitleText": "积分记录" - } + "root": "pages-user", + "pages": [ + { + "path": "points/index", + "style": { + "navigationBarTitleText": "积分记录" + } + }, + { + "path": "coupons/index", + "style": { + "navigationBarTitleText": "我的优惠券" + } + }, + { + "path": "item-cards/index", + "style": { + "navigationBarTitleText": "我的道具卡" + } + }, + { + "path": "invite/landing", + "style": { + "navigationBarTitleText": "好友邀请" + } + }, + { + "path": "invites/index", + "style": { + "navigationBarTitleText": "邀请记录" + } + }, + { + "path": "tasks/index", + "style": { + "navigationBarTitleText": "任务中心" + } + }, + { + "path": "orders/index", + "style": { + "navigationBarTitleText": "我的订单" + } + }, + { + "path": "orders/detail", + "style": { + "navigationBarTitleText": "订单详情" + } + }, + { + "path": "address/index", + "style": { + "navigationBarTitleText": "地址管理" + } + }, + { + "path": "address/edit", + "style": { + "navigationBarTitleText": "编辑地址" + } + }, + { + "path": "address/submit", + "style": { + "navigationBarTitleText": "填写收货信息" + } + }, + { + "path": "help/index", + "style": { + "navigationBarTitleText": "使用帮助" + } + }, + { + "path": "agreement/user", + "style": { + "navigationBarTitleText": "用户协议" + } + }, + { + "path": "agreement/purchase", + "style": { + "navigationBarTitleText": "购买协议" + } + } + ] }, { - "path": "pages/coupons/index", - "style": { - "navigationBarTitleText": "我的优惠券" - } + "root": "pages-shop", + "pages": [ + { + "path": "shop/detail", + "style": { + "navigationBarTitleText": "商品详情" + } + } + ] }, { - "path": "pages/item-cards/index", - "style": { - "navigationBarTitleText": "我的道具卡" - } - }, - { - "path": "pages/invite/landing", - "style": { - "navigationBarTitleText": "好友邀请" - } - }, - { - "path": "pages/invites/index", - "style": { - "navigationBarTitleText": "邀请记录" - } - }, - { - "path": "pages/tasks/index", - "style": { - "navigationBarTitleText": "任务中心" - } - }, - { - "path": "pages/orders/index", - "style": { - "navigationBarTitleText": "我的订单" - } - }, - { - "path": "pages/orders/detail", - "style": { - "navigationBarTitleText": "订单详情" - } - }, - { - "path": "pages/address/index", - "style": { - "navigationBarTitleText": "地址管理" - } - }, - { - "path": "pages/address/edit", - "style": { - "navigationBarTitleText": "编辑地址" - } - }, - { - "path": "pages/address/submit", - "style": { - "navigationBarTitleText": "填写收货信息" - } - }, - { - "path": "pages/help/index", - "style": { - "navigationBarTitleText": "使用帮助" - } - }, - { - "path": "pages/agreement/user", - "style": { - "navigationBarTitleText": "用户协议" - } - }, - { - "path": "pages/agreement/purchase", - "style": { - "navigationBarTitleText": "购买协议" - } - }, - { - "path": "pages/activity/yifanshang/index", - "style": { - "navigationBarTitleText": "一番赏" - } - }, - { - "path": "pages/activity/wuxianshang/index", - "style": { - "navigationBarTitleText": "无限赏" - } - }, - { - "path": "pages/activity/duiduipeng/index", - "style": { - "navigationBarTitleText": "对对碰" - } - }, - { - "path": "pages/activity/list/index", - "style": { - "navigationBarTitleText": "活动列表" - } - }, - { - "path": "pages/activity/pata/index", - "style": { - "navigationBarTitleText": "爬塔" - } - }, - { - "path": "pages/game/minesweeper/index", - "style": { - "navigationStyle": "custom", - "navigationBarTitleText": "扫雷游戏" - } - }, - { - "path": "pages/game/webview", - "style": { - "navigationBarTitleText": "游戏挑战", - "navigationBarBackgroundColor": "#000000", - "navigationBarTextStyle": "white" - } + "root": "pages-game", + "pages": [ + { + "path": "game/minesweeper/index", + "style": { + "navigationStyle": "custom", + "navigationBarTitleText": "扫雷 game" + } + }, + { + "path": "game/webview", + "style": { + "navigationBarTitleText": "游戏挑战", + "navigationBarBackgroundColor": "#000000", + "navigationBarTextStyle": "white" + } + } + ] } ], "tabBar": { diff --git a/pages/cabinet/index.vue b/pages/cabinet/index.vue index ed54209..65c9f7c 100644 --- a/pages/cabinet/index.vue +++ b/pages/cabinet/index.vue @@ -162,7 +162,7 @@