|
@@ -5,7 +5,7 @@
|
|
|
</view>
|
|
|
<!-- 称重 -->
|
|
|
<view class="content">
|
|
|
- <view @click="toTdRecord" class="tdrecord">投递记录</view>
|
|
|
+ <view @click="toHelp" class="tdrecord">蓝牙使用帮助</view>
|
|
|
<view class="cz-box" @click="toWork">
|
|
|
<view :class="loading?'turn':''">
|
|
|
<u-image width="100rpx" height="100rpx" src="/static/chengzhong.png"></u-image>
|
|
@@ -108,10 +108,10 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 查看投递记录
|
|
|
- toTdRecord(){
|
|
|
+ // 使用帮助
|
|
|
+ toHelp(){
|
|
|
uni.navigateTo({
|
|
|
- url: '/pages/tdRecord/tdRecord'
|
|
|
+ url: '/pages/help/help'
|
|
|
})
|
|
|
},
|
|
|
// 去认证用户并开始称重
|
|
@@ -132,7 +132,7 @@
|
|
|
console.log(res)
|
|
|
_this.iosMac = res.result
|
|
|
uni.navigateTo({
|
|
|
- url: '/pages/userAuth/userAuth?deviceId=' + _this.iosMac
|
|
|
+ url: '/pages/userAuth/userAuth?macAddress=' + _this.iosMac + '&id=' + _this.deviceId
|
|
|
})
|
|
|
}
|
|
|
})
|
|
@@ -142,7 +142,7 @@
|
|
|
}else{
|
|
|
// 安卓系统直接跳转
|
|
|
uni.navigateTo({
|
|
|
- url: '/pages/userAuth/userAuth?deviceId=' + (this.platform == 'ios' ? _this.iosMac : _this.deviceId)
|
|
|
+ url: '/pages/userAuth/userAuth?macAddress=' + (this.platform == 'ios' ? _this.iosMac : _this.deviceId) + '&id=' + _this.deviceId
|
|
|
})
|
|
|
}
|
|
|
}else{
|
|
@@ -230,8 +230,18 @@
|
|
|
// 关闭连接
|
|
|
_this.statusStr = '蓝牙已关闭,请开启手机蓝牙'
|
|
|
_this.loading = false
|
|
|
- // _this.connectedDeviceId = null
|
|
|
- // _this.closeConnect()
|
|
|
+ if(_this.connectedDeviceId){
|
|
|
+ uni.closeBLEConnection({
|
|
|
+ deviceId: _this.connectedDeviceId,
|
|
|
+ success: function(res) {
|
|
|
+ console.log(res)
|
|
|
+ _this.connectedDeviceId = null
|
|
|
+ },
|
|
|
+ fail(res) {
|
|
|
+ console.log(res)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}else{
|
|
|
if(!res.discovering && !_this.loading){
|
|
|
_this.statusStr = '蓝牙已启用,请绑定设备'
|
|
@@ -298,7 +308,7 @@
|
|
|
},
|
|
|
fail(err) {
|
|
|
console.log(err,'createBLEConnection error')
|
|
|
- _this.statusStr = '设备连接失败,请检查后重试'
|
|
|
+ _this.statusStr = '设备连接失败,请检查蓝牙是否开启后重试'
|
|
|
_this.connectStatus = false
|
|
|
_this.loading = false
|
|
|
uni.$emit('blueConnectCallback',0)
|
|
@@ -381,7 +391,7 @@
|
|
|
|
|
|
/*用来监听手机蓝牙设备的数据变化*/
|
|
|
uni.onBLECharacteristicValueChange(function(res) {
|
|
|
- console.log(res,'read data')
|
|
|
+ // console.log(res,'read data')
|
|
|
that.balanceData = that.buf2string(res.value)
|
|
|
that.$u.vuex('vuex_balanceData',that.balanceData)
|
|
|
})
|