From 912ec5f693292dcab73e4814c689bc0bf38ae108 Mon Sep 17 00:00:00 2001 From: davy Date: Wed, 9 Apr 2025 14:04:46 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E9=87=8D=E6=9E=84=E6=89=AB?= =?UTF-8?q?=E7=A0=81=E7=BB=93=E6=9E=9C=E9=A1=B5=E9=9D=A2=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pagesActivity/myActivityDetail.vue | 58 +- pagesActivity/scanResult.vue | 1041 +++++++++++++++++----------- static/information.svg | 1 + static/tick-circle@2x.png | Bin 4080 -> 0 bytes 4 files changed, 698 insertions(+), 402 deletions(-) create mode 100644 static/information.svg delete mode 100644 static/tick-circle@2x.png diff --git a/pagesActivity/myActivityDetail.vue b/pagesActivity/myActivityDetail.vue index 577884a..8b830d3 100644 --- a/pagesActivity/myActivityDetail.vue +++ b/pagesActivity/myActivityDetail.vue @@ -5,8 +5,15 @@ 累计进度 + + + 累计目标已完成,请耐心等待品牌方兑付奖励 + 品牌方已发起兑付奖励,快递单号:{{activity.expressNo || '暂无'}},请注意查收 + 累计活动已结束,兑付时间:{{activity.claimTime || '-'}} + + - + 剩余累计目标 {{activity.remainingBeerCount || 0}} @@ -15,7 +22,7 @@ - + {{remainingDays}} @@ -154,22 +161,29 @@ 活动状态 - {{!reward ? '累计中' : (reward.rewardStatus == 0 ? '待确认' : '已确认')}} + {{activity.activityStatus == 0 ? '未参与' : + activity.activityStatus == 1 ? '累计中' : + activity.activityStatus == 2 ? '待兑付' : + activity.activityStatus == 3 ? '待确认' : '已完成'}} - - {{!reward ? '扫码累计' : (reward.rewardStatus == 0 ? '确认兑付完成' : '兑付已确认')}} + @click="activity.activityStatus == 1 ? toScan() : + activity.activityStatus == 3 ? confirmPay() : null"> + + {{activity.activityStatus == 0 ? '未参与' : + activity.activityStatus == 1 ? '扫码累计' : + activity.activityStatus == 2 ? '累计目标已完成' : + activity.activityStatus == 3 ? '确认兑付完成' : '已完成'}} @@ -299,18 +313,17 @@ content: '确认兑付完成?', success: (res) => { if (res.confirm) { - confirmPayApi(this.reward.id).then(res => { uni.showToast({ title: '确认成功', icon: 'success', }) - this.init() + // 更新活动状态为4(已完成) + this.activity.activityStatus = 4 }) } }, }) - }, toScan() { uni.switchTab({ @@ -392,6 +405,21 @@ padding: 32rpx; } + .status-tip { + text-align: center; + margin-bottom: 32rpx; + padding: 24rpx; + background: rgba(25, 54, 122, 0.05); + border-radius: 12rpx; + + .tip-text { + font-size: 28rpx; + color: #19367A; + line-height: 1.5; + display: block; + } + } + .target-display { text-align: center; margin-bottom: 32rpx; diff --git a/pagesActivity/scanResult.vue b/pagesActivity/scanResult.vue index 0e23a5a..2636265 100644 --- a/pagesActivity/scanResult.vue +++ b/pagesActivity/scanResult.vue @@ -5,36 +5,37 @@ - - - - - - - - {{ beer.beerName }} - {{ beer.brandName }} - - - 生产日期: - {{ beer.createTime ? beer.createTime.split(' ')[0] : '' }} - - - 净含量: - {{ beer.netContent }} + + + + + 识别产品 + + + + + + + + + + {{ beer.beerName }} + {{ beer.brandName }} + + {{ beer.beerOverallRating || '4.9' }} + {{ beer.beerReviewsCount || '20' }} reviews @@ -53,181 +54,433 @@ @@ -284,10 +537,13 @@ longitude: this.longitude }).then(res => { console.log(res.data) + this.showError = false // 重置错误状态 + this.errorType = null // 重置错误类型 this.info = res.data this.beer = res.data.beer this.activity = res.data.activity || [] this.platformActivity = res.data.platformActivity || [] + this.activitySum = 0 // 重置活动数量 if (this.activity && this.activity.length > 0) { this.activitySum += this.activity.length this.activityId = this.activity[0].id @@ -298,12 +554,13 @@ } }).catch(err => { console.error('获取二维码信息失败:', err) + this.showError = true if (err.code === 500 && err.msg === '请在酒吧附近100米范围内扫码') { - this.showError = true this.errorType = 'location' } else if (err.code === 500 && err.msg.includes('已失效')) { this.errorType = 'expired' } else { + this.errorType = 'expired' uni.showToast({ title: err.msg || '获取信息失败', icon: 'none' @@ -403,128 +660,147 @@ padding: 0rpx 26rpx 60rpx; .error-page { + padding: 120rpx 32rpx; display: flex; flex-direction: column; align-items: center; - padding-top: 120rpx; - + .status-icon { width: 160rpx; height: 160rpx; - margin-bottom: 40rpx; + margin-bottom: 32rpx; } - + .status-title { font-size: 36rpx; - color: #3D3D3D; + color: #333333; font-weight: 600; margin-bottom: 16rpx; + text-align: center; } - + .status-desc { font-size: 28rpx; - color: #5F5F63; - font-weight: 400; - margin-bottom: 12rpx; + color: #666666; + margin-bottom: 8rpx; text-align: center; + } + } + + .product-section { + margin-top: 48rpx; + padding: 0 32rpx; + + .section-header { + display: flex; + align-items: center; + gap: 12rpx; + margin-bottom: 24rpx; - &:last-of-type { - margin-bottom: 60rpx; + .section-icon { + width: 40rpx; + height: 40rpx; + } + + text { + font-size: 32rpx; + color: #333333; + font-weight: 500; } } - - .product-card { - width: 100%; - background: #FFFFFF; - border-radius: 24rpx; - box-shadow: 0px 8rpx 24rpx rgba(0, 0, 0, 0.08); - padding: 36rpx; - margin-bottom: 40rpx; + } + + .product-card { + background: #FFFFFF; + border-radius: 16rpx; + padding: 24rpx; + box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04); + margin-bottom: 32rpx; + + .product-content { + display: flex; + gap: 24rpx; - .product-content { - display: flex; + .product-image { + width: 160rpx; + height: 240rpx; + border-radius: 12rpx; + overflow: hidden; + flex-shrink: 0; - .product-image { - margin-right: 28rpx; - - .cover { - width: 200rpx; - height: 300rpx; - border-radius: 16rpx; - box-shadow: 0px 8rpx 16rpx rgba(0, 0, 0, 0.12); - } + .cover { + width: 100%; + height: 100%; + object-fit: cover; + } + } + + .product-info { + flex: 1; + display: flex; + flex-direction: column; + justify-content: space-between; + + .product-name { + font-size: 32rpx; + color: #333333; + font-weight: 600; + margin-bottom: 12rpx; } - .product-info { - flex: 1; + .product-brand { + font-size: 28rpx; + color: #666666; + margin-bottom: 16rpx; + } + + .product-details { + margin-bottom: 16rpx; - .product-name { - font-size: 40rpx; - color: #141415; - font-weight: 600; - margin-bottom: 16rpx; - } - - .product-brand { - font-size: 30rpx; - color: #5F5F63; - font-weight: 500; - margin-bottom: 16rpx; - } - - .product-details { - margin-bottom: 28rpx; + .detail-item { + display: flex; + align-items: center; + margin-bottom: 8rpx; - .detail-item { - display: flex; - margin-bottom: 12rpx; - font-size: 28rpx; - - .detail-label { - color: #3D3D3D; - margin-right: 8rpx; - font-weight: 500; - } - - .detail-value { - color: #5F5F63; - font-weight: 400; - } + .detail-label { + font-size: 26rpx; + color: #999999; + margin-right: 8rpx; + } + + .detail-value { + font-size: 26rpx; + color: #333333; } } } - } - } - - .error-action { - width: 100%; - padding: 0 40rpx; - margin-top: 40rpx; - - .action-btn { - display: flex; - align-items: center; - justify-content: center; - width: 100%; - height: 96rpx; - background: #D42E78; - border-radius: 12rpx; - font-size: 28rpx; - color: #FFFFFF; - font-weight: 500; - box-shadow: 0px 4rpx 12rpx rgba(0, 0, 0, 0.1); - - .btn-icon { - width: 40rpx; - height: 40rpx; - margin-right: 12rpx; - filter: brightness(0) invert(1); + + .product-rating { + display: flex; + align-items: center; + gap: 12rpx; + + .rating-stars { + display: flex; + align-items: center; + gap: 8rpx; + + .rating-value { + font-size: 26rpx; + color: #333333; + font-weight: 500; + } + } + + .rating-count { + font-size: 24rpx; + color: #999999; + } } } } } - /* 状态提示样式 */ .lq-state-box { display: flex; flex-direction: column; @@ -587,96 +863,6 @@ } } - /* 产品卡片样式 */ - .product-card { - background: #FFFFFF; - border-radius: 24rpx; - box-shadow: 0px 8rpx 24rpx rgba(0, 0, 0, 0.08); - padding: 36rpx; - margin-bottom: 40rpx; - - .product-content { - display: flex; - - .product-image { - margin-right: 28rpx; - - .cover { - width: 200rpx; - height: 300rpx; - border-radius: 16rpx; - box-shadow: 0px 8rpx 16rpx rgba(0, 0, 0, 0.12); - } - } - - .product-info { - flex: 1; - - .product-name { - font-size: 40rpx; - color: #141415; - font-weight: 600; - margin-bottom: 16rpx; - } - - .product-brand { - font-size: 30rpx; - color: #5F5F63; - font-weight: 600; - margin-bottom: 16rpx; - } - - .product-details { - margin-bottom: 28rpx; - - .detail-item { - display: flex; - margin-bottom: 12rpx; - font-size: 28rpx; - - .detail-label { - color: #3D3D3D; - margin-right: 8rpx; - font-weight: 500; - } - - .detail-value { - color: #5F5F63; - font-weight: 400; - } - } - } - - .product-rating { - display: flex; - align-items: center; - - .rating-stars { - display: flex; - align-items: center; - background: #F5F5F5; - padding: 8rpx 16rpx; - border-radius: 16rpx; - margin-right: 16rpx; - - .rating-value { - font-size: 28rpx; - color: #5F5F63; - font-weight: 400; - margin-left: 8rpx; - } - } - - .rating-count { - font-size: 28rpx; - color: #5F5F63; - font-weight: 400; - } - } - } - } - } - /* 福利卡片样式 */ .benefit-card { background: #FFFFFF; @@ -766,34 +952,62 @@ margin-right: 28rpx; box-shadow: 0px 4rpx 12rpx rgba(0, 0, 0, 0.05); - .brand-logo { + .brand-logo-container { width: 140rpx; height: 140rpx; border-radius: 16rpx; margin-bottom: 20rpx; + overflow: hidden; + + .brand-logo { + width: 100%; + height: 100%; + object-fit: cover; + } + } + + .brand-logo-placeholder { + width: 140rpx; + height: 140rpx; + border-radius: 16rpx; + margin-bottom: 20rpx; + background: #EEEEEE; + display: flex; + align-items: center; + justify-content: center; + border: 2rpx dashed #CCCCCC; + + .placeholder-text { + font-size: 24rpx; + color: #999999; + } } .progress-info { + display: flex; + flex-direction: column; + align-items: center; text-align: center; .progress-label { + margin-top: 12rpx; font-size: 24rpx; color: #9E9E9E; font-weight: 400; - margin-bottom: 8rpx; + margin-bottom: 32rpx; } .progress-value { .completed { font-size: 32rpx; color: #DE3C4B; - font-weight: 500; + font-weight: 600; } .remaining { font-size: 40rpx; color: #DE3C4B; - font-weight: 500; + font-weight: 600; } } } @@ -802,22 +1016,54 @@ .activity-right { flex: 1; - .activity-name { - font-size: 32rpx; - font-weight: 600; - color: #0B0E26; + .activity-header { + display: flex; + align-items: center; + justify-content: space-between; margin-bottom: 20rpx; + + .activity-name { + font-size: 32rpx; + font-weight: 600; + color: #0B0E26; + } + + .activity-tag { + font-size: 24rpx; + color: #FFFFFF; + background: #DE3C4B; + padding: 4rpx 12rpx; + border-radius: 8rpx; + } } - .activity-detail { - font-size: 26rpx; - color: #0B0E26; - font-weight: 400; - margin-bottom: 16rpx; + .activity-details { + margin-bottom: 20rpx; - .highlight { - color: #DE3C4B; - font-weight: 500; + .detail-row { + display: flex; + align-items: center; + margin-bottom: 12rpx; + + .detail-label { + font-size: 26rpx; + color: #999999; + margin-right: 8rpx; + flex-shrink: 0; + } + + .detail-value { + font-size: 26rpx; + color: #333333; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + + .highlight { + color: #DE3C4B; + font-weight: 500; + } + } } } @@ -839,6 +1085,22 @@ } } + .beer-scroll-placeholder { + width: 100%; + height: 144rpx; + background: #F5F5F5; + border-radius: 8rpx; + display: flex; + align-items: center; + justify-content: center; + margin-bottom: 20rpx; + + .placeholder-text { + font-size: 24rpx; + color: #999999; + } + } + .reward-info { display: flex; align-items: center; @@ -859,6 +1121,11 @@ font-weight: 400; } } + + .error-text { + color: #DE3C4B; + font-style: italic; + } } } } diff --git a/static/information.svg b/static/information.svg new file mode 100644 index 0000000..1c3a03a --- /dev/null +++ b/static/information.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/tick-circle@2x.png b/static/tick-circle@2x.png deleted file mode 100644 index aefe27753b12c3fa2a72edaf61e08cf701983da3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4080 zcmV005u}1^@s6i_d2*00001b5ch_0Itp) z=>Px#1am@3R0s$N2z&@+hyVZ&nn^@KRCt{2olSDvxDvykH;#Fm^i%WdxpsXkiS0V{jHC zPj+3HJ1Ia;r(*+-1HvB+#3-#=OU#LoUE*79gjS7y-Ry=2_d%V#%Bte+5{6*jCH9bpqt{ATn6ai0Ey% zEuEUA6ywDX83`C2^cRLCm z+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