只能提两天之后的日期

main
lion 1 year ago
parent 49648332e5
commit 990bb4bf1e

@ -34,8 +34,8 @@
</view> </view>
</view> </view>
<view class="orderInfo-status"> <view class="orderInfo-status">
<u-form-item label="发货时间" :label-style="{'display':'none','width':0,'flex':0}" :border-bottom="false" style="width:100%" prop="send_date" <u-form-item label="发货时间" :label-style="{'display':'none','width':0,'flex':0}"
label-position="left"> :border-bottom="false" style="width:100%" prop="send_date" label-position="left">
<view style="display: flex;align-items: center;justify-content: space-between;"> <view style="display: flex;align-items: center;justify-content: space-between;">
<view> <view>
<view>发货时间</view> <view>发货时间</view>
@ -43,7 +43,8 @@
<view class="hh" @click="openDatePicker"> <view class="hh" @click="openDatePicker">
<view class="" v-if="form.send_date"> <view class="" v-if="form.send_date">
<!-- <view>{{form.express}}</view> --> <!-- <view>{{form.express}}</view> -->
<view>{{form.ymd}} <text style="color:#b62828;margin:0 10rpx">[{{form.week}}]</text> <view>{{form.ymd}} <text
style="color:#b62828;margin:0 10rpx">[{{form.week}}]</text>
<!-- {{form.hh}} --> <!-- {{form.hh}} -->
</view> </view>
</view> </view>
@ -119,7 +120,8 @@
<view v-html="tips"></view> <view v-html="tips"></view>
</view> </view>
<view class="agreeinfo-btn"> <view class="agreeinfo-btn">
<view @click="closeAgree" :class="isAgree?'canAgree':''">我同意<text v-if="isAgreeTime>0">({{isAgreeTime}})</text></view> <view @click="closeAgree" :class="isAgree?'canAgree':''">我同意<text
v-if="isAgreeTime>0">({{isAgreeTime}})</text></view>
</view> </view>
</view> </view>
</view> </view>
@ -129,8 +131,8 @@
<view class="confirmpicinfo"> <view class="confirmpicinfo">
<view class="imgbox"> <view class="imgbox">
<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')">
></image> </image>
</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>
@ -406,19 +408,31 @@
let data = res.card let data = res.card
if (data.open_dates) { if (data.open_dates) {
for (var k in data.open_dates) { for (var k in data.open_dates) {
// 0
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) let _k = this.momentDay(k)
this.listDates.push({ this.listDates.push({
canUse: data.open_dates[k], canUse: data.open_dates[k],
..._k ..._k
}) })
} }
}
} }
} }
}).then(res => { }).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;
},
momentDay(date) { momentDay(date) {
if (date) { if (date) {
const weeks = ["周日", '周一', '周二', '周三', '周四', '周五', '周六', ] const weeks = ["周日", '周一', '周二', '周三', '周四', '周五', '周六', ]
@ -793,12 +807,14 @@
.u-form-item__body { .u-form-item__body {
align-items: baseline; align-items: baseline;
.u-form-item--left { .u-form-item--left {
width: 0 !important; width: 0 !important;
flex: 0 !important; flex: 0 !important;
} }
} }
} }
.hh { .hh {
&:last-child { &:last-child {
text-align: right; text-align: right;
@ -1076,6 +1092,7 @@
line-height: 75rpx; line-height: 75rpx;
margin: 20rpx auto; margin: 20rpx auto;
} }
.canAgree { .canAgree {
background-color: #ba8b45; background-color: #ba8b45;
} }

Loading…
Cancel
Save