Commit d41cede1 by 谢中龙

修改商品详情和广告

parent b3decc88
......@@ -153,8 +153,7 @@ Component({
else{
//先设置进去
dialogInfo[key] = true;
wx.setStorageSync('dialogInfo',dialogInfo);
//获取今天的当前也的key
let expiredAllKey = [];
for(let k in dialogInfo){
......@@ -167,6 +166,8 @@ Component({
expiredAllKey.forEach(item => {
delete dialogInfo[item];
});
wx.setStorageSync('dialogInfo',dialogInfo);
}
},
//获取今天是否已经弹出了
......
......@@ -164,6 +164,7 @@ wxService.page({
//确定领取优惠券
onTapSureGetCoupon(e){
const { memberId } = wx.getStorageSync('_baseUserInfo');
let item = e.currentTarget.dataset.item;
if(!memberId){
wx.showToast({
title: '请先登录',
......@@ -172,11 +173,19 @@ wxService.page({
return ;
}
if(this.todayHasGot(item.id)){
wx.showToast({
title: '您今天已经领取过了,请明天再来领取吧',
icon : 'none'
});
return ;
}
wx.showLoading({
title: '领取中..',
});
let item = e.currentTarget.dataset.item;
wxService.post(`/coupon/coupon/draw`,{
couponSettingId : item.id,
memberId : memberId,
......@@ -187,7 +196,7 @@ wxService.page({
title: '领取成功',
});
// this.setLocalStorageByKey(couponSettingId);
this.setLocalStorageByKey(item.id);
}
})
},
......@@ -204,8 +213,7 @@ wxService.page({
else{
//先设置进去
getCouponData[key] = true;
wx.setStorageSync('getCouponData',getCouponData);
//获取今天的当前也的key
let expiredAllKey = [];
for(let k in getCouponData){
......@@ -218,6 +226,8 @@ wxService.page({
expiredAllKey.forEach(item => {
delete getCouponData[item];
});
wx.setStorageSync('getCouponData',getCouponData);
}
},
......@@ -225,11 +235,11 @@ wxService.page({
todayHasGot(couponSettingId){
let getCouponData = wx.getStorageSync('getCouponData');
let key = `${couponSettingId}_d_${this.getCurrentYearMonDay()}`;
if(!dialogInfo){
if(!getCouponData){
return false;
}
if(dialogInfo[key]){
if(getCouponData[key]){
return true
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment