119 lines
2.4 KiB
JavaScript
119 lines
2.4 KiB
JavaScript
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('在组件实例被从页面节点树移除时执行')
|
||
}
|
||
},
|
||
|
||
})
|