Commit 6f8cfb5e by zhangzhen

页面优化

parent 2ad5fc38
......@@ -225,10 +225,16 @@
icon:'success',
title:'开门成功'
})
setTimeout(()=>{
this.openDoorStatus = false;
},5000)
} else {
uni.showToast({
icon:'success',
title:res.data.msg
})
}
setTimeout(()=>{
this.openDoorStatus = false;
},5000)
})
},
onOrderConfirm(){
......
<template>
<view class="coupon-list-box">
<scroll-view scroll-x class="bg-white nav">
<view class="flex text-center">
<view class="cu-item flex-sub" :class="index==statusIndex?'text-orange cur':''"
v-for="(item,index) in statusList" :key="index" @tap="tabSelect(index)">
<text>{{item.label}}</text>
</view>
</view>
</scroll-view>
<view v-for="(item,index) in list" :key="index" class="coupon-item">
<view class="part-left">
......@@ -43,7 +51,7 @@
</u-empty>
</view>
<!-- 当数据没有更多时 -->
<view v-if="list.length" style="padding: 12px 6% 0;">
<view v-if="list.length" style="padding: 12px 6%;">
<u-loadmore :status="status" :icon="true" :line='true' :loading-text="loadingText"
:loadmore-text="loadmoreText" :nomore-text="nomoreText" />
</view>
......@@ -80,6 +88,21 @@
tipText:"",
show:false,
listBlankImage:indexConfig.assetsPath+'/no_data_icon.png',
statusIndex: 0,
statusList: [
{
label: "全部",
value: "",
},
{
label: "待使用",
value: "0",
},
{
label: "已使用",
value: "1",
}
]
};
},
components: {
......@@ -109,7 +132,14 @@
}
}
})
}
},
tabSelect(i) {
this.statusIndex = i;
this.queryParams.pageNum = 1;
this.queryParams.useStatus = this.statusList[this.statusIndex].value
this.list = []
this.onLoading()
},
}
}
</script>
......@@ -120,6 +150,14 @@
flex-direction: column;
align-items: center;
width: 100%;
padding-top: 100upx;
.nav{
position: fixed;
top: 0;
left: 0;
height: 90upx;
z-index: 999;
}
.coupon-item{
display: flex;
flex-direction: row;
......
......@@ -633,9 +633,9 @@
// let startInex = this.dateIntervalList.findIndex(item => item.status === 0)
this.dateIntervalList.forEach((val,i)=>{
if(selectNum>=this.duration){
if(selectNum>this.duration){
return
} else if(val.status === 0 || (val.status ==1 && Number(moment(val.endHoldTime).format('mm'))<59)){
} else if(val.status === 0 || (val.status ==1 && Number(moment(val.endHoldTime).format('mm'))<29)){
selectNum+=1
if(t<0){
t = i
......@@ -647,7 +647,7 @@
})
if( selectNum < this.duration || (selectNum >= this.duration && t>=24)){
if( selectNum <= this.duration || (selectNum >= this.duration && t>=24)){
if(this.dateIndex>=this.dateList.length-1){
this.onInitDateList()
}else{
......@@ -843,7 +843,7 @@
if (!this.useDateStatus) {
uni.showToast({
icon: "none",
title: "选择时段有重复"
title: "所选时段已被其他订单占用"
})
}
}, 1000)
......@@ -963,6 +963,7 @@
if (this.modeIndex === i) return;
this.modeIndex = i;
this.selectCouponIndex = -1;
this.useDateStatus = true;
this.duration = Number(this.packageMode[this.modeIndex].duration);
let val = this.intervalList.findIndex(item=>item.status === 2)
let len = this.intervalList.filter(item=> item.status ===2).length;
......@@ -981,13 +982,13 @@
h = val+duration
}
this.endTime = `${h>=10?h:'0'+h}:${startM>=10?startM:'0'+startM}`;
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
this.useDateStatus = false
}
}else{
status = this.dateIntervalList[index].status
......@@ -997,10 +998,10 @@
status
}
})
if (showHourUse) {
if (!this.useDateStatus) {
uni.showToast({
icon: "none",
title: "选择时段有重复",
title: "所选时段已被其他订单占用",
success: () => {
setTimeout(async ()=>{
this.dateObj =await this.onSetDateTime(this.startTime, this.endTime);
......@@ -1043,7 +1044,7 @@
let n = 0
let t = -1;
res.data.data.forEach((item,k)=>{
if(n<=this.duration && (item.status===0||(item.status ==1 && Number(moment(item.endHoldTime).format('mm'))<59))){
if(n<=this.duration && (item.status===0||(item.status ==1 && Number(moment(item.endHoldTime).format('mm'))<29))){
n += 1
if(t<0){
t = k
......@@ -1056,7 +1057,7 @@
}
})
if(n < this.duration || (n >= this.duration && t>=24)){
if(n <= this.duration || (n >= this.duration && t>=24)){
uni.showToast({
icon:"none",
title:"当前日期无可预约时段"
......@@ -1161,7 +1162,7 @@
if (!this.useDateStatus) {
uni.showToast({
icon: "none",
title: "选择时段有重复,无法下单"
title: "所选时段已被其他订单占用"
})
return
}
......@@ -1175,7 +1176,7 @@
if (!this.useDateStatus) {
uni.showToast({
icon: "none",
title: "选择时段有重复,无法下单"
title: "所选时段已被其他订单占用"
})
return
}
......@@ -1323,7 +1324,6 @@
},
onSelectDatePoint(val, i) {
if(this.orderType == 2) return;
this.showHourUse = false;
if(i>=24) {
uni.showToast({
icon:"none",
......@@ -1343,7 +1343,7 @@
if (mTime >= 59) {
uni.showToast({
icon: 'none',
title: '当前时段不可'
title: '当前时段不可预定'
})
return;
} else {
......@@ -1385,14 +1385,14 @@
}
this.dateObj = this.onSetDateTime(this.startTime, this.endTime);
let showHourUse = false;
this.useDateStatus = true;
this.intervalList = this.intervalList.map((item,index) =>{
let status = item.status;
if(index>=i && index<= i+this.duration){
status = 2
if(this.dateIntervalList[index].status === 1 && index !== i ){
showHourUse = true
this.useDateStatus = false;
}
}else{
status = this.dateIntervalList[index].status
......@@ -1402,10 +1402,10 @@
status
}
})
if (showHourUse) {
if (!this.useDateStatus) {
uni.showToast({
icon: "none",
title: "选择时段有重复"
title: "所选时段已被其他订单占用"
})
}
},
......
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