Commit d41cede1 by 谢中龙

修改商品详情和广告

parent b3decc88
...@@ -153,7 +153,6 @@ Component({ ...@@ -153,7 +153,6 @@ Component({
else{ else{
//先设置进去 //先设置进去
dialogInfo[key] = true; dialogInfo[key] = true;
wx.setStorageSync('dialogInfo',dialogInfo);
//获取今天的当前也的key //获取今天的当前也的key
let expiredAllKey = []; let expiredAllKey = [];
...@@ -167,6 +166,8 @@ Component({ ...@@ -167,6 +166,8 @@ Component({
expiredAllKey.forEach(item => { expiredAllKey.forEach(item => {
delete dialogInfo[item]; delete dialogInfo[item];
}); });
wx.setStorageSync('dialogInfo',dialogInfo);
} }
}, },
//获取今天是否已经弹出了 //获取今天是否已经弹出了
......
...@@ -164,6 +164,7 @@ wxService.page({ ...@@ -164,6 +164,7 @@ wxService.page({
//确定领取优惠券 //确定领取优惠券
onTapSureGetCoupon(e){ onTapSureGetCoupon(e){
const { memberId } = wx.getStorageSync('_baseUserInfo'); const { memberId } = wx.getStorageSync('_baseUserInfo');
let item = e.currentTarget.dataset.item;
if(!memberId){ if(!memberId){
wx.showToast({ wx.showToast({
title: '请先登录', title: '请先登录',
...@@ -172,11 +173,19 @@ wxService.page({ ...@@ -172,11 +173,19 @@ wxService.page({
return ; return ;
} }
if(this.todayHasGot(item.id)){
wx.showToast({
title: '您今天已经领取过了,请明天再来领取吧',
icon : 'none'
});
return ;
}
wx.showLoading({ wx.showLoading({
title: '领取中..', title: '领取中..',
}); });
let item = e.currentTarget.dataset.item;
wxService.post(`/coupon/coupon/draw`,{ wxService.post(`/coupon/coupon/draw`,{
couponSettingId : item.id, couponSettingId : item.id,
memberId : memberId, memberId : memberId,
...@@ -187,7 +196,7 @@ wxService.page({ ...@@ -187,7 +196,7 @@ wxService.page({
title: '领取成功', title: '领取成功',
}); });
// this.setLocalStorageByKey(couponSettingId); this.setLocalStorageByKey(item.id);
} }
}) })
}, },
...@@ -204,7 +213,6 @@ wxService.page({ ...@@ -204,7 +213,6 @@ wxService.page({
else{ else{
//先设置进去 //先设置进去
getCouponData[key] = true; getCouponData[key] = true;
wx.setStorageSync('getCouponData',getCouponData);
//获取今天的当前也的key //获取今天的当前也的key
let expiredAllKey = []; let expiredAllKey = [];
...@@ -218,6 +226,8 @@ wxService.page({ ...@@ -218,6 +226,8 @@ wxService.page({
expiredAllKey.forEach(item => { expiredAllKey.forEach(item => {
delete getCouponData[item]; delete getCouponData[item];
}); });
wx.setStorageSync('getCouponData',getCouponData);
} }
}, },
...@@ -225,11 +235,11 @@ wxService.page({ ...@@ -225,11 +235,11 @@ wxService.page({
todayHasGot(couponSettingId){ todayHasGot(couponSettingId){
let getCouponData = wx.getStorageSync('getCouponData'); let getCouponData = wx.getStorageSync('getCouponData');
let key = `${couponSettingId}_d_${this.getCurrentYearMonDay()}`; let key = `${couponSettingId}_d_${this.getCurrentYearMonDay()}`;
if(!dialogInfo){ if(!getCouponData){
return false; return false;
} }
if(dialogInfo[key]){ if(getCouponData[key]){
return true 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