只能提两天之后的日期

main
lion 1 year ago
parent 49648332e5
commit 990bb4bf1e

@ -34,8 +34,8 @@
</view>
</view>
<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"
label-position="left">
<u-form-item label="发货时间" :label-style="{'display':'none','width':0,'flex':0}"
:border-bottom="false" style="width:100%" prop="send_date" label-position="left">
<view style="display: flex;align-items: center;justify-content: space-between;">
<view>
<view>发货时间</view>
@ -43,7 +43,8 @@
<view class="hh" @click="openDatePicker">
<view class="" v-if="form.send_date">
<!-- <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}} -->
</view>
</view>
@ -119,7 +120,8 @@
<view v-html="tips"></view>
</view>
<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>
@ -129,8 +131,8 @@
<view class="confirmpicinfo">
<view class="imgbox">
<image
:src="cardInfo.sku?(cardInfo.sku.image_url?cardInfo.sku.image_url:require('@/static/logo-xietaitai.png')):require('@/static/logo-xietaitai.png')"
></image>
:src="cardInfo.sku?(cardInfo.sku.image_url?cardInfo.sku.image_url:require('@/static/logo-xietaitai.png')):require('@/static/logo-xietaitai.png')">
</image>
</view>
<view class="pictitle">{{cardInfo.sku?cardInfo.sku.name:''}}</view>
<text>{{cardInfo.sku?cardInfo.sku.specs:''}}</text>
@ -224,14 +226,14 @@
return {
showinfo: false,
showagree: false,
isAgree:false,
isAgreeTime:10,
agreeTimer:null,
isAgree: false,
isAgreeTime: 10,
agreeTimer: null,
showAddress: false,
listAddress: [],
addressInfo: '',
cardInfo: {},
tips:'',
tips: '',
type: '',
form: {
card_number: '',
@ -317,7 +319,7 @@
},
onUnload() {
if(this.agreeTimer){
if (this.agreeTimer) {
clearInterval(this.agreeTimer)
this.agreeTimer = null
}
@ -352,8 +354,8 @@
}
//
const configs = uni.getStorageSync("configs")
configs.map(item=>{
if(item.key==='tips'){
configs.map(item => {
if (item.key === 'tips') {
this.tips = item.value
}
})
@ -406,19 +408,31 @@
let data = res.card
if (data.open_dates) {
for (var k in data.open_dates) {
// 0
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
})
}
}
}
}
}).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) {
if (date) {
const weeks = ["周日", '周一', '周二', '周三', '周四', '周五', '周六', ]
@ -565,7 +579,7 @@
}
},
openShowInfo(){
openShowInfo() {
let that = this
if (!isNull(this.form.mobile2) && this.form.mobile2.length > 0) {
if (!isMobile(this.form.mobile2)) {
@ -600,37 +614,37 @@
}
});
},
closeAgree(){
if(this.isAgreeTime>0){
closeAgree() {
if (this.isAgreeTime > 0) {
return
}else{
} else {
this.isAgree = true
this.showagree = false
}
},
reduceAgreeTime(){
reduceAgreeTime() {
let that = this
if(that.isAgreeTime>0){
this.agreeTimer = setInterval(function(){
if (that.isAgreeTime > 0) {
this.agreeTimer = setInterval(function() {
that.isAgreeTime--
if(that.isAgreeTime===0){
if (that.isAgreeTime === 0) {
that.isAgree = true
that.isAgreeTime = 0
clearInterval(that.agreeTimer)
that.agreeTimer = null
}
},1000)
}, 1000)
}
},
submit() {
let that = this
if(!this.isAgree){
if (!this.isAgree) {
this.showagree = true
this.isAgreeTime = 10
this.reduceAgreeTime()
}else{
if(this.isAgree){
} else {
if (this.isAgree) {
this.form.show = 0
if (this.type == 'edit') {
console.log("this.form", this.form)
@ -793,12 +807,14 @@
.u-form-item__body {
align-items: baseline;
.u-form-item--left{
width:0!important;
flex:0!important;
.u-form-item--left {
width: 0 !important;
flex: 0 !important;
}
}
}
.hh {
&:last-child {
text-align: right;
@ -921,7 +937,7 @@
.imgbox {
width: 150rpx;
height:150rpx;
height: 150rpx;
margin: 0 auto;
border-radius: 10rpx;
border: 1px solid #ba8b45;
@ -931,7 +947,7 @@
.imgbox image {
width: 150rpx;
height:150rpx;
height: 150rpx;
vertical-align: middle;
}
@ -1052,21 +1068,21 @@
&-title {
font-size: 32rpx;
margin-bottom: 30rpx;
color:#b62828;
color: #b62828;
text-align: center;
}
&-content {
line-height: 1.8;
font-size: 30rpx;
height:300rpx;
height: 300rpx;
overflow: scroll;
}
&-btn {
>view {
background-color: rgba(0,0,0,0.5);
background-color: rgba(0, 0, 0, 0.5);
color: #fff;
border-radius: 40rpx;
width: 60%;
@ -1076,7 +1092,8 @@
line-height: 75rpx;
margin: 20rpx auto;
}
.canAgree{
.canAgree {
background-color: #ba8b45;
}
}

Loading…
Cancel
Save