初始化

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

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;
}