From a4dbfd14b79a117d58e2e59bac12799748643ea2 Mon Sep 17 00:00:00 2001 From: tsui110 Date: Tue, 30 Dec 2025 15:28:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9=E6=96=B0=E7=89=88=E7=9A=84?= =?UTF-8?q?=E5=AF=B9=E5=AF=B9=E7=A2=B0=EF=BC=8C=E8=B0=83=E6=95=B4=E4=BA=86?= =?UTF-8?q?=E6=9B=B4=E5=A4=9A=E7=9A=84=E6=8E=92=E5=BA=8F=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=E7=AD=89=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/activity/RewardsPreview.vue | 15 +- pages-activity/activity/duiduipeng/index.vue | 29 +++- pages/shop/index.vue | 157 ++++++++++++++++++- utils/activity.js | 32 +++- 4 files changed, 214 insertions(+), 19 deletions(-) diff --git a/components/activity/RewardsPreview.vue b/components/activity/RewardsPreview.vue index d48160e..0b09dc9 100644 --- a/components/activity/RewardsPreview.vue +++ b/components/activity/RewardsPreview.vue @@ -9,7 +9,9 @@ - {{ group.level }}赏 + + {{ isMatchingGroup(group.level) ? group.level : `${group.level}赏` }} + 总概率 {{ group.totalPercent }}% @@ -58,6 +60,10 @@ const props = defineProps({ type: Boolean, default: false }, + playType: { + type: String, + default: 'normal' + }, emptyText: { type: String, default: '暂无奖品配置' @@ -66,9 +72,14 @@ const props = defineProps({ defineEmits(['view-all']) +// 判断是否为对对碰分组(包含"对子"字样) +const isMatchingGroup = (level) => { + return String(level || '').includes('对子') +} + const rewardGroups = computed(() => { if (!props.grouped) return [] - return groupRewardsByLevel(props.rewards) + return groupRewardsByLevel(props.rewards, props.playType) }) diff --git a/pages-activity/activity/duiduipeng/index.vue b/pages-activity/activity/duiduipeng/index.vue index f595ea9..9a18150 100644 --- a/pages-activity/activity/duiduipeng/index.vue +++ b/pages-activity/activity/duiduipeng/index.vue @@ -46,7 +46,8 @@ @@ -317,11 +318,18 @@ const currentIssueRewards = computed(() => { // 用于奖池预览的 rewards(已排序) const previewRewards = computed(() => { - const isMatchType = detail.value?.play_type === 'match' + const isMatchType = ['match', 'matching'].includes(detail.value?.play_type) if (isMatchType) { // 对对碰模式:按 min_score 升序 - return [...currentIssueRewards.value].sort((a, b) => (a.min_score - b.min_score)) + const sorted = [...currentIssueRewards.value].sort((a, b) => (a.min_score - b.min_score)) + console.log('[对对碰] previewRewards 排序后:', sorted.map(r => ({ + name: r.title, + min_score: r.min_score, + weight: r.weight, + percent: r.percent + }))) + return sorted } else { // 普通模式:返回原数组 return currentIssueRewards.value @@ -329,7 +337,7 @@ const previewRewards = computed(() => { }) const rewardGroups = computed(() => { - const isMatchType = detail.value?.play_type === 'match' + const isMatchType = ['match', 'matching'].includes(detail.value?.play_type) // 对对碰模式:不分组,直接按 min_score 平铺所有奖品 if (isMatchType) { @@ -337,11 +345,20 @@ const rewardGroups = computed(() => { const sortedRewards = [...currentIssueRewards.value].sort((a, b) => (a.min_score - b.min_score)) // 将每个奖品作为一个单独的分组 - return sortedRewards.map(item => ({ + const groups = sortedRewards.map(item => ({ level: `${item.min_score}对子`, rewards: [item], totalPercent: item.percent.toFixed(1) })) + + console.log('[对对碰] rewardGroups 分组后:', groups.map(g => ({ + level: g.level, + count: g.rewards.length, + totalPercent: g.totalPercent, + firstItem: g.rewards[0]?.title + }))) + + return groups } // 普通模式:按原来的分组逻辑 @@ -568,7 +585,7 @@ function normalizeRewards(list, playType = 'normal') { })) // 根据 play_type 决定排序方式 - if (playType === 'match') { + if (['match', 'matching'].includes(playType)) { // 对对碰:按 min_score 升序排列,不过滤 min_score=0 的奖品 enriched.sort((a, b) => (a.min_score - b.min_score)) } else { diff --git a/pages/shop/index.vue b/pages/shop/index.vue index 2beb8a2..2efce50 100644 --- a/pages/shop/index.vue +++ b/pages/shop/index.vue @@ -66,7 +66,15 @@ - + + + + + + + + {{ loadingText }} + @@ -138,7 +146,7 @@ - 加载更多... + {{ loadingText }} - 到底啦 - @@ -147,7 +155,7 @@