浏览代码

支付已经完成

soft5566 2 年之前
父节点
当前提交
e4681337c2

+ 18 - 14
.hbuilderx/launch.json

@@ -1,16 +1,20 @@
-{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
-  // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
-    "version": "0.0",
-    "configurations": [{
-     	"default" : 
-     	{
-     		"launchtype" : "local"
-     	},
-     	"mp-weixin" : 
-     	{
-     		"launchtype" : "local"
-     	},
-     	"type" : "uniCloud"
-     }
+{
+    // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
+    // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
+    "version" : "0.0",
+    "configurations" : [
+        {
+            "default" : {
+                "launchtype" : "local"
+            },
+            "mp-weixin" : {
+                "launchtype" : "local"
+            },
+            "type" : "uniCloud"
+        },
+        {
+            "openVueDevtools" : true,
+            "type" : "uni-app:h5"
+        }
     ]
     ]
 }
 }

+ 33 - 7
App.vue

@@ -1,14 +1,40 @@
 <script>
 <script>
 	export default {
 	export default {
-		onLaunch: function() {
+		onLaunch: function(options) {
 			// console.log('App Launch')
 			// console.log('App Launch')
-			// console.log(localStorage.getItem('token')=='null')
-			if (localStorage.getItem('token') == 'null' && localStorage.getItem('errorMsg') == 'null') {
-				window.location.href =
-					'https://open.wecard.qq.com/connect/oauth/authorize?app_key=4FD5599032819781&response_type=code&scope=snsapi_userinfo&ocode=1015730314&redirect_uri=https://chtech.ncjti.edu.cn/hotel/ihotel-api/ihotel/hotelUser/weixiaoAuth&state=https://chtech.ncjti.edu.cn/hotel/ihotel-api/ihotel/hotelUser/weixiaoAuth';
-			} else if (localStorage.getItem('token') == 'null' && localStorage.getItem('errorMsg') == '获取用户信息失败') {
+			// console.log('\'' + this.$utils.getEncryptedData('token') + '\'')
+			// console.log('\'' + this.$utils.getEncryptedData('cardNumber') + '\'')
+			// console.log('\'' + this.$utils.getEncryptedData('errorMsg') + '\'')
+
+			var cardNumber = options.query.card_number;
+			if (!this.$utils.isEmpty(cardNumber)) {
+				this.$utils.storeEncryptedData('cardNumber', cardNumber);
+			} else {
+				cardNumber = this.$utils.getEncryptedData('cardNumber');
+				if (this.$utils.isEmpty(cardNumber)) {
+					uni.showToast({
+						title: '未获得用户信息',
+						duration: 3000
+					})
+				}
+			}
+
+			var token = this.$utils.getEncryptedData('token');
+			var errorMsg = this.$utils.getEncryptedData('errorMsg');
+
+			if (this.$utils.isEmpty(cardNumber) && this.$utils.isEmpty(token) && this.$utils.isEmpty(errorMsg)) {
+				var url = 'https://chtech.ncjti.edu.cn/hotelReservation/zhotel/appopenid.action';
+				var encodedUrl = encodeURIComponent(url);
+				window.location.href = 'https://open.wecard.qq.com/connect/oauth/authorize' +
+					'?app_key=9FFFACD6D09F15D2' +
+					'&response_type=code' +
+					'&scope=snsapi_userinfo' +
+					'&ocode=1015730314' +
+					'&redirect_uri=' + encodedUrl +
+					'&state=' + url;
+			} else if (this.$utils.isEmpty(cardNumber) && this.$utils.isEmpty(token) && this.$utils.containsString(errorMsg, '失败')) {
 				uni.navigateTo({
 				uni.navigateTo({
-					url: 'pages/huoquanshibai/huoquanshibai'
+					url: '/pages/p404/p404'
 				})
 				})
 			}
 			}
 		},
 		},

+ 27 - 17
main.js

@@ -1,39 +1,49 @@
-
 // #ifndef VUE3
 // #ifndef VUE3
 import Vue from 'vue'
 import Vue from 'vue'
 import App from './App'
 import App from './App'
 import axios from "axios"
 import axios from "axios"
 import qs from 'qs'
 import qs from 'qs'
-import getUrlKey from './utils/getToken.js'
-localStorage.setItem('token',getUrlKey('token'))
-localStorage.setItem('errorMsg',getUrlKey('errorMsg'))
-console.log(localStorage.getItem('token'))
-console.log(localStorage.getItem('errorMsg'))
 
 
-//引入公共接口
-import {myRequest} from './utils/api.js'
-//挂载全局
-Vue.prototype.$myRequest = myRequest
+// 公共函数
+import utils from '@/utils/common.js';
 
 
-Vue.config.productionTip = false
+//引入公共接口
+import {
+	myRequest
+} from '@/utils/api.js'
 
 
 App.mpType = 'app'
 App.mpType = 'app'
+//挂载全局
+Vue.prototype.$utils = utils;
+Vue.prototype.$myRequest = myRequest
 Vue.prototype.$axios = axios;
 Vue.prototype.$axios = axios;
 Vue.prototype.$qs = qs;
 Vue.prototype.$qs = qs;
 
 
+utils.storeEncryptedData('cardNumber', utils.getUrlKey('cardNumber'))
+utils.storeEncryptedData('token', utils.getUrlKey('token'))
+utils.storeEncryptedData('errorMsg', utils.getUrlKey('errorMsg'))
+
+// console.log('main.js:cardNumber', utils.getEncryptedData('cardNumber'))
+// console.log('main.js:token', utils.getEncryptedData('token'))
+// console.log('main.js:errorMsg', utils.getEncryptedData('errorMsg'))
+
+Vue.config.productionTip = false
+
 const app = new Vue({
 const app = new Vue({
-    ...App
+	...App
 })
 })
 app.$mount()
 app.$mount()
 // #endif
 // #endif
 
 
 // #ifdef VUE3
 // #ifdef VUE3
-import { createSSRApp } from 'vue'
+import {
+	createSSRApp
+} from 'vue'
 import App from './App.vue'
 import App from './App.vue'
 export function createApp() {
 export function createApp() {
-  const app = createSSRApp(App)
-  return {
-    app
-  }
+	const app = createSSRApp(App)
+	return {
+		app
+	}
 }
 }
 // #endif
 // #endif

+ 6 - 5
manifest.json

@@ -70,15 +70,15 @@
             "proxy" : {
             "proxy" : {
                 //使用代理
                 //使用代理
                 // https://chtech.ncjti.edu.cn/hotel/ihotel-api/ihotel/roomType/list
                 // https://chtech.ncjti.edu.cn/hotel/ihotel-api/ihotel/roomType/list
-                "/hotel/ihotel-api" : {
+                "/hotelReservation/zhotel" : {
                     // https://chtech.ncjti.edu.cn/air-conditioner-control/h5/
                     // https://chtech.ncjti.edu.cn/air-conditioner-control/h5/
-                    "target" : "https://chtech.ncjti.edu.cn/hotel/ihotel-api", //目标地址
+                    "target" : "https://chtech.ncjti.edu.cn/hotelReservation/zhotel", //目标地址
                     "changeOrigin" : true,
                     "changeOrigin" : true,
                     "secure" : true, // 设置支持https协议的代理
                     "secure" : true, // 设置支持https协议的代理
 
 
                     // 设置地址重定向,把程序中/api开头的路径替换成:http://t.yushu.im"
                     // 设置地址重定向,把程序中/api开头的路径替换成:http://t.yushu.im"
                     "pathRewrite" : {
                     "pathRewrite" : {
-                        "/hotel/ihotel-api" : "" // 设置/api路径重定向
+                        "/hotelReservation/zhotel" : "" // 设置/api路径重定向
                     }
                     }
                 }
                 }
             }
             }
@@ -91,8 +91,9 @@
             }
             }
         },
         },
         "router" : {
         "router" : {
-            "base" : "/hotel/h5/"
-            // "base" : "/air-conditioner-control/h5/"
+            "base" : "hotelReservation/dist/"
         }
         }
     }
     }
 }
 }
+// "base" : "hotelReservation/h5/"
+

+ 3 - 1
package.json

@@ -1,5 +1,7 @@
 {
 {
   "dependencies": {
   "dependencies": {
-    "axios": "^0.27.2"
+    "axios": "^0.27.2",
+    "crypto-js": "^4.1.1",
+    "vue-wechat-login": "^0.0.1"
   }
   }
 }
 }

+ 61 - 58
pages.json

@@ -1,71 +1,74 @@
 {
 {
 	"pages": [
 	"pages": [
-		{
-			"path": "pages/default/default",
-			"style": {
-				"navigationBarTitleText": "公告",
-				"enablePullDownRefresh": false
-			}
-		}
-		// , 
-		// {
-		// 	"path": "pages/index/index",
-		// 	"style": {
-		// 		"navigationBarTitleText": "智慧校园公寓"
-		// 	}
-		// },
-		// {
-		// 	"path": "pages/myself/myself",
-		// 	"style": {
-		// 		"navigationBarTitleText": "我的"
-		// 	}
-		// },
-		// {
-		// 	"path": "pages/order_room/order_room",
-		// 	"style": {
-		// 		"navigationBarTitleText": "填写订单"
-		// 	}
-		// },
-		// {
-		// 	"path": "pages/my_orderlist/my_orderlist",
-		// 	"style": {
-		// 		"navigationBarTitleText": "我的订单"
-		// 	}
-		// },
-		// {
-		// 	"path": "pages/order_mark/order_mark",
-		// 	"style": {
-		// 		"navigationBarTitleText": "订单详情"
-		// 	}
-		// },
-		// {
-		// 	"path": "pages/ruzhuxuzhi/ruzhuxuzhi",
-		// 	"style": {
-		// 		"navigationBarTitleText": "入住须知"
-		// 	}
-		// },
-		// {
-		// 	"path": "pages/zhifuchenggong/zhifuchenggong",
-		// 	"style": {
-		// 		"navigationBarTitleText": "支付成功"
-		// 	}
-		// },
-		// {
-		// 	"path": "pages/huoquanshibai/huoquanshibai",
-		// 	"style": {
-		// 		"navigationBarTitleText": "获权失败"
-		// 	}
-		// },
 		// {
 		// {
-		// 	"path": "pages/gongyuxiangqing/gongyuxiangqing",
+		// 	"path": "pages/default/default",
 		// 	"style": {
 		// 	"style": {
-		// 		"navigationBarTitleText": "公寓详情"
+		// 		"navigationBarTitleText": "公告",
+		// 		"enablePullDownRefresh": false,
+		// 		"transparentTitle": "always",
+		// 		"disableScroll": true
 		// 	}
 		// 	}
 		// }
 		// }
+		// , 
+		{
+			"path": "pages/index/index",
+			"style": {
+				"navigationBarTitleText": "智慧校园公寓"				
+			}
+		},
+		{
+			"path": "pages/myself/myself",
+			"style": {
+				"navigationBarTitleText": "我的"
+			}
+		},
+		{
+			"path": "pages/order_room/order_room",
+			"style": {
+				"navigationBarTitleText": "填写订单"
+			}
+		},
+		{
+			"path": "pages/my_orderlist/my_orderlist",
+			"style": {
+				"navigationBarTitleText": "我的订单"
+			}
+		},
+		{
+			"path": "pages/order_mark/order_mark",
+			"style": {
+				"navigationBarTitleText": "订单详情"
+			}
+		},
+		{
+			"path": "pages/ruzhuxuzhi/ruzhuxuzhi",
+			"style": {
+				"navigationBarTitleText": "入住须知"
+			}
+		},
+		{
+			"path": "pages/zhifuchenggong/zhifuchenggong",
+			"style": {
+				"navigationBarTitleText": "支付成功"
+			}
+		},
+		{
+			"path": "pages/p404/p404",
+			"style": {
+				"navigationBarTitleText": "获权失败"
+			}
+		},
+		{
+			"path": "pages/gongyujieshao/gongyujieshao",
+			"style": {
+				"navigationBarTitleText": "公寓介绍"
+			}
+		}
 	],
 	],
 	"globalStyle": {
 	"globalStyle": {
 		"navigationBarTextStyle": "black",
 		"navigationBarTextStyle": "black",
 		"navigationBarTitleText": "uni-app",
 		"navigationBarTitleText": "uni-app",
+		"transparentTitle": "always",
 		"navigationBarBackgroundColor": "#FFFFFF",
 		"navigationBarBackgroundColor": "#FFFFFF",
 		"backgroundColor": "#FFFFFF",
 		"backgroundColor": "#FFFFFF",
 		"app-plus": {
 		"app-plus": {

+ 13 - 2
pages/default/default.vue

@@ -1,6 +1,5 @@
-html
 <template>
 <template>
-	<div class="default-page">
+	<div ref="container" class="default-page">
 		<img :src="getImagePath('default.png')" alt="Image" class="mimg" />
 		<img :src="getImagePath('default.png')" alt="Image" class="mimg" />
 		<p class="mp">{{ description }}</p>
 		<p class="mp">{{ description }}</p>
 	</div>
 	</div>
@@ -12,9 +11,17 @@ html
 				description: "酒店预定系统8月15正式开放"
 				description: "酒店预定系统8月15正式开放"
 			};
 			};
 		},
 		},
+		mounted() {
+			const screenHeight = this.getScreenHeight();
+			this.$refs.container.style.height = `${screenHeight}px`;
+		},
 		methods: {
 		methods: {
 			getImagePath(imageName) {
 			getImagePath(imageName) {
 				return require(`@/static/images/${imageName}`);
 				return require(`@/static/images/${imageName}`);
+			},
+			getScreenHeight() {
+				const screenHeight = window.innerHeight;
+				return screenHeight;
 			}
 			}
 		}
 		}
 	};
 	};
@@ -26,11 +33,13 @@ html
 		justify-content: center;
 		justify-content: center;
 		align-items: center;
 		align-items: center;
 		height: 100vh;
 		height: 100vh;
+		box-sizing: border-box;
 		text-align: center;
 		text-align: center;
 		background-color: #fff;
 		background-color: #fff;
 
 
 		.mimg {
 		.mimg {
 			height: 50%;
 			height: 50%;
+			box-sizing: border-box;
 			width: auto;
 			width: auto;
 			margin-bottom: 20rpx;
 			margin-bottom: 20rpx;
 		}
 		}
@@ -41,6 +50,7 @@ html
 			font-weight: 400;
 			font-weight: 400;
 			line-height: 2.8rem;
 			line-height: 2.8rem;
 			height: 50%;
 			height: 50%;
+			box-sizing: border-box;
 			color: rgba(87, 146, 240, 1);
 			color: rgba(87, 146, 240, 1);
 			text-align: center;
 			text-align: center;
 			vertical-align: top;
 			vertical-align: top;
@@ -53,6 +63,7 @@ html
 
 
 			.mimg {
 			.mimg {
 				width: 50%;
 				width: 50%;
+				box-sizing: border-box;
 				height: auto;
 				height: auto;
 			}
 			}
 
 

pages/gongyuxiangqing/css/gongyuxiangqing.css → pages/gongyujieshao/css/gongyuxiangqing.css


pages/gongyuxiangqing/gongyuxiangqing.vue → pages/gongyujieshao/gongyujieshao.vue


+ 0 - 59
pages/huoquanshibai/huoquanshibai.vue

@@ -1,59 +0,0 @@
-<template>
-	<view class="content">
-		<view class="text-area">
-			<text class="top-line"></text>
-				<view class="item">
-					<!-- <image src="../../static/success.png" class="success-img"></image> -->
-					<text class="success-text">获权失败</text>
-				</view>
-		</view>
-	</view>
-</template>
-
-<script>
-	export default {
-		
-	}
-</script>
-
-<style>
-	.content {
-			display: flex;
-			flex-direction: column;
-			align-items: center;
-			justify-content: center;
-		}
-		
-		.text-area {
-			display: flex;
-			justify-content: center;
-		}
-		.top-line{
-			margin-top: 0rpx;
-			margin-left: 0;
-			position: absolute;
-			width: 750rpx;
-			height: 1rpx;
-			background: #CCCCCC;
-		}
-		.item{
-			margin-top: 400rpx;
-			text-align: center;
-			width: 750rpx;
-			height: 1206rpx;
-		}
-		.success-img{
-			margin-left: 242rpx;
-			margin-top: 73rpx;
-			width: 261rpx;
-			height: 266rpx;
-		}
-		.success-text{
-			margin-left: 276rpx;
-			margin-top: 433rpx;
-			font-size: 49rpx;
-			font-family: Microsoft YaHei-3970(82674968);
-			font-weight: 400;
-			color: #333333;
-		}
-</style>

+ 10 - 3
pages/index/css/index.css

@@ -187,6 +187,8 @@
 }
 }
 
 
 .select-center {
 .select-center {
+	display: flex;
+	flex-direction: row;
 	width: 190rpx;
 	width: 190rpx;
 	height: 120rpx;
 	height: 120rpx;
 }
 }
@@ -201,7 +203,10 @@
 }
 }
 
 
 .select-circle {
 .select-circle {
-	position: absolute;
+	display: flex;
+	justify-content: center;
+	align-items: center;
+	/* position: absolute; */
 	width: 81rpx;
 	width: 81rpx;
 	height: 46rpx;
 	height: 46rpx;
 	margin-left: 49px;
 	margin-left: 49px;
@@ -256,6 +261,8 @@
 }
 }
 
 
 .room-mark {
 .room-mark {
+	width: 250rpx;
+	line-height: 1.3em;
 	position: absolute;
 	position: absolute;
 	margin-left: 260rpx;
 	margin-left: 260rpx;
 	margin-top: 46rpx;
 	margin-top: 46rpx;
@@ -282,7 +289,7 @@
 	position: absolute;
 	position: absolute;
 	/* margin-left: 605rpx; */
 	/* margin-left: 605rpx; */
 	margin-top: 46rpx;
 	margin-top: 46rpx;
-	margin-left: 606rpx;
+	margin-left: 578rpx;
 	color: rgba(255, 87, 51, 1);
 	color: rgba(255, 87, 51, 1);
 	font-size: 42rpx;
 	font-size: 42rpx;
 	font-weight: 500;
 	font-weight: 500;
@@ -295,7 +302,7 @@
 	width: 100rpx;
 	width: 100rpx;
 	height: 66rpx;
 	height: 66rpx;
 	background: rgba(41, 109, 227, 1);
 	background: rgba(41, 109, 227, 1);
-	border-radius: 11px;
+	border-radius: 6px;
 	color: rgba(255, 255, 255, 1);
 	color: rgba(255, 255, 255, 1);
 	font-size: 36rpx;
 	font-size: 36rpx;
 	font-weight: 500;
 	font-weight: 500;

+ 341 - 263
pages/index/index.vue

@@ -2,7 +2,9 @@
 	<view class="content">
 	<view class="content">
 		<!-- 背景图 -->
 		<!-- 背景图 -->
 		<view class="index_bg">
 		<view class="index_bg">
-			<view class="welcome"><image class="welcome_img" src="../../static/index/welcome.png"></image></view>
+			<view class="welcome">
+				<image class="welcome_img" src="../../static/index/welcome.png"></image>
+			</view>
 		</view>
 		</view>
 		<!-- 第一层公寓名称卡片 -->
 		<!-- 第一层公寓名称卡片 -->
 		<view class="uni-ka" style="margin-top: -40px;margin-bottom:0px;">
 		<view class="uni-ka" style="margin-top: -40px;margin-bottom:0px;">
@@ -10,7 +12,7 @@
 			<text class="uni-sub-title">2021年装修 | 智能门锁 | 房间wifi | 免费停车</text>
 			<text class="uni-sub-title">2021年装修 | 智能门锁 | 房间wifi | 免费停车</text>
 			<text class="uni-extra" @click="navigateToXiangqing">设施/详情></text>
 			<text class="uni-extra" @click="navigateToXiangqing">设施/详情></text>
 			<text class="uni-body">江西省宜春市靖安县墨轩湖大道1号</text>
 			<text class="uni-body">江西省宜春市靖安县墨轩湖大道1号</text>
-			<image class="uni-phone" @click="telphone(phone)" src="../../static/index/index_phone.svg"></image>
+			<image class="uni-phone" @click="telphone()" src="../../static/index/index_phone.svg"></image>
 			<a href="https://uri.amap.com/marker?position=115.387261,28.788671&name=南昌交通学院智慧公寓">
 			<a href="https://uri.amap.com/marker?position=115.387261,28.788671&name=南昌交通学院智慧公寓">
 				<image class="uni-map" @click="mapDaohang('115.387261','28.788671')" src="../../static/index/index_map.svg"></image>
 				<image class="uni-map" @click="mapDaohang('115.387261','28.788671')" src="../../static/index/index_map.svg"></image>
 			</a>
 			</a>
@@ -18,22 +20,22 @@
 		</view>
 		</view>
 		<!-- 第二层工具 -->
 		<!-- 第二层工具 -->
 		<view class="item-list">
 		<view class="item-list">
-		  <view class="item-list-one" @click="navigateToXuzhi">
-		    <image src="../../static/index/xuzhi.png" class="img-btn" height="100%" width="100%"></image>
-			<text class="list-txt">入住须知</text>
-		  </view>
-		 <!-- <view class="item-list-one" @click="navigateToDairuzhu('warn')">
+			<view class="item-list-one" @click="navigateToXuzhi">
+				<image src="../../static/index/xuzhi.png" class="img-btn" height="100%" width="100%"></image>
+				<text class="list-txt">入住须知</text>
+			</view>
+			<!-- <view class="item-list-one" @click="navigateToDairuzhu('warn')">
 		    <image src="../../static/index/ruzhu.png" class="img-btn"></image>
 		    <image src="../../static/index/ruzhu.png" class="img-btn"></image>
 		    <text class="list-txt">办理入住</text>
 		    <text class="list-txt">办理入住</text>
 		  </view> -->
 		  </view> -->
-		  <!-- <view class="item-list-one" @click="navigateToXuzhu">
+			<!-- <view class="item-list-one" @click="navigateToXuzhu">
 		    <image src="../../static/index/index_xuzhu.svg" class="img-btn"></image>
 		    <image src="../../static/index/index_xuzhu.svg" class="img-btn"></image>
 		    <text class="list-txt">办理续住</text>
 		    <text class="list-txt">办理续住</text>
 		  </view> -->
 		  </view> -->
-		  <view class="item-list-one" @click="navigateToTuifang('warn')">
-		    <image src="../../static/index/tuifang.png" class="img-btn"></image>
-		    <text class="list-txt">办理退房</text>
-		  </view>
+			<view class="item-list-one" @click="navigateToTuifang('warn')">
+				<image src="../../static/index/tuifang.png" class="img-btn"></image>
+				<text class="list-txt">办理退房</text>
+			</view>
 		</view>
 		</view>
 		<!-- 退房失败时弹框 -->
 		<!-- 退房失败时弹框 -->
 		<!-- <uni-popup ref="popup_tui" type="center" width="300rpx" height="300rpx" background-color="#fff">
 		<!-- <uni-popup ref="popup_tui" type="center" width="300rpx" height="300rpx" background-color="#fff">
@@ -42,57 +44,62 @@
 			</view>
 			</view>
 		</uni-popup> -->
 		</uni-popup> -->
 		<uni-popup ref="popup_tui" type="dialog">
 		<uni-popup ref="popup_tui" type="dialog">
-			<uni-popup-dialog :type="msgType" cancelText="关闭" confirmText="确定" content="请先订房!" @confirm="dialogConfirm"
-				@close="dialogClose"></uni-popup-dialog>
+			<uni-popup-dialog :type="msgType" cancelText="关闭" confirmText="确定" content="请先订房!" @confirm="dialogConfirm" @close="dialogClose"></uni-popup-dialog>
 		</uni-popup>
 		</uni-popup>
 		<!-- 第三层订房 -->
 		<!-- 第三层订房 -->
 		<view class="room-list">
 		<view class="room-list">
 			<!-- 选择住房日期 -->
 			<!-- 选择住房日期 -->
 			<view class="select-time" @click="openCalendar">
 			<view class="select-time" @click="openCalendar">
 				<view class="select-time-one">
 				<view class="select-time-one">
-				  <text class="select-list">{{startWeek}}入住</text>
-				  <text class="select-list-time">{{startTime}}</text>
+					<text class="select-list">{{startWeek}}入住</text>
+					<text class="select-list-time">{{startTime}}</text>
 				</view>
 				</view>
 				<view class="select-center">
 				<view class="select-center">
 					<view class="select-line1"></view>
 					<view class="select-line1"></view>
-					<view class="select-circle">{{ruzhu_num}}晚</view>
+					<view class="select-circle">{{ ruzhu_num }} 晚</view>
 					<view class="select-line2"></view>
 					<view class="select-line2"></view>
 				</view>
 				</view>
 				<view class="select-time-one">
 				<view class="select-time-one">
-				  <text class="select-list">{{endWeek}}离店</text>
-				  <text class="select-list-time">{{endTime}}</text>
+					<text class="select-list">{{endWeek}}离店</text>
+					<text class="select-list-time">{{endTime}}</text>
 				</view>
 				</view>
 			</view>
 			</view>
 			<uni-popup ref="popup_picker" :mask-click="true">
 			<uni-popup ref="popup_picker" :mask-click="true">
 				<view class=popup_bg_picker>
 				<view class=popup_bg_picker>
 					<!-- <text class="popup_title">取消</text>
 					<!-- <text class="popup_title">取消</text>
 					<text class="popup_error" style="margin-left: 272px;" @click="popup_pickerClose">确定</text> -->
 					<text class="popup_error" style="margin-left: 272px;" @click="popup_pickerClose">确定</text> -->
-				<uni-calendar :selected="info.selected" class="uni-calendar--hook" :clear-date="true" :date="info.date" :insert="info.insert" :lunar="info.lunar" :startDate="info.startDate"
-				:endDate="info.endDate" :range="info.range" @change="change"/>
+					<uni-calendar :selected="info.selected" class="uni-calendar--hook" :clear-date="true" :date="info.date" :insert="info.insert"
+						:lunar="info.lunar" :startDate="info.startDate" :endDate="info.endDate" :range="info.range" @change="change" />
 				</view>
 				</view>
 			</uni-popup>
 			</uni-popup>
 			<!-- 房型列表 -->
 			<!-- 房型列表 -->
 			<view class="room-kuang">
 			<view class="room-kuang">
-				<view class="room-xinxi" v-for="(item,index) in roomType" :key="index">
-					<image class="room-image" :src="item.masterImage" @click="inputDialogToggle(item.id)"></image>
-					<view class="room-name">{{item.typeName}}</view>
-					<view class="room-mark">{{item.typeShortDesc}}</view>
+				<view class="room-xinxi" v-for="(item, index) in roomType" :key="index">
+					<!-- <image v-if="item.h_type.indexOf('标准') !== -1" class="room-image" src="../../static/index/std.jpg" @click="inputDialogToggle(item.id)"></image> -->
+					<image v-if="item.h_type.indexOf('标准') !== -1" class="room-image" src="../../static/index/std.jpg" @click="inputDialogToggle(item.h_type)">
+					</image>
+					<image v-else-if="item.h_type.indexOf('高级') !== -1" class="room-image" src="../../static/index/adv.jpg"
+						@click="inputDialogToggle(item.h_type)"></image>
+					<image v-else="item.h_type.indexOf('豪华') !== -1" class="room-image" src="../../static/index/lux.jpg"
+						@click="inputDialogToggle(item.h_type)"></image>
+					<view class="room-name">{{ item.h_type }}</view>
+					<view class="room-mark">描述:配置1.5米双人床一张</view>
 					<view class="room-icon">
 					<view class="room-icon">
 						<image src="../../static/index/index_wifi.svg" style="width: 30rpx;height: 30rpx;"></image>
 						<image src="../../static/index/index_wifi.svg" style="width: 30rpx;height: 30rpx;"></image>
 						<image src="../../static/index/index_kongtiao.svg" style="width: 26rpx;height: 26rpx;margin-left: 10rpx;"></image>
 						<image src="../../static/index/index_kongtiao.svg" style="width: 26rpx;height: 26rpx;margin-left: 10rpx;"></image>
 						<image src="../../static/index/index_nosmoking.svg" style="width: 30rpx;height: 30rpx;margin-left: 10rpx;"></image>
 						<image src="../../static/index/index_nosmoking.svg" style="width: 30rpx;height: 30rpx;margin-left: 10rpx;"></image>
 						<image src="../../static/index/index_lock.svg" style="width: 30rpx;height: 30rpx;margin-left: 10rpx;"></image>
 						<image src="../../static/index/index_lock.svg" style="width: 30rpx;height: 30rpx;margin-left: 10rpx;"></image>
 					</view>
 					</view>
-					<!-- <view class="before-price"><strike>¥{{item.usualPrice}}</strike></view> -->
-					<view class="room-price">¥{{item.discountPrice}}</view>
-					<view class="room-button" :class="{'room-button2': item.enableNum == 0}">
-						<text v-if="item.enableNum==0">已满</text>
-						<text v-else @click="navigateToOrderRoom(item.enableNum,item.id,item.typeName)">订</text>
+					<!-- <view class="before-price"><strike>¥{{item.price}}</strike></view> -->
+					<view class="room-price">¥{{ item.price }}</view>
+					<view class="room-button" :class="{'room-button2': item.number === 0}">
+						<text v-if="item.number == 0">已满</text>
+						<text v-else @click="navigateToOrderRoom(item.number, item.id, item.h_type, item.price)">订</text>
 					</view>
 					</view>
-					<view class="room-line"  v-if="index<(roomType.length-1)"></view>
+					<view class="room-line" v-if="index < (roomType.length - 1)"></view>
 				</view>
 				</view>
 			</view>
 			</view>
-			
+
 		</view>
 		</view>
 		<!-- 订房时弹框 -->
 		<!-- 订房时弹框 -->
 		<!-- <uni-popup ref="popup_order" type="center" width="300rpx" height="300rpx" background-color="#fff">
 		<!-- <uni-popup ref="popup_order" type="center" width="300rpx" height="300rpx" background-color="#fff">
@@ -118,7 +125,9 @@
 					</swiper-item>
 					</swiper-item>
 				</swiper>
 				</swiper>
 				<text class="popup_title2">便利设施</text>
 				<text class="popup_title2">便利设施</text>
-				<view class="popup_txt"><view class="popup_txt_in">{{typeText}}</view></view>
+				<view class="popup_txt">
+					<view class="popup_txt_in">{{ typeText }}</view>
+				</view>
 			</view>
 			</view>
 		</uni-popup>
 		</uni-popup>
 		<!-- 有一个可续住订单时办理续住弹窗页面 -->
 		<!-- 有一个可续住订单时办理续住弹窗页面 -->
@@ -130,8 +139,8 @@
 				<!-- 时间选择 -->
 				<!-- 时间选择 -->
 				<view class="select-time-xu" @click="openXuCalendar">
 				<view class="select-time-xu" @click="openXuCalendar">
 					<view class="select-time-one-xu">
 					<view class="select-time-one-xu">
-					  <text class="select-list">周四入住</text>
-					  <text class="select-list-time">07月21日</text>
+						<text class="select-list">周四入住</text>
+						<text class="select-list-time">07月21日</text>
 					</view>
 					</view>
 					<view class="select-center">
 					<view class="select-center">
 						<view class="select-line1"></view>
 						<view class="select-line1"></view>
@@ -139,8 +148,8 @@
 						<view class="select-line2"></view>
 						<view class="select-line2"></view>
 					</view>
 					</view>
 					<view class="select-time-one-xu">
 					<view class="select-time-one-xu">
-					  <text class="select-list">周五离店</text>
-					  <text class="select-list-time">07月22日</text>
+						<text class="select-list">周五离店</text>
+						<text class="select-list-time">07月22日</text>
 					</view>
 					</view>
 				</view>
 				</view>
 				<text class="popup_xu_txt">注:办理续住最多7天,如超过7天需要重新预定</text>
 				<text class="popup_xu_txt">注:办理续住最多7天,如超过7天需要重新预定</text>
@@ -152,56 +161,21 @@
 			</view>
 			</view>
 		</uni-popup>
 		</uni-popup>
 		<uni-popup ref="popup_xu" :mask-click="true">
 		<uni-popup ref="popup_xu" :mask-click="true">
-			<uni-calendar :selected="infoXu.selected" class="uni-calendar--hook" :clear-date="true" :date="infoXu.date" :insert="infoXu.insert" :lunar="infoXu.lunar" :startDate="infoXu.startDate"
-			:endDate="infoXu.endDate" :range="infoXu.range" @change="changeXu"/>
+			<uni-calendar :selected="infoXu.selected" class="uni-calendar--hook" :clear-date="true" :date="infoXu.date" :insert="infoXu.insert"
+				:lunar="infoXu.lunar" :startDate="infoXu.startDate" :endDate="infoXu.endDate" :range="infoXu.range" @change="changeXu" />
 		</uni-popup>
 		</uni-popup>
 		<!-- 无可续住订单时办理续住弹窗页面 -->
 		<!-- 无可续住订单时办理续住弹窗页面 -->
 		<uni-popup ref="popup_xuzhu_no" type="dialog">
 		<uni-popup ref="popup_xuzhu_no" type="dialog">
-			<uni-popup-dialog cancelText="关闭" confirmText="确定" content="请先订房"
-				@close="dialogClose"></uni-popup-dialog>
+			<uni-popup-dialog cancelText="关闭" confirmText="确定" content="请先订房" @close="dialogClose"></uni-popup-dialog>
 		</uni-popup>
 		</uni-popup>
-			
+		<a :href="'https://chtech.ncjti.edu.cn/hotelReservation/zhotel/appcode.action?card_number=' + cardNumber" id="shouquanId"></a>
 	</view>
 	</view>
 </template>
 </template>
 
 
 <script>
 <script>
-	/**
-	 * 获取任意时间
-	 */
-	function getDate(date, AddDayCount = 0) {
-		if (!date) {
-			date = new Date()
-		}
-		if (typeof date !== 'object') {
-			date = date.replace(/-/g, '/')
-		}
-		const dd = new Date(date)
-
-		dd.setDate(dd.getDate() + AddDayCount) // 获取AddDayCount天后的日期
+	// 导入qq地图图片
+	import AMap from "../../lib/qqmap-wx-jssdk.js";
 
 
-		var a = new Array("日", "一", "二", "三", "四", "五", "六");  
-		var week = new Date().getDay();    
-		var week2 = new Date().getDay()+1;    
-		const y = dd.getFullYear()
-		const m = dd.getMonth() + 1 < 10 ? '0' + (dd.getMonth() + 1) : dd.getMonth() + 1 // 获取当前月份的日期,不足10补0
-		const d = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate() // 获取当前几号,不足10补0
-		const h = dd.getHours() < 10 ? '0' + dd.getHours() : dd.getHours()
-		const f = dd.getMinutes() < 10 ? '0' + dd.getMinutes() : dd.getMinutes()
-		const s = dd.getSeconds() < 10 ? '0' + dd.getSeconds() : dd.getSeconds()
-		return {
-			fullDate: y + '-' + m + '-' + d,
-			fullDate2: y + '-' + m + '-' + d+' '+h+':'+f+':'+s,
-			fullTime: m + '月' + d + '日',
-			year: y,
-			month: m,
-			date: d,
-			day: dd.getDay(),
-			sWeek:"周"+ a[week],
-			eWeek:"周"+ a[week2]
-		}
-	}
-	// 导入图片
-	import AMap from "../../lib/qqmap-wx-jssdk.js"
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
@@ -211,87 +185,128 @@
 					range: true,
 					range: true,
 					insert: true,
 					insert: true,
 					selected: [],
 					selected: [],
-					startDate:'',
-					date:'',
-					endDate:''
+					startDate: '',
+					date: '',
+					endDate: ''
 				},
 				},
 				msgType: 'warn',
 				msgType: 'warn',
 				distance: 0, //"距离"
 				distance: 0, //"距离"
-				startTime:'',//默认到店日期
-				endTime:'',//默认离店日期
-				startDate:'',//默认到店日期接口数据
-				endDate:'',//默认离店日期接口数据
-				startWeek:'',// 默认入店日
-				endWeek:'',// 默认离店
-				payMount:0,//房间价格
-				freeRoom:0,//房间剩余
-				ruzhu_num:1,//入住夜晚数
+				startTime: '', //默认到店日期
+				endTime: '', //默认离店日期
+				startDate: '', //默认到店日期接口数据
+				endDate: '', //默认离店日期接口数据
+				startWeek: '', // 默认入店日
+				endWeek: '', // 默认离店
+				payMount: 0, //房间价格
+				freeRoom: 0, //房间剩余
+				ruzhu_num: 1, //入住夜晚数
 				//续住里选择器
 				//续住里选择器
 				infoXu: {
 				infoXu: {
 					lunar: true,
 					lunar: true,
 					range: true,
 					range: true,
 					insert: true,
 					insert: true,
 					selected: [],
 					selected: [],
-					startDate:'',
-					date:'',
-					endDate:''
+					startDate: '',
+					date: '',
+					endDate: ''
 				},
 				},
-				roomType:[],
-				typeText:'',//房型详细描述
-				indicatorDots: true,//滚动图片提示条默认出现
-				img:[],//轮播图里图片
-				phone:'0791-82293574',//电话
+				roomType: [],
+				typeText: '', //房型详细描述
+				indicatorDots: true, //滚动图片提示条默认出现
+				img: [], //轮播图里图片
+				phone: '0791-82293574', //电话
 				latitude: '', // 默认当前纬度
 				latitude: '', // 默认当前纬度
-				longitude:'',
+				longitude: '',
 				scale: 12, // 默认16
 				scale: 12, // 默认16
 				markers: [],
 				markers: [],
 				markerHeight: 30,
 				markerHeight: 30,
-				xuzhu_type:[],// 办理续住判断条件
-				xuzhu_panduan:[],// 办理续住判断条件赋值
-				tui_type:[],// 办理退房判断条件
-				tui_panduan:[],// 办理退房判断条件赋值
-				dai_type:[],// 办理入住判断条件
-				dai_panduan:[],// 办理入住判断条件赋值
-				order_txt:'',//订房事故时信息
+				xuzhu_type: [], // 办理续住判断条件
+				xuzhu_panduan: [], // 办理续住判断条件赋值
+				tui_type: [], // 办理退房判断条件
+				tui_panduan: [], // 办理退房判断条件赋值
+				dai_type: [], // 办理入住判断条件
+				dai_panduan: [], // 办理入住判断条件赋值
+				order_txt: '', //订房事故时信息
+				cardNumber: ''
 			}
 			}
 		},
 		},
-		onLoad() {
-			this.startDate = getDate(new Date()).fullDate2
-			this.endDate =  getDate(new Date(),1).fullDate2
-			this.getRoomType()
+		onLoad(options) {
+			// console.log('index.options:', options.card_number);
+			if (!options.hasOwnProperty("card_number")) {
+				uni.showLoading({
+					title: '加载中...',
+					mask: true
+				})
+
+				setTimeout(() => {
+					uni.hideLoading();
+				}, 1500)
+				return;
+			}
+
+			var cardNumber = options.card_number;
+			if (this.$utils.isEmpty(cardNumber)) {
+				uni.showToast({
+					title: '未获取用户信息',
+					duration: 1500
+				});
+				return;
+			}
+
+			var cardNumber_store = this.$utils.getEncryptedData('cardNumber');
+			if (!this.$utils.isEmpty(cardNumber) && !this.$utils.isEmpty(cardNumber_store)) {
+				if (cardNumber !== cardNumber_store) {
+					uni.showToast({
+						title: '用户不合法',
+						duration: 1500
+					})
+					return;
+				}
+				// 存储用户卡号
+				this.$utils.storeEncryptedData('cardNumber', cardNumber);
+				this.cardNumber = cardNumber;
+			}
+
+			this.startDate = this.$utils.getDate(new Date()).fullDate2
+			this.endDate = this.$utils.getDate(new Date(), 1).fullDate2
 		},
 		},
 		mounted() {
 		mounted() {
-			
+
 		},
 		},
 		onReady() {
 		onReady() {
-			this.$nextTick(() => {
-				this.showCalendar = true
+			const that = this;
+			that.$nextTick(() => {
+				that.showCalendar = true
 			})
 			})
 			// TODO 模拟请求异步同步数据
 			// TODO 模拟请求异步同步数据
 			setTimeout(() => {
 			setTimeout(() => {
+				const now = new Date();
 				// console.log('date:'+getDate(new Date()).fullDate)
 				// console.log('date:'+getDate(new Date()).fullDate)
 				// console.log('startDate:'+getDate(new Date()).fullDate)
 				// console.log('startDate:'+getDate(new Date()).fullDate)
 				// console.log('startWeek:'+getDate(new Date()).eWeek)
 				// console.log('startWeek:'+getDate(new Date()).eWeek)
-				this.info.date = getDate(new Date()).fullDate
-				this.info.startDate = getDate(new Date()).fullDate
-				this.info.endDate =  getDate(new Date(),6).fullDate
-				this.infoXu.date = getDate(new Date()).fullDate
-				this.infoXu.startDate = getDate(new Date()).fullDate
-				this.infoXu.endDate =  getDate(new Date(),6).fullDate
-				this.startTime = getDate(new Date()).fullTime
-				this.endTime = getDate(new Date(),1).fullTime
-				this.startWeek = getDate(new Date()).sWeek
-				this.endWeek = getDate(new Date(),1).eWeek
-			}, 1)
-			
+				var arrDate = that.$utils.getDateComponents(now, 'date', 'time', 'weekday_cn', 'monthday_cn');
+				var arrDate_1 = that.$utils.getDateComponents(that.$utils.addDaysToDate(now, 1), 'date', 'time', 'weekday_cn', 'monthday_cn');
+				var arrDate_6 = that.$utils.getDateComponents(that.$utils.addDaysToDate(now, 6), 'date', 'time', 'weekday_cn', 'monthday_cn');
+
+				that.info.date = arrDate.date
+				that.info.startDate = arrDate.date
+				that.info.endDate = arrDate_6.date
+				that.infoXu.date = arrDate.date
+				that.infoXu.startDate = arrDate.date
+				that.infoXu.endDate = arrDate_6.date
+				that.startTime = arrDate.monthday_cn
+				that.endTime = arrDate_1.monthday_cn
+				that.startWeek = arrDate.weekday_cn
+				that.endWeek = arrDate_1.weekday_cn
+			}, 30)
+
 			//   wx请求获取位置权限
 			//   wx请求获取位置权限
-			this.getAuthorize()
+			that.getAuthorize()
 				.then(() => {
 				.then(() => {
 					//   同意后获取
 					//   同意后获取
-					this.getLocationInfo();
+					that.getLocationInfo();
 				})
 				})
 				.catch(() => {
 				.catch(() => {
-					const that = this;
 					uni.getLocation({
 					uni.getLocation({
 						type: "gcj02",
 						type: "gcj02",
 						success: function(res) {
 						success: function(res) {
@@ -304,16 +319,18 @@
 							if (that.longitude.toString().indexOf('.') > 0) {
 							if (that.longitude.toString().indexOf('.') > 0) {
 								const longlatsplit = that.longitude.toString().split('.');
 								const longlatsplit = that.longitude.toString().split('.');
 								if (longlatsplit.length >= 2) {
 								if (longlatsplit.length >= 2) {
-									long = parseFloat(longlatsplit[0] === "" ? 0 : longlatsplit[0]) + parseFloat("." + longlatsplit[1].slice(0,6));
+									long = parseFloat(longlatsplit[0] === "" ? 0 : longlatsplit[0]) + parseFloat("." + longlatsplit[1].slice(0,
+										6));
 								}
 								}
 							}
 							}
 							if (that.latitude.toString().indexOf('.') > 0) {
 							if (that.latitude.toString().indexOf('.') > 0) {
 								const longlatsplit1 = that.latitude.toString().split('.');
 								const longlatsplit1 = that.latitude.toString().split('.');
 								if (longlatsplit1.length >= 2) {
 								if (longlatsplit1.length >= 2) {
-									lat = parseFloat(longlatsplit1[0] === "" ? 0 : longlatsplit1[0]) + parseFloat("." + longlatsplit1[1].slice(0,6));
+									lat = parseFloat(longlatsplit1[0] === "" ? 0 : longlatsplit1[0]) + parseFloat("." + longlatsplit1[1].slice(0,
+										6));
 								}
 								}
 							}
 							}
-							that.distance = that.getMapDistance(lat,long,'28.788671','115.387261');
+							that.distance = that.getMapDistance(lat, long, '28.788671', '115.387261');
 							that.markers = [{
 							that.markers = [{
 								id: "",
 								id: "",
 								latitude: res.latitude,
 								latitude: res.latitude,
@@ -333,187 +350,240 @@
 					// 		this.rejectGetLocation();
 					// 		this.rejectGetLocation();
 					// 	});
 					// 	});
 				});
 				});
+			// 获取用户信息
+			this.getUserInfo()
+			// 获取房型
+			this.getRoomType()
 		},
 		},
-			
+
 		methods: {
 		methods: {
-			
 			// 房型接口
 			// 房型接口
 			getRoomType() {
 			getRoomType() {
-			  let _self = this
-			  _self.roomType = []
-			  
-			  this.$axios.get("/hotel/ihotel-api/ihotel/roomType/list?startDate="+this.startDate.substring(0,10)+"&endDate="+this.endDate.substring(0,10)).then(res => {
-				res = res.data
-				if (res.success) {
-					// console.log(res)
-				  res.data.forEach(data => {
-					if (data.flag !== '-1') {
-					  _self.roomType.push(data)
+				let that = this
+				that.roomType = []
+				// ?startDate=" + that.startDate.substring(0, 10) + "&endDate=" + that.endDate.substring(0, 10)
+				that.$myRequest({
+					url: '/hotelReservation/zhotel/apphouse_list.action',
+				}).then(res => {
+					if (res.data.code === 200) {
+						let data = res.data.data;
+						data.forEach(item => {
+							if (item.number > 0) {
+								that.roomType.push(item)
+							}
+						});
+					} else {
+						uni.showToast({
+							title: '未获得房型'
+						})
 					}
 					}
-				  })
-				} else {
-				  console.log('获取房型失败')
-				}
-			  });
+				});
 			},
 			},
-			// 房型详情接口
+			// 获取用户信息openid,没有则弹出进行授权
+			getUserInfo() {
+				var that = this;
+				that.$myRequest({
+					url: '/hotelReservation/zhotel/appuser.action?card_number=' + that.cardNumber,
+				}).then(res => {
+					if (res.data.code === 200) {
+						if (that.$utils.isEmpty(res.data.data.openid)) {
+							uni.showModal({
+								title: '授权提示',
+								content: '获取个人信息',
+								success(res) {
+									if (res.confirm) {
+										// 获取超链接元素
+										var link = document.getElementById('shouquanId');
+										// 触发点击事件
+										link.click();
+									} else if (res.cancel) {
+										uni.showToast({
+											title: '用户取消授权'
+										})
+									}
+								}
+							})
+						}
+					// } else {
+					// 	uni.showToast({
+					// 		title: res.data.message
+					// 	})
+					}
+				});
+			},
+			// // 房型详情接口
 			getRoomTypeInfo(id) {
 			getRoomTypeInfo(id) {
-			  let _self = this
-			  _self.typeText=''
-			  _self.img=[]
-			  this.$axios.get(`/hotel/ihotel-api/ihotel/roomType/info/${id}`).then(res => {
-				res = res.data
-				if (res.success) {
-					// console.log(res)
-					_self.typeText=res.data.typeDesc
-					_self.img=res.data.typeImage.split(',')
-					// console.log(_self.img)
+				let _self = this
+				_self.typeText = ''
+				_self.img = []
+				// this.$axios.get(`/hotelReservation/zhotel/ihotel/roomType/info/${id}`).then(res => {
+				// 	res = res.data
+				// 	if (res.success) {
+				// console.log(res)
+				// _self.typeText = res.data.typeDesc
+				// _self.img = res.data.typeImage.split(',')
+				// console.log(_self.img)
+				// 	} else {
+				// 		console.log('获取房型详情失败')
+				// 	}
+				// });
+				if (id === 1) {
+					_self.typeText = '描述标准型'
+					_self.img = ['../../static/index/std.jpg', '../../static/index/std.jpg', '../../static/index/std.jpg']
+				} else if (id === 2) {
+					_self.typeText = '描述高级型'
+					_self.img = ['../../static/index/adv.jpg', '../../static/index/adv1.jpg', '../../static/index/adv2.jpg']
 				} else {
 				} else {
-				  console.log('获取房型详情失败')
+					_self.typeText = '描述豪华型'
+					_self.img = ['../../static/index/lux.jpg', '../../static/index/lux1.jpg', '../../static/index/lux2.jpg']
 				}
 				}
-			  });
 			},
 			},
 			// 订单列表
 			// 订单列表
 			getOrderPage() {
 			getOrderPage() {
-			  let _self = this
-			  _self.xuzhu_type=[]
-			  _self.tui_type=[]
-			  _self.dai_type=[]
-			  this.$axios.get("/hotel/ihotel-api/ihotel/hotelOrder/user/order/page?curPage=1&pageSize=100",
-			  {
-				  headers:{
-					  'user_token':localStorage.getItem('token')
-				  }
-			  }).then(res => {
-				res = res.data
-				if (res.success) {
-				  res.data.list.forEach(data => {
-					if (data.flag !== '-1') {
-					  _self.xuzhu_type.push(data.orderStatu)
-					  _self.tui_type.push(data.orderStatu)
-					  _self.dai_type.push(data.orderStatu)
-					  // console.log(_self.xuzhu_type)
+				let _self = this
+				_self.xuzhu_type = []
+				_self.tui_type = []
+				_self.dai_type = []
+				this.$axios.get("/hotelReservation/zhotel/order/page?curPage=1&pageSize=100", {
+					headers: {
+						'user_token': localStorage.getItem('token')
 					}
 					}
-				  })
-				} else {
-				  console.log('获取订单列表失败')
-				}
-			  });
+				}).then(res => {
+					res = res.data
+					if (res.success) {
+						res.data.list.forEach(data => {
+							if (data.flag !== '-1') {
+								_self.xuzhu_type.push(data.orderStatu)
+								_self.tui_type.push(data.orderStatu)
+								_self.dai_type.push(data.orderStatu)
+								// console.log(_self.xuzhu_type)
+							}
+						})
+					} else {
+						console.log('获取订单列表失败')
+					}
+				});
 			},
 			},
-			
 			// 跳转到入住须知
 			// 跳转到入住须知
-			navigateToXuzhi(){
+			navigateToXuzhi() {
 				uni.navigateTo({
 				uni.navigateTo({
-				  url: "../ruzhuxuzhi/ruzhuxuzhi",
+					url: "../ruzhuxuzhi/ruzhuxuzhi",
 				});
 				});
 			},
 			},
 			// 跳转到公寓详情
 			// 跳转到公寓详情
-			navigateToXiangqing(){
+			navigateToXiangqing() {
 				uni.navigateTo({
 				uni.navigateTo({
-				  url: "../gongyuxiangqing/gongyuxiangqing",
+					url: "../gongyujieshao/gongyujieshao",
 				});
 				});
 			},
 			},
 			// 订房间 
 			// 订房间 
-			navigateToOrderRoom(enableNum,id,typeName) {
+			navigateToOrderRoom(enableNum, id, typeName, price) {
+				// console.log(enableNum, id, typeName, price);
 				let _self = this
 				let _self = this
 				_self.roomType = []
 				_self.roomType = []
-				if (enableNum>=1){
+				if (enableNum >= 1) {
 					uni.navigateTo({
 					uni.navigateTo({
-					  url: "../order_room/order_room?roomTypeId="+id +"&enableStartTime="+this.startDate+"&enableEndTime="+this.endDate+"&startTime="+this.startTime+"&endTime="+this.endTime+"&typeName="+typeName,
+						url: "../order_room/order_room?roomTypeId=" + id + "&enableStartTime=" + _self.startDate + "&enableEndTime=" + _self.endDate +
+							"&startTime=" + _self.startTime + "&endTime=" + _self.endTime + "&ruzhu_num=" + _self.ruzhu_num + "&typeName=" + typeName +
+							"&freeRoom=" + enableNum + "&price=" + price
 					});
 					});
 				}
 				}
 				this.getRoomType()
 				this.getRoomType()
-				
-				
 			},
 			},
 			//办理入住跳转
 			//办理入住跳转
-			navigateToDairuzhu(type){
-				this.dai_panduan=[]
+			navigateToDairuzhu(type) {
+				this.dai_panduan = []
 				setTimeout(() => {
 				setTimeout(() => {
 					this.getOrderPage()
 					this.getOrderPage()
-				},1)
+				}, 1)
 				setTimeout(() => {
 				setTimeout(() => {
-					for (let i=0;i<this.dai_type.length;i++){
+					for (let i = 0; i < this.dai_type.length; i++) {
 						this.dai_type.forEach(val => {
 						this.dai_type.forEach(val => {
-							if(val[i]==2) {
+							if (val[i] == 2) {
 								this.dai_panduan.push(val)
 								this.dai_panduan.push(val)
 							}
 							}
 						})
 						})
 					}
 					}
-					if(this.dai_panduan.length>=1) {
+					if (this.dai_panduan.length >= 1) {
 						uni.navigateTo({
 						uni.navigateTo({
-							url:"../my_orderlist/my_orderlist?Inv=2"
+							url: "../my_orderlist/my_orderlist?Inv=2"
 						})
 						})
-					}else if(this.dai_panduan.length<1) {
+					} else if (this.dai_panduan.length < 1) {
 						this.msgType = type
 						this.msgType = type
-						this.order_txt='请先订房!'
+						this.order_txt = '请先订房!'
 						this.$refs.popup_order.open()
 						this.$refs.popup_order.open()
 					}
 					}
-				},150)
+				}, 150)
 			},
 			},
 			//办理退房
 			//办理退房
-			navigateToTuifang(type){
-				this.tui_panduan=[]
+			navigateToTuifang(type) {
+				this.tui_panduan = []
 				setTimeout(() => {
 				setTimeout(() => {
 					this.getOrderPage()
 					this.getOrderPage()
-				},1)
+				}, 1)
 				setTimeout(() => {
 				setTimeout(() => {
-					for (let i=0;i<this.tui_type.length;i++){
+					for (let i = 0; i < this.tui_type.length; i++) {
 						this.tui_type.forEach(val => {
 						this.tui_type.forEach(val => {
-							if(val[i]==3) {
+							if (val[i] == 3) {
 								this.tui_panduan.push(val)
 								this.tui_panduan.push(val)
 							}
 							}
 						})
 						})
 					}
 					}
-					if(this.tui_panduan.length>=1) {
+					if (this.tui_panduan.length >= 1) {
 						uni.navigateTo({
 						uni.navigateTo({
-							url:"../my_orderlist/my_orderlist?Inv=3"
+							url: "../my_orderlist/my_orderlist?Inv=3"
 						})
 						})
-					}else if(this.tui_panduan.length<1) {
+					} else if (this.tui_panduan.length < 1) {
 						this.msgType = type
 						this.msgType = type
 						this.$refs.popup_tui.open()
 						this.$refs.popup_tui.open()
 					}
 					}
-				},150)
+				}, 150)
 			},
 			},
-			//户型详情弹窗
-			inputDialogToggle(id) {
+			// 户型详情弹窗
+			inputDialogToggle(h_type) {
 				this.$refs.popup.open()
 				this.$refs.popup.open()
-				this.getRoomTypeInfo(id)
+				if (h_type.indexOf('标准') !== -1) {
+					this.getRoomTypeInfo(1)
+				} else if (h_type.indexOf('高级') !== -1) {
+					this.getRoomTypeInfo(2)
+				} else {
+					this.getRoomTypeInfo(3)
+				}
 			},
 			},
 			popupClose() {
 			popupClose() {
 				this.$refs.popup.close()
 				this.$refs.popup.close()
 			},
 			},
 			//办理续住弹窗
 			//办理续住弹窗
-			navigateToXuzhu(){
-				this.xuzhu_panduan=[]
+			navigateToXuzhu() {
+				this.xuzhu_panduan = []
 				setTimeout(() => {
 				setTimeout(() => {
 					this.getOrderPage()
 					this.getOrderPage()
-				},1)
+				}, 1)
 				setTimeout(() => {
 				setTimeout(() => {
-					for (let i=0;i<this.xuzhu_type.length;i++){
+					for (let i = 0; i < this.xuzhu_type.length; i++) {
 						this.xuzhu_type.forEach(val => {
 						this.xuzhu_type.forEach(val => {
-							if(val[i]==3) {
+							if (val[i] == 3) {
 								this.xuzhu_panduan.push(val)
 								this.xuzhu_panduan.push(val)
 							}
 							}
 						})
 						})
 					}
 					}
 					console.log(this.xuzhu_panduan)
 					console.log(this.xuzhu_panduan)
-					if(this.xuzhu_panduan.length>1) {
+					if (this.xuzhu_panduan.length > 1) {
 						uni.navigateTo({
 						uni.navigateTo({
-							url:"../my_orderlist/my_orderlist?Inv=3"
+							url: "../my_orderlist/my_orderlist?Inv=3"
 						})
 						})
-					}else if(this.xuzhu_panduan.length==1) {
+					} else if (this.xuzhu_panduan.length == 1) {
 						this.$refs.popup_xuzhu.open()
 						this.$refs.popup_xuzhu.open()
-					}else if(this.xuzhu_panduan.length==0) {
+					} else if (this.xuzhu_panduan.length == 0) {
 						this.$refs.popup_xuzhu_no.open()
 						this.$refs.popup_xuzhu_no.open()
 					}
 					}
-				},150)
+				}, 150)
 			},
 			},
 			popupXuzhuClose() {
 			popupXuzhuClose() {
 				this.$refs.popup_xuzhu.close()
 				this.$refs.popup_xuzhu.close()
 			},
 			},
 			// 不可续住关闭弹窗
 			// 不可续住关闭弹窗
-			dialogClose(){
+			dialogClose() {
 				this.$refs.popup_xuzhu_no.close()
 				this.$refs.popup_xuzhu_no.close()
 			},
 			},
 			// 日期选择器弹窗开启
 			// 日期选择器弹窗开启
@@ -521,42 +591,50 @@
 				this.$refs.popup_picker.open()
 				this.$refs.popup_picker.open()
 			},
 			},
 			change(e) {
 			change(e) {
-				this.info.selected=[
-					{
-						date: e.range.before,
+				var before = e.range.before;
+				var after = e.range.after;
+				this.info.selected = [{
+						date: before,
 						info: '到店'
 						info: '到店'
 					},
 					},
 					{
 					{
-						date: e.range.after,
+						date: after,
 						info: '离店'
 						info: '离店'
 					}
 					}
-				]
-				if(e.range.before!=''&&e.range.after=='') {
-					this.startWeek='周'+e.lunar.ncWeek.substring(2,3)
-				} else if(e.range.before!=''&&e.range.after!=''){
-					if((new Date(e.range.after).getTime())<(new Date(e.range.before).getTime())) {
-						this.order_txt='离店日期不能小于到店日期'
-						this.$refs.popup_order.open()
-					}else{
-						this.endWeek='周'+e.lunar.ncWeek.substring(2,3)
-						this.startTime=e.range.before.substring(5,7)+'月'+e.range.before.substring(8,10)+'日'
-						this.endTime=e.range.after.substring(5,7)+'月'+e.range.after.substring(8,10)+'日'
-						this.startDate = e.range.before +' 14:00:00'
-						this.endDate =  e.range.after +' 12:00:00'
-						this.ruzhu_num=parseInt(((new Date(e.range.after).getTime())-(new Date(e.range.before).getTime()))/1000/60/60/24)
-						if(this.endDate !=' 12:00:00') {
-							this.getRoomType()
-						}
+				];
+				if (before !== '' && after === '') {
+					this.startWeek = '周' + e.lunar.ncWeek.substring(2, 3)
+				} else if (before !== '' && after !== '') {
+					if ((new Date(after).getTime()) == (new Date(before).getTime())) {
+						uni.showToast({
+							title: '不能选同一天',
+							icon: 'error',
+							duration: 1500
+						});
+						return;
+					}
+					if ((new Date(after).getTime()) < (new Date(before).getTime())) {
+						var temp = before;
+						before = after;
+						after = temp;
+					}
+					this.endWeek = '周' + e.lunar.ncWeek.substring(2, 3)
+					this.startTime = before.substring(5, 7) + '月' + before.substring(8, 10) + '日'
+					this.endTime = after.substring(5, 7) + '月' + after.substring(8, 10) + '日'
+					this.startDate = before + ' 14:00:00'
+					this.endDate = after + ' 12:00:00'
+					this.ruzhu_num = parseInt(((new Date(after).getTime()) - (new Date(before).getTime())) / 1000 / 60 / 60 / 24)
+					if (this.endDate != ' 12:00:00') {
+						this.getRoomType()
 					}
 					}
 				}
 				}
-				
 			},
 			},
 			// 续住里日期选择器弹窗
 			// 续住里日期选择器弹窗
 			openXuCalendar() {
 			openXuCalendar() {
 				this.$refs.popup_xu.open()
 				this.$refs.popup_xu.open()
 			},
 			},
 			changeXu(e) {
 			changeXu(e) {
-				console.log('1change 返回:', e)
+				// console.log('1change 返回:', e)
 				// 模拟动态打卡
 				// 模拟动态打卡
 				if (this.infoXu.selected.length > 5) return
 				if (this.infoXu.selected.length > 5) return
 				this.infoXu.selected.push({
 				this.infoXu.selected.push({
@@ -569,12 +647,13 @@
 				})
 				})
 			},
 			},
 			//拨打电话
 			//拨打电话
-			telphone(phone){
-				uni.makePhoneCall({ 
-					phoneNumber: phone ,
+			telphone() {
+				var that = this;
+				uni.makePhoneCall({
+					phoneNumber: that.phone,
 				}) // 传参带入号码即可
 				}) // 传参带入号码即可
 			},
 			},
-			
+
 			//   初次位置授权
 			//   初次位置授权
 			getAuthorize() {
 			getAuthorize() {
 				return new Promise((resolve, reject) => {
 				return new Promise((resolve, reject) => {
@@ -606,17 +685,17 @@
 						if (that.longitude.toString().indexOf('.') > 0) {
 						if (that.longitude.toString().indexOf('.') > 0) {
 							const longlatsplit = that.longitude.toString().split('.');
 							const longlatsplit = that.longitude.toString().split('.');
 							if (longlatsplit.length >= 2) {
 							if (longlatsplit.length >= 2) {
-								long = parseFloat(longlatsplit[0] === "" ? 0 : longlatsplit[0]) + parseFloat("." + longlatsplit[1].slice(0,6));
+								long = parseFloat(longlatsplit[0] === "" ? 0 : longlatsplit[0]) + parseFloat("." + longlatsplit[1].slice(0, 6));
 							}
 							}
 						}
 						}
 						if (that.latitude.toString().indexOf('.') > 0) {
 						if (that.latitude.toString().indexOf('.') > 0) {
 							const longlatsplit1 = that.latitude.toString().split('.');
 							const longlatsplit1 = that.latitude.toString().split('.');
 							if (longlatsplit1.length >= 2) {
 							if (longlatsplit1.length >= 2) {
-								lat = parseFloat(longlatsplit1[0] === "" ? 0 : longlatsplit1[0]) + parseFloat("." + longlatsplit1[1].slice(0,6));
+								lat = parseFloat(longlatsplit1[0] === "" ? 0 : longlatsplit1[0]) + parseFloat("." + longlatsplit1[1].slice(0, 6));
 							}
 							}
 						}
 						}
 						console.log("纬度", lat);
 						console.log("纬度", lat);
-						that.distance = that.getMapDistance(lat,long,'28.788671','115.387261');
+						that.distance = that.getMapDistance(lat, long, '28.788671', '115.387261');
 						console.log(that.distance)
 						console.log(that.distance)
 						that.markers = [{
 						that.markers = [{
 							id: "",
 							id: "",
@@ -652,7 +731,7 @@
 					});
 					});
 				});
 				});
 			},
 			},
-			
+
 			// 彻底拒绝位置获取
 			// 彻底拒绝位置获取
 			rejectGetLocation() {
 			rejectGetLocation() {
 				uni.showToast({
 				uni.showToast({
@@ -662,9 +741,8 @@
 				});
 				});
 			},
 			},
 			//打开地图导航
 			//打开地图导航
-			mapDaohang(lon,lat){
-			},
-			
+			mapDaohang(lon, lat) {},
+
 			//进行经纬度转换为距离的计算
 			//进行经纬度转换为距离的计算
 			Rad(d) {
 			Rad(d) {
 				return d * Math.PI / 180.0; //经纬度转换成三角函数中度分表形式。
 				return d * Math.PI / 180.0; //经纬度转换成三角函数中度分表形式。
@@ -687,7 +765,7 @@
 					Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2)));
 					Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2)));
 				s = s * 6378.137; // EARTH_RADIUS;
 				s = s * 6378.137; // EARTH_RADIUS;
 				s = Math.round(s * 10000) / 10000; //输出为公里
 				s = Math.round(s * 10000) / 10000; //输出为公里
-				s=s.toFixed(2);
+				s = s.toFixed(2);
 				return s;
 				return s;
 			},
 			},
 		}
 		}
@@ -696,4 +774,4 @@
 
 
 <style>
 <style>
 	@import url("./css/index.css");
 	@import url("./css/index.css");
-</style>
+</style>

+ 4 - 3
pages/my_orderlist/css/my_orderlist.css

@@ -103,7 +103,7 @@
 }
 }
 .room-price{
 .room-price{
 	position: absolute;
 	position: absolute;
-	margin-left: 601rpx;
+	margin-left: 580rpx;
 	margin-top: 46rpx;
 	margin-top: 46rpx;
 	color: rgba(56, 56, 56, 1);
 	color: rgba(56, 56, 56, 1);
 	font-size: 42rpx;
 	font-size: 42rpx;
@@ -137,7 +137,7 @@
 	line-height: 56rpx;
 	line-height: 56rpx;
 	color: rgba(41, 109, 227, 1);
 	color: rgba(41, 109, 227, 1);
 }
 }
-.room-button2{
+/* .room-button2{
 	position: absolute;
 	position: absolute;
 	margin-left: 551rpx;
 	margin-left: 551rpx;
 	margin-top: 146rpx;
 	margin-top: 146rpx;
@@ -148,7 +148,7 @@
 	text-align: center;
 	text-align: center;
 	line-height: 56rpx;
 	line-height: 56rpx;
 	color: rgba(41, 109, 227, 1);
 	color: rgba(41, 109, 227, 1);
-}
+} */
 .room-button3{
 .room-button3{
 	position: absolute;
 	position: absolute;
 	margin-left: 551rpx;
 	margin-left: 551rpx;
@@ -156,6 +156,7 @@
 	width: 146rpx;
 	width: 146rpx;
 	height: 56rpx;
 	height: 56rpx;
 	background: rgba(41, 109, 227, 1);
 	background: rgba(41, 109, 227, 1);
+	border: 1px solid rgba(41, 109, 227, 1);
 	border-radius: 4px;
 	border-radius: 4px;
 	text-align: center;
 	text-align: center;
 	line-height: 56rpx;
 	line-height: 56rpx;

+ 212 - 231
pages/my_orderlist/my_orderlist.vue

@@ -2,53 +2,54 @@
 	<view class="content">
 	<view class="content">
 		<!-- 切换栏 -->
 		<!-- 切换栏 -->
 		<scroll-view :scroll-x="true" class="inv-h-w">
 		<scroll-view :scroll-x="true" class="inv-h-w">
-			<view :class="['inv-h',Inv==6?'inv-h-se':'']" @click="changeTab(6)">全部</view>
+			<view :class="['inv-h',Inv==0?'inv-h-se':'']" @click="changeTab(0)">全部</view>
 			<view :class="['inv-h',Inv==1?'inv-h-se':'']" @click="changeTab(1)">待支付</view>
 			<view :class="['inv-h',Inv==1?'inv-h-se':'']" @click="changeTab(1)">待支付</view>
-			<view :class="['inv-h',Inv==2?'inv-h-se':'']" @click="changeTab(2)">待入住</view>
+			<view :class="['inv-h',Inv==2?'inv-h-se':'']" @click="changeTab(2)">已支付</view>
 			<view :class="['inv-h',Inv==3?'inv-h-se':'']" @click="changeTab(3)">已入住</view>
 			<view :class="['inv-h',Inv==3?'inv-h-se':'']" @click="changeTab(3)">已入住</view>
-			<view :class="['inv-h',Inv==0?'inv-h-se':'']" @click="changeTab(0)">已取消</view>
-			<view :class="['inv-h',Inv==4?'inv-h-se':'']" @click="changeTab(4)">待结账</view>
-			<view :class="['inv-h',Inv==5?'inv-h-se':'']" @click="changeTab(5)">已完成</view>
+			<view :class="['inv-h',Inv==4?'inv-h-se':'']" @click="changeTab(4)">已取消</view>
+			<view :class="['inv-h',Inv==5?'inv-h-se':'']" @click="changeTab(5)">已退款</view>
+			<view :class="['inv-h',Inv==6?'inv-h-se':'']" @click="changeTab(6)">已退房</view>
 		</scroll-view>
 		</scroll-view>
 		<!-- 订单样式 -->
 		<!-- 订单样式 -->
 		<view class="room-kuang">
 		<view class="room-kuang">
-			<view class="room-xinxi" v-for="(item,index) in troom" :key="index">
-				<view @click="navigateToOrderMark(item.id)">
-				<image class="room-image" :src="item.roomTypeMasterImg"></image>
-				<view class="room-name">{{item.roomTypeName}}</view>
-				<view class="room-time">{{item.enableStartTime|snippet}}-{{item.enableEndTime|snippet}}</view>
-				<view class="room-order">订单号:{{item.id}}</view>
-				<view class="room-type">
-					<text v-if="item.orderStatu==0">已取消</text>
-					<text v-if="item.orderStatu==1">待支付</text>
-					<text v-if="item.orderStatu==2">待入住</text>
-					<text v-if="item.orderStatu==3">已入住</text>
-					<text v-if="item.orderStatu==4">
-						待结账
-					</text>
-					<text v-if="item.orderStatu==5">已完成</text>
-				</view>
-				<view class="room-price">¥{{item.payAmount}}</view>
+			<view class="room-xinxi" v-for="(item, index) in troom" :key="index">
+				<!-- <view @click="navigateToOrderMark(item.id)"> -->
+				<view>
+					<image class="room-image" v-if="item.h_type.indexOf('标准') !== -1" src="../../static/index/std.jpg"></image>
+					<image class="room-image" v-if="item.h_type.indexOf('高级') !== -1" src="../../static/index/adv.jpg"></image>
+					<image class="room-image" v-if="item.h_type.indexOf('豪华') !== -1" src="../../static/index/lux.jpg"></image>
+					<view class="room-name">{{item.h_type}}</view>
+					<view class="room-time">{{item.live_time|snippet}}~{{item.end_time|snippet}}</view>
+					<view class="room-order">订单号:{{item.order_num}}</view>
+					<view class="room-type">
+						<text v-if="item.status==1">待支付</text>
+						<text v-else-if="item.status==2">已支付</text>
+						<text v-else-if="item.status==3">已入住</text>
+						<text v-else-if="item.status==4">已取消</text>
+						<text v-else-if="item.status==5">已退款</text>
+						<text v-else="item.status==6">已退房</text>
+					</view>
+					<view class="room-price">¥{{ item.pay_account }}</view>
 				</view>
 				</view>
-				<uni-countdown v-if="item.orderStatu == 1" class="room-count" color="#FF5733" :show-day="false" :second="timeupSecond" @timeup="timeup(item.createTime)" />
-				<text v-if="item.orderStatu == 1" class="room-count-txt">之后取消</text>
-				<view class="room-button" v-if="item.orderStatu != 4 && item.orderStatu != 2 && item.orderStatu != 3">
-					<text v-if="item.orderStatu == 0" @click="openDel(item.id,'warn')">删除</text>
-					<text v-if="item.orderStatu == 1" @click="openQu(item.id,'warn')">取消订单</text>
-					<text v-if="item.orderStatu == 5" @click="openDel(item.id,'warn')">删除</text>
-					<!-- <text v-if="item.orderStatu == 2">取消订单</text> -->
-					<!-- <text v-if="item.orderStatu == 3" @click="navigateToXuzhu">续住</text> -->
+				<!-- <uni-countdown v-if="item.status == 0" class="room-count" color="#FF5733" :show-day="false" :second="timeupSecond"
+					@timeup="timeup(item.createTime)" />
+				<text v-if="item.status == 0" class="room-count-txt">之后取消</text> -->
+				<view class="room-button" v-if="item.status != 3 && item.status != 4 && item.status != 5 && item.status != 6">
+					<text v-if="item.status == 1 || item.status == 2" @click="openQu(item.id,'warn')">取消订单</text>
+					<!-- <text v-else-if="item.status == 0" @click="openDel(item.id,'warn')">删除</text> -->
+					<!-- <text v-else="item.status == 5" @click="openDel(item.id,'warn')">删除</text> -->
+					<!-- <text v-else-if="item.status == 2">取消订单</text> -->
+					<!-- <text v-else-if="item.status == 3" @click="navigateToXuzhu">续住</text> -->
 				</view>
 				</view>
-				<view class="room-button2" :class="{'room-button3': item.orderStatu == 1 || item.orderStatu == 4}">
-					<text v-if="item.orderStatu == 0" @click="navigateToZaici(item.enableStartTime,item.enableEndTime,item.roomTypeId)">再次预定</text>
-					<text v-if="item.orderStatu == 1" @click="getOrderPay(item.id)">支付</text>
-					<text v-if="item.orderStatu == 4" @click="navigateToJiezhang(item.id)">去处理</text>
-					<text v-if="item.orderStatu == 5" @click="navigateToWanchengZaici(item.roomTypeId)">再次预定</text>
-					<!-- <text v-if="item.orderStatu == 2" @click="openRu(item.id,'warn')">办理入住</text> -->
-					<text v-if="item.orderStatu == 3" @click="openTui(item.id,'warn')">退房</text>
-					
+				<view :class="{'room-button3': item.status == 1}">
+					<text v-if="item.status == 1" @click="getOrderPay(item.id)">支付</text>
+					<!-- <text v-else-if="item.status == 0" @click="navigateToZaici(item.enableStartTime,item.enableEndTime,item.roomTypeId)">再次预定</text>
+					<text v-else-if="item.status == 4" @click="navigateToJiezhang(item.id)">去处理</text>
+					<text v-else-if="item.status == 5" @click="navigateToWanchengZaici(item.roomTypeId)">再次预定</text>
+					<text v-else="item.status == 3" @click="openTui(item.id,'warn')">退房</text> -->
+					<!-- <text v-else-if="item.status == 2" @click="openRu(item.id,'warn')">办理入住</text> -->
 				</view>
 				</view>
-				<view class="room-line"  v-if="index<(troom.length-1)"></view>
+				<view class="room-line" v-if="index<(troom.length-1)"></view>
 			</view>
 			</view>
 		</view>
 		</view>
 		<!-- 提示时弹框 -->
 		<!-- 提示时弹框 -->
@@ -68,8 +69,8 @@
 				<!-- 时间选择 -->
 				<!-- 时间选择 -->
 				<view class="select-time-xu" @click="openXuCalendar">
 				<view class="select-time-xu" @click="openXuCalendar">
 					<view class="select-time-one-xu">
 					<view class="select-time-one-xu">
-					  <text class="select-list">周四入住</text>
-					  <text class="select-list-time">07月21日</text>
+						<text class="select-list">周四入住</text>
+						<text class="select-list-time">07月21日</text>
 					</view>
 					</view>
 					<view class="select-center">
 					<view class="select-center">
 						<view class="select-line1"></view>
 						<view class="select-line1"></view>
@@ -77,8 +78,8 @@
 						<view class="select-line2"></view>
 						<view class="select-line2"></view>
 					</view>
 					</view>
 					<view class="select-time-one-xu">
 					<view class="select-time-one-xu">
-					  <text class="select-list">周五离店</text>
-					  <text class="select-list-time">07月22日</text>
+						<text class="select-list">周五离店</text>
+						<text class="select-list-time">07月22日</text>
 					</view>
 					</view>
 				</view>
 				</view>
 				<text class="popup_xu_txt">注:办理续住最多7天,如超过7天需要重新预定</text>
 				<text class="popup_xu_txt">注:办理续住最多7天,如超过7天需要重新预定</text>
@@ -90,107 +91,71 @@
 			</view>
 			</view>
 		</uni-popup>
 		</uni-popup>
 		<uni-popup ref="popup_xu" :mask-click="true">
 		<uni-popup ref="popup_xu" :mask-click="true">
-			<uni-calendar :selected="infoXu.selected" class="uni-calendar--hook" :clear-date="true" :date="infoXu.date" :insert="infoXu.insert" :lunar="infoXu.lunar" :startDate="infoXu.startDate"
-			:endDate="infoXu.endDate" :range="infoXu.range" @change="changeXu"/>
+			<uni-calendar :selected="infoXu.selected" class="uni-calendar--hook" :clear-date="true" :date="infoXu.date" :insert="infoXu.insert"
+				:lunar="infoXu.lunar" :startDate="infoXu.startDate" :endDate="infoXu.endDate" :range="infoXu.range" @change="changeXu" />
 		</uni-popup>
 		</uni-popup>
 	</view>
 	</view>
 </template>
 </template>
 
 
 <script>
 <script>
-	/**
-	 * 获取任意时间
-	 */
-	function getDate(date, AddDayCount = 0) {
-		if (!date) {
-			date = new Date()
-		}
-		if (typeof date !== 'object') {
-			date = date.replace(/-/g, '/')
-		}
-		const dd = new Date(date)
-	
-		dd.setDate(dd.getDate() + AddDayCount) // 获取AddDayCount天后的日期
-	
-		var a = new Array("日", "一", "二", "三", "四", "五", "六");  
-		var week = new Date().getDay();    
-		var week2 = new Date().getDay()+1;    
-		const y = dd.getFullYear()
-		const m = dd.getMonth() + 1 < 10 ? '0' + (dd.getMonth() + 1) : dd.getMonth() + 1 // 获取当前月份的日期,不足10补0
-		const d = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate() // 获取当前几号,不足10补0
-		const h = dd.getHours() < 10 ? '0' + dd.getHours() : dd.getHours()
-		const f = dd.getMinutes() < 10 ? '0' + dd.getMinutes() : dd.getMinutes()
-		const s = dd.getSeconds() < 10 ? '0' + dd.getSeconds() : dd.getSeconds()
-		return {
-			fullDate: y + '-' + m + '-' + d,
-			fullDate2: y + '-' + m + '-' + d+' '+h+':'+f+':'+s,
-			fullTime: m + '月' + d + '日',
-			year: y,
-			month: m,
-			date: d,
-			day: dd.getDay(),
-			sWeek:"周"+ a[week],
-			eWeek:"周"+ a[week2]
-		}
-	}
-	// 导入图片
-	import room1 from '../../static/index/room_image.svg'
-	import room2 from '../../static/index/room_image.svg'
 	export default {
 	export default {
-		data(){
+		data() {
 			return {
 			return {
 				Inv: 6,
 				Inv: 6,
-				room:[],
-				troom:[],
-				timeupSecond:null,
+				room: [],
+				troom: [],
+				timeupSecond: null,
 				//续住里选择器
 				//续住里选择器
 				infoXu: {
 				infoXu: {
 					lunar: true,
 					lunar: true,
 					range: true,
 					range: true,
 					insert: true,
 					insert: true,
 					selected: [],
 					selected: [],
-					startDate:'',
-					date:'',
-					endDate:'',
-					order_txt:'',//提交订单时信息
+					startDate: '',
+					date: '',
+					endDate: '',
+					order_txt: '', //提交订单时信息
 				},
 				},
-				msgType:'warn',
-				msgType2:'warn',
-				order_txt:'',//
-				order_txt2:'',//
-				tankuang:false,//弹框是否确定
-				order_txt_id:'',
+				msgType: 'warn',
+				msgType2: 'warn',
+				order_txt: '', //
+				order_txt2: '', //
+				tankuang: false, //弹框是否确定
+				order_txt_id: '',
+				cardNumber: ''
 			}
 			}
 		},
 		},
-		filters:{
+		filters: {
 			//字过长变为...
 			//字过长变为...
 			snippet: function(value) {
 			snippet: function(value) {
-				if(value.length>=10) {
+				if (value.length >= 10) {
 					return value.slice(0, 10);
 					return value.slice(0, 10);
 				} else {
 				} else {
 					return value
 					return value
 				}
 				}
 			},
 			},
 		},
 		},
+		onLoad(option) {
+			this.Inv = option.Inv;
+			// 获取用户信息
+			this.getUserInfo()
+		},
 		onShow() {
 		onShow() {
 			// 模拟从后台拿到的数据
 			// 模拟从后台拿到的数据
 			var room = []
 			var room = []
 			// list数组中为每一项添加双向绑定的属性---这个属性要在页面显示(onShow)添加
 			// list数组中为每一项添加双向绑定的属性---这个属性要在页面显示(onShow)添加
 			room.forEach(el => el.isChecked = false);
 			room.forEach(el => el.isChecked = false);
 			this.room = room;
 			this.room = room;
-			this.troom = room;//真实数据赋值给页面数据
+			this.troom = room; //真实数据赋值给页面数据
 			this.changeTab(this.Inv)
 			this.changeTab(this.Inv)
 		},
 		},
-		onLoad(option) {
-			this.Inv=option.Inv;
-		},
 		/**
 		/**
-		* 生命周期函数--监听页面卸载
-		*/
-		onUnload: function () {
-		  clearInterval(this.timer);
-		},
-		mounted(){
+		 * 生命周期函数--监听页面卸载
+		 */
+		onUnload: function() {
+			clearInterval(this.timer);
 		},
 		},
+		mounted() {},
 		onReady() {
 		onReady() {
 			this.$nextTick(() => {
 			this.$nextTick(() => {
 				this.showCalendar = true
 				this.showCalendar = true
@@ -202,140 +167,150 @@
 				// console.log('endDate:'+getDate(new Date(),6).fullDate)
 				// console.log('endDate:'+getDate(new Date(),6).fullDate)
 				this.infoXu.date = getDate(new Date()).fullDate
 				this.infoXu.date = getDate(new Date()).fullDate
 				this.infoXu.startDate = getDate(new Date()).fullDate
 				this.infoXu.startDate = getDate(new Date()).fullDate
-				this.infoXu.endDate =  getDate(new Date(),6).fullDate
+				this.infoXu.endDate = getDate(new Date(), 6).fullDate
 			}, 2000)
 			}, 2000)
 		},
 		},
-		methods:{
+		methods: {
+			// 获取用户信息
+			getUserInfo() {
+				var tempCardNumber = this.$utils.getEncryptedData('cardNumber')
+				if (this.$utils.isEmpty(tempCardNumber)) {
+					uni.showToast({
+						title: '用户卡号为空'
+					});
+					return;
+				}
+
+				this.cardNumber = tempCardNumber;
+			},
 			// 订单列表
 			// 订单列表
 			getOrderPage() {
 			getOrderPage() {
-				  let _self = this
-				  var Inv2=this.Inv
-				  _self.troom = []
-				  _self.room = []
-				  if (this.Inv==6) {
-					  Inv2=''
-				  }
-				  this.$axios.get("/hotel/ihotel-api/ihotel/hotelOrder/user/order/page?curPage=1&pageSize=100&statu="+Inv2,
-				  {
-					  headers:{
-						  'user_token':localStorage.getItem('token')
-					  }
-				  }).then(res => {
-					res = res.data
-					if (res.success) {
-						// console.log(res)
-					  res.data.list.forEach(data => {
-						_self.troom.push(data)
-						_self.room.push(data)
-					  })
+				let that = this
+				var Inv2 = that.Inv
+				that.troom = []
+				that.room = []
+				// if (that.Inv == 6) {
+				// 	Inv2 = 0
+				// }
+				that.$myRequest({
+					url: '/hotelReservation/zhotel/appqueryOrder.action?card_number=02090&state=' + Inv2
+				}).then(res => {
+					var data = res.data
+					if (data.code === 200) {
+						data.data.forEach(item => {
+							that.room.push(item)
+							that.troom.push(item)
+						})
 					} else {
 					} else {
-					  console.log('获取订单列表失败')
+						that.msgType = 'warn'
+						that.order_txt = data.message
+						that.$refs.popup_order.open()
 					}
 					}
-				  });
+				});
 			},
 			},
-			//待确认的弹框操作
+			// 待确认的弹框操作
 			dialogConfirm() {
 			dialogConfirm() {
 				this.$refs.popup_order2.close()
 				this.$refs.popup_order2.close()
-				this.tankuang=true
-				if(this.tankuang==true) {
-					if(this.order_txt2=='确定删除?') {
+				this.tankuang = true
+				if (this.tankuang == true) {
+					if (this.order_txt2 == '确定删除?') {
 						this.getOrderDelete(this.order_txt_id)
 						this.getOrderDelete(this.order_txt_id)
-					} else if(this.order_txt2=='确定退房?') {
+					} else if (this.order_txt2 == '确定退房?') {
 						this.getOrderReturn(this.order_txt_id)
 						this.getOrderReturn(this.order_txt_id)
-					} else if(this.order_txt2=='确定入住?') {
+					} else if (this.order_txt2 == '确定入住?') {
 						this.getOrderHold(this.order_txt_id)
 						this.getOrderHold(this.order_txt_id)
-					} else if(this.order_txt2=='确定取消订单?') {
+					} else if (this.order_txt2 == '确定取消订单?') {
 						this.getOrderCancel(this.order_txt_id)
 						this.getOrderCancel(this.order_txt_id)
 					}
 					}
-				} 
+				}
 			},
 			},
-			dialogClose(){
+			// 提示时弹框
+			dialogClose() {
 				this.$refs.popup_order2.close()
 				this.$refs.popup_order2.close()
 			},
 			},
-			//删除弹框
-			openDel(id,type){
-				this.order_txt_id=id
+			// 删除弹框
+			openDel(id, type) {
+				this.order_txt_id = id
 				this.msgType2 = type
 				this.msgType2 = type
-				this.order_txt2='确定删除?'
+				this.order_txt2 = '确定删除?'
 				this.$refs.popup_order2.open()
 				this.$refs.popup_order2.open()
 			},
 			},
-			//退房弹框
-			openTui(id,type) {
-				this.order_txt_id=id
+			// 退房弹框
+			openTui(id, type) {
+				this.order_txt_id = id
 				this.msgType2 = type
 				this.msgType2 = type
-				this.order_txt2='确定退房?'
+				this.order_txt2 = '确定退房?'
 				this.$refs.popup_order2.open()
 				this.$refs.popup_order2.open()
 			},
 			},
-			//入住弹框
-			openRu(id,type) {
-				this.order_txt_id=id
+			// 入住弹框
+			openRu(id, type) {
+				this.order_txt_id = id
 				this.msgType2 = type
 				this.msgType2 = type
-				this.order_txt2='确定入住?'
+				this.order_txt2 = '确定入住?'
 				this.$refs.popup_order2.open()
 				this.$refs.popup_order2.open()
 			},
 			},
-			//取消订单弹框
-			openQu(id,type) {
-				this.order_txt_id=id
+			// 取消订单弹框
+			openQu(id, type) {
+				this.order_txt_id = id
 				this.msgType2 = type
 				this.msgType2 = type
-				this.order_txt2='确定取消订单?'
+				this.order_txt2 = '确定取消订单?'
 				this.$refs.popup_order2.open()
 				this.$refs.popup_order2.open()
 			},
 			},
 			// 支付订单
 			// 支付订单
 			getOrderPay(id) {
 			getOrderPay(id) {
-				  let _self = this
-				  this.$axios.get(`/hotel/ihotel-api/ihotel/hotelOrder/user/order/pay/${id}`,
-				  {
-					  headers:{
-						  'user_token':localStorage.getItem('token')
-					  }
-				  }).then(res => {
+				let _self = this
+				this.$axios.get(`/hotelReservation/zhotel/ihotel/hotelOrder/user/order/pay/${id}`, {
+					headers: {
+						'user_token': localStorage.getItem('token')
+					}
+				}).then(res => {
 					res = res.data
 					res = res.data
 					if (res.success) {
 					if (res.success) {
-						if(res.data.payAmount==0) {
+						if (res.data.payAmount == 0) {
 							uni.navigateTo({
 							uni.navigateTo({
-								url: '../zhifuchenggong/zhifuchenggong?orderId='+res.data.orderId
+								url: '../zhifuchenggong/zhifuchenggong?orderId=' + res.data.orderId
 							})
 							})
 						} else {
 						} else {
 							window.location.href = res.data.payUrl;
 							window.location.href = res.data.payUrl;
 						}
 						}
-						
+
 					} else {
 					} else {
-						this.order_txt=res.message
+						this.order_txt = res.message
 						this.$refs.popup_order.open()
 						this.$refs.popup_order.open()
 						console.log('支付失败')
 						console.log('支付失败')
 					}
 					}
-				  });
+				});
 			},
 			},
 			// 办理退房
 			// 办理退房
 			getOrderReturn(order_txt_id) {
 			getOrderReturn(order_txt_id) {
 				let _self = this
 				let _self = this
 				this.$axios.defaults.headers.common['user_token'] = localStorage.getItem('token');
 				this.$axios.defaults.headers.common['user_token'] = localStorage.getItem('token');
-				this.$axios.put(`/hotel/ihotel-api/ihotel/hotelOrder/user/order/return/${this.order_txt_id}`,).then(res => {
+				this.$axios.put(`/hotelReservation/zhotel/ihotel/hotelOrder/user/order/return/${this.order_txt_id}`, ).then(res => {
 					res = res.data
 					res = res.data
 					if (res.success) {
 					if (res.success) {
-						this.order_txt='退房成功'
+						this.order_txt = '退房成功'
 						this.$refs.popup_order.open()
 						this.$refs.popup_order.open()
 						this.getOrderPage()
 						this.getOrderPage()
 					} else {
 					} else {
-						this.order_txt=res.message
+						this.order_txt = res.message
 						this.$refs.popup_order.open()
 						this.$refs.popup_order.open()
 					}
 					}
-					
+
 				});
 				});
-				this.tankuang==false
+				this.tankuang == false
 			},
 			},
 			// 办理入住
 			// 办理入住
 			getOrderHold(order_txt_id) {
 			getOrderHold(order_txt_id) {
 				let _self = this
 				let _self = this
 				this.$axios.defaults.headers.common['user_token'] = localStorage.getItem('token');
 				this.$axios.defaults.headers.common['user_token'] = localStorage.getItem('token');
-				this.$axios.put(`/hotel/ihotel-api/ihotel/hotelOrder/user/order/hold/${this.order_txt_id}`,).then(res => {
+				this.$axios.put(`/hotelReservation/zhotel/ihotel/hotelOrder/user/order/hold/${this.order_txt_id}`, ).then(res => {
 					res = res.data
 					res = res.data
 					if (res.success) {
 					if (res.success) {
-						this.order_txt='办理入住成功'
+						this.order_txt = '办理入住成功'
 						this.$refs.popup_order.open()
 						this.$refs.popup_order.open()
 						this.getOrderPage()
 						this.getOrderPage()
 					} else {
 					} else {
-						this.order_txt=res.message
+						this.order_txt = res.message
 						this.$refs.popup_order.open()
 						this.$refs.popup_order.open()
 					}
 					}
 				});
 				});
@@ -344,64 +319,68 @@
 			getOrderDelete(order_txt_id) {
 			getOrderDelete(order_txt_id) {
 				let _self = this
 				let _self = this
 				this.$axios.defaults.headers.common['user_token'] = localStorage.getItem('token');
 				this.$axios.defaults.headers.common['user_token'] = localStorage.getItem('token');
-				this.$axios.delete(`/hotel/ihotel-api/ihotel/hotelOrder/user/order/${this.order_txt_id}`,).then(res => {
+				this.$axios.delete(`/hotelReservation/zhotel/ihotel/hotelOrder/user/order/${this.order_txt_id}`, ).then(res => {
 					res = res.data
 					res = res.data
 					if (res.success) {
 					if (res.success) {
-						this.order_txt='删除订单成功'
+						this.order_txt = '删除订单成功'
 						this.$refs.popup_order.open()
 						this.$refs.popup_order.open()
 						this.getOrderPage()
 						this.getOrderPage()
 					} else {
 					} else {
-						this.order_txt=res.message
+						this.order_txt = res.message
 						this.$refs.popup_order.open()
 						this.$refs.popup_order.open()
 					}
 					}
 				});
 				});
-				this.tankuang==false
+				this.tankuang == false
 			},
 			},
 			// 待支付取消订单
 			// 待支付取消订单
 			getOrderCancel(order_txt_id) {
 			getOrderCancel(order_txt_id) {
-				let _self = this
-				this.$axios.defaults.headers.common['user_token'] = localStorage.getItem('token');
-				this.$axios.put(`/hotel/ihotel-api/ihotel/hotelOrder/user/order/cancel/${this.order_txt_id}`,).then(res => {
-					res = res.data
-					if (res.success) {
-						this.order_txt='取消成功'
-						this.$refs.popup_order.open()
-						this.getOrderPage()
+				let that = this
+				// that.$axios.defaults.headers.common['user_token'] = that.$utils.getEncryptedData('token');
+				that.$myRequest({
+					url: '/hotelReservation/zhotel/ihotel/hotelOrder/user/order/cancel/' + that.order_txt_id
+				}).then(res => {
+					alert(JSON.stringify(res.data))
+					if (res.data.code === 200) {
+						that.order_txt = '取消成功'
+						that.$refs.popup_order.open()
+						that.getOrderPage()
 					} else {
 					} else {
-						this.order_txt=res.message
-						this.$refs.popup_order.open()
+						that.order_txt = res.message
+						that.$refs.popup_order.open()
 					}
 					}
 				});
 				});
 			},
 			},
 			// 订单取消再次预订
 			// 订单取消再次预订
-			navigateToZaici(enableStartTime,enableEndTime,roomTypeId){
+			navigateToZaici(enableStartTime, enableEndTime, roomTypeId) {
 				uni.navigateTo({
 				uni.navigateTo({
-					url:"../order_room/order_room?enableStartTime="+enableStartTime+"&enableEndTime="+enableEndTime+"&startTime="+enableStartTime.substring(5,7)+'月'+enableStartTime.substring(8,10)+'日'+"&endTime="+enableEndTime.substring(5,7)+'月'+enableEndTime.substring(8,10)+'日'+"&roomTypeId="+roomTypeId
+					url: "../order_room/order_room?enableStartTime=" + enableStartTime + "&enableEndTime=" + enableEndTime + "&startTime=" +
+						enableStartTime.substring(5, 7) + '月' + enableStartTime.substring(8, 10) + '日' + "&endTime=" + enableEndTime.substring(5, 7) +
+						'月' + enableEndTime.substring(8, 10) + '日' + "&roomTypeId=" + roomTypeId
 				})
 				})
 			},
 			},
 			// 订单已完成再次预订
 			// 订单已完成再次预订
-			navigateToWanchengZaici(roomTypeId){
+			navigateToWanchengZaici(roomTypeId) {
 				uni.navigateTo({
 				uni.navigateTo({
-					url:'../order_room/order_room?roomTypeId='+roomTypeId
+					url: '../order_room/order_room?roomTypeId=' + roomTypeId
 				})
 				})
 			},
 			},
-			//处理结账
+			// 处理结账
 			navigateToJiezhang(id) {
 			navigateToJiezhang(id) {
 				uni.navigateTo({
 				uni.navigateTo({
-					url:"../order_mark/order_mark?orderId="+id
+					url: "../order_mark/order_mark?orderId=" + id
 				})
 				})
 			},
 			},
 			/*
 			/*
-			  * @Explain:选项卡点击切换
-			  */
+			 * @Explain:选项卡点击切换
+			 */
 			changeTab(Inv) {
 			changeTab(Inv) {
-				console.log(Inv)
 				var that = this;
 				var that = this;
-				this.Inv =Inv
+				that.Inv = Inv
 				var arr = [];
 				var arr = [];
-				this.getOrderPage(this.Inv)
-				that.room.map(item => {//遍历真实数据,拿到所需要的数据放在页面数据tlist中,展示在页面上
-					if(item.orderStatu == this.Inv){
+				// 订单列表
+				that.getOrderPage(that.Inv)
+				that.room.map(item => { //遍历真实数据,拿到所需要的数据放在页面数据tlist中,展示在页面上
+					if (item.orderStatu == that.Inv) {
 						arr.push(item);
 						arr.push(item);
 					}
 					}
 				})
 				})
@@ -409,7 +388,7 @@
 				// if(this.Inv == 6){//获取全部数据
 				// if(this.Inv == 6){//获取全部数据
 				// 	that.troom = that.room;
 				// 	that.troom = that.room;
 				// }
 				// }
-				//滚动到顶部
+				// 滚动到顶部
 				uni.pageScrollTo({
 				uni.pageScrollTo({
 					duration: 0, //过渡时间必须为0,否则运行到手机会报错
 					duration: 0, //过渡时间必须为0,否则运行到手机会报错
 					scrollTop: 0 //滚动到实际距离是元素距离顶部的距离减去最外层盒子的滚动距离(如res.top - data.top)
 					scrollTop: 0 //滚动到实际距离是元素距离顶部的距离减去最外层盒子的滚动距离(如res.top - data.top)
@@ -417,48 +396,50 @@
 			},
 			},
 			// 倒计时
 			// 倒计时
 			timeup(createTime) {
 			timeup(createTime) {
-				    var that = this;
-				    /**setInterval间歇调用 */
-				    that.timer = setInterval(function () {
+				var that = this;
+				/**setInterval间歇调用 */
+				that.timer = setInterval(function() {
 					//订单下单时间
 					//订单下单时间
 					var buy_time = createTime;
 					var buy_time = createTime;
 					//计算剩余下单时间
 					//计算剩余下单时间
-					var time = (new Date(buy_time).getTime() + 10* 60 * 1000) - (new Date().getTime());
-					if(time>0){
-					  //计算剩余的分钟
-					  var minutes = parseInt(time / 1000 / 60 % 60, 10);
-					  //计算剩余的秒数
-					  var seconds = parseInt(time / 1000 % 60, 10);
-					  that.timeupSecond=parseInt(time / 1000);
-					  // console.log(that.timeupSecond)
-					  //判断分钟和秒数小于10要在前面加个0.
-					  if(minutes<10){
-						minutes = '0' + minutes;
-					  }
-					  if (seconds < 10) {
-						seconds = '0' + seconds;
-					  }
-					  var timer = minutes + ":" + seconds;
+					var time = (new Date(buy_time).getTime() + 10 * 60 * 1000) - (new Date().getTime());
+					if (time > 0) {
+						//计算剩余的分钟
+						var minutes = parseInt(time / 1000 / 60 % 60, 10);
+						//计算剩余的秒数
+						var seconds = parseInt(time / 1000 % 60, 10);
+						that.timeupSecond = parseInt(time / 1000);
+						// console.log(that.timeupSecond)
+						//判断分钟和秒数小于10要在前面加个0.
+						if (minutes < 10) {
+							minutes = '0' + minutes;
+						}
+						if (seconds < 10) {
+							seconds = '0' + seconds;
+						}
+						var timer = minutes + ":" + seconds;
 					}
 					}
 				}, 1000);
 				}, 1000);
-				if(that.timeupSecond==0) {
+
+				if (that.timeupSecond == 0) {
 					uni.showToast({
 					uni.showToast({
 						title: '时间到'
 						title: '时间到'
 					})
 					})
+					// 订单列表
 					this.getOrderPage()
 					this.getOrderPage()
 				}
 				}
-				
+
 				// this.timeupSecond = 0
 				// this.timeupSecond = 0
 			},
 			},
 			// 跳转到订单详情
 			// 跳转到订单详情
 			navigateToOrderMark(id) {
 			navigateToOrderMark(id) {
 				// console.log(id)
 				// console.log(id)
 				uni.navigateTo({
 				uni.navigateTo({
-					url: "../order_mark/order_mark?orderId="+id,
+					url: "../order_mark/order_mark?orderId=" + id,
 				})
 				})
 			},
 			},
-			//办理续住弹窗
-			navigateToXuzhu(){
+			// 办理续住弹窗
+			navigateToXuzhu() {
 				this.$refs.popup_xuzhu.open()
 				this.$refs.popup_xuzhu.open()
 			},
 			},
 			popupXuzhuClose() {
 			popupXuzhuClose() {
@@ -481,7 +462,7 @@
 					info: '离店'
 					info: '离店'
 				})
 				})
 			},
 			},
-			
+
 		},
 		},
 	}
 	}
 </script>
 </script>

+ 39 - 22
pages/myself/css/myself.css

@@ -5,7 +5,8 @@
 	justify-content: center;
 	justify-content: center;
 	background-color: #F2F3F5;
 	background-color: #F2F3F5;
 }
 }
-.person{
+
+.person {
 	display: revert;
 	display: revert;
 	margin-top: 20rpx;
 	margin-top: 20rpx;
 	margin-left: 20rpx;
 	margin-left: 20rpx;
@@ -15,14 +16,16 @@
 	background: rgba(255, 255, 255, 1);
 	background: rgba(255, 255, 255, 1);
 	border-radius: 9rpx;
 	border-radius: 9rpx;
 }
 }
-.person_touxiang{
+
+.person_touxiang {
 	margin-left: 30rpx;
 	margin-left: 30rpx;
 	margin-top: 40rpx;
 	margin-top: 40rpx;
 	width: 110rpx;
 	width: 110rpx;
 	height: 110rpx;
 	height: 110rpx;
 	border-radius: 55px;
 	border-radius: 55px;
 }
 }
-.person_name{
+
+.person_name {
 	position: absolute;
 	position: absolute;
 	margin-left: 22rpx;
 	margin-left: 22rpx;
 	margin-top: 50rpx;
 	margin-top: 50rpx;
@@ -30,10 +33,11 @@
 	font-size: 36rpx;
 	font-size: 36rpx;
 	font-weight: 600;
 	font-weight: 600;
 }
 }
-.person_identity{
+
+.person_identity {
 	position: absolute;
 	position: absolute;
 	margin-left: 14rpx;
 	margin-left: 14rpx;
-	width: 91rpx;
+	width: 100rpx;
 	height: 38rpx;
 	height: 38rpx;
 	background: rgba(41, 109, 227, 1);
 	background: rgba(41, 109, 227, 1);
 	border-radius: 145rpx;
 	border-radius: 145rpx;
@@ -43,7 +47,8 @@
 	line-height: 38rpx;
 	line-height: 38rpx;
 	text-align: center;
 	text-align: center;
 }
 }
-.person_phone{
+
+.person_phone {
 	position: absolute;
 	position: absolute;
 	margin-left: 22rpx;
 	margin-left: 22rpx;
 	margin-top: 98rpx;
 	margin-top: 98rpx;
@@ -51,8 +56,9 @@
 	font-size: 24rpx;
 	font-size: 24rpx;
 	font-weight: 400;
 	font-weight: 400;
 }
 }
+
 /* 第二部分,我的订单 */
 /* 第二部分,我的订单 */
-.my_order{
+.my_order {
 	display: revert;
 	display: revert;
 	margin-top: 20rpx;
 	margin-top: 20rpx;
 	margin-left: 20rpx;
 	margin-left: 20rpx;
@@ -62,44 +68,53 @@
 	background: rgba(255, 255, 255, 1);
 	background: rgba(255, 255, 255, 1);
 	border-radius: 9rpx;
 	border-radius: 9rpx;
 }
 }
-.order_title{
+
+.order_title {
 	margin-left: 28rpx;
 	margin-left: 28rpx;
 	margin-top: 30rpx;
 	margin-top: 30rpx;
 	color: rgba(0, 0, 0, 1);
 	color: rgba(0, 0, 0, 1);
 	font-size: 32rpx;
 	font-size: 32rpx;
 	font-weight: 500;
 	font-weight: 500;
 }
 }
-.order_all{
+
+.order_all {
 	margin-left: 602rpx;
 	margin-left: 602rpx;
 	margin-top: -30rpx;
 	margin-top: -30rpx;
 	color: rgba(128, 128, 128, 1);
 	color: rgba(128, 128, 128, 1);
 	font-size: 24rpx;
 	font-size: 24rpx;
 	font-weight: 400;
 	font-weight: 400;
 }
 }
-.item-list{
+
+.item-list {
 	display: flex;
 	display: flex;
 	flex-direction: row;
 	flex-direction: row;
-	justify-content: flex-start;
+	flex-wrap: wrap;
 	width: 710rpx;
 	width: 710rpx;
-	height: 121rpx;
-	margin-top: 20rpx;
-	margin-left: 10rpx;
+	padding: 20rpx;
 	background: rgba(255, 255, 255, 1);
 	background: rgba(255, 255, 255, 1);
 	border-radius: 10px;
 	border-radius: 10px;
+	box-sizing: border-box;
 }
 }
-.item-list-one{
+
+.item-list-one {
 	display: flex;
 	display: flex;
 	flex-direction: column;
 	flex-direction: column;
 	align-items: center;
 	align-items: center;
-	width: 150rpx;
-	margin-right: 30rpx;
-	margin-top: 20rpx;
+	flex-grow: 1;
+	padding: 20rpx;
+	outline: 1px solid #fafafa;
+}
+
+.item-list-one:only-child {
+	outline: none;
 }
 }
-.img-btn{
+
+.img-btn {
 	width: 59rpx;
 	width: 59rpx;
 	height: 54rpx;
 	height: 54rpx;
 }
 }
-.list-txt{
+
+.list-txt {
 	width: 150rpx;
 	width: 150rpx;
 	text-align: center;
 	text-align: center;
 	font-size: 28rpx;
 	font-size: 28rpx;
@@ -107,8 +122,9 @@
 	color: rgba(0, 0, 0, 1);
 	color: rgba(0, 0, 0, 1);
 	font-weight: 400;
 	font-weight: 400;
 }
 }
+
 /* 第三部分,我的服务 */
 /* 第三部分,我的服务 */
-.my_help{
+.my_help {
 	display: revert;
 	display: revert;
 	margin-top: 20rpx;
 	margin-top: 20rpx;
 	margin-left: 20rpx;
 	margin-left: 20rpx;
@@ -118,7 +134,8 @@
 	background: rgba(255, 255, 255, 1);
 	background: rgba(255, 255, 255, 1);
 	border-radius: 9rpx;
 	border-radius: 9rpx;
 }
 }
-.help_title{
+
+.help_title {
 	margin-left: 28rpx;
 	margin-left: 28rpx;
 	margin-top: 30rpx;
 	margin-top: 30rpx;
 	color: rgba(0, 0, 0, 1);
 	color: rgba(0, 0, 0, 1);

+ 82 - 101
pages/myself/myself.vue

@@ -1,14 +1,11 @@
 <template>
 <template>
 	<view class="content">
 	<view class="content">
 		<view class="person">
 		<view class="person">
-			<image class="person_touxiang" v-if="touxiang==''" src="../../static/my/touxiang.svg"></image>
+			<image class="person_touxiang" v-if="touxiang == ''" src="../../static/my/touxiang.svg"></image>
 			<image class="person_touxiang" v-else :src="touxiang"></image>
 			<image class="person_touxiang" v-else :src="touxiang"></image>
-			<text class="person_name">{{cardName}}
+			<text class="person_name">{{ cardName }}
 				<text class="person_identity">
 				<text class="person_identity">
-					<text v-if="cardIdentity==0">其他</text>
-					<text v-if="cardIdentity==1">学生</text>
-					<text v-if="cardIdentity==4">教职工</text>
-					<text v-if="cardIdentity==5">校友</text>
+					<text>{{ cardIdentity }}</text>
 				</text>
 				</text>
 			</text>
 			</text>
 			<text class="person_phone">{{cardNum}}</text>
 			<text class="person_phone">{{cardNum}}</text>
@@ -16,40 +13,42 @@
 		<!-- 第二部分,我的订单 -->
 		<!-- 第二部分,我的订单 -->
 		<view class="my_order">
 		<view class="my_order">
 			<view class="order_title">我的订单</view>
 			<view class="order_title">我的订单</view>
-			<view class="order_all" @click="navigateToAll">全部></view>
+			<view class="order_all" @tap="navigateToDingdan(0)">全部></view>
 			<view class="item-list">
 			<view class="item-list">
-			  <view class="item-list-one" @click="navigateToDaizhifu">
-			    <image src="../../static/my/no_zhifu.svg" class="img-btn"></image>
-			    <text class="list-txt">待支付</text>
-			  </view>
-			  <view class="item-list-one" @click="navigateToDairuzhu">
-			    <image src="../../static/my/dairuzhu.svg" class="img-btn"></image>
-			    <text class="list-txt">待入住</text>
-			  </view>
-			  <view class="item-list-one" @click="navigateToYiruzhu">
-			    <image src="../../static/my/yiruzhu.svg" class="img-btn"></image>
-			    <text class="list-txt">已入住</text>
-			  </view>
-			  <view class="item-list-one" @click="navigateToYiquxiao">
-			    <image src="../../static/my/yiquxiao.svg" class="img-btn"></image>
-			    <text class="list-txt">已取消</text>
-			  </view>
-			</view>
-			<view class="item-list">
-			  <view class="item-list-one" @click="navigateToYiwancheng">
-			    <image src="../../static/my/wancheng.svg" class="img-btn"></image>
-			    <text class="list-txt">已完成</text>
-			  </view>
+				<view class="item-list-one" @tap="navigateToDingdan(1)">
+					<image src="../../static/my/no_zhifu.svg" class="img-btn"></image>
+					<text class="list-txt">待支付</text>
+				</view>
+				<view class="item-list-one" @tap="navigateToDingdan(2)">
+					<image src="../../static/my/dairuzhu.svg" class="img-btn"></image>
+					<text class="list-txt">已支付</text>
+				</view>
+				<view class="item-list-one" @tap="navigateToDingdan(3)">
+					<image src="../../static/my/yiruzhu.svg" class="img-btn"></image>
+					<text class="list-txt">已入住</text>
+				</view>
+				<view class="item-list-one" @tap="navigateToDingdan(4)">
+					<image src="../../static/my/yiquxiao.svg" class="img-btn"></image>
+					<text class="list-txt">已取消</text>
+				</view>
+				<view class="item-list-one" @tap="navigateToDingdan(5)">
+					<image src="../../static/my/wancheng.svg" class="img-btn"></image>
+					<text class="list-txt">已退款</text>
+				</view>
+				<view class="item-list-one" @tap="navigateToDingdan(6)">
+					<image src="../../static/my/wancheng.svg" class="img-btn"></image>
+					<text class="list-txt">已退房</text>
+				</view>
 			</view>
 			</view>
 		</view>
 		</view>
 		<!-- 第三部分,我的服务 -->
 		<!-- 第三部分,我的服务 -->
 		<view class="my_help">
 		<view class="my_help">
 			<view class="help_title">我的服务</view>
 			<view class="help_title">我的服务</view>
 			<view class="item-list">
 			<view class="item-list">
-			  <view class="item-list-one" @click="telphone(phone)">
-			    <image src="../../static/my/person_phone.svg" class="img-btn"></image>
-			    <text class="list-txt">人工热线</text>
-			  </view>
+				<view class="item-list-one" @tap="telphone()">
+					<image src="../../static/my/person_phone.svg" class="img-btn"></image>
+					<text class="list-txt">人工热线</text>
+				</view>
 			</view>
 			</view>
 		</view>
 		</view>
 	</view>
 	</view>
@@ -59,90 +58,72 @@
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
-				phone:'0791-82293574',//客服热线电话
-				cardName:'',//用户名
-				cardIdentity:'',//身份
-				cardNum:'',//卡号
-				touxiang:'',
+				phone: '0791-82293574', //客服热线电话
+				cardName: '', //用户名
+				cardIdentity: '', //身份
+				cardNum: '', //卡号
+				touxiang: '',
 			}
 			}
 		},
 		},
 		onLoad() {
 		onLoad() {
+			// 获取用户信息
 			this.getUserInfo()
 			this.getUserInfo()
 		},
 		},
 		methods: {
 		methods: {
 			// 获取用户信息
 			// 获取用户信息
 			getUserInfo() {
 			getUserInfo() {
-				  let _self = this
-				  this.$axios.get("/hotel/ihotel-api/ihotel/hotelUser/userInfo",
-				  {
-					  headers:{
-						  'user_token':localStorage.getItem('token')
-					  }
-				  }).then(res => {
-					res = res.data
-					if (res.success) {
-						if (res.data.statu == '1') {
-						  _self.cardName=res.data.name
-						  _self.cardIdentity=res.data.identityType
-						  _self.cardNum=res.data.telPhone
-						  _self.touxiang=res.data.headImage
-						}else {
-							alert('您没有权限,请联系客服')
+				var that = this
+				var tempCardNumber = that.$utils.getEncryptedData('cardNumber')
+				if (that.$utils.isEmpty(tempCardNumber)) {
+					uni.showToast({
+						title: '用户卡号为空'
+					});
+					return;
+				}
+				that.cardNumber = tempCardNumber;
+				that.$myRequest({
+					url: '/hotelReservation/zhotel/appuser.action?card_number=' + that.cardNumber,
+				}).then(res => {
+					// console.log(res);
+					let data = res.data.data
+					if (res.data.code === 200) {
+						that.cardName = data.user_name
+						that.cardPhone = data.user_phone
+						that.cardNum = data.card_number
+						if (data.identity_type === 0) {
+							that.cardIdentity = '其它'
+						} else if (data.identity_type === 1) {
+							that.cardIdentity = '学生'
+						} else if (data.identity_type === 4) {
+							that.cardIdentity = '教职工'
+						} else if (data.identity_type === 5) {
+							that.cardIdentity = '校友'
+						} else if (data.identity_type === 6) {
+							that.cardIdentity = '访客'
+						} else {
+							that.cardIdentity = '临时人员'
 						}
 						}
 					} else {
 					} else {
-					  console.log('获取用户信息失败')
+						alert('未获得用户数据')
 					}
 					}
-				  });
+				});
 			},
 			},
-			//跳转到全部订单
-			navigateToAll(){
+			// 跳转到订单
+			navigateToDingdan(index) {
 				uni.navigateTo({
 				uni.navigateTo({
-					url:"../my_orderlist/my_orderlist?Inv=6"
-				})
-			},
-			//跳转到待支付订单
-			navigateToDaizhifu(){
-				uni.navigateTo({ 
-					url: "../my_orderlist/my_orderlist?Inv=1",
-				})
-			},
-			//跳转到待入住订单
-			navigateToDairuzhu(){
-				uni.navigateTo({ 
-					url: "../my_orderlist/my_orderlist?Inv=2"
-				})
-			},
-			//跳转到已入住订单
-			navigateToYiruzhu(){
-				uni.navigateTo({ 
-					url: "../my_orderlist/my_orderlist?Inv=3"
-				})
-			},
-			//跳转到已取消订单
-			navigateToYiquxiao(){
-				uni.navigateTo({ 
-					url: "../my_orderlist/my_orderlist?Inv=0"
-				})
-			},
-			//跳转到待结账订单
-			navigateToDaijiezhang(){
-				uni.navigateTo({ 
-					url: "../my_orderlist/my_orderlist?Inv=4"
-				})
-			},
-			//跳转到已完成订单
-			navigateToYiwancheng(){
-				uni.navigateTo({ 
-					url: "../my_orderlist/my_orderlist?Inv=5"
+					url: "../my_orderlist/my_orderlist?Inv=" + index,
 				})
 				})
 			},
 			},
-			//拨打人工热线
-			telphone(phone){
-				uni.makePhoneCall({ phoneNumber: phone }) // 传参带入号码即可
+			// 拨打人工热线
+			telphone() {
+				var that = this
+				uni.makePhoneCall({
+					phoneNumber: that.phone
+				}) // 传参带入号码即可
 			},
 			},
-			//跳转到房间报修
-			navigateToBaoxiu(){
-				window.location.href='https://jtishfw.ncjti.edu.cn/baoxiu/repair-h5/#/'
+			// 跳转到房间报修
+			navigateToBaoxiu() {
+				window.location.href = 'https://jtishfw.ncjti.edu.cn/baoxiu/repair-h5/#/'
 			}
 			}
 		}
 		}
 	}
 	}

+ 96 - 95
pages/order_mark/order_mark.vue

@@ -4,7 +4,7 @@
 		<view class="one-order3" v-if="orderList.orderStatu == 5">
 		<view class="one-order3" v-if="orderList.orderStatu == 5">
 			<view class="one-order-title">订单已完成 / 期待您再次光临<text class="all-price">¥{{orderList.shouldFree}}</text></view>
 			<view class="one-order-title">订单已完成 / 期待您再次光临<text class="all-price">¥{{orderList.shouldFree}}</text></view>
 			<view class="one-order-menshi">房费<text class="menshi-price">¥{{orderList.totalFree}}</text></view>
 			<view class="one-order-menshi">房费<text class="menshi-price">¥{{orderList.totalFree}}</text></view>
-			<view class="room-button-6"@click="getOrderDelete(orderList.orderId)">
+			<view class="room-button-6" @click="getOrderDelete(orderList.orderId)">
 				<text>删除订单</text>
 				<text>删除订单</text>
 			</view>
 			</view>
 			<view class="room-button2-6" @click="navigateToWanchengZaici(orderList.roomTypeId)">
 			<view class="room-button2-6" @click="navigateToWanchengZaici(orderList.roomTypeId)">
@@ -41,7 +41,8 @@
 				房费<text class="yufukuan-price">¥{{orderList.payAmount}}</text>
 				房费<text class="yufukuan-price">¥{{orderList.payAmount}}</text>
 			</view>
 			</view>
 			<view class="room-button" v-if="orderList.orderStatu != 2&& orderList.orderStatu != 3">
 			<view class="room-button" v-if="orderList.orderStatu != 2&& orderList.orderStatu != 3">
-				<text v-if="orderList.orderStatu == 0" @click="navigateToZaici(orderList.enableStartTime,orderList.enableEndTime,orderList.roomTypeId)">再次预定</text>
+				<text v-if="orderList.orderStatu == 0"
+					@click="navigateToZaici(orderList.enableStartTime,orderList.enableEndTime,orderList.roomTypeId)">再次预定</text>
 				<text v-if="orderList.orderStatu == 1" @click="openQu()(orderList.orderId,'warn')">取消订单</text>
 				<text v-if="orderList.orderStatu == 1" @click="openQu()(orderList.orderId,'warn')">取消订单</text>
 			</view>
 			</view>
 			<view class="room-button2" :class="{'buttonNo': orderList.orderStatu == 3 || orderList.orderStatu == 2}">
 			<view class="room-button2" :class="{'buttonNo': orderList.orderStatu == 3 || orderList.orderStatu == 2}">
@@ -56,13 +57,15 @@
 			<view class="two-order-title">订单信息</view>
 			<view class="two-order-title">订单信息</view>
 			<view class="two-order-name">预定信息:<text class="two-order-txt">{{orderList.userName}}</text></view>
 			<view class="two-order-name">预定信息:<text class="two-order-txt">{{orderList.userName}}</text></view>
 			<view class="two-order-phone">手机号码:<text class="two-order-txt">{{orderList.userPhone}}</text></view>
 			<view class="two-order-phone">手机号码:<text class="two-order-txt">{{orderList.userPhone}}</text></view>
-			<view class="two-order-count">订    号:<text class="two-order-txt">{{orderList.orderId}}</text></view>
+			<view class="two-order-count">订 单 号:<text class="two-order-txt">{{orderList.orderId}}</text></view>
 			<view class="two-order-time">下单时间:<text class="two-order-txt">{{orderList.createTime}}</text></view>
 			<view class="two-order-time">下单时间:<text class="two-order-txt">{{orderList.createTime}}</text></view>
-			<view class="two-order-xing">户         型:<text class="two-order-txt">{{orderList.roomNo}}</text></view>
-			<view class="two-order-zhuTime">入离时间:<text class="two-order-txt" v-if="orderList.enableStartTime,orderList.enableEndTime">入住日{{orderList.enableStartTime.substring(11,16)}}后   离店日{{orderList.enableEndTime.substring(11,16)}}前</text></view>
+			<view class="two-order-xing">户 型:<text class="two-order-txt">{{orderList.roomNo}}</text></view>
+			<view class="two-order-zhuTime">入离时间:<text class="two-order-txt"
+					v-if="orderList.enableStartTime,orderList.enableEndTime">入住日{{orderList.enableStartTime.substring(11,16)}}后
+					离店日{{orderList.enableEndTime.substring(11,16)}}前</text></view>
 			<view class="two-order-secret" v-if="orderList.orderStatu ==3">房间门锁密码:{{orderList.lockRealtimePassword}}</view>
 			<view class="two-order-secret" v-if="orderList.orderStatu ==3">房间门锁密码:{{orderList.lockRealtimePassword}}</view>
 		</view>
 		</view>
-		
+
 		<view class="order-mark">您的满意是我们最大的追求</view>
 		<view class="order-mark">您的满意是我们最大的追求</view>
 		<!-- 提示时弹框 -->
 		<!-- 提示时弹框 -->
 		<uni-popup ref="popup_order2" type="dialog">
 		<uni-popup ref="popup_order2" type="dialog">
@@ -77,203 +80,201 @@
 
 
 <script>
 <script>
 	export default {
 	export default {
-		data(){
+		data() {
 			return {
 			return {
-				orderList:'',//订单整体
-				orderId:'',//订单号
-				billXin:'',//结账信息
-				order_txt:'',//弹框提示信息
-				msgType:'warn',
-				msgType2:'warn',
-				order_txt:'',//
-				order_txt2:'',//
-				tankuang:false,//弹框是否确定
-				order_txt_id:'',
+				orderList: '', //订单整体
+				orderId: '', //订单号
+				billXin: '', //结账信息
+				order_txt: '', //弹框提示信息
+				msgType: 'warn',
+				msgType2: 'warn',
+				order_txt: '', //
+				order_txt2: '', //
+				tankuang: false, //弹框是否确定
+				order_txt_id: '',
 			}
 			}
 		},
 		},
+		onload(options) {
+			console.log('不能执行onload')
+		},
 		onShow() {
 		onShow() {
 			// 获取当前小程序的页面栈
 			// 获取当前小程序的页面栈
 			let pages = getCurrentPages();
 			let pages = getCurrentPages();
 			// 数组中索引最大的页面--当前页面
 			// 数组中索引最大的页面--当前页面
-			let currentPage = pages[pages.length-1];
+			let currentPage = pages[pages.length - 1];
 			// 打印出当前页面中的 options
 			// 打印出当前页面中的 options
-			this.orderId=currentPage.options.orderId
+			this.orderId = currentPage.options.orderId
 			this.getOrderInfo(this.orderId)
 			this.getOrderInfo(this.orderId)
 			this.getOrderBill(this.orderId)
 			this.getOrderBill(this.orderId)
 		},
 		},
-		onload(option){
-			console.log('不能执行onload')
-		},
-		methods:{
-			//获取每个订单详情
+		methods: {
+			// 获取每个订单详情
 			getOrderInfo() {
 			getOrderInfo() {
-				  let _self = this
-				  _self.orderList = []
-				  this.$axios.get(`/hotel/ihotel-api/ihotel/hotelOrder/user/order/${this.orderId}`,
-				  {
-					  headers:{
-					  		'user_token':localStorage.getItem('token')
-					  }
-				  }
-				  ).then(res => {
+				let _self = this
+				_self.orderList = []
+				this.$axios.get(`/hotelReservation/zhotel/ihotel/hotelOrder/user/order/${this.orderId}`, {
+					headers: {
+						'user_token': localStorage.getItem('token')
+					}
+				}).then(res => {
 					res = res.data
 					res = res.data
 					if (res.success) {
 					if (res.success) {
 						console.log(res)
 						console.log(res)
-						this.orderList=res.data
+						this.orderList = res.data
 					} else {
 					} else {
-					  console.log('获取订单列表失败')
+						console.log('获取订单列表失败')
 					}
 					}
-				  });
+				});
 			},
 			},
 			//待确认的弹框操作
 			//待确认的弹框操作
 			dialogConfirm() {
 			dialogConfirm() {
 				this.$refs.popup_order2.close()
 				this.$refs.popup_order2.close()
-				this.tankuang=true
-				if(this.tankuang==true) {
-					if(this.order_txt2=='确定删除?') {
+				this.tankuang = true
+				if (this.tankuang == true) {
+					if (this.order_txt2 == '确定删除?') {
 						this.getOrderDelete(this.order_txt_id)
 						this.getOrderDelete(this.order_txt_id)
-					} else if(this.order_txt2=='确定退房?') {
+					} else if (this.order_txt2 == '确定退房?') {
 						this.getOrderReturn(this.order_txt_id)
 						this.getOrderReturn(this.order_txt_id)
-					} else if(this.order_txt2=='确定入住?') {
+					} else if (this.order_txt2 == '确定入住?') {
 						this.getOrderHold(this.order_txt_id)
 						this.getOrderHold(this.order_txt_id)
-					} else if(this.order_txt2=='确定取消订单?') {
+					} else if (this.order_txt2 == '确定取消订单?') {
 						this.getOrderCancel(this.order_txt_id)
 						this.getOrderCancel(this.order_txt_id)
 					}
 					}
-				} 
+				}
 			},
 			},
-			dialogClose(){
+			dialogClose() {
 				this.$refs.popup_order2.close()
 				this.$refs.popup_order2.close()
 			},
 			},
 			//删除弹框
 			//删除弹框
-			openDel(orderId,type){
-				this.order_txt_id=orderId
+			openDel(orderId, type) {
+				this.order_txt_id = orderId
 				this.msgType2 = type
 				this.msgType2 = type
-				this.order_txt2='确定删除?'
+				this.order_txt2 = '确定删除?'
 				this.$refs.popup_order2.open()
 				this.$refs.popup_order2.open()
 			},
 			},
 			//退房弹框
 			//退房弹框
-			openTui(orderId,type) {
-				this.order_txt_id=orderId
+			openTui(orderId, type) {
+				this.order_txt_id = orderId
 				this.msgType2 = type
 				this.msgType2 = type
-				this.order_txt2='确定退房?'
+				this.order_txt2 = '确定退房?'
 				this.$refs.popup_order2.open()
 				this.$refs.popup_order2.open()
 			},
 			},
 			//入住弹框
 			//入住弹框
-			openRu(orderId,type) {
-				this.order_txt_id=orderId
+			openRu(orderId, type) {
+				this.order_txt_id = orderId
 				this.msgType2 = type
 				this.msgType2 = type
-				this.order_txt2='确定入住?'
+				this.order_txt2 = '确定入住?'
 				this.$refs.popup_order2.open()
 				this.$refs.popup_order2.open()
 			},
 			},
 			//取消订单弹框
 			//取消订单弹框
-			openQu(orderId,type) {
-				this.order_txt_id=orderId
+			openQu(orderId, type) {
+				this.order_txt_id = orderId
 				this.msgType2 = type
 				this.msgType2 = type
-				this.order_txt2='确定取消订单?'
+				this.order_txt2 = '确定取消订单?'
 				this.$refs.popup_order2.open()
 				this.$refs.popup_order2.open()
 			},
 			},
 			// 订单结账信息
 			// 订单结账信息
 			getOrderBill() {
 			getOrderBill() {
-				  let _self = this
-				  this.$axios.get(`/hotel/ihotel-api/ihotel/hotelOrder/user/order/bill/${this.orderId}`,
-				  {
-					  headers:{
-						  'user_token':localStorage.getItem('token')
-					  }
-				  }).then(res => {
+				let _self = this
+				this.$axios.get(`/hotelReservation/zhotel/ihotel/hotelOrder/user/order/bill/${this.orderId}`, {
+					headers: {
+						'user_token': localStorage.getItem('token')
+					}
+				}).then(res => {
 					res = res.data
 					res = res.data
 					if (res.success) {
 					if (res.success) {
 						// console.log(res)
 						// console.log(res)
-						if(res.data.flag!='3') {
-							this.billXin=res.data
+						if (res.data.flag != '3') {
+							this.billXin = res.data
 						}
 						}
-						
+
 					} else {
 					} else {
-					  console.log('获取结账信息失败')
+						console.log('获取结账信息失败')
 					}
 					}
-				  });
+				});
 			},
 			},
 			// 订单取消再次预订
 			// 订单取消再次预订
-			navigateToZaici(enableStartTime,enableEndTime,roomTypeId){
+			navigateToZaici(enableStartTime, enableEndTime, roomTypeId) {
 				uni.navigateTo({
 				uni.navigateTo({
-					url:"../order_room/order_room?enableStartTime="+enableStartTime+"&enableEndTime="+enableEndTime+"&startTime="+enableStartTime.substring(5,7)+'月'+enableStartTime.substring(8,10)+'日'+"&endTime="+enableEndTime.substring(5,7)+'月'+enableEndTime.substring(8,10)+'日'+"&roomTypeId="+roomTypeId
+					url: "../order_room/order_room?enableStartTime=" + enableStartTime + "&enableEndTime=" + enableEndTime + "&startTime=" +
+						enableStartTime.substring(5, 7) + '月' + enableStartTime.substring(8, 10) + '日' + "&endTime=" + enableEndTime.substring(5, 7) +
+						'月' + enableEndTime.substring(8, 10) + '日' + "&roomTypeId=" + roomTypeId
 				})
 				})
 			},
 			},
 			// 待支付取消订单
 			// 待支付取消订单
 			getOrderCancel(order_txt_id) {
 			getOrderCancel(order_txt_id) {
 				let _self = this
 				let _self = this
 				this.$axios.defaults.headers.common['user_token'] = localStorage.getItem('token');
 				this.$axios.defaults.headers.common['user_token'] = localStorage.getItem('token');
-				this.$axios.put(`/hotel/ihotel-api/ihotel/hotelOrder/user/order/cancel/${this.order_txt_id}`,).then(res => {
+				this.$axios.put(`/hotelReservation/zhotel/ihotel/hotelOrder/user/order/cancel/${this.order_txt_id}`, ).then(res => {
 					res = res.data
 					res = res.data
 					if (res.success) {
 					if (res.success) {
-						this.order_txt='取消成功'
+						this.order_txt = '取消成功'
 						this.$refs.popup_order.open()
 						this.$refs.popup_order.open()
 						this.getOrderInfo()
 						this.getOrderInfo()
 					} else {
 					} else {
-						this.order_txt=res.message
+						this.order_txt = res.message
 						this.$refs.popup_order.open()
 						this.$refs.popup_order.open()
 					}
 					}
 				});
 				});
 			},
 			},
 			// 支付订单
 			// 支付订单
 			getOrderPay(orderId) {
 			getOrderPay(orderId) {
-				  let _self = this
-				  this.$axios.get(`/hotel/ihotel-api/ihotel/hotelOrder/user/order/pay/${orderId}`,
-				  {
-					  headers:{
-						  'user_token':localStorage.getItem('token')
-					  }
-				  }).then(res => {
+				let _self = this
+				this.$axios.get(`/hotelReservation/zhotel/ihotel/hotelOrder/user/order/pay/${orderId}`, {
+					headers: {
+						'user_token': localStorage.getItem('token')
+					}
+				}).then(res => {
 					res = res.data
 					res = res.data
 					if (res.success) {
 					if (res.success) {
-						if(res.data.payAmount==0) {
+						if (res.data.payAmount == 0) {
 							uni.navigateTo({
 							uni.navigateTo({
-								url: '../zhifuchenggong/zhifuchenggong?orderId='+res.data.orderId
+								url: '../zhifuchenggong/zhifuchenggong?orderId=' + res.data.orderId
 							})
 							})
 						} else {
 						} else {
 							window.location.href = res.data.payUrl;
 							window.location.href = res.data.payUrl;
 						}
 						}
 					} else {
 					} else {
-						this.order_txt=res.message
+						this.order_txt = res.message
 						this.$refs.popup_order.open()
 						this.$refs.popup_order.open()
 						console.log('支付失败')
 						console.log('支付失败')
 					}
 					}
-				  });
+				});
 			},
 			},
 			// 删除订单
 			// 删除订单
 			getOrderDelete(order_txt_id) {
 			getOrderDelete(order_txt_id) {
 				let _self = this
 				let _self = this
 				this.$axios.defaults.headers.common['user_token'] = localStorage.getItem('token');
 				this.$axios.defaults.headers.common['user_token'] = localStorage.getItem('token');
-				this.$axios.delete(`/hotel/ihotel-api/ihotel/hotelOrder/user/order/${this.order_txt_id}`,).then(res => {
+				this.$axios.delete(`/hotelReservation/zhotel/ihotel/hotelOrder/user/order/${this.order_txt_id}`, ).then(res => {
 					res = res.data
 					res = res.data
 					if (res.success) {
 					if (res.success) {
-						this.order_txt='删除订单成功'
+						this.order_txt = '删除订单成功'
 						this.$refs.popup_order.open()
 						this.$refs.popup_order.open()
 						this.getOrderInfo()
 						this.getOrderInfo()
 					} else {
 					} else {
-						this.order_txt=res.message
+						this.order_txt = res.message
 						this.$refs.popup_order.open()
 						this.$refs.popup_order.open()
 					}
 					}
 				});
 				});
 			},
 			},
 			// 订单已完成再次预订
 			// 订单已完成再次预订
-			navigateToWanchengZaici(roomTypeId){
+			navigateToWanchengZaici(roomTypeId) {
 				uni.navigateTo({
 				uni.navigateTo({
-					url:'../order_room/order_room?roomTypeId='+roomTypeId
+					url: '../order_room/order_room?roomTypeId=' + roomTypeId
 				})
 				})
 			},
 			},
 			// 办理入住
 			// 办理入住
 			getOrderHold(order_txt_id) {
 			getOrderHold(order_txt_id) {
 				let _self = this
 				let _self = this
 				this.$axios.defaults.headers.common['user_token'] = localStorage.getItem('token');
 				this.$axios.defaults.headers.common['user_token'] = localStorage.getItem('token');
-				this.$axios.put(`/hotel/ihotel-api/ihotel/hotelOrder/user/order/hold/${this.order_txt_id}`,).then(res => {
+				this.$axios.put(`/hotelReservation/zhotel/ihotel/hotelOrder/user/order/hold/${this.order_txt_id}`, ).then(res => {
 					res = res.data
 					res = res.data
 					if (res.success) {
 					if (res.success) {
-						this.order_txt='办理入住成功'
+						this.order_txt = '办理入住成功'
 						this.$refs.popup_order.open()
 						this.$refs.popup_order.open()
 						this.getOrderInfo()
 						this.getOrderInfo()
 					} else {
 					} else {
-						this.order_txt=res.message
+						this.order_txt = res.message
 						this.$refs.popup_order.open()
 						this.$refs.popup_order.open()
 					}
 					}
 				});
 				});
@@ -282,15 +283,15 @@
 			getOrderReturn(order_txt_id) {
 			getOrderReturn(order_txt_id) {
 				let _self = this
 				let _self = this
 				this.$axios.defaults.headers.common['user_token'] = localStorage.getItem('token');
 				this.$axios.defaults.headers.common['user_token'] = localStorage.getItem('token');
-				this.$axios.put(`/hotel/ihotel-api/ihotel/hotelOrder/user/order/return/${this.order_txt_id}`,).then(res => {
+				this.$axios.put(`/hotelReservation/zhotel/ihotel/hotelOrder/user/order/return/${this.order_txt_id}`, ).then(res => {
 					res = res.data
 					res = res.data
 					if (res.success) {
 					if (res.success) {
-						this.order_txt='退房成功'
+						this.order_txt = '退房成功'
 						this.$refs.popup_order.open()
 						this.$refs.popup_order.open()
 						this.getOrderInfo()
 						this.getOrderInfo()
 						this.getOrderBill()
 						this.getOrderBill()
 					} else {
 					} else {
-						this.order_txt=res.message
+						this.order_txt = res.message
 						this.$refs.popup_order.open()
 						this.$refs.popup_order.open()
 					}
 					}
 				});
 				});

+ 13 - 27
pages/order_room/css/order_room.css

@@ -116,6 +116,9 @@
 }
 }
 
 
 .select-circle {
 .select-circle {
+	display: flex;
+	justify-content: center;
+	align-items: center;
 	position: absolute;
 	position: absolute;
 	width: 81rpx;
 	width: 81rpx;
 	height: 46rpx;
 	height: 46rpx;
@@ -140,47 +143,30 @@
 }
 }
 
 
 .form_bg {
 .form_bg {
-	margin-left: 21rpx;
-	width: 709rpx;
+	display: flex;
+	flex-direction: column;
+	padding-left: 60rpx;
+	margin-top: 166rpx;
+	width: 750rpx;
 	height: 418rpx;
 	height: 418rpx;
 	background: rgba(247, 249, 250, 1);
 	background: rgba(247, 249, 250, 1);
 	border-radius: 5rpx;
 	border-radius: 5rpx;
+	box-sizing: border-box;
 }
 }
 
 
 .form_title {
 .form_title {
-	position: absolute;
-	margin-left: 29rpx;
-	margin-top: 166rpx;
 	color: rgba(128, 128, 128, 1);
 	color: rgba(128, 128, 128, 1);
 	font-size: 28rpx;
 	font-size: 28rpx;
 	font-weight: 400;
 	font-weight: 400;
 }
 }
 
 
-.form-name {
-	position: absolute;
-	margin-left: 29rpx;
-	margin-top: 238rpx;
-	color: rgba(0, 0, 0, 1);
-	font-size: 28rpx;
-	font-weight: 400;
-}
-
-.form-line {
-	position: absolute;
-	margin-left: 29rpx;
-	margin-top: 301rpx;
-	width: 650rpx;
-	background: rgba(204, 204, 204, 1);
-	border: 1px solid rgba(230, 230, 230, 1);
-}
-
-.form-phone {
-	position: absolute;
-	margin-left: 29rpx;
-	margin-top: 326rpx;
+.form-text {
+	line-height: 3rem;
+	padding-left: 29rpx;
 	color: rgba(0, 0, 0, 1);
 	color: rgba(0, 0, 0, 1);
 	font-size: 28rpx;
 	font-size: 28rpx;
 	font-weight: 400;
 	font-weight: 400;
+	border-bottom: 1px solid rgba(230, 230, 230, 1);
 }
 }
 
 
 .uni-list-cell-db {
 .uni-list-cell-db {

+ 182 - 172
pages/order_room/order_room.vue

@@ -15,17 +15,17 @@
 		<view class="two_all">
 		<view class="two_all">
 			<view class="select-time" @click="openCalendar">
 			<view class="select-time" @click="openCalendar">
 				<view class="select-time-one">
 				<view class="select-time-one">
-					<text class="select-list">{{startWeek}}入住</text>
-					<text class="select-list-time">{{startTime}}</text>
+					<text class="select-list">{{ startWeek }}入住</text>
+					<text class="select-list-time">{{ startTime }}</text>
 				</view>
 				</view>
 				<view class="select-center">
 				<view class="select-center">
 					<view class="select-line1"></view>
 					<view class="select-line1"></view>
-					<view class="select-circle">{{ruzhu_num}}晚</view>
+					<view class="select-circle">{{ ruzhu_num }} 晚</view>
 					<view class="select-line2"></view>
 					<view class="select-line2"></view>
 				</view>
 				</view>
 				<view class="select-time-one">
 				<view class="select-time-one">
-					<text class="select-list">{{endWeek}}离店</text>
-					<text class="select-list-time">{{endTime}}</text>
+					<text class="select-list">{{ endWeek }}离店</text>
+					<text class="select-list-time">{{ endTime }}</text>
 				</view>
 				</view>
 			</view>
 			</view>
 			<uni-popup ref="popup_picker" :mask-click="true">
 			<uni-popup ref="popup_picker" :mask-click="true">
@@ -35,12 +35,10 @@
 				</view>
 				</view>
 			</uni-popup>
 			</uni-popup>
 			<view class="form_bg">
 			<view class="form_bg">
-				<view class="form_title">{{typeName}}</view>
-				<!-- 自定义表单 -->
-				<view class="form-name">{{cardName}}</view>
-				<view class="form-line"></view>
-				<view class="form-phone">{{cardPhone}}</view>
-				<view class="form-line" style="margin-top: 389rpx;"></view>
+				<view class="form_title">房型:{{ typeName }}</view>
+				<view class="form-text">姓名:{{ cardName }}</view>
+				<view class="form-text">手机:{{ cardPhone }}</view>
+				<view class="form-text">身份:{{ cardIdentity }}</view>
 			</view>
 			</view>
 		</view>
 		</view>
 		<!-- 注释 -->
 		<!-- 注释 -->
@@ -51,10 +49,10 @@
 		</view>
 		</view>
 		<!-- 支付框 -->
 		<!-- 支付框 -->
 		<view class="fukuan">
 		<view class="fukuan">
-			<view class="fu-price"><text style="font-size: 28rpx;">总计:</text>¥{{payMount}}</view>
+			<view class="fu-price"><text style="font-size: 28rpx;">总计:</text>¥{{ payMount }}</view>
 			<view class="fu-zhifu" :class="{'room-button2': freeRoom == 0}">
 			<view class="fu-zhifu" :class="{'room-button2': freeRoom == 0}">
-				<text v-if="freeRoom==0">房间已满</text>
-				<text v-else @click="getOrderSubmit('warn')">立即支付</text>
+				<text v-if="freeRoom == 0">房间已满</text>
+				<text v-else @tap="getOrderSubmit()">立即支付</text>
 			</view>
 			</view>
 		</view>
 		</view>
 		<!-- 提交订单时弹框 -->
 		<!-- 提交订单时弹框 -->
@@ -62,46 +60,10 @@
 			<uni-popup-dialog :type="msgType" cancelText="关闭" confirmText="确定" :content="order_txt" @confirm="dialogConfirm"
 			<uni-popup-dialog :type="msgType" cancelText="关闭" confirmText="确定" :content="order_txt" @confirm="dialogConfirm"
 				@close="dialogClose"></uni-popup-dialog>
 				@close="dialogClose"></uni-popup-dialog>
 		</uni-popup>
 		</uni-popup>
-
 	</view>
 	</view>
 </template>
 </template>
 
 
 <script>
 <script>
-	/**
-	 * 获取任意时间
-	 */
-	function getDate(date, AddDayCount = 0) {
-		if (!date) {
-			date = new Date()
-		}
-		if (typeof date !== 'object') {
-			date = date.replace(/-/g, '/')
-		}
-		const dd = new Date(date)
-
-		dd.setDate(dd.getDate() + AddDayCount) // 获取AddDayCount天后的日期
-
-		var a = new Array("日", "一", "二", "三", "四", "五", "六");
-		var week = new Date().getDay();
-		var week2 = new Date().getDay() + 1;
-		const y = dd.getFullYear()
-		const m = dd.getMonth() + 1 < 10 ? '0' + (dd.getMonth() + 1) : dd.getMonth() + 1 // 获取当前月份的日期,不足10补0
-		const d = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate() // 获取当前几号,不足10补0
-		const h = dd.getHours() < 10 ? '0' + dd.getHours() : dd.getHours()
-		const f = dd.getMinutes() < 10 ? '0' + dd.getMinutes() : dd.getMinutes()
-		const s = dd.getSeconds() < 10 ? '0' + dd.getSeconds() : dd.getSeconds()
-		return {
-			fullDate: y + '-' + m + '-' + d,
-			fullDate2: y + '-' + m + '-' + d + ' ' + h + ':' + f + ':' + s,
-			fullTime: m + '月' + d + '日',
-			year: y,
-			month: m,
-			date: d,
-			day: dd.getDay(),
-			sWeek: "周" + a[week],
-			eWeek: "周" + a[week2]
-		}
-	}
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
@@ -130,180 +92,228 @@
 				cardPhone: '', //用户电话
 				cardPhone: '', //用户电话
 				cardIdentity: '', //身份
 				cardIdentity: '', //身份
 				submitToken: '', //请求令牌
 				submitToken: '', //请求令牌
-				roomTypeId: '', //房间类型id
+				// roomTypeId: '', //房间类型id
 				remark: '', //备注要求
 				remark: '', //备注要求
 				payMount: 0, //应付金额
 				payMount: 0, //应付金额
 				freeRoom: 0, //剩余房间
 				freeRoom: 0, //剩余房间
 				ruzhu_num: 1, //入住夜晚
 				ruzhu_num: 1, //入住夜晚
 				order_txt: '', //提交订单时信息
 				order_txt: '', //提交订单时信息
 				msgType: 'warn',
 				msgType: 'warn',
+				cardNumber: '',
+				payData: {}
 			}
 			}
 		},
 		},
 		onLoad(option) {
 		onLoad(option) {
-			console.log(option)
-			// this.payMount=Number(option.payMount)
-			// this.ruzhu_num=option.ruzhu_num
-			// this.freeRoom=option.freeRoom
-			this.roomTypeId = option.roomTypeId
-			this.typeName = option.typeName
-			this.startTime = option.startTime
-			this.endTime = option.endTime
-			this.startDate = option.enableStartTime.substring(0, 11) + "12:00:00"
-			this.endDate = option.enableEndTime.substring(0, 11) + "14:00:00"
-			this.startWeek = this.getweekday(this.startDate)
-			this.endWeek = this.getweekday(this.endDate)
-			this.mayTime = this.startDate.substring(0, 11) + "18:00:00"
-			// console.log(this.getweekday(this.startDate))
-			this.getTokenSubmit()
+			// console.log('option', option)
+			this.ruzhu_num = option.ruzhu_num
+			this.payMount = Number(option.price) //应付金额
+			this.freeRoom = option.freeRoom //剩余房间
+			// this.roomTypeId = option.roomTypeId //房间类型id
+			this.h_type = option.typeName //户型名
+			this.startTime = option.startTime //到店日期
+			this.endTime = option.endTime //离店日期
+			this.startDate = option.enableStartTime.substring(0, 11) + "12:00:00" //默认到店日期接口数据
+			this.endDate = option.enableEndTime.substring(0, 11) + "14:00:00" //默认离店日期接口数据
+			this.startWeek = this.$utils.getweekday(this.startDate) // 默认入店日
+			this.endWeek = this.$utils.getweekday(this.endDate) // 默认离店
+			this.mayTime = this.startDate.substring(0, 11) + "18:00:00" // 预计到店时间
+			// console.log(this.$utils.getweekday(this.startDate))
 		},
 		},
 		mounted() {
 		mounted() {
-			this.getUserInfo()
-			this.getOrderConfirm('warn')
+			// 获取用户信息
+			this.getUserInfo();
 		},
 		},
 		onReady() {
 		onReady() {
-			this.$nextTick(() => {
-				this.showCalendar = true
+			var that = this
+			that.$nextTick(() => {
+				that.showCalendar = true
 			})
 			})
 			// TODO 模拟请求异步同步数据
 			// TODO 模拟请求异步同步数据
 			setTimeout(() => {
 			setTimeout(() => {
-				this.info.date = getDate(new Date()).fullDate
-				this.info.startDate = getDate(new Date()).fullDate
-				this.info.endDate = getDate(new Date(), 6).fullDate
-				this.startTime = getDate(new Date()).fullTime
-				this.endTime = getDate(new Date(), 1).fullTime
-				this.startWeek = getDate(new Date()).sWeek
-				this.endWeek = getDate(new Date(), 1).eWeek
-				this.ruzhu_num = 1
+				that.info.date = that.$utils.getDate(new Date()).fullDate
+				that.info.startDate = that.$utils.getDate(new Date()).fullDate
+				that.info.endDate = that.$utils.getDate(new Date(), 6).fullDate
+				if (that.$utils.isEmpty(that.startTime)) {
+					that.startTime = that.$utils.getDate(new Date()).fullTime
+				}
+				if (that.$utils.isEmpty(that.endTime)) {
+					that.endTime = that.$utils.getDate(new Date(), 1).fullTime
+				}
+				if (that.$utils.isEmpty(that.startWeek)) {
+					that.startWeek = that.$utils.getDate(new Date()).sWeek
+				}
+				if (that.$utils.isEmpty(that.endWeek)) {
+					that.endWeek = that.$utils.getDate(new Date(), 1).eWeek
+				}
+				if (that.$utils.isEmpty(that.ruzhu_num)) {
+					that.ruzhu_num = 1
+				}
 			}, 20)
 			}, 20)
 		},
 		},
 		methods: {
 		methods: {
-			// 获取请求令牌
-			getTokenSubmit() {
-				let _self = this
-				this.$axios.get("/hotel/ihotel-api/ihotel/hotelOrder/user/submit/token", {
-					headers: {
-						'user_token': localStorage.getItem('token')
-					}
-				}).then(res => {
-					res = res.data
-					if (res.success) {
-						this.submitToken = res.data.submitToken
-					} else {
-						console.log('获取请求令牌失败')
-					}
-				});
+			/**
+			 * 调起支付
+			 */
+			onBridgeReady() {
+				var that = this;
+				// 在这里可以使用WeixinJSBridge对象进行支付调用等操作
+				// 调用支付接口
+				if (typeof WeixinJSBridge !== 'undefined') {
+					WeixinJSBridge.invoke('getBrandWCPayRequest', that.payData,
+						function(res) {
+							if (res.err_msg == "get_brand_wcpay_request:ok") {
+								// 使用以上方式判断前端返回,微信团队郑重提示:
+								//res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
+								uni.showToast({
+									title: '支付成功',
+									icon: 'success'
+								});
+							} else if (res.err_msg == "get_brand_wcpay_request:cancel") {
+								uni.showToast({
+									title: '支付取消',
+									icon: 'success'
+								});
+							} else {
+								uni.showModal({
+									title: res.errMsg
+								})
+							}
+						});
+				}
 			},
 			},
-			// 获取用户信息
+			/**
+			 * 获取用户信息
+			 */
 			getUserInfo() {
 			getUserInfo() {
-				let _self = this
-				this.$axios.get("/hotel/ihotel-api/ihotel/hotelUser/userInfo", {
-					headers: {
-						'user_token': localStorage.getItem('token')
-					}
+				var that = this
+				var tempCardNumber = that.$utils.getEncryptedData('cardNumber')
+				if (that.$utils.isEmpty(tempCardNumber)) {
+					uni.showToast({
+						title: '用户卡号为空'
+					});
+					return;
+				}
+				that.cardNumber = tempCardNumber;
+				that.$myRequest({
+					url: '/hotelReservation/zhotel/appuser.action?card_number=' + that.cardNumber
 				}).then(res => {
 				}).then(res => {
-					res = res.data
-					if (res.success) {
-						if (res.data.statu == '1') {
-							_self.cardName = res.data.name
-							_self.cardPhone = res.data.telPhone
-							_self.cardIdentity = res.data.identityType
+					// console.log(res);
+					let data = res.data.data
+					if (res.data.code === 200) {
+						that.cardName = data.user_name
+						that.cardPhone = data.user_phone
+						if (data.identity_type === 0) {
+							that.cardIdentity = '其它'
+						} else if (data.identity_type === 1) {
+							that.cardIdentity = '学生'
+						} else if (data.identity_type === 4) {
+							that.cardIdentity = '教职工'
+						} else if (data.identity_type === 5) {
+							that.cardIdentity = '校友'
+						} else if (data.identity_type === 6) {
+							that.cardIdentity = '访客'
 						} else {
 						} else {
-							alert('您没有权限,请联系客服')
+							that.cardIdentity = '临时人员'
 						}
 						}
 					} else {
 					} else {
-						console.log('获取用户信息失败')
+						alert('未获得用户数据')
 					}
 					}
 				});
 				});
 			},
 			},
-			// 确认订单
-			getOrderConfirm(type) {
-				let _self = this
-				this.$axios.get("/hotel/ihotel-api/ihotel/hotelOrder/user/order/confirm?startTime=" + this.startDate.substring(0, 10) + "&endTime=" + this.endDate
-					.substring(0, 10) + '&roomTypeId=' + this.roomTypeId).then(res => {
-					res = res.data
-					if (res.success) {
-						this.payMount = res.data.totalAmount
-						this.freeRoom = res.data.freeNum
-						this.ruzhu_num = res.data.nums
-					} else {
-						this.msgType = type
-						this.order_txt = res.message
-						this.$refs.popup_order.open()
+			/**
+			 * 提交订单
+			 */
+			getOrderSubmit() {
+				let that = this
+				that.$myRequest({
+					method: 'POST',
+					url: '/hotelReservation/zhotel/apporder_pay.action',
+					data: {
+						'card_number': that.cardNumber,
+						'h_type': that.h_type,
+						'live_time': that.startDate.substring(0, 10),
+						'end_time': that.endDate.substring(0, 10)
+					},
+					headers: {
+						'Content-Type': 'application/json'
 					}
 					}
-				});
-			},
-			// 提交订单
-			getOrderSubmit(type) {
-				this.payUrl = ''
-				let _self = this
-				this.$axios.defaults.headers.common['user_token'] = localStorage.getItem('token');
-				this.$axios.defaults.headers.common['request_token'] = this.submitToken;
-				this.$axios.defaults.headers.common['Content-Type'] = 'application/json'
-				this.$axios.post("/hotel/ihotel-api/ihotel/hotelOrder/user/order/submit", {
-					"enableStartTime": this.startDate, //入住时间
-					"enableEndTime": this.endDate, //离店时间
-					"roomTypeId": this.roomTypeId, //房间类型id
-					"payAmount": this.payMount, //需支付金额
-					"userName": this.cardName,
-					"userPhone": this.cardPhone,
-					"mayIntoTime": this.mayTime,
-					"remark": this.remark,
 				}).then(res => {
 				}).then(res => {
-					res = res.data
-					if (res.success) {
-						if (res.data.payAmount == 0) {
-							uni.navigateTo({
-								url: '../zhifuchenggong/zhifuchenggong?orderId=' + res.data.orderId
-							})
-						} else {
-							window.location.href = res.data.payUrl;
+					let data = res.data
+					if (data.code === 200) {
+						let d = data.data;
+						that.payData = {
+							"appId": d.appId,
+							"nonceStr": d.nonceStr,
+							"paySign": d.paySign,
+							"package": "prepay_id=" + d.prepay_id,
+							"signType": d.signType,
+							"timeStamp": d.timeStamp
 						}
 						}
 
 
+						if (typeof WeixinJSBridge === 'undefined') {
+							if (document.addEventListener) {
+								document.addEventListener('WeixinJSBridgeReady', that.onBridgeReady, false);
+							} else if (document.attachEvent) {
+								document.attachEvent('WeixinJSBridgeReady', that.onBridgeReady);
+								document.attachEvent('onWeixinJSBridgeReady', ththatis.onBridgeReady);
+							}
+						} else {
+							that.onBridgeReady();
+						}
 					} else {
 					} else {
-						this.msgType = type
-						this.order_txt = res.message
-						this.$refs.popup_order.open()
+						that.msgType = 'warn'
+						that.order_txt = data.message
+						that.$refs.popup_order.open()
 					}
 					}
 				});
 				});
 			},
 			},
-			// 计算指定时间是周几
-			getweekday(date) {
-				// date例如:'2022-03-05'
-				var weekArray = new Array("周日", "周一", "周二", "周三", "周四", "周五", "周六")
-				var weeka = weekArray[new Date(date).getDay()]
-				return weeka
+			dialogConfirm() {
+				uni.showToast({
+					title: '确定'
+				})
 			},
 			},
 			//日历选择器
 			//日历选择器
 			openCalendar() {
 			openCalendar() {
 				this.$refs.popup_picker.open()
 				this.$refs.popup_picker.open()
 			},
 			},
+			// 重新选择日期
 			change(e) {
 			change(e) {
-				console.log('1change 返回:', e)
+				// console.log('1change 返回:', e)
 				// 模拟动态打卡
 				// 模拟动态打卡
 				// if (this.info.selected.length > 5) return
 				// if (this.info.selected.length > 5) return
+				var before = e.range.before;
+				var after = e.range.after;
 				this.info.selected = [{
 				this.info.selected = [{
-						date: e.range.before,
+						date: before,
 						info: '到店'
 						info: '到店'
 					},
 					},
 					{
 					{
-						date: e.range.after,
+						date: after,
 						info: '离店'
 						info: '离店'
 					}
 					}
-				]
-				if (e.range.before != '' && e.range.after == '') {
+				];
+				if (before !== '' && after === '') {
 					this.startWeek = '周' + e.lunar.ncWeek.substring(2, 3)
 					this.startWeek = '周' + e.lunar.ncWeek.substring(2, 3)
-				} else if (e.range.before != '' && e.range.after != '') {
-					if ((new Date(e.range.after).getTime()) < (new Date(e.range.before).getTime())) {
-						this.order_txt = '离店日期不能小于到店日期'
-						this.$refs.popup_order.open()
-					} else {
-						this.endWeek = '周' + e.lunar.ncWeek.substring(2, 3)
-						this.startTime = e.range.before.substring(5, 7) + '月' + e.range.before.substring(8, 10) + '日'
-						this.endTime = e.range.after.substring(5, 7) + '月' + e.range.after.substring(8, 10) + '日'
-						this.startDate = e.range.before + ' 14:00:00'
-						this.endDate = e.range.after + ' 12:00:00'
-						this.ruzhu_num = parseInt(((new Date(e.range.after).getTime()) - (new Date(e.range.before).getTime())) / 1000 / 60 / 60 / 24)
+				} else if (before !== '' && after !== '') {
+					if ((new Date(after).getTime()) == (new Date(before).getTime())) {
+						uni.showToast({
+							title: '不能选同一天',
+							icon: 'error',
+							duration: 1500
+						});
+						return;
+					}
+					if ((new Date(after).getTime()) < (new Date(before).getTime())) {
+						var temp = before;
+						before = after;
+						after = temp;
 					}
 					}
+					this.endWeek = '周' + e.lunar.ncWeek.substring(2, 3)
+					this.startTime = before.substring(5, 7) + '月' + before.substring(8, 10) + '日'
+					this.endTime = after.substring(5, 7) + '月' + after.substring(8, 10) + '日'
+					this.startDate = before + ' 14:00:00'
+					this.endDate = after + ' 12:00:00'
+					this.ruzhu_num = parseInt(((new Date(after).getTime()) - (new Date(before).getTime())) / 1000 / 60 / 60 / 24)
 				}
 				}
 			},
 			},
 			//选择器
 			//选择器

+ 149 - 0
pages/p404/p404.vue

@@ -0,0 +1,149 @@
+<template>
+	<div class="auth-fail-page">
+		<view class="seal">
+			<view class="seal-son">
+				<span class="quan">授权失败</span>
+				<span class="dt">{{d}} {{t}}</span>
+			</view>
+		</view>
+		<p class="ptxt">{{ message }}</p>
+		<p class="error-message ptxt">很抱歉,您的授权未能成功。</p>
+		<p class="error-message">请稍后重试或联系客服。</p>
+	</div>
+</template>
+
+<script>
+	export default {
+		name: 'p404',
+		data() {
+			return {
+				message: '',
+				d: '',
+				t: ''
+			}
+		},
+		onLoad(options) {
+			// console.log(options.message);
+			// 印章中的时间
+			this.getDataTime();
+
+			if (!options.hasOwnProperty("message")) {
+				uni.showToast({
+					title: '未传错误信息',
+					duration: 3000
+				})
+				return;
+			} else {
+				if (options.message === undefined || options.message === null) {
+					uni.showToast({
+						title: '未获取错误信息',
+						duration: 3000
+					})
+					return;
+				}
+			}
+
+			// 错误信息
+			this.message = options.message;
+		},
+		methods: {
+			getDataTime() {
+				const currentDate = new Date();
+				const year = currentDate.getFullYear();
+				const month = String(currentDate.getMonth() + 1).padStart(2, '0');
+				const day = String(currentDate.getDate()).padStart(2, '0');
+				const hours = String(currentDate.getHours()).padStart(2, '0');
+				const minutes = String(currentDate.getMinutes()).padStart(2, '0');
+				const seconds = String(currentDate.getSeconds()).padStart(2, '0');
+
+				this.d = year + '.' + month + '.' + day;
+				this.t = hours + ':' + minutes;
+			}
+		}
+	};
+</script>
+
+<style>
+	.auth-fail-page {
+		font-family: Arial, sans-serif;
+		background-color: #f8f8f8;
+		text-align: center;
+		padding: 20px;
+		position: relative;
+	}
+
+	.seal {
+		width: 260rpx;
+		height: 260rpx;
+		border: solid 6rpx #aa0000;
+		border-radius: 50%;
+		background-color: rgba(255, 255, 255, 0.8);
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		position: absolute;
+		left: 245rpx;
+		top: 100rpx;
+		opacity: 0.8;
+	}
+
+	.seal-son {
+		width: 245rpx;
+		height: 245rpx;
+		border: solid 2rpx #aa0000;
+		border-radius: 100%;
+		background-color: rgba(255, 255, 255, 0.8);
+		position: relative;
+	}
+
+	.quan {
+		position: absolute;
+		top: 75rpx;
+		right: 65rpx;
+		text-align: center;
+		font-size: 40rpx;
+		transform: rotate(-45deg);
+		color: #aa0000;
+		font-weight: 900;
+	}
+
+	/* 竖屏样式 */
+	@media (orientation: portrait) {
+		/* 在这里添加竖屏时的样式 */
+		.dt {
+			position: absolute;
+			top: 123rpx;
+			left: 77rpx;
+			text-align: center;
+			font-size: 34rpx;
+			transform: rotate(-45deg);
+			color: #aa0000;
+		}
+	}
+
+	/* 横屏样式 */
+	@media (orientation: landscape) {
+		/* 在这里添加横屏时的样式 */
+		.dt {
+			position: absolute;
+			top: 123rpx;
+			left: 77rpx;
+			line-height: 2.5rem;
+			text-align: center;
+			font-size: 34rpx;
+			transform: rotate(-45deg);
+			color: #aa0000;
+		}
+	}
+
+	.error-message {
+		color: #999;
+		margin: 30rpx auto;
+	}
+
+	.ptxt {
+		color: #666;
+		font-size: 20px;
+		margin: 380rpx auto 0rpx;
+	}
+</style>

二进制
static/index/adv.jpg


二进制
static/index/adv1.jpg


二进制
static/index/adv2.jpg


二进制
static/index/lux.jpg


二进制
static/index/lux1.jpg


二进制
static/index/lux2.jpg


二进制
static/index/std.jpg


+ 13 - 12
utils/api.js

@@ -1,11 +1,16 @@
-// 封装 和后端联调接口
+// 封装 和 后端联调接口
 
 
-const baseURL  = ""; //公共路径  后端给的url
+const NODE_ENV = 'development'; // production 生产环境  development 开发环境
+
+let baseURL = ''; // 公共路径  后端给的url
+if (NODE_ENV === 'production') {
+	baseURL = 'https://chtech.ncjti.edu.cn'; // 公共路径  后端给的url
+}
 
 
 export const myRequest = (options) => {
 export const myRequest = (options) => {
 	//加载loading
 	//加载loading
 	uni.showLoading({
 	uni.showLoading({
-		title:'加载中'
+		title: '加载中'
 	})
 	})
 	return new Promise((resolve, reject) => {
 	return new Promise((resolve, reject) => {
 		uni.request({
 		uni.request({
@@ -15,22 +20,18 @@ export const myRequest = (options) => {
 			method: options.method || 'GET',
 			method: options.method || 'GET',
 			// 请求参数(若不传,则默认为 {} )
 			// 请求参数(若不传,则默认为 {} )
 			data: options.data || {},
 			data: options.data || {},
-			headers: options.headers  || {},
+			headers: options.headers || {},
 			// 请求成功
 			// 请求成功
 			success: (res) => {
 			success: (res) => {
 				// 此判断可根据自己需要更改
 				// 此判断可根据自己需要更改
-				if (res.data.status !== 1) {
-					return uni.showToast({
-						title: '获取数据失败!'
-					})
-				}
 				resolve(res)
 				resolve(res)
 			},
 			},
 			// 请求失败
 			// 请求失败
 			fail: (err) => {
 			fail: (err) => {
-				uni.showToast({
-					title: '请求接口失败!'
-				})
+				// uni.showToast({
+				// 	icon: 'none',
+				// 	title: err.errMsg
+				// })
 				reject(err)
 				reject(err)
 			},
 			},
 			//请求结束之后,执行的回调函数(成功或失败都会执行)
 			//请求结束之后,执行的回调函数(成功或失败都会执行)

+ 168 - 0
utils/common.js

@@ -0,0 +1,168 @@
+// 导入 crypto-js 库 
+import CryptoJS from 'crypto-js';
+
+const utils = {
+	// 加密函数 
+	encryptData(data, key) {
+		const encryptedData = CryptoJS.AES.encrypt(data, key).toString();
+		return encryptedData;
+	},
+
+	// 解密函数 
+	decryptData(encryptedData, key) {
+		const decryptedData = CryptoJS.AES.decrypt(encryptedData, key).toString(CryptoJS.enc.Utf8);
+		return decryptedData;
+	},
+
+	// 存储数据到Encrypted session Storage 
+	storeEncryptedData(key, data) {
+		const encryptedData = this.encryptData(data, key);
+		sessionStorage.setItem(key, encryptedData);
+	},
+
+	// 从Encrypted Local Storage获取数据 
+	getEncryptedData(key) {
+		const encryptedData = sessionStorage.getItem(key);
+		if (encryptedData) {
+			const decryptedData = this.decryptData(encryptedData, key);
+			return decryptedData;
+		}
+		return null;
+	},
+
+	// 获取任意时间
+	getDate(date, AddDayCount = 0) {
+		if (!date) {
+			date = new Date();
+		}
+
+		if (typeof date !== 'object') {
+			date = date.replace(/-/g, '/');
+		}
+
+		const dd = new Date(date);
+
+		dd.setDate(dd.getDate() + AddDayCount); // 获取AddDayCount天后的日期
+
+		var a = new Array("日", "一", "二", "三", "四", "五", "六");
+		var week = new Date().getDay();
+		var week2 = new Date().getDay() + 1;
+		const y = dd.getFullYear();
+		const m = dd.getMonth() + 1 < 10 ? '0' + (dd.getMonth() + 1) : dd.getMonth() + 1; // 获取当前月份的日期,不足10补0
+		const d = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate(); // 获取当前几号,不足10补0
+		const h = dd.getHours() < 10 ? '0' + dd.getHours() : dd.getHours();
+		const f = dd.getMinutes() < 10 ? '0' + dd.getMinutes() : dd.getMinutes();
+		const s = dd.getSeconds() < 10 ? '0' + dd.getSeconds() : dd.getSeconds();
+		return {
+			fullDate: y + '-' + m + '-' + d,
+			fullDate2: y + '-' + m + '-' + d + ' ' + h + ':' + f + ':' + s,
+			fullTime: m + '月' + d + '日',
+			year: y,
+			month: m,
+			date: d,
+			day: dd.getDay(),
+			sWeek: "周" + a[week],
+			eWeek: "周" + a[week2]
+		};
+	},
+
+	// 计算指定时间是周几
+	getweekday(date) {
+		// date例如:'2022-03-05'
+		var weekArray = new Array("周日", "周一", "周二", "周三", "周四", "周五", "周六")
+		var weeka = weekArray[new Date(date).getDay()]
+		return weeka
+	},
+
+	// 获取年月日时分秒周
+	// getDateComponents(now_1, 'YYYY-MM-DD', 'YYYY-MM-DD HH:mm:ss', 'HH:mm:ss','date', 'datetime', 'time', 'weekday_cn', 'week_cn', 'weekday_cnx', 'week_en'));
+	getDateComponents(date, ...components) {
+		const year = date.getFullYear();
+		const month = String(date.getMonth() + 1).padStart(2, '0');
+		const day = String(date.getDate()).padStart(2, '0');
+		const hour = String(date.getHours()).padStart(2, '0');
+		const minute = String(date.getMinutes()).padStart(2, '0');
+		const second = String(date.getSeconds()).padStart(2, '0');
+		const week_cn = ["日", "一", "二", "三", "四", "五", "六"][date.getDay()];
+		const weekday_cn = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"][date.getDay()];
+		const weekday_cnx = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"][date.getDay()];
+		const week_en = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'][date.getDay()];
+
+		const result = {};
+
+		for (const component of components) {
+			switch (component) {
+				case 'YYYY-MM-DD':
+				case 'date':
+					result['date'] = `${year}-${month}-${day}`;
+					break;
+				case 'YYYY-MM-DD HH:mm:ss':
+				case 'datetime':
+					result['datetime'] = `${year}-${month}-${day} ${hour}:${minute}:${second}`;
+					break;
+				case 'monthday':
+					result['monthday'] = `${month}-${day}`;
+					break;
+				case 'monthday_cn':
+					result['monthday_cn'] = `${month}月-${day}日`;
+					break;
+				case 'HH:mm:ss':
+				case 'time':
+					result['time'] = `${hour}:${minute}:${second}`;
+					break;
+				case 'week_cn':
+					result['week_cn'] = week_cn;
+					break;
+				case 'weekday_cn':
+					result['weekday_cn'] = weekday_cn;
+					break;
+				case 'weekday_cnx':
+					result['weekday_cnx'] = weekday_cnx;
+					break;
+				case 'week_en':
+					result['week_en'] = week_en;
+					break;
+				default:
+					break;
+			}
+		}
+
+		return result;
+	},
+
+	// 指定日期加任意天数
+	addDaysToDate(date, days) {
+		const result = new Date(date);
+		result.setDate(result.getDate() + days);
+		return result;
+	},
+	
+	// 检测是否为空
+	isEmpty(value) {
+		if (value === null || value === undefined) {
+			return true;
+		}
+
+		if (typeof value === 'string' && value.trim() === '') {
+			return true;
+		}
+
+		if (typeof value === 'object' && Object.keys(value).length === 0) {
+			return true;
+		}
+
+		return false;
+	},
+
+	// 检测是否包含指定的字符串
+	containsString(str, searchString) {
+		return str.indexOf(searchString) !== -1;
+	},
+
+	// 解析URL中的参数
+	getUrlKey(name) {
+		return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ""])[1].replace(/\+/g, '%20')) || null
+	}
+}
+
+export default utils;

+ 0 - 4
utils/getToken.js

@@ -1,4 +0,0 @@
-const getUrlKey=function(name){
-	return decodeURIComponent((new RegExp('[?|&]' +name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [,""])[1].replace(/\+/g, '%20')) || null
-};
-export default getUrlKey