670人员登记调整,蓝牙成功不再走后端
This commit is contained in:
@ -282,7 +282,7 @@
|
||||
request,
|
||||
baseURL
|
||||
} from '../../utils/request';
|
||||
|
||||
import lnglatConvert from '@/utils/wgs84_to_gcj02.js'
|
||||
|
||||
const pagePath = "pages/670/HBY670";
|
||||
var ble = null;
|
||||
@ -369,6 +369,7 @@
|
||||
showClose: false
|
||||
},
|
||||
usrToggle: true,
|
||||
bleLinkCnt:0
|
||||
},
|
||||
formData: {
|
||||
battary: "", //电量
|
||||
@ -380,9 +381,9 @@
|
||||
modeCurr: "", //档位
|
||||
SOS: "", //sos
|
||||
lightCurr: "qiang", //照明模式
|
||||
company: "", //单位
|
||||
usrname: "", //姓名
|
||||
job: "", //职位
|
||||
company: "湖北消防总队", //单位
|
||||
usrname: "胡红军", //姓名
|
||||
job: "中队长", //职位
|
||||
usrid: "", //id
|
||||
msgTxt: "", //消息1
|
||||
qzwarn: false, //是否强制报警
|
||||
@ -469,6 +470,7 @@
|
||||
var device = data.data;
|
||||
these.Status.apiType = data.apiType;
|
||||
these.device = device;
|
||||
these.formData.usrid = device.deviceImei;
|
||||
if (data.apiType !== 'listA') {
|
||||
Common.getdeviceShareId(data.data.id).then(res => {
|
||||
if (res.code == 200) {
|
||||
@ -523,7 +525,10 @@
|
||||
},
|
||||
methods: {
|
||||
showBleUnConnect() {
|
||||
|
||||
this.Status.bleLinkCnt++;
|
||||
if(this.Status.bleLinkCnt>3){
|
||||
return;
|
||||
}
|
||||
this.showPop({
|
||||
message: "蓝牙未连接过该设备,请使用蓝牙重新添加该设备",
|
||||
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
|
||||
@ -557,8 +562,9 @@
|
||||
});
|
||||
},
|
||||
gotoMap() {
|
||||
this.detailData.longitude = this.formData.Lon;
|
||||
this.detailData.latitude = this.formData.Lat;
|
||||
let lnglat=lnglatConvert.wgs84_to_gcj02(this.formData.Lon,this.formData.Lat);
|
||||
this.detailData.longitude = lnglat[0];
|
||||
this.detailData.latitude = lnglat[1];
|
||||
uni.navigateTo({
|
||||
url: '/pages/common/map/index',
|
||||
events: {
|
||||
@ -2196,14 +2202,14 @@
|
||||
hideLoading(these);
|
||||
|
||||
|
||||
let json = {
|
||||
deviceId: these.device.id,
|
||||
name: these.formData.company,
|
||||
position: these.formData.usrname,
|
||||
unitName: these.formData.job,
|
||||
code: these.formData.usrid
|
||||
};
|
||||
api.sendUsr(json)
|
||||
// let json = {
|
||||
// deviceId: these.device.id,
|
||||
// name: these.formData.company,
|
||||
// position: these.formData.usrname,
|
||||
// unitName: these.formData.job,
|
||||
// code: these.formData.usrid
|
||||
// };
|
||||
// api.sendUsr(json)
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2221,7 +2227,7 @@
|
||||
let s = (text.length * 2).toString(16);
|
||||
let len = String(s).padStart(4, '0')
|
||||
len = len.match(/.{1,2}/g);
|
||||
|
||||
|
||||
// 填充头部
|
||||
dataView.setUint8(0, 0x55); // 帧头
|
||||
dataView.setUint8(1, 0x03); // 帧类型:文字
|
||||
@ -2251,10 +2257,10 @@
|
||||
|
||||
// 发送下一个包
|
||||
currentPacket++;
|
||||
setTimeout(sendNextPacket, 0);
|
||||
setTimeout(sendNextPacket, 2000);
|
||||
}).catch(err => {
|
||||
if (err.code == '10007') {
|
||||
setTimeout(sendNextPacket, 0);
|
||||
setTimeout(sendNextPacket,2000);
|
||||
} else {
|
||||
requestSend();
|
||||
}
|
||||
@ -2276,7 +2282,7 @@
|
||||
these.HoldYouHand("word transmit start", 120, f.deviceId, f.writeServiceId, f
|
||||
.wirteCharactId).then(
|
||||
() => {
|
||||
setTimeout(sendText, 200);
|
||||
setTimeout(sendText, 2000);
|
||||
}).catch((ex) => {
|
||||
requestSend();
|
||||
// console.log("握手没有成功", ex);
|
||||
|
||||
Reference in New Issue
Block a user