柒零 1 jaar geleden
bovenliggende
commit
d8a5901d75

+ 6 - 6
subpages/data/data.wxml

@@ -53,20 +53,20 @@
 
 
 	<view class="container_00">
-		<view class="data-row_c00">
-			<view class="data-item_c00 left_c00">
-				<!-- <image class="data-image_c00" src="/static/images/report/zhoubao_new.png" mode="aspectFit"></image>
+		<!-- <view class="data-row_c00"> -->
+		<!-- <view class="data-item_c00 left_c00"> -->
+		<!-- <image class="data-image_c00" src="/static/images/report/zhoubao_new.png" mode="aspectFit"></image>
 				<text class="data-text_c00">周报 </text>
 				<image class="data-image_c00" src="/static/images/report/yuebao_new.png" mode="aspectFit"></image>
 				<text class="data-text_c00">月报 </text> -->
-				<image class="data-image_c00" src="/static/images/report/tuisong_new.png" mode="aspectFit"></image>
+		<!-- <image class="data-image_c00" src="/static/images/report/tuisong_new.png" mode="aspectFit"></image>
 				<picker mode="selector" range-key="friendly_name1" range="{{tvEntityIds}}" value="{{tvEntityIdsIndex}}"
 					bindchange="tvEntityIdsChange" wx:if="{{ifOneMoreTV}}">
 					<text class="data-text_c00">推送电视 </text>
 				</picker>
 				<text class="data-text_c00" bindtap="tvEntityIdChange" wx:else>推送电视 </text>
-			</view>
-		</view>
+			</view> -->
+		<!-- </view> -->
 		<view class="separator_c00"></view>
 
 		<view class="circle-container-yh">

BIN
subpages/images/ic_jdmc.png


+ 1 - 1
subpages/login/login.js

@@ -157,7 +157,7 @@ Page({
 	
 	setTimeout(function() {
 	    wx.reLaunch({
-			url: '/pages/scan/scan',
+        url: '/subpages/scan/scan',
 	    })
 	  }, 2000) // 设置延时时间,单位为毫秒
 	  

+ 31 - 2
subpages/main/main.js

@@ -3901,7 +3901,33 @@ Page({
 		} else {
 			this.showData();
 		}
+		const that = this;
+		wx.request({
+			url: `${aipushApi}` + '/getsn',
+			data: {
+				// "hotelcode":that.data.hotelcode?that.data.hotelcode:"club",
+				// "roomcode":that.data.hotelcode?that.data.roomcode:"nuange",
+				"hotelcode": that.data.hotelcode ? that.data.hotelcode : "club",
+				"roomcode": that.data.roomcode ? that.data.roomcode : "nuange",
+				"token": token_push
+			},
+			method: 'POST',
+			success(res) {
+				try {
+					if (res && res.data && res.data[0]) {
+						that.setData({
+							hotelname: res.data[0].hn,
+							roomname: res.data[0].rn
+						});
+						console.log("res.data=sn=" + JSON.stringify(res.data));
+					}
 
+				} catch (error) {
+					console.error(error);
+				}
+
+			},
+		})
 	},
 	authorizationSuccessful() {
 		console.log("授权成功");
@@ -3919,7 +3945,7 @@ Page({
 
 			setTimeout(function () {
 				wx.reLaunch({
-					url: '/pages/scan/scan',
+					url: '/subpages/scan/scan',
 				})
 			}, 2000) // 设置延时时间,单位为毫秒
 		} else {
@@ -3934,7 +3960,7 @@ Page({
 
 				setTimeout(function () {
 					wx.reLaunch({
-						url: '/pages/scan/scan',
+						url: '/subpages/scan/scan',
 					})
 				}, 2000) // 设置延时时间,单位为毫秒
 			}
@@ -3967,6 +3993,9 @@ Page({
 	showOther() { 
 		const that = this;
 		that.startInterval();
+
+
+	
 		
 	},
 	onLoad(option) {

+ 24 - 21
subpages/main/main.wxml

@@ -18,6 +18,18 @@
 
 
     <view class="contentArea">
+
+      <view class="theFirstRow">
+        <image class="data-card__icon" src="/subpages/images/ic_jdmc.png" />
+        <text class="theFirstRow-name">{{hotelname?(hotelname+'·'):''}}{{roomname?(roomname+'房间'):''}}</text>
+        <text class="theFirstRow-title">温度</text>
+        <text class="theFirstRow-value">{{w_temp}}<text class="theFirstRow-unit">℃</text></text>
+
+        <view style="margin-left: 30rpx;width: 2rpx; background: #e8e8e8; height: 24rpx;" />
+        <text class="theFirstRow-title">湿度</text>
+        <text class="theFirstRow-value">{{w_humidity}}<text class="theFirstRow-unit">%</text></text>
+
+      </view>
       <view class="menu-tab">
         <view
           class="{{!modelList1.length ? 'menu-tab-disenable' : currentMenuTabIndex == 0 ? 'menu-tab-item-active' :  'menu-tab-item'}}"
@@ -29,25 +41,13 @@
           class="{{!modelList3.length ? 'menu-tab-disenable' : currentMenuTabIndex == 2 ? 'menu-tab-item-active' :  'menu-tab-item'}}"
           data-index="2" bindtap="checkMenuTap">睡眠模式</view>
       </view>
-
-      <view class="theFirstRow">
-        <image src="/static/icons/ic_temperature.svg" mode="widthFix" />
-        <text class="theFirstRow-title">温度</text>
-        <text class="theFirstRow-value">{{w_temp}}<text class="theFirstRow-unit">℃</text></text>
-
-        <view style="margin-left: 30rpx;width: 2rpx; background: #e8e8e8; height: 24rpx;" />
-        <image src="/static/icons/ic_humidity.svg" mode="widthFix" />
-        <text class="theFirstRow-title">湿度</text>
-        <text class="theFirstRow-value">{{w_humidity}}<text class="theFirstRow-unit">%</text></text>
-
-      </view>
       <view wx:if="{{isLoading}}" class="loading-container">
         <text class="loading-text">数据正在加载,请耐心等待...</text>
       </view>
       <view class="data-container sliderList">
 
         <!-- 普通的-->
-        <view wx:for="{{listSwitch}}" wx:for-index="index" wx:for-item="item" class="sliderItem">
+        <view wx:for="{{listSwitch}}" wx:for-index="index" wx:for-item="item" class="sliderItem" wx:key="index">
           <view class="data-card" style="{{item.state=='on' ? 'background: #0BC3AA;' : item.bg}}">
             <image class="data-card__icon" src="{{item.state=='on' ? item.selectedImgSrc : item.imgSrc}}" />
             <view class="data-card__text">
@@ -67,7 +67,7 @@
 
 
         <!-- cover  -->
-        <view wx:for="{{listCover}}" wx:for-index="index" wx:for-item="item" class="sliderItem">
+        <view wx:for="{{listCover}}" wx:for-index="index" wx:for-item="item" class="sliderItem" wx:key="index">
           <view class="data-card">
             <image class="data-card__icon" src="{{item.imgSrc}}" />
             <view class="data-card__text">
@@ -84,7 +84,8 @@
           </view>
         </view>
         <!-- 电视 card-->
-        <view wx:for="{{listMitvMediaPlayer}}" wx:for-index="index" wx:for-item="item" class="sliderItem">
+        <view wx:for="{{listMitvMediaPlayer}}" wx:for-index="index" wx:for-item="item" class="sliderItem"
+          wx:key="index">
           <view class="data-card" style="{{item.bg}}">
             <image class="data-card__icon" src="{{item.imgSrc}}" />
             <view class="data-card__text">
@@ -113,7 +114,7 @@
 
           <!-- 香薰机 -->
           <view class="test" class="sliderItem" wx:for="{{listAromatherapyMachine}}" wx:for-index="index"
-            wx:for-item="item" wx:if="{{item.isAromatherapy}}">
+            wx:for-item="item" wx:if="{{item.isAromatherapy}}" wx:key="index">
 
             <view class="center-view">
               <view class="title-line"></view>
@@ -122,7 +123,7 @@
             <view class="data-media-player" style="flex-direction: row;">
 
               <view class="data-media-1" wx:for="{{listAromatherapyMachine}}" wx:for-index="index2" wx:for-item="item2"
-                wx:if="{{item2.isAromlight}}">
+                wx:if="{{item2.isAromlight}}" wx:key="index2">
                 <text class="sub-title">{{item2.friendly_name}}</text>
                 <view wx:if="{{item.state=='on'}}" class="btn-pos-view" bindtap="onSelect_All_aromlight"
                   data-param0="{{index2}}" data-param1="/services" data-param2="/{{item2.domain}}"
@@ -150,7 +151,7 @@
                   </view>
                 </view>
                 <view class="card-data" wx:for="{{listAromatherapyMachine}}" wx:for-index="index2" wx:for-item="item2"
-                  wx:if="{{item2.isAromAtomization}}" style="height: 230rpx;">
+                  wx:if="{{item2.isAromAtomization}}" style="height: 230rpx;" wx:key="index2">
                   <image class="data-card__icon" src="{{item2.imgSrc}}" />
                   <text class="data-card__title1">{{item2.friendly_name}}</text>
                   <view class="data-card__value">
@@ -172,7 +173,8 @@
           </view>
 
           <!-- 加湿器 -->
-          <view class="test" wx:for="{{listHumidifier}}" wx:for-index="index" wx:for-item="item" class="sliderItem">
+          <view class="test" wx:for="{{listHumidifier}}" wx:for-index="index" wx:for-item="item" class="sliderItem"
+            wx:key="index">
 
             <view class="center-view">
               <view class="title-line"></view>
@@ -217,7 +219,7 @@
             </view>
           </view>
           <!-- 空调 -->
-          <view class="test sliderItem" wx:for="{{listClimate}}" wx:for-index="index" wx:for-item="item">
+          <view class="test sliderItem" wx:for="{{listClimate}}" wx:for-index="index" wx:for-item="item" wx:key="index">
             <view class="center-view">
               <view class="title-line"></view>
               <text class="gray-text">{{item.friendly_name}}</text>
@@ -308,7 +310,8 @@
 
             </view>
           </view>
-          <view wx:for="{{listMiotMediaPlayer}}" wx:for-index="index" wx:for-item="item" class="sliderItem">
+          <view wx:for="{{listMiotMediaPlayer}}" wx:for-index="index" wx:for-item="item" class="sliderItem"
+            wx:key="index">
             <!-- 一行 -->
             <view class="data-media-player" style="{{item.entity_picture}}">
               <!-- 标题 -->

+ 23 - 12
subpages/main/main.wxss

@@ -61,12 +61,21 @@ page {
 .theFirstRow {
   font-weight: 500;
   display: flex;
+  margin-top: 40rpx;
   justify-content: flex-end;
   margin-right: 30rpx;
   align-items: center;
   flex-direction: row;
 }
 
+.theFirstRow-name {
+  flex: 1;
+  text-align: left;
+  color: #3E3D44;
+  font-size: 24rpx;
+  margin-left: 14rpx;
+}
+
 .theFirstRow-title {
   font-size: 20rpx;
   margin: 0 20rpx;
@@ -888,7 +897,6 @@ page {
 
 
 .data-container {
-  margin-top: 36rpx;
   display: grid;
   justify-content: center;
   grid-template-columns: repeat(auto-fill, 320rpx);
@@ -1051,38 +1059,41 @@ page {
 .menu-tab {
   display: flex;
   flex-direction: row;
-  width: fit-content;
+  width: calc(100% - 80rpx);
   margin: 40rpx;
   align-items: center;
+  flex-wrap: nowrap;
   border-radius: 40rpx;
-  background: #FFFFFF;
 }
 
 .menu-tab-item {
   font-size: 28rpx;
-  padding: 8rpx 54rpx;
-  margin: 4rpx;
+  padding: 14rpx 20rpx;
+  flex: auto;
+  text-align: center;
+  margin: 0 12rpx;
+  background: #FFFFFF;
   white-space: nowrap;
-  border-radius: 40rpx;
+  border-radius: 16rpx;
   color: #6C6970;
 }
 
 .menu-tab-disenable {
   font-size: 28rpx;
-  padding: 8rpx 54rpx;
-  margin: 4rpx;
+  padding: 14rpx 20rpx;
+  margin: 0 12rpx;
   white-space: nowrap;
-  border-radius: 40rpx;
+  border-radius: 16rpx;
   color: #cccccc;
 }
 
 .menu-tab-item-active {
   color: #FFFFFF;
   font-size: 28rpx;
-  padding: 8rpx 48rpx;
+  padding: 14rpx 20rpx;
   white-space: nowrap;
-  border-radius: 40rpx;
-  margin: 4rpx;
+  border-radius: 16rpx;
+  margin: 0 12rpx;
   background: #0BC3AA;
 }
 

+ 7 - 7
subpages/scan/scan.js

@@ -49,18 +49,18 @@ Page({
           let roomcodeTemp = res.result.split('|')[1];
           // wx.clearStorage();
           var userInfo = wx.getStorageSync("userInfo") || {};
-          if (hotelcodeTemp == userInfo.hotel && roomcodeTemp == userInfo.room) {
+          // if (hotelcodeTemp == userInfo.hotel && roomcodeTemp == userInfo.room) {
             wx.setStorageSync('res', res);
             wx.setStorageSync('scanResultExpiresAt', Date.now() + 2 * 60 * 60 * 1000); // 超时时间戳,例如设置为2小时后过期
             wx.reLaunch({
               url: '/pages/index/index?res=' + res,//传res
             })
-          } else {
-            wx.showToast({
-              title: '暂无权限,请先办理入住',
-              icon: 'none'
-            });
-          }
+          // } else {
+          //   wx.showToast({
+          //     title: '暂无权限,请先办理入住',
+          //     icon: 'none'
+          //   });
+          // }
         }
 
       }

+ 2 - 2
subpages/sleepEvaluation/sleepEvaluation.js

@@ -608,7 +608,7 @@ Page({
 
 			setTimeout(function () {
 				wx.reLaunch({
-					url: '/pages/scan/scan',
+					url: '/subpages/scan/scan',
 				})
 			}, 2000) // 设置延时时间,单位为毫秒
 		} else if (wx.getStorageSync('res').result.split('|').length != 2) {
@@ -620,7 +620,7 @@ Page({
 
 			setTimeout(function () {
 				wx.reLaunch({
-					url: '/pages/scan/scan',
+					url: '/subpages/scan/scan',
 				})
 			}, 2000) // 设置延时时间,单位为毫秒
 		} else {

+ 2 - 2
subpages/sleepQualityIndexAssessment/sleepQualityIndexAssessment.js

@@ -712,7 +712,7 @@ Page({
 
 			setTimeout(function () {
 				wx.reLaunch({
-					url: '/pages/scan/scan',
+					url: '/subpages/scan/scan',
 				})
 			}, 2000) // 设置延时时间,单位为毫秒
 		} else if (wx.getStorageSync('res').result.split('|').length != 2) {
@@ -724,7 +724,7 @@ Page({
 
 			setTimeout(function () {
 				wx.reLaunch({
-					url: '/pages/scan/scan',
+					url: '/subpages/scan/scan',
 				})
 			}, 2000) // 设置延时时间,单位为毫秒
 		} else {