소스 검색

fix:提交

guotianliang 3 년 전
부모
커밋
19fbc84045

+ 1 - 0
app.js

@@ -46,6 +46,7 @@ App({
     this.checkUpdate();
   },
   globalData: {
+    specialProject:["Pj1101080259"],
     StatusBar: null,
     Custom: null,
     CustomBar: null,

+ 0 - 1
components/envchart/envchart.js

@@ -39,7 +39,6 @@ function chartFn(data=[],envType,envName) {
     // ];
     let maxTemp;
     let minTemp;
-    console.log(envTypelist[envType],envType,"envType")
     if(envTypelist[envType]){
       maxTemp=envTypelist[envType].max;
       minTemp=envTypelist[envType].min;

+ 9 - 1
pages/adjust/index.js

@@ -189,7 +189,7 @@ Page({
         text:["优","良","差"]
       },
       hcho:{
-        range:[0.05,0.08],
+        range:[0.08,0.1],
         text:["适宜","偏高","超标"]
       }
     };
@@ -798,7 +798,9 @@ Page({
     let day = new Date();
     let year = day.getFullYear();
     let month = day.getMonth() + 1;
+    month=month<10?('0'+month):month;
     let today = day.getDate();
+    today=today<10?('0'+today):today;
     const data={
       projectId:this.data.spaceDetail.projectId,
       date:`${year}${month}${today}`
@@ -863,6 +865,12 @@ Page({
       (content[0].co2||content[0].co2==0)&&(content[0].co2level = this.checkLevel(content[0].co2,"co2"));
       (content[0].pm25||content[0].pm25==0)&&(content[0].pm25level = this.checkLevel(content[0].pm25,"pm25"));
       (content[0].hcho||content[0].hcho==0)&&(content[0].hcholevel = this.checkLevel(content[0].hcho,"hcho"));
+      if(typeof content[0].isPassengerPass==="undefined"){
+        content[0].isPassengerPassShow=false;
+      }else{
+        content[0].isPassengerPassShow=true;
+        content[0].isPassengerPass=content[0].isPassengerPass?'有人':'无人'
+      }
     }
     this.setData({spaceDetail:content[0]},()=>{
       this.checkGuide(value);

+ 12 - 0
pages/adjust/index.less

@@ -159,10 +159,22 @@ page{
             }
         }
         .msg_right{
+            display: flex;
+            align-items: center;
             text{
                 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 - 0
pages/adjust/index.wxml

@@ -46,6 +46,7 @@
                 </view>
             </view>
             <view class="msg_right" bindtap="toDetail">
+                <text wx:if="{{spaceDetail.isPassengerPassShow}}" class="peoplestate">{{spaceDetail.isPassengerPass}}</text>
                 <text>{{filter.initItemNum('',spaceDetail.temperature,'温度')}}</text>°C
             </view>
         </view>

+ 14 - 0
pages/adjust/index.wxss

@@ -148,10 +148,24 @@ page {
   width: 46rpx;
   height: 46rpx;
 }
+.adjust_main .space_msg .msg_right {
+  display: flex;
+  align-items: center;
+}
 .adjust_main .space_msg .msg_right text {
   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;

+ 4 - 1
pages/detail/index.js

@@ -94,7 +94,9 @@ Page({
       let day = new Date();
       let year = day.getFullYear();
       let month = day.getMonth() + 1;
+      month=month<10?('0'+month):month;
       let today = day.getDate();
+      today=today<10?('0'+today):today;
       const data={
         projectId:$.store.get('projectId')||$.storage.get('projectId'),
         dateTiime:`${year}${month}${today}`
@@ -168,7 +170,8 @@ Page({
       }
     }
     let funid = this.data.funcid;
-    let falgPro = (funid==="PM2d5"&&this.data.projectId==="Pj1101080259");
+    let specialProject=$.store.get("specialProject");
+    let falgPro = (funid==="PM2d5"&&specialProject.includes(this.data.projectId));
     (baseArr.length>1)&&baseArr.forEach(item=>{
         item[1] = item[1]=="-9999"?null:falgPro?parseInt(item[1]*1000):initNum[funid](item[1]);
     });

+ 7 - 1
pages/index/index.js

@@ -376,6 +376,12 @@ Page({
         (item.co2||item.co2==0)&&(item.co2level = this.checkLevel(item.co2,"co2"));
         (item.pm25||item.pm25==0)&&(item.pm25level = this.checkLevel(item.pm25,"pm25"));
         (item.hcho||item.hcho==0)&&(item.hcholevel = this.checkLevel(item.hcho,"hcho"));
+        if(typeof item.isPassengerPass==="undefined"){
+          item.isPassengerPassShow=false;
+        }else{
+          item.isPassengerPassShow=true;
+          item.isPassengerPass=item.isPassengerPass?'有人':'无人'
+        }
       })
       this.setData({cardList:res.content})
     }else{
@@ -399,7 +405,7 @@ Page({
         text:["优","良","差"]
       },
       hcho:{
-        range:[0.05,0.08],
+        range:[0.08,0.1],
         text:["适宜","偏高","超标"]
       }
     };

+ 12 - 0
pages/index/index.less

@@ -172,10 +172,22 @@ page{
                    }
                }
                .msg_right{
+                   display: flex;
+                   align-items: center;
                    text{
                         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 - 0
pages/index/index.wxml

@@ -60,6 +60,8 @@
                             </view>
                         </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>

+ 14 - 0
pages/index/index.wxss

@@ -151,10 +151,24 @@ page {
   width: 46rpx;
   height: 46rpx;
 }
+.contant_box .spacelist_box .space_item .space_msg .msg_right {
+  display: flex;
+  align-items: center;
+}
 .contant_box .spacelist_box .space_item .space_msg .msg_right text {
   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;

+ 2 - 0
pages/usercenter/index.js

@@ -167,7 +167,9 @@ Page({
     let day = new Date();
     let year = day.getFullYear();
     let month = day.getMonth() + 1;
+    month=month<10?('0'+month):month;
     let today = day.getDate();
+    today=today<10?('0'+today):today;
     const data={
       projectId:$.store.get('projectId')||$.storage.get('projectId'),
       date:`${year}${month}${today}`

+ 9 - 1
utils/filter.wxs

@@ -10,7 +10,15 @@ var mathFormat = function (num) {
   return formatnum
 }
 var initItemNum = function(project,value,name) {
-  if(project==="Pj1101080259"&&name==="PM2.5"&&value){
+  var specialProject=["Pj1101080259"];
+  var falg=false;
+  for(var i=0;i<specialProject.length;i++){
+    if(specialProject[i]===project){
+      falg=true;
+      break;
+    }
+  }
+  if(falg&&name==="PM2.5"&&value){
     value = parseInt(value*1000);
   }
   if(name==="CO₂"&&value){