homeNew.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698
  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/homeNew.css?id=102">
  46. <link rel="stylesheet" type="text/css" href="../static/css/swiper-bundle.min.css" />
  47. <script src="../static/css/swiper-bundle.min.js"></script>
  48. <style>
  49. canvas {
  50. display: block;
  51. width: 100%;
  52. height: 100%;
  53. z-index: 999;
  54. border-radius: 1.25rem;
  55. }
  56. .wine{
  57. width: 100%;
  58. height: 100%;
  59. }
  60. .mainbox {
  61. width: 18rem;
  62. height: 10rem;
  63. background: #fff;
  64. position: fixed;
  65. top: 38%;
  66. left: 12%;
  67. border-radius: 5px;
  68. }
  69. .boxTitle {
  70. text-align: center;
  71. font-size: 18px;
  72. padding: 10px 0px;
  73. }
  74. .boxText {
  75. text-align: center;
  76. font-size: 16px;
  77. }
  78. .boxbt {
  79. width: 60%;
  80. height: 2.5rem;
  81. background: #0886F5;
  82. margin: 0 auto;
  83. font-size: 16px;
  84. text-align: center;
  85. line-height: 2.5rem;
  86. color: #fff;
  87. border-radius: 5px;
  88. margin-top: 1rem;
  89. }
  90. .sbox {
  91. width: 18rem;
  92. height: 5.5rem;
  93. background: #fff;
  94. position: fixed;
  95. top: 38%;
  96. left: 5%;
  97. border-radius: 5px;
  98. }
  99. .sboxText {
  100. padding: 17px;
  101. font-size: 16px;
  102. }
  103. .boximg {
  104. position: absolute;
  105. width: 1rem;
  106. height: 1rem;
  107. left: 45%;
  108. bottom: -22%;
  109. }
  110. .maxs{
  111. width: 100%;
  112. height: 100%;
  113. position: fixed;
  114. background:rgba(0,0,0,0.5);
  115. }
  116. .helps{
  117. width: 35px;
  118. height: 30px;
  119. background: rgba(187,187,187,1);
  120. border-radius: 30px 0px 0px 30px;
  121. font-size: 13px;
  122. line-height: 30px;
  123. color: rgba(255,255,255,1);
  124. position: absolute;
  125. right: 0;
  126. bottom: 181px;
  127. text-align: center;
  128. }
  129. .helps-img{
  130. width: 50%;
  131. height: 50%;
  132. margin: 0 auto;
  133. margin-top: 0.5rem;
  134. }
  135. .diskName{
  136. margin-left: 6px;
  137. }
  138. #showsuss{
  139. display: none;
  140. }
  141. .swiper-container {
  142. width: 100%;
  143. height: 100%;
  144. }
  145. .swiper-slide {
  146. text-align: center;
  147. font-size: 18px;
  148. /* background: #fff; */
  149. height: 667px;
  150. /* Center slide text vertically */
  151. display: -webkit-box;
  152. display: -ms-flexbox;
  153. display: -webkit-flex;
  154. display: flex;
  155. -webkit-box-pack: center;
  156. -ms-flex-pack: center;
  157. -webkit-justify-content: center;
  158. justify-content: center;
  159. -webkit-box-align: center;
  160. -ms-flex-align: center;
  161. -webkit-align-items: center;
  162. align-items: center;
  163. }
  164. .swiper-button-next{
  165. width: 15px;
  166. height: 15px;
  167. background: url(../static/img/xia_icon.png);
  168. }
  169. .swiper-button-prev{
  170. width: 15px;
  171. height: 15px;
  172. background: url(../static/img/shang_icon.png);
  173. }
  174. .swiper-button-next:after, .swiper-container-rtl .swiper-button-prev:after{
  175. content: "" !important;
  176. }
  177. .swiper-button-prev:after, .swiper-container-rtl .swiper-button-next:after{
  178. content: "" !important;
  179. }
  180. </style>
  181. <div style="width: 100%;height: 100%;background: #F8F9FA;">
  182. <!-- <div class="canvas" style="display: none;">
  183. <div id="wine" style="height: 90%;">
  184. </div>
  185. <div class="camvas-head">
  186. <div class="vip">
  187. <img class="vipimg" src="../static/img/vip_icon.png"></img>
  188. <text class="diskName"></text>
  189. </div>
  190. <div class="canvastime"></div>
  191. </div>
  192. </div> -->
  193. <!-- Swiper -->
  194. <div class="newhelp">
  195. <div class="helpImg">
  196. <img src="../static/img/bangzu_icon.png" />
  197. </div>
  198. <div class="font">使用帮助?</div>
  199. </div>
  200. <div class="buyIcon">
  201. <img src="../static/img/goumai_icon.png" />
  202. </div>
  203. <div class="swiper-container">
  204. <div class="swiper-wrapper">
  205. <div class="swiper-slide">
  206. <div class="canvas" style="display: none;">
  207. <div id="wine" style="height: 100%;">
  208. </div>
  209. <div class="camvas-head">
  210. <div class="tophead">
  211. <div class="th_left">
  212. <img src="../static/img/xingyao_icon.png" />
  213. </div>
  214. <div class="th_right">
  215. <div class="thl-font">是南瓜哥哥啊</div>
  216. <div class="thl-time">剩29天6小时</div>
  217. </div>
  218. </div>
  219. <div class="th_renew">
  220. 续费
  221. </div>
  222. <!-- <div class="vip">
  223. <img class="vipimg" src="../static/img/vip_icon.png"></img>
  224. <text class="diskName">885752258</text>
  225. </div>
  226. <div class="canvastime"></div> -->
  227. </div>
  228. </div>
  229. </div>
  230. <div class="swiper-slide">
  231. <div class="canvas" style="display: none;">
  232. <div id="wine" style="height: 100%;">
  233. </div>
  234. <div class="camvas-head">
  235. <div class="tophead">
  236. <div class="th_left">
  237. <img src="../static/img/xingyao_icon.png" />
  238. </div>
  239. <div class="th_right">
  240. <div class="thl-font">是南瓜哥哥啊</div>
  241. <div class="thl-time">剩29天6小时</div>
  242. </div>
  243. </div>
  244. <div class="th_renew">
  245. 续费
  246. </div>
  247. </div>
  248. </div>
  249. </div>
  250. <div class="swiper-slide">
  251. <div class="canvas" style="display: none;">
  252. <div id="wine" style="height: 100%;">
  253. </div>
  254. <div class="camvas-head">
  255. <div class="tophead">
  256. <div class="th_left">
  257. <img src="../static/img/xingyao_icon.png" />
  258. </div>
  259. <div class="th_right">
  260. <div class="thl-font">是南瓜哥哥啊</div>
  261. <div class="thl-time">剩29天6小时</div>
  262. </div>
  263. </div>
  264. <div class="th_renew">
  265. 续费
  266. </div>
  267. </div>
  268. </div>
  269. </div>
  270. <div class="swiper-slide">
  271. <div class="canvas" style="display: none;">
  272. <div id="wine" style="height: 100%;" class="kongWine">
  273. <div class="kphone">
  274. <div class="kp_img">
  275. <img src="../static/img/goumai_pic.png" />
  276. </div>
  277. <div class="kp_btn">
  278. 购买云手机
  279. </div>
  280. </div>
  281. </div>
  282. <!-- <div class="camvas-head">
  283. <div class="tophead">
  284. <div class="th_left">
  285. <img src="../static/img/xingyao_icon.png" />
  286. </div>
  287. <div class="th_right">
  288. <div class="thl-font">是南瓜哥哥啊</div>
  289. <div class="thl-time">剩29天6小时</div>
  290. </div>
  291. </div>
  292. <div class="th_renew">
  293. 续费
  294. </div>
  295. </div> -->
  296. </div>
  297. </div>
  298. </div>
  299. <!-- Add Arrows -->
  300. <div class="swiper-button-next"></div>
  301. <div class="swiper-button-prev"></div>
  302. </div>
  303. <!-- 没登录状态 -->
  304. <div class="canvasfalse" style="display: none;">
  305. <div class="notLoggedin">
  306. <image src="../static/img/tianjiashouji_pic.png"></image>
  307. </div>
  308. <!-- 审核-->
  309. <div id="showsuss">
  310. <div class="notLoggedin-text">
  311. <div>下载云手机</div>
  312. <div>体验更多功能</div>
  313. </div>
  314. <div class="notLoggedin-bt">
  315. 立即下载
  316. </div>
  317. </div>
  318. </div>
  319. <!--<div class="addto">
  320. <img class="addto-img" src="../static/img/tianjia_icon.png"></img>
  321. </div>-->
  322. <!-- <div class="help">使用帮助?</div>
  323. <div class="helps" data-id="1">
  324. <img class="helps-img" src="../static/img/bangzu_icon.png">
  325. </div> -->
  326. <div class="maxs" style="display: none;">
  327. <div class="mainbox" style="display: none;">
  328. <div class="boxTitle">提示</div>
  329. <div class="boxText">
  330. <div>由于小程序的功能限制,此功能暂时</div>
  331. <div>无法使用,请下载APP使用更多功能</div>
  332. </div>
  333. <!--<div class="boxbt" onclick="cp(document.getElementById('user_ref_id'));">立即前往下载</div>-->
  334. <div class="boxbt" onclick="cp(document.getElementById('user_ref_id'));">立即前往下载</div>
  335. <div class="boximg"><img src="../static/img/wx/guanbi_icon.png"></div>
  336. </div>
  337. </div>
  338. </div>
  339. <div id="copy-txt" style="position: absolute;opacity: 0;">
  340. <span id="user_ref_id">www.androidsCloud.com</span>
  341. </div>
  342. <script>
  343. var swiper = new Swiper('.swiper-container', {
  344. navigation: {
  345. nextEl: '.swiper-button-next',
  346. prevEl: '.swiper-button-prev',
  347. },
  348. });
  349. </script>
  350. <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.0.js"></script>
  351. <!-- 视频-->
  352. <script src="../static/js/jquery-1.11.0.min.js"></script>
  353. <script type="text/javascript" src="../static/js/Decoder.js"></script>
  354. <script type="text/javascript" src="../static/js/YUVCanvas.js"></script>
  355. <script type="text/javascript" src="../static/js/Player.js"></script>
  356. <script type="text/javascript">
  357. var url = window.location.href;
  358. url = url.split('/')
  359. console.log(url)
  360. // var baseUrl = 'https://' + url[2] //'http://192.168.31.159'//'http://' + url[2]
  361. // var baseUrl = 'http://192.168.31.20'
  362. var baseUrl='https://test.androidscloud.com';
  363. var query = window.location.search.substring(1);
  364. var vars = query.split("&");
  365. // var urls = "https://xcx.androidscloud.com"
  366. // 审核
  367. $.ajax({
  368. url: baseUrl + "/api/user/v1/config/download/isShow",
  369. data: {},
  370. type: 'get',
  371. dataType: 'json',
  372. success: function(data) {
  373. if (data.data) {
  374. $("#showsuss").show()
  375. } else {
  376. $("#showsuss").hide()
  377. }
  378. //
  379. }
  380. })
  381. // var baseUrl = window.location.href; //"http://192.168.31.20"
  382. document.body.addEventListener('touchmove', function(e) {
  383. e.preventDefault()
  384. }, {
  385. passive: false
  386. })
  387. var data = {}
  388. var clientType = vars.find(e => {
  389. return e.startsWith('clientType')
  390. }) || ''
  391. var cardIp = vars.find(e => {
  392. return e.startsWith('cardIp')
  393. }) || ''
  394. var port = vars.find(e => {
  395. return e.startsWith('port')
  396. }) || ''
  397. var sn = vars.find(e => {
  398. return e.startsWith('sn')
  399. }) || ''
  400. var demoTime = vars.find(e => {
  401. return e.startsWith('demoTime')
  402. }) || ''
  403. var id = vars.find(e => {
  404. return e.startsWith('id')
  405. }) || ''
  406. var vip = vars.find(e => {
  407. return e.startsWith('vip')
  408. }) || ''
  409. var diskName = vars.find(e => {
  410. return e.startsWith('diskName')
  411. }) || ''
  412. var times = vars.find(e => {
  413. return e.startsWith('times')
  414. }) || ''
  415. var username = vars.find(e => {
  416. return e.startsWith('username')
  417. }) || ''
  418. var userCardId = vars.find(e => {
  419. return e.startsWith('userCardId')
  420. }) || ''
  421. var ip = vars.find(e => {
  422. return e.startsWith('ip')
  423. }) || ''
  424. // $(".aaa").text(clientType.substring(11, clientType.length))
  425. // let cardIp = getUrlParam('cardIp');
  426. // console.log(cardIp)
  427. getQueryString: (name) => {
  428. let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  429. let r = window.location.search.substr(1).match(reg);
  430. console.log(name)
  431. if (r != null) {
  432. return unescape(decodeURI(r[2]));
  433. return null;
  434. }
  435. }
  436. data.clientType = clientType.substring(11, clientType.length)
  437. data.cardIp = cardIp.substring(7, cardIp.length)
  438. data.port = port.substring(5, port.length)
  439. data.sn = sn.substring(3, sn.length)
  440. data.demoTime = demoTime.substring(9, demoTime.length)
  441. data.id = id.substring(3, id.length)
  442. data.vip = vip.substring(4, vip.length)
  443. data.diskName = diskName.substring(9, diskName.length)
  444. data.times = times.substring(6, times.length)
  445. data.username = username.substring(9, username.length)
  446. data.userCardId = userCardId.substring(11, userCardId.length)
  447. data.ip = ip.substring(3, ip.length)
  448. let timestext = "剩" + decodeURI(data.times) || data.demoTime / 3600 + "小时"
  449. $(".diskName").text(decodeURI(data.diskName) || data.username)
  450. console.log("timestext>>>>>>", timestext);
  451. $(".canvastime").text(timestext)
  452. if (data.vip == "0") {
  453. $(".canvasfalse").css({
  454. "display": "block"
  455. })
  456. $(".canvas").css({
  457. "display": "none"
  458. })
  459. } else {
  460. $(".canvas").css({
  461. "display": "block"
  462. })
  463. $(".canvasfalse").css({
  464. "display": "none"
  465. })
  466. }
  467. // 云手机相关逻辑
  468. var player = new Player({
  469. size: {
  470. width: 768,
  471. height: 1024
  472. }
  473. });
  474. // document.body.appendChild(player.canvas);
  475. // var urlss = url[2]
  476. var urlss = 'test.androidscloud.com'
  477. var secanv = document.getElementById("wine");
  478. secanv.appendChild(player.canvas);
  479. // 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;
  480. var strhost = "wss://" + urlss + "/videoWebSocket?clientType=" + data.clientType + "&cardIp=" + data.cardIp +
  481. "&port=" + data.port + "&sn=" + data.sn;
  482. var client = new WebSocket(strhost);
  483. console.log('wsssss==============', client)
  484. client.binaryType = 'arraybuffer';
  485. // debugger
  486. client.onopen = function(evt) {
  487. // onOpen(evt)
  488. };
  489. client.onclose = function(evt) {
  490. // onClose(evt)
  491. };
  492. client.onmessage = function(evt) {
  493. onMessage(evt)
  494. };
  495. client.onerror = function(evt) {
  496. // onError(evt)
  497. };
  498. function onMessage(evt) {
  499. console.log("onMessage==============", evt);
  500. var messageData = new Uint8Array(evt.data);
  501. player.decode(messageData);
  502. }
  503. $("canvas").on("click", function() {
  504. client.close()
  505. // ?clientType=0&cardIp=30.30.30.42&port=9100&sn=RK3930C2301900042&demoTime=3600&id=3
  506. setTimeout(() => {
  507. wx.miniProgram.navigateTo({
  508. url: '/pages/trialInterface/trialInterface?clientType=' + data.clientType + "&cardIp=" + data.cardIp +
  509. "&port=" + data.port + "&sn=" + data.sn + "&username=" + data.username + "&userCardId=" + data.userCardId +
  510. "&demoTime=3600&id=" + data.id + "&diskName=" + decodeURI(data.diskName)
  511. })
  512. }, 100);
  513. })
  514. $(".helps").click(function() {
  515. // wx.miniProgram.navigateTo({
  516. // url: '/pages/viewurl/viewurl'
  517. // })
  518. //按点击处理
  519. var set = $('.helps').attr("data-id")
  520. if (set == '1') {
  521. $('.helps').attr({
  522. "data-id": "2"
  523. })
  524. $(".helps").hide();
  525. $(".help").css({
  526. "right": "0"
  527. })
  528. } else {
  529. $('.helps').attr({
  530. "data-id": "1"
  531. })
  532. $(".help").css({
  533. "right": "-4rem"
  534. })
  535. }
  536. });
  537. function stopPropagation(e) {
  538. if (e.stopPropagation)
  539. e.stopPropagation();
  540. else
  541. e.cancelBubble = true;
  542. }
  543. $(document).bind('click', function() {
  544. $(".help").css({
  545. "right": "-4rem"
  546. })
  547. $('.helps').attr({
  548. "data-id": "1"
  549. })
  550. $(".helps").show();
  551. });
  552. $('.help').bind('click', function(e) {
  553. stopPropagation(e);
  554. wx.miniProgram.navigateTo({
  555. url: '/pages/viewurl/viewurl'
  556. })
  557. });
  558. $('.helps').bind('click', function(e) {
  559. stopPropagation(e);
  560. });
  561. //
  562. // var player = new Player({
  563. // size: {
  564. // width: 1280,
  565. // height: 720
  566. // }
  567. // });
  568. // var secanv = document.getElementById("wine");
  569. // secanv.appendChild(player.canvas);
  570. // var players = AV.Player.fromWebSocket("ws://" + urlss + '/videoWebSocket?' + "clientType=" + data.clientType +
  571. // "&cardIp=" + data.cardIp + "&port=" + data.port + "&sn=" + data.sn);
  572. // players.play();
  573. $(".boximg").on("click", function() {
  574. $(".mainbox").css({
  575. "display": "none"
  576. })
  577. $(".maxs").css({
  578. "display": "none"
  579. })
  580. })
  581. $(".maxs").on("click", function() {
  582. $(".mainbox").css({
  583. "display": "none"
  584. })
  585. $(".maxs").css({
  586. "display": "none"
  587. })
  588. })
  589. $(".addto").on("click", function() {
  590. $(".mainbox").css({
  591. "display": "block"
  592. })
  593. $(".maxs").css({
  594. "display": "block"
  595. })
  596. })
  597. $(".notLoggedin-bt").on("click", function() {
  598. // $(".mainbox").css({
  599. // "display": "block"
  600. // })
  601. // $(".maxs").css({
  602. // "display": "block"
  603. // })
  604. })
  605. function selectText(x) {
  606. if (document.selection) {
  607. var range = document.body.createTextRange();
  608. range.moveToElementText(x);
  609. range.select();
  610. } else if (window.getSelection) {
  611. var selection = window.getSelection();
  612. var range = document.createRange();
  613. selection.removeAllRanges();
  614. range.selectNodeContents(x);
  615. selection.addRange(range);
  616. }
  617. }
  618. function cp(x) {
  619. $(".mainbox").css({
  620. "display": "none"
  621. })
  622. $(".sbox").css({
  623. "display": "block"
  624. })
  625. selectText(x);
  626. document.execCommand("copy");
  627. alert("复制成功")
  628. }
  629. </script>
  630. </head>
  631. <body>
  632. </body>
  633. </html>