chenzhen2 пре 1 година
родитељ
комит
7b57f0a138

+ 15 - 6
src/api/home.js

@@ -17,9 +17,9 @@ export function queryControlSpaceCompany(params) {
   return $http({
     url: `/controlSpaceUser/getControlSpaceCompany`,
     method: 'POST',
-    serverSp:'http://192.168.4.29:52015',
-    data: JSON.stringify(params)
-  })
+    serverSp: 'http://192.168.4.29:52015',
+    data: JSON.stringify(params),
+  });
 }
 
 //常驻空间快速调节卡片
@@ -27,14 +27,14 @@ export function querySpaceFunctionCard(params) {
   return $http({
     url: `/controlSpaceUser/queryPermanentSpaceFunctionCard?userId=${params.userId}&companyId=${params.companyId}`,
     method: 'GET',
-    serverSp:'http://192.168.4.29:52015'
+    serverSp: 'http://192.168.4.29:52015',
   });
 }
 //常驻空间参数属性
 export function getSpaceProperty(params) {
   return $http({
     url: `/duoduo-service/duoduoenv-service/custom/spaceProperty?projectId=${params.projectId}&spaceId=${params.spaceId}`,
-    method: 'GET'
+    method: 'GET',
   });
 }
 //切换公司
@@ -50,7 +50,16 @@ export function getWeather(projectId) {
   return $http({
     isNotShowErrorToast: true,
     url: `/duoduo-service/object-service/weather/getCurrentWeather?projectId=${projectId}`,
-    method: 'get'
+    method: 'get',
+  });
+}
+//扫码确认登录接 行政端
+export function confirmLogin({ qrCodeId }) {
+  // /duoduo-service/duoduoenv-service/userNew/confirmLogin
+  return $http({
+    url: `/userNew/confirmLogin/${qrCodeId}`,
+    method: 'GET',
+    serverSp: 'http://192.168.16.181:52009',
   });
 }
 

+ 5 - 3
src/packagesEnv/api/officehome.js

@@ -1,6 +1,7 @@
 import $http from '@/common/request.js'
 import config from '@/config'
 import store from '@/store/index.js'
+import { user } from '@/store/user.js'
 
 function storeUser() {
   let userInfo = store.state.user.userInfo
@@ -420,11 +421,12 @@ function queryCustomAndScence(params) {
     errorSave: true
   })
 }
-
+// TODO 设置常驻工区
 function changeDefaultSpace(params) {
   return $http({
-    url: `/user/defaultSpace?spaceId=${params}`,
-    method: 'POST',
+    serverSp: 'http://192.168.4.29:52015',
+    url: `/controlSpaceUser/savePermanentSpace?spaceId=${params}&userId=${storeUser().userId}`,
+    method: 'GET',
     isNotShowErrorToast: true,
     errorSave: true
   })

+ 25 - 53
src/packagesEnv/pages/administration/chooseIdentity.wpy

@@ -1,7 +1,7 @@
 <style lang="less">
 .overflow-wrap {
   box-sizing: border-box;
-  position:relative;
+  position: relative;
   width: 100%;
   height: 100%;
   background-color: #ebf5fa;
@@ -94,63 +94,16 @@
   <div class="overflow-wrap"  :style="{'background-image': 'url('+h5StaticPath+'/page-home/adminBack.png)'}">
     <navigationbar :ntitle="'选择登录身份'"></navigationbar>
    <div class="bind-item" >
-      <div class="tenant-name">博锐尚格技术有限公司</div>
-      <div class="tenant-identity">
-        <div class="info">正式员工</div>
-        <image class="logo-icon"  src="{{h5StaticPath+'/page-bind-tenant/logo_icon.svg'}}"/>
-      </div>
-      <image class="checked-icon"   src="{{h5StaticPath+'/page-bind-tenant/checked.svg'}}"/>
-   </div>
-   <div class="bind-item" >
-      <div class="tenant-name">博锐尚格技术有限公司</div>
-      <div class="tenant-identity">
-        <div class="info">正式员工</div>
-        <image class="logo-icon"  src="{{h5StaticPath+'/page-bind-tenant/logo_icon.svg'}}"/>
-      </div>
-      <image class="checked-icon"   src="{{h5StaticPath+'/page-bind-tenant/checked.svg'}}"/>
-   </div>
-   <div class="bind-item" >
-      <div class="tenant-name">博锐尚格技术有限公司</div>
-      <div class="tenant-identity">
-        <div class="info">正式员工</div>
-        <image class="logo-icon"  src="{{h5StaticPath+'/page-bind-tenant/logo_icon.svg'}}"/>
-      </div>
-      <image class="checked-icon"   src="{{h5StaticPath+'/page-bind-tenant/checked.svg'}}"/>
-   </div>
-   <div class="bind-item" >
-      <div class="tenant-name">博锐尚格技术有限公司</div>
-      <div class="tenant-identity">
-        <div class="info">正式员工</div>
-        <image class="logo-icon"  src="{{h5StaticPath+'/page-bind-tenant/logo_icon.svg'}}"/>
-      </div>
-      <image class="checked-icon"   src="{{h5StaticPath+'/page-bind-tenant/checked.svg'}}"/>
-   </div>
-   <div class="bind-item" >
-      <div class="tenant-name">博锐尚格技术有限公司</div>
-      <div class="tenant-identity">
-        <div class="info">正式员工</div>
-        <image class="logo-icon"  src="{{h5StaticPath+'/page-bind-tenant/logo_icon.svg'}}"/>
-      </div>
-      <image class="checked-icon"   src="{{h5StaticPath+'/page-bind-tenant/checked.svg'}}"/>
-   </div>
-   <div class="bind-item" >
-      <div class="tenant-name">博锐尚格技术有限公司</div>
-      <div class="tenant-identity">
-        <div class="info">正式员工</div>
-        <image class="logo-icon"  src="{{h5StaticPath+'/page-bind-tenant/logo_icon.svg'}}"/>
-      </div>
-      <image class="checked-icon"   src="{{h5StaticPath+'/page-bind-tenant/checked.svg'}}"/>
-   </div>
-   <div class="bind-item" >
-      <div class="tenant-name">博锐尚格技术有限公司</div>
+      <div class="tenant-name">{{ companyName }}</div>
       <div class="tenant-identity">
         <div class="info">正式员工</div>
         <image class="logo-icon"  src="{{h5StaticPath+'/page-bind-tenant/logo_icon.svg'}}"/>
       </div>
       <image class="checked-icon"   src="{{h5StaticPath+'/page-bind-tenant/checked.svg'}}"/>
    </div>
+
    <div class="bind-btn-box">
-    <button @click.stop="bindTent">确认</button>
+    <button @click.stop="loginAdmin">确认</button>
    </div>
  </div>
 </template>
@@ -161,22 +114,41 @@ import eventHub from '@/common/eventHub';
 import { mapState } from '@wepy/x';
 import store from '@/store';
 import config from '@/config';
+import { confirmLogin } from '@/api/home.js';
 
 wepy.page({
   store,
   config: {},
   data: {
     h5StaticPath: config.h5StaticPath,
+    qrCodeId: '',
   },
   computed: {
     ...mapState({
       userInfo: (state) => state.user.userInfo,
       projctId: (state) => state.user?.userInfo?.projctId,
       companyId: (state) => state.user?.userInfo?.companyId,
+      companyName: (state) => {
+        return state.user?.companyName;
+      },
     }),
   },
-  methods: {},
-  onLoad() {},
+  methods: {
+    loginAdmin() {
+      confirmLogin({ qrCodeId: '1792589efd114af5a1493f1b05a22378' })
+        .then((res) => {
+          if (res.result == 'success') {
+            wx.navigateTo({
+              url: `/packagesEnv/pages/administration/asuccess`,
+            });
+          }
+        })
+        .catch((err) => {});
+    },
+  },
+  onLoad(options) {
+    this.qrCodeId = options.qrCodeId;
+  },
   onShow() {},
 });
 </script>

+ 15 - 3
src/packagesEnv/pages/administration/index.wpy

@@ -78,7 +78,7 @@
     <div class="aLink">用电脑打开上方行政端网址<span class="copy">复制网址</span></div>
   </div>
   <div class="bottom">
-    <div class="aButton">
+    <div class="aButton" @click="scanQrcode">
       <van-icon name="scan" style="margin-right:8px;"/>扫码登录
     </div>
   <div class="aInfo">扫一扫行政端二维码,登录行政端</div>
@@ -106,8 +106,20 @@ wepy.page({
       companyId: (state) => state.user?.userInfo?.companyId,
     }),
   },
-  methods: {},
-  onLoad() {},
+  methods: {
+    scanQrcode: function() {
+      wx.scanCode({
+        success: (res) => {
+          console.log('scanQrcodescanQrcode', res);
+          var qrCodeId = res.result;
+          wx.navigateTo({
+            url: `/packagesEnv/pages/administration/chooseIdentity?qrCodeId=${qrCodeId}`,
+          });
+        },
+      });
+    },
+  },
+  onLoad(options) {},
   onShow() {},
 });
 </script>

+ 6 - 4
src/packagesEnv/pages/home/index.wpy

@@ -272,10 +272,10 @@
     <div class="menuItem" @click="goPortrait"><div class="menuImg"><image class="image" :src="h5StaticPath+'myhabits.png'"/></div><div class="menuTitle">我的习惯</div></div>
     <div class="menuItem" @click="goPersonCenter"><div class="menuImg"><image class="image" :src="h5StaticPath+'myself.png'"/></div><div class="menuTitle">个人中心</div></div>
   </div>
-  <div class="menuHeader">管理</div>
-  <div class="menuList">
+  <div class="menuHeader" v-if="userInfo.manageUserType==3">管理</div>
+  <div class="menuList" v-if="userInfo.manageUserType==3">
     <div class="menuItem"><div class="menuImg"  @click="goAdministration"><image class="image" :src="h5StaticPath+'control.png'"/></div><div class="menuTitle">行政端管理</div></div>
-</div>
+  </div>
 </div>
 <van-popup :show="show" position="bottom"  @close="hideProject" round>
   <div class="projectPop">
@@ -329,6 +329,7 @@ wepy.page({
       var filter = this.companyList.filter((item) => {
         return item.id == this.companyId;
       });
+      store.commit('setCompanyName', filter[0]?.name);
       return filter[0]?.name;
     },
   },
@@ -434,6 +435,7 @@ wepy.page({
       });
     },
     goToIntroduce(id) {
+      //有没有可控空间
       var hasControlSpaces = this.controlSpaces.length == 0 ? 'no' : 'has';
       wx.navigateTo({
         url: `/packagesEnv/pages/home/${id}?hasControlSpaces=${hasControlSpaces}`,
@@ -451,7 +453,7 @@ wepy.page({
     },
     goAdministration() {
       wx.navigateTo({
-        url: '/packagesEnv/pages/administration/index',
+        url: `/packagesEnv/pages/administration/index`,
       });
     },
   },

+ 4 - 0
src/packagesEnv/pages/officehome/FloorHeating/floorHeating.wpy

@@ -283,6 +283,10 @@ wepy.component({
     getData() {
       querySapceFloorHeating({ spaceId: this.spaceId }).then(res => {
         const resData = res.data
+        if (!resData.equipList) {
+          clearInterval(this.timer)
+          this.timer = null
+        }
         this.equipList = resData.equipList || []
         this.len = this.equipList.length
         this.tempSet = resData.tempSet

+ 28 - 35
src/packagesEnv/pages/officehome/Header/residen-work.wpy

@@ -35,45 +35,38 @@ wepy.component({
   computed: {},
   methods: {
     showSaveSpace() {
-      var _this = this
-      if (_this.spaceId == _this.userInfo.spaceId) {
-        wx.showToast({
-          title: '该空间已是您的常驻工区',
-          icon: 'none',
-          duration: 3000
-        })
-      } else {
-        wx.showModal({
-          title: '设置常驻工区',
-          content: '将该空间设定为您的常驻工区?',
-          confirmText: '确定',
-          cancelText: '取消',
-          cancelColor: '#c4c4c4',
-          confirmColor: '#1DB1B2',
-          success: res => {
-            if (res.confirm) {
-              changeDefaultSpace(_this.options.spaceId).then(res => {
+      const _this = this
+      console.log(this, '----this')
+      _this.$root.getCurrentSpace()
+      wx.showModal({
+        title: '设置常驻工区',
+        content: '将该空间设定为您的常驻工区?',
+        confirmText: '确定',
+        cancelText: '取消',
+        cancelColor: '#c4c4c4',
+        confirmColor: '#1DB1B2',
+        success: res => {
+          if (res.confirm) {
+            changeDefaultSpace(_this.spaceId).then(res => {
                 // getCurrentPages 小程序自己的方法
-                var pages = getCurrentPages()
-                console.log('res', res, pages)
-                _this.userInfo.spaceId = _this.options.spaceId
-                wx.showToast({
-                  title: '设置成功',
-                  icon: 'success',
-                  duration: 3000,
-                  complete: res => {
-                    if (pages.length <= 1) {
-                      wx.redirectTo({ url: '/pages/homev2' })
-                    } else {
-                      wx.navigateBack()
-                    }
+              var pages = getCurrentPages()
+              _this.$root.getCurrentSpace()
+              wx.showToast({
+                title: '设置成功',
+                icon: 'success',
+                duration: 3000,
+                complete: res => {
+                  if (pages.length <= 1) {
+                    wx.redirectTo({ url: '/packagesEnv/pages/home/index' })
+                  } else {
+                    wx.navigateBack()
                   }
-                })
+                }
               })
-            }
+            })
           }
-        })
-      }
+        }
+      })
     }
   },
     // 生命周期 - 创建完成(可以访问当前this实例)

+ 2 - 2
src/packagesEnv/pages/officehome/Header/space-basic.wpy

@@ -26,13 +26,13 @@
             <div class="g-fl room-name">
                 <span class="name_text">{{officeData.localName || '该空间不可调节'}}</span>
                 <has-person
-                    v-if="officeData.isPassengerPass !== undefined && IsShowPerson"
+                    v-show="officeData.isPassengerPass !== undefined && IsShowPerson"
                     :isPassengerPass="officeData.isPassengerPass"
                 ></has-person>
             </div>
             <div>
                 <residen-work
-                    v-if="options.roomType =='开放' && isControlSpace===3 || isControlSpace===4"
+                    v-show="isControlSpace===3 || isControlSpace===4"
                     :IsResiden="isControlSpace"
                     :spaceId="options.spaceId"
                     :userInfo="userInfo"

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

@@ -329,12 +329,13 @@ wepy.component({
 
   },
   watch: {
-    spaceId() {
+    spaceId(val) {
       this.showLamps = false // 恢复初始化值
       this.allowSvg = 'down_Arrow.svg'
-
-      this.getLampList()
-      this.getTwoTimerLoop()
+      if (val) {
+        this.getLampList()
+        this.getTwoTimerLoop()
+      }
     },
     lampHide(nval) {
       if (this.showLamps) {

+ 1 - 1
src/packagesEnv/pages/officehome/components/set-permanent.wpy

@@ -77,7 +77,7 @@
             ></cover-image>
             <cover-view class="little-box">
                 <cover-view class="text">设为常驻 </cover-view>
-                <cover-image class="little-img" :src="h5StaticPath+'/arrow.svg'"></cover-image>
+                <cover-image class="little-img" :src="h5StaticPath+'arrow.svg'"></cover-image>
             </cover-view>
         </cover-view>
 

+ 7 - 4
src/packagesEnv/pages/officehome/index.wpy

@@ -562,7 +562,8 @@ page {
                         class="maproom-detail"
                         v-show="moveToBottom"
                     >
-                        <div class="upToSpace">
+                        <div class="upToSpace" 
+                        v-if="officeData.localName">
                             <image
                                 class="imgSt"
                                 src="{{h5StaticPath}}icon-double-arrow.svg"
@@ -983,7 +984,7 @@ page {
             </div>
         </div>
         <set-permanent
-            v-if="userControlSpace.isControlSpace === 3 && this.routeParams.from==='homeSetSpace'"
+            v-show="userControlSpace.isControlSpace === 3 && this.routeParams.from==='homeSetSpace'"
             :show="isShowPermanent"
             @component-permanent-panel-close="closePermanentPanel(false)"
         >
@@ -1074,7 +1075,6 @@ wepy.page({
   store,
   data: {
     sceneShow: false,
-    projectId: 'Pj1101080259',
     isShowPermanent: false,
     userControlSpace: {}, // 用户控制空间
     cardWidth: 0, // 动态获取卡片的宽度
@@ -1222,7 +1222,7 @@ wepy.page({
   computed: {
     ...mapState({
       userInfo: state => state.user.userInfo,
-            //   projectId: 'Pj1101080259',
+      projectId: state => state.user.userInfo.projectId,
       handPopHight: state => state.officehome.handPopHight
     }),
     ...mapActions(['setIsApprovalProject']),
@@ -1317,6 +1317,7 @@ wepy.page({
           await this.getData()
         }
         let setAirtemp = this.$refs.airHandCard.airTemp
+
         switch (this.routeParams.from) {
           case 'homeShowEnv':
             if (this.userControlSpace.isControlSpace === 1 || this.userControlSpace.isControlSpace === 2) {
@@ -1331,6 +1332,7 @@ wepy.page({
             break
           case 'openLamp':
             this.selectCrad('', 'lamp')
+            console.log(this.$refs, '----this.$refs.lampAdjust')
             this.$refs.lampAdjust.eqChange(true, 'allLamp')
             break
           case 'airAddOne':
@@ -1596,6 +1598,7 @@ wepy.page({
     },
     // 地图数据切换空间
     mapChangeSpaceInfo(obj) {
+      console.log(obj, '----来自地图')
       this.userControlSpace = obj
       this.options.spaceId = obj.spaceId
       this.getData()

+ 1 - 2
src/service/user.js

@@ -265,6 +265,5 @@ export {
   checkLoginNew,
   checkTokenIsValid,
   getCompanyDataByPhone,
-  checkUserControl,
-  checkLoginStatus
+  checkUserControl
 }

+ 7 - 3
src/store/user.js

@@ -11,7 +11,9 @@ export default {
     applyId: '',
     tokenInfo: wx.getStorageSync('tokenInfo'),
     hasClearToken: false,
-    isActivated: wx.getStorageSync('isActivated')
+    tokenIsValid: true,
+    isActivated: wx.getStorageSync('isActivated'),
+    companyName: ''
   },
   mutations: {
     // 续约接口是否被调用过
@@ -63,8 +65,10 @@ export default {
     setUserPhone(state, data) {
       wx.setStorageSync('userPhone', data);
       state.userPhone = data
-    }
-
+    },
+    setCompanyName(state, value) {
+      state.companyName = value;
+    },
   },
   actions: {
     setToken({ commit }, data) {