Просмотр исходного кода

评价功能优化/会议扫码签到功能上线

fanghuisheng 3 дней назад
Родитель
Сommit
c433f204d2

+ 1 - 0
.gitignore

@@ -1,6 +1,7 @@
 .DS_Store
 .history/
 .hbuilderx/
+unpackage/resources/
 package-lock.json
 node_modules/
 dist/

+ 1 - 2
src/pages/business/ai/conv/index.vue

@@ -169,12 +169,11 @@ import { ref, reactive, computed, getCurrentInstance, toRefs, inject, nextTick,
 import { aiApi } from "@/api/business/ai.js";
 /*----------------------------------组件引入-----------------------------------*/
 /*----------------------------------store引入-----------------------------------*/
-import { useStores, commonStores, controlStores } from "@/store/modules/index";
+import { useStores, commonStores } from "@/store/modules/index";
 /*----------------------------------公共方法引入-----------------------------------*/
 /*----------------------------------公共变量-----------------------------------*/
 const { proxy } = getCurrentInstance();
 const useStore = useStores();
-const controlStore = controlStores();
 /*----------------------------------变量声明-----------------------------------*/
 const state = reactive({
   buffer: "", // 用于存储流式数据不完整的行

+ 1 - 2
src/pages/business/ai/conv/record.vue

@@ -45,12 +45,11 @@ import { ref, reactive, computed, getCurrentInstance, toRefs, inject } from "vue
 /*----------------------------------接口引入-----------------------------------*/
 /*----------------------------------组件引入-----------------------------------*/
 /*----------------------------------store引入-----------------------------------*/
-import { useStores, commonStores, controlStores } from "@/store/modules/index";
+import { useStores, commonStores } from "@/store/modules/index";
 /*----------------------------------公共方法引入-----------------------------------*/
 /*----------------------------------公共变量-----------------------------------*/
 const { proxy } = getCurrentInstance();
 const useStore = useStores();
-const controlStore = controlStores();
 /*----------------------------------变量声明-----------------------------------*/
 const state = reactive({
   loading: false,

+ 32 - 2
src/pages/business/meeting/index.vue

@@ -136,8 +136,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, deviceApi } from "@/api/business/meeting.js";
-import { doorApi } from "@/api/business/door.js";
+import { MeetingRoomList, MeetingRoomReservationList, deviceApi, signOnOut } from "@/api/business/meeting.js";
 /*----------------------------------组件引入-----------------------------------*/
 import timeSlot from "./components/timeSlot.vue";
 import switchSlot from "./components/switchSlot.vue";
@@ -314,6 +313,32 @@ function changeSheet(e) {
       });
   } else if (e.name == "我的会议") {
     proxy.$tab.navigateTo(`/pages/business/meeting/my/index`).then(() => {});
+  } else if (e.name == "扫一扫") {
+    uni.scanCode({
+      autoZoom: false,
+      scanType: ["qrCode"],
+      // onlyFromCamera: true,
+      success: (res) => {
+        if (res.result == "会议空闲中") {
+          proxy.$modal.msg("当前无可参加的会议!");
+        } else {
+          signOnOut({
+            meetingId: res.result,
+            userId: useStore.userId, //参会人Id
+            mothodType: 0, //签到签退类别(0.签到 1.签退)
+            signType: 2, //签到签退方式(0.人工 1.人脸)
+          }).then((item) => {
+            proxy.$modal.msg("签到成功");
+          });
+        }
+      },
+      fail: (err) => {
+        console.log("扫码失败", err);
+      },
+      complete: () => {
+        console.log("扫码结束");
+      },
+    });
   }
 }
 
@@ -327,6 +352,11 @@ function handleSheet(show, type) {
         value: "",
         type: "meeting-my",
       },
+      {
+        name: "扫一扫",
+        value: "",
+        type: "meeting-scan",
+      },
     ];
   } else if (type === "popupMore") {
     state.sheet.actions = [

+ 1 - 2
src/pages/common/authentication/index.vue

@@ -97,12 +97,11 @@ import { ref, reactive, computed, getCurrentInstance, toRefs, inject } from "vue
 /*----------------------------------接口引入-----------------------------------*/
 /*----------------------------------组件引入-----------------------------------*/
 /*----------------------------------store引入-----------------------------------*/
-import { useStores, commonStores, controlStores } from "@/store/modules/index";
+import { useStores, commonStores } from "@/store/modules/index";
 /*----------------------------------公共方法引入-----------------------------------*/
 /*----------------------------------公共变量-----------------------------------*/
 const { proxy } = getCurrentInstance();
 const useStore = useStores();
-const controlStore = controlStores();
 /*----------------------------------变量声明-----------------------------------*/
 const state = reactive({
   loading: false,

+ 1 - 1
src/pages/common/evaluate/index.vue

@@ -115,7 +115,7 @@ onLoad((options) => {
     size: 1,
   }).then((requset) => {
     if (requset.data?.records.length > 0) {
-      isWhether.value = true;
+      isWhether.value = requset.data.records[0].score ? true : false;
       rateValue.value = requset.data.records[0].score;
       projectName.value = requset.data.records[0].projectName;
       handleTime.value = requset.data.records[0].handleTime;

+ 0 - 265
src/store/modules/control.js

@@ -53,206 +53,6 @@ const controlStore = defineStore("control", {
         },
     }),
     actions: {
-        /**
-         * @初始化缓存数据
-         */
-        initData() {
-            var that = this
-            var storage = uni.getStorageSync("storage_face");
-            if (storage) {
-                config.baseUrl = "http://" + storage.domain + "/prod-api";
-                that.form.domain = storage.domain;
-                that.form.linkUrl = storage.linkUrl.indexOf(":") != -1 ? storage.linkUrl.split(":")[0] : storage.linkUrl;
-                that.form.port = storage.port ? storage.port : "";
-                that.form.meetingId = storage.meetingId || undefined;
-                that.form.meetingName = storage.meetingName || undefined;
-                that.form.doorList = {
-                    id: storage.doorList.id || undefined,
-                    name: storage.doorList.name || undefined,
-                }
-            }
-        },
-        /**
-         * @初始化摄像头
-         */
-        initCamera() {
-            var that = this
-            //#ifdef APP-PLUS
-            permission.getPermisson("camera").then((res) => {
-                res ? that.handleChildren({ funcName: "开启摄像头", data: {} }) : "";
-            });
-            //#endif
-        },
-        /**
-         * @初始化NFC
-         */
-        initNfc() {
-            var that = this
-            //#ifdef APP-PLUS
-            nfc.initNFC();
-            nfc.readNFC().then((e) => {
-                that.openDoor();
-                that.initNfc();
-            });
-            //#endif
-        },
-        /**
-         * @初始化事件
-         */
-        initHandle() {
-            this.handleChildren({ funcName: "初始化事件", data: {} })
-        },
-        /**
-         * @弹窗确定按钮事件
-         */
-        modalConfirm(rules) {
-            if (!this.form.linkUrl) {
-                modal.msg("请输入链接地址");
-                return;
-            }
-
-            if (!/^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}(?:\.[a-zA-Z0-9]{2,})+$/.test(this.form.linkUrl)) {
-                modal.msg("请输入正确的链接地址");
-                return;
-            }
-
-            if (!this.form.meetingName && this.pageFunction.includes('会议')) {
-                modal.msg("请选择绑定会议室");
-                return;
-            }
-
-            if (!this.form.doorList.name && this.pageFunction.includes('门禁')) {
-                modal.msg("请选择绑定门禁");
-                return;
-            }
-
-            uni.setStorageSync("storage_face", this.form);
-            this.modalClose();
-        },
-        /**
-         * @弹窗退出按钮事件
-         */
-        modalCancel() {
-            this.modal.show = false;
-            //#ifdef APP-PLUS
-            keyListen.quitApp();
-            //#endif
-        },
-        /**
-         * @弹窗关闭事件
-         */
-        modalClose() {
-            this.handleChildren({ funcName: "开启摄像头", data: {} });
-            this.modal.show = false;
-        },
-        /**
-         * @section回调事件
-         */
-        sectionChange(e) {
-            if (e == 1) {
-                if (!this.form.linkUrl) {
-                    modal.msg("请输入链接地址");
-                    return;
-                }
-
-                if (!/^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}(?:\.[a-zA-Z0-9]{2,})+$/.test(this.form.linkUrl)) {
-                    modal.msg("请输入正确的链接地址");
-                    return;
-                }
-
-                var domain = "";
-                if (this.form.linkUrl) {
-                    domain = this.form.linkUrl;
-                    if (this.form.port) {
-                        domain += ":" + this.form.port;
-                    }
-                }
-
-                this.form.domain = domain;
-                config.baseUrl = "http://" + this.form.domain + "/prod-api";
-                if (this.pageFunction.includes('会议')) {
-                    this.getMeetingRoomList();
-                }
-                if (this.pageFunction.includes('门禁')) {
-                    this.getdoorList();
-                }
-            }
-
-            this.subsection.value = e;
-        },
-
-        /**
-         * @action弹出框点击事件
-         */
-        handlePicker(value, index, ind) {
-            if (value == "绑定会议室") {
-                this.picker.title = "绑定会议室";
-                this.picker.list = [this.meetingRoomList];
-                this.picker.defaultIndex = 0;
-            } else if (value == "绑定门禁") {
-                this.picker.title = "绑定门禁";
-                this.picker.list = [this.doooList];
-                this.picker.defaultIndex = 0;
-            }
-            this.picker.show = true;
-        },
-
-        /**
-         * @action弹出框选择事件
-         */
-        pickerConfirm(e) {
-            if (this.picker.title == "绑定会议室") {
-                this.form.meetingId = e.value[0].value;
-                this.form.meetingName = e.value[0].name;
-            } else if (this.picker.title == "绑定门禁") {
-                this.form.doorList.id = e.value[0].value;
-                this.form.doorList.name = e.value[0].name;
-            }
-            this.picker.show = false;
-        },
-
-        /**
-         * @会议室下拉列表
-         */
-        getMeetingRoomList() {
-            var that = this
-            that.meetingRoomList = [];
-            meetingApi()
-                .GetMeetingRoomList({
-                    domain: that.form.domain,
-                })
-                .then((requset) => {
-                    if (requset.data.length > 0) {
-                        requset.data.forEach((e) => {
-                            that.meetingRoomList.push({
-                                value: e.roomId,
-                                name: e.roomName,
-                            });
-                        });
-                    }
-                });
-        },
-        /**
-         * @门禁下拉列表
-         */
-        getdoorList() {
-            doorApi()
-                .Select({
-                    current: 1, //页数
-                    size: 2000, //条数
-                    domain: this.form.domain, //域名
-                })
-                .then((requset) => {
-                    if (requset.data.records.length > 0) {
-                        requset.data.records.forEach((e) => {
-                            this.doooList.push({
-                                value: e.deviceUuid,
-                                name: e.deviceName,
-                            });
-                        });
-                    }
-                });
-        },
         /**
          * @门禁开门
          */
@@ -313,71 +113,6 @@ const controlStore = defineStore("control", {
                     console.log(err);
                 });
         },
-        /**
-         * @人脸验证
-         */
-        faceVerify(imageBase) {
-            var that = this
-            faceApi()
-                .faceVef({
-                    domain: that.form.domain,
-                    imageBase: imageBase,
-                })
-                .then((item) => {
-                    if (item.data.code === 200 || item.data.code === 201) {
-                        item.data.userName = item.data.faceName;
-                        if (that.pageFunction.includes('会议')) {
-                            that.meetingVerify(item.data);
-                        } else {
-                            that.openDoor(item.data, true);
-                        }
-                    }
-
-                    if (item.data.msg != "人脸验证接口返回异常") {
-                        modal.msg(item.data.msg);
-                    }
-
-                    that.handleChildren({ funcName: "人脸冷却", data: {} });
-                })
-                .catch((err) => {
-                    that.handleChildren({ funcName: "人脸冷却", data: {} });
-                });
-        },
-
-        /**
-         * @会议验证
-         */
-        meetingVerify(event) {
-            var that = this
-            if (that.meetingReservaList.thisVenueData.length > 0) {
-                meetingApi()
-                    .Attendee({
-                        domain: this.form.domain,
-                        meetingId: this.meetingReservaList.thisVenueData[0].meetingId,
-                        userId: event.userId,
-                        userName: event.userName,
-                    })
-                    .then((item) => {
-                        if (item.data.status == "1") {
-                            that.openDoor(event, true);
-                            that.meetingSign(event);
-                        }
-                        modal.msg(item.data.msg);
-                    });
-            }
-        },
-        /**
-         * @会议签到
-         */
-        meetingSign(event) {
-            signOnOut({
-                domain: this.form.domain,
-                meetingId: this.meetingReservaList.thisVenueData[0].meetingId,
-                userId: event.userId, //参会人Id
-                mothodType: 0, //签到签退类别(0.签到 1.签退)
-                signType: 1, //签到签退方式(0.人工 1.人脸)
-            }).then((item) => { });
-        },
         /**
          * @解析父页面传回的数据
          */