|
@@ -100,51 +100,48 @@ var cUrl = "ws://192.168.198.82:9100/card?cardIp=" + data.ip
|
|
|
// }
|
|
|
console.log(cUrl, 'curl')
|
|
|
// var cUrl = Number(data.clientType) === 3? "ws://"+urlss+"/authControlWebSocket?"+"clientType="+data.clientType+"&username="+data.username+"&userCardId="+data.userCardId : "ws://"+urlss+"/controlWebSocket?"+"clientType="+data.clientType+"&cardIp="+data.cardIp+"&port="+data.port+"&sn="+data.sn
|
|
|
-doConnect();
|
|
|
-function doConnect() {
|
|
|
- var wsss = new WebSocket(cUrl);
|
|
|
- wsss.binaryType = 'arraybuffer';
|
|
|
- wsss.onopen = function () {
|
|
|
- console.log("onopen==============");
|
|
|
- var pings = {
|
|
|
- "event": "getScreenStatus"
|
|
|
- }
|
|
|
- wsss.send(JSON.stringify(pings));
|
|
|
- var bitRate = {
|
|
|
- "data": {
|
|
|
- "bitRate": 2243000
|
|
|
- },
|
|
|
- "event": "bitRate"
|
|
|
- }
|
|
|
- console.log('打开安卓卡wsss.onopen========', data.sn)
|
|
|
- // wsss.send(JSON.stringify(bitRate));
|
|
|
- wsss.send(ExexuteMove(JSON.stringify(bitRate), data.sn))
|
|
|
- };
|
|
|
- wsss.onmessage = function (event) {
|
|
|
- // console.log("onMessage==============", event);
|
|
|
- // var resets = JSON.parse(event.data)
|
|
|
- // var resets = event.data;
|
|
|
- // resets.errorMsg && alert(resets.errorMsg)
|
|
|
- // resolving = resets.data.orientation
|
|
|
- // if (resolving == 1) {} else {}
|
|
|
- // console.log('>>>resolvingresolvingresolving', resolving)
|
|
|
-
|
|
|
- };
|
|
|
- wsss.onclose = function (event) {
|
|
|
- alert("websocket连接断开");
|
|
|
- doConnect();
|
|
|
- };
|
|
|
- wsss.onerror = function (event) {
|
|
|
- console.log("onerror==============");
|
|
|
- };
|
|
|
-}
|
|
|
-
|
|
|
-$('#box').on("click", function () {
|
|
|
+var wsss = new WebSocket(cUrl);
|
|
|
+console.log('wsssss==============', wsss)
|
|
|
+wsss.binaryType = 'arraybuffer';
|
|
|
+
|
|
|
+wsss.onopen = function() {
|
|
|
+ console.log("onopen==============");
|
|
|
+ var pings = {
|
|
|
+ "event": "getScreenStatus"
|
|
|
+ }
|
|
|
+ wsss.send(JSON.stringify(pings));
|
|
|
+ var bitRate = {
|
|
|
+ "data": {
|
|
|
+ "bitRate": 2243000
|
|
|
+ },
|
|
|
+ "event": "bitRate"
|
|
|
+ }
|
|
|
+ console.log('打开安卓卡wsss.onopen========', data.sn)
|
|
|
+ // wsss.send(JSON.stringify(bitRate));
|
|
|
+ wsss.send(ExexuteMove(JSON.stringify(bitRate), data.sn))
|
|
|
+};
|
|
|
+wsss.onmessage = function(event) {
|
|
|
+ // console.log("onMessage==============", event);
|
|
|
+ // var resets = JSON.parse(event.data)
|
|
|
+ // var resets = event.data;
|
|
|
+ // resets.errorMsg && alert(resets.errorMsg)
|
|
|
+ // resolving = resets.data.orientation
|
|
|
+ // if (resolving == 1) {} else {}
|
|
|
+ // console.log('>>>resolvingresolvingresolving', resolving)
|
|
|
+
|
|
|
+};
|
|
|
+wsss.onclose = function(event) {
|
|
|
+ console.log("onclose==============");
|
|
|
+};
|
|
|
+wsss.onerror = function(event) {
|
|
|
+ console.log("onerror==============");
|
|
|
+};
|
|
|
+$('#box').on("click", function() {
|
|
|
|
|
|
draw_graph('pencil', this)
|
|
|
})
|
|
|
//剪切板
|
|
|
-$(".upload").on("click", function () {
|
|
|
+$(".upload").on("click", function() {
|
|
|
let texts = $(this).attr("data-text")
|
|
|
if (texts == "uploads") {
|
|
|
$(".mainbox").css({
|
|
@@ -160,9 +157,9 @@ $(".upload").on("click", function () {
|
|
|
})
|
|
|
|
|
|
//home 控制home
|
|
|
-$(".botmat1img").on("click", function () {
|
|
|
+$(".botmat1img").on("click", function() {
|
|
|
let codes = $(this).attr("data-text")
|
|
|
- console.log("homehomehome---------", codes)
|
|
|
+ console.log("homehomehome---------",codes)
|
|
|
if (codes == "home") {
|
|
|
// var bitRate = {
|
|
|
// "data": {
|
|
@@ -195,7 +192,7 @@ $(".botmat1img").on("click", function () {
|
|
|
|
|
|
})
|
|
|
//高清控制
|
|
|
-$(".PictureQuality").on("click", function () {
|
|
|
+$(".PictureQuality").on("click", function() {
|
|
|
$(this).addClass("avit").siblings().removeClass('avit')
|
|
|
let id = $(this).attr("data-id")
|
|
|
var bitRate = {
|
|
@@ -211,7 +208,7 @@ $(".PictureQuality").on("click", function () {
|
|
|
})
|
|
|
|
|
|
//画图形
|
|
|
-var draw_graph = function (graphType, obj) {
|
|
|
+var draw_graph = function(graphType, obj) {
|
|
|
console.log('111》》》', graphType)
|
|
|
//把蒙版放于画板上面
|
|
|
//$("#canvas_bak").css("z-index",1);
|
|
@@ -226,7 +223,7 @@ var draw_graph = function (graphType, obj) {
|
|
|
var startY;
|
|
|
|
|
|
//鼠标按下获取 开始xy开始画图
|
|
|
- var touchstart = function (e) {
|
|
|
+ var touchstart = function(e) {
|
|
|
$('.control-right-img').attr({
|
|
|
"data-id": "2"
|
|
|
})
|
|
@@ -286,7 +283,7 @@ var draw_graph = function (graphType, obj) {
|
|
|
};
|
|
|
|
|
|
//鼠标离开 把蒙版canvas的图片生成到canvas中
|
|
|
- var touchend = function (e) {
|
|
|
+ var touchend = function(e) {
|
|
|
var touchfor = e.originalEvent.changedTouches; //for 的手指数组
|
|
|
var touch = e.originalEvent.changedTouches[0];
|
|
|
var thochlethng = e.originalEvent.changedTouches.length
|
|
@@ -340,12 +337,12 @@ var draw_graph = function (graphType, obj) {
|
|
|
};
|
|
|
|
|
|
//清空层 云手机超出屏幕的开关
|
|
|
- var clearContext = function (type) {
|
|
|
+ var clearContext = function(type) {
|
|
|
canDraw = false;
|
|
|
}
|
|
|
|
|
|
// 鼠标移动
|
|
|
- var touchmove = function (e) {
|
|
|
+ var touchmove = function(e) {
|
|
|
|
|
|
e = e || window.event;
|
|
|
var touchfor = e.originalEvent.targetTouches; //for 的手指数组
|
|
@@ -407,7 +404,7 @@ var draw_graph = function (graphType, obj) {
|
|
|
};
|
|
|
|
|
|
//鼠标离开区域以外 除了涂鸦 都清空
|
|
|
- var mouseout = function () {
|
|
|
+ var mouseout = function() {
|
|
|
|
|
|
if (graphType != 'handwriting') {
|
|
|
clearContext();
|