浇花器

This commit is contained in:
3321822538@qq.com 2025-01-10 17:14:17 +08:00
parent 0007cf28bd
commit da45ae50e3

View File

@ -267,7 +267,7 @@
<u-picker v-model="showjs" mode="time" :params="params" @confirm="confirm"></u-picker> <u-picker v-model="showjs" mode="time" :params="params" @confirm="confirm"></u-picker>
<tab-bar :indexs='0'></tab-bar> <tab-bar :indexs='0'></tab-bar>
</view> </view>
</template> </template>
@ -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,6 +935,30 @@
} }
}) })
}, },
//
getlianjie(){
if(this.datalist == ''){
let that = this
uni.showModal({
title: '提示',
content: '设备未连接,是否进行设备连接?',
success: function (res) {
if (res.confirm) {
uni.hideLoading()
that.btnlj()
} else if (res.cancel) {
uni.hideLoading()
uni.showToast({
title: '已取消连接',
icon: 'none',
duration:2000
})
}
}
})
}
},
// //
getlist(){ getlist(){
this.$u.get(`/app/getDeviceInfoByUser?userId=${this.userobj.userId}`).then((res) => { this.$u.get(`/app/getDeviceInfoByUser?userId=${this.userobj.userId}`).then((res) => {
@ -934,26 +969,21 @@
this.mac = res.data[0].mac this.mac = res.data[0].mac
this.user = res.data[0] this.user = res.data[0]
this.shebid = res.data[0].deviceId this.shebid = res.data[0].deviceId
if(this.datalist == ''){ let that = this
let that = this wx.openBluetoothAdapter({
uni.showModal({ success: function (res) {
title: '提示', console.log('蓝牙适配器初始化成功');
content: '设备未连接,是否进行设备连接?', that.getlianjie()
success: function (res) { },
if (res.confirm) { fail: function (err) {
uni.hideLoading() console.error('蓝牙适配器初始化失败,可能是因为没有权限', err);
that.btnlj() uni.showToast({
} else if (res.cancel) { title: '蓝牙适配器初始化失败,可能是因为没有权限',
uni.hideLoading() icon: 'none',
uni.showToast({ duration:2000
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: