Commit b36dbad3 by zhangzhen

细节优化

parent 21e2f630
......@@ -130,7 +130,7 @@
<view class="part-1">
<button class="cu-btn round" :class="orderType===1?'line-black':'line-gray'"
@tap="onSelectDate">
<text>{{startTime}}</text>
<text>{{startTime | resetStartTime}}</text>
<text class="cuIcon-edit"></text>
</button>
</view>
......@@ -422,21 +422,7 @@
],
// 套餐
modeIndex: 0,
packageMode: [{
id: '',
label: "优惠套餐1",
duration: 4,
originalPrice: 100,
realPrice: 78
},
{
id: '',
label: "优惠套餐2",
duration: 8,
originalPrice: 200,
realPrice: 138
}
],
packageMode: [],
// 原数据
dateIntervalList: [],
intervalList: [],
......@@ -477,6 +463,18 @@
}
};
},
filters:{
resetStartTime(val){
let time = null;
let hour = val.split(':')
if(hour>=24){
time = `${hour-24}:00`
}else{
time = val
}
return time;
}
},
onLoad(option) {
uni.showLoading({
title: "加载中"
......@@ -562,6 +560,8 @@
}).then(res => {
uni.hideLoading()
// orderType 订单类型
if (this.orderType === 1) {
if (this.index == 1){
this.duration = Number(this.packageMode[this.modeIndex].duration);
......@@ -579,7 +579,7 @@
if(item.status==1 && this.setStartTime.duration < this.duration && moment(item.endHoldTime).format("mm")<59 ){
this.setStartTime.startTime = moment(item.endHoldTime).format("HH:mm");
if(index>=24){
this.setStartTime.days = 2
this.setStartTime.days = 2;
}
this.setStartTime.duration = 0;
this.setStartTime.status = true;
......@@ -602,9 +602,6 @@
} else if(item.status === 0 && this.setStartTime.duration === 0 && !this.setStartTime.status){
this.setStartTime.duration += 1;
this.setStartTime.startTime = `${index}:00`;
if(index>=24){
this.setStartTime.days = 2
}
this.setStartTime.status = true;
}else if(item.status === 0 && this.setStartTime.duration >= 0 && this.setStartTime.duration < this.duration && this.setStartTime.status){
this.setStartTime.duration += 1;
......@@ -725,7 +722,6 @@
}
}
this.$forceUpdate();
setTimeout(() => {
if (!this.useDateStatus) {
uni.showToast({
......@@ -830,8 +826,48 @@
},
onChangeMode(i) {
if (this.modeIndex === i) return;
this.modeIndex = i
this.onSetEndTime()
this.modeIndex = i;
let val = this.intervalList.findIndex(item=>item.status === 2)
let len = this.intervalList.filter(item=> item.status ===2).length;
let duration = Number(this.packageMode[this.modeIndex].duration);
let start = Number(this.startTime.split(":")[0])
let startM = Number(this.startTime.split(":")[1])
let h = val;
if(val+duration>=24){
h = val+duration-24
} else{
h = val+duration
}
this.endTime = `${h>=10?h:'0'+h}:${startM}`;
this.dateObj = this.onSetDateTime(this.startTime, this.endTime);
let showHourUse = false;
this.intervalList = this.intervalList.map((item,index) =>{
let status = item.status;
if(index>=val && index<= val+duration){
status = 2
if(this.dateIntervalList[index].status === 1 && index !== val ){
showHourUse = true
}
}else{
status = this.dateIntervalList[index].status
}
return {
...item,
status
}
})
if (showHourUse) {
uni.showToast({
icon: "none",
title: "选择时段有重复"
})
}
},
onDurationChange(i) {
if (i >= this.distanceMode.length - 1) {
......@@ -1066,7 +1102,6 @@
if (i < 24) {
if (val.status == 1) {
let mTime = moment(val.endHoldTime).format("mm")
console.log(mTime, "分钟数据")
if (mTime >= '59') {
uni.showToast({
icon: 'none',
......
......@@ -64,6 +64,10 @@
<text class="text-gray">支付方式</text>
<text class="text-title">{{orderInfo.payType==1?'微信支付':'其他支付'}}</text>
</view>
<view v-if="orderInfo.couponName && orderInfo.couponId" class="flex-between">
<text class="text-gray">优惠券抵扣</text>
<text class="text-title">{{orderInfo.couponName}}</text>
</view>
<view class="flex-between">
<text class="text-gray">支付时间</text>
<text class="text-title">{{orderInfo.payTime||'-'}}</text>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment