diff --git a/pagesActivity/scanResult.vue b/pagesActivity/scanResult.vue index d5f8c15..8d9585f 100644 --- a/pagesActivity/scanResult.vue +++ b/pagesActivity/scanResult.vue @@ -58,6 +58,17 @@ + + 领取信息 + + {{ beer.scanCoinCount }}枚({{beer.brandName}})品牌啤酒币已到账 + 品牌啤酒币可用于兑换好礼 + + + 距离目标达成还剩 {{ selectedActivity.remainingBeerCount }} 桶 + + + 商品详细 @@ -85,14 +96,6 @@ - - - 品牌福利 - - {{ beer.scanCoinCount}}枚({{beer.brandName}})品牌啤酒币已到账 - 品牌啤酒币可用于兑换好礼 - - @@ -158,6 +161,11 @@ + + + @@ -404,6 +452,7 @@ longitude: null, errorType: null, // 错误类型: location-位置错误, expired-已失效 isJustReceived: false, // 是否刚刚领取成功 + selectedActivity: null, // 选中的活动 }; }, onLoad({ @@ -496,7 +545,7 @@ consumeCode(data).then(res => { console.log('领取响应:', res) // 验证响应数据 - if (res.code === 200 && res.data) { + if (res.code === 200) { uni.hideLoading() uni.showToast({ title: '领取成功', @@ -509,7 +558,7 @@ this.getQrcodeInfoFun(this.result) }, 1000) } else { - throw new Error('领取失败:响应数据异常') + throw new Error(res.msg || '领取失败') } }).catch(err => { console.error('领取失败:', err) @@ -553,6 +602,7 @@ // 选择品牌方活动 selectPPF(item) { this.activityId = item.id + this.selectedActivity = item }, // 选择平台活动 selectPlatform(item) { @@ -588,6 +638,15 @@ formatTime(timestamp) { const date = new Date(timestamp); return date.toLocaleString(); + }, + // 计算剩余天数 + getRemainingDays(endDate) { + if(!endDate) return 0; + const targetDate = new Date(endDate); + const currentDate = new Date(); + const timeDiff = targetDate.getTime() - currentDate.getTime(); + const remainingDays = Math.ceil(timeDiff / (1000 * 3600 * 24)); + return Math.max(remainingDays, 0); // 确保不会显示负数天数 } } } @@ -614,6 +673,14 @@ justify-content: center; gap: 20rpx; } + + &--error { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + gap: 16rpx; + } } &__icon { @@ -640,6 +707,7 @@ flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; + padding-bottom: 40rpx; } &__section { @@ -676,14 +744,14 @@ display: flex; justify-content: space-between; gap: 24rpx; - padding: 24rpx 32rpx env(safe-area-inset-bottom); + padding: 24rpx 32rpx calc(24rpx + env(safe-area-inset-bottom)); background: #fff; position: fixed; left: 0; right: 0; bottom: 0; box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.1); - z-index: 99; + z-index: 100; } &__btn { @@ -718,6 +786,38 @@ opacity: 0.9; } } + + &__icon-container { + display: flex; + flex-direction: column; + align-items: center; + margin-bottom: 16rpx; + } + + &__icon { + width: 120rpx; + height: 120rpx; + margin-bottom: 16rpx; + + &--info { + width: 80rpx; + height: 80rpx; + margin-bottom: 8rpx; + } + } + + .activity-info { + margin-top: 24rpx; + padding: 24rpx; + background: #F7F8FA; + border-radius: 16rpx; + + &__progress { + font-size: 28rpx; + color: #19367A; + font-weight: 500; + } + } } .product-card { @@ -801,14 +901,15 @@ .benefit-card { background: #FFF; - padding: 24rpx; + padding: 0 24rpx; border-radius: 16rpx; &__title { font-size: 32rpx; font-weight: 600; color: #3D3D3D; - margin-bottom: 12rpx; + margin-top: 8rpx; + // margin-bottom: 24rpx; display: block; } @@ -887,17 +988,9 @@ border-radius: 8rpx; box-shadow: 0 2rpx 6rpx rgba(0, 0, 0, 0.3); - &--store { + &--time { background-color: #D42E78; } - - &--new { - background-color: #19367A; - } - - &--limited { - background-color: #FF6B35; - } } &__content {