main
lion 1 year ago
parent dc9fd66a7d
commit 07d64be3af

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

Loading…
Cancel
Save