柒零 1 年間 前
コミット
d4668b3520

+ 58 - 56
subpages/constitutionDiagnosis/constitutionDiagnosis.js

@@ -536,7 +536,7 @@ Page({
 								success() {
 									setTimeout(() => {
 										wx.navigateTo({
-											url: `/subpages/detectionResult/detectionResult?comScoreIndex=${comScoreIndex.slice(0,1)}`,
+											url: `/subpages/detectionResult/detectionResult?comScoreIndex=${comScoreIndex.slice(0, 1)}`,
 										})
 									}, 1000);
 								}
@@ -621,63 +621,65 @@ Page({
 		var that = this;
 		console.log("constitutionDiagnosis页面");
 		// wx.clearStorage();
-		console.log('option.res=' + JSON.stringify(wx.getStorageSync('res')));
-		if (!wx.getStorageSync('res') || !wx.getStorageSync('res').result) {
-			wx.showModal({
-				title: '提示',
-				content: '请先扫描房间二维码',
-				showCancel: false
-			});
+		// console.log('option.res=' + JSON.stringify(wx.getStorageSync('res')));
+		// if (!wx.getStorageSync('res') || !wx.getStorageSync('res').result) {
+		// 	wx.showModal({
+		// 		title: '提示',
+		// 		content: '请先扫描房间二维码',
+		// 		showCancel: false
+		// 	});
+
+		// 	setTimeout(function () {
+		// 		wx.reLaunch({
+		// 			url: '/subpages/scan/scan',
+		// 		})
+		// 	}, 2000) // 设置延时时间,单位为毫秒
+		// } else if (wx.getStorageSync('res').result.split('|').length != 2) {
+		// 	wx.showModal({
+		// 		title: '提示',
+		// 		content: '房间二维码不正确,请重新扫码',
+		// 		showCancel: false
+		// 	});
+
+		// 	setTimeout(function () {
+		// 		wx.reLaunch({
+		// 			url: '/subpages/scan/scan',
+		// 		})
+		// 	}, 2000) // 设置延时时间,单位为毫秒
+		// } else {
+		// const expiresAt = wx.getStorageSync('scanResultExpiresAt');
+		// const now = Date.now() 
+		// if (expiresAt || expiresAt < now) {
+		//   // 扫码结果已过期  
+		//   wx.showToast({  
+		//     title: '扫码结果失效或已过期,请重新扫码',  
+		//     icon: 'none'  
+		//   });  
+		//   // 清除过期的扫码结果  
+		//   wx.removeStorageSync('scanResultExpiresAt');  
+		//   setTimeout(function() {
+		//       wx.reLaunch({
+		//       		url: '/pages/scan/scan',
+		//       })
+		//     }, 2000) // 设置延时时间,单位为毫秒
+
+		// }else{
+		// 	//续期
+		// 	wx.setStorageSync('scanResultExpiresAt', Date.now() + 2 * 60 * 60 * 1000)
+		// }
 
-			setTimeout(function () {
-				wx.reLaunch({
-					url: '/subpages/scan/scan',
-				})
-			}, 2000) // 设置延时时间,单位为毫秒
-		} else if (wx.getStorageSync('res').result.split('|').length != 2) {
-			wx.showModal({
-				title: '提示',
-				content: '房间二维码不正确,请重新扫码',
-				showCancel: false
-			});
+		let hotelTemp = '';
+		let roomTemp = '';
 
-			setTimeout(function () {
-				wx.reLaunch({
-					url: '/subpages/scan/scan',
-				})
-			}, 2000) // 设置延时时间,单位为毫秒
-		} else {
-			// const expiresAt = wx.getStorageSync('scanResultExpiresAt');
-			// const now = Date.now() 
-			// if (expiresAt || expiresAt < now) {
-			//   // 扫码结果已过期  
-			//   wx.showToast({  
-			//     title: '扫码结果失效或已过期,请重新扫码',  
-			//     icon: 'none'  
-			//   });  
-			//   // 清除过期的扫码结果  
-			//   wx.removeStorageSync('scanResultExpiresAt');  
-			//   setTimeout(function() {
-			//       wx.reLaunch({
-			//       		url: '/pages/scan/scan',
-			//       })
-			//     }, 2000) // 设置延时时间,单位为毫秒
-
-			// }else{
-			// 	//续期
-			// 	wx.setStorageSync('scanResultExpiresAt', Date.now() + 2 * 60 * 60 * 1000)
-			// }
-
-			let hotelTemp = '';
-			let roomTemp = '';
-
-			hotelTemp = wx.getStorageSync('res').result.split('|')[0];
-			roomTemp = wx.getStorageSync('res').result.split('|')[1];
-			this.setData({
-				hotel: hotelTemp,
-				room: roomTemp,
-			});
-		}
+		hotelTemp = wx.getStorageSync('hotelEmpower');
+		roomTemp = wx.getStorageSync('roomEmpower');
+		// hotelTemp = wx.getStorageSync('res').result.split('|')[0];
+		// roomTemp = wx.getStorageSync('res').result.split('|')[1];
+		this.setData({
+			hotel: hotelTemp,
+			room: roomTemp,
+		});
+		// }
 
 	},
 	areAllArraysEmpty: function (arr1, arr2, arr3, arr4, arr5, arr6, arr7, arr8) {

+ 28 - 22
subpages/sleepEvaluation/sleepEvaluation.js

@@ -552,7 +552,7 @@ Page({
 									}, 1500);
 								}
 							});
-				
+
 						}
 					},
 					fail: function (error) {
@@ -600,41 +600,47 @@ Page({
 		var that = this;
 		console.log("sleepEvaluation页面");
 		// wx.clearStorage();
-		console.log('option.res=' + JSON.stringify(wx.getStorageSync('res')));
-		if (!wx.getStorageSync('res') || !wx.getStorageSync('res').result) {
+		if ((!wx.getStorageSync('res') || !wx.getStorageSync('res').result) && !wx.getStorageSync('hotelEmpower') && !wx.getStorageSync('roomEmpower')) {
 			wx.showModal({
 				title: '提示',
 				content: '请先扫描房间二维码',
 				showCancel: false
 			});
 
-			setTimeout(function () {
-				wx.reLaunch({
-					url: '/subpages/scan/scan',
-				})
-			}, 2000) // 设置延时时间,单位为毫秒
-		} else if (wx.getStorageSync('res').result.split('|').length != 2) {
-			wx.showModal({
-				title: '提示',
-				content: '房间二维码不正确,请重新扫码',
-				showCancel: false
-			});
-
 			setTimeout(function () {
 				wx.reLaunch({
 					url: '/subpages/scan/scan',
 				})
 			}, 2000) // 设置延时时间,单位为毫秒
 		} else {
+			let hotelcodeTemp = '';
+			let roomcodeTemp = '';
 
-			let hotelTemp = '';
-			let roomTemp = '';
-
-			hotelTemp = wx.getStorageSync('res').result.split('|')[0];
-			roomTemp = wx.getStorageSync('res').result.split('|')[1];
+			if (wx.getStorageSync('res') && wx.getStorageSync('res').result && wx.getStorageSync('res').result.split('|').length != 2) {
+				if (!wx.getStorageSync('hotelEmpower') || !wx.getStorageSync('roomEmpower')) {
+					wx.showModal({
+						title: '提示',
+						content: '房间二维码不正确,请重新扫码',
+						showCancel: false
+					});
+
+					setTimeout(function () {
+						wx.reLaunch({
+							url: '/subpages/scan/scan',
+						})
+					}, 2000) // 设置延时时间,单位为毫秒
+				}
+			}
+			if (wx.getStorageSync('res') && wx.getStorageSync('res').result) {
+				hotelcodeTemp = wx.getStorageSync('res').result.split('|')[0];
+				roomcodeTemp = wx.getStorageSync('res').result.split('|')[1];
+			} else {
+				hotelcodeTemp = wx.getStorageSync('hotelEmpower');
+				roomcodeTemp = wx.getStorageSync('roomEmpower');
+			}
 			this.setData({
-				hotel: hotelTemp,
-				room: roomTemp,
+				hotel: hotelcodeTemp,
+				room: roomcodeTemp,
 			});
 		}
 	},

+ 30 - 28
subpages/sleepQualityIndexAssessment/sleepQualityIndexAssessment.js

@@ -703,41 +703,43 @@ Page({
 			columns
 		});
 		console.log('option.res=' + JSON.stringify(wx.getStorageSync('res')));
-		if (!wx.getStorageSync('res') || !wx.getStorageSync('res').result) {
-			wx.showModal({
-				title: '提示',
-				content: '请先扫描房间二维码',
-				showCancel: false
-			});
-
-			setTimeout(function () {
-				wx.reLaunch({
-					url: '/subpages/scan/scan',
-				})
-			}, 2000) // 设置延时时间,单位为毫秒
-		} else if (wx.getStorageSync('res').result.split('|').length != 2) {
-			wx.showModal({
-				title: '提示',
-				content: '房间二维码不正确,请重新扫码',
-				showCancel: false
-			});
-
-			setTimeout(function () {
-				wx.reLaunch({
-					url: '/subpages/scan/scan',
-				})
-			}, 2000) // 设置延时时间,单位为毫秒
-		} else {
+		// if (!wx.getStorageSync('res') || !wx.getStorageSync('res').result) {
+		// 	wx.showModal({
+		// 		title: '提示',
+		// 		content: '请先扫描房间二维码',
+		// 		showCancel: false
+		// 	});
+
+		// 	setTimeout(function () {
+		// 		wx.reLaunch({
+		// 			url: '/subpages/scan/scan',
+		// 		})
+		// 	}, 2000) // 设置延时时间,单位为毫秒
+		// } else if (wx.getStorageSync('res').result.split('|').length != 2) {
+		// 	wx.showModal({
+		// 		title: '提示',
+		// 		content: '房间二维码不正确,请重新扫码',
+		// 		showCancel: false
+		// 	});
+
+		// 	setTimeout(function () {
+		// 		wx.reLaunch({
+		// 			url: '/subpages/scan/scan',
+		// 		})
+		// 	}, 2000) // 设置延时时间,单位为毫秒
+		// } else {
 			let hotelTemp = '';
 			let roomTemp = '';
 
-			hotelTemp = wx.getStorageSync('res').result.split('|')[0];
-			roomTemp = wx.getStorageSync('res').result.split('|')[1];
+			hotelTemp = wx.getStorageSync('hotelEmpower');
+			roomTemp = wx.getStorageSync('roomEmpower');
+			// hotelTemp = wx.getStorageSync('res').result.split('|')[0];
+			// roomTemp = wx.getStorageSync('res').result.split('|')[1];
 			this.setData({
 				hotel: hotelTemp,
 				room: roomTemp,
 			});
-		}
+		// }
 	},
 
 	/**