Forráskód Böngészése

fix: 联系方式页面处理

chenzhen2 2 éve
szülő
commit
3f09c4b494

+ 5 - 0
public/images/ipdImages/code-icon.svg

@@ -0,0 +1,5 @@
+<svg width="134" height="134" viewBox="0 0 134 134" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g style="mix-blend-mode:lighten">
+<rect width="134" height="134" transform="matrix(-1 0 0 1 134 0)" fill="#CE9F27"/>
+</g>
+</svg>

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 8 - 0
public/images/ipdImages/phone-icon.svg


+ 10 - 3
src/apis/envmonitor.ts

@@ -2,10 +2,10 @@ import { RootObject, RootWeatherObject } from '@/model/rootObject'
 import { CompanyModel, OutherWeather, SpaceModel } from '@/model/userModel'
 import { https, post } from '@/utils/https'
 import { ContentType, Method, RequestParams } from 'axios-mapper'
-import { getComparams, setQueryConfig } from '@/utils'
-import { duoduoenvService, objectService, setupService, testApi } from '@/config'
+import { getUserInfo, setQueryConfig } from '@/utils'
+import { duoduoenvService, objectService, setupService, testApi, weachatService } from '@/config'
 
-const comInfo = getComparams()
+const comInfo = getUserInfo()
 const comParams: string = setQueryConfig(comInfo)
 
 // https://sagacare-h5.tenants.link/api/company/config/245e7060643811eb934c0237aedb39a6
@@ -215,5 +215,12 @@ export const queryWorkSpace = (params: any) => {
   return https().request<any>(`${testApi}padSpace/queryWorkSpace?${comParams}`, Method.POST, params, ContentType.json)
 }
 
+/**
+ * 查询客户列表
+ */
+export const queryCustomerservice = (params:any) => {
+  return https().request<RootObject<any>>(`${weachatService}/wechat-service-duoduoenv/duoduoenv/customerservice/query?${comParams}`, Method.POST, params, ContentType.json)
+}
+
 
 

+ 3 - 3
src/apis/portrait.ts

@@ -2,13 +2,13 @@ import { RootObject, RootWeatherObject } from '@/model/rootObject'
 import { Users, CompanyModel, OutherWeather, SpaceModel } from '@/model/userModel'
 import { https } from '@/utils/https'
 import { RequestParams, ContentType, Method } from 'axios-mapper'
-import { setQueryConfig, getComparams } from '@/utils'
+import { setQueryConfig, getUserInfo } from '@/utils'
 
 import { duoduoenvService } from '@/config'
 
 const comInfo: any = {}
-comInfo.userId = getComparams().userId
-comInfo.projectId = getComparams().projectId
+comInfo.userId = getUserInfo().userId
+comInfo.projectId = getUserInfo().projectId
 const comParams: string = setQueryConfig(comInfo)
 
 //查询 今日新增 排名

+ 1 - 0
src/config/index.ts

@@ -9,5 +9,6 @@
 export const setupService = '/duoduo-service/setup-service/'
 export const objectService = '/duoduo-service/object-service/'
 export const duoduoenvService = '/duoduo-service/duoduoenv-service/'
+export const weachatService = '/duoduo-service/'
 export const ssoService = '/sso/'
 export const testApi = '/test/'

+ 1 - 0
src/constant/key.ts

@@ -15,6 +15,7 @@ class Keys {
   static storageFloorKey = 'historyFloor'
   static storageSpaceInfoKey = 'storageSpaceInfo'
   static userInfoKey = 'userInfo'
+  static macKey = "mac"
 }
 
 export default Keys

+ 1 - 0
src/main.ts

@@ -21,6 +21,7 @@ const loadingStart = (duration: any = 0) => {
 const loadinngEnd = () => {
   Toast.clear()
 }
+app.config.globalProperties.$imgUrl=`http://api.sagacloud.cn/dp-auxiliary/image-service/common/image_get?systemId=dataPlatform`
 app.config.globalProperties.$toast = Toast
 app.config.globalProperties.$loadingStart = loadingStart
 app.config.globalProperties.$loadinngEnd = loadinngEnd

+ 26 - 22
src/permission.ts

@@ -3,13 +3,17 @@ import { RouteLocationNormalized } from 'vue-router'
 import { useStore } from './store'
 import { UserActionTypes } from './store/modules/user/action-types'
 // import { getUrlaccessToken } from '@/utils/https'
-import { getToken, setToken } from '@/utils/cookies'
+import { getToken, setCookieMac, setToken } from '@/utils/cookies'
 import { Toast } from 'vant'
 import Cookies from 'js-cookie'
+import { getUrlParams } from './utils/https'
 
-router.beforeEach(async(to: RouteLocationNormalized, _: RouteLocationNormalized, next: any) => {
-  // debugger
+router.beforeEach(async (to: RouteLocationNormalized, _: RouteLocationNormalized, next: any) => {
   const store = useStore()
+  let macAdr: string = getUrlParams('mac')
+  if (macAdr) {
+    setCookieMac(macAdr)
+  }
   await store.dispatch(UserActionTypes.ACTION_GET_USER_INFO, undefined)
   next()
   // const store = useStore()
@@ -18,25 +22,25 @@ router.beforeEach(async(to: RouteLocationNormalized, _: RouteLocationNormalized,
   //   setToken(accessToken)
   // }
   // if (process.env.VUE_APP_BASE_API !== '/borui/') {
-    // if (to.path === '/home') {
-    //   next()
-    // } else {
-    //   if (getToken()) {
-    //     if (store.state.user.userId) {
-    //       next()
-    //     } else {
-    //       await store.dispatch(UserActionTypes.ACTION_GET_USER_INFO, undefined)
-    //       next()
-    //     }
-    //   } else {
-    //     sessionStorage.clear()
-    //     const tokenOld: any = Cookies.get('accessToken')
-    //     if (to.path !== '/home') {
-    //       window.location.href = `/sgh5/home?accessToken=${tokenOld}`
-    //     }
-    //     Toast('登录失效,请退出app重新登录')
-    //   }
-    // }
+  // if (to.path === '/home') {
+  //   next()
+  // } else {
+  //   if (getToken()) {
+  //     if (store.state.user.userId) {
+  //       next()
+  //     } else {
+  //       await store.dispatch(UserActionTypes.ACTION_GET_USER_INFO, undefined)
+  //       next()
+  //     }
+  //   } else {
+  //     sessionStorage.clear()
+  //     const tokenOld: any = Cookies.get('accessToken')
+  //     if (to.path !== '/home') {
+  //       window.location.href = `/sgh5/home?accessToken=${tokenOld}`
+  //     }
+  //     Toast('登录失效,请退出app重新登录')
+  //   }
+  // }
   // } else {
   //   if (store.state.user.userId) {
   //     next()

+ 1 - 0
src/store/modules/user/action-types.ts

@@ -5,4 +5,5 @@ export enum UserActionTypes {
   ACTION_GET_USER_INFO = 'ACTION_GET_USER_INFO',
   ACTION_CHANGE_ROLES = 'ACTION_CHANGE_ROLES',
   ACTION_LOGIN_OUT = 'ACTION_LOGIN_OUT',
+  SET_USER_MAC='SET_USER_MAC'
 }

+ 15 - 15
src/store/modules/user/actions.ts

@@ -4,7 +4,7 @@ import { UserState } from './state'
 import { Mutations } from './mutations'
 import { UserMutationTypes } from './mutation-types'
 import { UserActionTypes } from './action-types'
-import { removeToken, setSessionUserInfo, setToken } from '@/utils/cookies'
+import { getCookieMac, removeToken, setSessionUserInfo, setToken } from '@/utils/cookies'
 import { PermissionActionType } from '../permission/action-types'
 import router, { resetRouter } from '@/router'
 import { useRoute, useRouter } from 'vue-router'
@@ -69,20 +69,20 @@ export const actions: ActionTree<UserState, RootState> & Actions = {
   },
   async [UserActionTypes.ACTION_GET_USER_INFO]({ commit }: AugmentedActionContext) {
     let nowProjectId: any = 'Pj1101080259'
-      const userInfo: any = {
-        userName: '陈珍',
-        userPhone: 15321277745,
-        userId: '602ef709beb64a1f9a4b6af2196d0af7'
-        // userId: '9a1ecfbacb6b4f249bf2dd3ec7793ead'
-        // userId: '1302990695845462811'
-      }
-      // setCookieUserInfo(JSON.stringify(userInfo))
-      setSessionUserInfo(JSON.stringify(userInfo))
-      commit(UserMutationTypes.SET_USER_NAME, userInfo.userName)
-      commit(UserMutationTypes.SET_USER_PHONE, userInfo.phone)
-      commit(UserMutationTypes.SET_USER_ID, userInfo.userId)
-      store.commit(UserMutationTypes.SET_PROJECT_ID, nowProjectId)
-      let projectId: any = getLocalProjectId()
+    const userInfo: any = {
+      userName: '陈珍',
+      userPhone: 15321277745,
+      userId: '602ef709beb64a1f9a4b6af2196d0af7'
+      // userId: '9a1ecfbacb6b4f249bf2dd3ec7793ead'
+      // userId: '1302990695845462811'
+    }
+    setSessionUserInfo(JSON.stringify(userInfo))
+    commit(UserMutationTypes.SET_USER_NAME, userInfo.userName)
+    commit(UserMutationTypes.SET_USER_PHONE, userInfo.phone)
+    commit(UserMutationTypes.SET_USER_ID, userInfo.userId)
+    let macAdr: any = getCookieMac()
+    commit(UserMutationTypes.SET_USER_MAC, macAdr)
+    store.commit(UserMutationTypes.SET_PROJECT_ID, nowProjectId)
   },
   async [UserActionTypes.ACTION_CHANGE_ROLES](
     { commit }: AugmentedActionContext,

+ 2 - 1
src/store/modules/user/mutation-types.ts

@@ -13,5 +13,6 @@ export enum UserMutationTypes {
   SET_USER_PHONE = 'SET_USER_PHONE',
   SET_PROJECT_ID = 'SET_PROJECT_ID',
   SET_COMPANY_ID = 'SET_COMPANY_ID',
-  SET_REMOTECONTROL = 'SET_REMOTECONTROL'
+  SET_REMOTECONTROL = 'SET_REMOTECONTROL',
+  SET_USER_MAC = 'SET_USER_MAC'
 }

+ 7 - 3
src/store/modules/user/mutations.ts

@@ -1,6 +1,6 @@
-import {MutationTree} from 'vuex'
-import {UserState} from './state'
-import {UserMutationTypes} from './mutation-types'
+import { MutationTree } from 'vuex'
+import { UserState } from './state'
+import { UserMutationTypes } from './mutation-types'
 import Cookies from 'js-cookie'
 import Keys from '@/constant/key'
 
@@ -11,6 +11,7 @@ export type Mutations<S = UserState> = {
   [UserMutationTypes.SET_USER_PHONE](state: S, userPhone: number): void
   [UserMutationTypes.SET_PROJECT_ID](state: S, projectId: string): void
   [UserMutationTypes.SET_COMPANY_ID](state: S, companyId: string): void
+  [UserMutationTypes.SET_USER_MAC](state: S, companyId: string): void,
   [UserMutationTypes.SET_REMOTECONTROL](state: S, remoteControl: boolean): void
 }
 
@@ -18,6 +19,9 @@ export const mutations: MutationTree<UserState> & Mutations = {
   [UserMutationTypes.SET_TOKEN](state: UserState, token: string) {
     state.token = token
   },
+  [UserMutationTypes.SET_USER_MAC](state: UserState, mac: string) {
+    state.mac = mac
+  },
 
   [UserMutationTypes.SET_USER_NAME](state: UserState, userName: string) {
     state.userName = userName

+ 5 - 2
src/store/modules/user/state.ts

@@ -1,4 +1,5 @@
-import { getToken, getProjectId, getCookieUserInfo, getSessionUserInfo } from '@/utils/cookies'
+import Keys from '@/constant/key'
+import { getToken, getProjectId, getCookieUserInfo, getSessionUserInfo, getCookieMac } from '@/utils/cookies'
 
 export interface UserState {
   token: string
@@ -8,16 +9,18 @@ export interface UserState {
   userPhone: number
   projectId: string,
   companyId: string,
+  mac: any,
   remoteControl: boolean  // 当前用户是否可以远程控制设备
 }
 
 export const state: UserState = {
   token: getToken() || '',
-  openid: '',
+  openid: Keys.openid,
   userName: getSessionUserInfo() ? getSessionUserInfo().name : '',
   userId: getSessionUserInfo() ? getSessionUserInfo().id : '',
   userPhone: getSessionUserInfo() ? getSessionUserInfo().phone : 0,
   projectId: getSessionUserInfo() ? getSessionUserInfo().projectId : getProjectId() || '',
   companyId: '',
+  mac: getCookieMac() ? getCookieMac() : '',
   remoteControl: false
 }

+ 5 - 1
src/utils/cookies.ts

@@ -9,6 +9,10 @@ export const getProjectId = () => Cookies.get(Keys.projectId)
 export const setToken = (token: string) => Cookies.set(Keys.tokenKey, token)
 export const removeToken = () => Cookies.remove(Keys.tokenKey)
 export const setCookieUserInfo = (userInfo: any) => Cookies.set(Keys.userInfoKey, userInfo)
+export const setCookieMac = (mac: any)=>Cookies.set(Keys.macKey, mac)
+export const getCookieMac=()=>{
+  return Cookies.get(Keys.macKey)
+}
 export const getCookieUserInfo = () => {
   let userInfo: any = Cookies.get(Keys.userInfoKey)
   if (userInfo) {
@@ -17,8 +21,8 @@ export const getCookieUserInfo = () => {
     return ''
   }
 }
+
 export const getSessionUserInfo = () => {
-  // debugger
   let userInfo: any = sessionStorage.getItem(Keys.userInfoKey)
   if (userInfo) {
     return JSON.parse(userInfo)

+ 4 - 4
src/utils/https.ts

@@ -19,9 +19,9 @@ export const https = (configobj: any = { timeout: '' }) => {
     config.timeout = configobj.timeout
   }
   const https = new HttpClient(config)
-  https.httpClient.interceptors.response.use(function(response) {
+  https.httpClient.interceptors.response.use(function (response) {
     return response
-  }, function(error) {
+  }, function (error) {
     // console.log('error===')
     // console.log(error.response.status)
     // console.log(error.status)
@@ -49,7 +49,7 @@ export const post = (url: any, data: any) => {
   })
 }
 
-export const getUrlParams = () => {
+export const getUrlParams = (key: any = 'accessToken') => {
   let url: any = location.search //获取url中"?"符后的字串
   let theRequest: any = new Object()
   if (url.indexOf('?') != -1) {
@@ -59,7 +59,7 @@ export const getUrlParams = () => {
       theRequest[strs[i].split('=')[0]] = strs[i].split('=')[1]
     }
   }
-  let token: any = theRequest['accessToken'] || ''
+  let token: string = theRequest[key] || ''
   return token
 }
 

+ 20 - 21
src/utils/index.ts

@@ -110,31 +110,12 @@ export const setQueryConfig = function (queryConfig: any) {
 export const getUserInfo = function () {
   let userInfo = store.state.user
   const paramsInfo: any = {
-    openid: Keys.openid,
-    userName: userInfo.userName,
+    openid: userInfo.openid,
     userId: userInfo.userId,
+    mac:userInfo.mac,
     pubname: Keys.pubname,
-    userPhone: userInfo.userPhone,
     projectId: userInfo.projectId
   }
-  if (process.env.VUE_APP_BASE_API === '/borui/') {
-    paramsInfo.pubname = Keys.pubname1
-  }
-  return paramsInfo
-}
-
-// 地址通用参赛携带
-export const getComparams = function () {
-  let userInfo = store.state.user
-  let paramsInfo: any = {
-    openid: Keys.openid,
-    userId: userInfo.userId,
-    pubname: Keys.pubname,
-    projectId: userInfo.projectId
-  }
-  if (process.env.VUE_APP_BASE_API === '/borui/') {
-    paramsInfo.pubname = Keys.pubname1
-  }
   if (userInfo.userName) {
     paramsInfo.userName = userInfo.userName
   }
@@ -144,6 +125,24 @@ export const getComparams = function () {
   return paramsInfo
 }
 
+// // 地址通用参赛携带
+// export const getComparams = function () {
+//   let userInfo = store.state.user
+//   let paramsInfo: any = {
+//     openid: Keys.openid,
+//     userId: userInfo.userId,
+//     pubname: Keys.pubname,
+//     projectId: userInfo.projectId
+//   }
+//   if (userInfo.userName) {
+//     paramsInfo.userName = userInfo.userName
+//   }
+//   if (userInfo.userPhone) {
+//     paramsInfo.userPhone = userInfo.userPhone
+//   }
+//   return paramsInfo
+// }
+
 export const formatDate = function (split: string = 'YYYYMMDD', date: any = new Date()) {
   //三目运算符
   const dates = date ? date : new Date()

+ 4 - 2
src/views/choiceSpace/choiceSpace.vue

@@ -75,7 +75,7 @@
 import { defineComponent, nextTick, onMounted, reactive, toRefs } from "vue";
 import { useRoute, useRouter, onBeforeRouteUpdate } from "vue-router";
 import { Search, TreeSelect, Popup, Checkbox, Toast } from "vant";
-import { parseImgUrl, setQueryConfig } from "@/utils";
+import { getUserInfo, parseImgUrl, setQueryConfig } from "@/utils";
 import { store } from "@/store";
 import { UserMutationTypes } from "@/store/modules/user/mutation-types";
 import {
@@ -97,6 +97,7 @@ export default defineComponent({
   setup() {
     const route: any = useRoute();
     const router: any = useRouter();
+    const userInfo: any = getUserInfo();
     const option1 = [
       { text: "全部商ddddd品", value: 0 },
       { text: "新款商ddd品", value: 1 },
@@ -142,6 +143,7 @@ export default defineComponent({
     const spaceData: any = [];
     const proxyData = reactive({
       parseImgUrl: parseImgUrl,
+      userInfo:userInfo,
       spaceType: spaceType,
       searchSpaceName: "",
       checked: false,
@@ -256,7 +258,7 @@ export default defineComponent({
       // 查询当前平板的默认空间await与wait的区别
       getDefaultLocation() {
         let params: any = {
-          macAddress: "test",
+          macAddress: proxyData.userInfo.mac,
           // projectId: store.state.user.projectId,
         };
         let paramsStr: any = setQueryConfig(params);

+ 5 - 3
src/views/choiceSpace/setMainSpace.vue

@@ -33,7 +33,7 @@ import {
 } from "vue";
 import { useRoute, useRouter, onBeforeRouteUpdate } from "vue-router";
 import { SwipeCell, Cell, Popup, Button, Dialog, Loading } from "vant";
-import { parseImgUrl } from "@/utils";
+import { getUserInfo, parseImgUrl } from "@/utils";
 import { queryWorkSpace, saveWorkSpace } from "@/apis/envmonitor";
 
 export default defineComponent({
@@ -46,10 +46,12 @@ export default defineComponent({
   },
   setup() {
     const proxyGlobal: any = getCurrentInstance();
+    const userInfo: any = getUserInfo();
     const spaceData: any = [];
     const router: any = useRouter();
     const proxyData = reactive({
       show: false,
+      userInfo: userInfo,
       loaging: false,
       parseImgUrl: parseImgUrl,
       // 格式化提交的数据
@@ -57,7 +59,7 @@ export default defineComponent({
         let params: any = {
           workSpaceList: [],
           majorSpaceId: "", //类型:String  必有字段  备注:主空间
-          macAddress: "test", //类型:String  必有字段  备注:平板地址
+          macAddress: proxyData.userInfo.mac, //类型:String  必有字段  备注:平板地址
         };
         proxyData.spaceData.map((space: any) => {
           if (item.spaceId === space.spaceId) {
@@ -103,7 +105,7 @@ export default defineComponent({
         let params: any = {
           criteria: {
             //类型:Object  必有字段  备注:无
-            macAddress: "test", //类型:String  必有字段  备注:mac地址
+            macAddress: proxyData.userInfo.mac, //类型:String  必有字段  备注:mac地址
           },
         };
         queryWorkSpace(params).then((res) => {

+ 181 - 0
src/views/envmonitor/components/Contact/index.vue

@@ -0,0 +1,181 @@
+<template>
+  <van-dialog
+    v-model:show="isShowContact"
+    :show-confirm-button="false"
+    class="contact-dialog"
+    :show-cancel-button="false"
+  >
+    <!-- 联系方式 -->
+    <div class="contact-content">
+      <div class="title">联系我们</div>
+      <div class="contact">
+        <div class="code-box">
+          <img :src="imgUrl + '&key=' + contantDetail.wechatQrCode" alt="" />
+          <div class="title">客户微信二维码</div>
+        </div>
+        <div class="phone-box">
+          <img :src="parseImgUrl('ipdImages', 'phone-icon.svg')" alt="" />
+          <div class="title">{{ contantDetail.phone }}</div>
+          <div class="concat-text">客户电话联系方式</div>
+        </div>
+      </div>
+      <buttons class="dailog-btn" @click="closeDailog">我知道了</buttons>
+    </div>
+  </van-dialog>
+</template>
+      
+      <script lang="ts">
+import {
+  defineComponent,
+  reactive,
+  toRefs,
+  onBeforeMount,
+  onMounted,
+  ref,
+  watch,
+  getCurrentInstance,
+} from "vue";
+import { Loading, Dialog, Toast } from "vant";
+import { getUserInfo, parseImgUrl } from "@/utils";
+import { queryCustomerservice } from "@/apis/envmonitor";
+const userInfo: any = getUserInfo();
+
+export default defineComponent({
+  props: {
+    isShowContact: {
+      type: Boolean,
+      default: () => false,
+    },
+  },
+  components: {
+    VanLoading: Loading,
+    [Dialog.Component.name]: Dialog.Component,
+  },
+  setup(props, contx) {
+    const contantDetail: any = {};
+    const proxyGlobal: any = getCurrentInstance();
+    const proxyData = reactive({
+      parseImgUrl: parseImgUrl,
+      contantDetail: contantDetail,
+      userInfo: userInfo,
+      imgUrl: proxyGlobal.proxy.$imgUrl,
+      isShowContact: props.isShowContact,
+      closeDailog() {
+        contx.emit("closeDailog");
+      },
+      // 查询联系方式
+      queryCustomerservice() {
+        let params: any = {
+          criteria: { projectId: proxyData.userInfo.projectId },
+        };
+        queryCustomerservice(params).then((res) => {
+          let resData: any = res;
+          let content: any = resData?.content ?? [];
+          proxyData.contantDetail = content[0];
+        });
+      },
+    });
+    watch(
+      props,
+      (newProps: any) => {
+        proxyData.isShowContact = newProps.isShowContact;
+      },
+      {
+        deep: false,
+        immediate: true,
+      }
+    );
+    onMounted(() => {
+      proxyData.queryCustomerservice();
+    });
+    return {
+      ...toRefs(proxyData),
+    };
+  },
+});
+</script>
+<style lang="scss">
+.contact-dialog {
+  width: 680px !important;
+  height: 420px !important;
+  background: #ffffff;
+  border-radius: 32px;
+  .van-dialog__content {
+    width: 100%;
+    height: 100%;
+  }
+  .contact-content {
+    position: relative;
+    width: 100%;
+    height: 100%;
+    .title {
+      font-family: "PingFang SC";
+      font-style: normal;
+      font-weight: 500;
+      font-size: 22px;
+      line-height: 31px;
+      text-align: center;
+      padding: 30px;
+      color: #000000;
+    }
+    .dailog-btn {
+      position: absolute;
+      bottom: 38px;
+      width: 335px;
+      left: 50%;
+      transform: translateX(-50%);
+      height: 50px;
+      line-height: 50px;
+      text-align: center;
+      background: #ffffff;
+      border: 1px solid #c3c7cb;
+      border-radius: 25px;
+    }
+  }
+  .contact {
+    display: flex;
+    height: 182px;
+    .code-box {
+      flex: 1;
+      border-right: 1px solid #d9d9d9;
+      text-align: center;
+      color: #1F2429;
+      img {
+        width: 134px;
+        height: 134px;
+        // margin-bottom: 17px;
+      }
+      .title {
+        color: #1f2429;
+        font-family: "Noto Sans SC";
+        font-style: normal;
+        font-weight: 400;
+        font-size: 14px;
+        // line-height: 20px;
+        text-align: center;
+      }
+    }
+    .phone-box {
+      flex: 1;
+      text-align: center;
+      .title {
+        font-family: "Montserrat";
+        font-style: normal;
+        font-weight: 500;
+        font-size: 24px;
+        // line-height: 29px;
+        margin-top: -15px;
+        color: #af810c;
+      }
+      img {
+        width: 100px;
+        height: 100px;
+      }
+      .concat-text {
+        margin-top: -10px;
+      }
+    }
+  }
+}
+</style>
+      

+ 30 - 15
src/views/envmonitor/index.vue

@@ -10,7 +10,7 @@
         <div class="weather">
           {{ outWeather.temperature ? outWeather.temperature : "--" }}℃
         </div>
-        <div class="weixiin">
+        <div class="weixiin" @click="showContact">
           <img :src="parseImgUrl('ipdImages', 'weixin.svg')" />
           <span> 联系客户</span>
         </div>
@@ -24,9 +24,15 @@
           >
             {{ officeData.localName }}
           </div>
-          <div>
+          <div
+            v-if="
+              officeData.isPassengerPass === true ||
+              officeData.isPassengerPass === false
+            "
+          >
             <img :src="parseImgUrl('ipdImages', 'vector.svg')" />
-            <span>无人</span>
+            <span v-if="officeData.isPassengerPass">有人</span>
+            <span v-if="!officeData.isPassengerPass">无人</span>
           </div>
         </div>
         <div class="space-info">
@@ -91,7 +97,7 @@
     </div>
     <div class="main-right">
       <!--加班start-->
-      <div class="work-btn">
+      <div class="work-btn" v-if="roomType === '开放' || roomType === '会议室'">
         <!-- {{roomType}} -->
         <work-config
           v-if="roomType === '开放' && isWork"
@@ -200,6 +206,8 @@
         @changeSpace="changeSpace"
       ></com-map>
     </van-popup>
+    <!--联系方式-->
+    <contact :isShowContact="isShowContact" @closeDailog="closeContactDailog"></contact>
   </div>
 </template>
 
@@ -215,6 +223,7 @@ import {
   onBeforeUnmount,
 } from "vue";
 import WorkOvertime from "./components/workOvertime/index.vue";
+import Contact from "./components/Contact/index.vue";
 import WorkConfig from "./components/workOvertime/WorkConfig.vue";
 import ScenarioConfig from "./components/Scenario/ScenarioConfig.vue";
 import MapBox from "@/views/envmonitor/components/Map/MapBox.vue";
@@ -277,6 +286,7 @@ export default defineComponent({
     WorkConfig,
     ScenarioConfig,
     Detail,
+    Contact,
     [Dialog.Component.name]: Dialog.Component,
     VanPopup: Popup,
     VanIcon: Icon,
@@ -641,6 +651,13 @@ export default defineComponent({
       nextCusStartTime: 0, // 第二天服务定制开始时间
       cusEndTime: 0,
       cusStartTime: 0, // 当天服务定制-开始时间
+      isShowContact: false,
+      showContact() {
+        proxyData.isShowContact = true;
+      },
+      closeContactDailog() {
+        proxyData.isShowContact = false;
+      },
       /**
        * 加班
        */
@@ -1417,13 +1434,12 @@ export default defineComponent({
           proxyData.spaceTimer = null;
         }
       },
-
       // 定时调空间
-      timerSpaceInfo() {
+      timerSpaceInfo(timer: any = 5000) {
         proxyData.clearTimerSpaceInfo();
         proxyData.spaceTimer = setTimeout(() => {
           proxyData.getSpaceInfo();
-        }, 2000);
+        }, timer);
       },
       isWork: false,
       isMetting: false,
@@ -1503,12 +1519,12 @@ export default defineComponent({
        * 空间相关的接口
        */
       init() {
-        proxyData.getSpaceInfo();
+        // proxyData.roomType = "";
         // 获取场景配置
         proxyData.querySpaceSceneConfig();
         // 查询加班记录
         proxyData.queryCustomAndScenceTimer(0);
-        proxyData.timerSpaceInfo();
+        proxyData.timerSpaceInfo(0);
         // 获取空间下的设备信息
         proxyData.getEquipments();
         proxyData.setTime();
@@ -1543,7 +1559,7 @@ export default defineComponent({
         let params: any = {
           criteria: {
             //类型:Object  必有字段  备注:无
-            macAddress: "test", //类型:String  必有字段  备注:mac地址
+            macAddress: proxyData.userInfo.mac, //类型:String  必有字段  备注:mac地址
           },
           orders: [
             //类型:Array  必有字段  备注:无
@@ -1605,7 +1621,9 @@ export default defineComponent({
       },
       // 切换空间
       changeSpace(item: any, type: any = 0) {
-        // debugger
+        // 定时清除空间信息
+        proxyData.clearTimerSpaceInfo();
+        // 重置当前选中空间的状态
         proxyData.resetSpaceStatus();
         proxyData.spaceInfo = item;
         proxyData.init();
@@ -1650,10 +1668,7 @@ export default defineComponent({
       // proxyData.envScrollTop()
     });
     onBeforeUnmount(() => {
-      if (proxyData.spaceTimer) {
-        clearTimeout(proxyData.spaceTimer);
-        proxyData.spaceTimer = null;
-      }
+      proxyData.clearTimerSpaceInfo();
     });
     onMounted(() => {
       // debugger