Commit 8ef0a4984f27671b682fa4c84f9e6f90cb07f92f

Authored by “pengye”
1 parent 7f5a42d9

付款页修改当前餐段判断规则

... ... @@ -614,7 +614,7 @@ Page({
} else {
obj.isshow = '0'
}
console.log('不可用日期信息餐段节假日', obj);
console.log('不可用日期信息餐段节假日', {...obj});
if (obj && obj.can && obj.solt) {
this.setData({
canSolt: {
... ... @@ -629,9 +629,9 @@ Page({
checkTimeInInterval(currentTime, lunchDis, lunchDinnerList) {
const [currentHour, currentMinute] = currentTime.split(':');
const [morningHour2, morningMinute2] = lunchDis.morning ? lunchDis.morning.split("-")[1].split(':') : [0, 0];
const [noonHour1, noonMinute1] = lunchDis.noon ? lunchDis.noon.split("-")[1].split(':') : [0, 0];
const [noonHour1, noonMinute1] = lunchDis.noon ? lunchDis.noon.split("-")[0].split(':') : [0, 0];
const [noonHour2, noonMinute2] = lunchDis.noon ? lunchDis.noon.split("-")[1].split(':') : [0, 0];
const [nightHour1, nightMinute1] = lunchDis.night ? lunchDis.night.split("-")[1].split(':') : [0, 0];
const [nightHour1, nightMinute1] = lunchDis.night ? lunchDis.night.split("-")[0].split(':') : [0, 0];
const currentTimestamp = new Date().setHours(currentHour, currentMinute, 0, 0); //当前时间
const time1 = (morningHour2 && morningMinute2) ? new Date().setHours(morningHour2, morningMinute2, 0, 0) : ''; //早餐截止时间
const time2 = (noonHour1 && noonMinute1) ? new Date().setHours(noonHour1, noonMinute1, 0, 0) : ''; //午餐开始时间
... ... @@ -657,16 +657,8 @@ Page({
} : {
solt: 2,
can: '午餐'
};
}
} else if (currentTimestamp > timeA1 && currentTimestamp < timeA2) { //在早餐/午餐截止时间之后 && 午餐/晚餐开始时间之前
return obj2.solt == 2 ? {
solt: 2,
can: '午餐'
} : {
solt: 3,
can: '晚餐'
};
} else if (currentTimestamp > timeA2) { //在午餐/晚餐截止时间之后
return obj1.solt == 1 ? {
solt: 1,
can: '早餐'
... ... @@ -674,6 +666,14 @@ Page({
solt: 2,
can: '午餐'
};
} else if (currentTimestamp > timeA2) { //在午餐/晚餐截止时间之后
return obj2.solt == 2 ? {
solt: 2,
can: '午餐'
} : {
solt: 3,
can: '晚餐'
};
}
}
// 3个餐段(早,午,晚)
... ... @@ -685,13 +685,18 @@ Page({
};
} else if (currentTimestamp > time1 && currentTimestamp < time2) { //在早餐截止时间之后 && 午餐开始时间之前
return {
solt: 1,
can: '早餐'
};
} else if (currentTimestamp > time2 && currentTimestamp < time3){
return {
solt: 2,
can: '午餐'
};
} else if (currentTimestamp > time3 && currentTimestamp < time4) { //在午餐截止时间之后 && 晚餐开始时间之前
}
} else if (currentTimestamp > time3 && currentTimestamp < time4) { //在午餐截止时间之后 && 晚餐开始时间之前
return {
solt: 3,
can: '晚餐'
solt: 2,
can: '午餐'
};
} else {
return {
... ...
... ... @@ -50,9 +50,9 @@
<!-- <view class="font20r bottom">{{item.arule.is_same_day=='1'?'领取当日可用':'领取当日不可用'}}</view>
<view wx:if="{{item.aexpiration>0}}" class="font20r bottom">领取后{{item.aexpiration}}天内使用</view>
<view wx:if="{{item.cdateText}}" class="font20r bottom">领取日期:{{item.cdateText}}</view> -->
<view wx:if="{{item.noonText || item.noonText}}" class="font20r bottomTitle"><text>不可使用:</text><view wx:if="{{item.noonText}}" class="bottom font20r">{{item.noonText}}</view>
<view wx:if="{{item.noonText}}" class="font20r bottomTitle"><text>不可使用:</text><view wx:if="{{item.noonText}}" class="bottom font20r">{{item.noonText}}</view>
</view>
<view wx:if="{{item.nigText}}" class="bottom font20r nodate">{{item.nigText}}</view>
<view wx:if="{{item.nigText}}" class="font20r {{!item.noonText?'bottomTitle':'bottom nodate'}}"><text wx:if="{{!item.noonText}}">不可使用:</text><view wx:if="{{item.nigText}}" class="bottom font20r">{{item.nigText}}</view></view>
<view wx:if="{{item.exp_date.week_show=='无'}}" class="bottom font20r">无使用时间限制</view>
</view>
<checkbox disabled="{{item.showCpupon == '0'}}" value="{{item.activity_id}}" checked="{{item.checked}}" />
... ...