初始化

This commit is contained in:
2025-12-11 09:50:02 +08:00
commit c25e282398
127 changed files with 63158 additions and 0 deletions

147
pages/NewHome/NewHome.js Normal file
View File

@@ -0,0 +1,147 @@
const app = getApp()
// pages/NewHome.js
Page({
options: {
addGlobalClass: true,
},
/**
* 页面的初始数据
*/
data: {
elements: [{
title: '查房',
name: 'MakingRounds',
color: 'cyan',
icon: 'newsfill'
},
{
title: '查房异常记录',
name: 'MakingRoundsAbnormal',
color: 'blue',
icon: 'colorlens'
},
{
title: '主机升级',
name: 'HostUpgrade',
color: 'purple',
icon: 'font'
},
{
title: '主机绑定 ',
name: 'HostBinding',
color: 'mauve',
icon: 'icon'
},
{
title: '人脸机绑定',
name: 'FacialDeviceBinding',
color: 'pink',
icon: 'btn'
},
{
title: '红外转发码库下载',
name: 'InfraredLibraryDownload',
color: 'brown',
icon: 'tagfill'
},
{
title: '程序配置',
name: 'ProgramConfiguration',
color: 'red',
icon: 'myfill'
},
{
title: '日志查询',
name: 'progress',
color: 'orange',
icon: 'icloading'
},
],
//权限信息
autho: null,
//酒店信息
Hotelinfo: null,
},
/**
* 生命周期函数--监听页面加载
*/
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("已经找到,无需循环~")
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@@ -0,0 +1,5 @@
{
"usingComponents": {
}
}

View File

@@ -0,0 +1,21 @@
<cu-custom bgColor="bg-gradual-blue"
isBack="true">
<block bindtap="back" slot="backText" >返回</block>
<view slot="content">{{Hotelinfo.HotelName}}({{Hotelinfo.Code}})</view>
</cu-custom>
<scroll-view scroll-y >
<view class='nav-list' style="margin-top: 20rpx;">
<navigator open-type="navigate" hover-class="navigator-hover" url="/pages/basics/{{item.name}}/{{item.name}}?HotelId={{Hotelinfo.HotelId}}" class="nav-li bg-{{item.color}}" wx:for="{{elements}}" wx:key>
<view class="nav-title ">{{item.title}}</view>
<!-- <view class="nav-name">{{item.name}}</view> -->
<!-- <text class='cuIcon-{{item.icon}}'></text> -->
</navigator>
</view>
<view class='cu-tabbar-height'></view>
</scroll-view>

View File

@@ -0,0 +1,6 @@
.flex-center {
display: flex;
justify-content: center; /* 水平 */
align-items: center; /* 垂直 */
text-align: center; /* 多行时文字也居中 */
}

103
pages/autho/index.js Normal file
View File

@@ -0,0 +1,103 @@
// pages/autho/index.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
},
onLoad :function (params) {
wx.removeStorage({
key: 'oldHotelinfo',
success (res) {
console.log('清除历史酒店信息~')
}
})
this.SQ();
},
SQ:function(params) {
app.SQ(isok=>{
if(isok){
console.log(params)
app.userLogin(()=>{
//登录成功~
wx.reLaunch({
url: "../index/index",
})
});
}else{
app.getFuzzyLocations(function (params) {
console.log(params)
app.userLogin(()=>{
//登录成功~
wx.reLaunch({
url: "../index/index",
})
});
},
()=>{
wx.showToast({
title: '拒绝将无法进入~',
showCancel:false,
icon:"error"
})
})
};}
)
},
/**
* 生命周期函数--监听页面加载
*/
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

3
pages/autho/index.json Normal file
View File

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}

7
pages/autho/index.wxml Normal file
View File

@@ -0,0 +1,7 @@
<cu-custom bgColor="bg-gradual-blue" >
<block bindtap="back" slot="backText" >返回</block>
<view slot="content">授权申请</view>
</cu-custom>
<view class="padding flex justify-center align-center bg-white">
<button class="cu-btn bg-green" bindtap="SQ">点击授权</button>
</view>

1
pages/autho/index.wxss Normal file
View File

@@ -0,0 +1 @@
/* pages/autho/index.wxss */

View File

@@ -0,0 +1,645 @@
// pages/basics/MakingRounds/MakingRounds.js
const app = getApp()
// const upgrade = require('../../../utils/upgrade.js')
import {
GetHostsInfo,
GetMAC,
GetFaceSN,
ErrorInfo,
CheckFaceSN,
OpenDoorTest,
GetRoomType,
GetRoomTypeAndModalsListLog,
WebChatUpgrade,
QueryUpdateHostStatus,
ForwardQueryUpdateHostProgressBar,
GetRoomTypeNode,
SetRCULight,
SetRCUAir,
SetRCUCurtain,
} from '../../../../lib/RequestingCenter.js'
import DeviceUpgrader from '../../../../utils/upgrade.js';
const upgrader = new DeviceUpgrader();
Page({
/**
* 页面的初始数据
*/
data: {
RoomNumber:"",
HotelName:"",
HotelId:"",
HotelCode:"",
roomtypeid:"",
devNode:null,
Gfilename:"",
Pfilename:"",
TabCur:1,
scrollHeight:0,
Completed:false, //是否处于升级状态
CurrentUpgradeDev:'', //当前升级设备
CurrentUpgradeDevStart:'',//当前升级设备状态
UpgradeCount:0, //已升级设备数量
UpgradeAllCount:1, //总升级设备数量
// 回路调试相关数据
roomtypeInfoNode:{},
roomtypeInfoNodeinfo:[],
VolumeLevel:30,
showinfo:0,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad:async function(options){
// 初始化升级器事件监听
upgrader.on('progress', p => {
console.log(p)
this.setData({ CurrentUpgradeDevStart: p }) // 实时刷新 UI
})
upgrader.on('error', e => {
wx.showToast({ title: '升级失败', icon: 'none' })
})
if (!options.RoomNumber || !options.HotelName ||!options.HotelId ||!options.roomtypeid ||!options.HotelCode||!options.createTime){
app.toast(2, "无酒店信息~")
return;
}
console.log(options.RoomNumber)
this.setData ({
RoomNumber:options.RoomNumber,
HotelName:options.HotelName,
HotelId:options.HotelId,
roomtypeid:options.roomtypeid,
HotelCode:options.HotelCode,
createTime:options.createTime
})
try {
// 调用 GetRoomTypeNode
const res = await GetRoomTypeNode({
hotelid:options.HotelId,
roomTypeID: options.roomtypeid
});
if (res.IsSuccess==true) {
let devlist = res.HostData
for (let nindex = 0; nindex < devlist.length; nindex++) {
if (devlist[nindex].RoomNumber==options.RoomNumber) {
devlist[nindex].Model =devlist[nindex].Model.trim().replace(/\0/g, "")
console.log(devlist[nindex].Model)
this.setData ({
devNode:devlist[nindex]
})
break
}
}
}
const Nres = await GetRoomType({
HotelID:options.HotelId,
})
let Gfilename=""
let Pfilename=""
if (Nres.Status==200) {
let Roomtypeinfo=Nres.Data
for (let index = 0; index < Roomtypeinfo.length; index++) {
const element = Roomtypeinfo[index];
if (element.ROOM_TYPE_OLD_ID == options.roomtypeid) {
if (element.App_Cfg_For_L2.length>0) {
Gfilename=element.App_Cfg_For_L2
}
if (element.App_Cfg_For_L4.length>0) {
Gfilename=element.App_Cfg_For_L4
}
if (element.APPTYPE=="App_Cfg") {
Pfilename=element.CONFIG_BIN
}else{
Pfilename=""
}
break
}
}
}
await GetRoomTypeAndModalsListLog({
code:options.HotelCode
}).then(res =>{
if (res.IsSuccess==true) {
for (let index = 0; index < res.Result.length; index++) {
const element = res.Result[index];
if (element.ID == options.roomtypeid) {
this.setData({
roomtypeInfo:res.Result,
roomtypeInfoNodeinfo:element.Modals
})
break
}
}
console.log(this.data.roomtypeInfoNodeinfo)
this.LoopDebugging(null)
}
})
this.setData({
Pfilename:Pfilename,
Gfilename:Gfilename,
});
} catch (err) {
console.log('GetRoomTypeNode error', err);
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
this.calcScrollHeight();
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
upgrader.cancelUpgrade()
upgrader._cleanup()
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
// 手动关闭升级进度显示
closeUpgradeProgress() {
this.setData({
Completed: false
})
},
onShareAppMessage() {
},
calcScrollHeight() {
// 1. 拿到屏幕可用高度px
const sys = wx.getSystemInfoSync();
const screenHeight = sys.windowHeight; // px
// 2. 拿到 scroll-view 的 toppx
wx.createSelectorQuery()
.in(this)
.select('#myScroll')
.boundingClientRect(rect => {
if (rect) {
const topPx = rect.top; // px
const bottomPx = 10 / 2; // 10rpx → 5px2倍屏
const heightPx = screenHeight - topPx - bottomPx;
// 3. 转 rpx 并写入
this.setData({
scrollHeight: heightPx * 2 // px→rpx
});
}
})
.exec();
},
tabSelect(e) {
this.setData({
TabCur: e.currentTarget.dataset.id,
})
},
async UpgradeTheEquipment(e) {
let se = e
let _this = this
let updataDev = e.currentTarget.dataset.id
let errstr = ""
if (updataDev == 1) {
errstr = "固件"
}
if (updataDev == 2) {
errstr = "配置"
}
wx.showModal({
title: "提示",
content: "是否进行" + errstr + "升级!",
async success(res) {
if (res.confirm) {
await _this.UpgradeTheEquipment2(se)
} else if (res.cancel) {
return
}
}
})
},
async UpgradeTheEquipment2(e) {
let updataDev = e.currentTarget.dataset.id
let errstr = ""
let UpgradeType = ""
let filename = ""
let _this = this
let RoomTypeID = this.data.roomtypeid
let HotelId = this.data.HotelId
let devNode = this.data.devNode
if (updataDev == 1) {
errstr = "升级固件失败"
UpgradeType = 'firmware'
filename = _this.data.Gfilename
filename = filename.replace('.hex', '.bin')
}
if (updataDev == 2) {
errstr = "升级配置失败"
UpgradeType = ''
filename = _this.data.Pfilename
}
if (filename.length == 0) {
_this.DisplayPrompt("未获取到升级文件!升级失败", 3000)
return
}
_this.setData({
UpgradeCount: 0, //升级计数
CurrentUpgradeDev: devNode.RoomNumber, //当前升级设备
CurrentUpgradeDevStart: '升级就绪',//当前升级设备状态
Completed: true,
UpgradeAllCount: 1,//升级总数
})
try {
await upgrader.startUpgrade(UpgradeType, {
roomTypeID: RoomTypeID,
hostidLists: '[' + devNode.ID + ']',
upgradefileName: filename,
hotelid: HotelId
})
.then(res => {
_this.setData({
UpgradeCount: _this.data.UpgradeCount + 1, //升级计数
})
console.log('升级完成', res)
})
.catch(err => {
console.log('升级失败', err)
});
_this.DisplayPrompt2("升级完成!", 1000)
} catch (error) {
_this.setData({
CurrentUpgradeDev: devNode.RoomNumber, //当前升级设备
CurrentUpgradeDevStart: errstr + ',服务器响应异常',//当前升级设备状态
})
// this.DisplayPrompt(errstr + ',服务器响应异常', 1000)
return
}
},
DisplayPrompt2(tipstr, showtime) {
wx.showToast({
title: tipstr,
icon: 'none',
duration: showtime
})
},
DisplayPrompt(tipstr, showtime) {
wx.showToast({
title: tipstr,
icon: 'none',
duration: showtime
})
},
LoopDebugging:async function (e)
{
//
let roomtypeInfoNodeinfo=this.data.roomtypeInfoNodeinfo
let addrtype
const myMap =[]
let li =[]
let addrtypelist =true
let message =this.data.message
for (let index = 0; index < roomtypeInfoNodeinfo.length; index++) {
const element = roomtypeInfoNodeinfo[index];
addrtype=this.GetloopType(element.ModalAddress)
if (addrtype.length==0) {
continue
}
addrtypelist=true
for (let index2 = 0; index2 < myMap.length; index2++) {
const element2 = myMap[index2];
if ( element2[0] == addrtype[0][0]) {
li= myMap[index2][1]
li.push([element.ModalAddress,element.Name,addrtype[0][1]])
myMap[index2][1]=li
addrtypelist=false
break
}
}
if (addrtypelist) {
li=[]
li.push([element.ModalAddress,element.Name,addrtype[0][1]])
myMap.push([addrtype[0][0],li])
}
}
roomtypeInfoNodeinfo=myMap.sort((a, b) => a[0] - b[0])
//获取房间在线状态 roomstart
console.log(roomtypeInfoNodeinfo)
this.setData({
roomtypeInfoNodeinfo:roomtypeInfoNodeinfo
})
console.log(this.data.roomtypeInfoNode)
},
GetloopType(loopaddr){
let astr =loopaddr[0]+loopaddr[1]+loopaddr[2]
let aint =parseInt(astr,10)
let bint =[]
switch (aint) {
case 1 :
// case 4 :
// case 54:
bint.push([1,[[1,'开关',0]]])//开关
break;
case 5: //开关停
bint.push([5,[[1,'开关',0]]])
break;
case 7: //开关停
bint.push([7,[[1,'开关',0],[2,'模式',1],[3,'风速',1],[4,'温度',25],[5,'阀开',0]]])
break;
case 23 :
case 24:
bint.push([23,[[1,'开关',10]]])
break;
case 52:
bint.push([52,[[1,'开关',0],[2,'亮度',10],[3,'色温',10]]])
break;
default:
break;
}
return bint
},
// 播放欢迎词
GetshowinfoClick() {
this.setData({
showinfo: this.data.showinfo + 1
})
},
// 调整音量
changeVolumeLevel(e) {
this.setData({
VolumeLevel: e.detail.value
})
},
// 设置设备开关状态
SetDeviceSwitchStatus(e) {
let devarr = e.target.dataset.index
let devval = parseInt(e.target.dataset.value)
let ID = parseInt(e.target.id)
let type = e.target.dataset.type
this.SetDevStartToHostMachine(ID, devarr, devval, type)
console.log(e)
},
// 设置设备调光亮度
SetDeviceSwitchStatusslider(e) {
let devarr = e.target.dataset.index
let devval = parseInt(e.detail.value)
let ID = parseInt(e.target.id)
this.SetDevStartToHostMachine(ID, devarr, devval, 0)
console.log(e)
},
// 设备控制主方法
SetDevStartToHostMachine: async function (id, devarr, Handletype, type) {
let roomtypeInfoNodeinfo = this.data.roomtypeInfoNodeinfo
let narry = []
for (let index = 0; index < roomtypeInfoNodeinfo.length; index++) {
const element = roomtypeInfoNodeinfo[index];
if (element[0] === id) {
for (let nindex = 0; nindex < element[1].length; nindex++) {
const nelement = element[1][nindex];
if (nelement[0] === devarr) {
narry = this.SetloopDataChange(id, nelement[2], Handletype, type)
let iset = await this.ControlStatusMainCircuit(id, narry, devarr)
if (iset) {
roomtypeInfoNodeinfo[index][1][nindex][2] = narry
this.setData({
roomtypeInfoNodeinfo: roomtypeInfoNodeinfo
})
}
return
}
}
return
}
}
},
// 回路数据变更
SetloopDataChange(id, dataarry, Handletype, type) {
let result = []
switch (id) {
case 1:
if (dataarry[0][2] == 1) {
dataarry[0][2] = 0
} else {
dataarry[0][2] = 1
}
result = dataarry
break;
case 23:
case 5:
dataarry[0][2] = Handletype
result = dataarry
break;
case 52:
let devval = parseInt(type)
if (devval == 1) {
if (dataarry[devval - 1][2] == 1) {
dataarry[devval - 1][2] = 0
result = dataarry
} else {
dataarry[devval - 1][2] = 1
result = dataarry
}
} else {
dataarry[devval - 1][2] = Handletype
result = dataarry
}
break;
case 7:
let bevval = parseInt(type)
switch (bevval) {
case 1:
if (dataarry[bevval - 1][2] == 1) {
dataarry[bevval - 1][2] = 0
result = dataarry
} else {
dataarry[bevval - 1][2] = 1
result = dataarry
}
break;
case 3:
case 2:
if (dataarry[bevval - 1][2] == 4) {
dataarry[bevval - 1][2] = 1
} else {
dataarry[bevval - 1][2] = dataarry[bevval - 1][2] + 1
}
break;
case 4: // -
if (dataarry[bevval - 1][2] == 16) {
break;
} else {
dataarry[bevval - 1][2] = dataarry[bevval - 1][2] - 1
}
break
case 5: // +
if (dataarry[bevval - 2][2] == 32) {
break;
} else {
dataarry[bevval - 2][2] = dataarry[bevval - 2][2] + 1
}
break;
default:
break;
}
result = dataarry
break;
default:
break;
}
return result
},
// 控制状态主回路
ControlStatusMainCircuit: async function (id, dataarry, addr) {
let RoomNumber = this.data.RoomNumber
let HotelId = this.data.HotelCode
let devNode = this.data.devNode
let res = []
let sw = dataarry[0][2]
// 解析.NET风格的日期格式 "/Date(1473004800000)/"
let dotNetDate = this.data.createTime
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}`
switch (id) {
case 1:
sw = sw == 1 ? 1 : 2
res = await SetRCULight({
roomNumber: RoomNumber,
code: HotelId,
creatDate: CreateTime,
status: sw,
modalAddress: addr,
brightness: 0
})
break;
case 5:
res = await SetRCUCurtain({
roomNumber: RoomNumber,
code: HotelId,
creatDate: CreateTime,
modalAddress: addr,
status: sw
})
break
case 7:
res = await SetRCUAir({
roomNumber: RoomNumber,
code: HotelId,
creatDate: CreateTime,
modalAddress: addr,
onOff: sw,
temperature: dataarry[3][2],
fanSpeed: dataarry[2][2] == 4 ? 0 : dataarry[2][2],
mode: dataarry[1][2] == 4 ? 0 : dataarry[1][2],
valve: 1
})
break
case 23:
res = await SetRCULight({
roomNumber: RoomNumber,
code: HotelId,
creatDate: CreateTime,
status: sw == 0 ? 2 : 1,
modalAddress: addr,
brightness: sw
})
break;
default:
return false
break;
}
if (res.IsSuccess == true) {
return true
}
return false
},
})

View File

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@@ -0,0 +1,242 @@
<cu-custom bgColor="bg-gradual-blue"
isBack="true">
<block bindtap="back" slot="backText" >返回</block>
<view slot="content">({{HotelName}})_{{RoomNumber}}</view>
</cu-custom>
<view class=" bg-white padding-5" >
<view class="bg-white" >
<view class="cubarN bg-white " >
<view class="cubarN bg-white flex-9" data-id ="{{index}}" bindtap="HideOrOpen" style="background:white;">
<view class="flex-9" style="font-weight: bold;" >房号:{{RoomNumber}}</view>
<view class="flex-sub text-{{devNode.Status==true? 'green':'red'}}" >{{ devNode.Status==true? "在线":"离线"}}</view>
</view>
</view>
<view class="cubarN bg-white" > <!-- wx:if="{{devlist[index].show==0}}"> -->
<view class="flex-xis" >MAC:{{devNode.MAC}}</view>
<!-- <view class="flex-xis setborder line-grey text-cut" style="height: 50rpx;width: 520rpx; font-size:22rpx; line-height: 50rpx"></view> -->
<view class="flex-twice" style="font-size: 26rpx;">主机:{{devNode.Model}}</view>
<view class="flex-twice" style="font-size: 22rpx;">配置版本:{{devNode.ConfigVersion}} </view>
</view>
<view class="cubarN bg-white solid-bottom "> <!-- wx:if="{{devlist[index].show==0}}"> -->
<view class="flex-eight" style="font-size: 22rpx;" >固件版本:{{devNode.Version}}</view>
</view>
</view>
</view>
<view class="flex solids line-grey" style=" height:62% ;width:100%;">
<view class="flex-eight" style="height: 100%;margin: 3rpx 5rpx; " >
<view class="flex-xis setborder line-grey text-cut" style="height: 45%;font-size: 22rpx; line-height: 50rpx;min-width: 0;margin: 3rpx 0rpx; ">
{{Gfilename}}
</view>
<view class="flex-xis setborder line-grey text-cut" style="height: 45%;font-size: 22rpx; line-height: 50rpx;min-width: 0;margin: 3rpx 0rpx;">
{{Pfilename}}
</view>
</view>
<view class="flex-twice" style="height: 100%;margin: 3rpx 5rpx;" >
<button class=" "style=" margin: 3rpx 0rpx; font-size: 22rpx;height:45%;" data-id="1" bind:tap="UpgradeTheEquipment" disabled="{{Completed}}">固件升级</button>
<button class=""style=" margin: 3rpx 0rpx; font-size: 22rpx;height: 45%;" data-id="2" bind:tap="UpgradeTheEquipment" disabled="{{Completed}}">配置升级</button>
</view>
</view>
<view wx:if="{{Completed}}" class=" flex align-center " style="height: 70rpx;background: aquamarine;" >
<view class="flex-eight" >正在升级房号:{{CurrentUpgradeDev}}:{{CurrentUpgradeDevStart}}</view>
<view class="flex-sub">
<text bind:tap="closeUpgradeProgress" class="setborder padding-xs text-red " style="cursor: pointer;">关闭</text>
</view>
</view>
<scroll-view scroll-x class="bg-white nav text-center text-bold text-xl ">
<view class="flex text-center">
<view class="cu-item {{1==TabCur?'text-blue cur':''}}" bindtap="tabSelect" data-id="{{1}}">
主机控制
</view>
<view class="cu-item {{2==TabCur?'text-blue cur':''}}" bindtap="tabSelect" data-id="{{2}}">
控制日志
</view>
</view>
</scroll-view>
<scroll-view scroll-y scroll-into-view="{{toView}}" id="myScroll" style="height:{{scrollHeight}}rpx; " >
<view wx:if="{{TabCur===1}}" style="height:95%" class="bg-white" >
<view class="bg-white ">
<!-- <view style="text-align: left;font-weight: bold">播放测试:</view> -->
<!-- <view style="text-align: left;font-weight: bold">播放测试:</view> -->
<view class="Ncu-bar bg-white flex">
<button bindtap="GetshowinfoClick" class="cu-btn round1 ulg margin-5" style="font-weight: bold;">播放欢迎词</button>
<!-- <view style="text-align: left;font-weight: bold" class=" margin-xs radius ">音量:</view> -->
<slider style="width:50%;" min="30" max="100" step="1" value="{{VolumeLevel}}" bindchange="changeVolumeLevel" ></slider>
<view>{{VolumeLevel}}</view>
</view>
<view class="ControlLine"></view>
</view>
<view class="bg-white " wx:for="{{roomtypeInfoNodeinfo}}" wx:for-item="row" wx:for-index="rowIndex">
<view class=" bg-white " wx:if="{{row[0]===1}}" >
<!-- <view style="text-align: left;font-weight: bold">设置设备开关状态:</view> -->
<view class="Ncu-bar bg-white flex-sub" wx:for="{{row[1].length/4 }}" wx:for-index="colIndex" >
<view class="Ncu-bar bg-white" wx:if="{{colIndex*4<row[1].length}}">
<button id="1" class="cu-btn round1 margin-3 vlg" data-value="1" data-index="{{row[1][colIndex*4][0]}}" bindtap="SetDeviceSwitchStatus" wx:if="{{colIndex*4<row[1].length}}" style="background-color: {{row[1][colIndex*4][2][0][2]===0 ? '#E6E6E6 ':'#39b54a'}};" >{{row[1][colIndex*4][1] }}</button>
<button id="1" class="cu-btn round1 margin-3 vlg" data-value="1" data-index="{{row[1][colIndex*4+1][0]}}" bindtap="SetDeviceSwitchStatus" wx:if="{{colIndex*4+1<row[1].length}}" style="background-color: {{row[1][colIndex*4+1][2][0][2]===0 ? '#E6E6E6':'#39b54a'}};">{{row[1][colIndex*4+1][1] }}</button>
<button id="1" class="cu-btn round1 margin-3 vlg" data-value="1" data-index="{{row[1][colIndex*4+2][0]}}" bindtap="SetDeviceSwitchStatus" wx:if="{{colIndex*4+2<row[1].length}}" style="background-color: {{row[1][colIndex*4+2][2][0][2]===0 ? '#E6E6E6':'#39b54a'}};">{{row[1][colIndex*4+2][1] }}</button>
<button id="1" class="cu-btn round1 margin-3 vlg" data-value="1" data-index="{{row[1][colIndex*4+3][0]}}" bindtap="SetDeviceSwitchStatus" wx:if="{{colIndex*4+3<row[1].length}}" style="background-color: {{row[1][colIndex*4+3][2][0][2]===0 ? '#E6E6E6':'#39b54a'}};">{{row[1][colIndex*4+3][1] }}</button>
<!-- <button class="cu-btn round margin-3 nlg" data-index="{{row[1][colIndex*5+4][0]}}" bindtap="SetDeviceSwitchStatus" wx:if="{{colIndex*4+4<row[1].length}}">{{row[1][colIndex*4+4][1] }}</button> -->
<!-- <button class="cu-btn round margin-3 nlg" data-index="{{row[1][colIndex*6+5][0]}}" bindtap="SetDeviceSwitchStatus" wx:if="{{colIndex*6+5<row[1].length}}">{{row[1][colIndex*6+5][1] }}</button> -->
</view>
</view>
<view class="ControlLine"></view>
</view>
<view class="bg-white" wx:if="{{row[0]===23}}">
<!-- <view style="text-align: left;font-weight: bold">设置调光亮度:</view> -->
<view class="bg-white" wx:for="{{row[1].length}}" wx:for-index="DimIndex" >
<view class="Ncu-bar bg-white">
<view class="flex-twice">{{row[1][DimIndex][1]}}</view>
<slider id="23" data-index="{{row[1][DimIndex][0]}}" class="flex-eight" min="10" max="90" step="1" value="{{row[1][DimIndex][2][0][2]}}" bindchange="SetDeviceSwitchStatusslider" ></slider>
<view class="flex-sub">{{row[1][DimIndex][2][0][2]}}</view>
</view>
</view>
<view class="ControlLine"></view>
</view>
<view class="bg-white" wx:if="{{row[0]===52}}">
<!-- <view style="text-align: left;font-weight: bold">色温控制:</view> -->
<view class="Ncu-bar bg-white">
<view class="action margin-0 flex-twice text-green " >开关</view>
<view class="action margin-0 flex-xis text-green solid-left" >色温</view>
<view class="action margin-0 flex-xis text-green solid-left" >亮度</view>
</view>
<view class=" bg-white" wx:for="{{row[1].length}}" wx:for-index="coloIndex" >
<view class="Ncu-bar bg-white">
<view class=" flex-twice margin-3 " >
<button id="52" data-type="1" data-value="1" data-index="{{row[1][coloIndex][0]}}" class="cu-btn round1 Elg" bindtap="SetDeviceSwitchStatus" style="background-color: {{row[1][coloIndex][2][0][2]===0 ? '#E6E6E6 ':'#39b54a'}};" >{{row[1][coloIndex][1]}}</button>
</view>
<view class=" flex-xis Ncubar1 solid-left " >
<button id="52" data-type="2" data-value="20" data-index="{{row[1][coloIndex][0]}}" class="margin-3 cu-btn round1 EElg" bindtap="SetDeviceSwitchStatus" style="background-color: {{row[1][coloIndex][2][1][2]===20 ? '#39b54a':'#E6E6E6 '}};">20</button>
<button id="52" data-type="2" data-value="50" data-index="{{row[1][coloIndex][0]}}" class="margin-3 cu-btn round1 EElg" bindtap="SetDeviceSwitchStatus" style="background-color: {{row[1][coloIndex][2][1][2]===50 ? '#39b54a':'#E6E6E6 '}};">50</button>
<button id="52" data-type="2" data-value="80" data-index="{{row[1][coloIndex][0]}}" class="margin-3 cu-btn round1 EElg" bindtap="SetDeviceSwitchStatus" style="background-color: {{row[1][coloIndex][2][1][2]===80 ? '#39b54a':'#E6E6E6 '}};">80</button>
</view>
<view class="ControlLine_h"></view>
<view class=" flex-xis Ncubar1 " >
<button id="52" data-type="3" data-value="20" data-index="{{row[1][coloIndex][0]}}" class="margin-3 cu-btn round1 EElg" bindtap="SetDeviceSwitchStatus" style="background-color: {{row[1][coloIndex][2][2][2]===20 ? '#39b54a':'#E6E6E6 '}};">20</button>
<button id="52" data-type="3" data-value="50" data-index="{{row[1][coloIndex][0]}}" class="margin-3 cu-btn round1 EElg" bindtap="SetDeviceSwitchStatus" style="background-color: {{row[1][coloIndex][2][2][2]===50 ? '#39b54a':'#E6E6E6 '}};">50</button>
<button id="52" data-type="3" data-value="80" data-index="{{row[1][coloIndex][0]}}" class="margin-3 cu-btn round1 EElg" bindtap="SetDeviceSwitchStatus" style="background-color: {{row[1][coloIndex][2][2][2]===80 ? '#39b54a':'#E6E6E6 '}};">80</button>
</view>
</view>
<!-- <view class="Ncubar1 bg-white" style="text-align: left;">
<view class="flex-twice">
<view style="text-align: left;font-weight: bold">{{row[1][coloIndex][1]}}:</view>
</view>
<view class="flex-8">
<switch class="Green" data-index="{{item}}" bindchange="Loopswitch"></switch>
</view>
</view> -->
<!-- <view class="Ncu-bar bg-white flex-eight">
<button class="cu-btn round vlg">亮度20</button>
<button class="cu-btn round vlg">亮度80</button>
<button class="cu-btn round vlg">色温20</button>
<button class="cu-btn round vlg">色温80</button>
</view> -->
</view>
<view class="ControlLine"></view>
</view>
<view class="bg-white" wx:if="{{row[0]===5}}">
<!-- <view style="text-align: left;font-weight: bold">设置设备开停关状态:</view> -->
<view class="bg-white" wx:for="{{row[1].length}}" wx:for-index="coloIndex">
<view class="Ncu-bar bg-white">
<view class="flex-treble" style="font-weight: bold">{{row[1][coloIndex][1]}}</view>
<view class="Ncubar1 bg-white flex-eight">
<button id="5" data-value="1" class="margin-3 cu-btn round1 clg" style="background-color:{{row[1][coloIndex][2][0][2]===1 ? '#39b54a':'#E6E6E6'}};" data-index="{{row[1][coloIndex][0]}}" bindtap="SetDeviceSwitchStatus" >开</button>
<button id="5" data-value="2" class="margin-3 cu-btn round1 clg" style="background-color:{{row[1][coloIndex][2][0][2]===2 ? '#39b54a':'#E6E6E6'}};" data-index="{{row[1][coloIndex][0]}}" bindtap="SetDeviceSwitchStatus" >关</button>
<button id="5" data-value="6" class="margin-3 cu-btn round1 clg" style="background-color:{{row[1][coloIndex][2][0][2]===6 ? '#39b54a':'#E6E6E6'}};" data-index="{{row[1][coloIndex][0]}}" bindtap="SetDeviceSwitchStatus">停</button>
</view>
</view>
<view class="ControlLine"></view>
</view>
<view class="ControlLine"></view>
</view>
<view class="bg-white" wx:if="{{row[0]===7}}">
<!-- <view style="text-align: left;font-weight: bold">设置温控设备状态:</view> -->
<view class=" bg-white" wx:for="{{row[1].length}}" wx:for-index="coloIndex">
<view class="Ncu-bar bg-white">
<view class=" flex-twice margin-xs " >
<!-- <button class="cu-btn round1 Elg">{{row[1][coloIndex][1]}}</button> -->
<button id="7" data-type="1" data-value="1" data-index="{{row[1][coloIndex][0]}}" class="cu-btn round1 Elg" bindtap="SetDeviceSwitchStatus" style="background-color: {{row[1][coloIndex][2][0][2]===0 ? '#E6E6E6 ':'#39b54a'}};" >{{row[1][coloIndex][1]}}</button>
</view>
<view class=" flex-8 Ncubar1 solid-left " >
<button id="7" data-type="2" data-value="1" data-index="{{row[1][coloIndex][0]}}" class=" cu-btn round1 clg margin-3" bindtap="SetDeviceSwitchStatus" style="background-color: {{row[1][coloIndex][2][1][2]===4 ? '#E6E6E6 ':row[1][coloIndex][2][1][2]===3 ? '#1cbbb4':row[1][coloIndex][2][1][2]===2 ? '#e54d42':'#0081ff'}};" >{{row[1][coloIndex][2][1][2]===4 ? '自动':row[1][coloIndex][2][1][2]===3 ? '送风':row[1][coloIndex][2][1][2]===2 ? '制热':'制冷'}}</button>
<button id="7" data-type="3" data-value="1" data-index="{{row[1][coloIndex][0]}}" class=" cu-btn round1 clg margin-3" bindtap="SetDeviceSwitchStatus" >{{row[1][coloIndex][2][2][2]===4 ? '自动':row[1][coloIndex][2][2][2]===3 ? '高风速':row[1][coloIndex][2][2][2]===2 ? '中风速':'低风速'}}</button>
<button id="7" data-type="4" data-value="1" data-index="{{row[1][coloIndex][0]}}" bindtap="SetDeviceSwitchStatus" class=" cu-btn round1 vvlg margin-3">-</button>
<text class=" textvlg">{{row[1][coloIndex][2][3][2]}}</text>
<button id="7" data-type="5" data-value="1" data-index="{{row[1][coloIndex][0]}}" bindtap="SetDeviceSwitchStatus" class=" cu-btn round1 vvlg margin-3">+</button>
</view>
</view>
<!-- <view class="Ncubar1 bg-white" style="text-align: left;">
<view class="flex-twice">
<view style="text-align: left;font-weight: bold">{{row[1][coloIndex][1]}}:</view>
</view>
<view class="flex-8">
<switch class="Green" data-index="{{item}}" bindchange="Loopswitch"></switch>
</view>
</view>
<view class=" bg-white flex-eight">
<view class="Ncu-bar bg-white flex-eight">
<button class=" cu-btn round1 vlg margin-3">制冷</button>
<button class=" cu-btn round1 vlg margin-3">制热</button>
<button class=" cu-btn round1 vlg margin-3">20度</button>
<button class=" cu-btn round1 vlg margin-3">30度</button>
</view>
<view class="Ncu-bar bg-white flex-eight">
<button class="cu-btn round1 vlg margin-3">风速高</button>
<button class="cu-btn round1 vlg margin-3">风速中</button>
<button class="cu-btn round1 vlg margin-3">风速低</button>
<button class="cu-btn round1 vlg margin-3">自动</button>
</view>
</view> -->
<view class="ControlLine"></view>
</view>
<view class="ControlLine"></view>
</view>
</view>
</view>
<view wx:else>
</view>
</scroll-view>

View File

@@ -0,0 +1,25 @@
.cubarN {
display: flex;
position: relative;
align-items: center;
min-height: 50rpx ;
justify-content: space-between;
}
.setborder
{
border: 1rpx solid #999;
}
.Ncu-bar {
display: flex;
position: relative;
align-items: center;
min-height: 70rpx ;
justify-content: space-between;
}
.Ncu-bar1 {
display: flex;
position: relative;
align-items: center;
min-height: 70rpx ;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,9 @@
{
"usingComponents": {
"loscom": "/components/logscom/logscom",
"HostUpgrade":"/pages/HostUpgrade/HostUpgrade",
"Upgrade":"/pages/Upgrade/Upgrade"
}
}

View File

@@ -0,0 +1,668 @@
<!-- pages/Hosts/Hosts.wxml{{isback}} -->
<cu-custom bgColor="bg-gradual-blue"
isBack="true">
<block bindtap="back" slot="backText" >返回</block>
<view slot="content">{{Hotelinfo.HotelName}}({{Hotelinfo.Code}})</view>
</cu-custom>
<view class="padding-sm bg-white radius shadow shadow-lg" style="padding-bottom:0;">
<!-- 头部区域 -->
<view>
<!-- 酒店信息 {{Hotelinfo.HotelId}}-->
<!-- <view class="margin-xs basis-xl">{{Hotelinfo.Code}}<span class="padding-left-xs">{{Hotelinfo.HotelName}}</span></view> -->
<!-- <view class="flex justify-end basis-xs">
<view class="text-green" bindtap="HelpClick">{{Help?'关闭':'帮助'}}</view>
</view> -->
<!---->
<!-- 导航栏 -->
<view class="flex flex-wrap">
<!-- 分类显示 -->
<view class="basis-xxxl ">
<button style="margin-right: 2px;" data-index="0" bindtap="GetshowinfoClick" class="cu-btn bg-{{showinfo==0?'green':'grey'}} ">全部</button>
<button style="margin-right: 2px;" data-index="1" bindtap="GetshowinfoClick" class="cu-btn bg-{{showinfo==1?'green':'grey'}} ">主机绑定</button>
<button style="margin-right: 2px;" data-index="2" bindtap="GetshowinfoClick" class="cu-btn bg-{{showinfo==2?'green':'grey'}} ">人脸机</button>
<button style="margin-right: 2px;" data-index="4" bindtap="GetshowinfoClick" class="cu-btn bg-{{showinfo==4?'green':'grey'}} ">主机蓝牙升级</button>
<button style="margin-right: 2px;" data-index="5" bindtap="GetshowinfoClick" class="cu-btn bg-{{showinfo==5?'green':'grey'}} ">主机升级</button>
<button style="margin-right: 2px;" data-index="3" bindtap="GetshowinfoClick1" class="cu-btn bg-{{showinfo==3?'green':'grey'}} ">刷新</button>
</view>
<view>
<view class="text-green" bindtap="HelpClick">{{Help?'关闭':'帮助'}}</view>
</view>
<!-- 标识区域 -->
<!-- <view class="basis-lg">
<view class="flex flex-wrap margin-left-xs">
<view class="basis-df flex">
<view style="width:0rpx;height:0rpx;margin-top:12rpx;" class="padding-xs bg-green"></view>
<text class="text-black text-df margin-left-xs margin-right-xs">绑定成功<text class="margin-left-xs"></text>{{statusdata[0]}}</text>
</view>
<view class="basis-df flex">
<view style="width:0rpx;height:0rpx;margin-top:12rpx;" class="padding-xs bg-red"></view>
<text class="text-black text-df margin-left-xs margin-right-xs">绑定失败<text class="margin-left-xs"></text>{{statusdata[1]}}</text>
</view>
<view class="basis-df flex">
<view style="width:0rpx;height:0rpx;margin-top:12rpx;" class="padding-xs bg-yellow"></view>
<text class="text-black text-df margin-left-xs margin-right-xs">解除绑定<text class="margin-left-xs"></text>{{statusdata[2]}}</text>
</view>
<view class="basis-df flex">
<view style="width:0rpx;height:0rpx;margin-top:12rpx;" class="padding-xs bg-grey"></view>
<text class="text-black text-df margin-left-xs margin-right-xs">未操作<text class="margin-left-xs"></text>{{statusdata[3]}}</text>
</view>
</view>
</view> -->
<!-- 按钮区域 -->
<!-- <view class="basis-sm flex flex-wrap">
<view class="flex flex-wrap text-center ">
<view class="basis-df" bindtap="islogsClick">
<view class=" radius bg-red">
<text class=" text-df text-white" >{{islogs?'退出':'操作记录'}}<text class="text-lg"></text></text>
</view>
</view>
<view class="basis-df">
<view data-index="0" bindtap="GetClick" class=" margin-left-xs radius bg-{{sel==0?'green':'grey'}} ">
<text class=" text-df text-white">全部<text class="margin-left-xs text-lg">{{HostsData.length}}</text></text>
</view>
</view>
<view class="basis-df">
<view data-index="2" bindtap="GetClick" class="margin-top-xs radius bg-{{sel==2?'green':'grey'}} ">
<text class=" text-df text-white">未绑<text class="margin-left-xs text-lg">{{NMac}}</text></text>
</view>
</view>
<view class="basis-df ">
<view data-index="1" bindtap="GetClick" class=" margin-top-xs margin-left-xs radius bg-{{sel==1?'green':'grey'}} ">
<text class="text-df text-white">已绑<text class="margin-left-xs text-lg">{{YMac}}</text></text>
</view>
</view>
</view>
</view> -->
</view>
<view class="bg-gray margin-xs" style="padding:2rpx"></view>
</view>
<!-- 房间显示区域 -->
<scroll-view id="scroll" wx:if="{{!Help && !islogs && showinfo!=4&& showinfo!=5}}" style="height:{{top_height==null?'600rpx':top_height+'px'}} ;padding-bottom:10rpx" scroll-y="true">
<view class="grid col-4 text-center" wx:if="{{showinfo<4}}">
<view wx:for="{{HostsDataFilters}}">
<view class="padding-xs">
<view style="font:bold;white-space: nowrap;overflow: hidden;" class="text-df {{item.xg!=null?(item.xg==0?'bg-green':(item.xg==1?'bg-red':'bg-yellow')):'bg-grey'}}">
{{item.RoomNumber}}
</view>
<view class="light bg-grey " style="height:{{showinfo==0?'170rpx':showinfo==3?'170rpx':'85rpx'}}">
<!-- rcu主机 -->
<view wx:if="{{showinfo!=2}}" bindtouchstart="handleTouchStart"
bindtouchend="handleTouchEnd"
data-index="{{index}}" bindlongtap="GetMAC_long" bindtap="GetMAC">
<block wx:if="{{item.MAC.length==17}}">
<view class="text-sm">M:{{item.MAC[0]}}{{item.MAC[1]}}{{item.MAC[2]}}{{item.MAC[3]}}{{item.MAC[4]}}{{item.MAC[5]}}{{item.MAC[6]}}{{item.MAC[7]}}{{item.MAC[8]}}
</view>
<view class="text-df">{{item.MAC[9]}}{{item.MAC[10]}}{{item.MAC[11]}}{{item.MAC[12]}}{{item.MAC[13]}}{{item.MAC[14]}}{{item.MAC[15]}}{{item.MAC[16]}}
</view>
</block>
<block wx:if="{{item.MAC.length<17 || !item.MAC || item.MAC.length==0}}" >
<!-- 两个 view 是因为 mac 是两行 -->
<view class="text-sm light" >
<!-- xiaoxi --> RCU
</view> <!-- style="opacity:0" -->
<view class="text-sm light" style="color: #e7ebee;">
<!-- xiaoxi -->绑定
</view>
</block>
</view>
<view class=" bg-white" style="height: 2rpx;" wx:if="{{showinfo==0}}"></view>
<!-- 人脸机 -->
<view wx:if="{{showinfo!=1 }}" bindtouchstart="handleTouchStart"
bindtouchend="handleTouchEnd"
data-index="{{index}}" bindlongtap="GetFaceSN_long" bindtap="GetFaceSN">
<block wx:if="{{item.FaceStatus==true}}">
<block wx:if="{{item.FaceSN.length>0}}">
<view style="color: #17852d;" class="text-df">s:{{item.FaceSN[0]}}{{item.FaceSN[1]}}{{item.FaceSN[2]}}{{item.FaceSN[3]}}{{item.FaceSN[4]}}{{item.FaceSN[5]}}{{item.FaceSN[6]}}{{item.FaceSN[7]}}
</view>
<view style="color: #17852d;" class="text-df">{{item.FaceSN[8]}}{{item.FaceSN[9]}}{{item.FaceSN[10]}}{{item.FaceSN[11]}}{{item.FaceSN[12]}}{{item.FaceSN[13]}}{{item.FaceSN[14]}}{{item.FaceSN[15]}}
</view>
</block>
<!-- <block wx:if="{{item.FaceSN.length==0}}">
style="opacity:0"
<view class="text-sm light">
xiaoxi
</view>
class="text-df light" style="opacity:0"
<view class="text-sm light">
xiaoxi
</view>
</block> -->
</block>
<block wx:else="{{item.FaceStatus==false}}">
<block wx:if="{{item.FaceSN.length>0}}">
<view style="color: #d11515;" class="text-df">s:{{item.FaceSN[0]}}{{item.FaceSN[1]}}{{item.FaceSN[2]}}{{item.FaceSN[3]}}{{item.FaceSN[4]}}{{item.FaceSN[5]}}{{item.FaceSN[6]}}{{item.FaceSN[7]}}
</view>
<view style="color:#d11515;" class="text-df">{{item.FaceSN[8]}}{{item.FaceSN[9]}}{{item.FaceSN[10]}}{{item.FaceSN[11]}}{{item.FaceSN[12]}}{{item.FaceSN[13]}}{{item.FaceSN[14]}}{{item.FaceSN[15]}}
</view>
</block>
<block wx:if="{{item.FaceSN.length==0}}">
<!-- class="text-sm light" style="opacity:0" -->
<view class="text-sm light">
<!-- xiaoxi -->人脸机
</view>
<!-- class="text-df light" style="opacity:0" -->
<view class="text-sm light" style="color: #e7ebed;">
绑定
</view>
</block>
</block>
</view>
</view>
</view>
</view>
<view wx:if="{{HostsDataFilters.length<=0}}">
暂无数据~
</view>
</view>
</scroll-view>
<HostUpgrade wx:if="{{showinfo==4}}" paramA="{{showinfo}}" myProperty="{{roomtype}}" nheight="{{top_height==null?'600':top_height}}" style="height:{{top_height==null?'600rpx':top_height+'rpx'}} ;padding-bottom:10rpx"></HostUpgrade>
<Upgrade wx:if="{{showinfo==5}}" style="height:{{top_height==null?'600rpx':top_height+'px'}} ;padding-top:10rpx;"></Upgrade>
<!-- 帮助区域 -->
<view wx:if="{{Help}}" class="padding-xs">
<view class="cu-card article">
<view class="cu-item shadow " style="margin:0;padding-bottom:0;">
<view class="title" style="line-height:initial;"><view class="text-cut">颜色指示块</view></view>
<view class="content">
<view class="desc">
<view class="text-content text-df">
指示块,仅针对本次进入页面有效,不代表历史操作记录,刷新或者重新进入页面都会执行重置操作。
</view>
</view>
</view>
</view>
</view>
<view class="cu-card article">
<view class="cu-item shadow " style="margin:0;padding-bottom:0;">
<view class="title" style="line-height:initial;"><view class="text-cut">MAC绑定操作</view></view>
<view class="content">
<view class="desc">
<view class="text-content text-df" style="height: auto;">
<view class="text-df text-green">点击</view>
点击房间如果已经绑定MAC会弹出提示语句点击继续继续执行扫码绑定扫码后,会有普通的MAC矫正如果MAC已经被绑定会再次弹出提示语句
如果MAC绑定的酒店有权限就会有提示语句然后可以点击继续执行绑定这将解除原有绑定绑定当前MAC;如果MAC绑定的酒店没有权限就仅有提示语而没有继续绑定按钮。
<view class="text-df text-green">长按</view>
长按会执行手动输入MAC后续与点击扫码绑定一致~
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 操作日志 -->
<view wx:if="{{islogs}}" >
<loscom hotelsid="{{Hotelinfo.HotelId}}"></loscom>
</view>
</view>
<!-- 房间已经绑定弹窗提示 -->
<view class="cu-modal {{modal==1?'show':''}}">
<view class="cu-Ndialog">
<view class="cu-bar bg-white ">
<view>
<view class="action " bindtap="GetReturnSet" wx:if="{{ISLoopDebugging>0}}">
<text class="cuIcon-back"></text>
</view>
</view>
<view>
<view class="content text-{{selHosts.Status == 1 ? 'green':'red'}}}" >{{selHosts.RoomNumber}}已经绑定MAC({{selHosts.Status == 1 ? '在线':'离线'}})</view>
</view>
<view class="justify-end">
<view class="action justify-end" bindtap="GetHide" >
<text class="cuIcon-close text-red"></text>
</view>
</view>
</view>
<view wx:if="{{ISLoopDebugging===0}}">
<view class="padding-lg flex flex-wrap " >
<view class="basis-sm text-right">酒店:</view><view class="text-left basis-lg">{{Hotelinfo.HotelName}}</view>
<view class="basis-sm text-right">房间:</view><view class="basis-lg text-left">{{message[1]}}</view>
<view class="basis-sm text-right">MAC地址</view><view class="basis-lg text-left">{{message[0]}}</view>
<view class="basis-sm text-right">当前固件:</view><view class="basis-lg text-left">{{roomGfilename}}</view>
<view class="basis-sm text-right">当前配置:</view><view class="basis-lg text-left">{{roomPfilename}}</view>
<view class=" text-left flex-sub text-sm text-gray">房间已经绑定MAC点击继续将执行扫描绑定点击取消将不会执行任何操作~</view>
</view>
<view class=" bg-white">
<view class="Ncu-bar bg-white">
<view class="action margin-0 flex-sub text-green " data-type="0" bindtap="ConfigurationUpgrade">固件升级</view>
<view class="action margin-0 flex-sub text-green solid-left" bindtap="FirmwareUpgrade" >配置升级</view>
<view class="action margin-0 flex-sub solid-left" bindtap="LoopDebugging" >回路调试</view>
</view>
<view class="Ncu-bar bg-white">
<view class="action margin-0 flex-sub text-green " data-type="0" bindtap="ErrorInfo">反馈错误</view>
<view class="action margin-0 flex-sub text-green solid-left" bindtap="GetHide" >取消</view>
<view class="action margin-0 flex-sub solid-left" bindtap="{{input == 0?'GetCode':'ShowInput'}}" >继续</view>
</view>
</view>
</view>
<view wx:if="{{ISLoopDebugging===1}}" style="height:95%" class="bg-white" >
<scroll-view style="height:90%" id="LoopDebugging" scroll-y="true" scroll-top="true">
<view class="bg-white ">
<!-- <view style="text-align: left;font-weight: bold">播放测试:</view> -->
<!-- <view style="text-align: left;font-weight: bold">播放测试:</view> -->
<view class="Ncu-bar bg-white">
<button bindtap="GetshowinfoClick" class="cu-btn round1 ulg margin-5" style="font-weight: bold;">播放欢迎词</button>
<!-- <view style="text-align: left;font-weight: bold" class=" margin-xs radius ">音量:</view> -->
<slider style="width:50%;" min="30" max="100" step="1" value="{{VolumeLevel}}" bindchange="changeVolumeLevel" ></slider>
<view>{{VolumeLevel}}</view>
</view>
<view class="ControlLine"></view>
</view>
<view class="bg-white " wx:for="{{roomtypeInfoNodeinfo}}" wx:for-item="row" wx:for-index="rowIndex">
<view class=" bg-white " wx:if="{{row[0]===1}}" >
<!-- <view style="text-align: left;font-weight: bold">设置设备开关状态:</view> -->
<view class="Ncu-bar bg-white flex-sub" wx:for="{{row[1].length/4 }}" wx:for-index="colIndex" >
<view class="Ncu-bar bg-white" wx:if="{{colIndex*4<row[1].length}}">
<button id="1" class="cu-btn round1 margin-3 vlg" data-value="1" data-index="{{row[1][colIndex*4][0]}}" bindtap="SetDeviceSwitchStatus" wx:if="{{colIndex*4<row[1].length}}" style="background-color: {{row[1][colIndex*4][2][0][2]===0 ? '#E6E6E6 ':'#39b54a'}};" >{{row[1][colIndex*4][1] }}</button>
<button id="1" class="cu-btn round1 margin-3 vlg" data-value="1" data-index="{{row[1][colIndex*4+1][0]}}" bindtap="SetDeviceSwitchStatus" wx:if="{{colIndex*4+1<row[1].length}}" style="background-color: {{row[1][colIndex*4+1][2][0][2]===0 ? '#E6E6E6':'#39b54a'}};">{{row[1][colIndex*4+1][1] }}</button>
<button id="1" class="cu-btn round1 margin-3 vlg" data-value="1" data-index="{{row[1][colIndex*4+2][0]}}" bindtap="SetDeviceSwitchStatus" wx:if="{{colIndex*4+2<row[1].length}}" style="background-color: {{row[1][colIndex*4+2][2][0][2]===0 ? '#E6E6E6':'#39b54a'}};">{{row[1][colIndex*4+2][1] }}</button>
<button id="1" class="cu-btn round1 margin-3 vlg" data-value="1" data-index="{{row[1][colIndex*4+3][0]}}" bindtap="SetDeviceSwitchStatus" wx:if="{{colIndex*4+3<row[1].length}}" style="background-color: {{row[1][colIndex*4+3][2][0][2]===0 ? '#E6E6E6':'#39b54a'}};">{{row[1][colIndex*4+3][1] }}</button>
<!-- <button class="cu-btn round margin-3 nlg" data-index="{{row[1][colIndex*5+4][0]}}" bindtap="SetDeviceSwitchStatus" wx:if="{{colIndex*4+4<row[1].length}}">{{row[1][colIndex*4+4][1] }}</button> -->
<!-- <button class="cu-btn round margin-3 nlg" data-index="{{row[1][colIndex*6+5][0]}}" bindtap="SetDeviceSwitchStatus" wx:if="{{colIndex*6+5<row[1].length}}">{{row[1][colIndex*6+5][1] }}</button> -->
</view>
</view>
<view class="ControlLine"></view>
</view>
<view class="bg-white" wx:if="{{row[0]===23}}">
<!-- <view style="text-align: left;font-weight: bold">设置调光亮度:</view> -->
<view class="bg-white" wx:for="{{row[1].length}}" wx:for-index="DimIndex" >
<view class="Ncu-bar bg-white">
<view class="flex-twice">{{row[1][DimIndex][1]}}</view>
<slider id="23" data-index="{{row[1][DimIndex][0]}}" class="flex-eight" min="10" max="90" step="1" value="{{row[1][DimIndex][2][0][2]}}" bindchange="SetDeviceSwitchStatusslider" ></slider>
<view class="flex-sub">{{row[1][DimIndex][2][0][2]}}</view>
</view>
</view>
<view class="ControlLine"></view>
</view>
<view class="bg-white" wx:if="{{row[0]===52}}">
<!-- <view style="text-align: left;font-weight: bold">色温控制:</view> -->
<view class="Ncu-bar bg-white">
<view class="action margin-0 flex-twice text-green " >开关</view>
<view class="action margin-0 flex-xis text-green solid-left" >色温</view>
<view class="action margin-0 flex-xis text-green solid-left" >亮度</view>
</view>
<view class=" bg-white" wx:for="{{row[1].length}}" wx:for-index="coloIndex" >
<view class="Ncu-bar bg-white">
<view class=" flex-twice margin-3 " >
<button id="52" data-type="1" data-value="1" data-index="{{row[1][coloIndex][0]}}" class="cu-btn round1 Elg" bindtap="SetDeviceSwitchStatus" style="background-color: {{row[1][coloIndex][2][0][2]===0 ? '#E6E6E6 ':'#39b54a'}};" >{{row[1][coloIndex][1]}}</button>
</view>
<view class=" flex-xis Ncubar1 solid-left " >
<button id="52" data-type="2" data-value="20" data-index="{{row[1][coloIndex][0]}}" class="margin-3 cu-btn round1 EElg" bindtap="SetDeviceSwitchStatus" style="background-color: {{row[1][coloIndex][2][1][2]===20 ? '#39b54a':'#E6E6E6 '}};">20</button>
<button id="52" data-type="2" data-value="50" data-index="{{row[1][coloIndex][0]}}" class="margin-3 cu-btn round1 EElg" bindtap="SetDeviceSwitchStatus" style="background-color: {{row[1][coloIndex][2][1][2]===50 ? '#39b54a':'#E6E6E6 '}};">50</button>
<button id="52" data-type="2" data-value="80" data-index="{{row[1][coloIndex][0]}}" class="margin-3 cu-btn round1 EElg" bindtap="SetDeviceSwitchStatus" style="background-color: {{row[1][coloIndex][2][1][2]===80 ? '#39b54a':'#E6E6E6 '}};">80</button>
</view>
<view class="ControlLine_h"></view>
<view class=" flex-xis Ncubar1 " >
<button id="52" data-type="3" data-value="20" data-index="{{row[1][coloIndex][0]}}" class="margin-3 cu-btn round1 EElg" bindtap="SetDeviceSwitchStatus" style="background-color: {{row[1][coloIndex][2][2][2]===20 ? '#39b54a':'#E6E6E6 '}};">20</button>
<button id="52" data-type="3" data-value="50" data-index="{{row[1][coloIndex][0]}}" class="margin-3 cu-btn round1 EElg" bindtap="SetDeviceSwitchStatus" style="background-color: {{row[1][coloIndex][2][2][2]===50 ? '#39b54a':'#E6E6E6 '}};">50</button>
<button id="52" data-type="3" data-value="80" data-index="{{row[1][coloIndex][0]}}" class="margin-3 cu-btn round1 EElg" bindtap="SetDeviceSwitchStatus" style="background-color: {{row[1][coloIndex][2][2][2]===80 ? '#39b54a':'#E6E6E6 '}};">80</button>
</view>
</view>
<!-- <view class="Ncubar1 bg-white" style="text-align: left;">
<view class="flex-twice">
<view style="text-align: left;font-weight: bold">{{row[1][coloIndex][1]}}:</view>
</view>
<view class="flex-8">
<switch class="Green" data-index="{{item}}" bindchange="Loopswitch"></switch>
</view>
</view> -->
<!-- <view class="Ncu-bar bg-white flex-eight">
<button class="cu-btn round vlg">亮度20</button>
<button class="cu-btn round vlg">亮度80</button>
<button class="cu-btn round vlg">色温20</button>
<button class="cu-btn round vlg">色温80</button>
</view> -->
</view>
<view class="ControlLine"></view>
</view>
<view class="bg-white" wx:if="{{row[0]===5}}">
<!-- <view style="text-align: left;font-weight: bold">设置设备开停关状态:</view> -->
<view class="bg-white" wx:for="{{row[1].length}}" wx:for-index="coloIndex">
<view class="Ncu-bar bg-white">
<view class="flex-treble" style="font-weight: bold">{{row[1][coloIndex][1]}}</view>
<view class="Ncubar1 bg-white flex-eight">
<button id="5" data-value="1" class="margin-3 cu-btn round1 clg" style="background-color:{{row[1][coloIndex][2][0][2]===1 ? '#39b54a':'#E6E6E6'}};" data-index="{{row[1][coloIndex][0]}}" bindtap="SetDeviceSwitchStatus" >开</button>
<button id="5" data-value="2" class="margin-3 cu-btn round1 clg" style="background-color:{{row[1][coloIndex][2][0][2]===2 ? '#39b54a':'#E6E6E6'}};" data-index="{{row[1][coloIndex][0]}}" bindtap="SetDeviceSwitchStatus" >关</button>
<button id="5" data-value="6" class="margin-3 cu-btn round1 clg" style="background-color:{{row[1][coloIndex][2][0][2]===6 ? '#39b54a':'#E6E6E6'}};" data-index="{{row[1][coloIndex][0]}}" bindtap="SetDeviceSwitchStatus">停</button>
</view>
</view>
<view class="ControlLine"></view>
</view>
<view class="ControlLine"></view>
</view>
<view class="bg-white" wx:if="{{row[0]===7}}">
<!-- <view style="text-align: left;font-weight: bold">设置温控设备状态:</view> -->
<view class=" bg-white" wx:for="{{row[1].length}}" wx:for-index="coloIndex">
<view class="Ncu-bar bg-white">
<view class=" flex-twice margin-xs " >
<!-- <button class="cu-btn round1 Elg">{{row[1][coloIndex][1]}}</button> -->
<button id="7" data-type="1" data-value="1" data-index="{{row[1][coloIndex][0]}}" class="cu-btn round1 Elg" bindtap="SetDeviceSwitchStatus" style="background-color: {{row[1][coloIndex][2][0][2]===0 ? '#E6E6E6 ':'#39b54a'}};" >{{row[1][coloIndex][1]}}</button>
</view>
<view class=" flex-8 Ncubar1 solid-left " >
<button id="7" data-type="2" data-value="1" data-index="{{row[1][coloIndex][0]}}" class=" cu-btn round1 clg margin-3" bindtap="SetDeviceSwitchStatus" style="background-color: {{row[1][coloIndex][2][1][2]===4 ? '#E6E6E6 ':row[1][coloIndex][2][1][2]===3 ? '#1cbbb4':row[1][coloIndex][2][1][2]===2 ? '#e54d42':'#0081ff'}};" >{{row[1][coloIndex][2][1][2]===4 ? '自动':row[1][coloIndex][2][1][2]===3 ? '送风':row[1][coloIndex][2][1][2]===2 ? '制热':'制冷'}}</button>
<button id="7" data-type="3" data-value="1" data-index="{{row[1][coloIndex][0]}}" class=" cu-btn round1 clg margin-3" bindtap="SetDeviceSwitchStatus" >{{row[1][coloIndex][2][2][2]===4 ? '自动':row[1][coloIndex][2][2][2]===3 ? '高风速':row[1][coloIndex][2][2][2]===2 ? '中风速':'低风速'}}</button>
<button id="7" data-type="4" data-value="1" data-index="{{row[1][coloIndex][0]}}" bindtap="SetDeviceSwitchStatus" class=" cu-btn round1 vvlg margin-3">-</button>
<text class=" textvlg">{{row[1][coloIndex][2][3][2]}}</text>
<button id="7" data-type="5" data-value="1" data-index="{{row[1][coloIndex][0]}}" bindtap="SetDeviceSwitchStatus" class=" cu-btn round1 vvlg margin-3">+</button>
</view>
</view>
<!-- <view class="Ncubar1 bg-white" style="text-align: left;">
<view class="flex-twice">
<view style="text-align: left;font-weight: bold">{{row[1][coloIndex][1]}}:</view>
</view>
<view class="flex-8">
<switch class="Green" data-index="{{item}}" bindchange="Loopswitch"></switch>
</view>
</view>
<view class=" bg-white flex-eight">
<view class="Ncu-bar bg-white flex-eight">
<button class=" cu-btn round1 vlg margin-3">制冷</button>
<button class=" cu-btn round1 vlg margin-3">制热</button>
<button class=" cu-btn round1 vlg margin-3">20度</button>
<button class=" cu-btn round1 vlg margin-3">30度</button>
</view>
<view class="Ncu-bar bg-white flex-eight">
<button class="cu-btn round1 vlg margin-3">风速高</button>
<button class="cu-btn round1 vlg margin-3">风速中</button>
<button class="cu-btn round1 vlg margin-3">风速低</button>
<button class="cu-btn round1 vlg margin-3">自动</button>
</view>
</view> -->
<view class="ControlLine"></view>
</view>
<view class="ControlLine"></view>
</view>
</view>
</scroll-view>
</view>
<view wx:if="{{ISLoopDebugging===2}}" class="bg-white" >
<view style="text-align: left;font-weight: bold">设备当前版本:</view>
<view>{{UpgradestIstrue == 0? Upgradenode.Gfilename:Upgradenode.Pfilename}}</view>
<view style="text-align: left;font-weight: bold">准备升级版本:</view>
<view>{{UpgradestIstrue == 0? Upgradenode.App_Cfg_For_L4:Upgradenode.CONFIG_BIN}}</view>
<view class="Ncubar1 bg-white">
<view class=" text-left " wx:if="{{Upgradestatus.length>0}}" >升级状态:</view>
<view class=" text-left " style="font-weight: bold;">{{Upgradestatus}}</view>
</view>
</view>
</view>
</view>
<!-- MAC已经被绑定弹窗提示 -->
<view class="cu-modal {{modal==3 || modal==4?'show':''}}">
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end">
<view class="content">{{code}}已经被绑定</view>
<view class="action" bindtap="GetHide" >
<text class="cuIcon-close text-red"></text>
</view>
</view>
<view class="padding-xs flex flex-wrap justify-center " >
<view class="basis-xl text-sm" wx:for="{{bdHosts}}" >
<text class=" text-right ">酒店:</text><text class="text-left text-red">{{item.HotelName}}</text>
<text class="padding-left-xs text-right " >房间:</text><text class="text-left text-red">{{item.RoomNumber}}</text>
<button class="cu-btn margin-left-xs sm bg-red" wx:if="{{item.qx == 0}}" data-index="{{index}}" type="" bindtap="Jb" >解绑</button>
<button class="cu-btn margin-left-xs sm bg-red" wx:if="{{item.qx != 0}}" disabled >解绑</button>
</view>
<view class="basis-xl">MAC地址<text class="text-left">{{code}}</text></view>
<view class="basis-xl text-left text-sm text-gray">MAC已经被其他房间绑定点击继续将取消原有绑定执行新的绑定点击取消将不会执行任何操作~</view>
</view>
<view class="cu-bar bg-white">
<view class="action margin-0 flex-sub text-green " data-type="1" bindtap="ErrorInfo">反馈错误</view>
<view class="action margin-0 flex-sub text-green solid-left" bindtap="GetHide" >取消</view>
<view wx:if="{{bdHosts.length<=0}}" class="action margin-0 flex-sub solid-left" data-type="false" bindtap="GetMacOKend" >继续</view>
</view>
</view>
</view>
<!-- 手动输入mac地址 -->
<view class="cu-modal {{modal==1000?'show':''}}">
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end">
<view class="content">为{{selHosts.RoomNumber}}绑定MAC</view>
<view class="action" bindtap="GetHide" >
<text class="cuIcon-close text-red"></text>
</view>
</view>
<view class="padding-lg flex flex-wrap " >
<view class="basis-sm text-right">房间:</view><view class="basis-lg text-left">{{selHosts.RoomNumber}}</view>
<view class="basis-sm text-right">MAC地址</view>
<view class="basis-lg text-left">
<input placeholder="手动输入MAC" model:value="{{code}}" name="input"></input>
</view>
</view>
<view class="cu-bar bg-white">
<view class="action margin-0 flex-sub text-green solid-left" bindtap="GetHide" >取消</view>
<view class="action margin-0 flex-sub solid-left" bindtap="GetMACOK" >确认</view>
</view>
</view>
</view>
<!-- 确定绑定 -->
<view class="cu-modal {{modal==521?'show':''}}">
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end">
<view class="content">绑定确认</view>
<view class="action" bindtap="GetHide" >
<text class="cuIcon-close text-red"></text>
</view>
</view>
<view class="padding-lg flex flex-wrap " >
<view class="basis-sm text-right">酒店:</view><view class="text-left basis-lg">{{Hotelinfo.HotelName}}</view>
<view class="basis-sm text-right">房间:</view><view class="basis-lg text-left">{{selHosts.RoomNumber}}</view>
<view class="basis-sm text-right">MAC地址</view><view class="basis-lg text-left">{{code}}</view>
<view class=" text-left flex-sub text-sm text-gray">确定为房间绑定MAC点击继续将执行扫描绑定点击取消将不会执行任何操作~</view>
</view>
<view class="cu-bar bg-white">
<view class="action margin-0 flex-sub text-green solid-left" bindtap="GetHide" >取消</view>
<view class="action margin-0 flex-sub solid-left" data-type="true" bindtap="GetMacOKend" >继续</view>
</view>
</view>
</view>
<!-- 无效条形码 -->
<view class="cu-modal {{modal==520?'show':''}}">
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end">
<view class="content">无效条码</view>
<view class="action" bindtap="GetHide" >
<text class="cuIcon-close text-red"></text>
</view>
</view>
<view class="padding-lg flex flex-wrap " >
<view class="basis-sm text-right">无效条码:</view><view class="basis-lg text-left">{{code}}</view>
<view class=" text-left flex-sub text-sm text-gray">扫描的条码为无效条码~</view>
</view>
<view class="cu-bar bg-white">
<view class="action margin-0 flex-sub text-green solid-left" bindtap="GetHide" >确定</view>
</view>
</view>
</view>
<!-- 确定绑定 -->
<view class="cu-modal {{modal==-521?'show':''}}">
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end">
<view class="content">绑定确认</view>
<view class="action" bindtap="GetHide" >
<text class="cuIcon-close text-red"></text>
</view>
</view>
<view class="padding-lg flex flex-wrap " >
<view class="basis-sm text-right">酒店:</view><view class="text-left basis-lg">{{Hotelinfo.HotelName}}</view>
<view class="basis-sm text-right">房间:</view><view class="basis-lg text-left">{{selHosts.RoomNumber}}</view>
<view class="basis-sm text-right">人脸机SN</view><view class="basis-lg text-left">{{code}}</view>
<view class=" text-left flex-sub text-sm text-gray">确定为房间绑定SN点击继续将执行扫描绑定点击取消将不会执行任何操作~</view>
</view>
<view class="cu-bar bg-white">
<view class="action margin-0 flex-sub text-green solid-left" bindtap="GetHide" >取消</view>
<view class="action margin-0 flex-sub solid-left" data-type="true" bindtap="GetFaceSNend" >继续</view>
</view>
</view>
</view>
<!-- 房间已经绑定人脸机弹窗提示 -->
<view class="cu-modal {{modal==-1?'show':''}}">
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end">
<view class="content">{{selHosts.RoomNumber}}已经绑定人脸机</view>
<view class="action" bindtap="GetHide" >
<text class="cuIcon-close text-red"></text>
</view>
</view>
<view class="padding-lg flex flex-wrap " >
<view class="basis-sm text-right">酒店:</view><view class="text-left basis-lg">{{Hotelinfo.HotelName}}</view>
<view class="basis-sm text-right">房间:</view><view class="basis-lg text-left">{{message[1]}}</view>
<view class="basis-sm text-right">人脸机SN</view><view class="basis-lg text-left">{{message[0]}}</view>
<view class=" text-left flex-sub text-sm text-gray">房间已经绑定人脸机,点击继续将执行扫描绑定;点击取消,将不会执行任何操作~</view>
</view>
<view class="cu-bar bg-white">
<!-- <view class="action margin-0 flex-sub " data-type="0" bindtap="ErrorInfo">反馈错误</view>text-red -->
<view id="{{Hotelinfo.HotelName}}_{{message[1]}}_{{message[0]}}_{{Hotelinfo.Code}}_{{Hotelinfo.HotelId}}" class="action margin-0 flex-sub text-green solid-left" style="font-weight: 600;" bindtap="testinfo" >设置</view>
<view id="{{Hotelinfo.HotelName}}_{{message[1]}}_{{message[0]}}_{{Hotelinfo.Code}}" class="action margin-0 flex-sub text-green solid-left" style="font-weight: 600;" bindtap="OpenDoor" >开门</view>
<!-- <view class="action margin-0 flex-sub {{selHosts.FaceSN!=''?'show':''}} text-red solid-left" bindtap="JbSn" >解绑</view> -->
<!-- <view class="action margin-0 flex-sub solid-left" bindtap="GetHide" >取消</view> -->
<!-- <view class="action margin-0 flex-sub text-green solid-left" bindtap="{{FaceSNinput == 0?'GetFaceCode':'ShowInputsn'}}" >继续</view> -->
</view>
</view>
</view>
<!-- SN已经被绑定弹窗提示 -->
<view class="cu-modal {{modal==-200?'show':''}}">
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end">
<view class="content">{{code}}已经被绑定
</view>
<view class="action" bindtap="GetHide" >
<text class="cuIcon-close text-red"></text>
</view>
</view>
<view class="padding-xs flex flex-wrap justify-center " >
<view class="basis-xl text-sm" wx:for="{{bdHosts}}" >
<text class=" text-right ">酒店:</text><text class="text-left text-red">{{item.HotelName}}</text>
<text class="padding-left-xs text-right " >房间:</text><text class="text-left text-red">{{item.RoomNumber}}</text>
<button class="cu-btn margin-left-xs sm bg-red" wx:if="{{item.qx == 0}}" data-index="{{index}}" type="" bindtap="JbSn" >解绑</button>
<button class="cu-btn margin-left-xs sm bg-red" wx:if="{{item.qx != 0}}" disabled >解绑</button>
</view>
<view class="basis-xl">SN<text class="text-left">{{code}}</text></view>
<view class="basis-xl text-left text-sm text-gray">SN已经被其他房间绑定点击继续将取消原有绑定执行新的绑定点击取消将不会执行任何操作~</view>
</view>
<view class="cu-bar bg-white">
<view class="action margin-0 flex-sub text-green solid-left" bindtap="GetHide" >取消</view>
<view wx:if="{{bdHosts.length<=0}}" class="action margin-0 flex-sub solid-left" data-type="false" bindtap="GetFaceSNend" >继续</view>
</view>
</view>
</view>
<!-- 手动输入SN地址 -->
<view class="cu-modal {{modal==-1000?'show':''}}">
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end">
<view class="content">为{{selHosts.RoomNumber}}绑定人脸机SN</view>
<view class="action" bindtap="GetHide" >
<text class="cuIcon-close text-red"></text>
</view>
</view>
<view class="padding-lg flex flex-wrap " >
<view class="basis-sm text-right">房间:</view><view class="basis-lg text-left">{{selHosts.RoomNumber}}</view>
<view class="basis-sm text-right">人脸机SN</view>
<view class="basis-lg text-left">
<input placeholder="手动输入SN" model:value="{{code}}" name="input"></input>
</view>
</view>
<view class="cu-bar bg-white">
<view class="action margin-0 flex-sub text-green solid-left" bindtap="GetHide" >取消</view>
<view class="action margin-0 flex-sub solid-left" bindtap="GetFaceSNOK" >确认</view>
</view>
</view>
</view>

View File

@@ -0,0 +1,42 @@
.Ncu-bar {
display: flex;
position: relative;
align-items: center;
min-height: 70rpx ;
justify-content: space-between;
}
.Ncu-bar1 {
display: flex;
position: relative;
align-items: center;
min-height: 70rpx ;
}
.Ncubar1 {
display: flex;
position: relative;
align-items:flex-start;
min-height: 70rpx ;
}
.ControlLine{
background-color: gray;
height: 1rpx;
width: 100%;
}
.ControlLine_h{
background-color: lightgray;
height: 80rpx;
width: 1rpx;
}
.textvlg {
display: inline-flex;
align-items: center;
justify-content: center;
text-align:center;
padding: 0 5rpx;
font-size:28rpx;
height: 80rpx;
width: 70rpx;
text-decoration: none;
}

View File

@@ -0,0 +1,948 @@
// pages/basics/MakingRounds/MakingRounds.js
const app = getApp()
//const upgrade = require('../../../utils/upgrade.js')
import {
GetHostsInfo,
GetMAC,
GetFaceSN,
ErrorInfo,
CheckFaceSN,
OpenDoorTest,
GetRoomType,
GetRoomTypeAndModalsListLog,
WebChatUpgrade,
QueryUpdateHostStatus,
ForwardQueryUpdateHostProgressBar,
GetRoomTypeNode,
SetRCULight,
SetRCUAir,
SetRCUCurtain,
} from '../../../lib/RequestingCenter.js'
import DeviceUpgrader from '../../../utils/upgrade.js';
// const DeviceUpgrader = require('../../../utils/upgrade.js');
const upgrader = new DeviceUpgrader();
Page({
/**
* 页面的初始数据
*/
data: {
TabCur:1,
RoomIndex:0,
//权限信息
autho: null,
//酒店信息
Hotelinfo: null,
HostsData:null,
HostsDataFilters:[],
isback:null,
HotelId:null,
statusdata:null,
onlineNumber:0,
inputValue:"",
toView:"",
scrollHeight: 0,
RoomtypeNamearray: [],
Completed:false, //是否处于升级状态
RoomtypeName: "",
devlist:[],
Roomtypeinfo:[],
Pfilename:"",
Gfilename:"",
Upgradenode:[],
myArray:[],
CurrentUpgradeDev:'', //当前升级设备
CurrentUpgradeDevStart:'',//当前升级设备状态
UpgradeAllCount:0,
//MAC绑定相关
selHosts: null,
code: null,
modal: 0,
input: 0,
bdHosts: [],
address: "",
},
/**
* 生命周期函数--监听页面加载
*/
onLoad:async function(options) {
if (!options.HotelId ) {
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, "网络繁忙")
});
app.globalData.HotelId=options.HotelId
await GetRoomType({
HotelID: options.HotelId
}).then(res => {
app.SetroontypeListindex(res)
this.setData({
myArray:app.globalData.roomIDName ,
RoomtypeNamearray:app.globalData.roomName
})
}, err => {
console.log('GetRoomType error')
}).catch(err => {
});
upgrader.on('progress', p => {
console.log(p)
this.setData({ CurrentUpgradeDevStart: p }) // 实时刷新 UI
})
upgrader.on('error', e => {
wx.showToast({ title: '升级失败', icon: 'none' })
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
this.calcScrollHeight();
},
calcScrollHeight() {
// 1. 拿到屏幕可用高度px
const sys = wx.getSystemInfoSync();
const screenHeight = sys.windowHeight; // px
// 2. 拿到 scroll-view 的 toppx
wx.createSelectorQuery()
.in(this)
.select('#myScroll')
.boundingClientRect(rect => {
if (rect) {
const topPx = rect.top; // px
const bottomPx = 10 / 2; // 10rpx → 5px2倍屏
const heightPx = screenHeight - topPx - bottomPx;
// 3. 转 rpx 并写入
this.setData({
scrollHeight: heightPx * 2 // px→rpx
});
}
})
.exec();
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
upgrader.cancelUpgrade()
upgrader._cleanup()
},
//MAC绑定相关方法
//检查MAC地址合法性
CheckMAC: function (vlues) {
return (vlues.indexOf("34D0B8") == 0 && vlues.length == 12 && vlues.indexOf(" ") < 0);
},
//扫码获取MAC地址
GetCode: async function () {
var that = this;
setTimeout(function () {
that.GetHide()
}, 100);
wx.scanCode({
onlyFromCamera: true,
success(res) {
that.setData({
code: res.result
})
that.GetMACOK();
},
fail(err) {
app.toast(2, "未识别到有效条形码")
}
})
},
//隐藏弹窗
GetHide() {
this.setData({
modal: 0,
input: 0,
})
},
//房间点击事件 - 扫码绑定
/**
* 获取主机MAC地址
* @async
* @function GetMAC
* @param {Object} e - 事件对象
* @param {number} e.currentTarget.dataset.index - 当前选中主机的索引
* @description 根据选中主机的索引获取MAC地址如果MAC地址不存在则调用GetCode方法
* @returns {Promise<void>}
*/
GetMAC: async function (e) {
let index = e.currentTarget.dataset['index'];
let selHosts = this.data.HostsDataFilters[index];
selHosts.index = index;
this.setData({
selHosts: selHosts,
input: 0
})
if (this.data.HostsDataFilters[index].MAC != "" && this.data.HostsDataFilters[index].MAC != null) {
this.setData({
modal: 1,
message: [this.data.HostsDataFilters[index].MAC, selHosts.RoomNumber]
})
} else {
this.GetCode()
}
},
//长按房间事件 - 手动输入MAC
GetMAC_long: function (e) {
let indexstr = e.currentTarget.id.replace("msg-","")
let index= Number(indexstr)
let selHosts = this.data.HostsDataFilters[index];
selHosts.index = index;
this.setData({
selHosts: selHosts,
input: 100
})
if (this.data.HostsDataFilters[index].MAC != "" && this.data.HostsDataFilters[index].MAC != null) {
this.setData({
modal: 1,
message: [selHosts.RoomNumber, this.data.HostsDataFilters[index].MAC]
})
} else {
this.ShowInput();
}
},
//显示手动输入MAC弹窗
ShowInput: function (params) {
this.setData({
modal: 1000,
code: ""
})
},
//验证手动输入的MAC地址
GetMACOK: function () {
let that = this;
if (!this.CheckMAC(that.data.code)) {
this.setData({
modal: 520
})
return;
}
this.setData({
modal: 521
})
},
//解绑MAC地址
Jb: async function(params) {
let index = params.currentTarget.dataset['index'];
let jbjd = this.data.bdHosts[index];
let that = this;
await GetMAC({
roomNumber: jbjd.RoomNumber,
roomID: jbjd.Id,
HotelID: jbjd.HotelID,
MAC: "",
NoCheck: false,
loc: that.data.address
}).then(
res => {
if (res.Status == 1000) {
app.toast(2, "无权限")
}
if (res.Status == 200) {
app.toast(1, "解绑成功")
var databdHosts = that.data.bdHosts;
databdHosts.splice(index, 1);
that.setData({
bdHosts: databdHosts
})
if (jbjd.HotelID != that.data.HotelId) {
return;
}
let data = that.data.HostsData;
let OLD = -1;
try {
data.forEach(
(x, INDEX) => {
if (x.RoomNumber === jbjd.RoomNumber) {
OLD = INDEX;
throw new Error();
}
}
)
} catch (error) {
}
if (OLD >= 0) {
data[OLD].MAC = "";
}
let res = that.GetFilters(that.data.sel, data);
that.setData({
HostsData: data,
HostsDataFilters: res[0],
statusdata: res[1]
})
} else {
app.toast(2, "解绑失败")
}
},
err => {
app.toast(2, "网络繁忙")
}
).catch(err => {
app.toast(2, "网络繁忙")
});
},
//最终绑定MAC地址
GetMacOKend: async function (type) {
let that = this;
if (type != true && type != false) {
type = type.currentTarget.dataset['type']
}
this.GetHide();
let xg = null;
await GetMAC({
roomNumber: that.data.selHosts.RoomNumber,
HotelID: that.data.selHosts.HotelID,
MAC: that.data.code,
NoCheck: type,
loc: that.data.address
}).then(
res => {
if (res.Status == 1000) {
xg = 100;
app.toast(2, "无权限")
}
if (res.Status == 200) {
xg = 0;
app.toast(1, "绑定成功")
//更新本地数据
let data = that.data.HostsData;
let OLD = -1;
try {
data.forEach(
(x, INDEX) => {
if (x.RoomNumber === that.data.selHosts.RoomNumber) {
OLD = INDEX;
throw new Error();
}
}
)
} catch (error) {
}
if (OLD >= 0) {
data[OLD].MAC = that.data.code;
}
that.setData({
HostsData: data,
HostsDataFilters: data
})
} else {
if (!type) {
xg = 1;
app.toast(2, "绑定失败")
} else {
try {
if (res.Status == 100) {
xg = 100;
let modal = 3;
let mesg = [that.data.code];
let bdHosts = res.Data.Hosts;
try {
that.data.autho.forEach((element, index) => {
element.Hotels.forEach((elements, indexs) => {
for (let index = 0; index < res.Data.Hosts.length; index++) {
if (elements.HotelId == res.Data.Hosts[index].HotelID) {
elements.Auth.forEach(Auth => {
if (Auth.AuthorityId == 16 && Auth.AuthotypeId == 3) {
bdHosts[index].qx = 0;
}
})
}
}
})
});
} catch (error) {
console.log(error)
}
that.setData({
modal: modal,
bdHosts: bdHosts,
message: mesg
})
} else {
if (res.Status == 150) {
xg = 1;
app.toast(2, "绑定失败")
} else {
xg = 100;
app.toast(2, "网络繁忙")
}
}
} catch (error) {
xg = 100;
console.log(error)
}
}
}
},
err => {
xg = 100;
app.toast(2, "网络繁忙")
}
).catch(err => {
xg = 100;
app.toast(2, "网络繁忙")
});
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
},
inputSearchForHotels(e){
this.setData({
inputValue: e.detail.value
})
},
async UpgradeTheEquipment(e){
let se=e
let _this =this
let updataDev = e.currentTarget.dataset.id
let errstr =""
if (updataDev == 1) {
errstr="固件"
}
if (updataDev == 2) {
errstr="配置"
}
wx.showModal({
title: "提示",
content: "是否进行"+errstr+"升级!",
async success (res) {
if (res.confirm) {
await _this.UpgradeTheEquipment2(se)
} else if (res.cancel) {
return
}
}
})
},
async UpgradeTheEquipment2(e){
let updataDev = e.currentTarget.dataset.id
let errstr =""
let devlist =this.data.devlist
let UpgradeType =""
let filename = ""
let RoomtypeName =this.data.RoomtypeName
let _this =this
let RoomTypeID=""
let HotelId= app.globalData.HotelId
let UpgradeCount=0
if (updataDev == 1) {
errstr="升级固件失败"
UpgradeType='firmware'
filename=_this.data.Gfilename
filename=filename.replace('.hex','.bin')
}
if (updataDev == 2) {
errstr="升级配置失败"
UpgradeType=''
filename=_this.data.Pfilename
}
if (filename.length ==0) {
_this.DisplayPrompt("未获取到升级文件!升级失败",3000)
return
}
RoomTypeID=this.GetRoomTypeId(RoomtypeName)
let newdevlist =[]
for (let i = 0; i < this.data.devlist.length; i++) {
devlist[i].UpgradeStatus = 0
if (devlist[i].checkbox) { //勾选
if (devlist[i].Status) { //离在线
newdevlist.push(devlist[i])
}
}
}
if (newdevlist.length>0) {
_this.setData({
UpgradeCount:0, //升级计数
CurrentUpgradeDev:"", //当前升级设备
CurrentUpgradeDevStart:"",//当前升级设备状态
Completed:true,
UpgradeAllCount:newdevlist.length,//升级总数
devlist:devlist
})
}else
{
this.DisplayPrompt2("未选中升级设备", 1000)
return
}
for (let Nvindex = 0; Nvindex < newdevlist.length; Nvindex++) {
const element = newdevlist[Nvindex];
_this.setData({
//升级计数
CurrentUpgradeDev:element.RoomNumber, //当前升级设备
CurrentUpgradeDevStart:'升级就绪',//当前升级设备状态
})
try {
await upgrader.startUpgrade(UpgradeType, {
roomTypeID: RoomTypeID,
hostidLists:'['+element.ID+']',
upgradefileName: filename,
hotelid:HotelId
})
.then(res => {
_this.setData({
UpgradeCount:_this.data.UpgradeCount+1, //升级计数
})
console.log('升级完成', res)
})
.catch(err =>{
console.log('升级失败', err)
});
}catch (error) {
_this.setData({
//升级计数
CurrentUpgradeDev:element.RoomNumber, //当前升级设备
CurrentUpgradeDevStart:errstr+',服务器响应异常',//当前升级设备状态
Completed:false
})
//this.DisplayPrompt(errstr+',服务器响应异常',1000)
return
}
}
this.DisplayPrompt2("升级完成!", 1000)
},
DisplayPrompt2(tipstr, showtime)
{
wx.showToast({
title: tipstr,
icon: 'none'
})
setTimeout(function () {
wx.hideToast()
}, showtime)
},
ALLcheckboxSub(e){
let devlist =this.data.devlist
let ALLcheckbox =this.data.Allcheckbox
let values = !ALLcheckbox
for (let index = 0; index < devlist.length; index++) {
devlist[index].checkbox=values
}
this.setData({
devlist:devlist,
Allcheckbox:values
});
},
checkboxSub(e){
let devlist =this.data.devlist
let ALLcheckbox =this.data.Allcheckbox
let index = e.currentTarget.dataset.id
let values =!devlist[index].checkbox
devlist[index].checkbox=values
let checksun =0
for (let nindex = 0; nindex < devlist.length; nindex++) {
if (values) {
if ( devlist[nindex].checkbox!=values) {
values=devlist[nindex].checkbox
}
}
if (devlist[nindex].checkbox) {
checksun=checksun+1
}
}
this.setData({
devlist:devlist,
Allcheckbox:values,
checksun:checksun
});
},
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,roomtypeid,hotelcode,createTime} = e.currentTarget.dataset;
let HostsDataFilters =this.data.HostsDataFilters
let timestr = HostsDataFilters[0].CreateTime
if (status !== 1) {
if (!HostsDataFilters[index].MAC||HostsDataFilters[index].MAC.length==0) {
//长按事件
if (this.endTime - this.startTime > 350) {
return;
}
this.setData({
selHosts: HostsDataFilters[index]
})
this.GetCode()
}
} else{ // 不为1时不跳转
wx.navigateTo({
url: `/pages/basics/HostUpgrade/EquipmentCaontrol/EquipmentCaontrol?RoomNumber=${room}&HotelName=${hotel}&HotelId=${this.data.Hotelinfo.HotelId }&roomtypeid=${roomtypeid }&HotelCode=${hotelcode}&createTime=${timestr}`
});
}
},
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({
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, "网络繁忙")
});
},
//touch start 开始触摸房间区域
handleTouchStart: function (e) {
this.startTime = e.timeStamp;
//console.log(" startTime = " + e.timeStamp);
},
//touch end结束触摸房间区域
handleTouchEnd: function (e) {
this.endTime = e.timeStamp;
//console.log(" endTime = " + e.timeStamp);
},
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];
},
RefreshTheRoomType(e){
e.detail=this.data.RoomtypeName
this.bindPickerChange(e)
},
GetRoomTypeId(roomTypeName){
if (roomTypeName.length>0) {
let myArray =this.data.myArray
for (let index = 0; index < myArray.length; index++) {
let strbuf = myArray[index].split('|') ;
if (strbuf[1]==roomTypeName) {
return strbuf[0]
}
}
}else{
return ""
}
},
DisplayPrompt(tipstr, showtime)
{
// wx.showModal({
// title: '提示',
// content: '确认执行此操作吗?',
// success(res) {
// if (res.confirm) { /* 用户点击确定 */ }
// }
// });
wx.showLoading({
title: tipstr,
})
setTimeout(function () {
wx.hideLoading()
}, showtime)
},
async bindPickerChange(e) {
let Completed =this.data.Completed
let _this =this
if (Completed) {
this.DisplayPrompt("正在升级中!",1000)
return
}
let devlist=[]
let Roomtypeinfo=[]
let roomid = this.GetRoomTypeId(e.detail)
if (roomid.length==0) {
return
}
let Pfilename =""
let Gfilename =""
let Upgradenode =[]
try {
// 调用 GetRoomTypeNode
const res = await GetRoomTypeNode({
hotelid: app.globalData.HotelId,
roomTypeID: roomid,
});
if (res.IsSuccess==true) {
devlist = res.HostData
for (let nindex = 0; nindex < devlist.length; nindex++) {
devlist[nindex].show=1
devlist[nindex].checkbox=0
devlist[nindex].UpgradeStatus=0
devlist[nindex].Model =_this.removeNullCharsAndInvisibleChars(devlist[nindex].Model)
}
}
const Nres = await GetRoomType({
HotelID:app.globalData.HotelId
})
if (Nres.Status==200) {
Roomtypeinfo=Nres.Data
for (let index = 0; index < Roomtypeinfo.length; index++) {
const element = Roomtypeinfo[index];
if (element.ROOM_TYPE_OLD_ID == roomid) {
Upgradenode=element
if (element.App_Cfg_For_L2.length>0) {
Gfilename=element.App_Cfg_For_L2
}
if (element.App_Cfg_For_L4.length>0) {
Gfilename=element.App_Cfg_For_L4
}
if (element.APPTYPE=="App_Cfg") {
Pfilename=element.CONFIG_BIN
}else{
Pfilename=""
}
break
}
}
}
this.setData({
RoomtypeName: e.detail,
devlist:devlist,
Roomtypeinfo:Roomtypeinfo,
Pfilename:Pfilename,
Gfilename:Gfilename,
Upgradenode:Upgradenode
});
console.log(devlist)
} catch (err) {
console.log('GetRoomTypeNode error', err);
}
},
removeNullCharsAndInvisibleChars(str) {
try {
return str.replace(/[\u0000-\u001F\u007F-\u009F\u200B-\u200F\u202A-\u202E\u2060-\u206F\uFEFF]/g, '');
} catch (error) {
return "NULL"
}
},
tabSelect(e) {
this.setData({
TabCur: e.currentTarget.dataset.id,
})
},
})

View File

@@ -0,0 +1,5 @@
{
"usingComponents": {
"wanselect": "/components/wanselect/wanselect"
}
}

View File

@@ -0,0 +1,238 @@
<cu-custom bgColor="bg-gradual-blue"
isBack="true">
<block bindtap="back" slot="backText" >返回</block>
<view slot="content">{{Hotelinfo.HotelName}}({{Hotelinfo.Code}})</view>
</cu-custom>
<scroll-view scroll-x class="bg-white nav text-center text-bold text-xl ">
<view class="flex text-center">
<view class="cu-item {{1==TabCur?'text-blue cur':''}}" bindtap="tabSelect" data-id="{{1}}">
单房间升级
</view>
<view class="cu-item {{2==TabCur?'text-blue cur':''}}" bindtap="tabSelect" data-id="{{2}}">
批量升级
</view>
</view>
</scroll-view>
<view wx:if="{{1==TabCur}}">
<view class=" solids bg-white" style="margin-top: 10rpx;height:70px ;width: 100%;font-weight: bold; ">
<view class="flex text-xl" style=" height:45% ;width: 100%;">
<!-- <view class="solids" wx:if="{{RoomIndex>=0}}" style="height:100% ;width: 50%;">
<text class="text-black">房号:{{HostsDataFilters[RoomIndex].RoomNumber}}</text>
</view> -->
<view class="solids" wx:if="{{RoomIndex>=0}}" style="height:100% ;width: 60%;">
<text class="text-black">房间在线:</text>
<text class="text-blue">{{onlineNumber}}/</text>
<text class="text-black">{{HostsDataFilters.length}} </text>
</view>
<view class="solids" wx:if="{{RoomIndex>=0}}" style="height:100% ;width: 40%;">
<button class="cu-btn1 line-green margin-left " style="width: 100%; margin:5rpx;" bindtap="RefreshTheRoom">刷新</button>
</view>
</view>
<view class="cu-bar1 bg-white " style="height:50% ;width: 100%;" >
<view class="solids" style="width: 60%;">
<input class="solids cu-btn1" focus="true" bindinput="inputSearchForHotels" confirm-type="search" style="width: 100%;"/>
</view>
<view class="flex"style="width: 40%;">
<button class="cu-btn1 line-green margin-left " style="width: 100%; margin:5rpx;" bindtap="SearchForHotels">搜索</button>
</view>
</view>
</view>
<scroll-view scroll-y scroll-into-view="{{toView}}" id="myScroll" style="height:{{scrollHeight}}rpx;" >
<view class='nav-list1 bg-white' bindtouchstart="handleTouchStart"
bindtouchend="handleTouchEnd" style="margin-top: 20rpx;">
<view bindtap="goProcess" bindlongtap="GetMAC_long" data-room="{{item.RoomNumber}}" data-hotel="{{Hotelinfo.HotelName}}"
data-status="{{item.Status}}" data-HotelCode="{{Hotelinfo.Code}}" data-roomtypeid="{{item.RoomTypeID}}" hover-class="navigator-hover" class="nav-li4 bg-{{item.Status===1? 'cyan':'gray'}}" wx:for="{{HostsDataFilters}}" id="msg-{{index}}" wx:key>
<view style="font-size: 32rpx;justify-content:start" >{{item.RoomNumber}}</view>
<view style="font-size: 20rpx;justify-content:start" >{{item.MAC}}</view>
</view>
</view>
</scroll-view>
</view>
<view wx:if="{{2==TabCur}}">
<view class=" solids bg-white" style="margin-top: 10rpx;height:100px ;width: 100%;font-weight: bold; ">
<view class="flex text-xl" style=" height:35% ;width: 100%;">
<view class="solids" style="height:100% ;width: 70%;">
<!-- 房型 -->
<view style="height:100% ;width: 100%; display: flex;justify-content:center; align-items:center; " >
<view style="height:100% ;width: 20%;">
<text >房型:</text>
</view>
<view style="height:100% ;width: 75%;">
<wanselect style="justify-content:center; align-items:center;" listData="{{RoomtypeNamearray}}" bind:optionTap='bindPickerChange'></wanselect>
</view>
</view>
</view>
<view class="solids" wx:if="{{RoomIndex>=0}}" style="height:100% ;width: 30%;">
<button class="cu-btn1 line-green margin-left " style="width: 100%; margin:5rpx;" bindtap="RefreshTheRoomType">刷新</button>
</view>
</view>
<view class="flex solids line-grey" style=" height:62% ;width:100%;">
<view class="flex-eight" style="height: 100%;margin: 3rpx 5rpx; " >
<view class="flex-xis setborder line-grey text-cut" style="height: 45%;font-size: 22rpx; line-height: 50rpx;min-width: 0;margin: 3rpx 0rpx; ">
{{Gfilename}}
</view>
<view class="flex-xis setborder line-grey text-cut" style="height: 45%;font-size: 22rpx; line-height: 50rpx;min-width: 0;margin: 3rpx 0rpx;">
{{Pfilename}}
</view>
</view>
<view class="flex-twice" style="height: 100%;margin: 3rpx 5rpx;" >
<button class=" "style=" margin: 3rpx 0rpx; font-size: 22rpx;height:45%;" data-id="1" bind:tap="UpgradeTheEquipment">固件升级</button>
<button class=""style=" margin: 3rpx 0rpx; font-size: 22rpx;height: 45%;" data-id="2" bind:tap="UpgradeTheEquipment" >配置升级</button>
</view>
</view>
</view>
<view class=" flex align-center " style="height: 70rpx;background: aquamarine;" >
<view class="flex-treble margin-xs" style="height: 50rpx;" bindtap="ALLcheckboxSub" >
<checkbox checked="{{Allcheckbox}}" ></checkbox>
<text >全选</text>
</view>
<view class="flex-eight" >正在升级房号:{{CurrentUpgradeDev}}:{{CurrentUpgradeDevStart}}</view>
<view class="flex-treble " style="justify-content: flex-end">已升级设备: {{UpgradeCount}} </view>
</view>
<scroll-view id="myScroll" scroll-into-view="{{toView}}" scroll-y="true" style="height:{{scrollHeight-100}}rpx;" >
<view wx:for="{{devlist.length}}" wx:key="index" class=" bg-white padding-5" >
<view class="bg-white" >
<view class="cubarN bg-white " >
<view class="flex-xsub margin-xs" data-id ="{{index}}" bindtap="checkboxSub" >
<checkbox style="top:25%;" checked="{{devlist[index].checkbox}}" ></checkbox>
</view>
<view class="cubarN bg-white flex-9" data-id ="{{index}}" bindtap="HideOrOpen" style="background:{{devlist[index].UpgradeStatus ==0? 'white':devlist[index].UpgradeStatus ==1? 'green':'red' }} ;">
<view class="flex-9" style="font-weight: bold;" >房号:{{devlist[index].RoomNumber}}</view>
<view class="flex-sub text-{{devlist[index].Status==true? 'green':'red'}}" >{{devlist[index].Status==true? "在线":"离线"}}</view>
</view>
</view>
<view class="cubarN bg-white" > <!-- wx:if="{{devlist[index].show==0}}"> -->
<view class="flex-xis" >MAC:{{devlist[index].MAC}}</view>
<!-- <view class="flex-xis setborder line-grey text-cut" style="height: 50rpx;width: 520rpx; font-size:22rpx; line-height: 50rpx"></view> -->
<view class="flex-twice" style="font-size: 22rpx;">主机:{{devlist[index].Model}}</view>
<view class="flex-twice" style="font-size: 22rpx;">配置版本:{{devlist[index].ConfigVersion}} </view>
</view>
<view class="cubarN bg-white solid-bottom "> <!-- wx:if="{{devlist[index].show==0}}"> -->
<view class="flex-eight" style="font-size: 22rpx;" >固件版本:{{devlist[index].Version}}</view>
</view>
</view>
</view>
</scroll-view>
</view>
<!-- MAC已经被绑定弹窗提示 -->
<view class="cu-modal {{modal==3 || modal==4?'show':''}}">
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end">
<view class="content">{{code}}已经被绑定</view>
<view class="action" bindtap="GetHide" >
<text class="cuIcon-close text-red"></text>
</view>
</view>
<view class="padding-xs flex flex-wrap justify-center " >
<view class="basis-xl text-sm" wx:for="{{bdHosts}}" >
<text class=" text-right ">酒店:</text><text class="text-left text-red">{{item.HotelName}}</text>
<text class="padding-left-xs text-right " >房间:</text><text class="text-left text-red">{{item.RoomNumber}}</text>
<button class="cu-btn margin-left-xs sm bg-red" wx:if="{{item.qx == 0}}" data-index="{{index}}" type="" bindtap="Jb" >解绑</button>
<button class="cu-btn margin-left-xs sm bg-red" wx:if="{{item.qx != 0}}" disabled >解绑</button>
</view>
<view class="basis-xl">MAC地址<text class="text-left">{{code}}</text></view>
<view class="basis-xl text-left text-sm text-gray">MAC已经被其他房间绑定点击继续将取消原有绑定执行新的绑定点击取消将不会执行任何操作~</view>
</view>
<view class="cu-bar bg-white">
<view class="action margin-0 flex-sub text-green " data-type="1" bindtap="ErrorInfo">反馈错误</view>
<view class="action margin-0 flex-sub text-green solid-left" bindtap="GetHide" >取消</view>
<view wx:if="{{bdHosts.length<=0}}" class="action margin-0 flex-sub solid-left" data-type="false" bindtap="GetMacOKend" >继续</view>
</view>
</view>
</view>
<!-- 手动输入mac地址 -->
<view class="cu-modal {{modal==1000?'show':''}}">
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end">
<view class="content">为{{selHosts.RoomNumber}}绑定MAC</view>
<view class="action" bindtap="GetHide" >
<text class="cuIcon-close text-red"></text>
</view>
</view>
<view class="padding-lg flex flex-wrap " >
<view class="basis-sm text-right">房间:</view>
<view class="basis-lg text-left">{{selHosts.RoomNumber}}</view>
<view class="basis-sm text-right">MAC地址</view>
<view class="basis-lg text-left">
<input placeholder="手动输入MAC" model:value="{{code}}" name="input"></input>
</view>
</view>
<view class="cu-bar bg-white">
<view class="action margin-0 flex-sub text-green solid-left" bindtap="GetHide" >取消</view>
<view class="action margin-0 flex-sub solid-left" bindtap="GetMACOK" >确认</view>
</view>
</view>
</view>
<!-- 确定绑定 -->
<view class="cu-modal {{modal==521?'show':''}}">
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end">
<view class="content">绑定确认</view>
<view class="action" bindtap="GetHide" >
<text class="cuIcon-close text-red"></text>
</view>
</view>
<view class="padding-lg flex flex-wrap " >
<view class="basis-sm text-right">酒店:</view><view class="text-left basis-lg">{{Hotelinfo.HotelName}}</view>
<view class="basis-sm text-right">房间:</view><view class="basis-lg text-left">{{selHosts.RoomNumber}}</view>
<view class="basis-sm text-right">MAC地址</view><view class="basis-lg text-left">{{code}}</view>
<view class=" text-left flex-sub text-sm text-gray">确定为房间绑定MAC点击继续将执行扫描绑定点击取消将不会执行任何操作~</view>
</view>
<view class="cu-bar bg-white">
<view class="action margin-0 flex-sub text-green solid-left" bindtap="GetHide" >取消</view>
<view class="action margin-0 flex-sub solid-left" data-type="true" bindtap="GetMacOKend" >继续</view>
</view>
</view>
</view>
<!-- 无效条形码 -->
<view class="cu-modal {{modal==520?'show':''}}">
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end">
<view class="content">无效条码</view>
<view class="action" bindtap="GetHide" >
<text class="cuIcon-close text-red"></text>
</view>
</view>
<view class="padding-lg flex flex-wrap " >
<view class="basis-sm text-right">无效条码:</view><view class="basis-lg text-left">{{code}}</view>
<view class=" text-left flex-sub text-sm text-gray">扫描的条码为无效条码~</view>
</view>
<view class="cu-bar bg-white">
<view class="action margin-0 flex-sub text-green solid-left" bindtap="GetHide" >确定</view>
</view>
</view>
</view>

View File

@@ -0,0 +1,112 @@
.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;
}
.setborder
{
border: 1rpx solid currentColor;
}
.cubarN {
display: flex;
position: relative;
align-items: center;
min-height: 50rpx ;
justify-content: space-between;
}

View File

@@ -0,0 +1,286 @@
// pages/basics/MakingRounds/MakingRounds.js
const app = getApp()
import {
GetHostsInfo,
GetMAC,
GetFaceSN,
ErrorInfo,
CheckFaceSN,
OpenDoorTest,
GetRoomType,
GetRoomTypeAndModalsListLog,
WebChatUpgrade,
QueryUpdateHostStatus,
ForwardQueryUpdateHostProgressBar,
GetRoomTypeNode,
SetRCULight,
SetRCUAir,
SetRCUCurtain,
} 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 的 toppx
wx.createSelectorQuery()
.in(this)
.select('#myScroll')
.boundingClientRect(rect => {
if (rect) {
const topPx = rect.top; // px
const bottomPx = 10 / 2; // 10rpx → 5px2倍屏
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) {
const { room, hotel, status } = e.currentTarget.dataset;
if (status !== 1) return; // 不为1时不跳转
wx.navigateTo({
url: `/pages/basics/MakingRounds/process/process?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({
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];
},
})

View File

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@@ -0,0 +1,46 @@
<cu-custom bgColor="bg-gradual-blue"
isBack="true">
<block bindtap="back" slot="backText" >返回</block>
<view slot="content">{{Hotelinfo.HotelName}}({{Hotelinfo.Code}})</view>
</cu-custom>
<view class=" solids bg-white" style="height:70px ;width: 100%;font-weight: bold; ">
<view class="flex text-xl" style=" height:45% ;width: 100%;">
<view class="solids" wx:if="{{RoomIndex>=0}}" style="height:100% ;width: 50%;">
<text class="text-black">房号:{{HostsDataFilters[RoomIndex].RoomNumber}}</text>
</view>
<view class="solids" wx:if="{{RoomIndex>=0}}" style="height:100% ;width: 50%;">
<text class="text-black">房间在线:</text>
<text class="text-blue">{{onlineNumber}}/</text>
<text class="text-black">{{HostsDataFilters.length}} </text>
</view>
</view>
<view class="cu-bar1 bg-white " style="height:50% ;width: 100%;" >
<view class="solids" style="width: 60%;">
<input class="solids cu-btn1" focus="true" bindinput="inputSearchForHotels" confirm-type="search" style="width: 100%;"/>
</view>
<view class="flex"style="width: 40%;">
<button class="cu-btn1 line-green margin-left " style="width: 100%; margin:5rpx;" bindtap="SearchForHotels">搜索</button>
<button class="cu-btn1 line-green margin-left " style="width: 100%; margin:5rpx;" bindtap="RefreshTheRoom">刷新</button>
</view>
</view>
</view>
<scroll-view scroll-y scroll-into-view="{{toView}}" id="myScroll" style="height:{{scrollHeight}}rpx;" >
<view class='nav-list1 bg-white' style="margin-top: 20rpx;">
<view bindtap="goProcess" data-room="{{item.RoomNumber}}" data-hotel="{{Hotelinfo.HotelName}}"
data-status="{{item.Status}}" hover-class="navigator-hover" class="nav-li4 bg-{{item.Status===1? 'cyan':'gray'}}" wx:for="{{HostsDataFilters}}" id="msg-{{index}}" wx:key>
<view style="font-size: 32rpx;justify-content:start" >{{item.RoomNumber}}</view>
<view style="font-size: 20rpx;justify-content:start" >{{item.MAC}}</view>
</view>
</view>
</scroll-view>

View File

@@ -0,0 +1,101 @@
.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;
}

View File

@@ -0,0 +1,182 @@
// pages/basics/MakingRounds/process/process.js
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} // 最后一条你自行改状态
],
deviceListindex:0,
inputValue:"",
toView:"",
scrollHeight: 0 ,
modalName: "",
note:"",
noteok:"",
errorsNumber:0,
HotelId:""
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (!options.RoomNumber || !options.HotelName ||!options.HotelId) {
app.toast(2, "无酒店信息~")
return;
}
console.log(options.RoomNumber)
this.setData ({
RoomNumber:options.RoomNumber,
HotelName:options.HotelName,
HotelId:options.HotelId
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
this.calcScrollHeight();
},
calcScrollHeight() {
// 1. 拿到屏幕可用高度px
const sys = wx.getSystemInfoSync();
const screenHeight = sys.windowHeight; // px
// 2. 拿到 scroll-view 的 toppx
wx.createSelectorQuery()
.in(this)
.select('#myScroll')
.boundingClientRect(rect => {
if (rect) {
const topPx = rect.top; // px
const bottomPx = 10 / 2; // 10rpx → 5px2倍屏
const heightPx = screenHeight - topPx - bottomPx;
// 3. 转 rpx 并写入
this.setData({
scrollHeight: heightPx * 2 // px→rpx
});
}
})
.exec();
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
},
showModal(e) {
this.setData({
modalName: e.currentTarget.dataset.target,
deviceListindex:e.currentTarget.dataset.id-1
})
},
DialogModal1(e){
let deviceList = this.data.deviceList
let deviceListindex=this.data.deviceListindex
deviceList[deviceListindex].equipmentstatus=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
}
this.setData({
deviceList:deviceList
})
console.log(this.data.deviceList)
},
inputSearchForHotels(e){
this.setData({
note: e.detail.value
})
console.log(this.data.note)
},
checkWardRoundRecords(e){
wx.navigateTo({
url: `/pages/basics/MakingRoundsAbnormal/MakingRoundsAbnormal?HotelId=${this.data.HotelId}&RoomNumber=${this.data.RoomNumber}`
});
},
saveTheText(e){
let deviceList = this.data.deviceList
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
})
},
})

View File

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@@ -0,0 +1,84 @@
<cu-custom bgColor="bg-gradual-blue"
isBack="true">
<block bindtap="back" slot="backText" >返回</block>
<view slot="content">({{HotelName}})_{{RoomNumber}}</view>
</cu-custom>
<view class="flex solid-bottom justify-between ">
<view class=" padding-xs margin-sm radius">
<text class="text-black">异常数量:</text>
<text class="text-red">1</text>
<text class="text-black">/{{deviceList.length}}</text>
</view>
<view class="bg-grey padding-xs margin-sm radius" hover-class="navigator-hover" bindtap="checkWardRoundRecords" >查看查房记录</view>
<view class="bg-grey padding-xs margin-sm radius" hover-class="navigator-hover">上传查房状态</view>
</view>
<!-- 设备状态表格 -->
<view class="th">
<text class="th-item">设备名称</text>
<text class="th-item">状态</text>
<text class="th-item">设备检测</text>
</view>
<scroll-view scroll-y scroll-into-view="{{toView}}" id="myScroll" style="height:{{scrollHeight}}rpx;">
<view class="device-table">
<block wx:for="{{deviceList}}" wx:key="id">
<view class="tr">
<!-- 名称 -->
<text class="th-item {{item.equipmentstatus==='hideModal_1'? 'bg-green':item.equipmentstatus==='hideModal_0'? 'bg-red':'textbcolor'}} ">{{item.name}}</text>
<!-- 状态 -->
<view class="td status">
<text class="status-text {{item.status==='在线'||item.status==='显示'?'on':'off'}}">
{{item.status}}
</text>
</view>
<!-- 按钮 -->
<view class="td btn-group">
<button class="btn green" data-id="{{item.id}}" data-st="正常" data-target="DialogModal1" bindtap="showModal">设备检测</button>
</view>
</view>
</block>
</view>
</scroll-view>
<view class="cu-modal {{modalName=='DialogModal1'?'show':''}}">
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end">
<view class="content">{{deviceList[deviceListindex].name}}</view>
</view>
<view >
<view class=" text-left" > 检测流程:</view>
<textarea auto-height maxlength="-1" class="solids " disabled="true" confirm-type="return" style="width: 95%;font-size: 32rpx;text-align: left;white-space: pre-wrap; word-break: break-all; line-height: 1.5;" value=" {{deviceList[deviceListindex].note}}"/>
</view>
<view class="cu-bar bg-white justify-end">
<view class="action">
<button class="cu-btn bg-gray text-xl text-blue" data-id="hideModal_1" bindtap="DialogModal2">修改检测流程</button>
<button class="cu-btn bg-red text-xl text-black margin-left" data-id="hideModal_0" bindtap="DialogModal1">异常</button>
<button class="cu-btn bg-green text-xl text-black margin-left" data-id="hideModal_1" bindtap="DialogModal1">正常</button>
</view>
</view>
<view wx:if="{{deviceList[deviceListindex].isnote === 1 }}" >
<view class=" text-left" > 检测流程:</view>
<textarea auto-height maxlength="-1" class="solids " focus="true" bindinput="inputSearchForHotels" confirm-type="return" style="width: 100%;font-size: 32rpx;text-align: left;white-space: pre-wrap; word-break: break-all; line-height: 1.5;" value=" {{deviceList[deviceListindex].note}}"/>
<view class="cu-bar bg-white justify-end">
<view class="action">
<button class="cu-btn bg-red text-xl text-black margin-left" data-id="cancel" bindtap="saveTheText">取消</button>
<button class="cu-btn bg-green text-xl text-black margin-left" data-id="ok" bindtap="saveTheText">保存</button>
</view>
</view>
</view>
</view>
</view>

View File

@@ -0,0 +1,18 @@
/* 新增scroll-view样式 */
.scroll-container {
height: calc(100vh - 240rpx); /* 精确计算上方固定内容的高度 */
}
.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; }
.tr{ display: flex; align-items: center; padding: 15rpx 0; border-bottom: 1rpx solid #f0f0f0; }
.td{ flex: 1; 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; }
.off{ background: #e54d42; }
.btn-group{ display: flex; justify-content: space-around; }
.btn{ width: 160rpx; height: 50rpx; line-height: 50rpx; font-size: 32rpx; color: #fff; padding: 0; border: none; border-radius: 8rpx; }
.green{ background: #07c160; }
.red{ background: #e54d42; }

View File

@@ -0,0 +1,129 @@
const app = getApp()
import {
GetHostsInfo,
GetMAC,
GetFaceSN,
ErrorInfo,
CheckFaceSN,
OpenDoorTest,
GetRoomType,
GetRoomTypeAndModalsListLog,
WebChatUpgrade,
QueryUpdateHostStatus,
ForwardQueryUpdateHostProgressBar,
GetRoomTypeNode,
SetRCULight,
SetRCUAir,
SetRCUCurtain,
} from '../../../lib/RequestingCenter.js'
Page({
/**
* 页面的初始数据
*/
data: {
RoomIndex:0,
//权限信息
autho: null,
//酒店信息
HostsDataFilters:[],
toView:"",
RoomNumber:"",
HotelId:"",
},
/**
* 生命周期函数--监听页面加载
*/
onLoad:async function(options) {
if (!options.HotelId || app.globalData.autho == null) {
app.toast(2, "无酒店信息~")
return;
}
if (!options.RoomNumber) {
this.setData({
autho: app.globalData.autho,
HotelId: options.HotelId
})
}else{
this.setData({
autho: app.globalData.autho,
HotelId: options.HotelId,
RoomNumber:options.RoomNumber
})
}
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("已经找到,无需循环~")
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
inputSearchForHotels(e){
this.setData({
RoomNumber: e.detail.value
})
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@@ -0,0 +1,5 @@
{
"usingComponents": {
}
}

View File

@@ -0,0 +1,53 @@
<cu-custom bgColor="bg-gradual-blue"
isBack="true">
<block bindtap="back" slot="backText" >返回</block>
<view slot="content">{{Hotelinfo.HotelName}}({{Hotelinfo.Code}})</view>
</cu-custom>
<view class=" solids bg-white" style="height:70px ;width: 100%;font-weight: bold; ">
<view class="flex text-xl " style=" height:45% ;width: 100%;">
<view class="flex solids " wx:if="{{RoomIndex>=0}}" style="height:100% ;width: 60%;">
<view class="text-black ">房间号:{{}}</view>
</view>
<view class="solids " wx:if="{{RoomIndex>=0}}" style="height:100% ;width: 40%;">
<text class="text-black">异常记录:</text>
<!-- <text class="text-blue">{{onlineNumber}}/</text> -->
<text class="text-black">{{HostsDataFilters.length}} </text>
</view>
</view>
<view class="cu-bar1 bg-white " style="height:50% ;width: 100%;" >
<view class="solids" style="width: 60%;">
<input class="solids cu-btn1" focus="true" bindinput="inputSearchForHotels" confirm-type="search" style="width: 100%;" value="{{RoomNumber}}"/>
</view>
<view class="flex"style="width: 40%;">
<button class="cu-btn1 line-green margin-left " style="width: 100%; margin:5rpx;" bindtap="inputSearchForHotels">搜索</button>
<button class="cu-btn1 line-green margin-left " style="width: 100%; margin:5rpx;" bindtap="RefreshTheRoom">维修记录</button>
</view>
</view>
</view>
<scroll-view scroll-y scroll-into-view="{{toView}}" >
<view class="cu-list menu margin-top-xs margin-bottom-sm shadow-lg" >
<view class="cu-itemz " wx:for="{{20}}" wx:key="index">
<view class="flex" style="width: 80%">
<view class="flex text-black"style="width: 50%">
<view>房号:</view>
<view class="nav-name">{{"床卫生间传"}}</view>
</view>
<view class=" nav-name " style="width: 50%;left: 30rpx;">
<view >床卫生间传感器测试</view>
</view>
</view>
<view class="flex"style="width: 18%;">
<button class="cu-btn1 line-green margin-left " style="width: 100%; margin:5rpx;white-space: pre-line;" bindtap="RefreshTheRoom">确认维\n修完成</button>
</view>
</view>
</view>
</scroll-view>

View File

@@ -0,0 +1,101 @@
.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;
}

149
pages/device/device.js Normal file
View File

@@ -0,0 +1,149 @@
// pages/device.js
const ecUI = require('../../utils/ecUI.js')
const ecBLE = require('../../utils/ecBLE.js')
let ctx
let isCheckScroll = true
let isCheckRevHex = false
let isCheckSendHex = false
let sendData = ''
Page({
/**
* 页面的初始数据
*/
data: {
textRevData: '',
scrollIntoView: 'scroll-view-bottom',
},
/**
* 生命周期函数--监听页面加载
*/
onLoad() {
ctx = this
isCheckScroll = true
isCheckRevHex = false
isCheckSendHex = false
sendData = ''
ecBLE.setChineseType(ecBLE.ECBLEChineseTypeGBK)
//on disconnect
ecBLE.onBLEConnectionStateChange(() => {
ecUI.showModal('提示', '设备断开连接')
})
//receive data
ecBLE.onBLECharacteristicValueChange((str, strHex) => {
let data =
ctx.data.textRevData +
ctx.dateFormat('[hh:mm:ss,S]:', new Date()) +
(isCheckRevHex ? strHex.replace(/[0-9a-fA-F]{2}/g, ' $&') : str) +
'\r\n'
// console.log(data)
ctx.setData({ textRevData: data })
if (isCheckScroll) {
if (ctx.data.scrollIntoView === "scroll-view-bottom") {
ctx.setData({ scrollIntoView: "scroll-view-bottom2" })
} else {
ctx.setData({ scrollIntoView: "scroll-view-bottom" })
}
}
})
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
ecBLE.onBLEConnectionStateChange(() => { })
ecBLE.onBLECharacteristicValueChange(() => { })
ecBLE.closeBLEConnection()
},
checkScroll(e) {
if (e.detail.value.length) isCheckScroll = true
else isCheckScroll = false
},
checkRevHex(e) {
if (e.detail.value.length) isCheckRevHex = true
else isCheckRevHex = false
},
checkSendHex(e) {
if (e.detail.value.length) isCheckSendHex = true
else isCheckSendHex = false
},
inputSendData(e) {
sendData = e.detail.value
},
btClearTap() {
this.setData({ textRevData: '' })
},
btSendTap() {
if (isCheckSendHex) {
let data = sendData
.replace(/\s*/g, '')
.replace(/\n/g, '')
.replace(/\r/g, '')
if (data.length === 0) {
ecUI.showModal('提示', '请输入要发送的数据')
return
}
if (data.length % 2 != 0) {
ecUI.showModal('提示', '数据长度只能是双数')
return
}
if (data.length > 488) {
ecUI.showModal('提示', '最多只能发送244字节')
return
}
if (!new RegExp('^[0-9a-fA-F]*$').test(data)) {
ecUI.showModal('提示', '数据格式错误只能是0-9,a-f,A-F')
return
}
ecBLE.writeBLECharacteristicValue(data, true)
} else {
if (sendData.length === 0) {
ecUI.showModal('提示', '请输入要发送的数据')
return
}
let tempSendData = sendData.replace(/\n/g, '\r\n')
if (tempSendData.length > 244) {
ecUI.showModal('提示', '最多只能发送244字节')
return
}
ecBLE.writeBLECharacteristicValue(tempSendData, false)
}
},
dateFormat(fmt, date) {
let o = {
'M+': date.getMonth() + 1, //月份
'd+': date.getDate(), //日
'h+': date.getHours(), //小时
'm+': date.getMinutes(), //分
's+': date.getSeconds(), //秒
'q+': Math.floor((date.getMonth() + 3) / 3), //季度
S: date.getMilliseconds(), //毫秒
}
if (/(y+)/.test(fmt))
fmt = fmt.replace(
RegExp.$1,
(date.getFullYear() + '').substr(4 - RegExp.$1.length)
)
for (var k in o)
if (new RegExp('(' + k + ')').test(fmt)) {
// console.log(RegExp.$1.length)
// console.log(o[k])
fmt = fmt.replace(
RegExp.$1,
RegExp.$1.length == 1
? (o[k] + '').padStart(3, '0')
: ('00' + o[k]).substr(('' + o[k]).length)
)
}
return fmt
},
checkChinese(e){
if(e.detail.value==='gbk'){
ecBLE.setChineseType(ecBLE.ECBLEChineseTypeGBK)
}else{
ecBLE.setChineseType(ecBLE.ECBLEChineseTypeUTF8)
}
}
})

5
pages/device/device.json Normal file
View File

@@ -0,0 +1,5 @@
{
"usingComponents": {},
"enablePullDownRefresh": false,
"disableScroll": true
}

47
pages/device/device.wxml Normal file
View File

@@ -0,0 +1,47 @@
<!--pages/device.wxml-->
<view class="device-container">
<view class="control-rev">
<text class="title-rev">数据接收 : </text>
<button class="bt-clear" type="primary" bindtap="btClearTap" hover-start-time="0">清空</button>
<checkbox-group bindchange="checkScroll" class="checkbox-scroll">
<checkbox checked="true"></checkbox>
<text>滚动</text>
</checkbox-group>
<checkbox-group bindchange="checkRevHex" class="checkbox-rev-hex">
<checkbox></checkbox>
<text>Hex</text>
</checkbox-group>
</view>
<view class="scroll-view-container">
<scroll-view class="scroll-view-rev" scroll-y="true" scroll-into-view="{{scrollIntoView}}">
<view class="view-rev-gap"></view>
<text class="text-rev" user-select="true" selectable="true">{{textRevData}}</text>
<view class="view-rev-gap"></view>
<view id="scroll-view-bottom"></view>
<view id="scroll-view-bottom2"></view>
</scroll-view>
</view>
<view class="control-send">
<text class="title-send">数据发送 : </text>
<checkbox-group bindchange="checkSendHex" class="checkbox-send-hex">
<checkbox></checkbox>
<text>Hex</text>
</checkbox-group>
</view>
<view class="view-input-send">
<textarea class="input-send" maxlength="-1" bindblur="inputSendData" bindinput="inputSendData" />
</view>
<view class="view-bt-send">
<button class="bt-send" type="primary" bindtap="btSendTap" hover-start-time="0">发送</button>
</view>
<view class="control-chinese">
<text class="title-chinese">中文字符集 : </text>
<radio-group bindchange="checkChinese" class="checkbox-chinese">
<radio value="utf8" />
<text class="checkbox-chinese-first-item">UTF-8</text>
<radio value="gbk" checked="true"/>
<text>GBK</text>
</radio-group>
</view>
<view><text class="text-support">技术支持https://eciot.com</text></view>
</view>

130
pages/device/device.wxss Normal file
View File

@@ -0,0 +1,130 @@
/* pages/device.wxss */
.device-container {
height: 100vh;
}
.control-rev{
height: 45px;
display: flex;
align-items: center;
padding: 0 20px;
}
.title-rev {
font-size: 17px;
flex:1;
}
.bt-clear {
width: 55px !important;
height: 29px;
font-size: 14px;
display: flex;
justify-content: center;
align-items: center;
padding: 0;
margin-right: 15px !important;
}
.checkbox-scroll {
font-size: 15px;
display: flex;
align-items: center;
margin-right: 10px;
}
.checkbox-rev-hex {
font-size: 15px;
display: flex;
align-items: center;
}
.scroll-view-container {
margin: 0 20px;
padding: 0 3px 0 5px;
background-color: #F5F5F5;
}
.scroll-view-rev {
height: 150px;
}
.view-rev-gap{
height: 5px;
}
.text-rev {
font-size: 14px;
word-break: break-all;
font-family: Monospace;
}
.control-send{
height: 45px;
display: flex;
align-items: center;
padding: 0 20px;
margin-top: 5px;
}
.title-send {
font-size: 17px;
flex:1;
}
.checkbox-send-hex {
font-size: 15px;
display: flex;
align-items: center;
}
.view-input-send {
margin: 0 20px;
padding: 2px 3px;
background-color: #F5F5F5;
}
.input-send {
height: 84px;
width: 100%;
word-break: break-all;
}
.view-bt-send {
margin: 15px 20px 0px 20px;
display: flex;
}
.bt-send {
flex: 1;
height: 45px;
display: flex;
justify-content: center;
align-items: center;
}
.control-chinese{
height: 45px;
display: flex;
align-items: center;
padding: 0 20px;
margin-top: 5px;
}
.title-chinese{
font-size: 17px;
flex:1;
}
.checkbox-chinese{
font-size: 15px;
display: flex;
align-items: center;
}
.checkbox-chinese-first-item{
margin-right: 10px;
}
.text-support{
font-size: 14px;
color: #909399;
margin-left: 20px;
}

273
pages/index/index.js Normal file
View File

@@ -0,0 +1,273 @@
// pages/basics/MakingRounds/MakingRounds.js
const app = getApp()
import {
GetHostsInfo,
GetMAC,
GetFaceSN,
ErrorInfo,
CheckFaceSN,
OpenDoorTest,
GetRoomType,
GetRoomTypeAndModalsListLog,
WebChatUpgrade,
QueryUpdateHostStatus,
ForwardQueryUpdateHostProgressBar,
GetRoomTypeNode,
SetRCULight,
SetRCUAir,
SetRCUCurtain,
} from '../../lib/RequestingCenter.js'
Page({
data: {
userInfo: null,
autho: null,
selectGroupIndex:-1,
ishotel: false,
hotelIndex: 0,
issel:false ,
curNav:1,
curIndex:0,
top_height:0,
inputValue:""
},
selectNav (event) {
let id = event.target.dataset.id,
index = parseInt(event.target.dataset.index);
self = this;
this.setData({
curNav:id,
curIndex:index
})
},
///选择酒店
SelHotel: function (e) {
let index = e.currentTarget.dataset['index'];
this.setData({
hotelIndex: index
})
wx.setStorageSync(this.data.userInfo.Id + '_xiaoxi_hotelId', this.data.autho[this.data.selectGroupIndex].Hotels[this.data.hotelIndex].HotelId)
},
//确定选择酒店
ShowSelHotel: async function (e) {
let id = e.currentTarget.dataset['id'];
if(id==-1){
id = this.data.autho[this.data.selectGroupIndex].Hotels[this.data.hotelIndex].HotelId;
}
if(this.data.hotelIndex>=0){
app.globalData.HotelId=id
wx.navigateTo({
url: '/pages/NewHome/NewHome?HotelId=' + id
})
}else{
app.toast(2,'未选择酒店')
}
},
//选择酒店组
bindgroup: function (e) {
let index
try {
index = e.currentTarget.dataset['index']
} catch (error) {
index=0
}
this.setData({
selectGroupIndex: index,
hotelIndex: 0,
ishotel: true
})
wx.setStorageSync(this.data.userInfo.Id + '_xiaoxi_hotelId', this.data.autho[this.data.selectGroupIndex].Hotels[this.data.hotelIndex].HotelId)
wx.setStorageSync(this.data.userInfo.Id + '_xiaoxi_selectGroupId', this.data.autho[this.data.selectGroupIndex].HotelGroupsId)
},
codebindgroup: function (GroupIndex,hotelIndex) {
this.setData({
selectGroupIndex: GroupIndex,
hotelIndex:hotelIndex,
ishotel: true
})
wx.setStorageSync(this.data.userInfo.Id + '_xiaoxi_hotelId', this.data.autho[this.data.selectGroupIndex].Hotels[this.data.hotelIndex].HotelId)
wx.setStorageSync(this.data.userInfo.Id + '_xiaoxi_selectGroupId', this.data.autho[this.data.selectGroupIndex].HotelGroupsId)
},
//登录
onLoad: async function (option) {
let that=this
this.setData({
userInfo: app.globalData.userinfo,
autho: app.globalData.autho
})
if (this.data.userInfo == null) {
app.checkLoginReadyCallback = res => {
this.setData({
userInfo: app.globalData.userinfo,
autho: app.globalData.autho
})
this.ReaSel()
};
} else {
this.ReaSel()
}
setTimeout(function () {
// 1.使用wx.createSelectorQuery()查询到需要滚动到的元素位置
wx.createSelectorQuery().select('#Headcustom').boundingClientRect(res => {
// 2.使用wx.getSysTemInfo()获取设备及页面高度windowHeightpx
wx.getSystemInfo({
success(ress) {
that.setData({
top_height: ress.windowHeight - res.bottom,
})
}
})
}).exec(function (params) {
console.log(params)
})
}, 100)
let e=[]
this.bindgroup(e)
console.log(this.data.top_height)
},
inputSearchForHotels(e){
this.setData({
inputValue: e.detail.value
})
},
SearchForHotels(e) {
//debugger //hotelIndex
let inputValue =this.data.inputValue.trim()
if (inputValue.length==0) {
wx.showModal({
title: "提示",
content: "无效搜索",
showCancel:false
})
return
}
let autho = this.data.autho
let selectGroupIndex = this.data.selectGroupIndex
const Naelement = autho[selectGroupIndex]
const CNaelement =this.sortHotelsByFuzzyMatch(Naelement.Hotels,inputValue)
autho[selectGroupIndex].Hotels=CNaelement
this.setData({
autho:autho
})
for (let aindex = 0; aindex < autho.length; aindex++) {
const aelement = autho[aindex];
for (let bindex = 0; bindex < aelement.Hotels.length; bindex++) {
const belement = aelement.Hotels[bindex];
if (belement.Code==inputValue) {
this.codebindgroup(aindex,bindex)
return
}
if (belement.HotelName==inputValue) {
this.codebindgroup(aindex,bindex)
return
}
}
}
wx.showModal({
title: "提示",
content: "未找到该酒店!",
showCancel:false
})
} ,
//读取历史选择酒店
ReaSel: function () {
let _xiaoxi_hotelId = wx.getStorageSync(this.data.userInfo.Id + '_xiaoxi_hotelId')
let _xiaoxi_selectGroupId = wx.getStorageSync(this.data.userInfo.Id + '_xiaoxi_selectGroupId')
let _xiaoxi_selectGroupIndex = -1;
let _xiaoxi_hotelIndex = -1;
this.data.autho.forEach((element, index) => {
if (element.HotelGroupsId == _xiaoxi_selectGroupId) {
_xiaoxi_selectGroupIndex = index;
element.Hotels.forEach((elements, indexs) => {
if (elements.HotelId == _xiaoxi_hotelId) {
_xiaoxi_hotelIndex = indexs;
}
})
}
});
this.setData({
selectGroupIndex: _xiaoxi_selectGroupIndex,
hotelIndex: _xiaoxi_hotelIndex
})
//非选择 读取上次进行跳转
if(!this.data.issel && this.data.hotelIndex>-1){
wx.navigateTo({
url: '/pages/NewHome/NewHome?HotelId='+this.data.autho[this.data.selectGroupIndex].Hotels[this.data.hotelIndex].HotelId
})
}
// 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){
wx.navigateTo({
url: '/pages/NewHome/NewHome?HotelId='+this.data.autho[0].Hotels[0].HotelId
})
}
} ,
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.HotelName) {
unmatchedHotels.push(hotel);
return;
}
const hotelName = String(hotel.HotelName).toLowerCase();
const isMatch = hotelName.includes(lowerKeyword);
if (isMatch) {
matchedHotels.push(hotel);
} else {
unmatchedHotels.push(hotel);
}
});
// 4. 合并数组并返回
return [...matchedHotels, ...unmatchedHotels];
}
})

3
pages/index/index.json Normal file
View File

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}

89
pages/index/index.wxml Normal file
View File

@@ -0,0 +1,89 @@
<cu-custom bgColor="bg-gradual-blue" id="Headcustom" >
<block bindtap="" slot="backText" >返回</block>
<view slot="content">{{selectGroupIndex==-1? "BLV":autho[selectGroupIndex].Hotels[hotelIndex].HotelName}}</view>
</cu-custom>
<!-- <view class="padding-sm bg-white radius shadow shadow-lg">
<view id="groups">
<view class="text-xl" wx:if="{{hotelIndex>=0}}">
<text class="text-green">{{autho[selectGroupIndex].Hotels[hotelIndex].Code}}:{{autho[selectGroupIndex].Hotels[hotelIndex].HotelName}}</text>
<button wx:if="{{hotelIndex>=0}}" data-id="-1" class="cu-btn line-green margin-left" bindtap="ShowSelHotel">确定</button>
<button wx:if="{{issel != false}}" data-id="{{issel}}" class="cu-btn line-green margin-left" bindtap="ShowSelHotel">返回</button>
</view>
<view wx:if="{{hotelIndex<0}}" >
<button class="cu-btn bg-green margin-xs">请选择酒店</button>
</view>
<view class="text-black text-lg margin-left-xs" wx:if="{{autho.length>0}}">
酒店组信息
</view>
<view class="grid col-3" wx:if="{{autho.length>0}}">
<view class="padding-xs" bindtap="bindgroup" data-index="{{idx}}" wx:for="{{autho}}" wx:for-index="idx" wx:for-item="item" >
<button style="width:100%;" class="cu-btn bg-{{selectGroupIndex==idx?'green':'grey'}}">{{item.HotelGroupsName}}({{item.Hotels.length}})</button>
</view>
</view>
<view wx:if="{{autho.length==0}}" class="text-red margin-left-xs" >
暂无相关酒店信息
</view>
</view>
<view id="hotels" wx:if="{{selectGroupIndex>-1}}" class="margin-top">
<view class="text-black text-xl">
<view class="grid col-4 text-center ">
<view bindtap="SelHotel" data-index="{{idx}}" wx:for="{{autho[selectGroupIndex].Hotels}}" wx:for-index="idx" wx:for-item="item" >
<view style="font:bold;white-space: nowrap;overflow: hidden;" class="{{hotelIndex == idx?'text-green':''}} text-df bg-gray padding-xs margin-xs" >{{item.HotelName}}</view>
</view>
</view>
</view>
</view>
</view> -->
<view style="height:{{top_height==0?'600rpx':top_height+'px'}} " >
<view class=" solids bg-white" style="height:13% ;width: 100%;">
<view class="text-xl" wx:if="{{hotelIndex>=0}}" style="height:100% ;width: 100%;">
<view class="solids" style="height:50% ;width: 100%;">
<text class="text-green">{{autho[selectGroupIndex].Hotels[hotelIndex].Code}}:{{autho[selectGroupIndex].Hotels[hotelIndex].HotelName}}</text>
</view>
<view class="cu-bar1 bg-white " style="height:50% ;width: 100%;" >
<view class="solids flex-6 " style="width: 100%;">
<input class="solids cu-btn1" focus="true" bindinput="inputSearchForHotels" confirm-type="search" style="width: 100%;"/>
</view>
<view class="flex-xis flex justify-end">
<button wx:if="{{hotelIndex>=0}}" data-id="-1" class="cu-btn1 line-green margin-left " style="width: 150rpx; margin:5rpx;" bindtap="SearchForHotels">搜索</button>
<button wx:if="{{hotelIndex>=0}}" data-id="-1" class="cu-btn1 line-green margin-left" style="width: 150rpx;margin:5rpx" bindtap="ShowSelHotel">确定</button>
</view>
</view>
</view>
</view>
<view class="cu-bar bg-white" style="height:85% ;width: 100%;">
<view style="height:100%;width: 40%;">
<scroll-view class="bg-white " scroll-into-view="{{'group'+selectGroupIndex}}" scroll-y style="height:100%;width: 100%;" scroll-with-animation scroll-top >
<view bindtap="bindgroup" data-index="{{idx}}" id="{{'group'+idx}}" wx:for="{{autho}}" wx:for-index="idx" wx:for-item="item">
<button class="text-sm cu1-btn lg {{idx==selectGroupIndex? 'text-green ':'text-black'}}" style="width:100%;" >{{item.HotelGroupsName}}({{item.Hotels.length}})</button>
</view>
</scroll-view>
</view>
<view style="height:100%;width: 60%;">
<scroll-view class="bg-white " scroll-y scroll-into-view="{{'Hotel'+hotelIndex}}" style="height:100%;width: 100%;" scroll-with-animation scroll-top >
<view class=" {{index==TabCurnode?'text-green ':'text-black'}}" id="{{'Hotel'+idx}}" bindtap="SelHotel" data-index="{{idx}}" wx:for="{{autho[selectGroupIndex].Hotels}}" wx:for-index="idx" wx:for-item="item">
<view style="font:bold;white-space: nowrap;overflow: hidden;" class="{{hotelIndex == idx?'text-green':''}} text-df bg-gray padding-xs margin-xs" >{{item.HotelName}}</view>
</view>
</scroll-view>
</view>
</view>
</view>

101
pages/index/index.wxss Normal file
View File

@@ -0,0 +1,101 @@
.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;
}

115
pages/login/login.js Normal file
View File

@@ -0,0 +1,115 @@
// pages/login.js
// app.js
const app = getApp()
import {
settoken,
Login
} from '../../lib/RequestingCenter.js'
Page({
/**
* 页面的初始数据
*/
data: {
login:false,
islong:false,
Uid:null,
Pwd:null
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
getwxlogin:function(){
app.toast(2,"暂未开放!");
},
//验证
submitForm(e) {
let that = this;
let type = e.currentTarget.dataset['type']
if(type=="1"){
that.setData({
islong:true
})
}
if(this.data.Uid == null || this.data.Uid=="" || this.data.Pwd == ""|| this.data.Pwd == null){
app.toast(2,"数据不完整")
}else {
Login({Pwd:that.data.Pwd,islong:that.data.islong,Uid:that.data.Uid}).then(res=>{
if(res.Status==200){
settoken(res.Data.token)
console.log("------------------------------------------")
// console.log(res)
if(that.data.islong){
wx.setStorageSync('xiaoxi_token', res.Data.token)
}
res.Data.userinfo.HeadImg = app.globalData.ImgUrl.replace("ImgUrl",res.Data.userinfo.HeadImg)
app.globalData.userinfo = res.Data.userinfo,
// console.log(res.Data.userinfo)
app.globalData.autho = res.Data.autho
// console.log(res.Data.autho)
// console.log("------------------------------------------")
app.toast(1,"登录成功",wx.reLaunch({
url: "/pages/index/index",
}))
}else{
app.toast(2,res.Message||"网络繁忙")
}
},err=>{
app.toast(2,"网络繁忙")
}
).catch(
err => {
console.log(err)
app.toast("异常",'error')
}
);
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
//登录
getlogin:function(){
this.setData({
login:true
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

2
pages/login/login.json Normal file
View File

@@ -0,0 +1,2 @@
{
}

48
pages/login/login.wxml Normal file
View File

@@ -0,0 +1,48 @@
<cu-custom bgColor="bg-cyan">
<view slot="content">BLV</view>
</cu-custom>
<!-- 选择按钮 -->
<view wx:if="{{!login}}" class="padding " >
<view class="flex justify-center">
<!-- 辅助布局 -->
<view class="flex-sub padding-sm margin-xs radius"></view>
<!-- 辅助布局 -->
<view class="flex-treble bg-cyan padding-sm margin-xs radius text-center" bindtap="getlogin">账号密码登录</view>
<!-- 辅助布局 -->
<view class="flex-sub padding-sm margin-xs radius"></view>
<!-- 辅助布局 -->
</view>
<view class="flex">
<!-- 辅助布局 -->
<view class="flex-sub padding-sm margin-xs radius"></view>
<!-- 辅助布局 -->
<view class="flex-treble bg-green padding-sm margin-xs radius text-center" bindtap="getwxlogin">微信登录</view>
<!-- 辅助布局 -->
<view class="flex-sub padding-sm margin-xs radius"></view>
<!-- 辅助布局 -->
</view>
</view>
<!-- 密码账号登录 -->
<view wx:if="{{login}}" class="padding " >
<view class="flex justify-center text-center">
<view class="flex-treble padding-sm margin-xs ">
<form>
<view class="cu-form-group margin-top">
<view class="title">账号</view>
<input placeholder="请输入账号" model:value="{{Uid}}" ></input>
</view>
<view class="cu-form-group">
<view class="title">密码</view>
<input type="password" placeholder="请输入密码" model:value="{{Pwd}}" ></input>
</view>
</form>
<view>
<button class="cu-btn bg-cyan margin lg" data-type="0" bindtap="submitForm">临时登录</button>
<button class="cu-btn bg-cyan margin-top lg" data-type="1" bindtap="submitForm">长期登录</button>
</view>
</view>
</view>
</view>
<mp-toptips msg="{{error}}" type="error" show="{{error}}"></mp-toptips>

0
pages/login/login.wxss Normal file
View File

314
pages/logs/logs.js Normal file
View File

@@ -0,0 +1,314 @@
const app = getApp()
//导入日志信息请求发方法
import {
Logsinfo
} from '../../lib/RequestingCenter.js'
var util = require('../../utils/util.js')
// pages/logs/logs.js
Page({
/**
* 页面的初始数据
*/
data: {
// 查询类型
apptype:-1,
// 时间范围 4 今日
seltime:4,
// 起始时间
starttime:"",
// 结束时间
endtime:"",
//正加载
status:0,
page:1,
logsdata:[],
//总数
sum:0,
//过滤后
filtcount:0,
//每次加载数量
pagelength:10,
//swview高度
topheight: 0,
//是否下拉
refresher:false,
// 酒店
Hotels:[],
// 下拉框的酒店
Hotelslist:[],
// 下拉框的索引
index:0,
//名字搜素
name:''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad:async function (options) {
//测试无需登录
if(app.globalData.userinfo==null){
wx.reLaunch({
url: "../autho/index",
})
return;
}
let that = this;
//酒店信息
let Hotels =[];
let Hotelslist =[]
Hotelslist.push("全部酒店");
let autho = app.globalData.autho
autho.forEach((x)=>{
x.Hotels.forEach(z=>{
Hotels.push(z);
Hotelslist.push(z.HotelName);
})
})
that.setData({
Hotels :Hotels,
Hotelslist:Hotelslist
})
setTimeout(function () {
try {
// 1.使用wx.createSelectorQuery()查询到需要滚动到的元素位置
wx.createSelectorQuery().select('#scroll').boundingClientRect(res => {
// 2.使用wx.getSysTemInfo()获取设备及页面高度windowHeightpx
wx.getSystemInfo({
success(ress) {
that.setData({
topheight: ress.windowHeight - res.top
})
}
})
}).exec(function (params) {
console.log(params)
})
} catch (error) {
console.log(error)
}
}, 100)
that.init();
},
sreach:function(params) {
this.setData({
page:1
})
this.init();
},
/**
* 下拉选择酒店
*/
bindPickerChange:function (e) {
this.setData({
index: e.detail.value,
page:1
})
this.init();
},
bindTimeChange:function (e) {
if(e.target.dataset.type==1){
this.setData({
seltime:5,
starttime: e.detail.value,
page:1
})
}else{
this.setData({
seltime:5,
endtime: e.detail.value,
page:1
})
}
this.init();
},
// 下拉刷新
toupper:function() {
if(this.data.refresher){
return;
}
this.setData({
refresher: true,
})
var that=this;
that.setData({
page: 1,
})
that.init();
},
// 上滑加载
MoreData:function (params) {
if(this.data.status==1 || this.data.status==3){
return;
}
let s = this.data.page+1;
this.setData({
status:1,
page:s
})
this.init();
},
//加载数据
init:async function () {
try {
if(this.data.page<1){
this.setData({
page:1
})
}
let that = this;
let search = {name:that.data.name,endtime:that.data.endtime,starttime:that.data.starttime,hotelsid:''};
let index = this.data.index -1;
if(index>=0){
search.hotelsid= that.data.Hotels[index].HotelId
}
await Logsinfo({
page:that.data.page,
search:search,
length:that.data.pagelength,
AppType:that.data.apptype
}).then(res => {
if (res.Status == 200) {
let newdata = res.Data.data
if(that.data.page > 1){
newdata = that.data.logsdata.concat(newdata);
}
//判断是否有更多
let more = 0;
if((that.data.page * that.data.pagelength)>=res.Data.filtcount){
more = 3;
}
if(res.Data.filtcount<=0){
newdata = [];
}
that.setData({
refresher: false,
logsdata: newdata,
status: more,
filtcount:res.Data.filtcount,
sum: res.Data.sum
})
} else {
that.setData({
status:2,
page:that.data.page-1
})
app.toast(2, res.Message || "网络繁忙")
}
}, err => {
that.setData({
status:2,
page:that.data.page-1
})
app.toast(2 ,"网络繁忙")
}).catch(err => {
that.setData({
status:2,
page:that.data.page-1
})
console.log(err)
app.toast(2 ,"网络繁忙")
});
} catch (error) {
console.log(error)
}
},
selapptype:function (e) {
let sel =Number(e.target.dataset.val) ;
this.setData({
apptype: sel,
page:1
})
this.init();
},
// 时间选择
seltime:function (e) {
let sel =Number(e.target.dataset.val) ;
let starttime = util.formatTime(new Date()).split(' ')[0];
let endtime = util.formatTime(new Date()).split(' ')[0];
switch (sel) {
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,
page:1
})
this.init();
},
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;
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
// this.init();
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

3
pages/logs/logs.json Normal file
View File

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}

79
pages/logs/logs.wxml Normal file
View File

@@ -0,0 +1,79 @@
<!-- 过滤器 -->
<wxs module="filter" src="../../utils/filters.wxs"></wxs>
<cu-custom bgColor="bg-gradual-blue" >
<block bindtap="" slot="backText" >返回</block>
<view slot="content">操作日志</view>
</cu-custom>
<view class="padding-sm bg-white radius shadow shadow-lg" style="padding-bottom:0;">
<view class="flex flex-wrap">
<view class="basis-xl text-df padding-top-xs ">
操作日志共{{sum}}条
<text class="padding-right"></text>过滤后{{filtcount}}条
</view>
<view style="flex-basis:100% " class="flex padding-top-xs">
<view class="margin-right-xs text-df">酒店:</view>
<picker class="text-df" mode="selector" value="{{index}}" bindchange="bindPickerChange" range="{{Hotelslist}}">
<view class="picker text-green" >
{{Hotelslist[index]}}
</view>
</picker>
</view>
<!-- 人脸机筛选 -->
<view style="flex-basis:100% " class="flex padding-top-xs">
<view bindtap="selapptype" data-val="-1" class="padding-right padding-left {{apptype==-1?'bg-green':''}} margin-right-xs text-df">全部</view>
<view bindtap="selapptype" data-val="0" class="padding-right padding-left {{apptype==0?'bg-green':''}} margin-right-xs text-df">RCU主机绑定信息</view>
<view bindtap="selapptype" data-val="1" class="padding-right padding-left {{apptype==1?'bg-green':''}} margin-right-xs text-df">人脸机绑定信息</view>
</view>
<!-- 时间筛选 -->
<view style="flex-basis:100% " class="flex padding-top-xs">
<view bindtap="seltime" data-val="4" class="padding-right padding-left {{seltime==4?'bg-green':''}} margin-right-xs text-df">全部</view>
<view bindtap="seltime" data-val="1" class="padding-right padding-left {{seltime==1?'bg-green':''}} margin-right-xs text-df">今日</view>
<view bindtap="seltime" data-val="2" class="padding-right padding-left {{seltime==2?'bg-green':''}} margin-right-xs text-df">本周</view>
<view bindtap="seltime" data-val="3" class="padding-right padding-left {{seltime==3?'bg-green':''}} margin-right-xs text-df">本月</view>
<view bindtap="seltime" data-val="5" class="padding-right padding-left {{seltime==5?'bg-green':''}} margin-right-xs text-df">指定时间</view>
</view>
<view style="flex-basis:100% " class="flex padding-top-xs">
<view class="margin-right-xs text-df">起始时间:</view>
<picker mode="date" class="text-df" data-type = "1" bindchange="bindTimeChange" :value="starttime" >
<view class="picker text-green">
{{starttime==""?"请选择":starttime}}
</view>
</picker>
<view class="margin-left-sm margin-right-xs text-df">截止时间:</view>
<picker start="{{starttime}}" mode="date" class="text-df" bindchange="bindTimeChange" data-type="2" :value="endtime" >
<view class="picker text-green">
{{endtime==""?"请选择":endtime}}
</view>
</picker>
</view>
<view style="flex-basis:100% " class="flex padding-top-xs align-center">
<view class="margin-right-xs text-df">用户名:</view>
<input style="border-bottom: 2rpx solid #ccc !important;" class="text-df padding-right padding-left margin-right-xs" placeholder="搜索用户" name="input" model:value="{{name}}"></input>
<view bindtap="sreach" class="padding-right padding-left bg-green text-df">搜素</view>
</view>
<!-- <view class="basis-sm">当前第{{page}}页</view> -->
</view>
<view class="bg-gray margin-xs" style="padding:2rpx" ></view>
<view id="scroll">
<scroll-view wx:if="{{topheight>0}}" style="height:{{topheight==null?'600rpx':topheight+'px'}} ;padding-bottom:10rpx" refresher-background="white" refresher-default-style="black" scroll-y refresher-enabled="{{true}}"
refresher-triggered="{{refresher}}" bindscrolltolower="MoreData" bindrefresherrefresh="toupper">
<view wx:for="{{logsdata}}" class="flex flex-wrap border-bottom">
<view class="basis-lg">{{item.Id}}<text class="margin-left-xs"></text>{{item.uid}}<text class="margin-left-xs"></text> {{filter.TimeFormat(item.createtime)}}</view>
<view class="basis-sm text-right">{{item.ActionId}}<text class='margin-left-xs text-{{item.type==0?"green":"red"}}'>{{item.AppType==0?"RCU":"人脸机"}}{{item.type==0?"绑定":"解绑"}}</text></view>
<!-- <view class="basis-df">行为:{{item.type==0?"绑定":"解绑"}}</view> -->
<view class="basis-xl">酒店:<text class='text-{{item.type==0?"green":"red"}}'>{{item.Name}}</text></view>
<view class="basis-sm">房间号:<text class='text-{{item.type==0?"green":"red"}}'>{{item.roomNumber}} - {{item.roomID}}</text></view>
<view class="basis-lg">{{item.AppType==0?"MAC":"SN"}}:<text class='text-{{item.type==0?"green":"red"}}'>{{item.MAC}}</text></view>
<view class="basis-xl">地点:{{item.location}}</view>
<view class="bg-gray margin-xs" style="padding:2rpx; width:100%" ></view>
</view>
<view class="cu-load bg-blue light loading" wx:if="{{status==1}}"></view>
<view class="cu-load bg-blue light over" wx:if="{{status==3}}"></view>
<view class="cu-load bg-red light erro " wx:if="{{status==2}}"></view>
</scroll-view>
</view>
</view>

1
pages/logs/logs.wxss Normal file
View File

@@ -0,0 +1 @@
/* pages/logs/logs.wxss */

81
pages/mycenter/index.js Normal file
View File

@@ -0,0 +1,81 @@
// pages/mycenter/index.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
userInfo: null,
},
//退出登录
LoginOut(){
wx.removeStorage({
key: 'xiaoxi_token',
success (res) {
wx.reLaunch({
url: "../login/login",
})
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.setData({
userInfo: app.globalData.userinfo,
autho: app.globalData.autho
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

View File

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}

33
pages/mycenter/index.wxml Normal file
View File

@@ -0,0 +1,33 @@
<!--pages/mycenter/index.wxml-->
<cu-custom bgColor="bg-gradual-blue">
<view slot="content">个人中心</view>
</cu-custom>
<view class="padding-sm bg-white radius shadow shadow-lg" >
<!-- 用户头像系列 -->
<view class="flex padding flex-wrap" style="width:100%">
<view class="flex align-center justify-center text-center" style="width:100%">
<view class="cu-avatar round xl" style="background-image:url({{userInfo.HeadImg}})"></view>
</view>
<view class="text-lg text-center padding-sm text-green" style="width:100%">{{userInfo.Uid}}</view>
</view>
<!-- 功能区域 -->
<view class="padding-xl">
<form>
<view class="cu-form-group ">
<view class="flex justify-between" style="width:100%">
<view class="text-df">我的反馈</view>
<view class="cu-capsule round">
<view class='cu-tag bg-red light'>{{userInfo.error.length || 0}}</view>
</view>
</view>
</view>
<view class="cu-form-group ">
<view class="flex justify-between" bindtap="LoginOut" style="width:100%">
<view class="text-df">退出登录</view>
</view>
</view>
</form>
</view>
</view>

View File