Browse Source

feat:有人无人

guotianliang 3 years ago
parent
commit
cc82a2eb15

+ 5 - 0
.vscode/settings.json

@@ -0,0 +1,5 @@
+{
+    "less.compile": {
+        "outExt": ".wxss"
+     }
+}

+ 1 - 0
components/spacecard/index.wxml

@@ -15,6 +15,7 @@
 			<view class="card_name">
 				<view class="nametxt">
 					<text>{{cardDate.localName}}</text>
+                    <text wx:if="{{cardDate.isPassengerPassShow}}" class="peoplestate {{cardDate.isPassengerPass=='有人'?'activepeople':''}}">{{cardDate.isPassengerPass}}</text>
 				</view>
 				<view class="imgbox">
 					<view  class="lottie {{canvashidden?'':lottiehidden}}" wx:if="{{canvashidden}}">

+ 15 - 0
components/spacecard/index.wxss

@@ -59,6 +59,21 @@
 .nametxt text{
   font-size: 32rpx;
   color: #191B26;
+  vertical-align: middle;
+}
+.nametxt .peoplestate{
+  display: inline-block;
+  box-sizing: border-box;
+  padding: 4px 12px;
+  margin-left: 10px;
+  background:#92af67;
+  vertical-align: middle;
+  color: #ffffff;
+  border-radius: 12px;
+  font-size: 24rpx;
+}
+.nametxt .activepeople{
+  background:#c86672;
 }
 .imgbox text{
   color: #80838F;

+ 7 - 0
pages/adjust/index.js

@@ -823,6 +823,13 @@ Page({
       options.co2&&(options.co2level = this.checkLevel(options.co2,"co2"));
       options.pm25&&(options.pm25level = this.checkLevel(options.pm25,"pm25"));
       options.hcho&&(options.hcholevel = this.checkLevel(options.hcho,"hcho"));
+      options.isPassengerPassShow&&(options.isPassengerPassShow=JSON.parse(options.isPassengerPassShow));
+      // if(typeof options.isPassengerPass==="undefined"){
+      //   options.isPassengerPassShow=false;
+      // }else{
+      //   options.isPassengerPassShow=true;
+      //   options.isPassengerPass=options.isPassengerPass?'有人':'无人'
+      // }
       this.setData({spaceDetail:options},()=>{
         this.checkGuide();
         this.getnowSeason();

+ 16 - 10
pages/adjust/index.less

@@ -141,10 +141,26 @@ page{
             .spacename{
                 height: 56rpx;
                 font-size: 40rpx;
+                vertical-align: middle;
                 font-weight: 400;
                 color: #2B3036;
                 line-height: 56rpx;
             }
+            .peoplestate{
+                display: inline-block;
+                box-sizing: border-box;
+                padding: 4px 12px;
+                margin-left: 10px;
+                // line-height: 56rpx;#c86672
+                background:#92af67;
+                vertical-align: middle;
+                color: #ffffff;
+                border-radius: 12px;
+                font-size: 24rpx;
+            }
+            .activepeople{
+                background:#c86672;
+            }
             .spacestate{
                 font-size: 30rpx;
                 color: #8D9399;
@@ -165,16 +181,6 @@ page{
                 font-size: 46rpx;
                 color: #2B3036;
             }
-            .peoplestate{
-                display: inline-block;
-                box-sizing: border-box;
-                padding: 4px 12px;
-                margin-right: 10px;
-                background:#d9f5d6;
-                color: #34c724;
-                border-radius: 12px;
-                font-size: 24rpx;
-            }
         }
     }
     .space_paramelist{

+ 2 - 1
pages/adjust/index.wxml

@@ -38,6 +38,7 @@
         <view class="space_msg">
             <view class="msg_left">
                 <text class="spacename">{{spaceDetail.localName}}</text>
+                <text wx:if="{{spaceDetail.isPassengerPassShow}}" class="peoplestate {{spaceDetail.isPassengerPass=='有人'?'activepeople':''}}">{{spaceDetail.isPassengerPass}}</text>
                 <view class="spacestate flex_row">
                     {{spaceDetail.state}}
                     <view>
@@ -46,7 +47,7 @@
                 </view>
             </view>
             <view class="msg_right" bindtap="toDetail">
-                <text wx:if="{{spaceDetail.isPassengerPassShow}}" class="peoplestate">{{spaceDetail.isPassengerPass}}</text>
+                <!-- <text wx:if="{{spaceDetail.isPassengerPassShow}}" class="peoplestate">{{spaceDetail.isPassengerPass}}</text> -->
                 <text>{{filter.initItemNum('',spaceDetail.temperature,'温度')}}</text>°C
             </view>
         </view>

+ 15 - 10
pages/adjust/index.wxss

@@ -132,10 +132,25 @@ page {
 .adjust_main .space_msg .msg_left .spacename {
   height: 56rpx;
   font-size: 40rpx;
+  vertical-align: middle;
   font-weight: 400;
   color: #2B3036;
   line-height: 56rpx;
 }
+.adjust_main .space_msg .msg_left .peoplestate {
+  display: inline-block;
+  box-sizing: border-box;
+  padding: 4px 12px;
+  margin-left: 10px;
+  background: #92af67;
+  vertical-align: middle;
+  color: #ffffff;
+  border-radius: 12px;
+  font-size: 24rpx;
+}
+.adjust_main .space_msg .msg_left .activepeople {
+  background: #c86672;
+}
 .adjust_main .space_msg .msg_left .spacestate {
   font-size: 30rpx;
   color: #8D9399;
@@ -156,16 +171,6 @@ page {
   font-size: 46rpx;
   color: #2B3036;
 }
-.adjust_main .space_msg .msg_right .peoplestate {
-  display: inline-block;
-  box-sizing: border-box;
-  padding: 4px 12px;
-  margin-right: 10px;
-  background: #d9f5d6;
-  color: #34c724;
-  border-radius: 12px;
-  font-size: 24rpx;
-}
 .adjust_main .space_paramelist {
   margin: 0 24rpx;
   background: #F8F9FA;

+ 16 - 10
pages/index/index.less

@@ -157,7 +157,23 @@ page{
                         font-weight: 400;
                         color: #2B3036;
                         line-height: 56rpx;
+                        vertical-align: middle;
                    }
+                   .peoplestate{
+                        display: inline-block;
+                        box-sizing: border-box;
+                        padding: 4px 12px;
+                        margin-left: 10px;
+                        // line-height: 56rpx;#c86672
+                        background:#92af67;
+                        vertical-align: middle;
+                        color: #ffffff;
+                        border-radius: 12px;
+                        font-size: 24rpx;
+                    }
+                    .activepeople{
+                        background:#c86672;
+                    }
                    .spacestate{
                         font-size: 30rpx;
                         color: #8D9399;
@@ -178,16 +194,6 @@ page{
                         font-size: 46rpx;
                         color: #2B3036;
                    }
-                   .peoplestate{
-                       display: inline-block;
-                       box-sizing: border-box;
-                       padding: 4px 12px;
-                       margin-right: 10px;
-                       background:#d9f5d6;
-                       color: #34c724;
-                       border-radius: 12px;
-                        font-size: 24rpx;
-                   }
                }
             }
             .space_paramelist{

+ 1 - 1
pages/index/index.wxml

@@ -54,6 +54,7 @@
                     <view class="space_msg">
                         <view class="msg_left">
                             <text class="spacename">{{item.localName}}</text>
+                            <text wx:if="{{item.isPassengerPassShow}}" class="peoplestate {{item.isPassengerPass=='有人'?'activepeople':''}}">{{item.isPassengerPass}}</text>
                             <view class="spacestate flex_row">
                                 <text>{{item.state}}</text>
                                 <view hidden="{{!lottieShow}}"><lottie id="lottie{{item.id}}" animationData="{{statusList[item.stateId].canvasDate}}" width="25" height="25"/></view>
@@ -61,7 +62,6 @@
                         </view>
                         <view class="msg_right" catchtap="toDetail" data-istemp="{{true}}" data-spaceid="{{item.id}}" data-projectid="{{item.projectId}}">
                              <!-- <view  wx:if="{{item.isPassengerPassShow}}" class="parame_tag" ><text>{{item.isPassengerPass}}</text></view> -->
-                            <text wx:if="{{item.isPassengerPassShow}}" class="peoplestate">{{item.isPassengerPass}}</text>
                             <text>{{filter.initItemNum('',item.temperature,'温度')}}</text>°C
                         </view>
                     </view>

+ 15 - 10
pages/index/index.wxss

@@ -138,6 +138,21 @@ page {
   font-weight: 400;
   color: #2B3036;
   line-height: 56rpx;
+  vertical-align: middle;
+}
+.contant_box .spacelist_box .space_item .space_msg .msg_left .peoplestate {
+  display: inline-block;
+  box-sizing: border-box;
+  padding: 4px 12px;
+  margin-left: 10px;
+  background: #92af67;
+  vertical-align: middle;
+  color: #ffffff;
+  border-radius: 12px;
+  font-size: 24rpx;
+}
+.contant_box .spacelist_box .space_item .space_msg .msg_left .activepeople {
+  background: #c86672;
 }
 .contant_box .spacelist_box .space_item .space_msg .msg_left .spacestate {
   font-size: 30rpx;
@@ -159,16 +174,6 @@ page {
   font-size: 46rpx;
   color: #2B3036;
 }
-.contant_box .spacelist_box .space_item .space_msg .msg_right .peoplestate {
-  display: inline-block;
-  box-sizing: border-box;
-  padding: 4px 12px;
-  margin-right: 10px;
-  background: #d9f5d6;
-  color: #34c724;
-  border-radius: 12px;
-  font-size: 24rpx;
-}
 .contant_box .spacelist_box .space_item .space_paramelist {
   margin: 0 24rpx;
   background: #F8F9FA;

+ 7 - 1
pages/spacelist/index.js

@@ -25,7 +25,7 @@ Page({
     let projectId = $.store.get('projectId') ||$.storage.get('projectId');
     let tenantId = $.store.get('tenantId')||$.storage.get('tenantId');
     let userId = $.store.get('userId') || $.storage.get('userId');
-    
+
     this.setData({
       currtPage:0,
       projectId:projectId,
@@ -69,6 +69,12 @@ Page({
       if(res.count&&res.content){
         res.content.map(item=>{
           item.picInit=utils.picInit(item.roomFuncType);
+          if(typeof item.isPassengerPass==="undefined"){
+            item.isPassengerPassShow=false;
+          }else{
+            item.isPassengerPassShow=true;
+            item.isPassengerPass=item.isPassengerPass?'有人':'无人'
+          }
         })
         this.setData({alllistContent:this.data.alllistContent.concat(res.content)});
       }else{