|
|
@ -103,6 +103,13 @@ |
|
|
}, |
|
|
}, |
|
|
mounted() { |
|
|
mounted() { |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
watch: { |
|
|
|
|
|
isShowSearch(newVal, oldVal) { |
|
|
|
|
|
if(newVal == false){ |
|
|
|
|
|
this.$parent.$parent.isShow = true |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
onLoad() { |
|
|
onLoad() { |
|
|
|
|
|
|
|
|
@ -118,6 +125,8 @@ |
|
|
//点击打印按钮 |
|
|
//点击打印按钮 |
|
|
handlePrintTap() { |
|
|
handlePrintTap() { |
|
|
let that = this |
|
|
let that = this |
|
|
|
|
|
console.log(this.$parent) |
|
|
|
|
|
this.$parent.$parent.clickShow(); |
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
|
mask: true, |
|
|
mask: true, |
|
|
title: '加载中...' |
|
|
title: '加载中...' |
|
|
@ -162,8 +171,8 @@ |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
uni.removeStorageSync('deviceId'); |
|
|
uni.removeStorageSync('deviceId'); |
|
|
this.isShowSearch = true |
|
|
that.isShowSearch = true |
|
|
this.sousuo() |
|
|
that.sousuo() |
|
|
uni.hideLoading(); |
|
|
uni.hideLoading(); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
@ -206,7 +215,7 @@ |
|
|
wx.createBLEConnection({ //555 |
|
|
wx.createBLEConnection({ //555 |
|
|
deviceId: deviceId, // 搜索到设备的 deviceId |
|
|
deviceId: deviceId, // 搜索到设备的 deviceId |
|
|
success: () => { |
|
|
success: () => { |
|
|
this.isShowSearch = false |
|
|
that.isShowSearch = false |
|
|
console.log('连接设备成功') |
|
|
console.log('连接设备成功') |
|
|
that.huoqufuwu(deviceId) |
|
|
that.huoqufuwu(deviceId) |
|
|
}, |
|
|
}, |
|
|
@ -214,7 +223,7 @@ |
|
|
console.log('连接设备失败', res) |
|
|
console.log('连接设备失败', res) |
|
|
that.tui.toast('连接设备失败', res) |
|
|
that.tui.toast('连接设备失败', res) |
|
|
if (uni.getStorageSync('deviceId')) { |
|
|
if (uni.getStorageSync('deviceId')) { |
|
|
this.huoqufuwu(uni.getStorageSync('deviceId')) |
|
|
that.huoqufuwu(uni.getStorageSync('deviceId')) |
|
|
} else { |
|
|
} else { |
|
|
wx.closeBLEConnection({ |
|
|
wx.closeBLEConnection({ |
|
|
deviceId: uni.getStorageSync('deviceId'), |
|
|
deviceId: uni.getStorageSync('deviceId'), |
|
|
@ -223,8 +232,8 @@ |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
uni.removeStorageSync('deviceId') |
|
|
uni.removeStorageSync('deviceId') |
|
|
this.sousuo() |
|
|
that.sousuo() |
|
|
this.isShowSearch = true |
|
|
that.isShowSearch = true |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
uni.hideLoading(); |
|
|
uni.hideLoading(); |
|
|
@ -249,7 +258,7 @@ |
|
|
console.log(res1) |
|
|
console.log(res1) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
this.isShowSearch = true |
|
|
that.isShowSearch = true |
|
|
uni.hideLoading(); |
|
|
uni.hideLoading(); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
@ -282,7 +291,7 @@ |
|
|
console.log(res) |
|
|
console.log(res) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
this.isShowSearch = true |
|
|
that.isShowSearch = true |
|
|
uni.hideLoading(); |
|
|
uni.hideLoading(); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|