浇花器
This commit is contained in:
parent
0007cf28bd
commit
da45ae50e3
|
@ -343,11 +343,23 @@
|
||||||
|
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
wx.openBluetoothAdapter({
|
||||||
|
success: function (res) {
|
||||||
|
console.log('蓝牙适配器初始化成功');
|
||||||
|
},
|
||||||
|
fail: function (err) {
|
||||||
|
console.error('蓝牙适配器初始化失败,可能是因为没有权限', err);
|
||||||
|
uni.showToast({
|
||||||
|
title: '蓝牙适配器初始化失败,可能是因为没有权限',
|
||||||
|
icon: 'none',
|
||||||
|
duration:2000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
// 请求个人信息
|
// 请求个人信息
|
||||||
this.getinfo()
|
this.getinfo()
|
||||||
// 一进来每分钟发一次上传信息命令
|
// 一进来每分钟发一次上传信息命令
|
||||||
this.getshuju()
|
this.getshuju()
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 点击进行设备录入
|
// 点击进行设备录入
|
||||||
|
@ -401,7 +413,6 @@
|
||||||
this.getshebxq()
|
this.getshebxq()
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
|
|
||||||
if(this.datalist == ''){
|
if(this.datalist == ''){
|
||||||
let that = this
|
let that = this
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
|
@ -924,16 +935,8 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 获取设备列表
|
// 一开始提示是否连接
|
||||||
getlist(){
|
getlianjie(){
|
||||||
this.$u.get(`/app/getDeviceInfoByUser?userId=${this.userobj.userId}`).then((res) => {
|
|
||||||
if (res.code == 200) {
|
|
||||||
if(res.data.length > 0 || res.data != ''){
|
|
||||||
this.bjflag = false
|
|
||||||
this.devicelist = res.data
|
|
||||||
this.mac = res.data[0].mac
|
|
||||||
this.user = res.data[0]
|
|
||||||
this.shebid = res.data[0].deviceId
|
|
||||||
if(this.datalist == ''){
|
if(this.datalist == ''){
|
||||||
let that = this
|
let that = this
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
|
@ -954,6 +957,33 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 获取设备列表
|
||||||
|
getlist(){
|
||||||
|
this.$u.get(`/app/getDeviceInfoByUser?userId=${this.userobj.userId}`).then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
if(res.data.length > 0 || res.data != ''){
|
||||||
|
this.bjflag = false
|
||||||
|
this.devicelist = res.data
|
||||||
|
this.mac = res.data[0].mac
|
||||||
|
this.user = res.data[0]
|
||||||
|
this.shebid = res.data[0].deviceId
|
||||||
|
let that = this
|
||||||
|
wx.openBluetoothAdapter({
|
||||||
|
success: function (res) {
|
||||||
|
console.log('蓝牙适配器初始化成功');
|
||||||
|
that.getlianjie()
|
||||||
|
},
|
||||||
|
fail: function (err) {
|
||||||
|
console.error('蓝牙适配器初始化失败,可能是因为没有权限', err);
|
||||||
|
uni.showToast({
|
||||||
|
title: '蓝牙适配器初始化失败,可能是因为没有权限',
|
||||||
|
icon: 'none',
|
||||||
|
duration:2000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
}else{
|
}else{
|
||||||
this.bjflag = true
|
this.bjflag = true
|
||||||
}
|
}
|
||||||
|
@ -981,17 +1011,7 @@
|
||||||
if (!options.result) {
|
if (!options.result) {
|
||||||
this.datalist = ''
|
this.datalist = ''
|
||||||
this.ver_data = ''
|
this.ver_data = ''
|
||||||
// uni.showModal({
|
|
||||||
// title: '很抱歉提醒你!',
|
|
||||||
// content: '小程序与设备异常断开',
|
|
||||||
// showCancel: false,
|
|
||||||
// //是否显示取消按钮
|
|
||||||
// success: function(res) {
|
|
||||||
// uni.hideLoading()
|
|
||||||
// this.datalist = ''
|
|
||||||
// this.ver_data = ''
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS:
|
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user