浇花器
This commit is contained in:
parent
0007cf28bd
commit
da45ae50e3
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user