diff --git a/pages/activity/wuxianshang/index.vue b/pages/activity/wuxianshang/index.vue index 4eb8102..e422b76 100644 --- a/pages/activity/wuxianshang/index.vue +++ b/pages/activity/wuxianshang/index.vue @@ -51,46 +51,25 @@ - - - - - - - {{ currentIssueTitle }} - {{ statusText || '进行中' }} - - - - - - - - 聚宝盆 - 随机掉落 10% - 随机免单 10% - - - - - - - @@ -206,7 +185,7 @@ function showRules() { } function goCabinet() { - uni.navigateTo({ url: '/pages/cabinet/index' }) + uni.switchTab({ url: '/pages/cabinet/index' }) } async function fetchDetail(id) { @@ -1037,6 +1016,7 @@ function closeFlip() { showFlip.value = false } } .tier-btn { flex: 1; + min-width: 0; display: flex; flex-direction: column; align-items: center; @@ -1067,28 +1047,50 @@ function closeFlip() { showFlip.value = false } } .tier-hot { - background: $gradient-brand; + background: $gradient-red; border: none; - box-shadow: $shadow-warm; + box-shadow: 0 6rpx 14rpx rgba($accent-red, 0.12); position: relative; overflow: hidden; + border-radius: $radius-lg; + transform: translateZ(0); .tier-price, .tier-label { - color: #fff; + color: #fff !important; + position: relative; + z-index: 2; } + &::before { + content: ''; + position: absolute; + left: -40%; + top: 0; + width: 60%; + height: 100%; + background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.22) 50%, rgba(255,255,255,0) 100%); + transform: skewX(-18deg); + opacity: 0.9; + z-index: 1; + pointer-events: none; + animation: hotShine 2.6s ease-in-out infinite; + } + &::after { content: 'HOT'; position: absolute; - top: 0; - right: 0; - background: linear-gradient(135deg, $accent-red, #D32F2F); + top: 8rpx; + right: 8rpx; + background: linear-gradient(135deg, rgba(255,255,255,0.25), rgba(255,255,255,0.05)); color: #fff; - font-size: 18rpx; + font-size: 20rpx; font-weight: 800; - padding: 4rpx 10rpx; - border-bottom-left-radius: $radius-md; - box-shadow: -2rpx 2rpx 4rpx rgba(0,0,0,0.1); + padding: 3rpx 10rpx; + border-radius: 999rpx; + border: 1rpx solid rgba(255,255,255,0.35); + text-shadow: 0 1rpx 2rpx rgba(0,0,0,0.18); + z-index: 3; + pointer-events: none; } &:active { @@ -1100,6 +1102,13 @@ function closeFlip() { showFlip.value = false } color: #FFFFFF; } +@keyframes hotShine { + 0% { transform: translateX(-10%) skewX(-18deg); opacity: 0; } + 15% { opacity: 0.9; } + 55% { transform: translateX(220%) skewX(-18deg); opacity: 0.35; } + 100% { transform: translateX(220%) skewX(-18deg); opacity: 0; } +} + .rewards-overlay { position: fixed; left: 0; right: 0; top: 0; bottom: 0; z-index: 9000; } .rewards-mask { position: absolute; left: 0; right: 0; top: 0; bottom: 0; diff --git a/pages/cabinet/index.vue b/pages/cabinet/index.vue index a61a966..cca4c4e 100644 --- a/pages/cabinet/index.vue +++ b/pages/cabinet/index.vue @@ -50,7 +50,10 @@ - 已选 {{ totalSelectedCount }} 件 + + 已选 {{ totalSelectedCount }} 件 + 预计兑换 {{ totalRedeemPoints }} 积分 + @@ -154,6 +157,10 @@ const totalSelectedCount = computed(() => { return aggregatedList.value.reduce((sum, item) => sum + (item.selected ? item.selectedCount : 0), 0) }) +const totalRedeemPoints = computed(() => { + return aggregatedList.value.reduce((sum, item) => sum + (item.selected ? (Number(item.points) || 0) * (item.selectedCount || 0) : 0), 0) +}) + const isAllSelected = computed(() => { return aggregatedList.value.length > 0 && aggregatedList.value.every(item => item.selected) }) @@ -552,15 +559,24 @@ async function fetchProductPrices() { const list = currentList.value for (let i = 0; i < list.length; i++) { const item = list[i] - if (item.id && !item.price) { + if (item.id && (!item.price || item.points === undefined || item.points === null)) { try { const res = await getProductDetail(item.id) + const p = res && (res.data ?? res.result ?? res) if (res && (res.price !== undefined || res.data?.price !== undefined)) { // 优先取 res.price,其次 res.data.price (兼容不同返回结构) const raw = res.price !== undefined ? res.price : res.data?.price const num = Number(raw) item.price = isNaN(num) ? null : (num / 100) } + if (p) { + const cands = [ + p.redeem_points, p.recycle_points, p.exchange_points, + p.points_redeem, p.points_value, p.points, p.points_required + ] + const val = cands.find(v => Number.isFinite(Number(v)) && Number(v) >= 0) + item.points = val !== undefined ? Number(val) : (item.points ?? 0) + } } catch (e) { console.error('Fetch price failed for:', item.id, e) } @@ -619,7 +635,7 @@ async function onRedeem() { uni.showModal({ title: '确认兑换', - content: `确定要兑换选中的 ${allIds.length} 件物品吗?此操作不可撤销。`, + content: `确定要兑换选中的 ${allIds.length} 件物品,预计获得 ${totalRedeemPoints.value} 积分吗?此操作不可撤销。`, success: async (res) => { if (res.confirm) { uni.showLoading({ title: '处理中...' }) @@ -957,6 +973,14 @@ async function onShip() { font-size: 28rpx; color: $text-main; font-weight: 600; + display: flex; + flex-direction: column; + gap: 6rpx; +} +.selected-points { + font-size: 22rpx; + color: $brand-primary; + font-weight: 700; } .btn-group { display: flex;