wangfukang 3 years ago
parent
commit
0ffdd6a5f0
  1. BIN
      components/.DS_Store
  2. 25
      components/kk-printer/index.vue

BIN
components/.DS_Store

Binary file not shown.

25
components/kk-printer/index.vue

@ -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();
} }
}) })

Loading…
Cancel
Save