650添加应答,app图标添加

This commit is contained in:
liub
2025-09-15 11:55:44 +08:00
parent 6ee45f6868
commit 9c9c684ab6
27 changed files with 31504 additions and 7864 deletions

View File

@ -60,7 +60,7 @@
</view>
<view>重发包序号{{reSendNumber}}</view>
<view class="sending-progress" v-if="isSending">
<view class="progress-bar">
<view class="progress-fill" :style="{ width: progress + '%' }"></view>
</view>
@ -230,7 +230,7 @@
request,
baseURL
} from '@/utils/request.js';
var videoChannel=null;
var videoChannel = null;
var mqttClient = null;
export default {
data() {
@ -303,7 +303,7 @@
videoHeight: "",
videoDuration: "",
currentSOS: "",
reSendNumber:null
reSendNumber: null
}
},
computed: {
@ -678,51 +678,47 @@
);
} else {
try {
let json=JSON.parse(str);
if("staBlue_picture" in json){
let json = JSON.parse(str);
if ("staBlue_picture" in json) {
//重发图片
console.log("收到重新发送图片的命令");
this.reSendNumber=json.staBlue_picture;
setTimeout(()=>{
this.sendImagePackets(this.rgb565Data,json.staBlue_picture);
},0);
return ;
}
else if("staBlue_text" in json){
this.reSendNumber = json.staBlue_picture;
setTimeout(() => {
this.sendImagePackets(this.rgb565Data, json.staBlue_picture);
}, 0);
return;
} else if ("staBlue_text" in json) {
//重发文本
console.log("收到重新发送文本的命令");
this.reSendNumber=json.staBlue_text;
setTimeout(()=>{
this.sendText(null,json.staBlue_text);
},0)
return ;
}
else if("staBlue_vidio" in json){
this.reSendNumber = json.staBlue_text;
setTimeout(() => {
this.sendText(null, json.staBlue_text);
}, 0)
return;
} else if ("staBlue_vidio" in json) {
//重发视频
console.log("收到重新发送视频的命令");
videoChannel.emit("ReSendVideo", {
videoNo:json.staBlue_vidio
videoNo: json.staBlue_vidio
});
return ;
}
else if("staBlue" in json){
if(json.staBlue=="finish"){
return;
} else if ("staBlue" in json) {
if (json.staBlue == "finish") {
console.log("收到设备回复,全部传输完成");
}
return ;
}
else{
return;
} else {
console.log("无法解析该文本");
}
} catch (error) {
console.log("文本解析失败")
}
@ -1471,11 +1467,10 @@
events: {
ImgCutOver: function(data) {
console.log("111111");
console.log("data=", data.length);
console.log("data=", data);
these.rgb565Data = these.convertToRGB565(
data);
console.log("rgb565=", these.rgb565Data
.length);
data.piexls);
console.log("rgb565=", these.rgb565Data);
},
ImgCutOver_Path: function(data) {
these.tempImagePath = data;
@ -1627,7 +1622,7 @@
this.currentPacket = ReSendNo;
this.currentPacket = ReSendNo;
totalPackets = ReSendNo;
currentPacket=ReSendNo;
currentPacket = ReSendNo;
}
// 发送单个数据包
let sendNextPacket = () => {
@ -1635,9 +1630,9 @@
this.isSending = false;
if (!ReSendNo) {
this.bleSendComplete();
}else{
// this.reSendNumber="";
}
} else {
// this.reSendNumber="";
}
resolve();
return;
}
@ -1742,11 +1737,11 @@
reject(err);
});
}
if(ReSendNo){
if (ReSendNo) {
sendNextPacket();
}else{
HoldYouHand();
} else {
HoldYouHand();
}
});
@ -1877,7 +1872,7 @@
console.log('文字发送完成');
if (!ReSendNo) {
this.bleSendComplete();
}else{
} else {
// this.reSendNumber="";
}
@ -2002,10 +1997,9 @@
});
});
}
if(!ReSendNo){
HoldYouHand();
}
else{
if (!ReSendNo) {
HoldYouHand();
} else {
sendNextPacket();
}
@ -2017,14 +2011,14 @@
for (let i = 0; i < str.length; i++) {
dataView.setUint8(i, str.charCodeAt(i));
}
setTimeout(()=>{
setTimeout(() => {
this.sendData(buffer).then(() => {
console.log("完成指令发送成功");
}).catch(err => {
console.log("完成指令发送失败");
});
},500)
}, 500)
},
// 将文字转换为GBK编码使用第三方库或API
convertToGBK(text) {
@ -2074,7 +2068,7 @@
url: "/pages/BlueTooth/ModeSetting/VideoSend_670",
success: (res) => {
let channel = res.eventChannel;
videoChannel=channel;
videoChannel = channel;
channel.emit("receiveDevice", {
connectedDeviceId: this.connectedDeviceId,
serviceId: this.serviceId,
@ -2085,7 +2079,7 @@
});
},
fail(ex) {
console.log("出现异常,",ex);
console.log("出现异常,", ex);
}
})
},