Переглянути джерело

Merge branch 'master' of http://39.106.8.246:3003/sagacloud/sagacloud-sagacare-weChat

zhaojing 1 рік тому
батько
коміт
b4d73b457f

+ 1 - 1
project.private.config.json

@@ -14,7 +14,7 @@
       "list": [
         {
           "name": "",
-          "pathName": "pages/auth/index",
+          "pathName": "pages/bindTenant/index",
           "query": "",
           "launchMode": "default",
           "scene": null

+ 76 - 76
src/packagesEnv/pages/officehome/airHand/air-hand-card.wpy

@@ -323,18 +323,18 @@ wepy.component({
       this.$emit('setCanScroll', true)
     },
     eachAirOpen(aindex) {
-      isWithinLocation()
-        .then(() => {
-          this.allDevices[aindex].open = !this.allDevices[aindex].open
-          var value = this.allDevices[aindex].open ? 1 : 0
+    //   isWithinLocation()
+    //     .then(() => {
+      this.allDevices[aindex].open = !this.allDevices[aindex].open
+      var value = this.allDevices[aindex].open ? 1 : 0
 
-          this.changeOneAir(
+      this.changeOneAir(
             this.allDevices[aindex].id,
             this.allDevices[aindex].switchCode,
             value
           )
-        })
-        .catch(() => {})
+        // })
+        // .catch(() => {})
     },
     showDetail(funcid) {
       this.$emit('showDetail', { funcid: funcid })
@@ -495,85 +495,85 @@ wepy.component({
     },
     changeZongAir(btnType, value) {
       if (!this.airData.isOpen && btnType != 'sw') return
-      isWithinLocation()
-        .then(() => {
-          if (this.roomType === '开放') {
-            this.showWorkTime = this.checkAirCanOpen(
+    //   isWithinLocation()
+    //     .then(() => {
+      if (this.roomType === '开放') {
+        this.showWorkTime = this.checkAirCanOpen(
               'air',
               !this.airData.isOpen
             )
-            if (!this.showWorkTime) {
-              return
-            }
-          }
-          var _this = this
-          if (btnType == 'gear' && value == 'windLow') {
+        if (!this.showWorkTime) {
+          return
+        }
+      }
+      var _this = this
+      if (btnType == 'gear' && value == 'windLow') {
             // 降挡
-            if (this.airGear > 1) {
-              this.airGear--
-              this.isAutoGear = 0
-            } else {
-              return
-            }
-          }
-          if (btnType == 'gear' && value == 'windUp') {
+        if (this.airGear > 1) {
+          this.airGear--
+          this.isAutoGear = 0
+        } else {
+          return
+        }
+      }
+      if (btnType == 'gear' && value == 'windUp') {
             // 升档
-            if (this.airGear < 3) {
-              this.airGear++
-              this.isAutoGear = 0
-            } else {
-              return
-            }
-          }
-          if (btnType == 'gear' && value == 'auto') {
-            this.isAutoGear = this.isAutoGear == 1 ? 0 : 1
-          }
-          if (btnType == 'mode') {
-            this.airMode = value
+        if (this.airGear < 3) {
+          this.airGear++
+          this.isAutoGear = 0
+        } else {
+          return
+        }
+      }
+      if (btnType == 'gear' && value == 'auto') {
+        this.isAutoGear = this.isAutoGear == 1 ? 0 : 1
+      }
+      if (btnType == 'mode') {
+        this.airMode = value
+      }
+      if (btnType == 'sw') {
+        this.airData.isOpen = !this.airData.isOpen
+      }
+
+      let paramArr = []
+      this.allDevices.forEach((dele) => {
+        if (btnType == 'sw') {
+          let paramObj = {
+            id: dele.id,
+            code: dele.switchCode,
+            value: _this.airData.isOpen ? 1 : 0
           }
-          if (btnType == 'sw') {
-            this.airData.isOpen = !this.airData.isOpen
+          paramArr.push(paramObj)
+        }
+        var pvalue
+        dele.allModel.forEach((mele) => {
+          if (mele.id == 'temp') {
+            pvalue = value
+          } else if (mele.id == 'gear') {
+            pvalue = _this.isAutoGear == 1 ? 4 : _this.airGear
+          } else if (mele.id == 'mode') {
+            pvalue = _this.airMode
           }
 
-          let paramArr = []
-          this.allDevices.forEach((dele) => {
-            if (btnType == 'sw') {
-              let paramObj = {
-                id: dele.id,
-                code: dele.switchCode,
-                value: _this.airData.isOpen ? 1 : 0
-              }
-              paramArr.push(paramObj)
+          if (mele.id == btnType) {
+            let paramObj = {
+              id: dele.id,
+              code: mele.code,
+              value: pvalue
             }
-            var pvalue
-            dele.allModel.forEach((mele) => {
-              if (mele.id == 'temp') {
-                pvalue = value
-              } else if (mele.id == 'gear') {
-                pvalue = _this.isAutoGear == 1 ? 4 : _this.airGear
-              } else if (mele.id == 'mode') {
-                pvalue = _this.airMode
-              }
-
-              if (mele.id == btnType) {
-                let paramObj = {
-                  id: dele.id,
-                  code: mele.code,
-                  value: pvalue
-                }
-                paramArr.push(paramObj)
-              }
-            })
-          })
+            paramArr.push(paramObj)
+          }
+        })
+      })
 
-          this.vibrateShort()
-          wx.showLoading()
+      this.vibrateShort()
+      wx.showLoading()
 
           //  下达指令
-          changeManualTempHttp(paramArr, {
-            curTemp: _this.temperature,
-            equipType: 'airConditioner'
-          })
+      changeManualTempHttp(paramArr, {
+        curTemp: _this.temperature,
+        equipType: 'airConditioner'
+      })
             .then((res) => {
               if (btnType == 'temp') {
                 _this.airTemp = value
@@ -583,8 +583,8 @@ wepy.component({
             .catch(() => {
               wx.hideLoading()
             })
-        })
-        .catch(() => {})
+        // })
+        // .catch(() => {})
     },
     changeOneAir(id, code, value, deviceObjCopy) {
       var _this = this

+ 39 - 39
src/packagesEnv/pages/officehome/components/lamp-adjust.wpy

@@ -465,51 +465,51 @@ wepy.component({
       return true
     },
     eqChange(value, id, index) {
-      isWithinLocation().then(() => {
-        if (this.roomType === '开放') {
-          this.showWorkTime = this.checkLampCanOpen(value, id)
-          if (!this.showWorkTime) return
-        }
-        this.fifteenTimeout()
-        let params = []
-        if (id === 'allLamp') {
-          params = this.initData
-          params.forEach(item => {
-            item.switch = value
-          })
+    //   isWithinLocation().then(() => {
+      if (this.roomType === '开放') {
+        this.showWorkTime = this.checkLampCanOpen(value, id)
+        if (!this.showWorkTime) return
+      }
+      this.fifteenTimeout()
+      let params = []
+      if (id === 'allLamp') {
+        params = this.initData
+        params.forEach(item => {
+          item.switch = value
+        })
          // 前端现更改灯的状态,15s后获取设备状态
-          this.lampList.map(item => {
+        this.lampList.map(item => {
+          item.switch = value
+          this.setLampItem(item)
+        })
+        this.initData.map(item => {
+          item.switch = value
+          this.setLampItem(item)
+        })
+        this.lampSw = value
+      } else {
+        params = [{ id: id, switch: value }]
+          //  前端现更改灯的状态,15s后获取设备状态
+        if (this.lampList.length === 1) {
+          this.lampSw = value
+        }
+        this.lampList.map(item => {
+          if (item.id === id) {
             item.switch = value
             this.setLampItem(item)
-          })
-          this.initData.map(item => {
+          }
+        })
+        this.initData.map(item => {
+          if (item.id === id) {
             item.switch = value
             this.setLampItem(item)
-          })
-          this.lampSw = value
-        } else {
-          params = [{ id: id, switch: value }]
-          //  前端现更改灯的状态,15s后获取设备状态
-          if (this.lampList.length === 1) {
-            this.lampSw = value
           }
-          this.lampList.map(item => {
-            if (item.id === id) {
-              item.switch = value
-              this.setLampItem(item)
-            }
-          })
-          this.initData.map(item => {
-            if (item.id === id) {
-              item.switch = value
-              this.setLampItem(item)
-            }
-          })
-        }
-        this.fifteenTimeout()
-        setallLampHttp(params).then(res => {})
-        this.vibrateShort()
-      })
+        })
+      }
+      this.fifteenTimeout()
+      setallLampHttp(params).then(res => {})
+      this.vibrateShort()
+    //   })
     },
     // 15s 之后再请求状态
     fifteenTimeout() {

+ 4 - 1
src/packagesEnv/pages/portrait/pointExplain.wpy

@@ -81,6 +81,7 @@ page {
             </div>
 
         </div>
+        <footer :justText="true"></footer>
     </div>
 
 </template>
@@ -131,7 +132,9 @@ wepy.page({
     'navigationBarTitleText': '',
     navigationStyle:"custom",
     usingComponents: {
-        'page-top-bar': '~@/components/common/page-top-bar',      
+        'page-top-bar': '~@/components/common/page-top-bar',  
+        'footer':'~@/components/coustome/footer'  
+    
     },
 
 }

+ 3 - 0
src/packagesEnv/pages/search/index.wpy

@@ -13,6 +13,7 @@ page {
     display: flex;
     position: relative;
     margin: 40rpx auto;
+    margin-top: 0;
     margin-bottom: 32rpx;
     width: 670rpx;
     height: 96rpx;
@@ -296,6 +297,7 @@ import eventHub from '@/common/eventHub';
 import { mapState } from '@wepy/x';
 import store from '@/store';
 import utils from '@/common/utils';
+import { checkHasUserInfo } from '@/service/user.js';
 import { findControllSpace } from '@/packagesEnv/api/mapApi';
 import testMixin from '@/mixins/test';
 
@@ -325,6 +327,7 @@ wepy.page({
     }),
   },
   onLoad() {
+    checkHasUserInfo()
     this.init();
   },
   onReady() {

+ 119 - 76
src/pages/auth/index.wpy

@@ -1,87 +1,126 @@
 <style lang="less">
-.login-box {
-  padding-top: 40px;
-  .avatar-wrapper {
-    padding: 0px;
-    width: 196rpx;
-    height: 196rpx;
-    border-radius: 50%;
-    image {
+page {
+  width: 100%;
+  height: 100%;
+}
+.auth-box {
+  position: relative;
+  box-sizing: border-box;
+  padding-top: 136rpx;
+  width: 100%;
+  background: #fff;
+  height: 100%;
+  .login-box {
+    // position: absolute;
+    padding-top: 40px;
+    .avatar-wrapper {
+      position: relative;
+      padding: 0px;
       width: 196rpx;
       height: 196rpx;
       border-radius: 50%;
+      background: transparent;
+      image {
+        position: absolute;
+        left: 0;
+        top: 0;
+        width: 198rpx;
+        height: 198rpx;
+        z-index: 333;
+        border-radius: 50%;
+      }
     }
-  }
-  .avatar-tip {
-    text-align: center;
-    font-family: PingFang SC;
-    font-size: 28rpx;
-    font-weight: 400;
-    line-height: 44rpx;
-    text-align: center;
-  }
-
-  .bind-btn-box {
-    position: fixed;
-    bottom: 228rpx;
-    left: 50%;
-    transform: translateX(-50%);
-    .bind-btn {
-      width: 548rpx;
-      height: 100rpx;
-      line-height: 100rpx;
-      border-radius: 56rpx;
-      background: rgba(61, 203, 204, 1);
-      border: none;
-      font-family: PingFang SC;
-      font-size: 32rpx;
-      font-weight: 400;
-      letter-spacing: 0px;
+    .avatar-tip {
       text-align: center;
-      color: #fff;
-    }
-    .bind-btn-tip {
-      //styleName: 14/常规;
       font-family: PingFang SC;
-      padding-top: 32rpx;
       font-size: 28rpx;
       font-weight: 400;
       line-height: 44rpx;
       text-align: center;
-      color: rgba(139, 148, 158, 1);
     }
-  }
 
-  .home-btn {
-    margin-top: 240rpx;
-    width: 548rpx;
-    height: 100rpx;
-    line-height: 100rpx;
-    border-radius: 56rpx;
-    border: 1px solid rgba(61, 203, 204, 1);
+    .bind-btn-box {
+      position: fixed;
+      bottom: 228rpx;
+      left: 50%;
+      transform: translateX(-50%);
+      z-index: 999;
+      .bind-btn {
+        width: 548rpx;
+        height: 100rpx;
+        line-height: 100rpx;
+        border-radius: 56rpx;
+        background: rgba(61, 203, 204, 1);
+        border: none;
+        font-family: PingFang SC;
+        font-size: 32rpx;
+        font-weight: 400;
+        letter-spacing: 0px;
+        text-align: center;
+        color: #fff;
+      }
+      .bind-btn-tip {
+        //styleName: 14/常规;
+        font-family: PingFang SC;
+        padding-top: 32rpx;
+        font-size: 28rpx;
+        font-weight: 400;
+        line-height: 44rpx;
+        text-align: center;
+        color: rgba(139, 148, 158, 1);
+      }
+    }
+
+    .home-btn {
+      margin-top: 240rpx;
+      width: 548rpx;
+      height: 100rpx;
+      line-height: 100rpx;
+      border-radius: 56rpx;
+      border: 1px solid rgba(61, 203, 204, 1);
+    }
+  }
+  .top {
+    position: absolute;
+    width: 100%;
+    top: 0;
+    z-index: 33;
+  }
+  .bottom {
+    position: absolute;
+    width: 100%;
+    bottom: 0;
+    z-index: 33;
   }
 }
 </style>
 <template>
- <div class="login-box">
-  <button class="avatar-wrapper"
-    v-if="canIUseGetUserProfile"
-    open-type="chooseAvatar" 
-    bind:chooseavatar="onChooseAvatar">
-    <image class="avatar" src="{{avatarUrl}}"/>
-  </button>  
-  <div class="avatar-tip" v-if="canIUseGetUserProfile">可点击获取头像</div>
-  <div class="bind-btn-box">
-   <button class="bind-btn"
-   open-type="getPhoneNumber"
-   bindgetphonenumber="phonenumberAuth"
-   >微信手机号认证</button>
-   <!-- @click="goBindTenant" -->
-   <!-- bindgetphonenumber="phonenumberAuth" -->
-   <div class="bind-btn-tip">确保是入职公司使用的手机号</div>
+<div class="auth-box">
+  <page-top-bar title=" " 
+  titleColor="#1B2129"></page-top-bar>
+  <image class="top" src="{{h5StaticPath}}/page-bind-tenant/auth-top.jpg"/>
+  <div class="login-box">
+    <button class="avatar-wrapper"
+      v-if="canIUseGetUserProfile"
+      open-type="chooseAvatar" 
+      bind:chooseavatar="onChooseAvatar">
+      <image class="avatar" src="{{avatarUrl}}"/>
+    </button>  
+    <div class="avatar-tip" v-if="canIUseGetUserProfile">可点击获取头像</div>
+    <div class="bind-btn-box">
+    <button class="bind-btn"
+    open-type="getPhoneNumber"
+    bindgetphonenumber="phonenumberAuth"
+    >微信手机号认证</button>
+    <!-- @click="goBindTenant" -->
+    <!-- bindgetphonenumber="phonenumberAuth" -->
+    <div class="bind-btn-tip">确保是入职公司使用的手机号</div>
+    </div>
+    <!-- <button class="home-btn" @click="goHome">首页</button> -->
   </div>
-  <!-- <button class="home-btn" @click="goHome">首页</button> -->
- </div>
+  <image class="bottom" src="{{h5StaticPath}}/page-bind-tenant/auth-bottom.jpg"/>
+
+</div>
 </template>
 
 <script>
@@ -96,14 +135,15 @@ let defaultAvatarUrl =
 wepy.page({
   store,
   config: {
-    navigationBarTitleText: 'test'
+    navigationBarTitleText: 'test',
   },
   data: {
     nicknameValue: '',
+    h5StaticPath: config.h5StaticPath,
     avatarUrl: defaultAvatarUrl,
     msg: '测试数据',
     canIUseGetUserProfile: false,
-    userInformation: wx.getStorageSync('userInformation')
+    userInformation: wx.getStorageSync('userInformation'),
   },
   onLoad() {
     if (wx.getUserProfile) {
@@ -125,13 +165,13 @@ wepy.page({
           console.log(res.data);
           that.avatarUrl = 'data:image/png;base64,' + res.data;
           setAvatar(that.avatarUrl);
-        }
+        },
       });
     },
     getPageCompanyByPhone() {},
     goHome() {
       wx.navigateTo({
-        url: '/packagesEnv/pages/home/index'
+        url: '/packagesEnv/pages/home/index',
       });
     },
     // 手机号认证
@@ -145,7 +185,7 @@ wepy.page({
     // code 换取手机号
     getHttpPhoneNumber(code) {
       getHttpPhoneNumber(code)
-        .then(res => {
+        .then((res) => {
           let data = res.data || {};
           let phoneNumber = data.purePhoneNumber;
           if (phoneNumber) {
@@ -155,22 +195,25 @@ wepy.page({
             console.log('没获取到手机号');
           }
         })
-        .catch(error => {
+        .catch((error) => {
           console.log('获取手机号的接口失败');
         });
     },
     goBindTenant() {
       console.log('被点击了');
       wx.navigateTo({
-        url: '/pages/bindTenant/index'
+        url: '/pages/bindTenant/index',
       });
-    }
+    },
   },
-  created() {}
+  created() {},
 });
 </script>
 <config>
 {
-navigationBarTitleText: '首页',
+navigationStyle:"custom",
+usingComponents: {
+    'page-top-bar': '~@/components/common/page-top-bar',      
+  },
 }
 </config>

+ 6 - 5
src/pages/bindTenant/index.wpy

@@ -209,19 +209,19 @@ wepy.page({
     // 获取租户数据
     getPageCompanyByPhone() {
       getCompanyDataByPhone().then((res) => {
+        let data = res ;
         console.log(res);
-        let data = res;
         if (data && data.length) {
           this.tenantData = data;
           this.initTentData();
           this.selecItem = this.tenantData[0];
         } else {
           wx.showToast({
-            title: '未获得公司服务权限!',
+            title: '您的手机号还未获得公司服务权限!',
             duration: 5000,
             icon: 'none',
           });
-          this.goHome();
+          this.returnLogin();
         }
       });
     },
@@ -234,9 +234,10 @@ wepy.page({
         url: '/packagesEnv/pages/home/index',
       });
     },
+    //  返回登录页面
     returnLogin() {
-      wx.navigateTo({
-        url: 'pages/index',
+      wx.redirectTo({
+        url: '/pages/index',
       });
     },
     goEnv() {

+ 7 - 3
src/pages/index.wpy

@@ -11,7 +11,11 @@ page {
 .login {
   width: 100%;
   height: 100%;
-  background: rgba(0, 0, 0.2);
+  // background-size: 100% 100%;
+  background-repeat: no-repeat;
+  background-position: center;
+  background-size: cover;
+  // background: rgba(0, 0, 0.2);
   image {
     position: relative;
     width: 384rpx;
@@ -42,9 +46,9 @@ page {
 </style>
 <template>
   <div class="login-box">
-    <page-top-bar title="" 
+    <page-top-bar title=" " 
   titleColor="#1B2129"></page-top-bar>
-   <div class="login">
+   <div class="login" :style="{'background-image':'url('+h5StaticPath+'/page-bind-tenant/login-bg.jpg)'}">
        <image src="{{h5StaticPath +'/page-bind-tenant/logo_title.png'}}" alt=""/>
        <button class="bind-btn"
         @click.stop="goBindTenant">登录</button>

+ 1 - 4
src/service/user.js

@@ -96,11 +96,8 @@ function wxLogin (type) {
 // 获取租户信息
 function getCompanyDataByPhone() {
   return new Promise((resolve, reject) => {
-    let userPhone = wx.getStorageSync('userPhone');
     let userInfo = store.state.user.userInfo;
-    if (!userPhone) {
-      userPhone = userInfo.phone
-    }
+    let userPhone = userInfo.phone || wx.getStorageSync('userPhone');
     let params = {
       phone: userPhone
     }