main
lion 1 year ago
parent dc9fd66a7d
commit 07d64be3af

@ -21,9 +21,7 @@
</image>
</block>
<block v-else>
<image
style="width:150rpx;height:150rpx"
:src="require('@/static/logo-xietaitai.png')">
<image style="width:150rpx;height:150rpx" :src="require('@/static/logo-xietaitai.png')">
</image>
</block>
<!-- <image
@ -155,9 +153,7 @@
</image>
</block>
<block v-else>
<image
:style="'width:150rpx;height:150rpx'"
:src="require('@/static/logo-xietaitai.png')">
<image :style="'width:150rpx;height:150rpx'" :src="require('@/static/logo-xietaitai.png')">
</image>
</block>
@ -471,26 +467,40 @@
return
}
if (data.open_dates) {
for (var k in data.open_dates) {
//
if (data.open_dates[k]['quantity'] - data.open_dates[k]['booked'] > 0) {
if (this.isAfterTwoDays(k)) {
//
if (this.type === 'edit') {
if (this.isAfterTwoDays(k)) {
let _k = this.momentDay(k)
this.listDates.push({
canUse: data.open_dates[k],
..._k
})
}
} else {
// 1212
let _k = this.momentDay(k)
this.listDates.push({
canUse: data.open_dates[k],
..._k
})
// if(this.isBeforeNoon(k)){
// }
}
}
}
} else {
toast("当前无可提货时间")
}
//
let product = res.product
if(!isNull(res.product.tip)){
if (!isNull(res.product.tip)) {
this.tips = res.product.tip
}else{
} else {
const configs = uni.getStorageSync("configs")
configs.map(item => {
if (item.key === 'tips') {
@ -503,6 +513,7 @@
})
},
//
isAfterTwoDays(open_dates) {
const dateToCheck = this.$moment(open_dates, 'YYYY-MM-DD');
const today = this.$moment();
@ -510,6 +521,30 @@
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) {
if (date) {
const weeks = ["周日", '周一', '周二', '周三', '周四', '周五', '周六', ]
@ -1039,8 +1074,8 @@
}
.imgbox {
width: 200rpx;
// height: 120rpx;
width: 200rpx;
// height: 120rpx;
margin: 0 auto;
// border-radius: 10rpx;
// border: 1px solid #ba8b45;
@ -1049,8 +1084,8 @@
}
.imgbox image {
width: 200rpx;
height: 120rpx;
width: 200rpx;
height: 120rpx;
vertical-align: middle;
border-radius: 10rpx;
border: 1px solid #ba8b45;

Loading…
Cancel
Save