|
|
|
|
@ -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 {
|
|
|
|
|
//正常提货 当天12点前可提当天,过12点 不可提当天
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|