Commit 417531e3 authored by caicaicai's avatar caicaicai

修改

parent 8d550eb9
......@@ -723,50 +723,50 @@ export default {
// xhr.onreadystatechange=onreadystatechange("上传方式一【Base64】");
// xhr.send(postData);
//发送语音数据
if (This.websocket.readyState === 1) { // that.websock.readyState = 1 表示连接成功,可以立即发送信息
if (This.websocket.readyState == 1) { // that.websock.readyState = 1 表示连接成功,可以立即发送信息
This.websocketsend(`{"toUserId":"${This.carAllNumberString}","contentText":"${postData}","fromUserId":"${This.dialogTitle1}"}`);
//上传到数据库
HttpReq.truckDispatching.recentNoticeAdd({noticeClass:This.dialogTitle1,flag:1,videoContent:postData}).then((res) => {
if(res.code == 200){
//近期通知列表
HttpReq.truckDispatching.recentNoticeQuery({size:50,sort:'id,desc',}).then((res) => {
if(res.code == 200){
This.recentNoticeData = res.data.content;
};
})
}else{
this.$notify({
title: res.msg,
type: 'error',
duration: 2500
})
}
}).catch(function(error) { });
// HttpReq.truckDispatching.recentNoticeAdd({noticeClass:This.dialogTitle1,flag:1,videoContent:postData}).then((res) => {
// if(res.code == 200){
// //近期通知列表
// HttpReq.truckDispatching.recentNoticeQuery({size:50,sort:'id,desc',}).then((res) => {
// if(res.code == 200){
// This.recentNoticeData = res.data.content;
// };
// })
// }else{
// this.$notify({
// title: res.msg,
// type: 'error',
// duration: 2500
// })
// }
// }).catch(function(error) { });
This.$notify({
title: '上传成功!',
type: 'success',
duration: 2500
});
} else if (This.websocket.readyState === 0) { // 表示正在连接,设置300ms后发送信息
} else if (This.websocket.readyState == 0) { // 表示正在连接,设置300ms后发送信息
setTimeout(function () {
This.websocketsend(`{"toUserId":"${This.carAllNumberString}","contentText":"${postData}","fromUserId":"${This.dialogTitle1}"}`);
HttpReq.truckDispatching.recentNoticeAdd({noticeClass:This.dialogTitle1,flag:1,videoContent:postData}).then((res) => {
if(res.code == 200){
//近期通知列表
HttpReq.truckDispatching.recentNoticeQuery({size:50,sort:'id,desc',}).then((res) => {
if(res.code == 200){
This.recentNoticeData = res.data.content;
};
})
}else{
this.$notify({
title: res.msg,
type: 'error',
duration: 2500
})
}
}).catch(function(error) { });
// HttpReq.truckDispatching.recentNoticeAdd({noticeClass:This.dialogTitle1,flag:1,videoContent:postData}).then((res) => {
// if(res.code == 200){
// //近期通知列表
// HttpReq.truckDispatching.recentNoticeQuery({size:50,sort:'id,desc',}).then((res) => {
// if(res.code == 200){
// This.recentNoticeData = res.data.content;
// };
// })
// }else{
// this.$notify({
// title: res.msg,
// type: 'error',
// duration: 2500
// })
// }
// }).catch(function(error) { });
This.$notify({
title: '上传成功!',
type: 'success',
......@@ -777,22 +777,22 @@ export default {
This.initWebSocket();
setTimeout(function () {
This.websocketsend(`{"toUserId":"${This.carAllNumberString}","contentText":"${postData}","fromUserId":"${This.dialogTitle1}"}`);
HttpReq.truckDispatching.recentNoticeAdd({noticeClass:This.dialogTitle1,flag:1,videoContent:postData}).then((res) => {
if(res.code == 200){
//近期通知列表
HttpReq.truckDispatching.recentNoticeQuery({size:50,sort:'id,desc',}).then((res) => {
if(res.code == 200){
This.recentNoticeData = res.data.content;
};
})
}else{
this.$notify({
title: res.msg,
type: 'error',
duration: 2500
})
}
}).catch(function(error) { });
// HttpReq.truckDispatching.recentNoticeAdd({noticeClass:This.dialogTitle1,flag:1,videoContent:postData}).then((res) => {
// if(res.code == 200){
// //近期通知列表
// HttpReq.truckDispatching.recentNoticeQuery({size:50,sort:'id,desc',}).then((res) => {
// if(res.code == 200){
// This.recentNoticeData = res.data.content;
// };
// })
// }else{
// this.$notify({
// title: res.msg,
// type: 'error',
// duration: 2500
// })
// }
// }).catch(function(error) { });
This.$notify({
title: '上传成功!',
type: 'success',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment