From 3852e6ac20099996695d593b128175e9e5e60196 Mon Sep 17 00:00:00 2001
From: chenzhihao <1798906853@qq.com>
Date: Tue, 30 Dec 2025 15:21:19 +0800
Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84=E7=AC=AC=E4=B8=80=E7=89=88?=
=?UTF-8?q?=20=E6=99=BA=E6=8E=A7=E5=8A=A9=E6=89=8B=E5=B0=8F=E7=A8=8B?=
=?UTF-8?q?=E5=BA=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app.js | 1 +
app.json | 6 +-
colorui/main.wxss | 8 +
lib/RequestingCenter.js | 66 +-
lib/request1.js | 25 +-
pages/NewHome/NewHome.js | 8 +-
.../FacialDeviceBinding.js | 629 +++++++++++++++++
.../FacialDeviceBinding.json | 6 +
.../FacialDeviceBinding.wxml | 144 ++++
.../FacialDeviceBinding.wxss | 364 ++++++++++
.../EquipmentCaontrol/EquipmentCaontrol.wxml | 3 +-
pages/basics/MakingRounds/MakingRounds.js | 24 +-
pages/basics/MakingRounds/process/process.js | 439 ++++++++++--
.../basics/MakingRounds/process/process.wxml | 74 +-
.../basics/MakingRounds/process/process.wxss | 3 +-
.../MakingRoundsAbnormal.js | 382 ++++++++++-
.../MakingRoundsAbnormal.wxml | 85 ++-
.../MakingRoundsAbnormal.wxss | 9 +
.../RoomTypeControlLog/RoomTypeControlLog.js | 135 ++++
.../RoomTypeControlLog.json | 3 +
.../RoomTypeControlLog.wxml | 34 +
.../RoomTypeControlLog.wxss | 1 +
pages/basics/progress/progress.js | 293 ++++++++
pages/basics/progress/progress.json | 3 +
pages/basics/progress/progress.wxml | 46 ++
pages/basics/progress/progress.wxss | 102 +++
pages/index/index.js | 18 +-
pages/test/test.js | 647 ++++++++++++++++++
pages/test/test.json | 3 +
pages/test/test.wxml | 143 ++++
pages/test/test.wxss | 1 +
project.config.json | 2 +-
32 files changed, 3584 insertions(+), 123 deletions(-)
create mode 100644 pages/basics/FacialDeviceBinding/FacialDeviceBinding.js
create mode 100644 pages/basics/FacialDeviceBinding/FacialDeviceBinding.json
create mode 100644 pages/basics/FacialDeviceBinding/FacialDeviceBinding.wxml
create mode 100644 pages/basics/FacialDeviceBinding/FacialDeviceBinding.wxss
create mode 100644 pages/basics/progress/RoomTypeControlLog/RoomTypeControlLog.js
create mode 100644 pages/basics/progress/RoomTypeControlLog/RoomTypeControlLog.json
create mode 100644 pages/basics/progress/RoomTypeControlLog/RoomTypeControlLog.wxml
create mode 100644 pages/basics/progress/RoomTypeControlLog/RoomTypeControlLog.wxss
create mode 100644 pages/basics/progress/progress.js
create mode 100644 pages/basics/progress/progress.json
create mode 100644 pages/basics/progress/progress.wxml
create mode 100644 pages/basics/progress/progress.wxss
create mode 100644 pages/test/test.js
create mode 100644 pages/test/test.json
create mode 100644 pages/test/test.wxml
create mode 100644 pages/test/test.wxss
diff --git a/app.js b/app.js
index 3758242..c45bd45 100644
--- a/app.js
+++ b/app.js
@@ -44,6 +44,7 @@ App({
HotelId:-1,
CreateTime:null,
HotelCode:null,
+ CreatDate:null,
},
toast:function(type,title,success,time){
if(type==1){
diff --git a/app.json b/app.json
index 5553764..461b1a2 100644
--- a/app.json
+++ b/app.json
@@ -10,7 +10,11 @@
"pages/basics/MakingRounds/process/process",
"pages/basics/MakingRoundsAbnormal/MakingRoundsAbnormal",
"pages/basics/HostUpgrade/HostUpgrade",
- "pages/basics/HostUpgrade/EquipmentCaontrol/EquipmentCaontrol"
+ "pages/basics/HostUpgrade/EquipmentCaontrol/EquipmentCaontrol",
+ "pages/test/test",
+ "pages/basics/FacialDeviceBinding/FacialDeviceBinding",
+ "pages/basics/progress/progress",
+ "pages/basics/progress/RoomTypeControlLog/RoomTypeControlLog"
],
"window": {
"backgroundTextStyle": "light",
diff --git a/colorui/main.wxss b/colorui/main.wxss
index fef3f65..46fb8f1 100644
--- a/colorui/main.wxss
+++ b/colorui/main.wxss
@@ -1398,6 +1398,14 @@ button.icon.lg {
justify-content: space-between;
align-items: center
}
+.cu-list.menu>.cu-itemzn {
+ position: relative;
+ padding: 0 10rpx;
+ min-height: 100rpx;
+ background-color: var(--white);
+ justify-content: space-between;
+ align-items: center
+}
.cu-list.menu>.cu-item:last-child:after {
border: none
diff --git a/lib/RequestingCenter.js b/lib/RequestingCenter.js
index 182a590..18332ee 100644
--- a/lib/RequestingCenter.js
+++ b/lib/RequestingCenter.js
@@ -191,6 +191,16 @@ export async function GetRoomTypeNode(params){
url: BoonliveUrl + 'GetDeviceInfo',
data: params || {}
})
+}
+//获取房型下的设备
+export async function GetRoomAddressStatus(params){
+ params.token = gettoken();
+ console.log(params)
+ return await reqeust1({
+ title: "",
+ url: BoonliveUrl + 'GetRoomAddressStatus',
+ data: params || {}
+ })
}
export async function WebChatUpgrade(params){
@@ -257,4 +267,58 @@ export async function SetRCUCurtain(params){
data: params || {}
})
}
-SetRCUCurtain
\ No newline at end of file
+
+//查询设备列表
+export async function QueryDeviceList(params){
+ params.token = gettoken();
+ console.log(params)
+ return await reqeust1({
+ title: null,
+ url: BoonliveUrl + 'QueryDeviceList',
+ data: params || {}
+ })
+}
+
+//设置RCU服务
+export async function SetRCUService(params){
+ params.token = gettoken();
+ console.log(params)
+ return await reqeust1({
+ title: null,
+ url: BoonliveUrl + 'SetRCUService',
+ data: params || {}
+ })
+}
+
+//写入房间设备访问日志
+export async function WriteRoomVisitLog(params){
+ params.token = gettoken();
+ console.log(params)
+ return await reqeust1({
+ title: "上传查房记录中",
+ url: BoonliveUrl + 'WriteRoomVisitLog',
+ data: params || {}
+ })
+}
+
+//查询房间设备访问日志
+export async function QueryRoomVisitLog(params){
+ params.token = gettoken();
+ console.log(params)
+ return await reqeust1({
+ title: "查询设备访问日志中",
+ url: BoonliveUrl + 'QueryRoomVisitLog',
+ data: params || {}
+ })
+}
+
+//修改房间设备访问日志
+export async function UpdateRoomVisitLog(params){
+ params.token = gettoken();
+ console.log(params)
+ return await reqeust1({
+ title: "更新故障记录中",
+ url: BoonliveUrl + 'UpdateRoomVisitLog',
+ data: params || {}
+ })
+}
\ No newline at end of file
diff --git a/lib/request1.js b/lib/request1.js
index 36011f0..2fee24f 100644
--- a/lib/request1.js
+++ b/lib/request1.js
@@ -2,29 +2,34 @@
let show = 0;
export default async function reqeust(params) {
show++;
- return new Promise((resolve, reject) => {
-
+ // 判断是否需要显示loading弹窗
+ const needLoading = params.title !== undefined && params.title !== null && params.title !== '';
+
+ if (needLoading) {
wx.showLoading({
title: params.title,
- mask:true
- })
- wx.request({
+ mask: true
+ });
+ }
+
+ return new Promise((resolve, reject) => {
+ wx.request({
header: {
- contentType: 'application/x-www-form-urlencoded', // 填入服务名称
- },
+ contentType: 'application/x-www-form-urlencoded', // 填入服务名称
+ },
url: params.url,
method: params.method || 'post',
data: params.data || {},
success: res => {
- resolve(res.data)
+ resolve(res.data)
},
fail: err => {
reject(err)
},
complete:()=>{
show--;
- if(show==0){
- wx.hideLoading()
+ if (needLoading && show === 0) {
+ wx.hideLoading();
}
}
})
diff --git a/pages/NewHome/NewHome.js b/pages/NewHome/NewHome.js
index a6c3bc0..232aad4 100644
--- a/pages/NewHome/NewHome.js
+++ b/pages/NewHome/NewHome.js
@@ -25,13 +25,7 @@ Page({
name: 'HostUpgrade',
color: 'purple',
icon: 'font'
- },
- {
- title: '主机绑定 ',
- name: 'HostBinding',
- color: 'mauve',
- icon: 'icon'
- },
+ },
{
title: '人脸机绑定',
name: 'FacialDeviceBinding',
diff --git a/pages/basics/FacialDeviceBinding/FacialDeviceBinding.js b/pages/basics/FacialDeviceBinding/FacialDeviceBinding.js
new file mode 100644
index 0000000..24c0a37
--- /dev/null
+++ b/pages/basics/FacialDeviceBinding/FacialDeviceBinding.js
@@ -0,0 +1,629 @@
+// pages/FacialDeviceBinding/FacialDeviceBinding.js
+// 人脸设备绑定页面逻辑
+const app = getApp()
+// 导入请求中心
+import {
+ GetHostsInfo,
+ GetFaceSN,
+ GetFaceCode,
+ CheckFaceSNAutho,
+ CheckFaceSN,
+ OpenDoorTest
+ } from '../../../lib/RequestingCenter';
+
+Page({
+ data: {
+ autho:null,
+ RoomIndex: 0, // 当前选中房间索引
+ Hotelinfo: null, // 酒店信息
+ HostsData: null, // 原始设备数据
+ HostsDataFilters: [], // 过滤后的设备数据
+ onlineFaceDevices: 0, // 在线人脸设备数量
+ inputValue: "", // 搜索输入值
+ scrollHeight: 0, // 滚动区域高度
+ toView: '', // 滚动位置
+ modal: '', // 弹窗状态
+ selHosts: null, // 当前选中的房间
+ faceSNCode: '', // 人脸设备SN输入
+ bdHosts: [], // 已绑定的主机列表
+ Help: false, // 帮助状态
+ islogs: false, // 操作记录状态
+ showinfo: 0, // 显示信息类型
+ faceAddress: '', // 人脸设备地址
+ input: 0, // 输入类型
+ ISLoopDebugging: 0, // 回路调试状态
+ message: [], // 弹窗信息
+ },
+
+
+ /**
+ * 页面的初始数据
+ */
+
+ onLoad:async function(options) {
+
+ if (!options.HotelId || app.globalData.autho == null) {
+ app.toast(2, "无酒店信息~")
+ return;
+ }
+
+ this.setData({
+ autho: app.globalData.autho ,
+ HotelId:options.HotelId
+ })
+ try {
+ this.data.autho.forEach((element, index) => {
+ element.Hotels.forEach((elements, indexs) => {
+ if (elements.HotelId == options.HotelId) {
+ this.setData({
+ Hotelinfo: elements
+ })
+ throw new Error();
+ }
+ })
+ });
+ } catch (error) {
+ console.log("已经找到,无需循环~")
+ }
+ // 计算滚动区域高度
+ this.calcScrollHeight();
+ // 获取人脸设备数据
+ this.GetHostsInfo();
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow: function () {
+ // 页面显示时重新获取数据
+ this.GetHostsInfo();
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide: function () {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload: function () {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh: function () {
+ this.GetHostsInfo();
+ wx.stopPullDownRefresh();
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom: function () {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage: function () {
+
+ },
+
+ // 返回上一页
+ back: function () {
+ wx.navigateBack({
+ delta: 1
+ });
+ },
+
+ // 计算滚动区域高度
+ calcScrollHeight: function () {
+
+// 1. 拿到屏幕可用高度(px)
+const sys = wx.getSystemInfoSync();
+const screenHeight = sys.windowHeight; // px
+
+// 2. 拿到 scroll-view 的 top(px)
+wx.createSelectorQuery()
+ .in(this)
+ .select('#myScroll')
+ .boundingClientRect(rect => {
+ if (rect) {
+ const topPx = rect.top; // px
+ const bottomPx = 10 / 2; // 10rpx → 5px(2倍屏)
+ const heightPx = screenHeight - topPx - bottomPx;
+
+ // 3. 转 rpx 并写入
+ this.setData({
+ scrollHeight: heightPx * 2 // px→rpx
+ });
+ }
+ })
+ .exec();
+
+
+
+ },
+
+ // 获取人脸设备数据
+ GetHostsInfo: function () {
+ const that = this;
+ // 显示加载提示
+ wx.showLoading({
+ title: '加载中...',
+ });
+
+ // 调用获取主机信息接口
+ GetHostsInfo({
+ HotelID: that.data.HotelId
+ }).then(res => {
+ // 隐藏加载提示
+ wx.hideLoading();
+
+ if (res.Status == 200) {
+ // 处理数据
+ const HostsData = res.Data;
+ const HostsDataFilters = HostsData;
+
+ // 统计在线人脸设备数量
+ let onlineFaceDevices = 0;
+ for (let i = 0; i < HostsDataFilters.length; i++) {
+ if (HostsDataFilters[i].FaceStatus) {
+ onlineFaceDevices++;
+ }
+ }
+
+ // 更新数据
+ that.setData({
+ HostsData: HostsData,
+ HostsDataFilters: HostsDataFilters,
+ onlineFaceDevices: onlineFaceDevices,
+ RoomIndex: 0
+ });
+
+ // 获取位置信息
+ that.GetLOC();
+ } else {
+ wx.showToast({
+ title: '获取数据失败',
+ icon: 'none'
+ });
+ }
+ }).catch(err => {
+ wx.hideLoading();
+ wx.showToast({
+ title: '网络异常',
+ icon: 'none'
+ });
+ console.error('获取主机信息失败:', err);
+ });
+ },
+
+ // 获取位置信息
+ GetLOC: function () {
+ const that = this;
+ // 调用微信获取位置接口
+ wx.getFuzzyLocation({
+ type: 'wgs84',
+ success(res) {
+ const latitude = res.latitude;
+ const longitude = res.longitude;
+ const address = `${latitude},${longitude}`;
+ that.setData({
+ faceAddress: address
+ });
+ },
+ fail(err) {
+ console.error('获取位置信息失败:', err);
+ // 位置信息获取失败不影响主流程
+ }
+ });
+ },
+
+ // 搜索输入
+ inputSearchForHotels: function (e) {
+ this.setData({
+ inputValue: e.detail.value
+ });
+ },
+
+ // 搜索房间
+ SearchForHotels: function () {
+ const that = this;
+ const inputValue = that.data.inputValue;
+ const HostsData = that.data.HostsData;
+
+ if (inputValue === '') {
+ // 搜索条件为空,显示所有数据
+ that.setData({
+ HostsDataFilters: HostsData
+ });
+ return;
+ }
+
+ // 根据房号搜索
+ const filters = HostsData.filter(item => {
+ return item.RoomNumber.indexOf(inputValue) !== -1;
+ });
+
+ that.setData({
+ HostsDataFilters: filters
+ });
+ },
+
+ // 刷新房间数据
+ RefreshTheRoom: function () {
+ this.GetHostsInfo();
+ },
+
+ // 跳转到人脸设备详情或直接扫码绑定
+ goFaceDetail: function (e) {
+ const index = e.currentTarget.id.split('-')[1];
+ const HostsDataFilters = this.data.HostsDataFilters;
+ const selHosts = HostsDataFilters[index];
+ selHosts.index = index;
+
+ this.setData({
+ RoomIndex: index,
+ selHosts: selHosts
+ });
+
+ // 判断条件:离线且未绑定
+ if (!selHosts.FaceStatus && (!selHosts.FaceSN || selHosts.FaceSN === '')) {
+
+ // 直接调用摄像头扫码绑定
+ this.GetFaceCode();
+ } else {
+ // 设置消息数据
+ this.setData({
+ message: [selHosts.FaceSN, selHosts.RoomNumber],
+ // 显示设备详情
+ modal: -1
+ });
+ }
+ },
+
+ // 关闭弹窗
+ GetHide: function () {
+ this.setData({
+ modal: ''
+ });
+ },
+
+ // 反馈错误
+ ErrorInfo: function () {
+ wx.showToast({
+ title: '反馈功能开发中',
+ icon: 'none'
+ });
+ },
+
+ // 人脸设备解绑
+ JbSn: function (params) {
+ let jbjd = null;
+ let faceSN = null;
+ let that = this;
+ let index = -1;
+
+ // 检查是否从SN已绑定弹窗点击解绑按钮
+ if (typeof params.currentTarget.dataset['index'] != 'undefined') {
+ faceSN = this.data.faceSNCode;
+ index = params.currentTarget.dataset['index'];
+ // 解绑的房间
+ jbjd = this.data.bdHosts[index];
+ } else {
+ jbjd = this.data.selHosts;
+ faceSN = this.data.selHosts.FaceSN;
+ }
+
+ wx.showModal({
+ title: '解绑确认',
+ content: `确定要解除${jbjd.RoomNumber}房间的人脸设备绑定吗?`,
+ success(res) {
+ if (res.confirm) {
+ // 调用解绑接口
+ GetFaceSN({
+ faceSN: faceSN,
+ roomID: jbjd.Id,
+ roomNumber: jbjd.RoomNumber,
+ faceAddress: that.data.faceAddress,
+ HotelID: jbjd.HotelID,
+ isjb: true
+ }).then(res => {
+ if (res.Status == 200) {
+ wx.showToast({
+ title: '解绑成功',
+ icon: 'success'
+ });
+
+ // 如果是从SN已绑定弹窗解绑,需要更新bdHosts数据
+ if (index > -1) {
+ let databdHosts = that.data.bdHosts;
+ databdHosts.splice(index, 1);
+ that.setData({
+ bdHosts: databdHosts
+ });
+
+ // 如果bdHosts为空,继续执行绑定
+ if (databdHosts.length <= 0) {
+ that.GetFaceSNend();
+ }
+ }
+
+ // 重新获取数据
+ that.GetHostsInfo();
+ // 关闭弹窗
+ that.GetHide();
+ } else {
+ wx.showToast({
+ title: '解绑失败',
+ icon: 'none'
+ });
+ }
+ }).catch(err => {
+ wx.showToast({
+ title: '网络异常',
+ icon: 'none'
+ });
+ console.error('解绑失败:', err);
+ });
+ }
+ }
+ });
+ },
+
+ // 扫码绑定人脸设备
+ GetFaceCode: function () {
+ const that = this;
+
+ // 检查权限
+ if (!that.CheckFaceSNAutho()) {
+ wx.showToast({
+ title: '您没有权限绑定人脸设备',
+ icon: 'none'
+ });
+ return;
+ }
+
+ // 调用微信扫码接口
+ wx.scanCode({
+ success: (res) => {
+ const code = res.result;
+ that.setData({
+ faceSNCode: code
+ });
+ debugger
+ that.GetFaceSNOK();
+ },
+ fail: (err) => {
+ console.error('扫码失败:', err);
+ wx.showToast({
+ title: '扫码失败',
+ icon: 'none'
+ });
+ }
+ });
+ },
+
+ // 手动输入人脸设备SN
+ ShowInputsn: function () {
+ // 检查权限
+ if (!this.CheckFaceSNAutho()) {
+ wx.showToast({
+ title: '您没有权限绑定人脸设备',
+ icon: 'none'
+ });
+ return;
+ }
+
+ this.setData({
+ modal: 'showBindConfirm'
+ });
+ },
+
+
+ GetFaceSNOK:function(){
+ let that = this;
+ if (!this.CheckFaceMAC(that.data.faceSNCode)) {
+ this.setData({
+ modal: 520
+ })
+ return;
+ };
+ if (that.data.selHosts.FaceSN == that.data.faceSNCode) {
+ app.toast(2, "条码一致,无需更改~")
+ return;
+ }
+ this.CheckFaceMACWL()
+ },
+ CheckFaceMACWL(){
+ let that = this;
+ CheckFaceSN({faceSN:this.data.faceSNCode}).then(
+ res => {
+ if (res.Status == 200) {
+ if(res.Data<=0){
+ that.setData({
+ modal:-521,
+ })
+ }else{
+ let remove = [];
+ let bdHosts = res.Data;
+ try {
+ //记录已经分配酒店但是未分配房间 且酒店是当前酒店 那就判断为没有绑定
+ that.data.autho.forEach((element, index) => {
+ element.Hotels.forEach((elements, indexs) => {
+ for (let index = 0; index < bdHosts.length; index++) {
+ if (elements.HotelId == bdHosts[index].HotelID) {
+ if(bdHosts[index].HotelID == that.data.Hotelinfo.HotelId && bdHosts[index].Id==0){
+ remove.push(index);
+ }
+ elements.Auth.forEach (Auth=>{
+ if(Auth.AuthorityId == 21 && Auth.AuthotypeId == 3){
+ //有权限
+ bdHosts[index].qx = 0;
+ }
+ })
+ }
+ }
+ })
+ });
+ } catch (error) {
+ console.log(error)
+ }
+ remove.forEach (x=>{
+ bdHosts.splice(x, 1);
+ })
+ let modalval = -200;
+ if(bdHosts.length<=0){
+ modalval = -521;
+ }
+ that.setData({
+ modal:modalval,
+ bdHosts:bdHosts
+ })
+ // app.toast(2, "已经被绑定")
+ }
+ }else{
+ app.toast(2, "网络繁忙")
+ }
+ },
+ err => {
+ console.log(err)
+ app.toast(2, "网络繁忙")
+ }).catch(err => {
+ console.log(err)
+ app.toast(2, "网络繁忙")
+ });
+ },
+ CheckFaceMAC:function(vlues){
+ return true;
+ console.log(vlues.length != 16)
+ return vlues.length == 16;
+ },
+ // 完成人脸设备绑定
+ GetFaceSNend: function () {
+ const that = this;
+ const selHosts = that.data.selHosts;
+ const faceSNCode = that.data.faceSNCode;
+
+ // 显示加载提示
+ wx.showLoading({
+ title: '绑定中...',
+ });
+
+ // 调用绑定接口
+ GetFaceSN({
+ faceSN: faceSNCode,
+ roomID: selHosts.Id,
+ roomNumber: selHosts.RoomNumber,
+ faceAddress: that.data.faceAddress,
+ HotelID: selHosts.HotelID,
+ isjb: false
+ }).then(res => {
+ // 隐藏加载提示
+ wx.hideLoading();
+
+ if (res.Status == 200) {
+ wx.showToast({
+ title: '绑定成功',
+ icon: 'success'
+ });
+ // 重新获取数据
+ that.GetHostsInfo();
+ // 关闭弹窗
+ that.GetHide();
+ } else if (res.Status == 400) {
+ // 设备已被绑定
+ that.setData({
+ bdHosts: res.Data,
+ code: faceSNCode,
+ modal: -200
+ });
+ } else {
+ wx.showToast({
+ title: '绑定失败',
+ icon: 'none'
+ });
+ }
+ }).catch(err => {
+ // 隐藏加载提示
+ wx.hideLoading();
+
+ wx.showToast({
+ title: '网络异常',
+ icon: 'none'
+ });
+ console.error('绑定失败:', err);
+ });
+ },
+
+ // 检查人脸设备绑定权限
+ CheckFaceSNAutho: function () {
+ let res = false;
+ this.data.Hotelinfo.Auth.forEach(x => {
+ if (x.AuthorityId == 21 && x.AuthotypeId == 3) {
+ res = true;
+ }
+ });
+ return res;
+ },
+
+ // 设置操作
+ testinfo: function (e) {
+ var jbjd = this.data.selHosts;
+ wx.navigateTo({
+ url: '/pages/test/test?Hotelinfo=' + e.currentTarget.id + '&RoomID=' + jbjd.Id + '&faceadd=' + this.data.faceAddress
+ });
+ },
+
+ // 开门操作
+ OpenDoor: function (e) {
+ const sn = e.currentTarget.id.split('_');
+ OpenDoorTest({faceSN:sn[2],isjb:true}).then(
+ res=>{
+ if (res.Status == 200) {
+ wx.showToast({
+ title: res.Message,
+ icon: 'none'
+ })
+ }else{
+ wx.showToast({
+ title: res.Message,
+ icon: 'none'
+ })
+ }
+ },rej=>{
+ wx.showToast({
+ title: "网络繁忙",
+ icon: 'none'
+ })
+ }
+ );
+ },
+
+ // 切换显示信息
+ GetshowinfoClick: function (e) {
+ const index = e.currentTarget.dataset.index;
+ this.setData({
+ showinfo: index
+ });
+ },
+
+ // 切换显示信息(刷新)
+ GetshowinfoClick1: function () {
+ this.GetHostsInfo();
+ },
+})
\ No newline at end of file
diff --git a/pages/basics/FacialDeviceBinding/FacialDeviceBinding.json b/pages/basics/FacialDeviceBinding/FacialDeviceBinding.json
new file mode 100644
index 0000000..75a629e
--- /dev/null
+++ b/pages/basics/FacialDeviceBinding/FacialDeviceBinding.json
@@ -0,0 +1,6 @@
+{
+ "navigationBarTitleText": "人脸设备绑定",
+ "usingComponents": {
+ "cu-custom": "/colorui/components/cu-custom"
+ }
+}
\ No newline at end of file
diff --git a/pages/basics/FacialDeviceBinding/FacialDeviceBinding.wxml b/pages/basics/FacialDeviceBinding/FacialDeviceBinding.wxml
new file mode 100644
index 0000000..f836003
--- /dev/null
+++ b/pages/basics/FacialDeviceBinding/FacialDeviceBinding.wxml
@@ -0,0 +1,144 @@
+
+ 返回
+ {{Hotelinfo.HotelName}}({{Hotelinfo.Code}})
+
+
+
+
+
+房号:{{HostsDataFilters[RoomIndex].RoomNumber}}
+
+
+ 人脸设备在线:
+ {{onlineFaceDevices}}/
+ {{HostsDataFilters.length}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.RoomNumber}}
+ {{item.FaceSN || '未绑定'}}
+
+
+
+
+
+
+
+
+
+ {{selHosts.RoomNumber}}已经绑定人脸机
+
+
+
+
+
+
+ 酒店:{{Hotelinfo.HotelName}}
+ 房间:{{message[1]}}
+ 人脸机SN:{{message[0]}}
+ 房间已经绑定人脸机,点击继续将执行扫描绑定;点击取消,将不会执行任何操作~
+
+
+
+
+
+
+ 设置
+ 开门
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 绑定人脸设备
+
+
+
+
+
+ 酒店:{{Hotelinfo.HotelName}}
+ 房间:{{selHosts.RoomNumber}}
+ 人脸设备SN:
+
+
+
+ 确定为该房间绑定人脸设备SN,点击继续将执行绑定操作;点击取消,将不会执行任何操作~
+
+
+ 取消
+ 继续
+
+
+
+
+
+
+
+
+ {{code}}已经被绑定
+
+
+
+
+
+
+
+
+
+酒店:{{item.HotelName}}
+房间:{{item.RoomNumber}}
+
+
+
+
+
+
+
+ SN:{{faceSNCode}}
+ SN已经被其他房间绑定,点击解绑将取消原有绑定,执行新的绑定;点击取消,将不会执行任何操作~
+
+
+
+ 取消
+
+ 继续
+
+
+
+
+
+
diff --git a/pages/basics/FacialDeviceBinding/FacialDeviceBinding.wxss b/pages/basics/FacialDeviceBinding/FacialDeviceBinding.wxss
new file mode 100644
index 0000000..33628d0
--- /dev/null
+++ b/pages/basics/FacialDeviceBinding/FacialDeviceBinding.wxss
@@ -0,0 +1,364 @@
+/* pages/FacialDeviceBinding/FacialDeviceBinding.wxss */
+/* 人脸设备绑定页面样式 */
+
+/* 滚动区域样式 */
+#scroll {
+ height: 100%;
+}
+
+/* 房间列表样式 */
+.nav-list1 {
+ display: flex;
+ flex-wrap: wrap;
+ padding: 0 10rpx;
+}
+
+/* 房间项样式 */
+.nav-li4 {
+ width: 31.33%;
+ margin: 1%;
+ padding: 15rpx;
+ border-radius: 8rpx;
+ text-align: center;
+ box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
+ transition: all 0.3s;
+}
+
+.nav-li4:active {
+ transform: scale(0.95);
+}
+
+/* 在线状态样式 */
+.bg-green {
+ background-color: #4CD964;
+ color: white;
+}
+
+/* 青色在线状态样式 */
+.bg-cyan {
+ background-color: #00BCD4;
+ color: white;
+}
+
+/* 离线状态样式 */
+.bg-gray {
+ background-color: #E5E5EA;
+ color: #8E8E93;
+}
+
+/* 搜索框样式 */
+.cu-btn1 {
+ position: relative;
+ border: 0rpx;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ box-sizing: border-box;
+ padding: 0 5rpx;
+ font-size: 26rpx;
+ height: 64rpx;
+ line-height: 1;
+ text-align: center;
+ text-decoration: none;
+ overflow: visible;
+ margin-left: initial;
+ transform: translate(0rpx, 0rpx);
+ margin-right: initial;
+}
+
+/* 按钮样式 */
+.margin-left {
+ margin-left: 10rpx;
+}
+
+/* 顶部操作栏样式 */
+.cu-bar1 {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+/* 弹性换行样式 */
+.flex-wrap {
+ display: flex;
+}
+
+/* 固体样式 */
+.solids {
+ display: block;
+}
+
+/* 顶部信息栏样式 */
+.text-xl {
+ font-size: 36rpx;
+ font-weight: bold;
+}
+
+.text-blue {
+ color: #007AFF;
+}
+
+.text-black {
+ color: #000000;
+}
+
+/* 弹窗样式 */
+.cu-modal {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: rgba(0, 0, 0, 0.5);
+ z-index: 999;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ opacity: 0;
+ transition: opacity 0.3s;
+}
+
+.cu-modal.show {
+ opacity: 1;
+}
+
+.cu-dialog {
+ background: white;
+ border-radius: 10rpx;
+ width: 80%;
+ max-width: 500rpx;
+ overflow: hidden;
+ transform: scale(0.8);
+ transition: transform 0.3s;
+}
+
+.cu-modal.show .cu-dialog {
+ transform: scale(1);
+}
+
+.cu-bar {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 20rpx;
+ border-bottom: 1px solid #E5E5EA;
+}
+
+.cu-bar .content {
+ font-size: 36rpx;
+ font-weight: bold;
+}
+.cu-bar.bg-gradual-blue .action {
+ color: white;
+}
+.cu-bar.bg-gradual-blue .action text {
+ color: white;
+}
+.cu-bar .action {
+ color: #007AFF;
+ font-size: 32rpx;
+}
+
+/* 内容区样式 */
+.padding-lg {
+ padding: 30rpx;
+}
+
+.flex {
+ display: flex;
+}
+
+.flex-wrap {
+ flex-wrap: wrap;
+}
+
+.basis-sm {
+ width: 30%;
+ text-align: right;
+ padding-right: 20rpx;
+}
+
+.basis-lg {
+ width: 70%;
+ text-align: left;
+}
+
+.text-red {
+ color: #FF3B30;
+}
+
+.text-green {
+ color: #4CD964;
+}
+
+/* 输入框样式 */
+input {
+ border: 1px solid #E5E5EA;
+ border-radius: 5rpx;
+ padding: 15rpx;
+ width: 100%;
+ font-size: 32rpx;
+ box-sizing: border-box;
+}
+
+/* 底部按钮栏样式 */
+.cu-bar.bg-white {
+ border-top: 1px solid #E5E5EA;
+ border-bottom: none;
+}
+
+.cu-bar .action {
+ padding: 10rpx 20rpx;
+}
+
+.solid-left {
+ border-left: 1px solid #E5E5EA;
+}
+
+/* 酒店信息样式 */
+.text-df {
+ font-size: 28rpx;
+}
+
+/* 设备信息样式 */
+.text-sm {
+ font-size: 24rpx;
+}
+
+/* 分隔线样式 */
+.ControlLine {
+ height: 2rpx;
+ background-color: #E5E5EA;
+ margin: 20rpx 0;
+}
+
+/* 轻量级文本样式 */
+.light {
+ opacity: 0.7;
+}
+
+/* 禁用状态样式 */
+button:disabled {
+ opacity: 0.5;
+}
+
+/* 加载提示样式 */
+.loading {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ padding: 50rpx;
+}
+
+.loading text {
+ margin-left: 10rpx;
+ font-size: 32rpx;
+ color: #8E8E93;
+}
+
+/* 空数据提示样式 */
+.empty {
+ text-align: center;
+ padding: 100rpx;
+ color: #8E8E93;
+ font-size: 32rpx;
+}
+
+/* 帮助区域样式 */
+.cu-card {
+ margin: 20rpx;
+ background: white;
+ border-radius: 10rpx;
+ box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
+}
+
+.cu-item {
+ padding: 30rpx;
+}
+
+.title {
+ font-size: 36rpx;
+ font-weight: bold;
+ margin-bottom: 20rpx;
+}
+
+.content {
+ font-size: 32rpx;
+ line-height: 1.6;
+}
+
+.desc {
+ margin-bottom: 20rpx;
+}
+
+.text-content {
+ font-size: 30rpx;
+ line-height: 1.8;
+}
+
+/* 酒店信息样式 */
+.hotel-info {
+ padding: 20rpx;
+ background: white;
+ border-bottom: 1px solid #E5E5EA;
+}
+
+.hotel-name {
+ font-size: 36rpx;
+ font-weight: bold;
+ color: #000000;
+}
+
+.hotel-code {
+ font-size: 30rpx;
+ color: #8E8E93;
+ margin-top: 10rpx;
+}
+
+/* 状态统计样式 */
+.status-stats {
+ display: flex;
+ justify-content: space-around;
+ padding: 20rpx;
+ background: white;
+ border-bottom: 1px solid #E5E5EA;
+}
+
+.stat-item {
+ text-align: center;
+}
+
+.stat-label {
+ font-size: 30rpx;
+ color: #8E8E93;
+}
+
+.stat-value {
+ font-size: 40rpx;
+ font-weight: bold;
+ color: #007AFF;
+}
+
+/* 操作按钮样式 */
+.operation-buttons {
+ display: flex;
+ justify-content: space-around;
+ padding: 20rpx;
+ background: white;
+ border-bottom: 1px solid #E5E5EA;
+}
+
+.operation-button {
+ flex: 1;
+ margin: 0 10rpx;
+ padding: 20rpx;
+ background: #007AFF;
+ color: white;
+ border-radius: 50rpx;
+ text-align: center;
+ font-size: 32rpx;
+}
+
+.operation-button:active {
+ opacity: 0.8;
+}
\ No newline at end of file
diff --git a/pages/basics/HostUpgrade/EquipmentCaontrol/EquipmentCaontrol.wxml b/pages/basics/HostUpgrade/EquipmentCaontrol/EquipmentCaontrol.wxml
index ad0291f..7567b3b 100644
--- a/pages/basics/HostUpgrade/EquipmentCaontrol/EquipmentCaontrol.wxml
+++ b/pages/basics/HostUpgrade/EquipmentCaontrol/EquipmentCaontrol.wxml
@@ -88,8 +88,7 @@
-
-
+
diff --git a/pages/basics/MakingRounds/MakingRounds.js b/pages/basics/MakingRounds/MakingRounds.js
index 2c57958..a975c1f 100644
--- a/pages/basics/MakingRounds/MakingRounds.js
+++ b/pages/basics/MakingRounds/MakingRounds.js
@@ -16,6 +16,7 @@ import {
SetRCULight,
SetRCUAir,
SetRCUCurtain,
+ GetRoomAddressStatus
} from '../../../lib/RequestingCenter.js'
Page({
@@ -79,7 +80,8 @@ Page({
onlineNumber=onlineNumber+1
}
}
-
+
+ app.globalData.CreatDate =res.Data[0].CreateTime
that.setData({
onlineNumber:onlineNumber,
HostsData: res.Data,
@@ -103,9 +105,6 @@ Page({
app.toast(2, "网络繁忙")
});
-
-
-
},
/**
@@ -194,11 +193,19 @@ Page({
})
},
goProcess(e) {
+ let indexstr = e.currentTarget.id.replace("msg-","")
+ let index= Number(indexstr)
const { room, hotel, status } = e.currentTarget.dataset;
-
+ this.setData({
+ RoomIndex:index
+ } )
+ //debugger
+ let HostsDataFilters= this.data.HostsDataFilters
+ console.log(HostsDataFilters[index].RoomNumber)
+ let RoomTypeID=HostsDataFilters[index].RoomTypeID
if (status !== 1) return; // 不为1时不跳转
wx.navigateTo({
- url: `/pages/basics/MakingRounds/process/process?RoomNumber=${room}&HotelName=${hotel}&HotelId=${this.data.Hotelinfo.HotelId }`
+ url: `/pages/basics/MakingRounds/process/process?RoomNumber=${room}&RoomTypeID=${RoomTypeID}&HotelName=${hotel}&HotelId=${this.data.Hotelinfo.HotelId }`
});
},
RefreshTheRoom:async function(e){
@@ -209,14 +216,17 @@ Page({
if (res.Status == 200) {
let onlineNumber=0
+
for (let index = 0; index < res.Data.length; index++) {
const element = res.Data[index];
if (element.Status===1) {
+
onlineNumber=onlineNumber+1
}
}
-
+
that.setData({
+ RoomIndex:RoomIndex,
onlineNumber:onlineNumber,
HostsData: res.Data,
HostsDataFilters: res.Data,
diff --git a/pages/basics/MakingRounds/process/process.js b/pages/basics/MakingRounds/process/process.js
index c8be377..ddb6da5 100644
--- a/pages/basics/MakingRounds/process/process.js
+++ b/pages/basics/MakingRounds/process/process.js
@@ -1,4 +1,10 @@
-// pages/basics/MakingRounds/process/process.js
+const app = getApp()
+import {
+ GetRoomAddressStatus,
+ QueryDeviceList,
+ WriteRoomVisitLog,
+ SetRCUService
+} from '../../../../lib/RequestingCenter.js'
Page({
/**
@@ -7,23 +13,7 @@ Page({
data: {
RoomNumber:"",
HotelName:"",
- deviceList:[
- {id:1, name:'取电面板通讯', status:'在线',note:'在线',isnote:"0"},
- {id:2, name:'温控面板通讯', status:'在线',note:'在线',isnote:0},
- {id:3, name:'红外转发通讯', status:'离线',note:'在线',isnote:0},
- {id:4, name:'485窗帘电机通讯',status:'在线',note:'在线',isnote:0},
- {id:5, name:'门口传感器测试', status:'显示',note:'在线',isnote:0},
- {id:6, name:'卫生间传感器测试',status:'显示',note:'在线',isnote:0},
- {id:7, name:'淋浴间传感器测试',status:'不显示',note:'在线',isnote:0},
- {id:8, name:'床尾传感器测试', status:'不显示',note:'在线',isnote:0},
- {id:9, name:'镜前传感器测试', status:'不显示',note:'在线',isnote:0},
- {id:10,name:'休闲区传感器测试',status:'不显示',note:'在线',isnote:0},
- {id:11,name:'客厅传感器测试', status:'不显示',note:'在线',isnote:0},
- {id:12,name:'厅卫传感器测试', status:'不显示',note:'在线',isnote:0},
- {id:13,name:'浴缸传感器测试', status:'不显示',note:'在线',isnote:0},
- {id:14,name:'门磁测试', status:'不显示',note:'在线',isnote:0},
- {id:15,name:'干接点窗帘测试', status:'正常',note:'在线',isnote:0} // 最后一条你自行改状态
- ],
+ deviceList:[],
deviceListindex:0,
inputValue:"",
toView:"",
@@ -32,15 +22,22 @@ Page({
note:"",
noteok:"",
errorsNumber:0,
- HotelId:""
+ HotelId:"",
+ RoomTypeID:"",
+ showErrorReasonInput: false, // 控制异常原因输入框显示/隐藏
+ errorReason: "", // 异常原因内容
},
+
+ // 定时器ID
+ timer5s: null,
+ timer1min: null,
/**
* 生命周期函数--监听页面加载
*/
- onLoad(options) {
+ onLoad:async function(options) {
- if (!options.RoomNumber || !options.HotelName ||!options.HotelId) {
+ if (!options.RoomNumber || !options.HotelName ||!options.HotelId ||!options.RoomTypeID) {
app.toast(2, "无酒店信息~")
return;
}
@@ -48,15 +45,95 @@ Page({
this.setData ({
RoomNumber:options.RoomNumber,
HotelName:options.HotelName,
- HotelId:options.HotelId
+ HotelId:options.HotelId,
+ RoomTypeID:options.RoomTypeID
})
+ console.log(app.globalData.HotelCode)
+
+ // let HotelId =parseInt(app.globalData.HotelCode);
+ // await GetRoomAddressStatus({
+ // Code: HotelId,
+ // RoomNum:options.RoomNumber
+ // }).then(res => {
+
+ // if (res.Status == 200) {
+
+
+
+ // } else {
+ // app.toast(2, res.Message || "网络繁忙")
+ // }
+ // }, err => {
+ // console.log(err)
+ // app.toast(2, "网络繁忙")
+ // }).catch(err => {
+ // console.log(err)
+ // app.toast(2, "网络繁忙")
+ // });
+
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
- onReady() {
+ onReady:async function() {
+ //debugger
this.calcScrollHeight();
+
+ // 页面加载完毕时调用QueryDeviceList获取设备列表
+ await this.getDeviceList();
+ },
+
+ /**
+ * 获取设备列表
+ */
+ getDeviceList:async function() {
+ try {
+ const res = await QueryDeviceList({
+ HotelID: app.globalData.HotelCode,
+ RoomTypeID: this.data.RoomTypeID
+ });
+
+ if (res.Status == 1) {
+ console.log('设备列表获取成功:', res.Data);
+ // 更新设备列表数据
+ let deviceList = [];
+ for (let index = 0; index < res.Data.length; index++) {
+ const element = res.Data[index];
+ // 检查是否已存在相同名称的设备
+ const isExist = deviceList.some(item => item.name === element.DevName);
+ if (!isExist) {
+ deviceList.push({
+ id: deviceList.length + 1,
+ name: element.DevName,
+ status: "在线",
+ note: element.Process,
+ isnote: 0,
+ Addrlist: [element.DevAddr]
+ });
+ } else {
+ // 如果设备已存在,将新地址添加到Addrlist中
+ const existingDevice = deviceList.find(item => item.name === element.DevName);
+ if (existingDevice) {
+ // 检查Addrlist中是否已存在该地址,避免重复添加
+ if (!existingDevice.Addrlist.includes(element.DevAddr)) {
+ existingDevice.Addrlist.push(element.DevAddr);
+ }
+ }
+ }
+ }
+ this.setData({
+ deviceList: deviceList
+ });
+
+ } else {
+ console.log('设备列表获取失败:', res.Message);
+ app.toast(2, res.Message || "获取设备列表失败");
+ }
+ } catch (error) {
+ console.log('获取设备列表出错:', error);
+ app.toast(2, "获取设备列表失败");
+ }
},
calcScrollHeight() {
// 1. 拿到屏幕可用高度(px)
@@ -66,7 +143,7 @@ Page({
// 2. 拿到 scroll-view 的 top(px)
wx.createSelectorQuery()
.in(this)
- .select('#myScroll')
+ .select('#NmyScroll')
.boundingClientRect(rect => {
if (rect) {
const topPx = rect.top; // px
@@ -85,21 +162,172 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow() {
-
+ // 启动定时器
+ this.startTimers();
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
-
+ // 停止定时器
+ this.stopTimers();
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
+ // 停止定时器
+ this.stopTimers();
+ },
+ /**
+ * 启动定时器
+ */
+ startTimers() {
+ // 先调用一次SetRCUService
+ this.callSetRCUService();
+ // 再调用一次GetRoomAddressStatus
+ this.callGetRoomAddressStatus();
+
+ // 设置5秒定时器,查询设备离在线状态
+ this.timer5s = setInterval(() => {
+ this.callGetRoomAddressStatus();
+ }, 5000);
+
+ // 设置1分钟定时器,启动设备巡检
+ this.timer1min = setInterval(() => {
+ this.callSetRCUService();
+ }, 60000);
+ },
+
+ /**
+ * 停止定时器
+ */
+ stopTimers() {
+ if (this.timer5s) {
+ clearInterval(this.timer5s);
+ this.timer5s = null;
+ }
+ if (this.timer1min) {
+ clearInterval(this.timer1min);
+ this.timer1min = null;
+ }
+ },
+
+ /**
+ * 调用SetRCUService接口
+ */
+ async callSetRCUService() {
+ // 解析.NET风格的日期格式 "/Date(1473004800000)/"
+ let dotNetDate = app.globalData.CreatDate
+ let timestamp, pageCreateTime
+ try {
+ timestamp = parseInt(dotNetDate.match(/\d+/)[0])
+ pageCreateTime = new Date(timestamp)
+ } catch (error) {
+ console.error('日期解析错误:', error)
+ // 如果解析失败,使用当前日期作为备选
+ pageCreateTime = new Date()
+ }
+ let year = pageCreateTime.getFullYear()
+ let month = (pageCreateTime.getMonth() + 1).toString().padStart(2, '0')
+ let day = pageCreateTime.getDate().toString().padStart(2, '0')
+ let CreateTime = `${year}-${month}-${day}`
+
+ try {
+
+ const params = {
+ code: app.globalData.HotelCode,
+ creatDate:CreateTime,
+ roomNumber: this.data.RoomNumber,
+ modalAddress:"004000029",
+ status: "1"
+ };
+ const res = await SetRCUService(params);
+ console.log('SetRCUService调用成功:', res);
+ } catch (error) {
+ console.error('SetRCUService调用失败:', error);
+ }
+ },
+
+ /**
+ * 调用GetRoomAddressStatus接口
+ */
+ async callGetRoomAddressStatus() {
+ //debugger
+ try {
+ const params = {
+ Code: parseInt(app.globalData.HotelCode),
+ RoomNum: this.data.RoomNumber
+ };
+ const res = await GetRoomAddressStatus(params);
+ //console.log('GetRoomAddressStatus调用成功:', res);
+
+ // 更新设备状态
+ if (res.Status === 1 && res.Data) {
+ this.updateDeviceStatus(res.Data);
+ }
+ } catch (error) {
+ console.error('GetRoomAddressStatus调用失败:', error);
+ }
+ },
+
+ /**
+ * 更新设备状态
+ */
+ updateDeviceStatus(data) {
+ let deviceList = this.data.deviceList;
+
+ // 检测data和deviceList是否有数据,若无数据则退出函数
+ if (!data || !deviceList || deviceList.length === 0) return;
+
+ // 先将所有设备标记为在线
+ deviceList = deviceList.map(device => ({
+ ...device,
+ status: '在线'
+ }));
+
+ // 遍历设备异常数据集合data
+ for (const exceptionAddr in data) {
+ if (data.hasOwnProperty(exceptionAddr)) {
+ // 取异常地址的前6个字符
+ const exceptionAddrPrefix = exceptionAddr.toString().substring(0, 6);
+
+ // 遍历设备列表
+ for (let index = 0; index < deviceList.length; index++) {
+ const device = deviceList[index];
+ let isMatched = false;
+
+ // 遍历设备的地址集合
+ for (let addrIndex = 0; addrIndex < device.Addrlist.length; addrIndex++) {
+ const deviceAddr = device.Addrlist[addrIndex];
+ // 取设备地址的前6个字符
+ const deviceAddrPrefix = deviceAddr.toString().substring(0, 6);
+
+ // 比较地址前缀
+ if (deviceAddrPrefix === exceptionAddrPrefix) {
+ // 地址匹配,将设备标记为离线
+ deviceList[index].status = '离线';
+ isMatched = true;
+ break; // 退出当前设备的地址循环
+ }
+ }
+
+ if (isMatched) {
+ continue; // 匹配成功,遍历下一个设备
+ }
+ }
+ }
+ }
+
+ // 更新设备列表
+ this.setData({
+ deviceList: deviceList
+ });
+
+ console.log('设备状态更新完成:', deviceList);
},
/**
@@ -131,29 +359,52 @@ Page({
DialogModal1(e){
let deviceList = this.data.deviceList
let deviceListindex=this.data.deviceListindex
- deviceList[deviceListindex].equipmentstatus=e.currentTarget.dataset.id
+ const status = e.currentTarget.dataset.id
- this.setData({
- modalName: null,
- deviceList:deviceList
- })
- console.log(this.data.deviceList)
- },
- DialogModal2(e){
- let deviceList = this.data.deviceList
- let deviceListindex=this.data.deviceListindex
- if (e.currentTarget.dataset.id==="hideModal_1") {
- deviceList[deviceListindex].isnote=1
- }else{
- deviceList[deviceListindex].isnote=0
+ // 如果选择异常,显示异常原因弹窗
+ if (status === 'hideModal_0') {
+ // 先设置设备状态为异常
+ deviceList[deviceListindex].equipmentstatus = status
+
+ // 重新计算异常数量
+ const errorsNumber = deviceList.filter(device => device.equipmentstatus === 'hideModal_0').length;
+
+ this.setData({
+ errorReason: deviceList[deviceListindex].errorReason || "", // 显示已有的异常原因
+ modalName: "DialogModal4",
+ deviceList: deviceList,
+ errorsNumber: errorsNumber
+ })
+ } else {
+ // 选择正常,直接保存状态并关闭弹窗
+ deviceList[deviceListindex].equipmentstatus = status
+ // 清除异常原因
+ deviceList[deviceListindex].errorReason = undefined
+
+ // 重新计算异常数量
+ const errorsNumber = deviceList.filter(device => device.equipmentstatus === 'hideModal_0').length;
+
+ this.setData({
+ modalName: null,
+ deviceList: deviceList,
+ errorsNumber: errorsNumber
+ })
}
-
-
- this.setData({
- deviceList:deviceList
+ console.log(this.data.deviceList)
+ },
+ DialogModal2(e){
+ this.setData({
+ modalName: "DialogModal3"
})
console.log(this.data.deviceList)
},
+
+ DialogModal3(e){
+ this.setData({
+ modalName:""
+ })
+ },
+
inputSearchForHotels(e){
this.setData({
note: e.detail.value
@@ -171,12 +422,106 @@ Page({
let deviceListindex=this.data.deviceListindex
let note=this.data.note
let noteok=e.currentTarget.dataset.id
- deviceList[deviceListindex].isnote= 0
if (noteok==="ok") {
deviceList[deviceListindex].note= note
}
- this.setData({
- deviceList:deviceList
+ this.setData({
+ deviceList:deviceList,
+ modalName: "DialogModal1"
})
},
+ // 处理异常原因输入
+ inputErrorReason(e){
+ this.setData({
+ errorReason: e.detail.value
+ })
+ },
+ // 确认异常原因弹窗
+ confirmErrorReasonModal(){
+ let deviceList = this.data.deviceList
+ let deviceListindex=this.data.deviceListindex
+
+ // 保存异常原因到设备节点
+ deviceList[deviceListindex].errorReason = this.data.errorReason
+
+ this.setData({
+ deviceList: deviceList,
+ modalName: null, // 退出所有弹窗
+ errorReason: ""
+ })
+
+ console.log("异常原因已保存:", deviceList[deviceListindex])
+ },
+ // 取消异常原因弹窗
+ cancelErrorReasonModal(){
+ let deviceList = this.data.deviceList
+ let deviceListindex=this.data.deviceListindex
+
+ // 如果还没有保存过异常原因,将设备状态改回未检测
+ if (!deviceList[deviceListindex].errorReason) {
+ deviceList[deviceListindex].equipmentstatus = undefined
+
+ // 重新计算异常数量
+ const errorsNumber = deviceList.filter(device => device.equipmentstatus === 'hideModal_0').length;
+
+ this.setData({
+ deviceList: deviceList,
+ errorsNumber: errorsNumber
+ })
+ }
+
+ this.setData({
+ modalName: "DialogModal1", // 返回之前的弹窗
+ errorReason: ""
+ })
+ },
+ /**
+ * 上传查房状态
+ */
+ async uploadWardRoundStatus() {
+ const deviceList = this.data.deviceList
+ // 检查所有设备是否已设置equipmentstatus状态
+ const allSet = deviceList.every(device => device.equipmentstatus !== undefined && device.equipmentstatus !== null)
+ if (!allSet) {
+ app.toast(2, "请先完成所有设备的状态检测")
+ return
+ }
+
+ try {
+ // 构造请求参数
+ const params = {
+ HotelID: this.data.HotelId,
+ RoomNumber: this.data.RoomNumber,
+ EquipmentList: deviceList.map(device => ({
+ EquipmentStatus: device.equipmentstatus === 'hideModal_1' ? '正常' : device.equipmentstatus === 'hideModal_0' ? '故障' : '',
+ FaultDescription: device.errorReason || '',
+ DevName: device.name,
+ EquipmentStatusType: device.equipmentstatus === 'hideModal_1' ? '1' : device.equipmentstatus === 'hideModal_0' ? '2' : '',
+ EquipmentOnlineStatus: device.status === '在线' ? '1' : '2'
+ }))
+ }
+
+ // 调用接口上传数据
+ const res = await WriteRoomVisitLog(params)
+
+ // 处理返回结果
+ if (res.Status === 1) {
+ app.toast(1, res.Message || "上传成功")
+ console.log("上传成功", res)
+ } else {
+ app.toast(2, res.Message || "上传失败")
+ console.log("上传失败", res)
+ }
+ } catch (error) {
+ app.toast(2, "上传失败,请检查网络连接")
+ console.error("上传出错", error)
+ }
+ },
+ /**
+ * 刷新设备列表
+ */
+ refreshDeviceList() {
+ // 调用getDeviceList函数刷新设备列表
+ this.getDeviceList()
+ },
})
\ No newline at end of file
diff --git a/pages/basics/MakingRounds/process/process.wxml b/pages/basics/MakingRounds/process/process.wxml
index 844212d..35cccd5 100644
--- a/pages/basics/MakingRounds/process/process.wxml
+++ b/pages/basics/MakingRounds/process/process.wxml
@@ -4,24 +4,24 @@
({{HotelName}})_{{RoomNumber}}
-
+
异常数量:
- 1
+ {{errorsNumber}}
/{{deviceList.length}}
- 查看查房记录
- 上传查房状态
+ 查看查房记录
+ 上传查房状态
+ 刷新设备
-
-
+
设备名称
- 状态
- 设备检测
+ 状态
+ 设备检测
-
+
@@ -29,14 +29,12 @@
{{item.name}}
-
-
- {{item.status}}
-
+
+ {{item.status}}
-
+
@@ -59,25 +57,51 @@
-
-
-
+
+
+
+
+
-
- 检测流程:
-
-
-
-
-
-
+
+
+
+
+ 修改检测流程 - {{deviceList[deviceListindex].name}}
+
+
+ 检测流程:
+
+
+
+
+
+
+
+
+
+
+
+
+ 异常原因 - {{deviceList[deviceListindex].name}}
+
+
+ 请输入异常原因:
+
+
+
+
+
+
+
+
diff --git a/pages/basics/MakingRounds/process/process.wxss b/pages/basics/MakingRounds/process/process.wxss
index d0107d4..60e75b4 100644
--- a/pages/basics/MakingRounds/process/process.wxss
+++ b/pages/basics/MakingRounds/process/process.wxss
@@ -5,9 +5,10 @@
.textbcolor{ background-color: #f0f0f0;}
.device-table{ margin: 20rpx; font-size: 28rpx; }
.th{ display: flex; border-bottom: 2rpx solid #e0e0e0; padding: 15rpx 0; }
-.th-item{ flex: 1; text-align: center; font-weight: bold; }
+.th-item{ flex: 6; text-align: center; font-weight: bold; }
.tr{ display: flex; align-items: center; padding: 15rpx 0; border-bottom: 1rpx solid #f0f0f0; }
.td{ flex: 1; text-align: center; }
+.td2{ flex: 3; text-align: center; }
.name{ text-align: left; padding-left: 10rpx; }
.status-text{ padding: 4rpx 12rpx; border-radius: 6rpx; color: #fff; font-size: 24rpx; }
.on{ background: #07c160; }
diff --git a/pages/basics/MakingRoundsAbnormal/MakingRoundsAbnormal.js b/pages/basics/MakingRoundsAbnormal/MakingRoundsAbnormal.js
index 5206720..fbd8b1f 100644
--- a/pages/basics/MakingRoundsAbnormal/MakingRoundsAbnormal.js
+++ b/pages/basics/MakingRoundsAbnormal/MakingRoundsAbnormal.js
@@ -15,7 +15,11 @@ import {
SetRCULight,
SetRCUAir,
SetRCUCurtain,
+ QueryRoomVisitLog,
+ WriteRoomVisitLog,
+ UpdateRoomVisitLog
} from '../../../lib/RequestingCenter.js'
+var util = require('../../../utils/util.js')
Page({
/**
@@ -30,6 +34,14 @@ Page({
toView:"",
RoomNumber:"",
HotelId:"",
+ // 时间范围查询相关
+ seltime:4, // 时间范围:4-全部,1-今日,2-本周,3-本月,5-指定时间
+ starttime:"", // 起始时间
+ endtime:"", // 结束时间
+ // 设备访问日志数据
+ visitLogList: [],
+ // 选中的记录ID,用于控制故障原因的显示
+ selectedId: null,
},
/**
@@ -78,14 +90,171 @@ Page({
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
+ this.calcScrollHeight();
+ },
+ calcScrollHeight() {
+ // 1. 拿到屏幕可用高度(px)
+ const sys = wx.getSystemInfoSync();
+ const screenHeight = sys.windowHeight; // px
+ // 2. 拿到 scroll-view 的 top(px)
+ wx.createSelectorQuery()
+ .in(this)
+ .select('#myScroll')
+ .boundingClientRect(rect => {
+ if (rect) {
+ const topPx = rect.top; // px
+ const bottomPx = 10 / 2; // 10rpx → 5px(2倍屏)
+ const heightPx = screenHeight - topPx - bottomPx;
+
+ // 3. 转 rpx 并写入
+ this.setData({
+ scrollHeight: heightPx * 2 // px→rpx
+ });
+ }
+ })
+ .exec();
},
/**
* 生命周期函数--监听页面显示
*/
- onShow() {
+ async onShow() {
+ await this.getRoomVisitLog();
+ },
+
+ // 获取房间设备访问日志
+ async getRoomVisitLog() {
+ // 检查是否有HotelId
+ if (!this.data.HotelId) {
+ console.error("缺少HotelId参数");
+ app.toast(2, "缺少酒店信息");
+ // 确保visitLogList始终是数组
+ this.setData({
+ visitLogList: [],
+ HostsDataFilters: []
+ });
+ return;
+ }
+
+ let params = {
+ HotelID: this.data.HotelId,
+ RoomNumber: this.data.RoomNumber, // 初始加载时不按房号筛选,获取所有异常记录
+ StartTime: this.data.starttime,
+ EndTime: this.data.endtime
+ };
+
+ console.log("请求参数:", params);
+
+ try {
+
+ let logs = []
+ const res = await QueryRoomVisitLog(params);
+ if (res && res.Status === 1) {
+ console.log(res.Data)
+ // 初始化 logs 数组
+let logs = [];
+for (let index = 0; index < res.Data.length; index++) {
+ const element = res.Data[index]; // element 是一个数组
+
+ // 查找每个字段对应的值
+ const findValue = (key) => {
+ const item = element.find(obj => obj.Key === key);
+ return item ? item.Value : null;
+ };
+
+ logs[index] = {
+ Id: findValue("ID"),
+ HotelID: findValue("HotelID"),
+ RoomNumber: findValue("RoomNumber"),
+ EquipmentStatus: findValue("EquipmentStatus"),
+ FaultDescription: findValue("FaultDescription"),
+ UpdateDate: findValue("UpdateDate"),
+ DevName: findValue("DevName"),
+ EquipmentStatusType: findValue("EquipmentStatusType"),
+ EquipmentOnlineStatus: findValue("EquipmentOnlineStatus"),
+ EquipmentOnlineStatusShow:0
+ };
+}
+
+
+ // 如果有搜索房号,将符合条件的记录放到头部
+ if (this.data.RoomNumber) {
+ logs= this.sortHotelsByFuzzyMatch(logs,this.data.RoomNumber)
+ }
+
+
+
+ this.setData({
+ visitLogList: logs, // 明确设置为数组
+ HostsDataFilters: logs // 更新异常记录数量显示
+ });
+
+ // 打印最终数据长度
+ console.log("最终显示数据数量:", logs.length);
+ } else {
+ console.error("API请求失败:", res);
+ app.toast(2, res.Message || "查询失败");
+ // 清空数据列表,明确设置为数组
+ this.setData({
+ visitLogList: [],
+ HostsDataFilters: []
+ });
+ }
+ } catch (err) {
+ console.error("查询设备访问日志失败:", err);
+ app.toast(2, "查询失败,请重试");
+ // 清空数据列表,明确设置为数组
+ this.setData({
+ visitLogList: [],
+ HostsDataFilters: []
+ });
+ }
+ },
+ sortHotelsByFuzzyMatch:function(hotels, keyword) {
+ // 1. 参数验证
+ if (!Array.isArray(hotels)) {
+ console.warn('第一个参数必须是数组');
+ return [];
+ }
+
+ if (typeof keyword !== 'string') {
+ console.warn('第二个参数必须是字符串');
+ return hotels.slice();
+ }
+
+ // 2. 处理空数组或空关键字的情况
+ const trimmedKeyword = keyword.trim();
+ if (hotels.length === 0 || trimmedKeyword === '') {
+ return hotels
+ }
+
+ const lowerKeyword = trimmedKeyword.toLowerCase();
+
+ // 3. 分离匹配和不匹配的酒店
+ const matchedHotels = [];
+ const unmatchedHotels = [];
+
+ hotels.forEach(hotel => {
+ // 检查是否为有效酒店对象
+ if (!hotel || typeof hotel !== 'object' || !hotel.RoomNumber) {
+ unmatchedHotels.push(hotel);
+ return;
+ }
+
+ const hotelName = String(hotel.RoomNumber).toLowerCase();
+ const isMatch = hotelName.includes(lowerKeyword);
+
+ if (isMatch) {
+ matchedHotels.push(hotel);
+ } else {
+ unmatchedHotels.push(hotel);
+ }
+ });
+
+ // 4. 合并数组并返回
+ return [...matchedHotels, ...unmatchedHotels];
},
/**
@@ -115,11 +284,222 @@ Page({
onReachBottom() {
},
+ // 房号输入
inputSearchForHotels(e){
this.setData({
RoomNumber: e.detail.value
})
},
+
+ // 搜索按钮点击
+ searchRoomLog() {
+ const { visitLogList, RoomNumber } = this.data;
+ if (!RoomNumber) {
+ // 如果搜索框为空,直接返回
+ return;
+ }
+
+ // 在现有数据上进行房号匹配
+ const filteredLogs = visitLogList.filter(log => log.RoomNumber && log.RoomNumber.includes(RoomNumber));
+ const otherLogs = visitLogList.filter(log => !log.RoomNumber || !log.RoomNumber.includes(RoomNumber));
+
+ // 将符合条件的数据放到头部
+ this.setData({
+ visitLogList: [...filteredLogs, ...otherLogs]
+ });
+ },
+
+ // 时间范围选择
+ seltime: function(e) {
+ let sel = Number(e.target.dataset.val);
+ let starttime = "";
+ let endtime = "";
+ const now = new Date();
+
+ switch (sel) {
+ case 1: // 今日
+ starttime = now.toISOString().split('T')[0];
+ endtime = now.toISOString().split('T')[0];
+ break;
+ case 2: // 本周
+ let time = this.getThisWeekData();
+ starttime = time.start_day;
+ endtime = time.end_day;
+ break;
+ case 3: // 本月
+ starttime = util.getCurrentMonthFirst(new Date());
+ endtime = util.getCurrentMonthLast(new Date());
+ break;
+ case 4: // 全部
+ starttime = "";
+ endtime = "";
+ break;
+ }
+
+ this.setData({
+ seltime: sel,
+ starttime: starttime,
+ endtime: endtime
+ });
+ },
+
+ // 自定义时间选择
+ bindTimeChange: function(e) {
+ if (e.target.dataset.type == 1) {
+ this.setData({
+ seltime: 5,
+ starttime: e.detail.value
+ });
+ } else {
+ this.setData({
+ seltime: 5,
+ endtime: e.detail.value
+ });
+ }
+ },
+
+ // 时间范围查询
+ async searchByTime() {
+ await this.getRoomVisitLog();
+ },
+
+ // 全部记录查询
+ async RefreshTheRoom() {
+ this.setData({
+ seltime: 4,
+ starttime: "",
+ endtime: "",
+ RoomNumber: "" // 清空搜索框内容
+ });
+ await this.getRoomVisitLog();
+ },
+
+ // 获取本周的起止日期
+ getThisWeekData: function() {
+ var thisweek = {};
+ var date = new Date();
+ // 本周一的日期
+ date.setDate(date.getDate() - date.getDay() + 1);
+ thisweek.start_day = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate();
+
+ // 本周日的日期
+ date.setDate(date.getDate() + 6);
+ thisweek.end_day = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate();
+ return thisweek;
+ },
+
+ // 切换故障原因显示状态
+ toggleFaultReason(e) {
+ const id = e.currentTarget.dataset.id;
+ const { selectedId } = this.data;
+
+ // 如果点击的是当前显示的项,则隐藏;否则显示点击的项
+ this.setData({
+ selectedId: selectedId === id ? null : id
+ });
+ },
+
+ // 确认维修完成
+ async confirmRepair(e) {
+ const id = e.currentTarget.dataset.id;
+ console.log("确认维修完成,设备ID:", id);
+
+ // 找到对应的设备记录
+ const deviceIndex = this.data.visitLogList.findIndex(item => item.Id === id);
+ if (deviceIndex === -1) {
+ console.error("未找到对应的设备记录");
+ return;
+ }
+
+ const device = this.data.visitLogList[deviceIndex];
+
+ // 获取当前时间
+ const now = new Date();
+ const year = now.getFullYear();
+ const month = String(now.getMonth() + 1).padStart(2, '0');
+ const day = String(now.getDate()).padStart(2, '0');
+ const hours = String(now.getHours()).padStart(2, '0');
+ const minutes = String(now.getMinutes()).padStart(2, '0');
+ const seconds = String(now.getSeconds()).padStart(2, '0');
+ const currentTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+
+ try {
+ // 1. 先调用UpdateRoomVisitLog接口,将原来的故障记录设置为维修完成
+ const updateParams = {
+ id: id,
+ faultDescription: "维修完成",
+ equipmentStatusType: "1"
+ };
+
+ const updateRes = await UpdateRoomVisitLog(updateParams);
+ if (updateRes.Status !== 1) {
+ wx.showToast({
+ title: updateRes.Message || "更新故障记录失败",
+ icon: 'none',
+ duration: 2000
+ });
+ console.log("更新故障记录失败", updateRes);
+ return;
+ }
+
+ // 2. 调用WriteRoomVisitLog接口,写入一条新的正常记录
+ const writeParams = {
+ HotelID: this.data.HotelId,
+ RoomNumber: device.RoomNumber,
+ EquipmentList: [{
+ EquipmentStatus: "正常",
+ FaultDescription: "已维修完成",
+ DevName: device.DevName,
+ EquipmentStatusType: "3",
+ EquipmentOnlineStatus: "1",
+ UpdateDate: currentTime
+ }]
+ };
+
+ const writeRes = await WriteRoomVisitLog(writeParams);
+
+ // 处理返回结果
+ if (writeRes.Status === 1) {
+ wx.showToast({
+ title: '维修完成',
+ icon: 'success',
+ duration: 2000
+ });
+
+ // 从visitLogList中移除对应的故障记录
+ const updatedVisitLogList = [...this.data.visitLogList];
+ updatedVisitLogList.splice(deviceIndex, 1);
+
+ // 更新页面数据
+ this.setData({
+ visitLogList: updatedVisitLogList,
+ HostsDataFilters: updatedVisitLogList
+ });
+
+ // 如果当前选中的是被移除的记录,清空选中状态
+ if (this.data.selectedId === id) {
+ this.setData({
+ selectedId: null
+ });
+ }
+ } else {
+ wx.showToast({
+ title: writeRes.Message || "写入正常记录失败",
+ icon: 'none',
+ duration: 2000
+ });
+ console.log("写入正常记录失败", writeRes);
+ }
+ } catch (error) {
+ wx.showToast({
+ title: "维修完成失败,请检查网络连接",
+ icon: 'none',
+ duration: 2000
+ });
+ console.error("维修完成出错", error);
+ }
+ },
+
/**
* 用户点击右上角分享
*/
diff --git a/pages/basics/MakingRoundsAbnormal/MakingRoundsAbnormal.wxml b/pages/basics/MakingRoundsAbnormal/MakingRoundsAbnormal.wxml
index 1406d1e..05a1e40 100644
--- a/pages/basics/MakingRoundsAbnormal/MakingRoundsAbnormal.wxml
+++ b/pages/basics/MakingRoundsAbnormal/MakingRoundsAbnormal.wxml
@@ -23,31 +23,82 @@
-
-
+
+
-
-
-
-
-
- 房号:
- {{"床卫生间传"}}
-
-
-
- 床卫生间传感器测试
-
+
+
+
+
+ 时间范围:
+ 全部
+ 今日
+ 本周
+ 本月
+
+
+
+
+ 时间:
+
+
+ {{starttime==""?"请选择":starttime}}
+
+
+ 至:
+
+
+ {{endtime==""?"请选择":endtime}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.UpdateDate}}
+
+
+ 房号:
+ {{item.RoomNumber}}
+
+
+
+
+
+ {{item.DevName}}
+
-
-
+
+
+
+
+
+
+
+ 故障原因:
+ {{item.FaultDescription}}
-
+
+
\ No newline at end of file
diff --git a/pages/basics/MakingRoundsAbnormal/MakingRoundsAbnormal.wxss b/pages/basics/MakingRoundsAbnormal/MakingRoundsAbnormal.wxss
index e9b4548..5a3f720 100644
--- a/pages/basics/MakingRoundsAbnormal/MakingRoundsAbnormal.wxss
+++ b/pages/basics/MakingRoundsAbnormal/MakingRoundsAbnormal.wxss
@@ -99,3 +99,12 @@
transform: translate(0rpx, 0rpx);
margin-right: initial;
}
+.Listindem{
+ position: relative;
+ display: flex;
+ padding: 0 10rpx;
+ min-height: 100rpx;
+ background-color: var(--white);
+ justify-content: space-between;
+ align-items: center
+}
\ No newline at end of file
diff --git a/pages/basics/progress/RoomTypeControlLog/RoomTypeControlLog.js b/pages/basics/progress/RoomTypeControlLog/RoomTypeControlLog.js
new file mode 100644
index 0000000..c3ab3a9
--- /dev/null
+++ b/pages/basics/progress/RoomTypeControlLog/RoomTypeControlLog.js
@@ -0,0 +1,135 @@
+// pages/basics/progress/RoomTypeControlLog/RoomTypeControlLog.js
+const app = getApp()
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ Hotelinfo: null,
+ HotelId: null,
+ RoomNumber: null,
+ sectionsList: [
+ {
+ id: 1,
+ name: '刷卡记录',
+ icon: 'card',
+ color: '#4CAF50',
+ count: 0
+ },
+ {
+ id: 2,
+ name: '回路状态记录',
+ icon: 'circuit',
+ color: '#2196F3',
+ count: 0
+ },
+ {
+ id: 3,
+ name: '回路异常记录',
+ icon: 'warning',
+ color: '#FF9800',
+ count: 0
+ },
+ {
+ id: 4,
+ name: '外设异常记录',
+ icon: 'device',
+ color: '#F44336',
+ count: 0
+ },
+ {
+ id: 5,
+ name: '语音上报记录',
+ icon: 'voice',
+ color: '#9C27B0',
+ count: 0
+ }
+ ]
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+ console.log('RoomTypeControlLog onLoad options:', options);
+
+ if (options.HotelId && options.RoomNumber && options.HotelName) {
+ this.setData({
+ HotelId: options.HotelId,
+ RoomNumber: options.RoomNumber,
+ Hotelinfo: {
+ HotelName: options.HotelName,
+ Code: ''
+ }
+ });
+ }
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage() {
+
+ },
+
+ /**
+ * 返回上一页
+ */
+ back() {
+ wx.navigateBack({
+ delta: 1
+ });
+ },
+
+ /**
+ * 点击板块列表项
+ */
+ tap板块列表项(e) {
+ const { id, name } = e.currentTarget.dataset;
+ console.log('点击了板块:', name, 'ID:', id);
+ // 这里可以添加点击事件的处理逻辑,比如跳转到对应记录的详细页面
+ }
+})
\ No newline at end of file
diff --git a/pages/basics/progress/RoomTypeControlLog/RoomTypeControlLog.json b/pages/basics/progress/RoomTypeControlLog/RoomTypeControlLog.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/basics/progress/RoomTypeControlLog/RoomTypeControlLog.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/basics/progress/RoomTypeControlLog/RoomTypeControlLog.wxml b/pages/basics/progress/RoomTypeControlLog/RoomTypeControlLog.wxml
new file mode 100644
index 0000000..2e24238
--- /dev/null
+++ b/pages/basics/progress/RoomTypeControlLog/RoomTypeControlLog.wxml
@@ -0,0 +1,34 @@
+
+ 返回
+ {{Hotelinfo.HotelName}}({{Hotelinfo.Code}})
+
+
+
+
+
+ 房间号:{{RoomNumber}}
+ 房间控制日志
+
+
+
+
+
+
+
+
+
+ {{item.name}}
+ 共 {{item.count}} 条记录
+
+
+
+
\ No newline at end of file
diff --git a/pages/basics/progress/RoomTypeControlLog/RoomTypeControlLog.wxss b/pages/basics/progress/RoomTypeControlLog/RoomTypeControlLog.wxss
new file mode 100644
index 0000000..69276f6
--- /dev/null
+++ b/pages/basics/progress/RoomTypeControlLog/RoomTypeControlLog.wxss
@@ -0,0 +1 @@
+/* pages/basics/progress/RoomTypeControlLog/RoomTypeControlLog.wxss */
\ No newline at end of file
diff --git a/pages/basics/progress/progress.js b/pages/basics/progress/progress.js
new file mode 100644
index 0000000..6debc35
--- /dev/null
+++ b/pages/basics/progress/progress.js
@@ -0,0 +1,293 @@
+// pages/basics/progress/progress.js
+const app = getApp()
+import {
+ GetHostsInfo,
+ GetMAC,
+ GetFaceSN,
+ ErrorInfo,
+ CheckFaceSN,
+ OpenDoorTest,
+ GetRoomType,
+ GetRoomTypeAndModalsListLog,
+ WebChatUpgrade,
+ QueryUpdateHostStatus,
+ ForwardQueryUpdateHostProgressBar,
+ GetRoomTypeNode,
+ SetRCULight,
+ SetRCUAir,
+ SetRCUCurtain,
+ GetRoomAddressStatus
+} from '../../../lib/RequestingCenter.js'
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ RoomIndex:0,
+ //权限信息
+ autho: null,
+ //酒店信息
+ Hotelinfo: null,
+ HostsData:null,
+ HostsDataFilters:[],
+ isback:null,
+ HotelId:null,
+ statusdata:null,
+ onlineNumber:0,
+ inputValue:"",
+ toView:"",
+ scrollHeight: 0
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad:async function(options) {
+ if (!options.HotelId || app.globalData.autho == null) {
+ app.toast(2, "无酒店信息~")
+ return;
+ }
+
+ this.setData({
+ autho: app.globalData.autho
+ })
+ try {
+ this.data.autho.forEach((element, index) => {
+ element.Hotels.forEach((elements, indexs) => {
+ if (elements.HotelId == options.HotelId) {
+ this.setData({
+ Hotelinfo: elements
+ })
+ throw new Error();
+ }
+ })
+ });
+ } catch (error) {
+ console.log("已经找到,无需循环~")
+ }
+
+ let that = this
+ await GetHostsInfo({
+ HotelID: this.data.Hotelinfo.HotelId
+ }).then(res => {
+
+ if (res.Status == 200) {
+ let onlineNumber=0
+ for (let index = 0; index < res.Data.length; index++) {
+ const element = res.Data[index];
+ if (element.Status===1) {
+ onlineNumber=onlineNumber+1
+ }
+ }
+
+ that.setData({
+ onlineNumber:onlineNumber,
+ HostsData: res.Data,
+ HostsDataFilters: res.Data,
+ isback: (app.globalData.autho.length > 1 || app.globalData.autho[0].Hotels.length > 1),
+ HotelId: options.HotelId,
+ statusdata: [0, 0, 0, res.Data.length]
+ })
+
+ console.log(this.data.HostsDataFilters)
+
+ } else {
+ app.toast(2, res.Message || "网络繁忙")
+ }
+ }, err => {
+ console.log(err)
+ app.toast(2, "网络繁忙")
+ }).catch(err => {
+ console.log(err)
+
+ app.toast(2, "网络繁忙")
+ });
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady() {
+ this.calcScrollHeight();
+ },
+ calcScrollHeight() {
+ // 1. 拿到屏幕可用高度(px)
+ const sys = wx.getSystemInfoSync();
+ const screenHeight = sys.windowHeight; // px
+
+ // 2. 拿到 scroll-view 的 top(px)
+ wx.createSelectorQuery()
+ .in(this)
+ .select('#myScroll')
+ .boundingClientRect(rect => {
+ if (rect) {
+ const topPx = rect.top; // px
+ const bottomPx = 10 / 2; // 10rpx → 5px(2倍屏)
+ const heightPx = screenHeight - topPx - bottomPx;
+
+ // 3. 转 rpx 并写入
+ this.setData({
+ scrollHeight: heightPx * 2 // px→rpx
+ });
+ }
+ })
+ .exec();
+ },
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage() {
+
+ },
+
+ inputSearchForHotels(e){
+ this.setData({
+ inputValue: e.detail.value
+ })
+ },
+ SearchForHotels(e){
+ //debugger
+ let myarry =this.data.HostsDataFilters
+ let inputValue =this.data.inputValue.trim()
+ const CNaelement =this.sortHotelsByFuzzyMatch(myarry,inputValue)
+ this.setData({
+ HostsDataFilters:CNaelement
+ })
+ },
+ goProcess(e) {
+ let indexstr = e.currentTarget.id.replace("msg-","")
+ let index= Number(indexstr)
+ const { room, hotel, status } = e.currentTarget.dataset;
+ this.setData({
+ RoomIndex:index
+ } )
+ let HostsDataFilters= this.data.HostsDataFilters
+ console.log(HostsDataFilters[index].RoomNumber)
+
+ // 取消状态检查,无论状态如何都允许跳转
+ wx.navigateTo({
+ url: `/pages/basics/progress/RoomTypeControlLog/RoomTypeControlLog?RoomNumber=${room}&HotelName=${hotel}&HotelId=${this.data.Hotelinfo.HotelId }`
+ });
+ },
+ RefreshTheRoom:async function(e){
+ let that = this
+ await GetHostsInfo({
+ HotelID: this.data.Hotelinfo.HotelId
+ }).then(res => {
+
+ if (res.Status == 200) {
+ let onlineNumber=0
+
+ for (let index = 0; index < res.Data.length; index++) {
+ const element = res.Data[index];
+ if (element.Status===1) {
+
+ onlineNumber=onlineNumber+1
+ }
+ }
+
+ that.setData({
+ RoomIndex:0,
+ onlineNumber:onlineNumber,
+ HostsData: res.Data,
+ HostsDataFilters: res.Data,
+ isback: (app.globalData.autho.length > 1 || app.globalData.autho[0].Hotels.length > 1),
+ statusdata: [0, 0, 0, res.Data.length]
+ })
+
+ console.log(this.data.HostsDataFilters)
+
+ } else {
+ app.toast(2, res.Message || "网络繁忙")
+ }
+ }, err => {
+ console.log(err)
+ app.toast(2, "网络繁忙")
+ }).catch(err => {
+ console.log(err)
+
+ app.toast(2, "网络繁忙")
+ });
+ },
+
+ sortHotelsByFuzzyMatch:function(hotels, keyword) {
+ // 1. 参数验证
+ if (!Array.isArray(hotels)) {
+ console.warn('第一个参数必须是数组');
+ return [];
+ }
+
+ if (typeof keyword !== 'string') {
+ console.warn('第二个参数必须是字符串');
+ return hotels.slice();
+ }
+
+ // 2. 处理空数组或空关键字的情况
+ const trimmedKeyword = keyword.trim();
+ if (hotels.length === 0 || trimmedKeyword === '') {
+ return hotels.slice();
+ }
+
+ const lowerKeyword = trimmedKeyword.toLowerCase();
+
+ // 3. 分离匹配和不匹配的酒店
+ const matchedHotels = [];
+ const unmatchedHotels = [];
+
+ hotels.forEach(hotel => {
+ // 检查是否为有效酒店对象
+ if (!hotel || typeof hotel !== 'object' || !hotel.RoomNumber) {
+ unmatchedHotels.push(hotel);
+ return;
+ }
+
+ const hotelName = String(hotel.RoomNumber).toLowerCase();
+ const isMatch = hotelName.includes(lowerKeyword);
+
+ if (isMatch) {
+ matchedHotels.push(hotel);
+ } else {
+ unmatchedHotels.push(hotel);
+ }
+ });
+
+ // 4. 合并数组并返回
+ return [...matchedHotels, ...unmatchedHotels];
+ },
+})
\ No newline at end of file
diff --git a/pages/basics/progress/progress.json b/pages/basics/progress/progress.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/basics/progress/progress.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/basics/progress/progress.wxml b/pages/basics/progress/progress.wxml
new file mode 100644
index 0000000..f690636
--- /dev/null
+++ b/pages/basics/progress/progress.wxml
@@ -0,0 +1,46 @@
+
+ 返回
+ {{Hotelinfo.HotelName}}({{Hotelinfo.Code}})
+
+
+
+
+
+房号:{{HostsDataFilters[RoomIndex].RoomNumber}}
+
+
+ 房间在线:
+ {{onlineNumber}}/
+ {{HostsDataFilters.length}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.RoomNumber}}
+ {{item.MAC}}
+
+
+
+
\ No newline at end of file
diff --git a/pages/basics/progress/progress.wxss b/pages/basics/progress/progress.wxss
new file mode 100644
index 0000000..c4f22df
--- /dev/null
+++ b/pages/basics/progress/progress.wxss
@@ -0,0 +1,102 @@
+/* pages/basics/progress/progress.wxss */
+.aside{
+ width:8rem;
+ border-right: 1px solid #ddd;
+ font-size: .85rem;
+}
+.type-nav{
+ width:8rem;
+ position: relative;
+ padding:.7rem .3rem;
+ text-align: center;
+ border-bottom: 1px solid #ddd;
+ z-index: 10;
+}
+.flex-wrap{
+ display: flex;
+}
+.type-nav.selected{
+ margin-right: -1px;
+ padding-left:0,-1px;
+ color: #333;
+ background-color: #fff;
+}
+/* .content{
+ background-color: #fff;
+} */
+
+.dish{
+ margin-left: 1rem;
+ padding: 1rem;
+ border-bottom: 1px solid #ddd;
+}
+.dish .title{
+ display: block;
+ font-size: 1rem;
+}
+.dish p{
+ color: orange;
+ font-size: .75rem;
+}
+.dish .add-btn{
+ width: 8rem;
+ text-align: right;
+}
+.cu-bar1 {
+ display: flex;
+
+ align-items: center;
+
+ justify-content: space-between;
+}
+.cart{
+ display: block;
+ position: fixed;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ padding: 1rem;
+ background: #ddd;
+}
+.container {
+ height: 50%;
+ box-sizing: border-box;
+ background-color: #f4f4f4;
+}
+.cu1-btn {
+ position: relative;
+ border: 0rpx;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ box-sizing: border-box;
+ padding: 5rpx 5rpx;
+ font-size: 26rpx;
+ height: 70rpx;
+ line-height: 1;
+ text-align: center;
+ text-decoration: none;
+ overflow: visible;
+ margin-left: initial;
+ transform: translate(0rpx, 0rpx);
+ margin-right: initial;
+}
+
+.cu-btn1 {
+ position: relative;
+ border: 0rpx;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ box-sizing: border-box;
+ padding: 0 5rpx;
+ font-size: 26rpx;
+ height: 64rpx;
+ line-height: 1;
+ text-align: center;
+ text-decoration: none;
+ overflow: visible;
+ margin-left: initial;
+ transform: translate(0rpx, 0rpx);
+ margin-right: initial;
+}
\ No newline at end of file
diff --git a/pages/index/index.js b/pages/index/index.js
index afc452c..00de107 100644
--- a/pages/index/index.js
+++ b/pages/index/index.js
@@ -50,14 +50,16 @@ Page({
//确定选择酒店
ShowSelHotel: async function (e) {
+ let HotelCode
let id = e.currentTarget.dataset['id'];
if(id==-1){
- id = this.data.autho[this.data.selectGroupIndex].Hotels[this.data.hotelIndex].HotelId;
+ id = this.data.autho[this.data.selectGroupIndex].Hotels[this.data.hotelIndex].HotelId;
+ HotelCode= this.data.autho[this.data.selectGroupIndex].Hotels[this.data.hotelIndex].Code;
}
if(this.data.hotelIndex>=0){
app.globalData.HotelId=id
-
+ app.globalData.HotelCode=HotelCode
wx.navigateTo({
@@ -101,7 +103,7 @@ Page({
//登录
onLoad: async function (option) {
let that=this
-
+
this.setData({
userInfo: app.globalData.userinfo,
autho: app.globalData.autho
@@ -212,8 +214,14 @@ Page({
selectGroupIndex: _xiaoxi_selectGroupIndex,
hotelIndex: _xiaoxi_hotelIndex
})
+
+
//非选择 读取上次进行跳转
if(!this.data.issel && this.data.hotelIndex>-1){
+ let HotelCode= this.data.autho[this.data.selectGroupIndex].Hotels[this.data.hotelIndex].Code;
+ let HotelId=this.data.autho[this.data.selectGroupIndex].Hotels[this.data.hotelIndex].HotelId
+ app.globalData.HotelId=HotelId
+ app.globalData.HotelCode=HotelCode
wx.navigateTo({
url: '/pages/NewHome/NewHome?HotelId='+this.data.autho[this.data.selectGroupIndex].Hotels[this.data.hotelIndex].HotelId
})
@@ -221,6 +229,10 @@ Page({
// console.log(this.data.autho.length==1 && this.data.autho[0].Hotels.length==1 && option.issel!=0)
//非选择 如果只有一个酒店就直接进行跳转
if(this.data.autho.length==1 && this.data.autho[0].Hotels.length==1 && !this.data.issel){
+ let HotelCode= this.data.autho[0].Hotels[0].Code;
+ let HotelId=this.data.autho[0].Hotels[0].HotelId
+ app.globalData.HotelId=HotelId
+ app.globalData.HotelCode=HotelCode
wx.navigateTo({
url: '/pages/NewHome/NewHome?HotelId='+this.data.autho[0].Hotels[0].HotelId
})
diff --git a/pages/test/test.js b/pages/test/test.js
new file mode 100644
index 0000000..0053ad4
--- /dev/null
+++ b/pages/test/test.js
@@ -0,0 +1,647 @@
+const app = getApp()
+//导入测试请求发方法
+import {
+ OpenDoorTest,
+ RestartTheDevice,
+ GeteDeviceInfomation,
+ DeletePeopleFromDeviceByGroup,
+ GetThePeopleListOfDevice,
+ openRommCheckin,
+ roomCheckOut,GetFaceSN
+} from '../../lib/RequestingCenter.js'
+// pages/test/test.js
+Page({
+
+ /**
+ * 页面的初始数据
+ */
+ data: {
+ imgList:[],
+ cout:1,
+ isbut:false,
+ isbuts:false,
+ count:1,
+ //测试信息
+sn:"",
+hid:"",
+HotelId:"",
+HotelName:"",
+Roomid:"",
+openUserName:"李四",
+openUserID:"123456789456123456",
+openUserSex:"1",
+outUserName:"",
+outUserID:"",
+imgurl:"",
+openUserTel:"15915641569",
+RoomNO:"",
+faceadd:""
+},
+isCard(e) {
+
+if(this.data.isCardds==this.data.isCard){
+ this.setData({
+ isCard: e.detail.value,
+ isCardds:!e.detail.value
+ })
+}else{
+ this.setData({
+ isCard: e.detail.value,
+ isCardds:""
+ })
+}
+
+
+ // this.setData({
+ // isCard: e.detail.value
+ // })
+},
+
+isCardds(e){
+if(this.data.isCardds==this.data.isCard){
+ this.setData({
+ isCard: !e.detail.value,
+ isCardds:e.detail.value
+ })
+}else{
+ this.setData({
+ isCard: "",
+ isCardds:e.detail.value
+ })
+}
+
+},
+
+
+
+
+
+//开房测试
+OpenRoom:function(params){
+
+ this.setData({
+ islogs: false,
+ openrom: !this.data.openrom
+ })
+ //调用打开摄像头代码
+
+ // wx.chooseMedia({
+ // count: 1, // 可以选择的图片数量
+ // sizeType: ['compressed'], // 可以指定是原图还是压缩图
+ // sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机
+ // success: function (res) {
+ // // 将拍照后的照片保存在本地文件夹中
+ // var tempFilePaths = res.tempFiles[0].tempFilePath
+ // console.log(res.tempFiles[0].tempFilePath)
+ // wx.uploadFile({
+ // url: 'http://localhost:56306/ImgServer/Update',//开发者放服务地址
+ // filePath: tempFilePaths,
+ // name: 'file',
+ // success: function (res) {
+ // var data = res.data;
+ // console.log(data);
+ // },
+ // fail: function (res) {
+ // console.log(res);
+ // }
+ // })
+ // }
+ // })
+//授权获取用户摄像头权限
+
+},
+ViewImage(e) {
+ wx.previewImage({
+ urls: this.data.imgList,
+ current: e.currentTarget.dataset.url
+ });
+},
+ChooseImage() {
+ console.log(111111111111)
+ var that =this;
+ wx.chooseImage({
+ count: 1, //默认9
+ sizeType: ['original'], //可以指定是原图还是压缩图,默认二者都有,'compressed'
+ sourceType: ['camera'], //从相册选择camera,album
+ camera: 'front',
+ success: (res) => {
+ console.log(res.tempFilePaths)
+ if (that.data.imgList.length != 0) {
+ that.setData({
+ imgList: that.data.imgList.concat(res.tempFilePaths)
+ })
+
+ } else {
+ that.setData({
+ imgList: res.tempFilePaths
+ })
+ }
+ console.log(that.data.imgList)
+ // https://auth.blv-oa.com/Wx/Update
+ // http://auth.blv-oa.com/Wx/Update
+ wx.uploadFile({
+ url: 'https://auth.blv-oa.com/Wx/Update',//开发者放服务地址
+ filePath: that.data.imgList[0],
+ name: 'file',
+ success: function (res) {
+ var data = res.data;
+ console.log(res)
+ data=JSON.parse(data)
+ console.log(data.data.src)
+ that.setData({
+ imgurl:data.data.src
+ })
+
+ },
+ fail: function (res) {
+ console.log(res);
+ }
+ })
+ },
+ fail:(res)=>{
+ console.log(res)
+ }
+ });
+ // wx.authorize({
+ // scope: 'scope.camera',
+ // success: function () {
+ // console.log("授权成功");
+
+ // // wx.chooseMedia({
+ // // count: 1,
+ // // mediaType: ['image'],
+ // // sourceType: ['album'],
+ // // maxDuration: 30,
+ // // camera: 'front',
+ // // success(res) {
+ // // console.log(res.tempFiles)
+ // // // console.log(res.tempFiles[0].tempFilePath)
+ // // // console.log(res.tempFiles[0].size)
+ // // if (that.data.imgList.length != 0) {
+ // // that.setData({
+ // // imgList: that.data.imgList.concat(res.tempFiles[0].tempFilePath)
+ // // })
+
+ // // } else {
+ // // that.setData({
+ // // imgList: res.tempFiles[0].tempFilePath
+ // // })
+ // // }
+ // // console.log(that.data.imgList)
+ // // // wx.uploadFile({
+ // // // url: 'https://auth.blv-oa.com/Wx/Update',//开发者放服务地址
+ // // // filePath: that.data.imgList[0],
+ // // // name: 'file',
+ // // // success: function (res) {
+ // // // var data = res.data;
+ // // // console.log(res)
+ // // // data=JSON.parse(data)
+ // // // console.log(data.data.src)
+ // // // that.setData({
+ // // // imgurl:data.data.src
+ // // // })
+
+ // // // },
+ // // // fail: function (res) {
+ // // // console.log(res);
+ // // // }
+ // // // })
+ // // }
+ // // })
+
+
+
+
+
+ // },
+ // fail: function (err) {
+ // console.log(err);
+ // }
+ // })
+},
+DelImg(e) {
+ wx.showModal({
+ title: '',
+ content: '确定要删除这张照片吗?',
+ cancelText: '再看看',
+ confirmText: '再见',
+ success: res => {
+ if (res.confirm) {
+ this.data.imgList.splice(e.currentTarget.dataset.index, 1);
+ this.setData({
+ imgList: this.data.imgList
+ })
+ }
+ }
+ })
+},
+
+radioChang:function(e){
+ console.log("radio发生change事件,携带value值为", e.detail.value)
+ this.setData({
+ openUserSex:e.detail.value
+ })
+},
+
+ ///
+ /// pms开房测试
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// 房间编号
+ /// 开房时间
+ /// 开房时间长度
+ ///
+//开房按钮
+Checkin:function(){
+console.log("姓名:"+this.data.openUserName+"证件类型:"+this.data.openUserID+"性别:"+this.data.openUserSex+"照片路径:"+this.data.imgurl)
+var that=this;
+console.log("房间id:"+that.data.Roomid+"人脸机编号:"+that.data.sn+"酒店编号:"+that.data.hid)
+openRommCheckin({
+ idNumber:that.data.openUserID,
+ name:that.data.openUserName,
+ sex:that.data.openUserSex,
+ picture:that.data.imgurl,
+ phone:that.data.openUserTel,
+ room:that.data.Roomid,
+ faceSN:that.data.sn,
+ hotelCode:that.data.hid,
+}).then(
+ res => {
+ console.log(res)
+ if (res.Status == 200) {
+ app.toast(2, res.Message)
+ }
+ else{
+ app.toast(2, res.Message)
+ }
+ },
+ err => {
+ app.toast(2, "网络繁忙")
+ }
+ ).catch(err => {
+ app.toast(2, "网络繁忙")
+});
+},
+
+//解绑
+JbSn:function(params) {
+ var that=this;
+ wx.showModal({
+ title: '提示',
+ content: '确定要解绑吗?',
+ success (res) {
+ if (res.confirm) {
+
+ GetFaceSN({
+ faceSN:that.data.sn,
+ roomID:that.data.RoomNO,
+ roomNumber:that.data.Roomid,
+ faceAddress:that.data.address,
+ HotelID:that.data.hid,
+ isjb:true
+ }).then(
+ res => {
+ if (res.Status == 200) {
+ switch (res.Data) {
+ case 0:
+ app.toast(1, "解绑成功~");
+
+ wx.navigateTo({
+ url: '/pages/Hosts/Hosts?HotelId='+that.data.hid
+ })
+ break;
+ case 1:
+ app.toast(2, "SN已经绑定酒店~")
+ break;
+ case 2:
+ app.toast(2, "SN绑定酒店失败~")
+ break;
+ case 3:
+ app.toast(2, "SN注册绑定酒店失败~")
+ break;
+ case 4:
+ app.toast(2, "未知错误~")
+ break;
+ case 5:
+ app.toast(2, "数据不符合~")
+ break;
+ case 6:
+ app.toast(2, "解绑失败~")
+ break;
+ default:
+ app.toast(2, "其他错误~")
+ break;
+ }
+ /// 0 成功
+ /// 1 已经注册已经绑定酒店
+ /// 2 已经注册更新失败
+ /// 3 未注册为分配酒店 添加注册 添加酒店是啊比
+ /// 4 未能预计的结果--
+ /// 5 数据不符合
+ /// 6 解绑失败
+ console.log(0)
+
+ }
+ else{
+ app.toast(2, "网络繁忙")
+ }
+ },
+ err => {
+ app.toast(2, "网络繁忙")
+ }
+ ).catch(err => {
+ app.toast(2, "网络繁忙")
+ });
+ } else if (res.cancel) {
+ console.log('用户点击取消')
+ }
+ }
+ })
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// if (confirm("你确定要继续吗?")) {
+
+// } else {
+// // 用户点击了取消
+// }
+
+},
+
+//退房测试
+checkOut:function(params){
+ var that=this;
+
+ wx.showModal({
+ title: '提示',
+ content: '确定退房吗?',
+ success (res) {
+ if (res.confirm) {
+ roomCheckOut({
+ room:that.data.Roomid,
+ faceSN:that.data.sn,
+ hotelCode:that.data.hid,
+ }).then(
+ res => {
+ if (res.Status == 200){
+ app.toast(2,"退房命令下发成功")
+ }
+ else{
+ app.toast(2, "退房命令下发成功")
+ }
+ },
+ err => {
+ app.toast(2, "退房命令下发失败")
+ }
+ ).catch(err => {
+ app.toast(2, "退房命令下发失败")
+ });
+
+ } else if (res.cancel) {
+ console.log('用户点击取消')
+ }
+ }
+ })
+
+
+
+
+},
+
+
+
+
+
+ // 帮助
+ HelpClick: function (params) {
+ this.setData({
+ islogs: false,
+ Help: !this.data.Help,
+ openrom: false
+ })
+ },
+
+ //功能测试
+ // featurutist:function(){
+
+
+ // },
+//测试
+// featurutistlist:function(e){
+
+// },
+
+
+
+
+//开门测试
+OpenDoor:function(){
+var that=this;
+OpenDoorTest({faceSN:that.data.sn,isjb:true}).then(
+ res => {
+ if (res.Status == 200) {
+ app.toast(2, res.Message)
+ }
+ else{
+ app.toast(2, res.Message)
+ }
+ },
+ err => {
+ app.toast(2, "网络繁忙")
+ }
+ ).catch(err => {
+ app.toast(2, "网络繁忙")
+});
+},
+
+//版本号码查询
+Getversionnumber:function(){
+ console.log(2);
+ var that=this;
+ GeteDeviceInfomation({faceSN:that.data.sn,hotelCode:that.data.HotelId, isjb:true}).then(
+ res => {
+ if (res.Status == 200) {
+ app.toast(2, res.Message)
+ }
+ else{
+ app.toast(2, res.Message)
+ }
+ },
+ err => {
+ app.toast(2, "网络繁忙")
+ }
+ ).catch(err => {
+ app.toast(2, "网络繁忙")
+ });
+},
+//人数查询
+Getpeopleobjained:function(){
+ console.log(3)
+ var that=this;
+ GetThePeopleListOfDevice({faceSN:that.data.sn,hotelCode:that.data.HotelId, isjb:true}).then(
+ res => {
+ if (res.Status == 200) {
+ app.toast(2, res.Message)
+ }
+ else{
+ app.toast(2, res.Message)
+ }
+ },
+ err => {
+ app.toast(2, "网络繁忙")
+ }
+ ).catch(err => {
+ app.toast(2, "网络繁忙")
+ });
+
+},
+//删除所有人
+Deletepeople:function(){
+ console.log(4)
+ var that=this;
+ wx.showModal({
+ title: '提示',
+ content: '确定删除设备中用户组为1的所有人信息吗?',
+ success (res) {
+ if (res.confirm) {
+ DeletePeopleFromDeviceByGroup({faceSN:that.data.sn,hotelCode:that.data.HotelId, isjb:true}).then(
+ res => {
+ if (res.Status == 200) {
+ app.toast(2, res.Message)
+ }
+ else{
+ app.toast(2, res.Message)
+ }
+ },
+ err => {
+ app.toast(2, "网络繁忙")
+ }
+ ).catch(err => {
+ app.toast(2, "网络繁忙")
+ });
+ } else if (res.cancel) {
+ console.log('用户点击取消')
+ }
+ }
+ })
+},
+//设备重新启动
+RestartDevice:function(){
+ console.log(5)
+ var that=this;
+ wx.showModal({
+ title: '提示',
+ content: '确定让设备重新启动吗?',
+ success (res) {
+ if (res.confirm) {
+ RestartTheDevice({faceSN:that.data.sn,isjb:true}).then(
+ res => {
+ if (res.Status == 200) {
+ app.toast(2, res.Message)
+ }
+ else{
+ app.toast(2, res.Message)
+ }
+ },
+ err => {
+ app.toast(2, "网络繁忙")
+ }
+ ).catch(err => {
+ app.toast(2, "网络繁忙")
+ });
+ } else if (res.cancel) {
+ console.log('用户点击取消')
+ }
+ }
+ })
+},
+
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad(options) {
+ console.log(options)
+var splitArray = options.Hotelinfo.split("_");
+console.log(splitArray)
+var that=this;
+that.setData({
+sn:splitArray[2],
+HotelId:splitArray[3],
+Roomid:splitArray[1],
+HotelName:splitArray[0],
+hid:splitArray[4],
+RoomNO:options.RoomID,
+faceadd:options.faceadd
+
+});
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+ */
+ onReady() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+ */
+ onShow() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+ */
+ onHide() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+ */
+ onUnload() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+ */
+ onPullDownRefresh() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+ */
+ onReachBottom() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+ */
+ onShareAppMessage() {
+
+ }
+})
+
\ No newline at end of file
diff --git a/pages/test/test.json b/pages/test/test.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/pages/test/test.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/pages/test/test.wxml b/pages/test/test.wxml
new file mode 100644
index 0000000..5be27fc
--- /dev/null
+++ b/pages/test/test.wxml
@@ -0,0 +1,143 @@
+
+ 返回
+ {{HotelId}}-{{HotelName}}
+
+
+
+
+ 编号:{{HotelId}}
+ 酒店:{{HotelName}}
+ 房间:{{Roomid}}
+ SN:{{sn}}
+
+
+ {{Help?'关闭':'帮助'}}
+
+
+
+
+
+
+
+
+
+
+
+
+ 页面说明
+
+
+
+
+ 此处的说明信息只在本页面使用。其他页面不可以使用本页面说明,
+
+
+
+
+
+
+
+ 功能测试区域所有按钮含义
+
+
+
+ 开门
+ 点击开门按钮是下发开门命令给设备,如果成功会听见继电器闭合声音或弹框开门成功。否则弹出开门失败或没有听见继电器闭合声音。
+ 版本号
+ 点击版本号是下发获取设备信息命令给设备,如果成功会弹出设备的版本号。否则弹出无法获取设备的版本信息。
+
+ 删除
+ 点击删除是下发删除所有入住人员命令给设备,如果成功弹出删除成功,否则弹出删除失败。
+ 重启
+ 点击删除是下发重启命令给设备,如果成功下发成功设备将重新启动,否则弹出下发失败,设备不会重新启动。
+ 开房
+ 开房所有信息默认值,性别默认是:女,姓名默认:李四,电话默认:15915641569,证件号码默认:123456789456123456,直接点击图片上传,上传照片后,点击开房即可发送信息给人脸机。(注意图片上传成功会显示在页面上)
+ 退房
+ 直接点击退房,会直接下发退房命令给人脸机。
+
+
+
+
+
+
diff --git a/pages/test/test.wxss b/pages/test/test.wxss
new file mode 100644
index 0000000..3ee2480
--- /dev/null
+++ b/pages/test/test.wxss
@@ -0,0 +1 @@
+/* pages/test/test.wxss */
\ No newline at end of file
diff --git a/project.config.json b/project.config.json
index 1712842..d89ebd3 100644
--- a/project.config.json
+++ b/project.config.json
@@ -71,5 +71,5 @@
"include": []
},
"appid": "wx2278e1d160883eb0",
- "libVersion": "2.29.2"
+ "libVersion": "3.11.1"
}
\ No newline at end of file