main
lion 1 year ago
parent dc9fd66a7d
commit 07d64be3af

@ -13,18 +13,16 @@
<view class="orderInfo-title">
<view>{{cardInfo.sku?cardInfo.sku.name:''}}</view>
</view>
<view class="orderInfo-info">
<block v-if="cardInfo.sku">
<image
:style="cardInfo.sku.image_url?'width:200rpx;height:120rpx':'width:150rpx;height:150rpx'"
:src="cardInfo.sku.image_url?cardInfo.sku.image_url:require('@/static/logo-xietaitai.png')">
</image>
</block>
<block v-else>
<image
style="width:150rpx;height:150rpx"
:src="require('@/static/logo-xietaitai.png')">
</image>
<view class="orderInfo-info">
<block v-if="cardInfo.sku">
<image
:style="cardInfo.sku.image_url?'width:200rpx;height:120rpx':'width:150rpx;height:150rpx'"
:src="cardInfo.sku.image_url?cardInfo.sku.image_url:require('@/static/logo-xietaitai.png')">
</image>
</block>
<block v-else>
<image style="width:150rpx;height:150rpx" :src="require('@/static/logo-xietaitai.png')">
</image>
</block>
<!-- <image
:src="cardInfo.sku?(cardInfo.sku.image_url?cardInfo.sku.image_url:require('@/static/logo-xietaitai.png')):require('@/static/logo-xietaitai.png')">
@ -147,20 +145,18 @@
<view class="ordercontainer" v-if="showinfo">
<view class="confirmbox">
<view class="confirmpicinfo">
<view class="imgbox">
<block v-if="cardInfo.sku">
<image
:style="cardInfo.sku.image_url?'width:200rpx;height:120rpx':'width:150rpx;height:150rpx'"
:src="cardInfo.sku.image_url?cardInfo.sku.image_url:require('@/static/logo-xietaitai.png')">
</image>
</block>
<block v-else>
<image
:style="'width:150rpx;height:150rpx'"
:src="require('@/static/logo-xietaitai.png')">
</image>
<view class="imgbox">
<block v-if="cardInfo.sku">
<image
:style="cardInfo.sku.image_url?'width:200rpx;height:120rpx':'width:150rpx;height:150rpx'"
:src="cardInfo.sku.image_url?cardInfo.sku.image_url:require('@/static/logo-xietaitai.png')">
</image>
</block>
<block v-else>
<image :style="'width:150rpx;height:150rpx'" :src="require('@/static/logo-xietaitai.png')">
</image>
</block>
</view>
<view class="pictitle">{{cardInfo.sku?cardInfo.sku.name:''}}</view>
<text>{{cardInfo.sku?cardInfo.sku.specs:''}}</text>
@ -379,7 +375,7 @@
this.form.password = uni.getStorageSync("vuex_card") ? uni.getStorageSync("vuex_card").password : ''
// uni.removeStorageSync("vuex_card")
}
this.getAddress()
this.getDates()
// this.getExpress()
@ -471,45 +467,84 @@
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)) {
let _k = this.momentDay(k)
this.listDates.push({
canUse: data.open_dates[k],
..._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)){
// }
}
}
}
}
//
let product = res.product
if (!isNull(res.product.tip)) {
this.tips = res.product.tip
} else {
toast("当前无可提货时间")
}
//
let product = res.product
if(!isNull(res.product.tip)){
this.tips = res.product.tip
}else{
const configs = uni.getStorageSync("configs")
configs.map(item => {
if (item.key === 'tips') {
this.tips = item.value
}
})
}
const configs = uni.getStorageSync("configs")
configs.map(item => {
if (item.key === 'tips') {
this.tips = item.value
}
})
}
}).then(res => {
})
},
//
isAfterTwoDays(open_dates) {
const dateToCheck = this.$moment(open_dates, 'YYYY-MM-DD');
const today = this.$moment();
const twoDaysAfterToday = today.add(2, 'days');
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,10 +1084,10 @@
}
.imgbox image {
width: 200rpx;
height: 120rpx;
vertical-align: middle;
border-radius: 10rpx;
width: 200rpx;
height: 120rpx;
vertical-align: middle;
border-radius: 10rpx;
border: 1px solid #ba8b45;
}

Loading…
Cancel
Save