17755135699 1 год назад
Родитель
Сommit
4cc7ad12d4
2 измененных файлов с 55 добавлено и 28 удалено
  1. 11 0
      components/uNavBar/index.vue
  2. 44 28
      pages/house/index.vue

+ 11 - 0
components/uNavBar/index.vue

@@ -1,4 +1,5 @@
 <template>
+	<view>
 	<u-navbar :title="title" :bgColor="bgColor" :titleStyle="titleStyle">
 		<view class="u-nav-slot" slot="left" style="display: flex;">
 			<u-icon v-if="showIcon" name="arrow-left" size="44" :color="leftIconColor" @tap="toBack(backUrl)"></u-icon>
@@ -6,6 +7,9 @@
 			<u-icon v-if="showHome&&showIcon" name="home" size="48" :color="leftIconColor" @tap="toHome"></u-icon>
 		</view>
 	</u-navbar>
+	<!-- 底部渐变色 -->
+	<view class="bottomBg" :style="{'height':mt+'px'}" v-if="bgColor=='transparent'"></view>
+	</view>
 </template>
 
 <script>
@@ -96,4 +100,11 @@
 	.u-navbar--fixed {
 		z-index: 99999 !important;
 	}
+	.bottomBg{
+		background: linear-gradient(to bottom,#E7F1FF,#fff);
+		position: fixed;
+		width: 100%;
+		z-index: 10;
+		top:0;
+	}
 </style>

+ 44 - 28
pages/house/index.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="page" :style="{'padding-top':mt+'px'}">
-		<c-nav-bar title="房态" :showIcon="false" :titleStyle="titleStyle"></c-nav-bar>
+		<c-nav-bar title="房态" :showIcon="false" :titleStyle="titleStyle" bgColor="transparent"></c-nav-bar>
 		<view class="leftFixed" v-if="leftData.length!=0" :style="{'top':(mt+2)+'px'}">
 			<view class="tj" :style="{'top':mt+'px'}"></view>
 			<view class="year">
@@ -31,12 +31,18 @@
 		<view>
 			<view class="content" v-if="xdata.length!=0">
 				<view class="tj" :style="{'top':mt+'px'}">
-					<text class="label">房间总数:</text>
-					<text>{{info.totalRooms}}</text>
-					<text class="label">在入住房间数:</text>
-					<text>{{info.checkinRooms}}</text>
-					<text class="label">待入住房间数:</text>
-					<text>{{info.bookRooms}}</text>
+					<view class="item">
+						<text class="label">{{info.totalRooms}}</text>
+						<text>房间总数</text>
+					</view>
+					<view class="item">
+						<text class="label">{{info.checkinRooms}}</text>
+						<text>在入住房间</text>
+					</view>
+					<view class="item">
+						<text class="label">{{info.bookRooms}}</text>
+						<text>待入住房间</text>
+					</view>
 				</view>
 				<view class="date">
 					<view class="item">
@@ -46,7 +52,7 @@
 					<view class="item" v-for="(item,keynme,index) in xdata" :key="index">
 						<text>{{item.rentDate.substring(5)}}</text>
 						<text>{{weeks[item.rentWeek]}}</text>
-						<text>剩{{item.spareRooms}}</text>
+						<text>剩{{item.spareRooms||0}}</text>
 					</view>
 				</view>
 				<view style="height:18rpx"></view>
@@ -73,16 +79,13 @@
 										<!-- 空置房-->
 										<template
 											v-if="delDataStatus(item2.roomNumber,item2.houseBaseId,roomData.roomDataList,'status') == 1">
-											<view
-												v-if="disTabCli(roomData) == 1"
-												class="cellBox disT">
-												{{item2.roomNumber|delDataStatus(item2.houseBaseId,roomData.roomDataList,'price')}}
+											<view v-if="disTabCli(roomData) == 1" class="cellBox disT">
+												¥{{item2.roomNumber|delDataStatus(item2.houseBaseId,roomData.roomDataList,'price')}}
 											</view>
-											<view
-												v-else
+											<view v-else
 												@click="check(item2.roomNumber,item2.houseBaseId,roomData,i + '-'+index2+ '-'+ ind)"
 												class="cellBox">
-												{{item2.roomNumber|delDataStatus(item2.houseBaseId,roomData.roomDataList,'price')}}
+												{{item2.roomNumber|delDataStatus(item2.houseBaseId,roomData.roomDataList,'price')}}
 											</view>
 										</template>
 										<template v-else>
@@ -211,7 +214,6 @@
 			},
 			//关房
 			tabCli(roomNumber, id, roomId) {
-				this.clearData();
 				if (roomNumber) {
 					let obj = {};
 					for (let i = 0; i < roomId.length; i++) {
@@ -219,8 +221,9 @@
 							obj = roomId[i];
 						}
 					}
+					console.log(obj)
 					//已预订,已入住 待确认 待支付
-					if (obj.status == 1 || obj.status == 2 || obj.status == -1|| obj.status == -2) {
+					if (obj.status == 1 || obj.status == 2 || obj.status == -1 || obj.status == -2) {
 						let orderId = obj.orderId;
 						uni.navigateTo({
 							url: "/pages/house/orderInfo?orderId=" + orderId
@@ -231,11 +234,13 @@
 						this.areaShow = true;
 						this.checkDataRoomId = [obj.id];
 						this.checkStatus = obj.status;
+						console.log(obj.id)
 					}
 				}
 			},
 			//确定关房
 			passengerConfirm(e) {
+				console.log(this.checkDataRoomId)
 				let status = this.area[e.indexs[0]].id;
 				this.$api.post('/merchant/hotel/room/state/updRoomState', {
 					roomIds: this.checkDataRoomId,
@@ -277,7 +282,7 @@
 				}
 			},
 			disTabCli(roomData) {
-				if(new Date(roomData.rentDate).Format('yyyy-MM-dd')<new Date().Format('yyyy-MM-dd')){
+				if (new Date(roomData.rentDate).Format('yyyy-MM-dd') < new Date().Format('yyyy-MM-dd')) {
 					return 1
 				}
 			},
@@ -417,23 +422,33 @@
 	}
 
 	.tj {
-		padding: 30rpx 0;
+		padding: 32rpx 0;
 		text-align: center;
-		height: 98rpx;
+		height: 140rpx;
 		box-sizing: border-box;
 		position: absolute;
 		width: 750rpx;
 		left: 0;
+		display: flex;
+		justify-content: space-between;
+		background-color: #fff;
+
+		.item {
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			width: 100px;
+			flex: 1;
+		}
 
 		text {
-			font-size: 28rpx;
-			color: #f44;
-			font-weight: bold;
-			margin: 0 10rpx;
+			font-size: 24rpx;
+			color: #999;
 
 			&.label {
+				font-size: 40rpx;
 				color: #333;
-				margin: 0
+				font-weight: bold;
 			}
 		}
 	}
@@ -443,7 +458,7 @@
 		position: relative;
 		border: 1rpx solid #E9F0F5;
 		// padding-bottom: 19rpx;
-		margin-top: 98rpx;
+		margin-top: 140rpx;
 
 		.item {
 			min-width: 130rpx;
@@ -571,7 +586,8 @@
 						flex-direction: column;
 						align-items: center;
 						justify-content: center;
-						&.disT{
+
+						&.disT {
 							color: #ccc;
 						}
 					}
@@ -706,7 +722,7 @@
 				border-bottom: 1rpx solid #E9F0F5;
 				width: 130rpx;
 				background-color: #fff;
-				box-shadow: 3px 0 5px #eae5e5;
+				box-shadow: 3px 0 10px #efefef;
 				box-sizing: border-box;
 				justify-content: center;
 				// &:first-child{height: 84rpx;border-top: 1rpx solid #E9F0F5;}