main
lion 1 year ago
parent dc9fd66a7d
commit 07d64be3af

@ -21,9 +21,7 @@
</image> </image>
</block> </block>
<block v-else> <block v-else>
<image <image style="width:150rpx;height:150rpx" :src="require('@/static/logo-xietaitai.png')">
style="width:150rpx;height:150rpx"
:src="require('@/static/logo-xietaitai.png')">
</image> </image>
</block> </block>
<!-- <image <!-- <image
@ -155,9 +153,7 @@
</image> </image>
</block> </block>
<block v-else> <block v-else>
<image <image :style="'width:150rpx;height:150rpx'" :src="require('@/static/logo-xietaitai.png')">
:style="'width:150rpx;height:150rpx'"
:src="require('@/static/logo-xietaitai.png')">
</image> </image>
</block> </block>
@ -471,8 +467,12 @@
return return
} }
if (data.open_dates) { if (data.open_dates) {
for (var k in data.open_dates) { for (var k in data.open_dates) {
//
if (data.open_dates[k]['quantity'] - data.open_dates[k]['booked'] > 0) { if (data.open_dates[k]['quantity'] - data.open_dates[k]['booked'] > 0) {
//
if (this.type === 'edit') {
if (this.isAfterTwoDays(k)) { if (this.isAfterTwoDays(k)) {
let _k = this.momentDay(k) let _k = this.momentDay(k)
this.listDates.push({ this.listDates.push({
@ -480,10 +480,20 @@
..._k ..._k
}) })
} }
} else {
// 1212
let _k = this.momentDay(k)
this.listDates.push({
canUse: data.open_dates[k],
..._k
})
// if(this.isBeforeNoon(k)){
// }
}
} }
} }
} else {
toast("当前无可提货时间")
} }
// //
@ -503,6 +513,7 @@
}) })
}, },
//
isAfterTwoDays(open_dates) { isAfterTwoDays(open_dates) {
const dateToCheck = this.$moment(open_dates, 'YYYY-MM-DD'); const dateToCheck = this.$moment(open_dates, 'YYYY-MM-DD');
const today = this.$moment(); const today = this.$moment();
@ -510,6 +521,30 @@
return dateToCheck >= twoDaysAfterToday; return dateToCheck >= twoDaysAfterToday;
}, },
// 12
isBeforeNoon(a) {
// Moment
console.log("a",a)
const dateA = this.$moment(a, 'YYYY-MM-DD');
//
const today = this.$moment();
if(dateA.isAfter(today)){
return true
}
//
if (dateA.isSame(today, 'day')) {
//
const now = this.$moment();
// 12
if (now.hour() < 12) {
return true; // 12
}
}
return false; //
},
momentDay(date) { momentDay(date) {
if (date) { if (date) {
const weeks = ["周日", '周一', '周二', '周三', '周四', '周五', '周六', ] const weeks = ["周日", '周一', '周二', '周三', '周四', '周五', '周六', ]

Loading…
Cancel
Save