diff --git a/pagesActivity/scanResult.vue b/pagesActivity/scanResult.vue
index 2636265..d5f8c15 100644
--- a/pagesActivity/scanResult.vue
+++ b/pagesActivity/scanResult.vue
@@ -1,486 +1,374 @@
-
-
-
-
-
-
-
- 您现在未在您门店定位的范围
- 请在门店范围100米内重新扫码
-
-
-
-
-
- {{ info.qrcode.statusDesc || '二维码已失效' }}
- {{ info.qrcode.statusMessage || '该二维码已超出可用范围' }}
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
- {{ beer.beerName }}
- {{ beer.brandName }}
-
- {{ beer.beerOverallRating || '4.9' }}
- {{ beer.beerReviewsCount || '20' }} reviews
+
+
+ 商品详细
+
+
+
+
+
+ {{ beer.beerName }}
+ {{ beer.brandName }}
+
+ 生产日期:
+ {{ beer.launchDate }}
+
+
+ 净含量:
+ {{ beer.netContent }}
+
+
+
+
+ {{ beer.beerOverallRating }}
+ {{ beer.beerReviewsCount }} 条评论
-
-
-
-
-
- 返回
-
-
+
+
+
-
-
-
-
-
-
-
-
- 扫码成功!
-
-
-
-
-
- 商品详细
-
-
-
-
-
-
- {{ beer.beerName }}
- {{ beer.brandName }}
-
-
- 生产日期:
- {{ beer.launchDate }}
-
-
- 净含量:
- {{ beer.netContent }}
-
-
-
-
-
- {{ beer.beerOverallRating }}
-
- {{beer.beerReviewsCount}} 条评论
-
-
-
-
-
-
-
-
- 品牌福利
-
-
- {{ beer.scanCoinCount}}枚 {{beer.brandName}} 啤酒币待领取
- 品牌啤酒币可用于兑换好礼
-
-
-
-
-
- !
- 该产品有多个进行中活动重叠,请选择要计入的活动
-
-
-
-
-
-
-
-
-
-
-
-
- 品牌图标
-
-
- 距离达成差
-
- 已达标
- {{ it.remainingBeerCount}}桶
-
-
-
-
-
-
-
- 活动时间:
- 首次扫码开始计时 {{it.duration}}天内
-
-
- 活动目标:
- {{ it.beer_scope === 0 ? '全系列酒款' : '指定酒款' }}累计扫码≥{{ it.activityTarget}}桶
-
-
-
-
-
-
-
-
- 暂无酒款信息
-
-
- 赠
-
- {{it.activityRewardGoods.goodsName}} * {{it.activityRewardCount}}
-
-
- 啤酒币 * {{it.activityRewardCount}}个
-
- 奖励内容获取失败
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
- 品牌图标
-
-
- 距离达成还剩
-
- 已达标
- {{ it.remainingBeerCount}}桶
-
-
-
-
-
-
-
- 活动时间:
- 首次扫码开始计时 {{it.duration}}天内
-
-
- 活动目标:
- {{ it.beer_scope === 0 ? '全系列酒款' : '以下酒款' }}累计扫码 ≥ {{ it.activityTarget}}桶
-
-
-
-
-
-
-
-
- 暂无酒款信息
-
-
- 奖励
-
- {{it.activityRewardGoods.goodsName}} * {{it.activityRewardCount}}
-
-
- 啤酒币 * {{it.activityRewardCount}}个
-
- 奖励内容获取失败
-
-
+
+
+ 商品详细
+
+
+
+
+
+ {{ beer.beerName }}
+ {{ beer.brandName }}
+
+ 生产日期:
+ {{ beer.launchDate }}
+
+
+ 净含量:
+ {{ beer.netContent }}
+
+
+
+
+ {{ beer.beerOverallRating }}
+
+ {{ beer.beerReviewsCount }} 条评论
-
-
-
-
-
-
-
-
-
-
-
-
-
- 该桶产品已于 {{ info.qrcode.verifyTime }} 扫码领取返利
-
-
-
-
-
- 领取成功!
-
-
-
-
-
- 商品详细
-
-
-
-
-
-
- {{ beer.beerName }}
- {{ beer.brandName }}
-
-
- 生产日期:
- {{ beer.launchDate }}
-
-
- 净含量:
- {{ beer.netContent }}
-
-
-
-
-
- {{ beer.beerOverallRating }}
-
- {{beer.beerReviewsCount}} 条评论
-
-
-
-
-
-
+
+ 品牌福利
-
- 品牌福利已领取
-
-
- {{ beer.scanCoinCount}}枚({{beer.brandName}})品牌啤酒币已到账
- 品牌啤酒币可用于兑换好礼
-
+ {{ beer.scanCoinCount}}枚({{beer.brandName}})品牌啤酒币已到账
+ 品牌啤酒币可用于兑换好礼
-
-
-
-
-
-
-
-
-
- 距离达成还剩
-
- 已达标
- {{ it.remainingBeerCount}}桶
-
-
-
-
-
-
-
- 活动时间:
- 首次扫码开始计时 {{it.duration}}天内
-
-
- 活动目标:
- {{ it.beer_scope === 0 ? '全系列酒款' : '以下酒款' }}累计扫码 ≥ {{ it.activityTarget}}桶
-
-
-
-
-
-
-
-
- 奖励
-
- {{it.activityRewardGoods.goodsName}} * {{it.activityRewardCount}}
-
-
- 啤酒币 * {{it.activityRewardCount}}个
-
-
-
-
-
+
+
-
-
-
-
-
-
- 距离达成还剩
-
- 已达标
- {{ it.remainingBeerCount}}桶
-
-
-
-
-
-
-
- 活动时间:
- 首次扫码开始计时 {{it.duration}}天内
-
-
- 活动目标:
- {{ it.beer_scope === 0 ? '全系列酒款' : '以下酒款' }}累计扫码 ≥ {{ it.activityTarget}}桶
-
-
-
-
-
-
-
-
- 奖励
-
- {{it.activityRewardGoods.goodsName}} * {{it.activityRewardCount}}
-
-
- 啤酒币 * {{it.activityRewardCount}}个
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
- 该桶产品已转为赠品
-
-
-
-
-
- 商品详细
+
+
+
+
+
+
+ 商品详细
+
+
+
-
-
-
-
-
- {{ beer.beerName }}
- {{ beer.brandName }}
-
-
- 生产日期:
- {{ beer.launchDate }}
-
-
- 净含量:
- {{ beer.netContent }}
-
+
+ {{ beer.beerName }}
+ {{ beer.brandName }}
+
+ 生产日期:
+ {{ beer.launchDate }}
+
+
+ 净含量:
+ {{ beer.netContent }}
+
+
+
+
+ {{ beer.beerOverallRating }}
-
-
-
- {{ beer.beerOverallRating }}
+ {{ beer.beerReviewsCount }} 条评论
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 商品详细
+
+
+
+
+
+ {{ beer.beerName }}
+ {{ beer.brandName }}
+
+ 生产日期:
+ {{ beer.launchDate }}
+
+
+ 净含量:
+ {{ beer.netContent }}
+
+
+
+
+ {{ beer.beerOverallRating }}
+
+ {{ beer.beerReviewsCount }} 条评论
+
+
+
+
+
+
+ 品牌福利
+
+ 可获得 {{ beer.scanCoinCount }}枚{{beer.brandName}}品牌啤酒币
+ 品牌啤酒币可用于兑换好礼
+
+
+
+
+
+ 该产品有多个进行中活动重叠,请选择要计入的活动
+
+
+
+ 品牌活动
+
+
+
+
+ 指定门店
+ 招募活动
+
+
+
+ 距离累计目标达成还剩
+ {{item.remainingBeerCount}}桶
+
+
+ 时间:首次扫码开始累计
+ {{item.duration}}天内
+
+
+ 活动截止还剩
+ {{item.remainingDays}}天
+
+
+ 目标:{{item.beerScope === 0 ? '品牌全系' : '以下'}}酒款累积扫码 ≥
+ {{ item.activityTarget}}桶
+
+
+
+
+
+
+
+ 赠
+
+
+
+ {{item.activityRewardGoods.goodsName}}
+ 规格:{{item.activityRewardGoods.specs}}
+ 数量:{{item.activityRewardCount}}份
+
+
+
+
+
+ 品牌啤酒币
+ 数量:{{item.activityRewardCount}}枚
+
- {{beer.beerReviewsCount}} 条评论
-
-
-
+
+
+
+
+
+
+
+
@@ -515,6 +403,7 @@
latitude: null,
longitude: null,
errorType: null, // 错误类型: location-位置错误, expired-已失效
+ isJustReceived: false, // 是否刚刚领取成功
};
},
onLoad({
@@ -525,6 +414,7 @@
this.result = result
this.latitude = latitude
this.longitude = longitude
+ this.isJustReceived = false // 重置领取状态
// 查询二维码信息
this.getQrcodeInfoFun(result)
},
@@ -568,6 +458,21 @@
}
})
},
+ // 显示确认弹窗
+ showConfirmPopup() {
+ this.$refs.confirmPopup.open();
+ },
+
+ // 关闭弹窗
+ closePopup() {
+ this.$refs.confirmPopup.close();
+ },
+
+ // 确认领取
+ confirmReceive() {
+ this.handleReceive();
+ this.closePopup();
+ },
// 立即领取
handleReceive() {
const data = {
@@ -581,21 +486,55 @@
if (this.platformActivityId) {
data.platformActivityId = this.platformActivityId
}
+
+ // 显示加载提示
+ uni.showLoading({
+ title: '领取中...',
+ mask: true
+ })
+
consumeCode(data).then(res => {
- console.log(res)
- uni.showToast({
- title: '领取成功',
- icon: 'success'
- })
- this.getQrcodeInfoFun(this.result)
+ console.log('领取响应:', res)
+ // 验证响应数据
+ if (res.code === 200 && res.data) {
+ uni.hideLoading()
+ uni.showToast({
+ title: '领取成功',
+ icon: 'success'
+ })
+ // 设置刚刚领取成功状态
+ this.isJustReceived = true
+ // 延迟刷新数据,确保后端数据已更新
+ setTimeout(() => {
+ this.getQrcodeInfoFun(this.result)
+ }, 1000)
+ } else {
+ throw new Error('领取失败:响应数据异常')
+ }
}).catch(err => {
console.error('领取失败:', err)
+ uni.hideLoading()
+
if (err.code === 500 && err.msg === '请在酒吧附近100米范围内扫码') {
this.showError = true
+ this.errorType = 'location'
+ } else if (err.code === 500 && err.msg.includes('reward_sn')) {
+ uni.showToast({
+ title: '系统维护中,请稍后再试',
+ icon: 'none',
+ duration: 2000
+ })
+ } else if (err.code === 500 && err.msg.includes('已领取')) {
+ uni.showToast({
+ title: '该酒品已领取过,请勿重复领取',
+ icon: 'none',
+ duration: 2000
+ })
} else {
uni.showToast({
- title: err.msg || '领取失败',
- icon: 'none'
+ title: err.msg || '领取失败,请重试',
+ icon: 'none',
+ duration: 2000
})
}
})
@@ -645,585 +584,446 @@
// #endif
}
})
+ },
+ formatTime(timestamp) {
+ const date = new Date(timestamp);
+ return date.toLocaleString();
}
}
}
\ No newline at end of file