Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
NewTruckTerminalSyetem
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SQL_Mou
NewTruckTerminalSyetem
Commits
82f2d7a3
Commit
82f2d7a3
authored
Nov 30, 2022
by
SQL_Mou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
与Android互相调用方法,增加socket长连接
parent
4391a46f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
0 deletions
+64
-0
index.vue
src/views/MLargeScreen/index.vue
+64
-0
No files found.
src/views/MLargeScreen/index.vue
View file @
82f2d7a3
...
@@ -234,6 +234,70 @@ export default {
...
@@ -234,6 +234,70 @@ export default {
},
},
methods
:{
methods
:{
// getSerialSend() {
// //console.log(123);
// window.SerialPort.send("hello");
// },
// getSerialReceive() {
// //console.log(123);
// let cont = "";
// cont = window.SerialPort.receive()
// window.alert(cont);
// },
// //初始化weosocket
// initWebSocket(){
// const wsuri = "ws://8.143.203.103:9095";//连接地址,可加参数
// // const wsuri = process.env.VUE_APP_WS_API + "/" + 'pcBigScreen';
// this.websocket = new WebSocket(wsuri);
// this.websocket.onopen = this.websocketonopen;
// this.websocket.onerror = this.websocketonerror;
// this.websocket.onmessage = this.websocketonmessage;
// this.websocket.onclose = this.websocketclose;
// this.websocketonmessage();
// },
// //WebSocket连接成功
// websocketonopen() {
// console.log("WebSocket连接成功");
// },
// //WebSocket连接错误
// websocketonerror(e) {
// console.log("WebSocket连接发生错误");
// },
// //WebSocket数据接收
// websocketonmessage(e){
// //console.log("e",e);
// if(e == undefined){
// return
// }else{
// let obj1 = JSON.parse(e.data);
// console.log(obj1);
// }
// },
// //WebSocket数据发送
// websocketsend(agentData){
// this.websocket.send(agentData);
// },
// //WebSocket关闭
// websocketclose(e){
// //console.log("connection closed (" + e.code + ")");
// console.log("connection closed !");
// },
// //WebSocket重连
// reconnect(){
// var This=this;
// if (this.websocket.readyState === 1) { // that.websock.readyState = 1 表示连接成功,可以立即发送信息
// This.websocketonmessage();
// } else if (this.websocket.readyState === 0) { // 表示正在连接,设置300ms后发送信息
// setTimeout(function () {
// This.websocketonmessage();
// }, 300);
// } else { // 连接未创建或者创建失败,则重新创建连接,并设置500ms后发送信息
// This.initWebSocket();
// setTimeout(function () {
// This.websocketonmessage();
// }, 500);
// }
// },
loadData
(){
loadData
(){
let
that
=
this
;
let
that
=
this
;
let
href1
=
window
.
location
.
href
;
let
href1
=
window
.
location
.
href
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment