Browse Source

no message

xiaoxin 2 years ago
parent
commit
86c8bd7c65

+ 1 - 1
pages/addOrEdit/addOrEdit.vue

@@ -155,7 +155,7 @@ export default {
 					contactId: this.id
 				}
 			})
-			console.log(res)
+			// console.log(res)
 			if (res.code === 200) {
 				uni.showToast({
 					title: '编辑成功',

+ 10 - 3
pages/affirmOrder/affirmOrder.vue

@@ -7,7 +7,9 @@
 			<!-- 标题区域 -->
 			<view class="header_title">民宿名称</view>
 			<!-- 返回图标区域 -->
-			<img class="header_icon" src="../../static/index/left.png" @click="handleBack" />
+			<view class="header_icon" @click="handleBack">
+				<img src="../../static/index/left.png" />
+			</view>
 		</view>
 
 		<view class="body">
@@ -276,7 +278,12 @@ export default {
 			top: 76rpx;
 			left: 5rpx;
 			width: 47rpx;
-			height: 47rpx;
+			height: 70rpx;
+
+			img {
+				width: 47rpx;
+				height: 47rpx;
+			}
 		}
 	}
 
@@ -562,4 +569,4 @@ export default {
 		}
 	}
 }
-</style>
+</style>

+ 2 - 2
pages/authorization/authorization.vue

@@ -25,7 +25,7 @@ export default {
 		},
 		// 查询请求
 		async handleQuery(type, code) {
-			if (type === 1) {
+			if (type === '1') {
 				// 查询商家是否绑定
 				const res = await this.$myRequest({
 					url: '/mhotel/appget_user_ma.action',
@@ -43,7 +43,7 @@ export default {
 						url: '/pages/shop/shop'
 					})
 				}
-			} else if (type === 2) {
+			} else if (type === '2') {
 				// 查询业主是否已绑定
 				const res = await this.$myRequest({
 					url: '/mhotel/appgetUser.action',

+ 1 - 1
pages/detail/detail.vue

@@ -10,7 +10,7 @@
 
 		<!-- 民宿详细信息区域 -->
 		<view class="detail">
-			<view class="detail_name">{{ info.hname }}</view>
+			<view class="detail_name">{{ info.hotel_name }}</view>
 
 			<view class="detail_info">
 				<view class="info_left">{{ info.fitupTime }}装修 | {{ info.openTime }}开业</view>

+ 13 - 5
pages/detailInfo/detailInfo.vue

@@ -1,14 +1,17 @@
 <template>
-	<view class="container">
+	<view class="container" v-if="detailInfo">
 		<!-- 顶部民宿信息区域 -->
 		<view class="header">
 			<img src="../../static/my/headerImg.png" />
 			<!-- 标题区域 -->
 			<view class="header_title">设施详情</view>
 			<!-- 返回图标区域 -->
-			<img class="header_icon" src="../../static/index/left.png" @click="handleBack" />
+			<view class="header_icon" @click="handleBack">
+				<img src="../../static/index/left.png" />
+			</view>
+
 			<!-- 民宿名称区域 -->
-			<view class="header_name">{{ detailInfo.hname }}</view>
+			<view class="header_name">{{ detailInfo.hotel_name }}</view>
 			<!-- 开业时间区域 -->
 			<view class="header_info">{{ detailInfo.openTime }}开业 I {{ detailInfo.fitupTime }}装修 I {{ detailInfo.roomNumber }}间客房</view>
 			<!-- 类型区域 -->
@@ -58,7 +61,7 @@ export default {
 			// 民宿ID
 			hotelId: '',
 			// 详细信息
-			detailInfo: {}
+			detailInfo: null
 		}
 	},
 	onLoad(options) {
@@ -158,7 +161,12 @@ export default {
 			top: 76rpx;
 			left: 5rpx;
 			width: 47rpx;
-			height: 47rpx;
+			height: 70rpx;
+
+			img {
+				width: 47rpx;
+				height: 47rpx;
+			}
 		}
 
 		.header_name {

+ 1 - 1
pages/home/home.vue

@@ -24,7 +24,7 @@
 			<view class="item" v-for="item in hotelList" :key="item.id" @click="goPageDetail(item)">
 				<image class="item-img" :src="item.coverImg" mode="scaleToFill"></image>
 				<view class="descrition">
-					<text class="title">{{ item.hname }}</text>
+					<text class="title">{{ item.hotel_name }}</text>
 					<text class="type">{{ item.hTypeName }}</text>
 					<text class="distance" v-if="showdDistance">距您直线{{ item.distance }}公里</text>
 					<view class="detail">

+ 2 - 2
pages/my/my.vue

@@ -6,7 +6,7 @@
 			<!-- 页面标题 -->
 			<view class="title">我的</view>
 			<!-- 头像区域 -->
-			<img class="img" v-if="flag" :src="userInfo.headPhoto" />
+			<img class="img" mode="aspectFill" v-if="flag" :src="userInfo.headPhoto" />
 			<img class="img" v-else src="../../static/my/portrait.png" />
 			<!-- 姓名区域 -->
 			<view class="name" v-if="flag">{{ userInfo.user_name }}</view>
@@ -338,4 +338,4 @@ export default {
 		}
 	}
 }
-</style>
+</style>

+ 44 - 2
pages/orderDetail/orderDetail.vue

@@ -7,9 +7,15 @@
 			<!-- 标题区域 -->
 			<view class="header_title">订单详情</view>
 			<!-- 返回图标区域 -->
-			<img class="header_icon" src="../../static/index/left.png" @click="handleBack" />
+			<view class="header_icon" @click="handleBack">
+				<img src="../../static/index/left.png" />
+			</view>
 
 			<view class="header_type" v-if="info.orderStatus === '1'">待支付</view>
+			<view class="header_time" v-if="info.orderStatus === '1'">
+				剩余
+				<uv-count-down :time="info.countDownTime" format="mm:ss" @finish="finish(info)"></uv-count-down>
+			</view>
 			<view class="header_info" v-if="info.orderStatus === '1'">超时后,订单将会自动取消</view>
 			<view class="header_type" v-if="info.orderStatus === '2'">已支付</view>
 			<view class="header_info" v-if="info.orderStatus === '2'">订单已支付,请等待商家接单</view>
@@ -164,6 +170,9 @@ export default {
 			// console.log(res)
 			if (res.code === 200) {
 				this.info = res.data
+				// 计算出倒计时时间(毫秒)
+				let temLockTime = this.info.lockTime ? this.info.lockTime * 1 : 15
+				this.info.countDownTime = new Date(this.info.createTime.slice(0, 19)).getTime() + temLockTime * 60 * 1000 - new Date().getTime()
 			}
 		},
 		// 点击复制文字回调
@@ -318,6 +327,19 @@ export default {
 					}
 				}
 			})
+		},
+		// 倒计时结束回调
+		async finish(item) {
+			const res = await this.$myRequest({
+				url: '/mhotel/abkupdateOrderStatus.action',
+				data: {
+					bookingId: item.id
+				}
+			})
+			// console.log(res)
+			if (res.code === 200) {
+				item.orderStatus = '6'
+			}
 		}
 	}
 }
@@ -350,7 +372,12 @@ export default {
 			top: 76rpx;
 			left: 10rpx;
 			width: 47rpx;
-			height: 47rpx;
+			height: 70rpx;
+
+			img {
+				width: 47rpx;
+				height: 47rpx;
+			}
 		}
 
 		.header_type {
@@ -361,6 +388,16 @@ export default {
 			font-weight: bold;
 		}
 
+		.header_time {
+			position: absolute;
+			top: 162rpx;
+			left: 530rpx;
+			display: flex;
+			align-items: center;
+			font-size: 30rpx;
+			font-weight: bold;
+		}
+
 		.header_info {
 			position: absolute;
 			top: 235rpx;
@@ -608,4 +645,9 @@ export default {
 		}
 	}
 }
+
+// 修改倒计时字体颜色
+::v-deep .uv-count-down .uv-count-down__text {
+	color: #fff;
+}
 </style>

+ 2 - 2
util/api.js

@@ -1,6 +1,6 @@
 // const BASE_URL = "https://chtech.ncjti.edu.cn/hotelReservation"
-const BASE_URL = "https://chtech.ncjti.edu.cn/hotelReservation/mhotel"
-// const BASE_URL = "http://192.168.161.232:8080"
+// const BASE_URL = "https://chtech.ncjti.edu.cn/hotelReservation/mhotel"
+const BASE_URL = "http://192.168.161.232:8080"
 export const myRequest = (options) => {
 	uni.showLoading({
 		title: "加载中",