柒零 1 rok temu
rodzic
commit
85d624de7a
2 zmienionych plików z 27 dodań i 14 usunięć
  1. 6 1
      subpages/data/data.js
  2. 21 13
      subpages/main/main.js

+ 6 - 1
subpages/data/data.js

@@ -4369,7 +4369,12 @@ Page({
 				}
 			}
 		}
-		updateTimeWaterfall(startTime, timePeriods, that)
+		
+		wx.nextTick(() => {
+			setTimeout(() => {
+				updateTimeWaterfall(startTime, timePeriods, that)
+			}, 1000);
+		});
 		// console.log("睡眠数据最终=>", dateString);
 		// console.log("睡眠数据最终=>", startTime);
 		console.log("睡眠数据最终=>", JSON.stringify(timePeriods));

+ 21 - 13
subpages/main/main.js

@@ -3936,7 +3936,7 @@ Page({
 	},
 	showData() {
 		const that = this;
-		if (!wx.getStorageSync('res') || !wx.getStorageSync('res').result) {
+		if ((!wx.getStorageSync('res') || !wx.getStorageSync('res').result) && !wx.getStorageInfoSync('hotelEmpower') && !wx.getStorageInfoSync('roomEmpower')) {
 			wx.showModal({
 				title: '提示',
 				content: '请先扫描房间二维码',
@@ -3951,21 +3951,29 @@ Page({
 		} else {
 			let hotelcodeTemp = '';
 			let roomcodeTemp = '';
+			
 			if (wx.getStorageSync('res').result.split('|').length != 2) {
-				wx.showModal({
-					title: '提示',
-					content: '房间二维码不正确,请重新扫码',
-					showCancel: false
-				});
+				if (!wx.getStorageInfoSync('hotelEmpower') || !wx.getStorageInfoSync('roomEmpower')) {
+					wx.showModal({
+						title: '提示',
+						content: '房间二维码不正确,请重新扫码',
+						showCancel: false
+					});
 
-				setTimeout(function () {
-					wx.reLaunch({
-						url: '/subpages/scan/scan',
-					})
-				}, 2000) // 设置延时时间,单位为毫秒
+					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.getStorageInfoSync('hotelEmpower');
+				roomcodeTemp = wx.getStorageInfoSync('roomEmpower');
 			}
-			hotelcodeTemp = wx.getStorageSync('res').result.split('|')[0];
-			roomcodeTemp = wx.getStorageSync('res').result.split('|')[1];
 			entity = roomcodeTemp;
 			if (entity == 'labs') {
 				entity = '公司实验室';