guotianliang 4 лет назад
Сommit
8955ead1f1
100 измененных файлов с 7324 добавлено и 0 удалено
  1. 3 0
      .gitignore
  2. 34 0
      app.js
  3. 22 0
      app.json
  4. 10 0
      app.wxss
  5. 107 0
      components/navbar/navbar.js
  6. 6 0
      components/navbar/navbar.json
  7. 11 0
      components/navbar/navbar.wxml
  8. 52 0
      components/navbar/navbar.wxss
  9. 101 0
      components/spacecard/index.js
  10. 7 0
      components/spacecard/index.json
  11. 32 0
      components/spacecard/index.wxml
  12. 82 0
      components/spacecard/index.wxss
  13. 30 0
      components/swiper-dots/index.js
  14. 4 0
      components/swiper-dots/index.json
  15. 5 0
      components/swiper-dots/index.wxml
  16. 23 0
      components/swiper-dots/index.wxss
  17. 165 0
      components/time-picker2/index.js
  18. 4 0
      components/time-picker2/index.json
  19. 24 0
      components/time-picker2/index.wxml
  20. 4 0
      components/time-picker2/index.wxss
  21. BIN
      miniprogram_npm/lottie-miniapp/component/images/img_1.png
  22. BIN
      miniprogram_npm/lottie-miniapp/component/images/img_2.png
  23. BIN
      miniprogram_npm/lottie-miniapp/component/images/img_3.png
  24. BIN
      miniprogram_npm/lottie-miniapp/component/images/img_4.png
  25. BIN
      miniprogram_npm/lottie-miniapp/component/images/img_5.png
  26. BIN
      miniprogram_npm/lottie-miniapp/component/images/img_6.png
  27. BIN
      miniprogram_npm/lottie-miniapp/component/images/img_7.png
  28. BIN
      miniprogram_npm/lottie-miniapp/component/images/img_8.png
  29. 88 0
      miniprogram_npm/lottie-miniapp/component/lottie.js
  30. 3 0
      miniprogram_npm/lottie-miniapp/component/lottie.json
  31. 2 0
      miniprogram_npm/lottie-miniapp/component/lottie.wxml
  32. 4 0
      miniprogram_npm/lottie-miniapp/component/lottie.wxss
  33. 1 0
      miniprogram_npm/lottie-miniapp/index.js
  34. 13 0
      package-lock.json
  35. 14 0
      package.json
  36. 167 0
      pages/auth/index.js
  37. 8 0
      pages/auth/index.json
  38. 17 0
      pages/auth/index.wxml
  39. 44 0
      pages/auth/index.wxss
  40. 253 0
      pages/efficient/index.js
  41. 12 0
      pages/efficient/index.json
  42. 54 0
      pages/efficient/index.wxml
  43. 97 0
      pages/efficient/index.wxss
  44. 1657 0
      pages/index/index.js
  45. 20 0
      pages/index/index.json
  46. 212 0
      pages/index/index.wxml
  47. 454 0
      pages/index/index.wxss
  48. 109 0
      pages/projectlist/index.js
  49. 4 0
      pages/projectlist/index.json
  50. 8 0
      pages/projectlist/index.wxml
  51. 24 0
      pages/projectlist/index.wxss
  52. 181 0
      pages/search/index.js
  53. 11 0
      pages/search/index.json
  54. 35 0
      pages/search/index.wxml
  55. 43 0
      pages/search/index.wxss
  56. 58 0
      project.config.json
  57. 103 0
      requests/api.js
  58. 58 0
      requests/http.js
  59. 7 0
      sitemap.json
  60. BIN
      static/images/CO2.png
  61. BIN
      static/images/PM2.5.png
  62. BIN
      static/images/RH.png
  63. BIN
      static/images/Temp.png
  64. BIN
      static/images/adjust.png
  65. BIN
      static/images/cold.png
  66. BIN
      static/images/good.png
  67. BIN
      static/images/hot.png
  68. BIN
      static/images/ic311.png
  69. BIN
      static/images/ic312.png
  70. BIN
      static/images/ic313.png
  71. BIN
      static/images/ic314.png
  72. BIN
      static/images/ic315.png
  73. BIN
      static/images/ic321.png
  74. BIN
      static/images/ic322.png
  75. BIN
      static/images/ic323.png
  76. BIN
      static/images/ic331.png
  77. BIN
      static/images/lamp.png
  78. BIN
      static/images/logo.jpg
  79. BIN
      static/images/nofollow.png
  80. BIN
      static/images/nolist.png
  81. BIN
      static/images/qrcode.png
  82. BIN
      static/images/room.png
  83. BIN
      static/images/severityCold.png
  84. BIN
      static/images/severityHot.png
  85. BIN
      static/images/severityWind.png
  86. 80 0
      utils/auth.js
  87. 18 0
      utils/filter.wxs
  88. 286 0
      utils/util.js
  89. 2047 0
      utils/wxcharts.js
  90. 1 0
      vant-weapp/dist/area/index.d.ts
  91. 224 0
      vant-weapp/dist/area/index.js
  92. 6 0
      vant-weapp/dist/area/index.json
  93. 18 0
      vant-weapp/dist/area/index.wxml
  94. 1 0
      vant-weapp/dist/area/index.wxss
  95. 1 0
      vant-weapp/dist/button/index.d.ts
  96. 79 0
      vant-weapp/dist/button/index.js
  97. 7 0
      vant-weapp/dist/button/index.json
  98. 68 0
      vant-weapp/dist/button/index.wxml
  99. 1 0
      vant-weapp/dist/button/index.wxss
  100. 0 0
      vant-weapp/dist/card/index.d.ts

+ 3 - 0
.gitignore

@@ -0,0 +1,3 @@
+.DS_Store
+node_modules
+/dist

+ 34 - 0
app.js

@@ -0,0 +1,34 @@
+//app.js
+const AUTH = require('utils/auth')
+App({
+   onLaunch:async function () {
+    // 处理登录
+    // 自动登录
+    // await AUTH.checkHasLogined().then(async isLogined => {
+    //   if (!isLogined) {
+    //     AUTH.login().then(async res=>{
+    //       api.getopenId(res.code).then((res)=>{
+    //         let openId = res.data.openId;
+    //         this.globalData.openId= openId;
+    //         wx.setStorageSync({
+    //           data: openId,
+    //           key: 'openId',
+    //         })
+    //         this.check();
+    //       });
+    //     });
+    //   }
+    // })
+  },
+  globalData: {
+    userInfo: null,
+    hasUserInfo:false,
+    openId:null,
+    userId:null,
+    projectId:"",
+    tenantId:"",
+    tenants:[],
+    projectName:null,
+    imgbaseUrl:"http://api.sagacloud.cn/dp-auxiliary/image-service/common/image_get?systemId=dataPlatform&key=",
+  }
+})

+ 22 - 0
app.json

@@ -0,0 +1,22 @@
+{
+  "pages": [
+    "pages/index/index",
+    "pages/search/index",
+    "pages/efficient/index",
+    "pages/auth/index",
+    "pages/projectlist/index"
+  ],
+  "window": {
+    "backgroundTextStyle": "light",
+    "navigationBarBackgroundColor": "#191b26",
+    "navigationBarTitleText": "WeChat",
+    "navigationBarTextStyle": "white"
+  },
+  "style": "v2",
+  "sitemapLocation": "sitemap.json",
+  "permission": {
+    "scope.userLocation": {
+      "desc": "您的位置信息将用于更好的提供服务"
+    }
+  }
+}

+ 10 - 0
app.wxss

@@ -0,0 +1,10 @@
+/* 初始化样式 */
+page,view,text,swiper,swiper-item,image,navigator{
+  padding: 0;
+  margin: 0;
+  box-sizing: border-box;
+}
+/* 定义主题颜色 */
+page{
+  --themeColor:#191B26;
+}

+ 107 - 0
components/navbar/navbar.js

@@ -0,0 +1,107 @@
+Component({
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+    projectName:{
+        type:String,
+        value:''
+    },
+      background: {
+          type: String,
+          value: 'rgba(0, 0, 0, 1)'
+      },
+      color: {
+          type: String,
+          value: 'rgba(255, 255, 255, 1)'
+      },
+      titleText: {
+          type: String,
+          value: ''
+      },
+      titleImg: {
+          type: String,
+          value: ''
+      },
+      backIcon: {
+          type: String,
+          value: ''
+      },
+      homeIcon: {
+          type: Boolean,
+          value: true
+      },
+      fontSize: {
+          type: Number,
+          value: 32
+      },
+      iconHeight: {
+          type: Number,
+          value: 19
+      },
+      iconWidth: {
+          type:Number,
+          value: 58
+      }
+  },
+  attached: function(){
+      var that = this;
+      that.setNavSize();
+      that.setStyle();
+  },
+  data: {
+
+  },
+  methods: {
+      // 通过获取系统信息计算导航栏高度
+      setNavSize: function() {
+          var that = this
+              , sysinfo = wx.getSystemInfoSync()
+              , statusHeight = sysinfo.statusBarHeight
+              , isiOS = sysinfo.system.indexOf('iOS') > -1
+              , navHeight;
+          if (!isiOS) {
+              navHeight = 48;
+          } else {
+              navHeight = 44;
+          }
+          that.setData({
+              status: statusHeight,
+              navHeight: navHeight
+          })
+      },
+      setStyle: function() {
+          var that  = this
+              , containerStyle
+              , textStyle
+              , iconStyle;
+          containerStyle = [
+              'background:' + that.data.background
+              ].join(';');
+          textStyle = [
+              'color:' + that.data.color,
+              'font-size:' + that.data.fontSize + 'rpx'
+          ].join(';');
+          iconStyle = [
+              'width: ' + that.data.iconWidth + 'px',
+              'height: ' + that.data.iconHeight + 'px'
+          ].join(';');
+          that.setData({
+              containerStyle: containerStyle,
+              textStyle: textStyle,
+              iconStyle: iconStyle
+          })
+      },
+      // 返回事件
+      back: function(){
+          wx.navigateBack({
+              delta: 1
+          })
+          this.triggerEvent('back', {back: 1})
+      },
+      home: function() {
+          console.log(123)
+          this.triggerEvent('home', {});
+      }
+  }
+})

+ 6 - 0
components/navbar/navbar.json

@@ -0,0 +1,6 @@
+{
+  "component": true,
+  "usingComponents": {
+    "van-icon": "../../vant-weapp/dist/icon/index"
+  }
+}

+ 11 - 0
components/navbar/navbar.wxml

@@ -0,0 +1,11 @@
+<view class='nav' style='height: {{status + navHeight}}px'>
+	<view class='status' style='height: {{status}}px;{{containerStyle}}'></view>
+	<view class='navbar' style='height:{{navHeight}}px;{{containerStyle}}'>
+		<view class='home-icon' wx:if="{{homeIcon}}" bindtap='home'>
+        <text class="projectname">{{projectName}}</text><van-icon name="arrow-down" color="#ffffff" class="iconright" />
+    </view>
+		<view class='nav-title'>
+			<text  style='{{textStyle}}'>{{titleText}}</text>
+		</view>
+	</view>
+</view>

+ 52 - 0
components/navbar/navbar.wxss

@@ -0,0 +1,52 @@
+.nav{
+  background-color: #191b26;
+  /* position: fixed; */
+}
+.navbar{
+  position: relative;
+}
+.back-icon, .home-icon{
+  /* width: 170rpx; */
+  height: 100%;
+  color: #fff;
+  align-items: center;
+  font-size: 14px;
+  position: absolute;
+  transform: translateY(-50%);
+  top: 50%;
+  display: flex;
+}
+.back-icon{
+  left: 16px;
+}
+.home-icon{
+  /* left: 44px; */
+  left: 16px;
+}
+.iconright{
+  margin-left: 6px;
+}
+.home-icon .projectname{
+  max-width: 180rpx;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space:nowrap;
+}
+.back-icon image{
+  width: 28px;
+  height: 28px;
+  margin: auto;
+}
+.home-icon image{
+  width: 20px;
+  height: 20px;
+  margin: auto;
+}
+.nav-title, .nav-icon{
+  position: absolute;
+  transform: translate(-50%, -50%);
+  left: 50%;
+  top: 50%;
+  color: #fff;
+  font-size: 0;
+}

Разница между файлами не показана из-за своего большого размера
+ 101 - 0
components/spacecard/index.js


+ 7 - 0
components/spacecard/index.json

@@ -0,0 +1,7 @@
+{
+  "component": true,
+  "usingComponents": {
+    "van-icon": "../../vant-weapp/dist/icon/index",
+    "lottie": "../../miniprogram_npm/lottie-miniapp/component/lottie"
+  }
+}

+ 32 - 0
components/spacecard/index.wxml

@@ -0,0 +1,32 @@
+<!--components/spacecard/spacecard.wxml-->
+
+<wxs src="../../utils/filter.wxs" module="filter" />
+<view>
+<!--  class="{{imgShow?'hide_box':'del_box'}}" -->
+	<view class="card_box" bindtap="goHome">
+		<view class="card_img">
+		<!-- 1592813009674.jpg -->
+			<image src="{{cardDate.picInit}}" wx:if="{{!imgShow}}"></image>
+			<image src="{{imgbaseUrl+cardDate.pic}}&width=136&height=108" wx:if="{{cardDate.pic}}" class='{{imgShow ? "" : "before-load"}}'  bindload="imageLoad" lazy-load="{{true}}"></image>
+			<!-- <view wx:if="{{!cardDate.pic}}" class="noimgbox">暂无图片</view> -->
+		</view>
+		<view class="card_msg">
+			<view>
+				<text>{{cardDate.localName}}</text>
+				<van-icon name="{{cardDate.subscribe?'star':'star-o'}}" wx:if="{{!isCheckbox}}" catchtap="changeStar" data-checked="{{cardDate.subscribe}}" color="{{cardDate.subscribe?'#f5a900':''}}" />
+			</view>
+			<view>
+				<view class="imgbox">
+					<view  class="lottie {{canvashidden?'':lottiehidden}}" wx:if="{{canvashidden}}">
+					<lottie id="lottie" canId="{{cardDate.id}}" animationData="{{statusList[cardDate.stateId].canvasDate}}" width="25" height="25"/></view>
+					<!-- <image src="{{statusList[cardDate.stateId].canvasDate}}"></image> -->
+					<text>{{cardDate.state}}</text>
+				</view>
+				<view class="tempnum">
+					{{filter.mathFormat(cardDate.temperature)|| '--'}}{{unit}}
+				</view>
+			</view>
+		</view>
+	</view>
+	<!-- <van-divider /> -->
+</view>

+ 82 - 0
components/spacecard/index.wxss

@@ -0,0 +1,82 @@
+/* components/spacecard/spacecard.wxss */
+.card_box{
+  display: flex;
+  flex-direction: row;
+  justify-content: space-around;
+}
+.card_img{
+  width:136rpx;
+  height: 108rpx;
+  border-radius:8rpx;
+  overflow: hidden;
+}
+.noimgbox{
+  width: 100%;
+  height: 100%;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  background-color: #cccccc;
+  color: #ffffff;
+  font-size: 12px;
+}
+.card_img image{
+  width: 100%;
+  height: 100%;
+}
+.card_msg{
+  flex: 1;
+  padding-left: 32rpx;
+}
+.card_msg>view{
+  display: flex;
+  justify-content: space-between;
+  flex-direction: row;
+}
+.imgbox{
+  display: flex;
+  align-items: center;
+}
+.imgbox image{
+  width: 40rpx;
+  height: 40rpx;
+  margin-right: 6rpx;
+}
+.card_msg>view:nth-child(1){
+  margin-top: 4rpx;
+  color:rgba(25,27,38,1);
+  font-size: 32rpx;
+}
+.card_msg>view:nth-child(2){
+  color: #80838F;
+  font-size: 28rpx;
+  margin-top: 16rpx;
+}
+.card_msg>view .tempnum{
+  color: #191B26;
+}
+.lottie{
+  width: 50rpx;
+  height: 50rpx;
+  z-index: 1;
+}
+.lottiehidden{
+  height: 0rpx;
+}
+.del_box{
+  display: none;
+}
+.hide_box{
+  display: flex;
+}
+/* .imagebg::after{
+  background: url(../../static/images/room.png)
+}
+.imagebg[src^="http"]::after{
+  opacity: 0;
+} */
+.before-load {
+  width: 0;
+  height: 0;
+  opacity: 0;
+}

+ 30 - 0
components/swiper-dots/index.js

@@ -0,0 +1,30 @@
+// components/swiper-dots/index.js
+Component({
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+    swiperCurrent:{
+      type:Number,
+      value:0
+    },
+    swiperNum:{
+      type:Number,
+      value:1
+    }
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+
+  }
+})

+ 4 - 0
components/swiper-dots/index.json

@@ -0,0 +1,4 @@
+{
+  "component": true,
+  "usingComponents": {}
+}

+ 5 - 0
components/swiper-dots/index.wxml

@@ -0,0 +1,5 @@
+<view class="dots" wx:if="{{swiperNum!==1}}"> 
+    <view>
+      <view wx:for="{{swiperNum}}" class="dot{{index == swiperCurrent ? ' active' : ''}}"  wx:key="{{index}}"></view> 
+    </view> 
+  </view>

+ 23 - 0
components/swiper-dots/index.wxss

@@ -0,0 +1,23 @@
+/* components/swiper-dots/index.wxss */
+.dots{
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+.dots>view view{
+  display: inline-block;
+}
+
+.dots .dot{ 
+  margin: 0 8rpx; 
+  width: 8rpx; 
+  height: 8rpx; 
+  background: #D8D8D8; 
+  border-radius: 4rpx; 
+  transition: all .6s; 
+} 
+.dots .dot.active{ 
+  width:32rpx;
+  border-radius:4rpx;
+  background: #5575FF;
+}

+ 165 - 0
components/time-picker2/index.js

@@ -0,0 +1,165 @@
+import util from "../../utils/util";
+const date = new Date()
+const days = ["今天", "明天"]
+// 初始化日期
+for (var i = 2; i <= 15; i++) {
+  var date1 = new Date(date);
+  date1.setDate(date.getDate() + i);
+  var md = (date1.getMonth() + 1) + "-" + date1.getDate();
+  days.push(md);
+}
+
+function getDistanceSpecifiedTime(yyyy,mth,dd) {
+  // 指定日期和时间
+  var EndTime = new Date(yyyy,mth,dd);
+  // 当前系统时间
+  var NowTime = new Date();
+  var NowTimeday = NowTime.getDay();
+  var EndTimeday = EndTime.getDay();
+  var t = EndTime.getTime() - NowTime.getTime();
+  var d = Math.ceil(t / 1000 / 60 / 60 / 24);
+  console.log(NowTimeday,EndTimeday);
+  if(NowTimeday==EndTimeday){
+    d=0;
+  }else if(NowTimeday!=EndTimeday&&d==0){
+    d=1
+  }
+  // var h = Math.floor(t / 1000 / 60 / 60 % 24);
+  // var m = Math.floor(t / 1000 / 60 % 60);
+  // var s = Math.floor(t / 1000 % 60);
+  // var html = d + " 天" + h + " 时" + m + " 分" + s + " 秒";
+  return d;
+}
+
+Component({
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+    nextOpenTime:{
+      type:String,
+      value:''
+    }
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+    days,
+    hours: [],
+    minutes: [],
+    minute: 2,
+    hour: 8,
+    day: 2,
+    multiIndex: [0, 0, 0],
+    
+  },
+  attached() {
+    this.loadTime("today",0);
+    if(this.data.nextOpenTime){ 
+      let nextHour=this.data.nextOpenTime.substring(8,10);
+      let nextMin=this.data.nextOpenTime.substring(10,12);
+      var day = getDistanceSpecifiedTime(this.data.nextOpenTime.substring(0,4),this.data.nextOpenTime.substring(4,6)-1,this.data.nextOpenTime.substring(6,8));
+      if(day == 0){
+        let currentHours = date.getHours();
+        let currentMinute = date.getMinutes();
+        this.setData({multiIndex:[0,nextHour - currentHours,currentMinute-nextMin]})
+      }else if(day == 1){
+        this.loadTime();
+        this.setData({multiIndex:[1,Number(nextHour),Number(nextMin)]});
+      }else{
+        console.log(day,"day")
+        this.loadTime();
+        this.setData({multiIndex:[day,nextHour,nextMin]});
+      }
+
+    }
+    console.log(this.data.multiIndex);
+    
+  },
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+    bindChange(e) {
+      const val = e.detail.value;
+      console.log(e)
+      if (val[0] !== 0) {
+        this.loadTime();
+      }else{
+        this.loadTime("today",e.detail.value[1]);
+      }
+      this.setData({
+        day: this.data.days[val[0]],
+        hour: this.data.hours[val[1]],
+        minute: this.data.minutes[val[2]]
+      })
+      this.sendDate();
+    },
+    fillZore(value){
+      if(value<10){
+        value = 0+value
+      }
+      return value
+    },
+    // 发送数据
+    sendDate(){
+      var monthDay=this.data.day;
+      var dayHour=this.data.hour;
+      var dayMinute=this.data.minute;
+      var monthDaystring='2020';
+      if ( monthDay=== "今天") {
+        var month = date.getMonth() + 1;
+        var day = date.getDate();
+        monthDaystring=monthDaystring+util.PrefixZero(month)+util.PrefixZero(day)+util.PrefixZero(dayHour)+util.PrefixZero(dayMinute);
+        monthDay = monthDay + dayHour +':'+dayMinute;
+      } else if (monthDay === "明天") {
+        var date1 = new Date(date);
+        date1.setDate(date.getDate() + 1);
+        monthDaystring=monthDaystring+util.PrefixZero(date1.getMonth() + 1)+util.PrefixZero(date1.getDate())+util.PrefixZero(dayHour)+util.PrefixZero(dayMinute);
+        monthDay = monthDay + dayHour +':'+dayMinute;
+      } else {
+        var month = monthDay.split("-")[0]; // 返回月
+        var day = monthDay.split("-")[1]; // 返回日
+        monthDaystring=monthDaystring+util.PrefixZero(month)+util.PrefixZero(day)+util.PrefixZero(dayHour)+util.PrefixZero(dayMinute);
+        monthDay = month + "月" + day + "日"+ dayHour +':'+dayMinute;
+      }
+      monthDaystring=monthDaystring+'00';
+      this.triggerEvent('timeChange', {monthDay,monthDaystring});
+    },
+    loadTime(value,now) {
+      let hours=[];
+      let minutes=[];
+      var startHours = 0;
+      var startMinute = 0;
+      if(value==="today"){
+        var currentHours = date.getHours();
+        var currentMinute = date.getMinutes();
+        startHours=currentHours;
+        startMinute=now===0?currentMinute:0;
+      }
+      // 初始化小时
+      for (let i = startHours; i <= 23; i++) {
+        if (i < 10) {
+          hours.push('0' + i)
+        } else {
+          hours.push(i)
+        }
+      }
+      // 初始化分钟
+      for (let i = startMinute; i <= 59; i++) {
+        if (i < 10) {
+          minutes.push('0' + i)
+        } else {
+          minutes.push(i)
+        }
+      }
+      var data={
+        hours:hours,
+        minutes:minutes,
+      }
+      this.setData(data)
+    },
+  }
+})

+ 4 - 0
components/time-picker2/index.json

@@ -0,0 +1,4 @@
+{
+  "component": true,
+  "usingComponents": {}
+}

+ 24 - 0
components/time-picker2/index.wxml

@@ -0,0 +1,24 @@
+<view class="container">
+		<view class="page-body">
+			<picker-view indicator-style="height: 64px;" style="width: 100%; height: 340rpx;" value="{{multiIndex}}" bindchange="bindChange">
+				<picker-view-column>
+					<view wx:for="{{days}}" wx:key="{{index}}" class="center_box">{{item}}</view>
+				</picker-view-column>
+				<picker-view-column>
+					<view wx:for="{{hours}}" wx:key="{{index}}" class="center_box">{{item}}</view>
+				</picker-view-column>
+				<picker-view-column>
+					<view wx:for="{{minutes}}" wx:key="{{index}}" class="center_box">{{item}}</view>
+				</picker-view-column>
+				<!-- <picker-view-column>
+					<view class="icon-container center_box">
+              AM
+					</view>
+					<view class="icon-container center_box">
+						PM
+					</view>
+				</picker-view-column> -->
+			</picker-view>
+		</view>
+
+	</view>

+ 4 - 0
components/time-picker2/index.wxss

@@ -0,0 +1,4 @@
+/* components/time-picker/index.wxss */
+.center_box{
+  line-height: 64px; text-align: center;
+}

BIN
miniprogram_npm/lottie-miniapp/component/images/img_1.png


BIN
miniprogram_npm/lottie-miniapp/component/images/img_2.png


BIN
miniprogram_npm/lottie-miniapp/component/images/img_3.png


BIN
miniprogram_npm/lottie-miniapp/component/images/img_4.png


BIN
miniprogram_npm/lottie-miniapp/component/images/img_5.png


BIN
miniprogram_npm/lottie-miniapp/component/images/img_6.png


BIN
miniprogram_npm/lottie-miniapp/component/images/img_7.png


BIN
miniprogram_npm/lottie-miniapp/component/images/img_8.png


+ 88 - 0
miniprogram_npm/lottie-miniapp/component/lottie.js

@@ -0,0 +1,88 @@
+'use strict';
+
+var _index = require('../index.js');
+
+var _index2 = _interopRequireDefault(_index);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+Component({
+  properties: {
+    width: {
+      type: Number,
+      value: 100
+    },
+    height: {
+      type: Number,
+      value: 100
+    },
+    path: {
+      type: String,
+      observer: function observer() {
+        this.init();
+      }
+    },
+    animationData: {
+      type: Object,
+      observer: function observer() {
+        this.init();
+      }
+    },
+    loop: {
+      type: Boolean,
+      value: true
+    },
+    autoplay: {
+      type: Boolean,
+      value: true
+    },
+    canId:{
+      type:String,
+      value:'0'
+    }
+  },
+  ready: function ready() {
+    this.init.bind(this);
+  },
+
+  methods: {
+    init: function init(animationData) {
+      var width = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.properties.width;
+      var height = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.properties.height;
+
+      var data = animationData || this.properties.animationData;
+      var dataPath = this.properties.path;
+      if (!data && !dataPath) {
+        return;
+      }
+
+      this.destory();
+      var that=this;
+      var canvasContext = _index.api.createCanvasContext(`test-canvas`, that);
+      canvasContext.canvas = {
+        width: width,
+        height: height
+      };
+
+      that.lottie = _index2.default.loadAnimation({
+        renderer: 'canvas', // 只支持canvas
+        loop: that.data.loop,
+        autoplay: that.data.autoplay,
+        animationData: data,
+        rendererSettings: {
+          context: canvasContext,
+          clearCanvas: true
+        }
+      });
+    },
+    destory: function destory() {
+      if (this.lottie) {
+        this.lottie.destroy();
+        this.lottie = null;
+      }
+    }
+  },
+  detached: function detached() {
+    this.destory.bind(this);
+  }
+});

+ 3 - 0
miniprogram_npm/lottie-miniapp/component/lottie.json

@@ -0,0 +1,3 @@
+{
+  "component": true
+}

+ 2 - 0
miniprogram_npm/lottie-miniapp/component/lottie.wxml

@@ -0,0 +1,2 @@
+<canvas canvas-id="test-canvas" class="lottie-canvas"></canvas>
+<!-- {{canId}} -->

+ 4 - 0
miniprogram_npm/lottie-miniapp/component/lottie.wxss

@@ -0,0 +1,4 @@
+.lottie-canvas {
+  width: 100%;
+  height: 100%;
+}

Разница между файлами не показана из-за своего большого размера
+ 1 - 0
miniprogram_npm/lottie-miniapp/index.js


+ 13 - 0
package-lock.json

@@ -0,0 +1,13 @@
+{
+  "name": "env-minp",
+  "version": "1.0.0",
+  "lockfileVersion": 1,
+  "requires": true,
+  "dependencies": {
+    "lottie-miniapp": {
+      "version": "1.9.0-0",
+      "resolved": "http://dev.dp.sagacloud.cn:8082/repository/npm-saga/lottie-miniapp/-/lottie-miniapp-1.9.0-0.tgz",
+      "integrity": "sha512-oQRgOO6xAkqWu8NqylBFZcmRAYdhQH2E0IreoyDJ83ggrNRMGMrMq/j4M2U/a97DIt54iB7kBYMiHhU4fVaffw=="
+    }
+  }
+}

+ 14 - 0
package.json

@@ -0,0 +1,14 @@
+{
+  "name": "env-minp",
+  "version": "1.0.0",
+  "description": "",
+  "main": "app.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "author": "",
+  "license": "ISC",
+  "dependencies": {
+    "lottie-miniapp": "^1.9.0-0"
+  }
+}

+ 167 - 0
pages/auth/index.js

@@ -0,0 +1,167 @@
+// pages/auth/index.js
+const app = getApp();
+const AUTH = require('../../utils/auth');
+import {userSave,getuserPhone} from "../../requests/api";
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    canIUse: wx.canIUse('button.open-type.getUserInfo'),
+    phonePop:false,
+    wxqcode:'',
+    locationFalg:false,
+  },
+  getUserInfoFn(res){
+    if(res.detail.errMsg==='getUserInfo:ok'){
+      app.globalData.userInfo=res.detail.userInfo;
+      this.setData({phonePop:true});
+    }else{
+      this.setData({phonePop:true});
+    }
+  },
+  bindGetPhoneNumber(e){
+    if (e.detail.errMsg == "getPhoneNumber:ok"){
+      AUTH.checkHasLogined().then(isLogined=>{
+        console.log(isLogined,"isLogined")
+        if(isLogined){
+          var data={};
+          data.encryptedData=e.detail.encryptedData;
+          data.iv=e.detail.iv;
+          data.openid=wx.getStorageSync('openId') || app.globalData.openId;
+          getuserPhone(data).then(async result=>{
+            console.log(result,"result")
+            if(result.result==="success"){
+              app.globalData.phoneNumber=result.phoneNumber;
+              await this.creatUser();
+              this.goHome();
+            }
+          })
+        }
+      })
+    }else{
+      this.goHome()
+    }
+  },
+  
+  goHome(){
+    // wx.redirectTo({
+    //   url: '../index/index',
+    // })
+    let pages = getCurrentPages(); 
+    let prevPage = pages[ pages.length - 2 ];
+    if(this.data.wxqcode){
+      prevPage.setData({  // 将我们想要传递的参数在这里直接setData。上个页面就会执行这里的操作。
+        wxqcode:this.data.wxqcode,
+        formWxcode:true,
+      })
+    }
+    
+    console.log(prevPage,"prevPage")
+    prevPage.setData({ 
+      formAuth:true,
+    })
+    console.log(prevPage.data,"prevPage")
+    wx.navigateBack({
+      delta: 1  // 返回上一级页面。
+    })
+  },
+  onClose(event){
+    console.log(event);
+    if(event.detail==="cancel"){
+      this.setData({phonePop:false});
+      wx.setStorage({
+        data: true,
+        key: 'clickPhone',
+      })
+      // wx.redirectTo({
+      //   url: '../index/index',
+      // })
+      this.goHome();
+    }
+  },
+  // 创建用户
+  async creatUser(){
+    const data={};
+    data.phone =app.globalData.phoneNumber;
+    data.openId =wx.getStorageSync('openId') ;
+    data.nickname=app.globalData.userInfo.nickName;
+    // data.userName=app.globalData.userInfo.nickName;
+    console.log(data);
+    let res = await userSave(data);
+    if(res.result==="success"){
+      app.globalData.userId=res.id;
+      wx.setStorageSync('userId', res.id);
+      wx.setStorageSync('logined', true);
+    }
+  },
+  async getUserLocation() {
+    var that = this;
+    await wx.getLocation({
+      altitude: 'false',
+      type: 'wgs84',
+      complete: (res) => {
+        that.setData({locationFalg:true})
+      },
+      success:async res=> {
+        let data={}
+        data.x=res.longitude;
+        data.y=res.latitude;
+        that.setData({
+          latitude:res.latitude
+        })
+        that.setData({
+          longitude:res.longitude
+        })
+        wx.setStorageSync('latitude', res.latitude)
+        wx.setStorageSync('longitude', res.longitude)    
+      },
+      fail() {
+
+        // Toast.fail('未定位到您所在位置');
+        // that.checkPower();
+        // that.setData({havePower:{result:"fail",message:"未定位到您的位置"}})
+      }
+    })
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    this.getUserLocation();
+    var wxqcode=wx.getStorageSync('wxqcode');
+    if(wxqcode){
+      this.setData({wxqcode:wxqcode})
+    }
+    
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+})

+ 8 - 0
pages/auth/index.json

@@ -0,0 +1,8 @@
+{
+  "usingComponents": {
+    "van-dialog": "../../vant-weapp/dist/dialog/index",
+    "van-button": "../../vant-weapp/dist/button/index",
+    "van-icon": "../../vant-weapp/dist/icon/index"
+  },
+  "navigationBarTitleText": "登录"
+}

+ 17 - 0
pages/auth/index.wxml

@@ -0,0 +1,17 @@
+<!--pages/auth/index.wxml-->
+<view class="login_box" wx-if="{{locationFalg}}">
+	<van-dialog use-slot show="{{ phonePop }}" show-cancel-button confirm-button-open-type="getPhoneNumber" 
+	bind:close="onClose" bind:getphonenumber="bindGetPhoneNumber">
+		<view class="phonetxt">
+			朵朵环境管家请求获取您的手机号
+		</view>
+	</van-dialog>
+	<view class="logomain">
+		<view class="logo">
+			<image src="../../static/images/logo.jpg"></image>
+		</view>
+		<view class="logo_txt">朵朵环境管家</view>
+	</view>
+	<!-- <van-button open-type='getUserInfo' bind:getuserinfo="getUserInfoFn" type="primary">快速调节绑定</van-button> -->
+	<button class="btnquick" open-type='getUserInfo' bindgetuserinfo="getUserInfoFn" type="primary">快速调节绑定</button>
+</view>

+ 44 - 0
pages/auth/index.wxss

@@ -0,0 +1,44 @@
+page{
+  width: 100%;
+  height: 100%;
+}
+.btnquick{
+ margin: 0 40rpx;
+}
+.login_box{
+  display: flex;
+  justify-content: center;
+  width: 100%;
+  height: 100%;
+  align-items: center;
+  flex-direction: column;
+}
+.login_box .van-dialog__footer button:not([size='mini']){
+  width: 100%;
+}
+.phonetxt{
+  display: flex;
+  padding: 30rpx;
+  justify-content: center;
+}
+.logomain{
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  flex-direction: column;
+  margin-bottom: 120rpx;
+}
+.logo{
+  width: 150rpx;
+  height: 150rpx;
+  border-radius: 50%;
+  overflow: hidden;
+}
+.logo image{
+  width: 150rpx;
+  height: 150rpx;
+}
+.logo_txt{
+  margin-top: 60rpx;
+  font-size: 16px;
+}

Разница между файлами не показана из-за своего большого размера
+ 253 - 0
pages/efficient/index.js


+ 12 - 0
pages/efficient/index.json

@@ -0,0 +1,12 @@
+{
+  "usingComponents": {
+    "van-checkbox": "../../vant-weapp/dist/checkbox/index",
+    "van-checkbox-group": "../../vant-weapp/dist/checkbox-group/index",
+    "spacecard": "../../components/spacecard/index",
+    "time-picker2": "../../components/time-picker2/index",
+    "van-divider": "../../vant-weapp/dist/divider/index",
+    "van-popup": "../../vant-weapp/dist/popup/index",
+    "lottie": "../../miniprogram_npm/lottie-miniapp/component/lottie"
+  },
+  "navigationBarTitleText": "关机"
+}

+ 54 - 0
pages/efficient/index.wxml

@@ -0,0 +1,54 @@
+<!--pages/efficient/index.wxml-->
+<view class="work_off">
+	<view class="allselect">
+		<text>这里仅展示您关注的房间哟</text>
+		<text bindtap="allSelect">全选</text>
+	</view>
+	<!--  {{imgShow?'':'del_box'}} -->
+	<view  class="checkitems">
+		<van-checkbox-group bind:change="checkChange" value="{{ checkedList }}">
+			<!--  disabled="{{true}}" -->
+			<block wx:for="{{listContent}}">
+				<van-checkbox name="{{item.id}}" shape="square" wx:key="{{index}}" disabled="{{item.isClose}}">
+					<spacecard isCheckbox="true" cardDate="{{item}}" canvashidden="{{!poptimeValue&&!secondpopValue}}"></spacecard>
+				</van-checkbox>
+				<van-divider custom-style="padding-left: 8.5%" />
+			</block>
+		</van-checkbox-group>
+		<!-- <time-picker /> -->
+	</view>
+	<view class="checkfooter"></view>
+	<!-- popValue -->
+	<cover-view wx:if="{{ popValue }}" class="lifan"> 
+		<cover-view class="spacedetail">
+			<cover-view class="detailtxt">
+				<cover-view>{{monthDay}} 恢复正常,</cover-view>
+				<cover-view bindtap="changeTime" class="detailtxtclick">点击修改</cover-view>
+			</cover-view>
+			<cover-view bindtap="openClose" class="custom_button">确定关机</cover-view>
+		</cover-view>
+	</cover-view>
+
+	<van-popup show="{{ poptimeValue }}" round closeable bind:close="popClose" position="bottom" custom-style="height:624rpx" wx:if="{{poptimeValue}}">
+		<view class="spacedetail">
+			<view class="space_title">修改时间</view>
+			<view class="space_title space_smalltitle">(系统判断是否会生效)</view>
+			<time-picker2 wx:if="{{poptimeValue}}" InitTime="{{InitTime}}" bind:timeChange="getTimevalue" nextOpenTime="{{monthDaystring}}" />
+			<view class="custom_button" bindtap="commitBtn">确定</view>
+		</view>
+	</van-popup>
+	<!-- 关机二次确认弹窗 -->
+	<van-popup show="{{ secondpopValue }}" round bind:close="commitClose" position="bottom" custom-style="height:400rpx;border-top:1px solid #ededee">
+		<view class="spacedetail seconddetail">
+			<view class="secondtxt secondtxt_title">
+				<view class="lottie" wx:if="{{!popShow}}">
+					<lottie id="lottie" animationData="{{canvasDate}}" width="25" height="25" />
+				</view>
+				空调将关闭
+			</view>
+			<view class="secondtxt">为您的节能意识点赞</view>
+			<view class="secondtxt">今日不会自动开启环境调节,如您需要可手动开启</view>
+			<view class="custom_button" bindtap="commitClose">关闭</view>
+		</view>
+	</van-popup>
+</view>

+ 97 - 0
pages/efficient/index.wxss

@@ -0,0 +1,97 @@
+/* pages/efficient/index.wxss */
+.work_off{
+  /* padding:0 20rpx ; */
+}
+.allselect{
+  display: flex;
+  align-items: center;
+  padding: 16rpx;
+  height:80rpx;
+  background:#F4F4F5;
+  justify-content: space-between;
+  /* flex-direction:row-reverse */
+}
+.allselect text:nth-child(2){
+  color: #5575FF;
+  font-size:16px;
+}
+.allselect text:nth-child(1){
+  color: #191B26;
+  font-size: 14px;
+}
+.van-checkbox__label {
+  width: 90%;
+}
+.checkitems{
+  margin:24rpx 0 0 32rpx;
+}
+.spacedetail {
+  padding: 25rpx 32rpx 0;
+}
+.space_title{
+  text-align: center;
+  margin-bottom: 20rpx;
+}
+.space_smalltitle{
+  font-size: 12px;
+}
+.checkfooter{
+  height: 240rpx;
+}
+.detailtxt{
+  display: flex;
+  justify-content: center;
+  /* align-items: center; */
+  /* text-align: center; */
+  font-size:14px;
+  color: #80838F;
+}
+.detailtxtclick{
+  color: #5575FF;
+}
+.custom_button{
+  box-sizing: content-box;
+  padding: 24rpx 32rpx;
+  height: 40rpx;
+  display: flex;
+  margin-top: 32rpx;
+  justify-content: center;
+  text-align: center;
+  align-items: center;
+  background-color: #5575FF;
+  color: #ffffff;
+  font-size: 16px;
+  border-radius:40rpx;
+}
+.lifan {
+  z-index: 999;
+  width: 100%;
+  background-color: #ffffff;
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  height: 300rpx;
+  height:240rpx;
+  border-top:1px solid #ededee
+}
+.lottie{
+  width: 50rpx;
+  height: 50rpx;
+}
+.seconddetail{
+  color:#333333;
+}
+.secondtxt{
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  font-size: 14px;
+  margin-bottom: 20rpx;
+}
+.secondtxt_title{
+  font-size: 20px;
+  margin-bottom: 18rpx;
+}
+.del_box{
+  display: none;
+}

Разница между файлами не показана из-за своего большого размера
+ 1657 - 0
pages/index/index.js


+ 20 - 0
pages/index/index.json

@@ -0,0 +1,20 @@
+{
+  "usingComponents": {
+    "van-transition": "../../vant-weapp/dist/transition/index",
+    "van-button": "../../vant-weapp/dist/button/index",
+    "van-icon": "../../vant-weapp/dist/icon/index",
+    "van-popup": "../../vant-weapp/dist/popup/index",
+    "van-toast": "../../vant-weapp/dist/toast/index",
+    "navbar":"../../components/navbar/navbar",
+    "van-divider": "../../vant-weapp/dist/divider/index",
+    "swiper-dots": "../../components/swiper-dots/index",
+    "van-radio": "../../vant-weapp/dist/radio/index",
+    "van-radio-group": "../../vant-weapp/dist/radio-group/index",
+    "van-notice-bar": "../../vant-weapp/dist/notice-bar/index",
+    "van-sticky": "../../vant-weapp/dist/sticky/index",
+    "lottie": "../../miniprogram_npm/lottie-miniapp/component/lottie"
+   
+  },
+  "navigationStyle":"custom",
+  "navigationBarTitleText": "扫码调节"
+}

+ 212 - 0
pages/index/index.wxml

@@ -0,0 +1,212 @@
+<wxs src="../../utils/filter.wxs" module="filter" />
+<!--index.wxml-->
+<view class="container">
+<van-sticky>
+  <!-- <van-button type="primary">基础用法</van-button> -->
+	<navbar titleText='环境调节' projectName='{{tenantName}}' homeIcon="{{tenants.length>1?true:false}}" bind:home="goProject"></navbar>
+</van-sticky>
+	<!-- 轮播图部分 -->
+	<view class="header_container">
+		<view class="header_box">
+		<!--  indicator-dots="true"  -->
+		<swiper duration="1000" circular="true" bindchange="swiperChange" current="{{swiperCurrent}}">
+			<block wx:for="{{swiperDate}}" wx:key="index">
+				<swiper-item  bindtap="changePop" data-index="{{index}}">
+					<image src="{{item.initPic}}" wx:if="{{!item.imgShow||!item.pic}}"></image>
+					<!--   -->
+					<image wx:key="index" src="{{imgbaseUrl+item.pic}}&width=2154&height=1464" wx-if="{{!item.isInit&&item.pic}}" class='{{item.imgShow ? "" : "before-load"}}' bindload="imageLoad"  data-index="{{index}}"></image>
+					<!-- <image src="{{item.pic}}" wx-if="{{item.isInit}}" mode="scaleToFill"></image> -->
+					<view class="img_footer">
+						<!-- 环境参数信息 -->
+						<view>
+							<image src="../../static/images/Temp.png" mode="aspectFill"></image>
+							温度: <view class="envitem">{{filter.mathFormat(item.temperature) || '--'}} <text>°C</text></view>
+						</view>
+						<view>
+							<image src="../../static/images/CO2.png"></image>
+							CO2: <view class="envitem">{{filter.mathFormat(item.co2) || '--'}} <text>ppm</text> </view>
+						</view>
+						<view>
+							<image src="../../static/images/RH.png"></image>
+							湿度: <view class="envitem">{{filter.mathFormat(item.humidity) || '--'}} <text>%</text></view>
+						</view>
+						<view>
+							<image src="../../static/images/PM2.5.png"></image>PM2.5: <view class="envitem">{{filter.mathFormat(item.pm25) || '--'}} <text>μg/m³</text></view>
+						</view>
+					</view>
+					<view class="fixed_box" wx:if="{{!item.isInit}}">
+						<!-- 房间及定位 -->
+						<view class="roombg"><text>{{item.localName}}</text></view>
+						<!-- bindtap="changePop" data-index="{{index}}" -->
+						<view class="envshow">
+							<view>
+							<view  class="lottie" wx:if="{{!popShow}}"><lottie id="lottie" animationData="{{statusList[item.stateId].canvasDate}}" width="25" height="25"/></view>
+								<!-- <image src="{{statusList[item.stateId].imgSrc}}"></image> -->
+								<text>{{item.state}}</text>
+							</view>
+							<view class="fixed_dec">调节
+								<van-icon name="arrow" color="#c3c6cb" />
+							</view>
+						</view>
+					</view>
+				</swiper-item>
+			</block>
+		</swiper>
+	</view>
+	</view>
+	
+	<!-- 轮播图小点 -->
+	<swiper-dots swiperCurrent="{{swiperCurrent}}" swiperNum="{{swiperDate.length}}"></swiper-dots>
+	<!-- 按钮部分 -->
+	<view class="btn_list">
+		<view id="{{item.id}}" catchtap="itemClick" class="btn_item" wx:for='{{meauList}}' wx:key="index">
+			<view class="item_img">
+				<!-- <van-icon name="qr" size="1em" /> -->
+				<image src="{{item.imgSrc}}" mode="aspectFill"></image>
+			</view>
+			<view>
+				<text class="item_title">{{item.title}}</text>
+				<text  class="item_des">{{item.des}}</text>
+			</view>
+			<view class="item_">
+				<van-icon name="arrow" color="#C3C6CB" />
+			</view>
+		</view>
+	</view>
+	<!-- 弹窗部分  custom-style="height:1200rpx"-->
+	<van-popup show="{{ popShow }}" round closeable="{{(popswiperDate.isClose||!feedBack)?flase:true}}" position="bottom" bind:close="popClose">
+		<view class="spacedetail" catchtouchmove="preventTouchMove" >
+			<!-- 房间名称 -->
+			<view class="space_title">{{popswiperDate.localName}}</view>
+			<!-- 数据列表 -->
+			<swiper current="{{popswiperCurrent}}" bindchange="popswiperChange" circular="true">
+				<swiper-item>
+					<view class="item_list">
+						<block wx:for="{{envList}}" wx:key="index">
+							<view class="list_item">
+								<view>{{filter.mathFormat(item.value) + item.unit|| '--'}}</view>
+								<view>{{item.name}}</view>
+							</view>
+						</block>
+					</view>
+				</swiper-item>
+				<swiper-item wx:if="{{feedBack&&!popswiperDate.isClose}}">
+				<!--  catchtouchmove='preventTouchMove'  bindtouchstart="touchHandler" wx:if="{{chartShow}}"-->
+				<!-- {{!feedBack?'123':'456'}} -->
+					<view class="canvas {{(!popShow||!chartShow)?'canvashidden':''}}}}" wx:key="{{feedBack}}" >
+						<canvas canvas-id="areaCanvas" ></canvas>
+					</view>
+					<view wx:if="{{!chartShow}}" class="canvascenter">
+						<view>小主辛苦了</view>
+						<view>还未开始显示哦</view>
+					</view>
+				</swiper-item>
+			</swiper>
+			<!-- 轮播图小点 -->
+			<swiper-dots swiperCurrent="{{popswiperCurrent}}" swiperNum="{{(feedBack&&!popswiperDate.isClose)?2:1}}"></swiper-dots>
+			<view class="envstate" wx:if="{{feedBack&&!popswiperDate.isClose}}">
+			<view class="lottie" wx:if="{{popShow}}">
+				<lottie id="lottie" animationData="{{statusList[popswiperDate.stateId].canvasDate}}" width="25" height="25" wx:key="{{statusList[popswiperDate.stateId]}}"/>
+			</view>
+				<!-- <image src="{{statusList[popswiperDate.stateId].imgSrc}}"></image> -->
+				{{popswiperDate.state}}
+			</view>
+			<van-divider wx:if="{{feedBack&&!popswiperDate.isClose}}" />
+			<!-- 反馈列表 -->
+			<view class="feedback_list" wx:if="{{feedBack&&!popswiperDate.isClose}}">
+				<view class="feedback_title">您当前的感觉是</view>
+				<view class="type_title">温度</view>
+				<view class="typelist">
+					<block wx:for="{{tempType}}" wx:key="index">
+						<view bindtap="changeType" class="{{tempTypeValue===item.id?'typelistactive':''}}" data-index="{{item.id}}" data-type="temp">
+							<image src="{{item.imgSrc}}"></image>{{item.value}}
+						</view>
+					</block>
+				</view>
+				<view class="type_title">环境</view>
+				<view class="typelist typelistlast">
+					<block wx:for="{{envType}}" wx:key="index">
+						<view bindtap="changeType" class="{{envTypeValue===item.id?'typelistactive':''}}" data-index="{{item.id}}" data-type="env">
+							<image src="{{item.imgSrc}}"></image>{{item.value}}
+						</view>
+					</block>
+				</view>
+				<view class='submitbtn {{(tempTypeValue!=-1||envTypeValue!=-1) ? "submitbtnactive" : ""}}' bindtap="submitFeedback">确定</view>
+
+			</view>
+			<!-- 反馈后页面显示 -->
+			<view wx:if="{{!feedBack&&!popswiperDate.isClose}}">
+				<!-- 文字 -->
+				<view class="feedtext">
+					<view class="feedimgbox">
+					<!-- {{spaceStatusId}} -->
+						<view  class="lottie"><lottie id="lottie2" animationData="{{spacestatusList[spaceStatusId].canvasDate}}" width="25" height="25"/></view>
+						<!-- <image src="{{spacestatusList[spaceStatusId].imgSrc}}"></image> -->
+						<text class="feedtext_title">{{spaceStatus}}</text>
+					</view>
+					<block wx:for="{{notice}}" wx:key="{{index}}">
+						<text class="feedtext_desc">{{item}}</text>
+					</block>
+					
+					<!-- 滚动列表 -->
+					<view class="noticbox">
+						<!-- <view class="noticcontent" >
+							<block wx:for="{{equipmentStatustext}}">
+								<view class="noticbox_text">{{item.name}}</view>
+								<view class="noticbox_text">{{item.actions}}</view>
+							</block>
+							<view></view>
+						</view> -->
+						<swiper vertical autoplay duration="300" circular interval="1500">
+							<block wx:for="{{equipmentStatustext}}" >
+								<swiper-item>
+									<view class="noticbox_text">{{item.name}}</view>
+									<!-- <view class="noticbox_text">{{item.actions}}</view> -->
+								</swiper-item>
+								<swiper-item>
+									<!-- <view class="noticbox_text">{{item.name}}</view> -->
+									<view class="noticbox_text">{{item.actions}}</view>
+								</swiper-item>
+							</block>
+						</swiper>
+						<!-- <van-notice-bar color="#80838F" backgroundColor="#ffffff" text="{{ equipmentStatustext }}" speed="{{speedValue}}" ></van-notice-bar> -->
+					<!-- {{equipmentStatus}} -->
+					</view>
+					<view class="radiobox">
+					<van-radio-group value="{{addFollow}}" bind:change="addonChange" wx:if="{{!popswiperDate.subscribe}}">
+						<van-radio  name="1" shape="square">是否加入关注列表</van-radio>
+					</van-radio-group>
+						<view wx:if="{{popswiperDate.subscribe}}">已加入关注列表</view>
+					</view>
+				</view>
+				<!-- <view>是否加入关注列表</view> -->
+				<view class='submitbtn opencontent_openbtn ' bindtap="colseFeedback">关闭</view>
+			</view>
+			<view class="opencontent" wx:if="{{popswiperDate.isClose}}">
+				<view class="envstate">
+					<view  class="lottie"><lottie id="lottie" animationData="{{statusList[popswiperDate.stateId].canvasDate}}" width="25" height="25"/></view>
+					<!-- <image src="{{statusList[popswiperDate.stateId].imgSrc}}"></image> -->
+					{{popswiperDate.state}}
+				</view>
+				<!-- {{filter.formatTimeall(popswiperDate.nextOpenTime)}} -->
+				<view class="opencontent_text">预计在{{monthDay}}  重新开启环境调节</view>
+				<view class='submitbtn opencontent_openbtn' bindtap="openEnv">立即开启环境调节</view>
+			</view>
+		</view>
+	</van-popup>
+	<!-- 弹出提示框 -->
+	<van-toast id="van-toast" />
+	<!-- 关机二次确认弹窗 secondpopValue-->
+	<van-popup show="{{ secondpopValue }}" round bind:close="commitClose" position="bottom" custom-style="height:380rpx;border-top:1px solid #ededee">
+		<view class="spacedetail seconddetail">
+			<view class="secondtxt secondtxt_title">
+				<view class="lottie">
+					<lottie id="lottie" animationData="{{spacestatusList[secondIcon-1].canvasDate}}" width="25" height="25" />
+				</view>
+				{{secondSpaceStatus}}
+			</view>
+			<view class="secondtxt">{{secondNotice}}</view>
+			<view class="custom_button" bindtap="commitClose">关闭</view>
+		</view>
+	</van-popup>
+</view>

+ 454 - 0
pages/index/index.wxss

@@ -0,0 +1,454 @@
+/* 轮播图样式 */
+.header_box {
+  /* width: 100%; */
+  /* padding:16rpx; */
+  box-sizing: border-box;
+  position: relative;
+  z-index: 2;
+  margin: 16rpx;
+  border-radius: 16rpx;
+  overflow: hidden;
+  position: relative;
+  background-color: #ffffff;
+  box-shadow: 0px 2px 12px 0px rgba(25, 27, 38, 0.1);
+}
+.header_container{
+  position: relative;
+  overflow: hidden;
+  z-index: 1;
+}
+.header_container::after{
+  content: '';
+  width: 100%;
+  position: absolute;
+  z-index: -1111;
+  background-color: #000000;
+  height: 400rpx;
+  border-radius: 0px 0px 18rpx 18rpx;
+  top: 0;
+  left: 0;
+}
+
+.header_box swiper {
+  position: relative;
+  height: 720rpx;
+}
+
+.header_box image {
+  height: 488rpx;
+  width: 100%;
+  overflow: hidden;
+}
+
+.img_footer {
+  height: 212rpx;
+  display: flex;
+  align-items: center;
+  padding: 0 52rpx;
+  justify-content: space-around;
+  flex-wrap: wrap;
+}
+
+.img_footer>view {
+  width: 50%;
+  display: flex;
+  align-items: center;
+  font-size: 32rpx;
+  color: #80838F;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+
+.img_footer view>image {
+  width: 44rpx;
+  height: 44rpx;
+  margin-right: 18rpx;
+}
+
+.img_footer .envitem text {
+  font-size: 28rpx;
+  margin-left: 4rpx;
+}
+
+.img_footer .envitem {
+  color: #191B26;
+  margin-left: 16rpx;
+}
+
+.fixed_box {
+  top: 0;
+  left: 0;
+  display: flex;
+  flex-direction: column;
+  justify-content: space-between;
+  height: 488rpx;
+  padding: 32rpx 48rpx 32rpx;
+  width: 100%;
+  position: absolute;
+  color: #ffffff;
+}
+.fixed_box>.roombg text{
+  display: inline-block;
+  background-color: rgba(6, 9, 25, 0.5);
+  padding: 10rpx 30rpx;
+  font-size: 32rpx;
+border-radius: 48rpx;
+
+}
+.fixed_dec {
+  display: flex;
+  color: #FFFFFF;
+  font-size: 28rpx;
+  align-items: center;
+}
+
+.envshow {
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+  padding: 20rpx 48rpx;
+  border-radius: 48rpx;
+  background-color: rgba(6, 9, 25, 0.5);
+}
+
+.envshow>view:nth-child(1) {
+  display: flex;
+  align-items: center;
+}
+
+.envshow image {
+  width: 40rpx;
+  height: 40rpx;
+  margin-right: 8rpx;
+}
+
+/* 三个按钮盒子 */
+.btn_list {
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+  padding: 0 8px;
+  box-sizing: border-box;
+}
+
+/* 单个按钮样式 */
+.btn_item {
+  width: 100%;
+  height: 176rpx;
+  margin-bottom: 24rpx;
+  display: flex;
+  align-items: center;
+  justify-content: space-around;
+  border-radius: 16rpx;
+  box-shadow: 0px 2px 12px 0px rgba(25, 27, 38, 0.1);
+}
+
+.btn_item:nth-child(1) {
+  margin-top: 48rpx;
+}
+
+.btn_item>view:nth-child(2) {
+  width: 336rpx;
+}
+
+.item_img {
+  height: 100rpx;
+  width: 100rpx;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  border-radius: 50%;
+  border: 2px solid #e8e8e9;
+}
+
+.item_img image {
+  width: 60rpx;
+  height: 60rpx;
+}
+
+.item_img image:nth-child(1) {
+  width: 44rpx;
+  height: 44rpx;
+}
+
+.item_img image:nth-child(2) {
+  width: 56rpx;
+  height: 56rpx;
+}
+
+.item_title {
+  display: block;
+  font-size: 36rpx;
+  line-height: 50rpx;
+  color: #191B26;
+}
+
+.item_des {
+  color: #80838F;
+  font-size: 28rpx;
+}
+
+/* 弹框样式 */
+.spacedetail {
+  padding: 25rpx 32rpx 0;
+}
+
+.spacedetail swiper {
+  height: 210rpx;
+}
+
+.space_title {
+  text-align: center;
+}
+
+.item_list {
+  display: flex;
+  height: 210rpx;
+  flex-direction: row;
+  justify-content: space-around;
+  align-items: center;
+}
+
+.list_item {
+  font-size: 35rpx;
+  text-align: center;
+}
+
+.list_item view:nth-child(2) {
+  color: rgba(128, 131, 143, 1);
+  font-size: 28rpx;
+  margin-top: 8rpx;
+}
+
+.noticbox_text{
+  text-align: center;
+}
+.envstate {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  height: 64rpx;
+  margin-top: 16rpx;
+  font-size: 20px;
+  color: #191B26;
+}
+
+.envstate image {
+  width: 40rpx;
+  height: 40rpx;
+  margin-right: 20rpx;
+}
+
+/* 反馈列表 */
+.feedback_list {
+  overflow: hidden;
+}
+
+.feedback_title {
+  font-size: 32rpx;
+  color: rgba(25, 27, 38, 1);
+  line-height: 38rpx;
+  margin-bottom: 38rpx;
+}
+
+.type_title {
+  font-size: 32rpx;
+  color: rgba(128, 131, 143, 1);
+  line-height: 38rpx;
+  margin-bottom: 16rpx;
+}
+
+.typelist {
+  display: flex;
+  flex-direction: row;
+  /* justify-content: space-between; */
+  flex-wrap: wrap;
+  margin-bottom: 40rpx;
+  overflow: hidden;
+}
+
+.typelistlast {
+  margin-bottom: 0;
+}
+
+.typelist>view {
+  width: 220rpx;
+  height: 84rpx;
+  display: flex;
+  font-size: 28rpx;
+  align-items: center;
+  justify-content: center;
+  background-color: #f4f4f5;
+  border-radius: 16rpx;
+  margin-bottom: 12rpx;
+}
+
+.typelist>view image {
+  width: 40rpx;
+  height: 40rpx;
+  margin-right: 12rpx;
+}
+
+.typelistlast>view {
+  margin-bottom: 0;
+}
+
+.typelist>view:nth-child(3n-1) {
+  margin: 0 12rpx;
+}
+
+.typelist>.typelistactive {
+  background-color: #5575FF;
+  color: white;
+}
+
+
+.submitbtn {
+  height: 80rpx;
+  background: rgba(85, 117, 255, 1);
+  border-radius: 20px;
+  text-align: center;
+  color: white;
+  line-height: 80rpx;
+  margin: 60rpx 0 64rpx;
+  opacity: 0.5;
+  overflow: hidden;
+  box-sizing: border-box;
+}
+
+.submitbtnactive {
+  opacity: 1;
+}
+
+.colsebtn {
+  margin: 40rpx 0 64rpx;
+  border: 1px solid rgba(218, 218, 218, 1);
+  background: #ffffff;
+  color: #191B26;
+  opacity: 1;
+}
+
+.canvas {
+  /* width: 100%; */
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+.canvashidden canvas{
+  height: 0;
+}
+.canvas canvas{
+  width: 340px;
+}
+.canvascenter {
+  width: 90%;
+  height: 90%;
+  display: flex;
+  font-size: 14px;
+  color: #cccc;
+  justify-content: center;
+  align-items: center;
+  flex-direction: column;
+  border-left: 1px solid #ccc;
+  border-bottom: 1px solid #ccc;
+  margin: 10rpx auto;
+}
+
+.feedtext {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  flex-direction: column;
+}
+
+.feedimgbox {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  flex-direction: row;
+
+  margin-bottom: 24rpx;
+}
+
+.feedimgbox image {
+  width: 40rpx;
+  height: 40rpx;
+  margin-right: 8rpx;
+}
+
+.feedtext_title {
+  font-size: 40rpx;
+  color: #191B26;
+}
+
+.feedtext_desc {
+  font-size: 28rpx;
+}
+
+.noticbox {
+  width: 100%;
+  height:65rpx;
+  font-size: 28rpx;
+  margin-top: 38rpx;
+}
+.noticbox swiper{
+  height: 45rpx;
+}
+
+.radiobox {
+  margin-top: 56rpx;
+}
+
+/* .opencontent{
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  flex-direction: column;
+}  */
+.opencontent_text {
+  color: #80838F;
+  margin-top: 84rpx;
+  text-align: center;
+}
+
+.opencontent_openbtn {
+  background: rgba(85, 117, 255, 1);
+  margin: 32rpx 0 64rpx;
+  opacity: 1;
+}
+.lottie{
+  width: 50rpx;
+  height: 50rpx;
+}
+.secondtxt{
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  font-size: 14px;
+  margin-bottom: 16rpx;
+}
+.secondtxt_title{
+  font-size: 20px;
+  margin-bottom: 22rpx;
+}
+.custom_button{
+  box-sizing: content-box;
+  padding: 24rpx 32rpx;
+  height: 40rpx;
+  display: flex;
+  margin-top: 54rpx;
+  justify-content: center;
+  text-align: center;
+  align-items: center;
+  background-color: #5575FF;
+  color: #ffffff;
+  font-size: 16px;
+  border-radius:40rpx;
+}
+.header_box .before-load {
+  width: 0;
+  height: 0;
+  opacity: 0;
+}

+ 109 - 0
pages/projectlist/index.js

@@ -0,0 +1,109 @@
+// pages/projectlist/index.js
+import utils from "../../utils/util"
+const app = getApp();
+
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    projectList:[],
+    tenantId:'',
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    this.setData({tenantId:app.globalData.tenantId})
+    let dataCope=JSON.parse(JSON.stringify(app.globalData.tenants));
+    dataCope= utils.buildTree(dataCope);
+    this.setData({projectList:dataCope});
+  },
+  chooseTenant(e){
+    // console.log(e);
+    const value = e.currentTarget.dataset.index;
+    if(this.data.tenantId&&this.data.tenantId==value.tenantId){
+      return
+    }
+    wx.setStorage({
+      data: value.projectId,
+      key: 'projectId',
+    })
+    wx.setStorage({
+      data: value.tenantId,
+      key: 'tenantId',
+    })
+    wx.setStorage({
+      data: value.tenantName,
+      key: 'tenantName',
+    })
+    this.setData({tenantId:value.tenantId});
+    app.globalData.projectId = value.projectId;
+    app.globalData.tenantId =value.tenantId;
+    app.globalData.tenantName = value.tenantName;
+    let pages = getCurrentPages(); 
+    let prevPage = pages[ pages.length - 2 ];
+    prevPage.setData({  // 将我们想要传递的参数在这里直接setData。上个页面就会执行这里的操作。
+      formList:true,
+      swiperCurrent:0
+    })
+    
+    wx.navigateBack({
+      delta: 1  // 返回上一级页面。
+    })
+    // wx.redirectTo({
+    //   url: '../index/index',
+    // })
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 4 - 0
pages/projectlist/index.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "项目选择"
+}

+ 8 - 0
pages/projectlist/index.wxml

@@ -0,0 +1,8 @@
+<view class="projectbox">
+  <block wx:for="{{projectList}}" wx:key="{{index}}">
+    <view>{{item.projectName}}</view>
+    <block wx:for="{{item.children}}" wx:for-item="items"  wx:key="{{items.tenantId}}">
+      <view class="children children{{items.tenantId===tenantId?'active':''}}" data-index="{{items}}"  bindtap="chooseTenant">{{items.tenantName}}</view>
+    </block>
+  </block>
+</view>

+ 24 - 0
pages/projectlist/index.wxss

@@ -0,0 +1,24 @@
+page{
+  width: 100%;
+  height: 100%; 
+  background-color: #F9F9FD;
+}
+.projectbox{
+  background-color: #FFFFFF;
+  color: #666666;
+}
+.projectbox>view{
+  height:88rpx;
+  line-height: 88rpx;
+  margin-left: 30rpx;
+  padding-left: 36rpx;
+  
+  border-bottom: 1px solid #EEEEEE;
+}
+.projectbox .children{
+  padding-left:72rpx;
+}
+.projectbox .childrenactive{
+  background-color: #f0f0f0;
+  color: #191B26;
+}

+ 181 - 0
pages/search/index.js

@@ -0,0 +1,181 @@
+// pages/search/index.js
+import utils from "../../utils/util";
+import {queryFollowspace,queryAllspace,followRoom,unfollowRoom} from "../../requests/api";
+import Toast from '../../vant-weapp/dist/toast/toast';
+const app = getApp();
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    spaceName:'',
+    listContent:[],
+    alllistContent:[],
+    activeTab:0,
+    projectId:"",
+    tenantId:"",
+    userId:"",
+    currtPage:1,
+    allListnum:0,
+    seachValue:'',
+    seachTimes:1,
+    imgShow:false,
+    noSpace:false,
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    if(wx.getStorageSync('logined')){
+      this.setData({currtPage:1});
+      this.setData({projectId:app.globalData.projectId});
+      this.setData({tenantId:app.globalData.tenantId});
+      this.setData({userId:app.globalData.userId});
+      this.getFollowlist();
+    }
+  },
+  onShow(){
+    this.setData({currtPage:1});
+  },
+  // 查询关注空间
+  async getFollowlist(){
+    const data={
+      "criteria": {
+          "userId":this.data.userId,
+          "projectId": this.data.projectId,
+          "tenantId": this.data.tenantId
+      }
+    }
+    this.setData({listContent:[]});
+    // this.setData({imgShow:false})
+    let res = await queryFollowspace(data);
+    // setTimer = setTimeout(()=>{this.setData({imgShow:true})},800);
+    if(res.count){
+      res.content.map(item=>{
+        item.picInit=utils.picInit(item.roomFuncType);
+      })
+      this.setData({noSpace:false});
+      this.setData({listContent:res.content});
+    }else{
+      this.setData({noSpace:true});
+    }
+  },
+  async getallList(value){
+    if(!wx.getStorageSync('logined')){
+      return 
+    }
+    const data={
+      "criteria": {
+          "userId":this.data.userId,
+          "projectId": this.data.projectId,
+          "tenantId": this.data.tenantId
+      },
+      page:this.data.currtPage,
+      size:15,
+      orders:[
+        {
+          column:"localName",
+          asc:"true"
+        }
+      ]
+    }
+    if(value&&this.data.seachTimes==1){
+      this.setData({currtPage:1});  
+      this.setData({seachTimes:2});
+      data.page=1;
+      data.criteria.localName={$like: `%${value}%`}
+    }
+    if(this.data.seachValue&&!value){
+      data.criteria.localName={$like: `%${this.data.seachValue}%`}
+    }
+    let res;
+    if(data.page!==1){
+       res =await queryAllspace(data);
+    }else{
+      res =await queryAllspace(data);
+    }
+   
+    this.setData({allListnum:res.count});
+    if(res.count&&res.content){
+      res.content.map(item=>{
+        item.picInit=utils.picInit(item.roomFuncType);
+      })
+      this.setData({alllistContent:this.data.alllistContent.concat(res.content)});
+    }else{
+      Toast('暂无更多')
+    }
+  },
+  tabChange(e){
+    if(e.detail.index==1&&this.data.activeTab==0){
+      // if(){
+        this.setData({currtPage:1});
+        this.setData({alllistContent:[]});
+        this.getallList();
+      // }
+    }else if(e.detail.index==0){
+      this.getFollowlist();
+    }
+    this.setData({activeTab:e.detail.index})
+  },
+  // 搜索
+  spaceSearch(e){
+    this.setData({seachValue:e.detail});
+    this.setData({seachTimes:1})
+    this.setData({activeTab:1});
+    this.setData({alllistContent:[]});
+    this.getallList(e.detail);
+  },
+  listClick(e){
+    let pages = getCurrentPages(); //获取当前页面js里面的pages里的所有信息。
+      let prevPage = pages[ pages.length - 2 ];
+      prevPage.setData({  // 将我们想要传递的参数在这里直接setData。上个页面就会执行这里的操作。
+        popswiperDate:e.detail.cardDate,
+        fromFollowpage:true,
+    })
+    wx.navigateBack({
+      delta: 1  // 返回上一级页面。
+    })
+  },
+  starClick(e){
+    let checked=e.detail.checked;
+    let spaceId=e.detail.spaceId;
+    const data = {
+      "userId":this.data.userId,//用户id
+      "projectId":this.data.projectId,//项目id
+      "spaceId":spaceId//空间id
+    }
+    
+    if(checked){
+      followRoom(data)
+    }else{
+      unfollowRoom(data)
+    }
+  },
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+    if(this.data.activeTab==1&&this.data.allListnum!=this.data.alllistContent.length){
+      this.setData({currtPage:this.data.currtPage+1})
+      this.getallList();
+    }else{
+      Toast('暂无更多')
+    }
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 11 - 0
pages/search/index.json

@@ -0,0 +1,11 @@
+{
+  "usingComponents": {
+    "van-search": "../../vant-weapp/dist/search/index",
+    "spacecard": "../../components/spacecard/index",
+    "van-divider": "../../vant-weapp/dist/divider/index",
+    "van-tab": "../../vant-weapp/dist/tab/index",
+    "van-tabs": "../../vant-weapp/dist/tabs/index",
+    "van-toast": "../../vant-weapp/dist/toast/index"
+  },
+  "navigationBarTitleText": "关注列表"
+}

+ 35 - 0
pages/search/index.wxml

@@ -0,0 +1,35 @@
+<!--pages/search/index.wxml-->
+<view>
+	<van-search shape="round" value="{{ spaceName }}" bind:search="spaceSearch" placeholder="请输入搜索关键词" />
+	<van-tabs type="card"  color="#5575ff" active="{{ activeTab }}" bind:change="tabChange">
+		<van-tab title="关注列表">
+		<!--  {{imgShow?'':'del_box'}} -->
+			<view class="cardlist">
+			<block wx:for="{{listContent}}" wx:key="index">
+				<spacecard bind:listClick="listClick" cardDate="{{item}}" bind:starClick="starClick" canvashidden="{{activeTab==0}}"></spacecard>
+				<van-divider/>
+			</block>
+			</view>
+		</van-tab>
+		<van-tab title="空间列表">
+			<view class="cardlist" >
+				<block wx:for="{{alllistContent}}" wx:key="index">
+				<spacecard bind:listClick="listClick" cardDate="{{item}}" bind:starClick="starClick" canvashidden="{{activeTab==1}}"></spacecard>
+				<van-divider/>
+				<!--   class="{{imgShow?'':'del_box'}}" -->
+			</block>
+			</view>
+		</van-tab>
+	</van-tabs>
+	<view class="nolist" wx:if="{{activeTab===0&&noSpace}}">
+		<image src="../../static/images/nofollow.png"></image>
+		<text>暂无关注</text>
+		<text>从空间列表选择关注吧!</text>
+	</view>
+	<view style="text-align: center;margin: 10px;">
+      <view wx:if="{{loading}}">加载中...</view>
+      <view wx:if="{{noMore}}">没有更多了</view>
+      <view wx:if="{{loadingFailed}}">数据加载失败,请重试</view>
+    </view>
+	<van-toast id="van-toast" />
+</view>

+ 43 - 0
pages/search/index.wxss

@@ -0,0 +1,43 @@
+.cardlist{
+  padding: 0 32rpx;
+}
+/* 修改标签页样式 */
+.van-tabs__wrap{
+  margin-bottom: 24rpx;
+  height: 72rpx!important;
+}
+.van-tabs__nav--card{
+  height: 72rpx!important;
+  overflow: hidden;
+  border-radius: 8rpx!important;
+  /* border:1px solid rgba(25,27,38,0.1)!important; */
+}
+.van-ellipsis{
+  line-height: 72rpx!important;
+}
+.van-tab{
+  height: 72rpx!important;
+  color: #000000!important;
+}
+.van-tab--active{
+  color: #ffffff!important;
+  /* border:1px solid #5575FF!important; */
+}
+.nolist{
+  display: flex;
+  margin-top: 240rpx;
+  justify-content: center;
+  align-items: center;
+  flex-direction: column;
+  color: #80838F;
+}
+.nolist image{
+  width: 160rpx;
+  height: 160rpx;
+}
+.nolist>text:nth-child(3){
+  margin-top: 18rpx;
+}
+.del_box{
+  display: none;
+}

+ 58 - 0
project.config.json

@@ -0,0 +1,58 @@
+{
+	"description": "项目配置文件",
+	"packOptions": {
+		"ignore": []
+	},
+	"setting": {
+		"urlCheck": false,
+		"es6": true,
+		"enhance": true,
+		"postcss": true,
+		"preloadBackgroundData": false,
+		"minified": true,
+		"newFeature": true,
+		"coverView": true,
+		"nodeModules": true,
+		"autoAudits": false,
+		"showShadowRootInWxmlPanel": true,
+		"scopeDataCheck": false,
+		"checkInvalidKey": true,
+		"checkSiteMap": true,
+		"uploadWithSourceMap": true,
+		"babelSetting": {
+			"ignore": [],
+			"disablePlugins": [],
+			"outputPath": ""
+		},
+		"useCompilerModule": false,
+		"userConfirmedUseCompilerModuleSwitch": false
+	},
+	"compileType": "miniprogram",
+	"libVersion": "2.11.1",
+	"appid": "wxa2bf334720c47626",
+	"projectname": "env-pc",
+	"debugOptions": {
+		"hidedInDevtools": []
+	},
+	"isGameTourist": false,
+	"simulatorType": "wechat",
+	"simulatorPluginLibVersion": {},
+	"condition": {
+		"search": {
+			"current": -1,
+			"list": []
+		},
+		"conversation": {
+			"current": -1,
+			"list": []
+		},
+		"game": {
+			"currentL": -1,
+			"list": []
+		},
+		"miniprogram": {
+			"current": -1,
+			"list": []
+		}
+	}
+}

+ 103 - 0
requests/api.js

@@ -0,0 +1,103 @@
+import {request} from './http'
+// 获取到openId
+function getopenId(code){
+  return request('/duoduo-service/wechat-service/wechat/app/getOpenId','GET',{code:code})
+}
+// 获取用户电话
+function getuserPhone(data){
+  return request('/duoduo-service/wechat-service/wechat/app/getUserInfo','GET',data)
+}
+// 检查用户是否注册
+function userCheck(data){
+  return request('/server/user/check','GET',data)
+}
+// 创建用户
+function userSave(data){
+  return request('/server/user/save','POST',data)
+}
+// 查询用户
+function userQuery(data){
+  return request('/server/user/query','POST',data)
+}
+// 更新用户
+function userUpdate(data){
+  return request('/server/user/update','POST',data)
+}
+// 关注空间
+function followRoom(data){
+  return request('/server/space/subscribe','POST',data)
+}
+// 取消关注
+function unfollowRoom(data){
+  return request('/server/space/unsubscribe','POST',data)
+}
+// 空间当前状态
+function spaceProperty(data){
+  return request('/server/custom/spaceProperty','GET',data)
+}
+// 查询空间温度曲线
+function queryChart(data){
+  return request('/server/space/queryPeriodData','GET',data)
+}
+//查询所有空间列表
+function queryAllspace(data){
+  return request('/server/space/queryAll','POST',data)
+}
+//查询所有关注列表
+function queryFollowspace(data){
+  return request('/server/space/querySubscribe','POST',data)
+}
+// 查询轮播图
+function queryRotation(data){
+  return request('/server/space/rotation','POST',data)
+}
+// 查询是否有调节权限
+function powerCheck(data){
+  return request('/server/custom/check','POST',data)
+}
+// 下班节能
+function workLeave(data){
+  return request('/server/custom/leave','POST',data)
+}
+// 下次开启时间
+function nextOpen(data){
+  return request('/server/custom/nextOpenTime','POST',data)
+}
+// 反馈
+function getfeedBack(data){
+  return request('/server/custom/feedback','POST',data)
+}
+// 查询空间信息
+function getSpacedetail(data){
+  return request('/server/space/property','POST',data)
+}
+// 下班后开启调节
+function openSpace(data){
+  return request('/server/custom/recover','POST',data)
+}
+// 查询反馈后设备动作
+function getEquipmentAction(data){
+  return request('/server/custom/getEquipmentAction','POST',data)
+}
+module.exports = {
+  getopenId:getopenId,
+  getuserPhone:getuserPhone,
+  userCheck:userCheck,
+  userSave:userSave,
+  userQuery:userQuery,
+  userUpdate:userUpdate,
+  followRoom:followRoom,
+  unfollowRoom:unfollowRoom,
+  spaceProperty:spaceProperty,
+  queryChart:queryChart,
+  queryAllspace:queryAllspace,
+  queryFollowspace:queryFollowspace,
+  powerCheck:powerCheck,
+  queryRotation:queryRotation,
+  workLeave:workLeave,
+  nextOpen:nextOpen,
+  getfeedBack:getfeedBack,
+  getSpacedetail:getSpacedetail,
+  openSpace:openSpace,
+  getEquipmentAction:getEquipmentAction
+}

+ 58 - 0
requests/http.js

@@ -0,0 +1,58 @@
+// 定义公共url
+const API_BASE_URL = "https://duoduoenv.sagacloud.cn";
+// 计算每次请求的次数
+var requestTimes = 0;
+const request = function request(url, method, data = {}) {
+  wx.showLoading({
+    title: "加载中..."
+  })
+  var _url = API_BASE_URL + url;
+  data = Object.assign(data, {
+    openid: wx.getStorageSync('openId')
+  })
+  if (method === "GET") {
+    
+    data = Object.assign(data, {
+      pubname: "sagacare"
+    })
+    console.log(data,"18")
+  } else {
+    _url = _url + `?pubname=sagacare&openid=${wx.getStorageSync('openId')}`
+    if (data.flag) {
+      _url = _url + `&flag=${data.flag}`
+    }
+  }
+  return new Promise(function (resolve, reject) {
+    requestTimes++
+    wx.request({
+      url: _url,
+      method: method,
+      data: data,
+      header: {
+        'content-type': 'application/json'
+      },
+      success: function success(request) {
+        resolve(request.data);
+      },
+      fail: function fail(error) {
+        wx.hideLoading();
+        wx.showModal({
+          title: '网络错误',
+          content: '网络出错,请刷新重试',
+          showCancel: false
+        })
+        reject(error);
+      },
+      complete: function complete() {
+        // 加载完成
+        requestTimes--
+        if (requestTimes === 0) {
+          wx.hideLoading()
+        }
+      }
+    });
+  });
+};
+module.exports = {
+  request: request
+}

+ 7 - 0
sitemap.json

@@ -0,0 +1,7 @@
+{
+  "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
+  "rules": [{
+  "action": "allow",
+  "page": "*"
+  }]
+}

BIN
static/images/CO2.png


BIN
static/images/PM2.5.png


BIN
static/images/RH.png


BIN
static/images/Temp.png


BIN
static/images/adjust.png


BIN
static/images/cold.png


BIN
static/images/good.png


BIN
static/images/hot.png


BIN
static/images/ic311.png


BIN
static/images/ic312.png


BIN
static/images/ic313.png


BIN
static/images/ic314.png


BIN
static/images/ic315.png


BIN
static/images/ic321.png


BIN
static/images/ic322.png


BIN
static/images/ic323.png


BIN
static/images/ic331.png


BIN
static/images/lamp.png


BIN
static/images/logo.jpg


BIN
static/images/nofollow.png


BIN
static/images/nolist.png


BIN
static/images/qrcode.png


BIN
static/images/room.png


BIN
static/images/severityCold.png


BIN
static/images/severityHot.png


BIN
static/images/severityWind.png


+ 80 - 0
utils/auth.js

@@ -0,0 +1,80 @@
+import {getopenId} from "../requests/api";
+async function checkSession(){
+  return new Promise((resolve, reject) => {
+    wx.checkSession({
+      success() {
+        resolve(true)
+      },
+      fail() {
+        resolve(false)
+      }
+    })
+  })
+}
+async function login(){
+  return new Promise((resolve,reject)=>{
+    wx.login({
+      success:async function (res) {
+        // 进行登录操作
+        resolve(res)
+        
+      },
+      fail:function (err){
+        wx.showToast({
+          title: '获取code失败',
+          icon: 'none'
+        })
+        reject(err);
+      }
+    })
+  })
+}
+// 检测登录状态,返回 true / false
+async function checkHasLogined() {
+  const openId = wx.getStorageSync('openId');
+  if (!openId) {
+    return false
+  }
+  const loggined = await checkSession();
+  if (!loggined) {
+    wx.removeStorageSync('openId')
+    return false
+  }
+  return true
+}
+
+function wxaCode(){
+  return new Promise((resolve, reject) => {
+    wx.login({
+      success(res) {
+        return resolve(res.code)
+      },
+      fail() {
+        wx.showToast({
+          title: '获取code失败',
+          icon: 'none'
+        })
+        return resolve('获取code失败')
+      }
+    })
+  })
+}
+function getUserInfo() {
+  return new Promise((resolve, reject) => {
+    wx.getUserInfo({
+      success: res => {
+         resolve(res)
+      },
+      fail: err => {
+        reject(err)
+      }
+    })
+  })
+}
+
+module.exports = {
+  checkHasLogined: checkHasLogined,
+  wxaCode: wxaCode,
+  getUserInfo: getUserInfo,
+  login: login,
+}

+ 18 - 0
utils/filter.wxs

@@ -0,0 +1,18 @@
+
+var mathFormat = function (num) {
+  var patt = getRegExp('\.','g');
+  var formatnum
+  if(!patt.test(num)){
+    formatnum= num
+  }else{
+    formatnum=  Number(num).toFixed(1)||'--';
+  }
+  return formatnum
+}
+
+/*
+ * 导出
+ */
+module.exports = {
+  mathFormat: mathFormat,
+}

+ 286 - 0
utils/util.js

@@ -0,0 +1,286 @@
+const formatTime = date => {
+  const year = date.getFullYear()
+  const month = date.getMonth() + 1
+  const day = date.getDate()
+  const hour = date.getHours()
+  const minute = date.getMinutes()
+  const second = date.getSeconds()
+
+  return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
+}
+
+const formatNumber = n => {
+  n = n.toString()
+  return n[1] ? n : '0' + n
+}
+
+// 格式化时间// 20180101101010  => 2018-01-01 10:10:10
+function formatDate(time) {
+  return `${time.substring(8,10)}:${time.substring(10,12)}`
+}
+/** 检测是否有定位权限BY 小程序 **/
+function checkHasLocationPermissionByMP() {
+  return new Promise(function (resolve, reject) {
+    wx.getSetting({
+      success(sd) {
+        if (!sd.authSetting['scope.userLocation']) {
+          wx.authorize({
+            scope: 'scope.userLocation',
+            success(e) {
+              resolve(e)
+            },
+            fail(e) {
+              reject()
+            }
+          })
+        } else {
+          resolve(sd)
+        }
+      }
+    })
+  })
+}
+function picInit(value){
+	let baseUrl="../../static/images/"
+	value = value || '';
+	if(value.startsWith("300")||value.startsWith("310")||value.startsWith("311")){
+		return baseUrl + "ic311.png"
+	}else if(value.startsWith("312")){
+		return baseUrl + "ic312.png"
+	}else if(value.startsWith("313")){
+		return baseUrl + "ic313.png"
+	}else if(value.startsWith("314")){
+		return baseUrl + "ic314.png"
+	}else if(value.startsWith("315")){
+		return baseUrl + "ic315.png"
+	}else if(value.startsWith("320")||value.startsWith("321")){
+		return baseUrl + "ic321.png"
+	}else if(value.startsWith("322")){
+		return baseUrl + "ic322.png"
+	}else if(value.startsWith("323")){
+		return baseUrl + "ic323.png"
+	}else if(value.startsWith("33")){
+		return baseUrl + "ic331.png"
+	}else{
+		return baseUrl + "ic313.png"
+	}
+}
+// 前面补零
+function PrefixZero(num, n = 2) {
+  return (Array(n).join(0) + num).slice(-n);
+}
+
+
+
+function buildTree(value) {
+  let list = JSON.parse(JSON.stringify(value));
+  // let temp = {};
+  let tree = [];
+  list.forEach(item => {
+    let temp = {};
+    let children = {};
+    temp.projectId = item.projectId;
+    temp.projectName = item.projectName;
+    temp.children = [];
+    tree.push(temp)
+  });
+  let hash = {};
+  tree = tree.reduce((item, next) => {
+    hash[next.projectId] ? '' : hash[next.projectId] = true && item.push(next);
+    return item;
+  }, []);
+  value.forEach((item) => {
+    tree.forEach(items => {
+      if (item.projectId === items.projectId) {
+        // items.children=[];
+        let children = {};
+        children.tenantId = item.tenantId;
+        children.projectId = item.projectId;
+        children.tenantName = item.tenantName;
+        children.remote = item.remote;
+        items.children.push(children);
+      }
+    })
+  })
+  return tree;
+}
+//  base64解码
+var Base64 = {
+  // 转码表
+  tables: [
+    'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
+    'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
+    'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
+    'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
+    'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
+    'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
+    'w', 'x', 'y', 'z', '0', '1', '2', '3',
+    '4', '5', '6', '7', '8', '9', '+', '/'
+  ],
+  UTF16ToUTF8 : function (str) {
+		let results = [], len = str.length;
+		for (let i = 0; i < len; i++) {
+			let code = str.charCodeAt(i);
+			if (code > 0x0000 && code <= 0x007F) {
+				/* 一字节,不考虑0x0000,因为是空字节
+				   U+00000000 – U+0000007F 	0xxxxxxx
+				*/
+				results.push(str.charAt(i));
+			} else if (code >= 0x0080 && code <= 0x07FF) {
+				/* 二字节
+				   U+00000080 – U+000007FF 	110xxxxx 10xxxxxx
+				   110xxxxx
+				*/
+				let byte1 = 0xC0 | ((code >> 6) & 0x1F);
+				// 10xxxxxx
+				let byte2 = 0x80 | (code & 0x3F);
+				results.push(
+					String.fromCharCode(byte1), 
+					String.fromCharCode(byte2)
+				);
+			} else if (code >= 0x0800 && code <= 0xFFFF) {
+				/* 三字节
+				   U+00000800 – U+0000FFFF 	1110xxxx 10xxxxxx 10xxxxxx
+				   1110xxxx
+				*/
+				let byte1 = 0xE0 | ((code >> 12) & 0x0F);
+				// 10xxxxxx
+				let byte2 = 0x80 | ((code >> 6) & 0x3F);
+				// 10xxxxxx
+				let byte3 = 0x80 | (code & 0x3F);
+				results.push(
+					String.fromCharCode(byte1), 
+					String.fromCharCode(byte2), 
+					String.fromCharCode(byte3)
+				);
+			} else if (code >= 0x00010000 && code <= 0x001FFFFF) {
+				// 四字节
+				// U+00010000 – U+001FFFFF 	11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
+			} else if (code >= 0x00200000 && code <= 0x03FFFFFF) {
+				// 五字节
+				// U+00200000 – U+03FFFFFF 	111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
+			} else /** if (code >= 0x04000000 && code <= 0x7FFFFFFF)*/ {
+				// 六字节
+				// U+04000000 – U+7FFFFFFF 	1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
+			}
+		}
+
+		return results.join('');
+	},
+	UTF8ToUTF16 : function (str) {
+		let results = [], len = str.length;
+		let i = 0;
+		for (let i = 0; i < len; i++) {
+			let code = str.charCodeAt(i);
+			// 第一字节判断
+			if (((code >> 7) & 0xFF) == 0x0) {
+				// 一字节
+				// 0xxxxxxx
+				results.push(str.charAt(i));
+			} else if (((code >> 5) & 0xFF) == 0x6) {
+				// 二字节
+				// 110xxxxx 10xxxxxx
+				let code2 = str.charCodeAt(++i);
+				let byte1 = (code & 0x1F) << 6;
+				let byte2 = code2 & 0x3F;
+				let utf16 = byte1 | byte2;
+				results.push(Sting.fromCharCode(utf16));
+			} else if (((code >> 4) & 0xFF) == 0xE) {
+				// 三字节
+				// 1110xxxx 10xxxxxx 10xxxxxx
+				let code2 = str.charCodeAt(++i);
+				let code3 = str.charCodeAt(++i);
+				let byte1 = (code << 4) | ((code2 >> 2) & 0x0F);
+				let byte2 = ((code2 & 0x03) << 6) | (code3 & 0x3F);
+				let utf16 = ((byte1 & 0x00FF) << 8) | byte2
+				results.push(String.fromCharCode(utf16));
+			} else if (((code >> 3) & 0xFF) == 0x1E) {
+				// 四字节
+				// 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
+			} else if (((code >> 2) & 0xFF) == 0x3E) {
+				// 五字节
+				// 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
+			} else /** if (((code >> 1) & 0xFF) == 0x7E)*/ {
+				// 六字节
+				// 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
+			}
+		}
+
+		return results.join('');
+	},
+	encode : function (str) {
+		if (!str) {
+			return '';
+		}
+		let utf8    = this.UTF16ToUTF8(str); // 转成UTF-8
+		let i = 0; // 遍历索引
+		let len = utf8.length;
+		let results = [];
+		while (i < len) {
+			let c1 = utf8.charCodeAt(i++) & 0xFF;
+			results.push(this.tables[c1 >> 2]);
+			// 补2个=
+			if (i == len) {
+				results.push(this.tables[(c1 & 0x3) << 4]);
+				results.push('==');
+				break;
+			}
+			let c2 = utf8.charCodeAt(i++);
+			// 补1个=
+			if (i == len) {
+				results.push(this.tables[((c1 & 0x3) << 4) | ((c2 >> 4) & 0x0F)]);
+				results.push(this.tables[(c2 & 0x0F) << 2]);
+				results.push('=');
+				break;
+			}
+			let c3 = utf8.charCodeAt(i++);
+			results.push(this.tables[((c1 & 0x3) << 4) | ((c2 >> 4) & 0x0F)]);
+			results.push(this.tables[((c2 & 0x0F) << 2) | ((c3 & 0xC0) >> 6)]);
+			results.push(this.tables[c3 & 0x3F]);
+		}
+
+		return results.join('');
+	},
+  decode: function (str) {
+    //判断是否为空
+    if (!str) {
+      return '';
+    }
+
+    let len = str.length;
+    let i = 0;
+    let results = [];
+    //循环解出字符数组
+    while (i < len) {
+      let code1 = this.tables.indexOf(str.charAt(i++));
+      let code2 = this.tables.indexOf(str.charAt(i++));
+      let code3 = this.tables.indexOf(str.charAt(i++));
+      let code4 = this.tables.indexOf(str.charAt(i++));
+
+      let c1 = (code1 << 2) | (code2 >> 4);
+      results.push(String.fromCharCode(c1));
+
+      if (code3 != -1) {
+        let c2 = ((code2 & 0xF) << 4) | (code3 >> 2);
+        results.push(String.fromCharCode(c2));
+      }
+      if (code4 != -1) {
+        let c3 = ((code3 & 0x3) << 6) | code4;
+        results.push(String.fromCharCode(c3));
+      }
+
+    }
+
+    return this.UTF8ToUTF16(results.join(''));
+  }
+}
+
+module.exports = {
+  formatTime: formatTime,
+  formatDate: formatDate,
+  checkHasLocationPermissionByMP: checkHasLocationPermissionByMP,
+  PrefixZero: PrefixZero,
+  buildTree: buildTree,
+	Base64:Base64,
+	picInit:picInit
+}

Разница между файлами не показана из-за своего большого размера
+ 2047 - 0
utils/wxcharts.js


+ 1 - 0
vant-weapp/dist/area/index.d.ts

@@ -0,0 +1 @@
+export {};

+ 224 - 0
vant-weapp/dist/area/index.js

@@ -0,0 +1,224 @@
+import { VantComponent } from '../common/component';
+import { pickerProps } from '../picker/shared';
+const COLUMNSPLACEHOLDERCODE = '000000';
+VantComponent({
+  classes: ['active-class', 'toolbar-class', 'column-class'],
+  props: Object.assign(Object.assign({}, pickerProps), {
+    value: {
+      type: String,
+      observer(value) {
+        this.code = value;
+        this.setValues();
+      },
+    },
+    areaList: {
+      type: Object,
+      value: {},
+      observer: 'setValues',
+    },
+    columnsNum: {
+      type: null,
+      value: 3,
+      observer(value) {
+        this.setData({
+          displayColumns: this.data.columns.slice(0, +value),
+        });
+      },
+    },
+    columnsPlaceholder: {
+      type: Array,
+      observer(val) {
+        this.setData({
+          typeToColumnsPlaceholder: {
+            province: val[0] || '',
+            city: val[1] || '',
+            county: val[2] || '',
+          },
+        });
+      },
+    },
+  }),
+  data: {
+    columns: [{ values: [] }, { values: [] }, { values: [] }],
+    displayColumns: [{ values: [] }, { values: [] }, { values: [] }],
+    typeToColumnsPlaceholder: {},
+  },
+  mounted() {
+    setTimeout(() => {
+      this.setValues();
+    }, 0);
+  },
+  methods: {
+    getPicker() {
+      if (this.picker == null) {
+        this.picker = this.selectComponent('.van-area__picker');
+      }
+      return this.picker;
+    },
+    onCancel(event) {
+      this.emit('cancel', event.detail);
+    },
+    onConfirm(event) {
+      const { index } = event.detail;
+      let { value } = event.detail;
+      value = this.parseOutputValues(value);
+      this.emit('confirm', { value, index });
+    },
+    emit(type, detail) {
+      detail.values = detail.value;
+      delete detail.value;
+      this.$emit(type, detail);
+    },
+    // parse output columns data
+    parseOutputValues(values) {
+      const { columnsPlaceholder } = this.data;
+      return values.map((value, index) => {
+        // save undefined value
+        if (!value) return value;
+        value = JSON.parse(JSON.stringify(value));
+        if (!value.code || value.name === columnsPlaceholder[index]) {
+          value.code = '';
+          value.name = '';
+        }
+        return value;
+      });
+    },
+    onChange(event) {
+      const { index, picker, value } = event.detail;
+      this.code = value[index].code;
+      this.setValues().then(() => {
+        this.$emit('change', {
+          picker,
+          values: this.parseOutputValues(picker.getValues()),
+          index,
+        });
+      });
+    },
+    getConfig(type) {
+      const { areaList } = this.data;
+      return (areaList && areaList[`${type}_list`]) || {};
+    },
+    getList(type, code) {
+      const { typeToColumnsPlaceholder } = this.data;
+      let result = [];
+      if (type !== 'province' && !code) {
+        return result;
+      }
+      const list = this.getConfig(type);
+      result = Object.keys(list).map((code) => ({
+        code,
+        name: list[code],
+      }));
+      if (code) {
+        // oversea code
+        if (code[0] === '9' && type === 'city') {
+          code = '9';
+        }
+        result = result.filter((item) => item.code.indexOf(code) === 0);
+      }
+      if (typeToColumnsPlaceholder[type] && result.length) {
+        // set columns placeholder
+        const codeFill =
+          type === 'province'
+            ? ''
+            : type === 'city'
+            ? COLUMNSPLACEHOLDERCODE.slice(2, 4)
+            : COLUMNSPLACEHOLDERCODE.slice(4, 6);
+        result.unshift({
+          code: `${code}${codeFill}`,
+          name: typeToColumnsPlaceholder[type],
+        });
+      }
+      return result;
+    },
+    getIndex(type, code) {
+      let compareNum = type === 'province' ? 2 : type === 'city' ? 4 : 6;
+      const list = this.getList(type, code.slice(0, compareNum - 2));
+      // oversea code
+      if (code[0] === '9' && type === 'province') {
+        compareNum = 1;
+      }
+      code = code.slice(0, compareNum);
+      for (let i = 0; i < list.length; i++) {
+        if (list[i].code.slice(0, compareNum) === code) {
+          return i;
+        }
+      }
+      return 0;
+    },
+    setValues() {
+      const county = this.getConfig('county');
+      let { code } = this;
+      if (!code) {
+        if (this.data.columnsPlaceholder.length) {
+          code = COLUMNSPLACEHOLDERCODE;
+        } else if (Object.keys(county)[0]) {
+          code = Object.keys(county)[0];
+        } else {
+          code = '';
+        }
+      }
+      const province = this.getList('province');
+      const city = this.getList('city', code.slice(0, 2));
+      const picker = this.getPicker();
+      if (!picker) {
+        return;
+      }
+      const stack = [];
+      stack.push(picker.setColumnValues(0, province, false));
+      stack.push(picker.setColumnValues(1, city, false));
+      if (city.length && code.slice(2, 4) === '00') {
+        [{ code }] = city;
+      }
+      stack.push(
+        picker.setColumnValues(
+          2,
+          this.getList('county', code.slice(0, 4)),
+          false
+        )
+      );
+      return Promise.all(stack)
+        .catch(() => {})
+        .then(() =>
+          picker.setIndexes([
+            this.getIndex('province', code),
+            this.getIndex('city', code),
+            this.getIndex('county', code),
+          ])
+        )
+        .catch(() => {});
+    },
+    getValues() {
+      const picker = this.getPicker();
+      return picker ? picker.getValues().filter((value) => !!value) : [];
+    },
+    getDetail() {
+      const values = this.getValues();
+      const area = {
+        code: '',
+        country: '',
+        province: '',
+        city: '',
+        county: '',
+      };
+      if (!values.length) {
+        return area;
+      }
+      const names = values.map((item) => item.name);
+      area.code = values[values.length - 1].code;
+      if (area.code[0] === '9') {
+        area.country = names[1] || '';
+        area.province = names[2] || '';
+      } else {
+        area.province = names[0] || '';
+        area.city = names[1] || '';
+        area.county = names[2] || '';
+      }
+      return area;
+    },
+    reset(code) {
+      this.code = code || '';
+      return this.setValues();
+    },
+  },
+});

+ 6 - 0
vant-weapp/dist/area/index.json

@@ -0,0 +1,6 @@
+{
+  "component": true,
+  "usingComponents": {
+    "van-picker": "../picker/index"
+  }
+}

+ 18 - 0
vant-weapp/dist/area/index.wxml

@@ -0,0 +1,18 @@
+<van-picker
+  class="van-area__picker"
+  active-class="active-class"
+  toolbar-class="toolbar-class"
+  column-class="column-class"
+  show-toolbar
+  value-key="name"
+  title="{{ title }}"
+  loading="{{ loading }}"
+  columns="{{ displayColumns }}"
+  item-height="{{ itemHeight }}"
+  visible-item-count="{{ visibleItemCount }}"
+  cancel-button-text="{{ cancelButtonText }}"
+  confirm-button-text="{{ confirmButtonText }}"
+  bind:change="onChange"
+  bind:confirm="onConfirm"
+  bind:cancel="onCancel"
+/>

+ 1 - 0
vant-weapp/dist/area/index.wxss

@@ -0,0 +1 @@
+@import '../common/index.wxss';

+ 1 - 0
vant-weapp/dist/button/index.d.ts

@@ -0,0 +1 @@
+export {};

+ 79 - 0
vant-weapp/dist/button/index.js

@@ -0,0 +1,79 @@
+import { VantComponent } from '../common/component';
+import { button } from '../mixins/button';
+import { openType } from '../mixins/open-type';
+import { canIUseFormFieldButton } from '../common/version';
+const mixins = [button, openType];
+if (canIUseFormFieldButton()) {
+  mixins.push('wx://form-field-button');
+}
+VantComponent({
+  mixins,
+  classes: ['hover-class', 'loading-class'],
+  data: {
+    baseStyle: '',
+  },
+  props: {
+    formType: String,
+    icon: String,
+    classPrefix: {
+      type: String,
+      value: 'van-icon',
+    },
+    plain: Boolean,
+    block: Boolean,
+    round: Boolean,
+    square: Boolean,
+    loading: Boolean,
+    hairline: Boolean,
+    disabled: Boolean,
+    loadingText: String,
+    customStyle: String,
+    loadingType: {
+      type: String,
+      value: 'circular',
+    },
+    type: {
+      type: String,
+      value: 'default',
+    },
+    dataset: null,
+    size: {
+      type: String,
+      value: 'normal',
+    },
+    loadingSize: {
+      type: String,
+      value: '20px',
+    },
+    color: {
+      type: String,
+      observer(color) {
+        let style = '';
+        if (color) {
+          style += `color: ${this.data.plain ? color : 'white'};`;
+          if (!this.data.plain) {
+            // Use background instead of backgroundColor to make linear-gradient work
+            style += `background: ${color};`;
+          }
+          // hide border when color is linear-gradient
+          if (color.indexOf('gradient') !== -1) {
+            style += 'border: 0;';
+          } else {
+            style += `border-color: ${color};`;
+          }
+        }
+        if (style !== this.data.baseStyle) {
+          this.setData({ baseStyle: style });
+        }
+      },
+    },
+  },
+  methods: {
+    onClick() {
+      if (!this.data.loading) {
+        this.$emit('click');
+      }
+    },
+    noop() {},
+  },
+});

+ 7 - 0
vant-weapp/dist/button/index.json

@@ -0,0 +1,7 @@
+{
+  "component": true,
+  "usingComponents": {
+    "van-icon": "../icon/index",
+    "van-loading": "../loading/index"
+  }
+}

+ 68 - 0
vant-weapp/dist/button/index.wxml

@@ -0,0 +1,68 @@
+<wxs src="../wxs/utils.wxs" module="utils" />
+
+<button
+  id="{{ id }}"
+  data-detail="{{ dataset }}"
+  class="custom-class {{ utils.bem('button', [type, size, { block, round, plain, square, loading, disabled, hairline, unclickable: disabled || loading }]) }} {{ hairline ? 'van-hairline--surround' : '' }}"
+  hover-class="van-button--active hover-class"
+  lang="{{ lang }}"
+  form-type="{{ formType }}"
+  style="{{ baseStyle }} {{ customStyle }}"
+  open-type="{{ disabled ? '' : openType }}"
+  business-id="{{ businessId }}"
+  session-from="{{ sessionFrom }}"
+  send-message-title="{{ sendMessageTitle }}"
+  send-message-path="{{ sendMessagePath }}"
+  send-message-img="{{ sendMessageImg }}"
+  show-message-card="{{ showMessageCard }}"
+  app-parameter="{{ appParameter }}"
+  aria-label="{{ ariaLabel }}"
+  bindtap="{{ !disabled ? 'onClick' : 'noop' }}"
+  bindgetuserinfo="bindGetUserInfo"
+  bindcontact="bindContact"
+  bindgetphonenumber="bindGetPhoneNumber"
+  binderror="bindError"
+  bindlaunchapp="bindLaunchApp"
+  bindopensetting="bindOpenSetting"
+>
+  <block wx:if="{{ loading }}">
+    <van-loading
+      custom-class="loading-class"
+      size="{{ loadingSize }}"
+      type="{{ loadingType }}"
+      color="{{ loadingColor(type,color,plain) }}"
+    />
+    <view wx:if="{{ loadingText }}" class="van-button__loading-text">
+      {{ loadingText }}
+    </view>
+  </block>
+  <block wx:else>
+    <van-icon
+      wx:if="{{ icon }}"
+      size="1.2em"
+      name="{{ icon }}"
+      class-prefix="{{ classPrefix }}"
+      class="van-button__icon"
+      custom-style="line-height: inherit;"
+    />
+    <view class="van-button__text">
+      <slot />
+    </view>
+  </block>
+</button>
+
+
+<wxs module="loadingColor">
+function get(type, color,plain) {
+  if(plain) {
+    return color ? color: '#c9c9c9';
+  }
+
+  if(type === 'default') {
+    return '#c9c9c9';
+  }
+  return 'white';
+}
+
+module.exports = get;
+</wxs>

Разница между файлами не показана из-за своего большого размера
+ 1 - 0
vant-weapp/dist/button/index.wxss


+ 0 - 0
vant-weapp/dist/card/index.d.ts


Некоторые файлы не были показаны из-за большого количества измененных файлов