|
@@ -29,19 +29,35 @@
|
|
</view>
|
|
</view>
|
|
<view v-if="meetingRoomList.length > 0">
|
|
<view v-if="meetingRoomList.length > 0">
|
|
<view class="mb10 required">绑定会议室</view>
|
|
<view class="mb10 required">绑定会议室</view>
|
|
- <view>
|
|
|
|
|
|
+ <view class="mb20">
|
|
<u-input
|
|
<u-input
|
|
v-model="form.meetingName"
|
|
v-model="form.meetingName"
|
|
placeholder="会议室(必选)"
|
|
placeholder="会议室(必选)"
|
|
suffixIcon="arrow-right"
|
|
suffixIcon="arrow-right"
|
|
suffixIconStyle="color: #909399"
|
|
suffixIconStyle="color: #909399"
|
|
- border="none"
|
|
|
|
|
|
+ border="bottom"
|
|
|
|
+ style="padding: 6px 0px"
|
|
disabledColor="transparent"
|
|
disabledColor="transparent"
|
|
disabled
|
|
disabled
|
|
@click="handlePicker('绑定会议室')"
|
|
@click="handlePicker('绑定会议室')"
|
|
/>
|
|
/>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
+ <view>
|
|
|
|
+ <view class="mb10 required">绑定门禁</view>
|
|
|
|
+ <view>
|
|
|
|
+ <u-input
|
|
|
|
+ v-model="form.doorName"
|
|
|
|
+ placeholder="门禁(必选)"
|
|
|
|
+ suffixIcon="arrow-right"
|
|
|
|
+ suffixIconStyle="color: #909399"
|
|
|
|
+ border="none"
|
|
|
|
+ disabledColor="transparent"
|
|
|
|
+ disabled
|
|
|
|
+ @click="handlePicker('绑定门禁')"
|
|
|
|
+ />
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
</u-modal>
|
|
</u-modal>
|
|
|
|
|
|
@@ -64,7 +80,7 @@ import config from "@/config";
|
|
import { onLoad, onShow, onReady, onHide, onLaunch, onUnload, onNavigationBarButtonTap, onPageScroll } from "@dcloudio/uni-app";
|
|
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 { ref, reactive, computed, getCurrentInstance, toRefs, inject, nextTick, watch } from "vue";
|
|
/*----------------------------------接口引入-----------------------------------*/
|
|
/*----------------------------------接口引入-----------------------------------*/
|
|
-import { meetingApi, faceApi, signOnOut, control } from "./api.js";
|
|
|
|
|
|
+import { meetingApi, faceApi, signOnOut, doorApi } from "./api.js";
|
|
/*----------------------------------组件引入-----------------------------------*/
|
|
/*----------------------------------组件引入-----------------------------------*/
|
|
/*----------------------------------store引入-----------------------------------*/
|
|
/*----------------------------------store引入-----------------------------------*/
|
|
/*----------------------------------公共方法引入-----------------------------------*/
|
|
/*----------------------------------公共方法引入-----------------------------------*/
|
|
@@ -75,6 +91,7 @@ const state = reactive({
|
|
width: "100%",
|
|
width: "100%",
|
|
height: "100%",
|
|
height: "100%",
|
|
},
|
|
},
|
|
|
|
+ meetingDoorList: [],
|
|
meetingRoomList: [],
|
|
meetingRoomList: [],
|
|
meetingTimeList: [],
|
|
meetingTimeList: [],
|
|
meetingReservaList: {
|
|
meetingReservaList: {
|
|
@@ -100,6 +117,8 @@ const state = reactive({
|
|
domain: undefined,
|
|
domain: undefined,
|
|
meetingId: undefined,
|
|
meetingId: undefined,
|
|
meetingName: undefined,
|
|
meetingName: undefined,
|
|
|
|
+ doorId: undefined,
|
|
|
|
+ doorName: undefined,
|
|
},
|
|
},
|
|
inter: {
|
|
inter: {
|
|
interMeeting: null,
|
|
interMeeting: null,
|
|
@@ -109,13 +128,19 @@ const { webviewStyles, meetingRoomList, modal, picker, form, inter } = toRefs(st
|
|
|
|
|
|
// 初始化
|
|
// 初始化
|
|
function init() {
|
|
function init() {
|
|
- uni.chooseImage({
|
|
|
|
- sourceType: ["camera"],
|
|
|
|
- success(res) {
|
|
|
|
- console.log(res);
|
|
|
|
- },
|
|
|
|
|
|
+ //#ifdef APP-PLUS
|
|
|
|
+ proxy.$permission.getPermisson("camera").then((res) => {
|
|
|
|
+ if (res) {
|
|
|
|
+ handleChildren({
|
|
|
|
+ funcName: "开启摄像头",
|
|
|
|
+ data: {},
|
|
|
|
+ });
|
|
|
|
+ }
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ initNfc();
|
|
|
|
+ //#endif
|
|
|
|
+
|
|
var storage = uni.getStorageSync("storage_face");
|
|
var storage = uni.getStorageSync("storage_face");
|
|
if (storage) {
|
|
if (storage) {
|
|
state.form.domain = storage.domain;
|
|
state.form.domain = storage.domain;
|
|
@@ -123,19 +148,32 @@ function init() {
|
|
state.form.port = storage.port ? storage.port : "";
|
|
state.form.port = storage.port ? storage.port : "";
|
|
state.form.meetingId = storage.meetingId || undefined;
|
|
state.form.meetingId = storage.meetingId || undefined;
|
|
state.form.meetingName = storage.meetingName || undefined;
|
|
state.form.meetingName = storage.meetingName || undefined;
|
|
|
|
+ state.form.doorId = storage.doorId || undefined;
|
|
|
|
+ state.form.doorName = storage.doorName || undefined;
|
|
}
|
|
}
|
|
|
|
|
|
- getMeetingRoomList();
|
|
|
|
- getMeetingRoomReservationList();
|
|
|
|
- inter.interMeeting = setInterval(() => {
|
|
|
|
|
|
+ if (!inter.interMeeting) {
|
|
getMeetingRoomReservationList();
|
|
getMeetingRoomReservationList();
|
|
- }, 1000 * 5);
|
|
|
|
|
|
+ inter.interMeeting = setInterval(() => {
|
|
|
|
+ getMeetingRoomReservationList();
|
|
|
|
+ }, 1000 * 5);
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 初始化NFC开门
|
|
|
|
+function initNfc() {
|
|
|
|
+ proxy.$nfc.initNFC();
|
|
|
|
+ proxy.$nfc.readNFC().then((e) => {
|
|
|
|
+ openDoor();
|
|
|
|
+ initNfc();
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* @会议室下拉列表
|
|
* @会议室下拉列表
|
|
*/
|
|
*/
|
|
function getMeetingRoomList() {
|
|
function getMeetingRoomList() {
|
|
|
|
+ state.meetingRoomList = [];
|
|
meetingApi()
|
|
meetingApi()
|
|
.GetMeetingRoomList({
|
|
.GetMeetingRoomList({
|
|
domain: state.form.domain,
|
|
domain: state.form.domain,
|
|
@@ -152,6 +190,31 @@ function getMeetingRoomList() {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * @门禁下拉列表
|
|
|
|
+ */
|
|
|
|
+function getdoorList() {
|
|
|
|
+ state.meetingDoorList = [];
|
|
|
|
+ doorApi()
|
|
|
|
+ .doorList({
|
|
|
|
+ current: 1, //页数
|
|
|
|
+ size: 2000, //条数
|
|
|
|
+ productCode: "502_KAT", //产品编码
|
|
|
|
+ deviceStatus: 2, //设备状态;1:在线,2:离线
|
|
|
|
+ domain: state.form.domain, //域名
|
|
|
|
+ })
|
|
|
|
+ .then((requset) => {
|
|
|
|
+ if (requset.data.records.length > 0) {
|
|
|
|
+ requset.data.records.forEach((e) => {
|
|
|
|
+ state.meetingDoorList.push({
|
|
|
|
+ value: e.deviceId,
|
|
|
|
+ name: e.deviceName,
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @会议室详情列表
|
|
* @会议室详情列表
|
|
*/
|
|
*/
|
|
@@ -297,7 +360,7 @@ function faceVerify(imageBase) {
|
|
if (state.meetingReservaList.thisVenueData.length > 0) {
|
|
if (state.meetingReservaList.thisVenueData.length > 0) {
|
|
meetingVerify(item);
|
|
meetingVerify(item);
|
|
} else {
|
|
} else {
|
|
- openDoor();
|
|
|
|
|
|
+ openDoor(item);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
proxy.$modal.msg(item.data.msg);
|
|
proxy.$modal.msg(item.data.msg);
|
|
@@ -309,25 +372,25 @@ function faceVerify(imageBase) {
|
|
/**
|
|
/**
|
|
* @会议验证
|
|
* @会议验证
|
|
*/
|
|
*/
|
|
-function meetingVerify(item) {
|
|
|
|
|
|
+function meetingVerify(event) {
|
|
meetingApi()
|
|
meetingApi()
|
|
.Attendee({
|
|
.Attendee({
|
|
domain: state.form.domain,
|
|
domain: state.form.domain,
|
|
meetingId: state.meetingReservaList.thisVenueData[0].meetingId,
|
|
meetingId: state.meetingReservaList.thisVenueData[0].meetingId,
|
|
- userId: item.data.userId,
|
|
|
|
- userName: item.data.faceName,
|
|
|
|
|
|
+ userId: event.data.userId,
|
|
|
|
+ userName: event.data.faceName,
|
|
})
|
|
})
|
|
.then((item1) => {
|
|
.then((item1) => {
|
|
if (item1.data.status == "1") {
|
|
if (item1.data.status == "1") {
|
|
proxy.$modal.msg(item1.data.msg);
|
|
proxy.$modal.msg(item1.data.msg);
|
|
- state.msg = `[${item.data.faceName}] ${item1.data.msg}`;
|
|
|
|
|
|
+ state.msg = `[${event.data.faceName}] ${item1.data.msg}`;
|
|
|
|
|
|
- openDoor();
|
|
|
|
|
|
+ openDoor(event);
|
|
|
|
|
|
signOnOut({
|
|
signOnOut({
|
|
domain: state.form.domain,
|
|
domain: state.form.domain,
|
|
meetingId: state.meetingReservaList.thisVenueData[0].meetingId,
|
|
meetingId: state.meetingReservaList.thisVenueData[0].meetingId,
|
|
- userId: item.data.userId, //参会人Id
|
|
|
|
|
|
+ userId: event.data.userId, //参会人Id
|
|
mothodType: 0, //签到签退类别(0.签到 1.签退)
|
|
mothodType: 0, //签到签退类别(0.签到 1.签退)
|
|
signType: 1, //签到签退方式(0.人工 1.人脸)
|
|
signType: 1, //签到签退方式(0.人工 1.人脸)
|
|
}).then((item2) => {});
|
|
}).then((item2) => {});
|
|
@@ -340,11 +403,17 @@ function meetingVerify(item) {
|
|
/**
|
|
/**
|
|
* @门禁开门
|
|
* @门禁开门
|
|
*/
|
|
*/
|
|
-function openDoor() {
|
|
|
|
- control({
|
|
|
|
- domain: state.form.domain,
|
|
|
|
- commandStr: JSON.stringify({ method: "control", params: { device_id: "223212768", command: 2 } }),
|
|
|
|
- })
|
|
|
|
|
|
+function openDoor(item) {
|
|
|
|
+ doorApi()
|
|
|
|
+ .doorControl({
|
|
|
|
+ domain: state.form.domain,
|
|
|
|
+ userId: item.data.userId || undefined,
|
|
|
|
+ userName: item.data.faceName || undefined,
|
|
|
|
+ productCode: "502_KAT",
|
|
|
|
+ deviceId: state.form.doorId,
|
|
|
|
+ commandCode: "door_onoff",
|
|
|
|
+ commandValue: 1,
|
|
|
|
+ })
|
|
.then((item2) => {
|
|
.then((item2) => {
|
|
proxy.$modal.msg("开门成功");
|
|
proxy.$modal.msg("开门成功");
|
|
})
|
|
})
|
|
@@ -372,6 +441,11 @@ function modalConfirm() {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (!state.form.doorName) {
|
|
|
|
+ proxy.$modal.msg("请选择绑定门禁");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
uni.setStorageSync("storage_face", state.form);
|
|
uni.setStorageSync("storage_face", state.form);
|
|
state.modal.show = false;
|
|
state.modal.show = false;
|
|
getMeetingRoomReservationList();
|
|
getMeetingRoomReservationList();
|
|
@@ -385,6 +459,10 @@ function handlePicker(value, index, ind) {
|
|
state.picker.title = "绑定会议室";
|
|
state.picker.title = "绑定会议室";
|
|
state.picker.list = [state.meetingRoomList];
|
|
state.picker.list = [state.meetingRoomList];
|
|
state.picker.defaultIndex = 0;
|
|
state.picker.defaultIndex = 0;
|
|
|
|
+ } else if (value == "绑定门禁") {
|
|
|
|
+ state.picker.title = "绑定门禁";
|
|
|
|
+ state.picker.list = [state.meetingDoorList];
|
|
|
|
+ state.picker.defaultIndex = 0;
|
|
}
|
|
}
|
|
state.picker.show = true;
|
|
state.picker.show = true;
|
|
}
|
|
}
|
|
@@ -396,6 +474,9 @@ function pickerConfirm(e) {
|
|
if (state.picker.title == "绑定会议室") {
|
|
if (state.picker.title == "绑定会议室") {
|
|
state.form.meetingId = e.value[0].value;
|
|
state.form.meetingId = e.value[0].value;
|
|
state.form.meetingName = e.value[0].name;
|
|
state.form.meetingName = e.value[0].name;
|
|
|
|
+ } else if (state.picker.title == "绑定门禁") {
|
|
|
|
+ state.form.doorId = e.value[0].value;
|
|
|
|
+ state.form.doorName = e.value[0].name;
|
|
}
|
|
}
|
|
state.picker.show = false;
|
|
state.picker.show = false;
|
|
}
|
|
}
|
|
@@ -415,7 +496,6 @@ function modalCancel() {
|
|
*/
|
|
*/
|
|
function analysisData(event) {
|
|
function analysisData(event) {
|
|
if ("funcName" in event) {
|
|
if ("funcName" in event) {
|
|
- console.log(event.funcName);
|
|
|
|
if (event.funcName == "打开配置") {
|
|
if (event.funcName == "打开配置") {
|
|
state.modal.show = true;
|
|
state.modal.show = true;
|
|
} else if (event.funcName == "人脸识别") {
|
|
} else if (event.funcName == "人脸识别") {
|
|
@@ -454,9 +534,13 @@ window.onmessage = function (event) {
|
|
// #endif
|
|
// #endif
|
|
|
|
|
|
onLoad((options) => {
|
|
onLoad((options) => {
|
|
- init();
|
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ init();
|
|
|
|
+ }, 500);
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+onShow(() => {});
|
|
|
|
+
|
|
onUnload(() => {
|
|
onUnload(() => {
|
|
clearInterval(inter.interMeeting); //销毁之前定时器
|
|
clearInterval(inter.interMeeting); //销毁之前定时器
|
|
});
|
|
});
|
|
@@ -464,8 +548,6 @@ onUnload(() => {
|
|
watch(
|
|
watch(
|
|
() => [state.form.linkUrl, state.form.port],
|
|
() => [state.form.linkUrl, state.form.port],
|
|
(val) => {
|
|
(val) => {
|
|
- state.meetingRoomList = [];
|
|
|
|
-
|
|
|
|
if (!state.form.linkUrl) {
|
|
if (!state.form.linkUrl) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -481,8 +563,10 @@ watch(
|
|
domain += ":" + state.form.port;
|
|
domain += ":" + state.form.port;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
state.form.domain = domain;
|
|
state.form.domain = domain;
|
|
config.baseUrl = "http://" + state.form.domain + "/prod-api";
|
|
config.baseUrl = "http://" + state.form.domain + "/prod-api";
|
|
|
|
+ getdoorList();
|
|
getMeetingRoomList();
|
|
getMeetingRoomList();
|
|
}
|
|
}
|
|
);
|
|
);
|