Browse Source

Merge branch 'master' of http://47.111.81.118:3000/uskycloud/usky-web-mobile into ming

ming 5 months ago
parent
commit
869943acdd

+ 9 - 0
src/api/business/meeting.js

@@ -244,4 +244,13 @@ export function signOnOut(data) {
         method: 'POST',
         data
     })
+}
+
+//门禁开门
+export function control(data) {
+    return request({
+        url: `/service-meeting/meetingRoom/502_KAT/223212768/control`,
+        method: 'GET',
+        params: data
+    })
 }

+ 2 - 0
src/config.js

@@ -2,6 +2,8 @@ import manifest from './manifest.json'
 
 // 应用全局配置
 export default {
+  ip: "192.168.120.165:9300",
+
   //#ifdef APP-PLUS || MP-WEIXIN
   baseUrl: "https://gateWay.usky.cn/prod-api",
   //#endif

+ 13 - 1
src/pages.json

@@ -67,7 +67,7 @@
             }
         },
         {
-            "path": "pages/common/face/index",
+            "path": "pages/face/index",
             "style": {
                 "navigationBarTitleText": "人脸识别",
                 "enablePullDownRefresh": false,
@@ -769,6 +769,18 @@
                             "titleNView": false
                         }
                     }
+                },
+                {
+                    "path": "meeting/detailed/index",
+                    "style": {
+                        "navigationBarTitleText": "会议详情",
+                        "enablePullDownRefresh": false,
+                        "navigationStyle": "custom",
+                        "app-plus": {
+                            "bounce": "none",
+                            "titleNView": false
+                        }
+                    }
                 }
             ]
         }

+ 119 - 0
src/pages/business/common/meeting/detailed/index.vue

@@ -0,0 +1,119 @@
+<template>
+  <view class="about-container">
+    <u-navbar :titleStyle="{ color: '#000' }" :autoBack="true" title="会议详情" :placeholder="true" :safeAreaInsetTop="true" bgColor="#fff">
+      <template #left>
+        <view class="u-navbar__content__left__item">
+          <u-icon name="arrow-left" size="20" color="#000"></u-icon>
+        </view>
+      </template>
+    </u-navbar>
+
+    <view class="oa-header-section text-center"> </view>
+    <view class="oa-content-section">
+      <view class="menu-list mt10 mlr0">
+        <view class="list-cell">
+          <view class="menu-item">
+            <view>会议室名称</view>
+            <view class="ml-auto text-right">{{ detailsData.roomName || "" }}</view>
+          </view>
+        </view>
+        <view class="list-cell">
+          <view class="menu-item">
+            <view>所在楼层</view>
+            <view class="ml-auto text-right">{{ detailsData.meetingFloor.floorName || "" }}</view>
+          </view>
+        </view>
+        <view class="list-cell">
+          <view class="menu-item">
+            <view>容纳人数</view>
+            <view class="ml-auto text-right">{{ detailsData.capacity || "" }}</view>
+          </view>
+        </view>
+        <view class="list-cell">
+          <view class="menu-item">
+            <view>创建时间</view>
+            <view class="ml-auto text-right">{{ detailsData.createTime ? detailsData.createTime.replace("T", " ") : detailsData.createTime || "" }}</view>
+          </view>
+        </view>
+      </view>
+
+      <view class="menu-list mt10 mlr0">
+        <view class="list-cell">
+          <view class="menu-item">
+            <view>会议室设施</view>
+          </view>
+          <view class="menu-item mt10">
+            <view class="text-right" v-for="dev in detailsData.meetingDevice" :key="dev">{{ dev.deviceName || "" }}</view>
+          </view>
+        </view>
+      </view>
+    </view>
+    <view class="oa-footer-section"> </view>
+  </view>
+</template>
+
+<script setup>
+/*----------------------------------依赖引入-----------------------------------*/
+import { onReady, onLoad, onShow, onNavigationBarButtonTap } from "@dcloudio/uni-app";
+import { ref, reactive, computed, getCurrentInstance, toRefs, inject } from "vue";
+/*----------------------------------接口引入-----------------------------------*/
+import { meetingRoomDetails } from "@/api/business/meeting.js";
+/*----------------------------------组件引入-----------------------------------*/
+/*----------------------------------store引入-----------------------------------*/
+/*----------------------------------公共方法引入-----------------------------------*/
+/*----------------------------------公共变量-----------------------------------*/
+const { proxy } = getCurrentInstance();
+/*----------------------------------变量声明-----------------------------------*/
+const state = reactive({
+  detailsData: {
+    meetingFloor: {
+      floorName: "",
+    },
+  },
+});
+
+const { detailsData } = toRefs(state);
+
+//会议详情接口调用
+function meetingDetailsApi(roomId) {
+  meetingRoomDetails({
+    roomId: roomId,
+  }).then((res) => {
+    console.log(res);
+    state.detailsData = res.data;
+  });
+}
+
+onShow(() => {
+  //调用系统主题颜色
+  proxy.$settingStore.systemThemeColor([1]);
+});
+
+onLoad((options) => {
+  if ("roomId" in options) {
+    meetingDetailsApi(options.roomId);
+  }
+});
+</script>
+
+<style lang="scss" scoped>
+.about-container {
+  .oa-header-section {
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+  }
+
+  .oa-footer-section {
+    margin-top: 25px;
+    text-align: center;
+    line-height: 30px;
+    color: #999;
+    font-size: 12px;
+
+    :deep(.u-text__value) {
+      justify-content: center;
+    }
+  }
+}
+</style>

+ 24 - 2
src/pages/business/common/meeting/index.vue

@@ -147,7 +147,7 @@
 import { onLoad, onShow, onReady, onHide, onLaunch, onUnload, onNavigationBarButtonTap, onPageScroll } from "@dcloudio/uni-app";
 import { ref, reactive, computed, getCurrentInstance, toRefs, inject } from "vue";
 /*----------------------------------接口引入-----------------------------------*/
-import { MeetingRoomList, MeetingRoomReservationList } from "@/api/business/meeting.js";
+import { MeetingRoomList, MeetingRoomReservationList, control } from "@/api/business/meeting.js";
 /*----------------------------------组件引入-----------------------------------*/
 import timeSlot from "./components/timeSlot.vue";
 /*----------------------------------store引入-----------------------------------*/
@@ -182,6 +182,11 @@ const state = reactive({
         fontSize: "16",
         disabled: true,
       },
+      {
+        name: "门禁开门",
+        fontSize: "16",
+        type: "meeting-room",
+      },
       {
         name: "会议室详情",
         fontSize: "16",
@@ -327,11 +332,28 @@ function calendarMonthSwitch(e) {
 
 /** 操作菜单 */
 function handleSheet(e) {
-  console.log(e);
   if (e.type == "meeting-details") {
+    proxy.$tab.navigateTo(`/pages/business/common/meeting/detailed/index?roomId=${state.popup.list.roomId}`).then(() => {});
+  } else if (e.type == "meeting-room") {
+    openDoor();
   }
 }
 
+/**
+ * @门禁开门
+ */
+function openDoor() {
+  control({
+    commandStr: JSON.stringify({ method: "control", params: { device_id: "223212768", command: 2 } }),
+  })
+    .then((item2) => {
+      proxy.$modal.msg("开门成功");
+    })
+    .catch((err) => {
+      console.log(err);
+    });
+}
+
 /** 操作弹窗 */
 function handlePopup(show, type, list) {
   state.popup.show = show;

+ 3 - 2
src/pages/business/mhxf/fireReport/components/detailedPath.vue

@@ -7,6 +7,7 @@
 </template>
 
 <script setup>
+import config from "@/config";
 import { onReady, onLoad, onShow, onNavigationBarButtonTap } from "@dcloudio/uni-app";
 import { ref, onMounted, inject, shallowRef, reactive, watchEffect, getCurrentInstance, toRefs } from "vue";
 import { useStores, commonStores } from "@/store/modules/index";
@@ -35,8 +36,8 @@ host = uni.getStorageSync("serveUrl");
 host = window.location.host;
 //#endif
 
-if (host.indexOf("172.16.120") != -1) {
-  viewerUrl.value = "http://172.16.120.165:9300/statics/pdf_js/web/viewer.html";
+if (host.indexOf(config.ip) != -1) {
+  viewerUrl.value = `http://${config.ip}/statics/pdf_js/web/viewer.html`;
 } else {
   viewerUrl.value = "http://file.usky.cn/statics/pdf_js/web/viewer.html";
 }

+ 9 - 0
src/pages/common/face/api.js → src/pages/face/api.js

@@ -55,4 +55,13 @@ export function signOnOut(data) {
         method: 'POST',
         data
     })
+}
+
+//门禁开门
+export function control(data) {
+    return request({
+        url: `/service-meeting/meetingRoom/502_KAT/223212768/control`,
+        method: 'GET',
+        params: data
+    })
 }

+ 92 - 55
src/pages/common/face/index.vue → src/pages/face/index.vue

@@ -60,10 +60,11 @@
 </template>
 <script setup>
 /*----------------------------------依赖引入-----------------------------------*/
+import config from "@/config";
 import { onLoad, onShow, onReady, onHide, onLaunch, onUnload, onNavigationBarButtonTap, onPageScroll } from "@dcloudio/uni-app";
 import { ref, reactive, computed, getCurrentInstance, toRefs, inject, nextTick, watch } from "vue";
 /*----------------------------------接口引入-----------------------------------*/
-import { meetingApi, faceApi, signOnOut } from "./api.js";
+import { meetingApi, faceApi, signOnOut, control } from "./api.js";
 /*----------------------------------组件引入-----------------------------------*/
 /*----------------------------------store引入-----------------------------------*/
 /*----------------------------------公共方法引入-----------------------------------*/
@@ -96,6 +97,7 @@ const state = reactive({
   form: {
     linkUrl: "",
     port: "",
+    domain: undefined,
     meetingId: undefined,
     meetingName: undefined,
   },
@@ -116,6 +118,7 @@ function init() {
 
   var storage = uni.getStorageSync("storage_face");
   if (storage) {
+    state.form.domain = storage.domain;
     state.form.linkUrl = storage.linkUrl.indexOf(":") != -1 ? storage.linkUrl.split(":")[0] : storage.linkUrl;
     state.form.port = storage.port ? storage.port : "";
     state.form.meetingId = storage.meetingId || undefined;
@@ -133,25 +136,19 @@ function init() {
  * @会议室下拉列表
  */
 function getMeetingRoomList() {
-  var domain = "";
-  if (state.form.linkUrl) {
-    domain = state.form.linkUrl;
-    if (state.form.port) {
-      domain += ":" + state.form.port;
-    }
-  }
-
   meetingApi()
     .GetMeetingRoomList({
-      domain: domain,
+      domain: state.form.domain,
     })
     .then((requset) => {
-      requset.data.forEach((e) => {
-        state.meetingRoomList.push({
-          value: e.roomId,
-          name: e.roomName,
+      if (requset.data.length > 0) {
+        requset.data.forEach((e) => {
+          state.meetingRoomList.push({
+            value: e.roomId,
+            name: e.roomName,
+          });
         });
-      });
+      }
     });
 }
 
@@ -159,6 +156,12 @@ function getMeetingRoomList() {
  * @会议室详情列表
  */
 function getMeetingRoomReservationList() {
+  state.meetingTimeList = [];
+  state.meetingReservaList.thisVenueData = [];
+  state.meetingReservaList.thisVenueTime = {};
+  state.meetingReservaList.nextSceneData = [];
+  state.meetingReservaList.nextSceneTime = {};
+
   for (let i = 0; i <= 23.5; i += 0.5) {
     var time = "";
     if (i % 1 === 0.5) {
@@ -184,17 +187,9 @@ function getMeetingRoomReservationList() {
     });
   }
 
-  var domain = "";
-  if (state.form.linkUrl) {
-    domain = state.form.linkUrl;
-    if (state.form.port) {
-      domain += ":" + state.form.port;
-    }
-  }
-
   meetingApi()
     .GetMeetingRoomReservationList({
-      domain: domain,
+      domain: state.form.domain,
       meetingRoomId: state.form.meetingId,
       date: proxy.$dayjs().format("YYYY-MM-DD") + " 00:00:00",
     })
@@ -226,7 +221,8 @@ function getMeetingRoomReservationList() {
           data: JSON.stringify(state.meetingReservaList),
         });
       }
-    });
+    })
+    .catch((err) => {});
 }
 
 // 显示时间段的函数
@@ -290,39 +286,70 @@ function showTimeSegments(times) {
  */
 function faceVerify(imageBase) {
   faceApi()
-    .faceVef({ imageBase })
-    .then((res) => {
-      state.faceImgState = false;
-      if (res.data.code === 200 || res.data.code === 201) {
-        proxy.$modal.msg(res.data.msg);
-
-        meetingApi()
-          .Attendee({
-            meetingId: state.thisVenueData[0].meetingId,
-            userId: res.data.userId,
-            name: res.data.faceName,
-          })
-          .then((res1) => {
-            if (res1.data.status == "1") {
-              proxy.$modal.msg(res1.data.msg);
-              state.msg = `[${res.data.faceName}] ${res1.data.msg}`;
-
-              signOnOut({
-                meetingId: state.thisVenueData[0].meetingId,
-                userId: res.data.userId, //参会人Id
-                mothodType: 0, //签到签退类别(0.签到 1.签退)
-                signType: 1, //签到签退方式(0.人工 1.人脸)
-              }).then((res) => {});
-            } else {
-              proxy.$modal.msg(res1.data.msg);
-            }
-          });
+    .faceVef({
+      domain: state.form.domain,
+      imageBase: imageBase,
+    })
+    .then((item) => {
+      if (item.data.code === 200 || item.data.code === 201) {
+        proxy.$modal.msg(item.data.msg);
+
+        if (state.meetingReservaList.thisVenueData.length > 0) {
+          meetingVerify(item);
+        } else {
+          openDoor();
+        }
+      } else {
+        proxy.$modal.msg(item.data.msg);
+      }
+    })
+    .catch((err) => {});
+}
+
+/**
+ * @会议验证
+ */
+function meetingVerify(item) {
+  meetingApi()
+    .Attendee({
+      domain: state.form.domain,
+      meetingId: state.meetingReservaList.thisVenueData[0].meetingId,
+      userId: item.data.userId,
+      userName: item.data.faceName,
+    })
+    .then((item1) => {
+      if (item1.data.status == "1") {
+        proxy.$modal.msg(item1.data.msg);
+        state.msg = `[${item.data.faceName}] ${item1.data.msg}`;
+
+        openDoor();
+
+        signOnOut({
+          domain: state.form.domain,
+          meetingId: state.meetingReservaList.thisVenueData[0].meetingId,
+          userId: item.data.userId, //参会人Id
+          mothodType: 0, //签到签退类别(0.签到 1.签退)
+          signType: 1, //签到签退方式(0.人工 1.人脸)
+        }).then((item2) => {});
       } else {
-        proxy.$modal.msg(res.data.msg);
+        proxy.$modal.msg(item1.data.msg);
       }
+    });
+}
+
+/**
+ * @门禁开门
+ */
+function openDoor() {
+  control({
+    domain: state.form.domain,
+    commandStr: JSON.stringify({ method: "control", params: { device_id: "223212768", command: 2 } }),
+  })
+    .then((item2) => {
+      proxy.$modal.msg("开门成功");
     })
     .catch((err) => {
-      state.faceImgState = false;
+      console.log(err);
     });
 }
 
@@ -346,8 +373,8 @@ function modalConfirm() {
   }
 
   uni.setStorageSync("storage_face", state.form);
-  getMeetingRoomReservationList();
   state.modal.show = false;
+  getMeetingRoomReservationList();
 }
 
 /**
@@ -446,6 +473,16 @@ watch(
     if (!/^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}(?:\.[a-zA-Z0-9]{2,})+$/.test(state.form.linkUrl)) {
       return;
     }
+
+    var domain = "";
+    if (state.form.linkUrl) {
+      domain = state.form.linkUrl;
+      if (state.form.port) {
+        domain += ":" + state.form.port;
+      }
+    }
+    state.form.domain = domain;
+    config.baseUrl = "http://" + state.form.domain + "/prod-api";
     getMeetingRoomList();
   }
 );

+ 1 - 1
src/pages/index.vue

@@ -48,7 +48,7 @@
         <image v-if="!state.swiperBool" style="width: 100%; height: 160px" src="@/static/images/index/banner1.png"></image>
 
         <!-- 天气 -->
-        <!-- #ifdef APP-PLUS || H5 -->
+        <!-- #ifdef APP-PLUS || MP-WEIXIN || H5 -->
         <oa-weather ref="oaWeatherRef"></oa-weather>
         <!-- #endif -->
 

+ 1 - 1
src/pages/mine.vue

@@ -68,7 +68,7 @@
               <view class="menu-item">
                 <view class="iconfont oaIcon-qinglihuancun menu-item-icon"></view>
                 <view>清理缓存</view>
-                <view class="text-right">{{ proxy.$settingStore.currentSize }}</view>
+                <view class="mr15 ml-auto text-right">{{ proxy.$settingStore.currentSize }}</view>
               </view>
             </view>
             <view class="list-cell list-cell-arrow" @click="handleToUpgrade" v-if="proxy.$common.isVisible()">

+ 4 - 4
src/pages/mine/about/index.vue

@@ -19,25 +19,25 @@
         <view class="list-cell list-cell-arrow">
           <view class="menu-item">
             <view>版本信息</view>
-            <view class="text-right">v{{ version }}</view>
+            <view class="mr15 ml-auto text-right">v{{ version }}</view>
           </view>
         </view>
         <view class="list-cell list-cell-arrow">
           <view class="menu-item">
             <view>官方邮箱</view>
-            <view class="text-right">{{ email }}</view>
+            <view class="mr15 ml-auto text-right">{{ email }}</view>
           </view>
         </view>
         <view class="list-cell list-cell-arrow">
           <view class="menu-item">
             <view>服务热线</view>
-            <view class="text-right">{{ hotline }}</view>
+            <view class="mr15 ml-auto text-right">{{ hotline }}</view>
           </view>
         </view>
         <view class="list-cell list-cell-arrow">
           <view class="menu-item">
             <view>公司网站</view>
-            <view class="text-right">
+            <view class="mr15 ml-auto text-right">
               <uni-link :href="url" :text="url" showUnderLine="false"></uni-link>
             </view>
           </view>

+ 4 - 4
src/pages/mine/info/index.vue

@@ -23,25 +23,25 @@
         <view class="list-cell list-cell-arrow" @click="handleUserModal('修改昵称')">
           <view class="menu-item">
             <view class="title">昵称</view>
-            <view class="text-right content">{{ user.nickName }}</view>
+            <view class="mr15 ml-auto text-right content">{{ user.nickName }}</view>
           </view>
         </view>
         <view class="list-cell list-cell-arrow" @click="handleUserModal('修改手机号')">
           <view class="menu-item">
             <view class="title">手机号</view>
-            <view class="text-right">{{ user.phonenumber }}</view>
+            <view class="mr15 ml-auto text-right">{{ user.phonenumber }}</view>
           </view>
         </view>
         <view class="list-cell list-cell-arrow" @click="handleUserModal('修改邮箱')">
           <view class="menu-item">
             <view class="title">邮箱</view>
-            <view class="text-right">{{ user.email }}</view>
+            <view class="mr15 ml-auto text-right">{{ user.email }}</view>
           </view>
         </view>
         <view class="list-cell list-cell-arrow" @click="handleUserModal('修改性别')">
           <view class="menu-item">
             <view class="title">性别</view>
-            <view class="text-right">{{ user.sex == "0" ? "男" : "女" }}</view>
+            <view class="mr15 ml-auto text-right">{{ user.sex == "0" ? "男" : "女" }}</view>
           </view>
         </view>
         <view class="list-cell list-cell-arrow" @click="proxy.$modal.showToast('模块建设中~')">

+ 2 - 2
src/pages/mine/secure/index.vue

@@ -10,13 +10,13 @@
         <view class="list-cell list-cell-arrow" @click="handleUserModal('修改手机号')">
           <view class="menu-item">
             <view class="title">手机号</view>
-            <view class="text-right">{{ user.phonenumber }}</view>
+            <view class="mr15 ml-auto text-right">{{ user.phonenumber }}</view>
           </view>
         </view>
         <view class="list-cell list-cell-arrow" @click="handleUserModal('修改密码')">
           <view class="menu-item">
             <view class="title">密码</view>
-            <view class="text-right">{{ user.password ? "已设置" : "未设置" }}</view>
+            <view class="mr15 ml-auto text-right">{{ user.password ? "已设置" : "未设置" }}</view>
           </view>
         </view>
       </view>

+ 1 - 1
src/pages/mine/setting/index.vue

@@ -26,7 +26,7 @@
         <view class="menu-item">
           <view class="iconfont oaIcon-qinglihuancun menu-item-icon"></view>
           <view>清理缓存</view>
-          <view class="text-right">{{ proxy.$settingStore.currentSize }}</view>
+          <view class="mr15 ml-auto text-right">{{ proxy.$settingStore.currentSize }}</view>
         </view>
       </view>
       <view class="list-cell list-cell-arrow" @click="proxy.$settingStore.handleToUpgrade()">

+ 1 - 1
src/permission.js

@@ -21,7 +21,7 @@ const whiteList = [
   "/pages/common/evaluate/record",//服务评价
   "/pages/common/NFC/index",//NFC读取
   "/pages/common/appMessage/details",//消息详情
-  "/pages/common/face/index",//人脸识别
+  "/pages/face/index",//人脸识别
 ];
 
 // 检查地址白名单

+ 9 - 17
src/static/face/index.html

@@ -217,7 +217,13 @@
             </div>
 
         </div>
-        <div id="home-card-bottom" class="home-card-bottom"></div>
+        <div id="home-card-bottom" class="home-card-bottom">
+            <div v-for="(item, timeIndex) in state.timeList" :key="item" :id="`timeScorll${timeIndex}`" :style="{ backgroundColor: item.isEnd === 1 ? '#909399' :
+                item.isHave===1 ? '#fa3534' : item.isReservation===1 ? '#ff9900' : '#409eff' }">
+                {{item.isEnd != 0 || item.isHave != 0 || item.isReservation != 0 ? item.startTime + " —— " +
+                item.endTime : item.startTime}}
+            </div>
+        </div>
     </div>
     <script>
         // 创建Vue实例
@@ -241,20 +247,7 @@
             computed: {},
             methods: {
                 // 初始化数据
-                initData() {
-                    var that = this
-
-                    var html = ``
-                    this.state.timeList.forEach((item, timeIndex) => {
-                        html += `
-                            <div id="timeScorll${timeIndex}" style="background-color: ${item.isEnd === 1 ? "#909399" : item.isHave === 1 ? "#fa3534" : item.isReservation === 1 ? "#ff9900" : "#409eff"}">
-                            ${item.isEnd != 0 || item.isHave != 0 || item.isReservation != 0 ? item.startTime + " —— " + item.endTime : item.startTime}  
-                            </div>
-                        `
-                    });
-                    $(`#home-card-bottom`).append(html)
-
-                },
+                initData() { },
                 // 初始化摄像头
                 initVido() {
                     var that = this;
@@ -308,7 +301,7 @@
                         touchstart: function (e) {
                             that.timeOutEvent = setTimeout(() => {
                                 that.longPress()
-                            }, 2000);
+                            }, 1000);
                             e.preventDefault();
                         },
                         touchmove: function () {
@@ -352,7 +345,6 @@
                     console.log(event.funcName)
                     if ("funcName" in event) {
                         if (event.funcName == "初始化数据") {
-                            $(`#home-card-bottom`).empty();//删除dom下的所有子元素
                             this.state.dataAll = JSON.parse(event.data).dataAll
                             this.state.thisVenueData = JSON.parse(event.data).thisVenueData
                             this.state.thisVenueTime = JSON.parse(event.data).thisVenueTime

+ 4 - 4
src/static/scss/global.scss

@@ -91,7 +91,6 @@
     }
 
     .text-right {
-      margin: 0 15px 0 auto;
       font-size: 14px;
       color: #909399
     }
@@ -109,7 +108,8 @@
     }
   }
 }
-.textExceeds{
-  word-wrap: break-word; 
-  word-break: break-all; 
+
+.textExceeds {
+  word-wrap: break-word;
+  word-break: break-all;
 }

+ 1 - 1
unpackage/config/setting.js

@@ -53,7 +53,7 @@ filesToModify.forEach((file) => {
                             state.pages.splice(0, 1, ...state.pages.splice(index, 1, state.pages[0]))
                         }
                     }
-                    state.condition.list[0].path = "pages/common/face/index"
+                    state.condition.list[0].path = "pages/face/index"
                 }
             })
         }