Pārlūkot izejas kodu

增加下拉刷新、点击跳转详情、已预订非今天的不显示办理入住

htc 10 mēneši atpakaļ
vecāks
revīzija
07043c7a09
1 mainītis faili ar 12 papildinājumiem un 3 dzēšanām
  1. 12 3
      pages/home/index.vue

+ 12 - 3
pages/home/index.vue

@@ -55,7 +55,7 @@
 			</view>
 		</view>
 		<block v-if="list.length>0">
-			<view class="card" v-for="(item,index) in list" :key="index">
+			<view class="card" v-for="(item,index) in list" :key="index" @tap="handleDetail(item)">
 				<view class="c_top">
 					<text>订单号:{{item.orderCode}}</text>
 					<text v-if='item.orderStatus==-1&&item.status==1' class="orange">待确认</text>
@@ -76,9 +76,9 @@
 				<view class="c_bottom">
 					<view class="btn" v-if="item.orderStatus==-1" :class="item.orderStatus==-1?'btn_jj':''" @tap="cancle(item)">拒绝</view>
 					<view class="btn" v-if="item.orderStatus==-1" @tap="toConfrimOrder(item)">确认订单</view>
-					<view class="btn" v-if="item.orderStatus==1" @tap="checkIn(2,item)">办理入住</view>
+					<view class="btn" v-if="item.orderStatus==1&&item.istoday" @tap="checkIn(2,item)">办理入住</view>
 					<view class="btn" v-if="item.orderStatus==2" @tap="toBltf(item)">办理退房</view>
-					<view class="btn" v-if="item.orderStatus==3||item.orderStatus==4" :class="item.orderStatus==3||item.orderStatus==4?'btn_xq':''" @tap="handleDetail(item)">详情</view>
+					<view class="btn" v-if="item.orderStatus==3||item.orderStatus==4||(item.orderStatus==1&&!item.istoday)" :class="(item.orderStatus==3||item.orderStatus==4||(item.orderStatus==1&&!item.istoday))?'btn_xq':''" @tap="handleDetail(item)">详情</view>
 				</view>
 			</view>
 		</block>
@@ -143,6 +143,14 @@
 			if(this.finished) return
 			this.getList();
 		},
+		onPullDownRefresh() {
+			setTimeout(()=>{
+				this.getType();
+				this.getDetails();
+				this.init();
+				uni.stopPullDownRefresh();
+			},1000);
+		},
 		methods: {
 			getType(){
 				this.$api.post('/merchant/register/getMerchantStoreList').then(res=>{
@@ -194,6 +202,7 @@
 						this.list = [...this.list,...res.data.data.list];
 						this.list.forEach(l=>{
 							l.date = new Date(l.arriveDate).Format('MM/dd')+" - "+new Date(l.leaveDate).Format('MM/dd');
+							l.istoday = new Date().Format('yyyy-MM-dd')==new Date(l.arriveDate).Format('yyyy-MM-dd')?true:false;
 						})
 						if (res.data.data.list.length == 0) this.finished = true;
 						else this.page++;