1
0
forked from dyf/APP

6155完成部分协议对接

This commit is contained in:
liub
2025-08-15 16:39:00 +08:00
parent 6ef2bb08b9
commit e95b2466e1
10 changed files with 871 additions and 708 deletions

File diff suppressed because it is too large Load Diff

View File

@ -309,6 +309,7 @@
these.formData.deviceName = device.deviceName;
these.formData.img = device.devicePic;
these.formData.id = device.id;
these.formData.deviceId=f.deviceId;
ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId);
these.setBleFormData();
@ -321,9 +322,7 @@
},
onBackPress(e) {
ble.removeReceiveCallback();
},
computed: {
RSSIRemark: function() {
@ -488,7 +487,8 @@
},
getDevice: function() {
console.log("LinkedList=",ble.data.LinkedList);
console.log("formData=",these.formData);
let f = ble.data.LinkedList.find((v) => {
return v.deviceId == these.formData.deviceId;
});
@ -1112,6 +1112,10 @@
let key = keys[i];
these.Status.Pop[key] = option[key];
}
if (!option.borderColor) {
option.borderColor = '#BBE600';
option.buttonBgColor = '#BBE600';
}
these.Status.Pop.showPop = true;
},
sendUsr: function() {
@ -1126,9 +1130,7 @@
];
showLoading(this, {
text: "请稍候..."
});
let f = this.getDevice();
if (!f) {
these.showPop({
@ -1139,7 +1141,9 @@
});
return;
}
showLoading(this, {
text: "请稍候..."
});
var sendText = function() {

View File

@ -19,13 +19,18 @@
连接
</view>
<global-loading ref="loading" />
</view>
</template>
<script>
import request from '@/utils/request.js';
import bleTool from '@/utils/BleHelper.js'
import {
showLoading,
hideLoading,
updateLoading
} from '@/utils/loading.js'
var these = null;
var eventChannel = null;
var ble=null;
@ -110,9 +115,9 @@
}
these.Statu.bound = null;
these.Statu.boundRemark = "";
uni.showLoading({
mask: true,
title: "连接中..."
showLoading(these,{
text: "连接中..."
})
let promise = request({
url: '/app/device/bind',
@ -142,7 +147,7 @@
these.Statu.bound = false;
these.Statu.boundRemark = '出现了未知的异常,操作失败';
}).finally(() => {
uni.hideLoading();
hideLoading(this);
});
}
}

View File

@ -81,12 +81,20 @@
</view>
</view>
</BottomSlideMenuPlus>
<global-loading ref="loading" />
</view>
</template>
<script>
import bleTool from '@/utils/BleHelper.js';
import request from '@/utils/request.js';
import {
showLoading,
hideLoading,
updateLoading
} from '@/utils/loading.js'
var ble = null;
var these = null;
export default {
@ -131,7 +139,8 @@
},
onBackPress: (e) => {
ble.StopSearch();
ble.removeDeviceFound();
ble.removeReceiveCallback();
},
onLoad() {
these = this;
@ -142,12 +151,15 @@
for (var i = 0; i < arr.length; i++) {
arr[i].linkStatu = false;
if(!arr[i].name){
continue;
}
let f = these.EquipMents.find(function(v) {
return v.deviceId == arr[i].deviceId;
});
if (!f) {
these.EquipMents.push(arr[i]);
} else {
@ -229,9 +241,8 @@
},
Link: function(item, index) {
uni.showLoading({
title: "正在连接",
mask: true
showLoading(this,{
text: "正在连接"
});
setTimeout(() => {
let serviceid=null;
@ -262,7 +273,7 @@
content:"连接失败:"+ex.msg
});
}).finally(()=>{
uni.hideLoading();
hideLoading(this);
});
}, 0);