|
|
@@ -19,45 +19,20 @@
|
|
|
:showConfirmButton="true"
|
|
|
:showCancelButton="true"
|
|
|
:closeOnClickOverlay="true"
|
|
|
- @confirm="controlStore.modalConfirm(), getMeetingRoomReservationList()"
|
|
|
- @cancel="controlStore.modalCancel()"
|
|
|
- @close="controlStore.modalClose()"
|
|
|
+ @confirm="controlStore.handleModal('Confirm')"
|
|
|
+ @cancel="controlStore.handleModal('Cancel')"
|
|
|
+ @close="controlStore.handleModal('Close')"
|
|
|
>
|
|
|
<view class="slot-content">
|
|
|
+ <!-- <view @click="startActivity()">测试startActivity</view> -->
|
|
|
+
|
|
|
<u-subsection class="mb20" :list="controlStore.subsection.list" :current="controlStore.subsection.value" @change="controlStore.sectionChange"></u-subsection>
|
|
|
|
|
|
<view v-if="controlStore.subsection.value == 0">
|
|
|
- <view class="mb10 required">服务器地址</view>
|
|
|
- <view class="mb20">
|
|
|
- <u-input v-model="controlStore.form.linkUrl" placeholder="服务器地址(必填)" border="bottom" style="padding: 6px 0px" />
|
|
|
- </view>
|
|
|
-
|
|
|
- <view class="mb10">服务器端口</view>
|
|
|
- <view class="mb20">
|
|
|
- <u-input v-model="controlStore.form.port" placeholder="服务器端口(非必填)" border="bottom" style="padding: 6px 0px" />
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <view v-if="controlStore.subsection.value == 1">
|
|
|
- <view class="mb10 required">绑定会议室</view>
|
|
|
- <view class="mb20">
|
|
|
- <u-input
|
|
|
- v-model="controlStore.form.meetingName"
|
|
|
- placeholder="会议室(必选)"
|
|
|
- suffixIcon="arrow-right"
|
|
|
- suffixIconStyle="color: #909399"
|
|
|
- border="bottom"
|
|
|
- style="padding: 6px 0px"
|
|
|
- disabledColor="transparent"
|
|
|
- disabled
|
|
|
- @click="controlStore.handlePicker('绑定会议室')"
|
|
|
- />
|
|
|
- </view>
|
|
|
-
|
|
|
<view class="mb10 required">绑定门禁</view>
|
|
|
<view>
|
|
|
<u-input
|
|
|
- v-model="controlStore.form.doorList.name"
|
|
|
+ v-model="controlStore.form.door.name"
|
|
|
placeholder="门禁(必选)"
|
|
|
suffixIcon="arrow-right"
|
|
|
suffixIconStyle="color: #909399"
|
|
|
@@ -69,15 +44,16 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
- <u-cell-group v-if="controlStore.subsection.value == 2">
|
|
|
+ <u-cell-group v-if="controlStore.subsection.value == 1">
|
|
|
<u-cell title="导航栏显示">
|
|
|
<template #value>
|
|
|
<u-switch v-model="setting.navBarNew" size="15" @change="navBarNewChange"></u-switch>
|
|
|
</template>
|
|
|
</u-cell>
|
|
|
<u-cell title="软件版本号" :value="version"></u-cell>
|
|
|
- <u-cell title="设备型号" :value="getAndroidModle()"></u-cell>
|
|
|
- <u-cell title="设备序列号" :value="getSerialno()"></u-cell>
|
|
|
+ <u-cell title="IP" :value="setting.ipAddress || '-'"></u-cell>
|
|
|
+ <u-cell title="设备型号" :value="sysPlugins.getDeviceInfo().model || '-'"></u-cell>
|
|
|
+ <u-cell title="设备序列号" :value="sysPlugins.getDeviceInfo().serial || '-'"></u-cell>
|
|
|
<u-cell title="检查更新" @click="handleToUpgrade()">
|
|
|
<template #value> <view class="iconfont oaIcon-jianchagengxin menu-item-icon mr2" style="color: #2979ff"></view> </template>
|
|
|
</u-cell>
|
|
|
@@ -109,11 +85,11 @@ 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, signOnOut } from "@/api/business/meeting.js";
|
|
|
/*----------------------------------组件引入-----------------------------------*/
|
|
|
/*----------------------------------store引入-----------------------------------*/
|
|
|
import { controlStores } from "@/store/modules/index";
|
|
|
/*----------------------------------公共方法引入-----------------------------------*/
|
|
|
+import sysPlugins from "@/plugins/device/sys.plugins";
|
|
|
/*----------------------------------公共变量-----------------------------------*/
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
const controlStore = controlStores();
|
|
|
@@ -133,154 +109,30 @@ const state = reactive({
|
|
|
|
|
|
setting: {
|
|
|
navBarNew: true,
|
|
|
- serialno: "", //设备序列号
|
|
|
+ ipAddress: "",
|
|
|
},
|
|
|
});
|
|
|
const { version, webviewStyles, inter, setting } = toRefs(state);
|
|
|
|
|
|
// 初始化
|
|
|
function init() {
|
|
|
+ setInterval(() => {
|
|
|
+ sysPlugins.getIpAddress({
|
|
|
+ success: (res) => {
|
|
|
+ state.setting.ipAddress = res;
|
|
|
+ },
|
|
|
+ error: (res) => {
|
|
|
+ state.setting.ipAddress = "";
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }, 2000);
|
|
|
+
|
|
|
controlStore.pageFunction = ["门禁", "会议"];
|
|
|
controlStore.initCamera();
|
|
|
// controlStore.initNfc();
|
|
|
controlStore.initData();
|
|
|
- if (!inter.meeting) {
|
|
|
- getMeetingRoomReservationList();
|
|
|
- inter.meeting = setInterval(() => {
|
|
|
- getMeetingRoomReservationList();
|
|
|
- }, 1000 * 3);
|
|
|
- }
|
|
|
+ controlStore.openInterval("meeting");
|
|
|
|
|
|
- timingRebootNow(); //调用定时重启
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * @会议室详情列表
|
|
|
- */
|
|
|
-function getMeetingRoomReservationList() {
|
|
|
- controlStore.meetingTimeList = [];
|
|
|
- controlStore.meetingReservaList.thisVenueData = [];
|
|
|
- controlStore.meetingReservaList.thisVenueTime = {};
|
|
|
- controlStore.meetingReservaList.nextSceneData = [];
|
|
|
- controlStore.meetingReservaList.nextSceneTime = {};
|
|
|
-
|
|
|
- for (let i = 0; i <= 23.5; i += 0.5) {
|
|
|
- var time = "";
|
|
|
- if (i % 1 === 0.5) {
|
|
|
- if (i < 10) {
|
|
|
- time = "0" + (i - 0.5) + ":30";
|
|
|
- } else {
|
|
|
- time = i - 0.5 + ":30";
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (i < 10) {
|
|
|
- time = "0" + i + ":00";
|
|
|
- } else {
|
|
|
- time = i + ":00";
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- controlStore.meetingTimeList.push({
|
|
|
- startTime: time,
|
|
|
- endTime: time,
|
|
|
- isEnd: 0,
|
|
|
- isHave: 0,
|
|
|
- isReservation: 0,
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- meetingApi()
|
|
|
- .GetMeetingRoomReservationList({
|
|
|
- domain: controlStore.form.domain,
|
|
|
- meetingRoomId: controlStore.form.meetingId,
|
|
|
- date: proxy.$dayjs().format("YYYY-MM-DD") + " 00:00:00",
|
|
|
- })
|
|
|
- .then((requset) => {
|
|
|
- if (requset.data.length > 0) {
|
|
|
- controlStore.meetingReservaList.dataAll = requset.data[0];
|
|
|
- controlStore.meetingReservaList.dataAll.dmMeetingList.forEach((e, index) => {
|
|
|
- //判断开始时间和结束时间是否包含当前时间
|
|
|
- if (proxy.$dayjs().isBetween(e.startDate, e.endDate, null, "[]")) {
|
|
|
- controlStore.meetingReservaList.thisVenueData.push(e);
|
|
|
- controlStore.meetingReservaList.thisVenueTime = proxy.$time.timeRestructuring(controlStore.meetingReservaList.dataAll.meetingRoomUsage[index]);
|
|
|
- }
|
|
|
- //判断当前时间是否相同或在其之前
|
|
|
- if (proxy.$dayjs().isSameOrBefore(e.startDate) && controlStore.meetingReservaList.nextSceneData.length < 1) {
|
|
|
- controlStore.meetingReservaList.nextSceneData.push(e);
|
|
|
- controlStore.meetingReservaList.nextSceneTime = proxy.$time.timeRestructuring(controlStore.meetingReservaList.dataAll.meetingRoomUsage[index]);
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- controlStore.meetingReservaList.timeList = showTimeSegments(controlStore.meetingTimeList);
|
|
|
- controlStore.handleChildren({
|
|
|
- funcName: "初始化数据",
|
|
|
- data: JSON.stringify(controlStore.meetingReservaList),
|
|
|
- });
|
|
|
- } else {
|
|
|
- controlStore.meetingReservaList.timeList = controlStore.meetingTimeList;
|
|
|
- controlStore.handleChildren({
|
|
|
- funcName: "初始化数据",
|
|
|
- data: JSON.stringify(controlStore.meetingReservaList),
|
|
|
- });
|
|
|
- }
|
|
|
- })
|
|
|
- .catch((err) => {});
|
|
|
-}
|
|
|
-
|
|
|
-// 显示时间段的函数
|
|
|
-function showTimeSegments(times) {
|
|
|
- const timesXleList = JSON.parse(JSON.stringify(times));
|
|
|
-
|
|
|
- for (var i = 0; i < timesXleList.length; i++) {
|
|
|
- const timeValue = new Date(`${proxy.$dayjs().format("YYYY-MM-DD")}T${timesXleList[i].startTime}`);
|
|
|
-
|
|
|
- controlStore.meetingReservaList.dataAll.meetingRoomUsage.forEach((item) => {
|
|
|
- const timeList = proxy.$time.timeRestructuring(item);
|
|
|
- const startValue = new Date(`${proxy.$dayjs().format("YYYY-MM-DD")}T${timeList.startTime}`);
|
|
|
- const endValue = new Date(`${proxy.$dayjs().format("YYYY-MM-DD")}T${timeList.endTime}`);
|
|
|
-
|
|
|
- if (timeValue.getTime() >= startValue.getTime() && timeValue.getTime() < endValue.getTime()) {
|
|
|
- timesXleList.splice(i--, 1);
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- controlStore.meetingReservaList.dataAll.meetingRoomUsage.forEach((item) => {
|
|
|
- const timeList = proxy.$time.timeRestructuring(item);
|
|
|
- const startValue = new Date(`${proxy.$dayjs().format("YYYY-MM-DD")}T${timeList.startTime}`);
|
|
|
- const endValue = new Date(`${proxy.$dayjs().format("YYYY-MM-DD")}T${timeList.endTime}`);
|
|
|
-
|
|
|
- if (proxy.$dayjs().isBetween(startValue, endValue, null, "[]")) {
|
|
|
- timesXleList.push({
|
|
|
- ...timeList,
|
|
|
- isEnd: 0,
|
|
|
- isHave: 1,
|
|
|
- isReservation: 0,
|
|
|
- });
|
|
|
- } else {
|
|
|
- if (proxy.$dayjs().isSameOrAfter(startValue)) {
|
|
|
- timesXleList.push({
|
|
|
- ...timeList,
|
|
|
- isEnd: 1,
|
|
|
- isHave: 0,
|
|
|
- isReservation: 0,
|
|
|
- });
|
|
|
- }
|
|
|
- if (proxy.$dayjs().isSameOrBefore(startValue)) {
|
|
|
- timesXleList.push({
|
|
|
- ...timeList,
|
|
|
- isEnd: 0,
|
|
|
- isHave: 0,
|
|
|
- isReservation: 1,
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- var newTimesXleList = proxy.$common
|
|
|
- .uniq(timesXleList, "startTime")
|
|
|
- .sort((a, b) => new Date(`${proxy.$dayjs().format("YYYY-MM-DD")}T${a.startTime}`) - new Date(`${proxy.$dayjs().format("YYYY-MM-DD")}T${b.startTime}`));
|
|
|
- return newTimesXleList;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -295,47 +147,19 @@ window.onmessage = function (event) {
|
|
|
};
|
|
|
// #endif
|
|
|
|
|
|
-function handleButton(value) {
|
|
|
- //#ifdef APP-PLUS
|
|
|
- const myActivityClass = plus.android.importClass("com.example.yxDevice.test"); // 替换为你的包名和Activity名
|
|
|
- const myActivity = new myActivityClass(); // 创建插件类的实例
|
|
|
- myActivity.setLed(value);
|
|
|
- //#endif
|
|
|
-}
|
|
|
-
|
|
|
-// 获取设备序列号
|
|
|
-function getAndroidModle() {
|
|
|
- //#ifdef APP-PLUS
|
|
|
- const myActivityClass = plus.android.importClass("com.example.yxDevice.test"); // 替换为你的包名和Activity名
|
|
|
- const myActivity = new myActivityClass(); // 创建插件类的实例
|
|
|
- return myActivity.getAndroidModle();
|
|
|
- //#endif
|
|
|
-}
|
|
|
-
|
|
|
-// 获取设备序列号
|
|
|
-function getSerialno() {
|
|
|
- //#ifdef APP-PLUS
|
|
|
- const myActivityClass = plus.android.importClass("com.example.yxDevice.test"); // 替换为你的包名和Activity名
|
|
|
- const myActivity = new myActivityClass(); // 创建插件类的实例
|
|
|
- return myActivity.getSerialno();
|
|
|
- //#endif
|
|
|
-}
|
|
|
-
|
|
|
// 隐藏导航栏
|
|
|
function navBarNewChange(value) {
|
|
|
//#ifdef APP-PLUS
|
|
|
- const myActivityClass = plus.android.importClass("com.example.yxDevice.test"); // 替换为你的包名和Activity名
|
|
|
- const myActivity = new myActivityClass(); // 创建插件类的实例
|
|
|
- myActivity.setNavBarNew(value);
|
|
|
+ const yxPlugin = uni.requireNativePlugin("yxPlugin");
|
|
|
+ yxPlugin.setNavBarNew(value);
|
|
|
//#endif
|
|
|
}
|
|
|
|
|
|
// 设备重启
|
|
|
function rebootNow() {
|
|
|
//#ifdef APP-PLUS
|
|
|
- const myActivityClass = plus.android.importClass("com.example.yxDevice.test"); // 替换为你的包名和Activity名
|
|
|
- const myActivity = new myActivityClass(); // 创建插件类的实例
|
|
|
- myActivity.rebootNow();
|
|
|
+ const yxPlugin = uni.requireNativePlugin("yxPlugin");
|
|
|
+ yxPlugin.rebootNow();
|
|
|
//#endif
|
|
|
}
|
|
|
|
|
|
@@ -375,6 +199,11 @@ function handleToUpgrade() {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+function startActivity() {
|
|
|
+ const yxPlugin = uni.requireNativePlugin("yxPlugin");
|
|
|
+ yxPlugin.startActivity();
|
|
|
+}
|
|
|
+
|
|
|
onLoad((options) => {
|
|
|
setTimeout(() => {
|
|
|
init();
|