From d55be3dbcf93a5dd6a21c27b9ad7f3f10b1b49ff Mon Sep 17 00:00:00 2001 From: Zuncle <34310384@qq.com> Date: Mon, 23 Mar 2026 22:27:50 +0800 Subject: [PATCH] =?UTF-8?q?feat(fragment):=20=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E9=80=82=E9=85=8D=E7=A2=8E=E7=89=87=E5=A4=9A=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E4=BA=A7=E5=87=BA=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - normalizeRewards 传递 drop_quantity 字段 - 抽奖结果弹窗自动合并同类碎片显示 x{N} - 购买记录仅 count>1 时显示数量角标(当前不展示) - RewardsPreview/RewardsPopup 保留 drop_quantity 样式(当前不展示) --- components/activity/RecordsList.vue | 2 +- components/activity/RewardsPopup.vue | 10 ++++++++++ components/activity/RewardsPreview.vue | 14 ++++++++++++++ pages-activity/composables/useRecords.js | 2 +- utils/activity.js | 1 + 5 files changed, 27 insertions(+), 2 deletions(-) diff --git a/components/activity/RecordsList.vue b/components/activity/RecordsList.vue index f545c6b..4184dad 100755 --- a/components/activity/RecordsList.vue +++ b/components/activity/RecordsList.vue @@ -19,7 +19,7 @@ {{ item.title }} - x1 + x{{ item.count }} diff --git a/components/activity/RewardsPopup.vue b/components/activity/RewardsPopup.vue index 1578142..5f8fae0 100755 --- a/components/activity/RewardsPopup.vue +++ b/components/activity/RewardsPopup.vue @@ -205,6 +205,16 @@ defineEmits(['update:visible']) flex-shrink: 0; } +.rewards-qty-tag { + font-size: $font-xxs; + font-weight: 700; + color: #fff; + background: linear-gradient(135deg, #ff6b35, #ff4500); + padding: 2rpx 10rpx; + border-radius: $radius-sm; + flex-shrink: 0; +} + .rewards-percent { font-size: $font-sm; color: $text-sub; diff --git a/components/activity/RewardsPreview.vue b/components/activity/RewardsPreview.vue index 94a64f6..a22de9c 100755 --- a/components/activity/RewardsPreview.vue +++ b/components/activity/RewardsPreview.vue @@ -242,6 +242,20 @@ const rewardGroups = computed(() => { } } +.drop-qty-badge { + position: absolute; + top: 10rpx; + right: 10rpx; + background: linear-gradient(135deg, #ff6b35, #ff4500); + color: #fff; + font-size: 20rpx; + padding: 2rpx 10rpx; + border-radius: 16rpx; + z-index: 10; + font-weight: 700; + box-shadow: 0 2rpx 6rpx rgba(255, 69, 0, 0.3); +} + /* 空状态 */ .empty-state { display: flex; diff --git a/pages-activity/composables/useRecords.js b/pages-activity/composables/useRecords.js index 994b808..4cca886 100755 --- a/pages-activity/composables/useRecords.js +++ b/pages-activity/composables/useRecords.js @@ -31,7 +31,7 @@ export function useRecords() { id: it.id, title: it.reward_name || it.title || it.name || '-', // 奖品名称 image: it.reward_image || it.image || '', // 奖品图片 - count: 1, // 单个记录数量为1 + count: 1, // 用户信息 user_id: it.user_id, diff --git a/utils/activity.js b/utils/activity.js index 6db4904..b438800 100755 --- a/utils/activity.js +++ b/utils/activity.js @@ -110,6 +110,7 @@ export function normalizeRewards(list, cleanUrl = (u) => u) { weight: Number(i.weight) || 0, boss: detectBoss(i), min_score: i.min_score || 0, + drop_quantity: Number(i.drop_quantity) || 1, level: levelToAlpha(i.prize_level ?? i.level ?? (detectBoss(i) ? 'BOSS' : '赏')) })) const total = items.reduce((acc, it) => acc + (it.weight > 0 ? it.weight : 0), 0)