初始化

This commit is contained in:
2025-12-11 09:50:45 +08:00
commit f52cfe714f
78 changed files with 11304 additions and 0 deletions

118
pages/Upgrade/Upgrade.js Normal file
View File

@@ -0,0 +1,118 @@
import {
GetRoomTypeNode
} from '../../lib/RequestingCenter.js'
const app = getApp()
Component({
/**
* 组件的属性列表
*/
properties: {
cWidth: { // 属性名
type: Number,
value: 100,
},
cheight: { // 属性名
type: Number,
value: 100,
},
},
/**
* 组件的初始数据
*/
data: {
myArray: [],
index: -1,
dat_filename:"固件文件.dat",
hex_filename:"固件文件.Hex",
devlist:[],
RoomNomber:[],
},
/**
* 组件的方法列表
*/
methods: {
async bindPickerChange(e) {
console.log('picker发送选择改变携带值为', e.detail.value);
// 更新数据
this.setData({
index: e.detail.value,
});
let strbuf= this.data. myArray[e.detail.value].split('|')
try {
// 调用 GetRoomTypeNode
const res = await GetRoomTypeNode({
hotelid: app.globalData.HotelId,
roomTypeID: strbuf[0],
});
// 调用全局方法
// await app.SetroontypeListindex(res);
// // 更新数据
// this.setData({
// roomtype: app.globalData.roomIDName,
// });
console.log(res);
} catch (err) {
console.log('GetRoomTypeNode error', err);
}
},
},
// 组件生命周期
pageLifetimes: {
show: function() {
console.log('页面被展示')
},
hide: function() {
console.log('页面被隐藏')
},
resize: function(size) {
console.log('页面尺寸变化')
},
},
lifetimes:{
show: function() {
debugger
console.log('picker发送选择改变携带值为')
},
ready: function () {
debugger
console.log(app.globalData.roomIDName)
this.setData({
myArray:app.globalData.roomIDName
})
console.log( this.data.myArray)
},
attached: function() {
// // 在组件实例进入页面节点树时执行
// debugger
// console.log(app.globalData.roomIDName)
// this.setData({
// myArray:app.globalData.roomIDName
// })
// console.log( this.data.myArray)\
},
detached: function() {
// 在组件实例被从页面节点树移除时执行
console.log('在组件实例被从页面节点树移除时执行')
}
},
})

View File

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

View File

@@ -0,0 +1,72 @@
<view style="height:100%;Width:100%;background: aquamarine;" >
<!-- 房型 -->
<view class="flex align-center bg-gray">
<view class=" ">
<text >房型:</text>
</view>
<view class="flex-eight " style=" justify-content: center; align-items: center;padding: 5rpx 20rpx;">
<picker class="" mode="selector" range="{{myArray}}" bindchange="bindPickerChange">
<view class="cu-tag line-cyan basis-xl " style="width: 100%;" >
<view class="basis-xxl" style=" text-align: center; ">{{myArray[index]}}</view>
<text class="cuIcon-triangledownfill"style="padding: 5rpx 30rpx;" ></text>
</view>
</picker>
</view>
</view>
<!-- 房型下的信息 -->
<view class="flex align-start bg-gray setborder line-grey">
<view class="flex-sub " style="height: 100rpx;" >
<checkbox style="top:25%;left: 12%;"></checkbox>
</view>
<view class="flex-sub " style="height: 100rpx" >
<view class="flex-sub title setborder line-grey" style="height: 50rpx">固件</view>
<view class="flex-sub title setborder line-grey" style="height: 50rpx">配置</view>
</view>
<view class="flex-xis" style="height: 100rpx" >
<view class="flex-xis title setborder line-grey" style="height: 50rpx">
<text>{{dat_filename}}</text>
</view>
<view class="flex-xis title setborder line-grey" style="height: 50rpx">
<text>{{hex_filename}}</text>
</view>
</view>
<view class="flex-subN " style="height: 100rpx" >
<button class="cu-btn setborder line-blue"style=" font-size: 25rpx;height: 50rpx" >升级</button>
<button class="cu-btn setborder line-blue"style=" font-size: 25rpx;height: 50rpx" >升级</button>
</view>
<view class="flex-subN " style="height: 100rpx" >
<button class="cu-btn setborder line-grey"style=" font-size: 25rpx;height: 100rpx" >设置</button>
</view>
</view>
<!-- 房型下的各个房号信息 -->
<view>
<view class="flex align-center " style="height: 50rpx;">
<view class="devices_summary">已升级设备{{devlist.length}}</view>
<button style=" font-size: 18rpx;" data-index="0" bindtap="openBluetoothAdapter" class=" flex-sub newcu-btn bg-{{showinfo==0?'green':'grey'}} ">设置</button>
<button style=" font-size: 18rpx;" data-index="0" bindtap="openBluetoothAdapter" class=" flex-sub newcu-btn bg-{{showinfo==0?'green':'grey'}} ">通信日志</button>
</view>
<scroll-view class="device_list" scroll-y scroll-with-animation>
<view wx:for="{{devices}}" wx:key="index"
class="device_item cf padding-sm">
<view data-device-id="{{item.deviceId}}" data-name="{{item.name || item.localName}}" class="fl flex-eight bg-{{devicedisplay==item.deviceId?'green':'white'}}" bindtap="createBLEConnection" hover-class="device_item_hover" >
<view style="font-size: 16px; color: #333;"> {{item.name}}</view>
<view style="font-size: 10px">信号强度: {{item.RSSI}}dBm ({{utils.max(0, item.RSSI + 100)}}%)</view>
<view style="font-size: 10px">UUID: {{item.deviceId}}</view>
<view style="font-size: 10px">Service数量: {{utils.len(item.advertisServiceUUIDs)}}</view>
<!-- <view class="bg-gray margin-xs" style="padding:2rpx;"></view> -->
</view>
<view class="fr flex-twice">
<button class="bg-red padding-lg margin-xs radius " style="font-size: 26rpx; " data-index="0" bindtap="closeBLEConnection" wx:if="{{devicedisplay==item.deviceId}}">断开连接</button>
</view>
</view>
</scroll-view>
</view>
</view>

View File

@@ -0,0 +1,24 @@
@import "../../colorui/main.wxss";
@import "../../colorui/icon.wxss";
.setborder
{
border: 1rpx solid currentColor;
}
.newcu-btn {
position: relative;
border: 0rpx;
display: inline-flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
padding: 0 20rpx;
font-size: 20rpx;
height: 50rpx;
line-height: 1;
text-align: center;
text-decoration: none;
overflow: visible;
margin-left: initial;
transform: translate(0rpx, 0rpx);
margin-right: initial;
}