|
@@ -119,14 +119,18 @@
|
|
|
}
|
|
|
return Math.floor(ret)
|
|
|
},
|
|
|
+ // 称重结果
|
|
|
balanceData() {
|
|
|
this.cancel()
|
|
|
-
|
|
|
- let data = this.$store.state.vuex_balanceData
|
|
|
+ let _this = this
|
|
|
+ let data = _this.$store.state.vuex_balanceData
|
|
|
console.log(data)
|
|
|
+
|
|
|
+ // 解析结果
|
|
|
let weight = data.split(',')[2]
|
|
|
- let uit = ''
|
|
|
- let fh = ''
|
|
|
+ let uit = '' // 单位
|
|
|
+ let fh = '' // 正负符号
|
|
|
+ // 去掉换行符
|
|
|
weight = weight.replace('\n','')
|
|
|
|
|
|
// 符号位
|
|
@@ -155,13 +159,14 @@
|
|
|
uit = 'g'
|
|
|
}
|
|
|
|
|
|
- console.log(weight,uit,fh,'weight end')
|
|
|
- this.formData.rubbishWeight = weight
|
|
|
+ // console.log(weight,uit,fh,'weight end')
|
|
|
+ _this.formData.rubbishWeight = weight
|
|
|
return fh + weight
|
|
|
}
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
let _this = this
|
|
|
+ // 设备id,去掉冒号并转小写
|
|
|
this.deviceId = options.deviceId.toLowerCase()
|
|
|
this.deviceId = this.deviceId.replace(/:/g,'')
|
|
|
|
|
@@ -246,7 +251,7 @@
|
|
|
}
|
|
|
|
|
|
this.loading = true
|
|
|
- // 查询用户余额
|
|
|
+ // 查询用户乐豆余额
|
|
|
queryldByMobile({mobile: this.formData.customerMobile}).then(res => {
|
|
|
if(res.status == 200){
|
|
|
this.current = this.current + 1
|
|
@@ -255,9 +260,11 @@
|
|
|
this.loading = false
|
|
|
})
|
|
|
},
|
|
|
+ // 上一步
|
|
|
prev(){
|
|
|
this.current = this.current - 1
|
|
|
},
|
|
|
+ // 提交保存结果
|
|
|
submit(){
|
|
|
let that = this
|
|
|
console.log(this.formData.rubbishWeight,'this.formData.rubbishWeight')
|
|
@@ -268,14 +275,14 @@
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- // 判断设备仍然连接中
|
|
|
+ // 判断设备蓝牙是否仍然连接中
|
|
|
uni.getBluetoothDevices({
|
|
|
success(res) {
|
|
|
let has = res.devices.find(item => {
|
|
|
let deviceId = item.deviceId.toLowerCase()
|
|
|
return deviceId.replace(/:/g,'') == that.deviceId
|
|
|
})
|
|
|
- console.log(has,'判断设备仍然连接中')
|
|
|
+ // console.log(has,'判断设备仍然连接中')
|
|
|
if(that.blueConnect && has){
|
|
|
that.showOk = true
|
|
|
that.modelContent = `
|
|
@@ -300,7 +307,9 @@
|
|
|
console.log(this.formData,'formData')
|
|
|
saveDelivery(this.formData).then(res => {
|
|
|
if(res.status == 200){
|
|
|
- uni.navigateBack()
|
|
|
+ setTimeout(()=>{
|
|
|
+ uni.navigateBack()
|
|
|
+ },500)
|
|
|
}
|
|
|
uni.showToast({
|
|
|
icon: 'none',
|
|
@@ -365,7 +374,7 @@
|
|
|
> view{
|
|
|
width: 46%;
|
|
|
border: 1px solid #eee;
|
|
|
- margin: 10rpx 0;
|
|
|
+ margin: 10rpx;
|
|
|
padding: 10rpx 20rpx;
|
|
|
border-radius: 8rpx;
|
|
|
display: flex;
|