home66Ws.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="initial-scale=1,maximum-scale=1, minimum-scale=1,user-scalable=no">
  7. <meta name="x5-orientation" content="portrait" />
  8. <meta name="screen-orientation" content="portrait" />
  9. <meta name="viewport" content="width=device-width, minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
  10. <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
  11. <meta name="apple-mobile-web-app-capable" content="yes">
  12. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  13. <meta name="format-detection" content="telephone=no, email=no">
  14. <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
  15. <meta name="apple-mobile-web-app-capable" content="yes">
  16. <!-- 删除苹果默认的工具栏和菜单栏 -->
  17. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  18. <!-- 设置苹果工具栏颜��? -->
  19. <meta name="format-detection" content="telphone=no, email=no">
  20. <!-- 忽略页面中的数字识别为电话,忽略email识别 -->
  21. <!-- 启用360浏览器的极速模��?(webkit) -->
  22. <meta name="renderer" content="webkit">
  23. <!-- 避免IE使用兼容模式 -->
  24. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  25. <!-- 针对手持设备优化,主要是针对一些老的不识别viewport的浏览器,比如黑��? -->
  26. <meta name="HandheldFriendly" content="true">
  27. <!-- 微软的老式浏览��? -->
  28. <meta name="MobileOptimized" content="320">
  29. <!-- uc强制竖屏 -->
  30. <!-- <meta name="screen-orientation" content="portrait"> -->
  31. <!-- QQ强制竖屏 -->
  32. <!-- <meta name="x5-orientation" content="portrait"> -->
  33. <!-- 不能旋转,问题出在这 -->
  34. <!-- UC强制全屏 -->
  35. <meta name="full-screen" content="yes">
  36. <!-- QQ强制全屏 -->
  37. <meta name="x5-fullscreen" content="true">
  38. <!-- UC应用模式 -->
  39. <meta name="browsermode" content="application">
  40. <!-- QQ应用模式 -->
  41. <meta name="x5-page-mode" content="app">
  42. <!-- windows phone 点击无高��? -->
  43. <meta name="msapplication-tap-highlight" content="no">
  44. <title></title>
  45. <link rel="stylesheet" href="../static/css/home.css?id=102">
  46. <style>
  47. canvas {
  48. display: block;
  49. width: 100%;
  50. height: 100%;
  51. z-index: 999;
  52. }
  53. .wine{
  54. width: 100%;
  55. height: 100%;
  56. }
  57. .mainbox {
  58. width: 18rem;
  59. height: 10rem;
  60. background: #fff;
  61. position: fixed;
  62. top: 38%;
  63. left: 12%;
  64. border-radius: 5px;
  65. }
  66. .boxTitle {
  67. text-align: center;
  68. font-size: 18px;
  69. padding: 10px 0px;
  70. }
  71. .boxText {
  72. text-align: center;
  73. font-size: 16px;
  74. }
  75. .boxbt {
  76. width: 60%;
  77. height: 2.5rem;
  78. background: #0886F5;
  79. margin: 0 auto;
  80. font-size: 16px;
  81. text-align: center;
  82. line-height: 2.5rem;
  83. color: #fff;
  84. border-radius: 5px;
  85. margin-top: 1rem;
  86. }
  87. .sbox {
  88. width: 18rem;
  89. height: 5.5rem;
  90. background: #fff;
  91. position: fixed;
  92. top: 38%;
  93. left: 5%;
  94. border-radius: 5px;
  95. }
  96. .sboxText {
  97. padding: 17px;
  98. font-size: 16px;
  99. }
  100. .boximg {
  101. position: absolute;
  102. width: 1rem;
  103. height: 1rem;
  104. left: 45%;
  105. bottom: -22%;
  106. }
  107. .maxs{
  108. width: 100%;
  109. height: 100%;
  110. position: fixed;
  111. background:rgba(0,0,0,0.5);
  112. }
  113. .helps{
  114. width: 35px;
  115. height: 30px;
  116. background: rgba(187,187,187,1);
  117. border-radius: 30px 0px 0px 30px;
  118. font-size: 13px;
  119. line-height: 30px;
  120. color: rgba(255,255,255,1);
  121. position: absolute;
  122. right: 0;
  123. bottom: 181px;
  124. text-align: center;
  125. }
  126. .helps-img{
  127. width: 50%;
  128. height: 50%;
  129. margin: 0 auto;
  130. margin-top: 0.5rem;
  131. }
  132. .diskName{
  133. margin-left: 6px;
  134. }
  135. #showsuss{
  136. display: none;
  137. }
  138. </style>
  139. <div style="width: 100%;height: 100%;">
  140. <div class="canvas" style="display: none;">
  141. <div id="wine" style="height: 90%;">
  142. <!--<image src="img/u760.jpg"></image>-->
  143. </div>
  144. <div class="camvas-head">
  145. <div class="vip">
  146. <img class="vipimg" src="../static/img/vip_icon.png"></img>
  147. <text class="diskName"></text>
  148. </div>
  149. <div class="canvastime"></div>
  150. </div>
  151. </div>
  152. <!-- 没登录状态 -->
  153. <div class="canvasfalse" style="display: none;">
  154. <div class="notLoggedin">
  155. <image src="../static/img/tianjiashouji_pic.png"></image>
  156. </div>
  157. <!-- 审核-->
  158. <div id="showsuss">
  159. <div class="notLoggedin-text">
  160. <div>下载云手机</div>
  161. <div>体验更多功能</div>
  162. </div>
  163. <div class="notLoggedin-bt">
  164. 立即下载
  165. </div>
  166. </div>
  167. </div>
  168. <!--<div class="addto">
  169. <img class="addto-img" src="../static/img/tianjia_icon.png"></img>
  170. </div>-->
  171. <div class="help">使用帮助?</div>
  172. <div class="helps" data-id="1">
  173. <img class="helps-img" src="../static/img/bangzu_icon.png">
  174. </div>
  175. <div class="maxs" style="display: none;">
  176. <div class="mainbox" style="display: none;">
  177. <div class="boxTitle">提示</div>
  178. <div class="boxText">
  179. <div>由于小程序的功能限制,此功能暂时</div>
  180. <div>无法使用,请下载APP使用更多功能</div>
  181. </div>
  182. <!--<div class="boxbt" onclick="cp(document.getElementById('user_ref_id'));">立即前往下载</div>-->
  183. <div class="boxbt" onclick="cp(document.getElementById('user_ref_id'));">立即前往下载</div>
  184. <div class="boximg"><img src="../static/img/wx/guanbi_icon.png"></div>
  185. </div>
  186. </div>
  187. </div>
  188. <div id="copy-txt" style="position: absolute;opacity: 0;">
  189. <span id="user_ref_id">www.androidsCloud.com</span>
  190. </div>
  191. <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.0.js"></script>
  192. <!-- 视频-->
  193. <script src="../static/js/jquery-1.11.0.min.js"></script>
  194. <script type="text/javascript" src="../static/js/Decoder.js"></script>
  195. <script type="text/javascript" src="../static/js/YUVCanvas.js"></script>
  196. <script type="text/javascript" src="../static/js/Player.js"></script>
  197. <script type="text/javascript">
  198. var url = window.location.href;
  199. url = url.split('/')
  200. console.log(url)
  201. // var baseUrl = 'https://' + url[2] //'http://192.168.31.159'//'http://' + url[2]
  202. var baseUrl = 'http://192.168.31.20'
  203. var query = window.location.search.substring(1);
  204. var vars = query.split("&");
  205. // var urls = "https://xcx.androidscloud.com"
  206. // 审核
  207. $.ajax({
  208. url: baseUrl + "/api/user/v1/config/download/isShow",
  209. data: {},
  210. type: 'get',
  211. dataType: 'json',
  212. success: function(data) {
  213. if (data.data) {
  214. $("#showsuss").show()
  215. } else {
  216. $("#showsuss").hide()
  217. }
  218. //
  219. }
  220. })
  221. // var baseUrl = window.location.href; //"http://192.168.31.20"
  222. document.body.addEventListener('touchmove', function(e) {
  223. e.preventDefault()
  224. }, {
  225. passive: false
  226. })
  227. var data = {}
  228. var clientType = vars.find(e => {
  229. return e.startsWith('clientType')
  230. }) || ''
  231. var cardIp = vars.find(e => {
  232. return e.startsWith('cardIp')
  233. }) || ''
  234. var port = vars.find(e => {
  235. return e.startsWith('port')
  236. }) || ''
  237. var sn = vars.find(e => {
  238. return e.startsWith('sn')
  239. }) || ''
  240. var demoTime = vars.find(e => {
  241. return e.startsWith('demoTime')
  242. }) || ''
  243. var id = vars.find(e => {
  244. return e.startsWith('id')
  245. }) || ''
  246. var vip = vars.find(e => {
  247. return e.startsWith('vip')
  248. }) || ''
  249. var diskName = vars.find(e => {
  250. return e.startsWith('diskName')
  251. }) || ''
  252. var times = vars.find(e => {
  253. return e.startsWith('times')
  254. }) || ''
  255. var username = vars.find(e => {
  256. return e.startsWith('username')
  257. }) || ''
  258. var userCardId = vars.find(e => {
  259. return e.startsWith('userCardId')
  260. }) || ''
  261. var ip = vars.find(e => {
  262. return e.startsWith('ip')
  263. }) || ''
  264. // $(".aaa").text(clientType.substring(11, clientType.length))
  265. // let cardIp = getUrlParam('cardIp');
  266. // console.log(cardIp)
  267. getQueryString: (name) => {
  268. let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  269. let r = window.location.search.substr(1).match(reg);
  270. console.log(name)
  271. if (r != null) {
  272. return unescape(decodeURI(r[2]));
  273. return null;
  274. }
  275. }
  276. data.clientType = clientType.substring(11, clientType.length)
  277. data.cardIp = cardIp.substring(7, cardIp.length)
  278. data.port = port.substring(5, port.length)
  279. data.sn = sn.substring(3, sn.length)
  280. data.demoTime = demoTime.substring(9, demoTime.length)
  281. data.id = id.substring(3, id.length)
  282. data.vip = vip.substring(4, vip.length)
  283. data.diskName = diskName.substring(9, diskName.length)
  284. data.times = times.substring(6, times.length)
  285. data.username = username.substring(9, username.length)
  286. data.userCardId = userCardId.substring(11, userCardId.length)
  287. data.ip = ip.substring(3, ip.length)
  288. let timestext = "剩" + decodeURI(data.times) || data.demoTime / 3600 + "小时"
  289. $(".diskName").text(decodeURI(data.diskName) || data.username)
  290. console.log("timestext>>>>>>", timestext);
  291. $(".canvastime").text(timestext)
  292. if (data.vip == "0") {
  293. $(".canvasfalse").css({
  294. "display": "block"
  295. })
  296. $(".canvas").css({
  297. "display": "none"
  298. })
  299. } else {
  300. $(".canvas").css({
  301. "display": "block"
  302. })
  303. $(".canvasfalse").css({
  304. "display": "none"
  305. })
  306. }
  307. // 云手机相关逻辑
  308. var player = new Player({
  309. size: {
  310. width: 768,
  311. height: 1024
  312. }
  313. });
  314. // document.body.appendChild(player.canvas);
  315. // var urlss = url[2]
  316. var urlss='test.androidscloud.com'
  317. var secanv = document.getElementById("wine");
  318. console.log("player",player.canvas,player);
  319. secanv.appendChild(player.canvas);
  320. // var strhost = Number(data.clientType) ===2? "wss://"+ urlss +"/shareWebSocket?clientType=2&username="+data.username+"&userCardId="+data.userCardId+"&ip="+data.ip : Number(data.clientType) ===3?"wss://"+ urlss +"/authVideoWebSocket?clientType=3&username="+data.username+"&userCardId="+data.userCardId :"wss://"+ urlss +"/videoWebSocket?clientType="+ data.clientType +"&cardIp="+data.cardIp +"&port="+ data.port +"&sn="+data.sn;
  321. // var strhost = "wss://" + urlss + "/videoWebSocket?clientType=" + data.clientType + "&cardIp=" + data.cardIp +
  322. // "&port=" + data.port + "&sn=" + data.sn;
  323. var strhost="ws://192.168.11.66:9101";
  324. // var strhost="wss://test.androidscloud.com/videoWebSocket?clientType=1&cardIp=14.215.128.96&port=2005&sn=RK3930C2301900005";
  325. var client = new WebSocket(strhost);
  326. console.log('wsssss==============', client)
  327. client.binaryType = 'arraybuffer';
  328. // debugger
  329. client.onopen = function(evt) {
  330. // onOpen(evt)
  331. };
  332. client.onclose = function(evt) {
  333. // onClose(evt)
  334. };
  335. client.onmessage = function(evt) {
  336. onMessage(evt)
  337. };
  338. client.onerror = function(evt) {
  339. // onError(evt)
  340. };
  341. function onMessage(evt) {
  342. // console.log("onMessage==============",evt);
  343. var messageData = new Uint8Array(evt.data);
  344. player.decode(messageData);
  345. }
  346. $("canvas").on("click", function() {
  347. client.close()
  348. // ?clientType=0&cardIp=30.30.30.42&port=9100&sn=RK3930C2301900042&demoTime=3600&id=3
  349. setTimeout(() => {
  350. wx.miniProgram.navigateTo({
  351. url: '/pages/trialInterface/trialInterface?clientType=' + data.clientType + "&cardIp=" + data.cardIp +
  352. "&port=" + data.port + "&sn=" + data.sn + "&username=" + data.username + "&userCardId=" + data.userCardId +
  353. "&demoTime=3600&id=" + data.id + "&diskName=" + decodeURI(data.diskName)
  354. })
  355. }, 100);
  356. })
  357. $(".helps").click(function() {
  358. // wx.miniProgram.navigateTo({
  359. // url: '/pages/viewurl/viewurl'
  360. // })
  361. //按点击处理
  362. var set = $('.helps').attr("data-id")
  363. if (set == '1') {
  364. $('.helps').attr({
  365. "data-id": "2"
  366. })
  367. $(".helps").hide();
  368. $(".help").css({
  369. "right": "0"
  370. })
  371. } else {
  372. $('.helps').attr({
  373. "data-id": "1"
  374. })
  375. $(".help").css({
  376. "right": "-4rem"
  377. })
  378. }
  379. });
  380. function stopPropagation(e) {
  381. if (e.stopPropagation)
  382. e.stopPropagation();
  383. else
  384. e.cancelBubble = true;
  385. }
  386. $(document).bind('click', function() {
  387. $(".help").css({
  388. "right": "-4rem"
  389. })
  390. $('.helps').attr({
  391. "data-id": "1"
  392. })
  393. $(".helps").show();
  394. });
  395. $('.help').bind('click', function(e) {
  396. stopPropagation(e);
  397. wx.miniProgram.navigateTo({
  398. url: '/pages/viewurl/viewurl'
  399. })
  400. });
  401. $('.helps').bind('click', function(e) {
  402. stopPropagation(e);
  403. });
  404. //
  405. // var player = new Player({
  406. // size: {
  407. // width: 1280,
  408. // height: 720
  409. // }
  410. // });
  411. // var secanv = document.getElementById("wine");
  412. // secanv.appendChild(player.canvas);
  413. // var players = AV.Player.fromWebSocket("ws://" + urlss + '/videoWebSocket?' + "clientType=" + data.clientType +
  414. // "&cardIp=" + data.cardIp + "&port=" + data.port + "&sn=" + data.sn);
  415. // players.play();
  416. $(".boximg").on("click", function() {
  417. $(".mainbox").css({
  418. "display": "none"
  419. })
  420. $(".maxs").css({
  421. "display": "none"
  422. })
  423. })
  424. $(".maxs").on("click", function() {
  425. $(".mainbox").css({
  426. "display": "none"
  427. })
  428. $(".maxs").css({
  429. "display": "none"
  430. })
  431. })
  432. $(".addto").on("click", function() {
  433. $(".mainbox").css({
  434. "display": "block"
  435. })
  436. $(".maxs").css({
  437. "display": "block"
  438. })
  439. })
  440. $(".notLoggedin-bt").on("click", function() {
  441. // $(".mainbox").css({
  442. // "display": "block"
  443. // })
  444. // $(".maxs").css({
  445. // "display": "block"
  446. // })
  447. })
  448. function selectText(x) {
  449. if (document.selection) {
  450. var range = document.body.createTextRange();
  451. range.moveToElementText(x);
  452. range.select();
  453. } else if (window.getSelection) {
  454. var selection = window.getSelection();
  455. var range = document.createRange();
  456. selection.removeAllRanges();
  457. range.selectNodeContents(x);
  458. selection.addRange(range);
  459. }
  460. }
  461. function cp(x) {
  462. $(".mainbox").css({
  463. "display": "none"
  464. })
  465. $(".sbox").css({
  466. "display": "block"
  467. })
  468. selectText(x);
  469. document.execCommand("copy");
  470. alert("复制成功")
  471. }
  472. </script>
  473. </head>
  474. <body>
  475. </body>
  476. </html>