wxhomeInfo.html 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title></title>
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. <meta name="viewport" content="initial-scale=1,maximum-scale=1, minimum-scale=1,user-scalable=no">
  8. <meta name="x5-orientation" content="portrait" />
  9. <meta name="screen-orientation" content="portrait" />
  10. <meta name="viewport" content="width=device-width, minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
  11. <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
  12. <meta name="apple-mobile-web-app-capable" content="yes">
  13. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  14. <meta name="format-detection" content="telephone=no, email=no">
  15. <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
  16. <meta name="apple-mobile-web-app-capable" content="yes">
  17. <!-- 删除苹果默认的工具栏和菜单栏 -->
  18. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  19. <!-- 设置苹果工具栏颜��? -->
  20. <meta name="format-detection" content="telphone=no, email=no">
  21. <!-- 忽略页面中的数字识别为电话,忽略email识别 -->
  22. <!-- 启用360浏览器的极速模��?(webkit) -->
  23. <meta name="renderer" content="webkit">
  24. <!-- 避免IE使用兼容模式 -->
  25. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  26. <!-- 针对手持设备优化,主要是针对一些老的不识别viewport的浏览器,比如黑��? -->
  27. <meta name="HandheldFriendly" content="true">
  28. <!-- 微软的老式浏览��? -->
  29. <meta name="MobileOptimized" content="320">
  30. <!-- uc强制竖屏 -->
  31. <!-- <meta name="screen-orientation" content="portrait"> -->
  32. <!-- QQ强制竖屏 -->
  33. <!-- <meta name="x5-orientation" content="portrait"> -->
  34. <!-- 不能旋转,问题出在这 -->
  35. <!-- UC强制全屏 -->
  36. <meta name="full-screen" content="yes">
  37. <!-- QQ强制全屏 -->
  38. <meta name="x5-fullscreen" content="true">
  39. <!-- UC应用模式 -->
  40. <meta name="browsermode" content="application">
  41. <!-- QQ应用模式 -->
  42. <meta name="x5-page-mode" content="app">
  43. <!-- windows phone 点击无高��? -->
  44. <meta name="msapplication-tap-highlight" content="no">
  45. <title></title>
  46. <style>
  47. body {
  48. font-size: .2592592593rem;
  49. margin: 0 auto;
  50. width: 100%;
  51. min-width: 320px;
  52. }
  53. .h-player {
  54. height: 100%;
  55. overflow: hidden;
  56. background: #000;
  57. }
  58. .container {
  59. width: 100%;
  60. height: 100%;
  61. position: relative;
  62. user-select: none;
  63. }
  64. #video1 {
  65. display: block;
  66. width: 100%;
  67. height: 100%;
  68. top: 0px;
  69. left: 0px;
  70. opacity: 1;
  71. }
  72. #box {
  73. width: 100%;
  74. height: 100%;
  75. position: absolute;
  76. left: 0;
  77. top: 0;
  78. z-index: 9999;
  79. /*width: 667px;
  80. height: 375px; http://192.168.31.8:8848/cloudmMobilePhone1.11/Player/trialInterface2.html
  81. position: absolute;
  82. left: -146px;
  83. top: 146px;
  84. background: red;*/
  85. /* transform: rotate(-90deg);*/
  86. /* opacity: 0.3;*/
  87. }
  88. .scroll {
  89. position: absolute;
  90. overflow: scroll;
  91. -webkit-overflow-scrolling: touch;
  92. top: 0;
  93. left: 0;
  94. bottom: 0;
  95. right: 0;
  96. }
  97. body:before {
  98. width: 100%;
  99. height: 100%;
  100. content: ' ';
  101. position: fixed;
  102. z-index: -1;
  103. top: 0;
  104. left: 0;
  105. background: #000;
  106. }
  107. #wine {
  108. user-select: none;
  109. -webkit-user-drag: none;
  110. position: absolute;
  111. z-index: 0;
  112. /* visibility: hidden;*/
  113. }
  114. #video1 {
  115. /* transform: rotate(180deg);*/
  116. }
  117. canvas {
  118. display: block;
  119. width: 100%;
  120. height: 100%;
  121. z-index: 999;
  122. }
  123. /*主屏*/
  124. .control {
  125. width: 900px;
  126. overflow: hidden;
  127. margin: 0 auto;
  128. margin-top: 90px;
  129. margin-bottom: 17px;
  130. }
  131. .control-left-img {
  132. width: 26px;
  133. height: 26px;
  134. }
  135. .control-left-img img {
  136. width: 100%;
  137. height: 100%;
  138. }
  139. #mainScreen-main {
  140. /* overflow: hidden; */
  141. user-select: none;
  142. -webkit-user-drag: none;
  143. position: relative;
  144. z-index: 0;
  145. width: 100%;
  146. height: 100%;
  147. top: 0px;
  148. /* left: 652.667px; */
  149. /* left: 270PX; */
  150. /* transform-origin: 0% 0%; */
  151. background: #000;
  152. }
  153. #mocan {
  154. position: absolute;
  155. left: -269px;
  156. top: 2px;
  157. /* opacity: 0.2; */
  158. width: 901px;
  159. height: 555px;
  160. z-index: 9999;
  161. opacity: 0.7;
  162. }
  163. #no-ne {
  164. width: 100%;
  165. height: 100%;
  166. position: absolute;
  167. top: 0;
  168. background: #000000;
  169. z-index: 99999;
  170. font-size: 18px;
  171. color: #FFFFFF;
  172. text-align: center;
  173. }
  174. .no-ne-text {
  175. margin-top: 60%;
  176. }
  177. .no-ne-an {
  178. width: 171px;
  179. height: 47px;
  180. background: #eb6100;
  181. line-height: 47px;
  182. text-align: center;
  183. color: #FFFFFF;
  184. margin: 0 auto;
  185. margin-top: 20px;
  186. }
  187. .container .muted {
  188. position: absolute;
  189. right: .46296rem;
  190. top: .46296rem;
  191. z-index: 9999999;
  192. /*background: #000;*/
  193. border-radius: 50%;
  194. /* opacity: 0.5;*/
  195. }
  196. .muted {
  197. width: 2.62963rem;
  198. height: 2.62963rem;
  199. background-position: -1.78704rem -8.43519rem;
  200. }
  201. html {
  202. height: 100%
  203. }
  204. .control-right-img {
  205. width: 42px;
  206. height: 42px;
  207. margin: 0 auto;
  208. /* margin: 1rem; */
  209. margin-top: 0.6rem;
  210. }
  211. .control-right-img img {
  212. width: 100%;
  213. height: 100%;
  214. }
  215. .leftmains {
  216. width: 3.5rem;
  217. height: 100%;
  218. background: #333333;
  219. position: fixed;
  220. right: 0rem;
  221. top: 0;
  222. transition: all 0.2s ease-in;
  223. }
  224. .PictureQualityMain {
  225. margin-top: 3rem;
  226. }
  227. .PictureQuality {
  228. margin: 0 auto;
  229. width: 2.5rem;
  230. height: 1.8rem;
  231. line-height: 1.8rem;
  232. color: #fff;
  233. text-align: center;
  234. font-size: 15px;
  235. margin-top: 1rem;
  236. }
  237. .avit {
  238. background: rgba(255, 255, 255, 1);
  239. color: #000 !important;
  240. border-radius: 3px;
  241. }
  242. .upload {
  243. margin: 0 auto;
  244. width: 3rem;
  245. height: 1.8rem;
  246. line-height: 1.8rem;
  247. color: #fff;
  248. text-align: center;
  249. font-size: 16px;
  250. margin-top: 3rem;
  251. }
  252. .upload img {
  253. width: 1.5rem;
  254. height: 1.5rem;
  255. }
  256. .upload div {
  257. margin-top: -0.5rem;
  258. font-size: 14px;
  259. }
  260. .operation {
  261. margin-top: 9rem;
  262. }
  263. .bottommains {
  264. width: 100%;
  265. height: 50px;
  266. background: #333333;
  267. position: fixed;
  268. left: 0;
  269. bottom: 0;
  270. }
  271. .botmat1 {
  272. width: 33%;
  273. float: left;
  274. }
  275. .botmat1img {
  276. margin: 0 auto;
  277. width: 1.5rem;
  278. height: 1.5rem;
  279. margin-top: 0.5rem;
  280. }
  281. .botmat1img img {
  282. width: 100%;
  283. height: 100%;
  284. }
  285. .mainbox {
  286. width: 18rem;
  287. height: 10rem;
  288. background: #fff;
  289. position: fixed;
  290. top: 38%;
  291. left: 5%;
  292. border-radius: 5px;
  293. }
  294. .boxTitle {
  295. text-align: center;
  296. font-size: 18px;
  297. padding: 10px 0px;
  298. }
  299. .boxText {
  300. text-align: center;
  301. font-size: 16px;
  302. }
  303. .boxbt {
  304. width: 60%;
  305. height: 2.5rem;
  306. background: #0886F5;
  307. margin: 0 auto;
  308. font-size: 16px;
  309. text-align: center;
  310. line-height: 2.5rem;
  311. color: #fff;
  312. border-radius: 5px;
  313. margin-top: 1rem;
  314. }
  315. .sbox {
  316. width: 18rem;
  317. height: 5.5rem;
  318. background: #fff;
  319. position: fixed;
  320. top: 38%;
  321. left: 5%;
  322. border-radius: 5px;
  323. }
  324. .sboxText {
  325. padding: 17px;
  326. font-size: 16px;
  327. }
  328. .sboxbu {
  329. text-align: right;
  330. color: #0886F5;
  331. font-size: 16px;
  332. margin-right: 2rem;
  333. }
  334. .boximg {
  335. position: absolute;
  336. width: 1rem;
  337. height: 1rem;
  338. left: 45%;
  339. bottom: -22%;
  340. }
  341. #showsuss{
  342. display: none;
  343. }
  344. </style>
  345. </head>
  346. <body class="scroll h-player" style="overscroll-behavior: contain;overflow:scroll;overflow-y: hidden;overflow-x: hidden;">
  347. <div class="container" id="player">
  348. <div class="muted" id="btnMuted">
  349. <div class="control-right-img" data-id="1">
  350. <img src="../static/img/xuanfu_icon.png">
  351. </div>
  352. </div>
  353. <div id="wine">
  354. <!-- <video id="video1" muted="muted" x5-video-orientation="landscape" playsinline="true" autoplay="true" webkit-playsinline="true" x5-playsinline="true" x5-video-player-type="h5" x5-video-player-fullscreen="false" style="pointer-events: none;"></video>
  355. -->
  356. <div id="box"></div>
  357. </div>
  358. <div class="leftmains">
  359. <div class="PictureQualityMain">
  360. <div class="PictureQuality " data-id="3072000">高清</div>
  361. <div class="PictureQuality avit" data-id="2243000">标清</div>
  362. <div class="PictureQuality" data-id="400000">极速</div>
  363. <div class="PictureQuality" data-id="400000">自动</div>
  364. </div>
  365. <div class="operation">
  366. <div class="upload" id="showsuss" data-text="uploads">
  367. <img src="../static/img/wx/shangchuan_icon.png">
  368. <div>上传</div>
  369. </div>
  370. <div class="upload" onclick="cp(document.getElementById('user_ref_id'));" data-text="Shearplate">
  371. <img src="../static/img/wx/jianqieban_icon.png">
  372. <div>剪切板</div>
  373. </div>
  374. <div class="upload" id="upload" data-text="Signout">
  375. <img src="../static/img/wx/tuichu_icon.png">
  376. <div>退出</div>
  377. </div>
  378. </div>
  379. </div>
  380. <div class="bottommains">
  381. <div class="botmat1">
  382. <div class="botmat1img" data-text="gengduo">
  383. <img src="../static/img/wx/gengduo_icon.png">
  384. </div>
  385. </div>
  386. <div class="botmat1">
  387. <div class="botmat1img" data-text="home">
  388. <img src="../static/img/wx/home_icon.png">
  389. </div>
  390. </div>
  391. <div class="botmat1">
  392. <div class="botmat1img" data-text="return">
  393. <img src="../static/img/wx/fanhui_icon.png">
  394. </div>
  395. </div>
  396. </div>
  397. <div class="mainbox" style="display: none;">
  398. <div class="boxTitle">提示</div>
  399. <div class="boxText">
  400. <div>由于小程序的功能限制,此功能暂时</div>
  401. <div>无法使用,请下载APP使用更多功能</div>
  402. </div>
  403. <div class="boxbt" onclick="cp(document.getElementById('user_ref_id'));">立即前往下载</div>
  404. <div class="boximg"><img src="../static/img/wx/guanbi_icon.png"></div>
  405. </div>
  406. <div class="sbox" style="display: none;">
  407. <div class="sboxText">下载地址已复制到剪切板</div>
  408. <div class="sboxbu">确定</div>
  409. </div>
  410. </div>
  411. <div id="copy-txt" style="position: absolute;opacity: 0;">
  412. <span id="user_ref_id">www.androidsCloud.com</span>
  413. </div>
  414. <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
  415. <!-- 音频-->
  416. <script src="../static/js/classlist.js"></script>
  417. <script src="../static/js/players.js"></script>
  418. <script src="../static/js/auroraplayer.js"></script>
  419. <script src="../static/js/aurora.js"></script>
  420. <script src="../static/js/aac.js"></script>
  421. <script src="../static/js/web.js"></script>
  422. <!-- 视频-->
  423. <script src="../static/js/jquery-1.11.0.min.js"></script>
  424. <script type="text/javascript" src="../static/js/Decoder.js"></script>
  425. <script type="text/javascript" src="../static/js/YUVCanvas.js"></script>
  426. <script type="text/javascript" src="../static/js/Player.js"></script>
  427. <script src="https://cdn.bootcss.com/vConsole/3.2.0/vconsole.min.js"></script>
  428. <script src="../static/distss/WXdraw.js"></script>
  429. <script>
  430. var topwinHeight = window.screen.height - window.innerHeight + 30; //计算title top 头部
  431. $('#wine').css({
  432. "width": window.screen.width,
  433. "height": window.screen.height - topwinHeight - 20,
  434. "position": "absolute",
  435. })
  436. var winese = document.createElement("wine");
  437. wine.style.top = "-" + winese + 'px';
  438. var url = window.location.href;
  439. url = url.split('/')
  440. // var baseUrl = window.location.href; //"http://192.168.31.20"
  441. // var baseUrl = "http://192.168.31.20"
  442. var baseUrl = "https://test.androidscloud.com"
  443. // var baseUrl = 'https://' + url[2] //url[2] //'http://192.168.31.159'//'http://' + url[2]
  444. var query = window.location.search.substring(1);
  445. // query = "clientType=1&cardIp=14.215.128.96&port=2012&sn=RK3930C2301900012&demoTime=3600&id=377&diskName=SC93mBww"
  446. var vars = query.split("&");
  447. console.log(vars)
  448. var data = {}
  449. // 审核
  450. $.ajax({
  451. url: baseUrl + "/api/user/v1/config/download/isShow",
  452. data: {},
  453. type: 'get',
  454. dataType: 'json',
  455. success: function(data) {
  456. if (data.data) {
  457. $("#showsuss").show()
  458. } else {
  459. $("#showsuss").hide()
  460. }
  461. //
  462. }
  463. })
  464. var clientType = vars.find(e => {
  465. return e.startsWith('clientType')
  466. }) || ''
  467. // console.log(clientType)
  468. data.clientType = clientType.substring(11, clientType.length)
  469. // 小程序直接进入
  470. var diskName = vars.find(e => {
  471. return e.startsWith('diskName')
  472. }) || ''
  473. data.diskName = diskName.substring(9, diskName.length)
  474. $(".leftmains").css({
  475. "right": "-4rem"
  476. })
  477. $('.leftmains').hide()
  478. $('.bottommains').hide()
  479. $('#btnMuted').hide()
  480. // document.title = decodeURI(data.diskName)
  481. if (data.clientType == 1) {
  482. var cardIp = vars.find(e => {
  483. return e.startsWith('cardIp')
  484. }) || ''
  485. var port = vars.find(e => {
  486. return e.startsWith('port')
  487. }) || ''
  488. var sn = vars.find(e => {
  489. return e.startsWith('sn')
  490. }) || ''
  491. var demoTime = vars.find(e => {
  492. return e.startsWith('demoTime')
  493. }) || ''
  494. var id = vars.find(e => {
  495. return e.startsWith('id')
  496. }) || ''
  497. data.clientType = clientType.substring(11, clientType.length)
  498. data.cardIp = cardIp.substring(7, cardIp.length)
  499. data.port = port.substring(5, port.length)
  500. data.sn = sn.substring(3, sn.length)
  501. data.demoTime = demoTime.substring(9, demoTime.length)
  502. data.id = id.substring(3, id.length)
  503. } else if (data.clientType == 2) { //分享屏幕
  504. $(".leftmains").css({
  505. "right": "-4rem"
  506. })
  507. $('.leftmains').hide()
  508. $('.bottommains').hide()
  509. $('#btnMuted').hide()
  510. let ip = vars.find(e => {
  511. return e.startsWith('ip')
  512. }) || ''
  513. var username = vars.find(e => {
  514. return e.startsWith('username')
  515. }) || ''
  516. var id = vars.find(e => {
  517. return e.startsWith('id')
  518. }) || ''
  519. var userCardId = vars.find(e => {
  520. return e.startsWith('userCardId')
  521. }) || ''
  522. data.id = id.substring(3, id.length)
  523. data.username = username.substring(9, username.length)
  524. data.ip = ip.substring(3, ip.length)
  525. data.userCardId = userCardId.substring(11, userCardId.length)
  526. // console.log(data.ip)
  527. // alert("测试3")
  528. // alert("data.userCardId",data.userCardId, "data.ip",data.ip)
  529. } else {
  530. // $(".leftmains").css({
  531. // "right":"-4rem"
  532. // })
  533. // $('.leftmains').hide()
  534. // $('.bottommains').hide()
  535. // $('#btnMuted').hide()
  536. var username = vars.find(e => {
  537. return e.startsWith('username')
  538. }) || ''
  539. var userCardId = vars.find(e => {
  540. return e.startsWith('userCardId')
  541. }) || ''
  542. data.username = username.substring(9, username.length)
  543. data.userCardId = userCardId.substring(11, userCardId.length)
  544. console.log(data.ip)
  545. }
  546. // 心跳
  547. // var time = 1000 * 30;
  548. // var interval;
  549. // fun()
  550. //
  551. // function run() {
  552. //
  553. // interval = setInterval(fun, time);
  554. // }
  555. //
  556. // function fun() {
  557. // $.ajax({
  558. // url: baseUrl + "/api/game/v1/cloudGame/dev/get/cardSn",
  559. // data: {
  560. // sn: data.sn
  561. // },
  562. // type: 'get',
  563. // dataType: 'json',
  564. // success: function(data) {
  565. //
  566. // }
  567. // })
  568. //
  569. // };
  570. // run();
  571. // data.clientType=1
  572. // data.sn="RK3930C2301900044"
  573. // data.cardIp="14.215.128.96"
  574. // data.port=2044
  575. var orientation = 0 //0 竖屏,1横屏
  576. var winHeight = window.screen.height - window.innerHeight
  577. var urlss = url[2]
  578. document.body.addEventListener('touchmove', function(e) {
  579. e.preventDefault()
  580. }, {
  581. passive: false
  582. })
  583. //
  584. // urlss = "14.215.128.96"
  585. // console.log()
  586. // data.clientType = 1
  587. // data.sn="RK3930C2301900044"
  588. // data.cardIp="14.215.128.96"
  589. // data.port=2044
  590. var strhost="";
  591. var players = AV.Player.fromWebSocket("wss://test.androidscloud.com:9105");
  592. // if (data.clientType == 3) {
  593. // var players = AV.Player.fromWebSocket("wss://" + urlss + '/authVideoWebSocket?' + "clientType=" + data.clientType +
  594. // "&username=" + data.username + "&userCardId=" + data.userCardId);
  595. // } else if (data.clientType == 2) {
  596. // var players = AV.Player.fromWebSocket("wss://" + urlss + '/shareWebSocket?' + "clientType=" + data.clientType +
  597. // "&username=" + data.username + "&userCardId=" + data.userCardId + "&ip=" + data.ip);
  598. // } else {
  599. // var players = AV.Player.fromWebSocket("wss://" + urlss + '/videoWebSocket?' + "clientType=" + data.clientType +
  600. // "&cardIp=" + data.cardIp + "&port=" + data.port + "&sn=" + data.sn);
  601. // }
  602. // // debugger
  603. // var players = AV.Player.fromWebSocket('ws://14.215.128.96/authVideoWebSocket?clientType=3&username=WqXTc1593762177&userCardId=377');
  604. players.play();
  605. players.volume = 100
  606. //var players = AV.Player.fromWebSocket('ws://14.215.128.96/videoWebSocket?clientType=0&cardIp=30.30.30.58&port=9100&sn=RK3930C2301900060');
  607. var warid = {
  608. id: data.id,
  609. type: 1,
  610. sn: data.sn
  611. }
  612. //结束时间 type=2
  613. var warids = {
  614. id: data.id,
  615. type: 2,
  616. sn: data.sn
  617. }
  618. // $.ajax({})
  619. // 关闭浏览器
  620. // window.onbeforeunload = function() {}
  621. //撤销的array
  622. var cancelList = new Array();
  623. //撤销的次数
  624. var cancelIndex = 0;
  625. var inputType = 0 //输入类型 0:手写,1:键盘输入
  626. //判断是否ie
  627. var IE_HACK = (/msie/i.test(navigator.userAgent) &&
  628. !/opera/i.test(navigator.userAgent));
  629. // 云手机相关逻辑
  630. var player = new Player({
  631. size: {
  632. width: 1280,
  633. height: 720
  634. }
  635. });
  636. var secanv = document.getElementById("wine");
  637. secanv.appendChild(player.canvas);
  638. // &cardIp="+data.data.extranetIp+"&port="+data.data.extranetPort+"&sn="+data.data.sn
  639. $(function() {
  640. initCanvas();
  641. });
  642. //初始化
  643. var initCanvas = function() {
  644. }
  645. window.onload = function() {};
  646. $("#voew").on("click", function() {})
  647. $("#box").on("click", function() {
  648. // draw_graph('pencil', this)
  649. })
  650. console.log(player)
  651. $('#mocan').on('click', function() {
  652. draw_graph('pencil', this)
  653. })
  654. // //初始化一下就可以了,
  655. // let vConsole = new VConsole();
  656. // //你打印的数据 比如
  657. // console.log('test');
  658. //就可像小程序一样的看了和调试了。
  659. $('.no-ne-an').on('click', function() {
  660. //结束时间 type=2
  661. let warids = {
  662. id: data.id,
  663. type: 2,
  664. sn: data.sn
  665. }
  666. $.ajax({
  667. url: baseUrl + "/api/game/v1/cloudGame/dev/getSn",
  668. data: warid,
  669. type: 'get',
  670. dataType: 'json',
  671. success: function(data) {
  672. history.go(-1)
  673. if (data.status == 0) {
  674. } else {
  675. alert(data.msg)
  676. }
  677. //
  678. }
  679. })
  680. })
  681. var btnMuted = document.querySelector("#btnMuted");
  682. btnMuted && (function() {
  683. var setHistory = function(left, top) {
  684. try {
  685. localStorage.setItem("muted-btn-loc", JSON.stringify({
  686. left: left,
  687. top: top
  688. }));
  689. } catch (ex) {}
  690. };
  691. var getHistory = function() {
  692. try {
  693. var value = localStorage.getItem("muted-btn-loc");
  694. if (!value) return null;
  695. value = JSON.parse(value);
  696. if (!value) return null;
  697. return value;
  698. } catch (ex) {
  699. return null
  700. }
  701. };
  702. var fixLoc = function(loc) {
  703. var rect = btnMuted.getBoundingClientRect();
  704. rect = {
  705. top: rect.top,
  706. left: rect.left,
  707. width: rect.width,
  708. height: rect.height
  709. }; //部分低版本浏览器,该属性为只读
  710. if (loc) {
  711. rect.left = loc.left;
  712. rect.top = loc.top;
  713. }
  714. var minX = 0;
  715. var minY = 0;
  716. var docRect = document.documentElement.getBoundingClientRect();
  717. var maxY = docRect.height - rect.height;
  718. var maxX = docRect.width - rect.width;
  719. var left = rect.left;
  720. var top = rect.top;
  721. left = Math.min(left, maxX);
  722. left = Math.max(left, minX);
  723. top = Math.min(top, maxY);
  724. top = Math.max(top, minY);
  725. console.log(rect.top, top, loc);
  726. if (loc || top !== rect.top || left !== rect.left) {
  727. btnMuted.style.cssText += "left:" + left + "px;top:" + top + "px;";
  728. }
  729. }
  730. window.addEventListener("resize", function() {
  731. fixLoc();
  732. });
  733. var touchPoint = {
  734. pageY: 0,
  735. pageX: 0
  736. };
  737. var currentLoc = {
  738. top: 0,
  739. left: 0,
  740. curTop: 0,
  741. curLeft: 0
  742. };
  743. var toMove = false;
  744. var touchmove = function(e) {
  745. e.preventDefault();
  746. var point = e.changedTouches[0];
  747. var top = -touchPoint.pageY + point.pageY;
  748. var left = -touchPoint.pageX + point.pageX;
  749. if (toMove) {
  750. top += currentLoc.top;
  751. left += currentLoc.left;
  752. currentLoc.curLeft = left;
  753. currentLoc.curTop = top;
  754. btnMuted.style.cssText += "left:" + left + "px;top:" + top + "px;";
  755. } else {
  756. if (Math.abs(top) >= 5 || Math.abs(left) >= 5) {
  757. toMove = true;
  758. }
  759. }
  760. };
  761. var touchend = function() {
  762. window.removeEventListener("touchmove", touchmove, {
  763. passive: false
  764. });
  765. window.removeEventListener("touchend", touchend, {
  766. passive: false
  767. });
  768. if (toMove) {
  769. setHistory(currentLoc.curLeft, currentLoc.curTop);
  770. fixLoc();
  771. } else {
  772. //按点击处理
  773. var set = $('.control-right-img').attr("data-id")
  774. if (set == '1') {
  775. $('.control-right-img').attr({
  776. "data-id": "2"
  777. })
  778. // $('.control-right-img').find('img').attr({
  779. // "src": "../static/img/musicturn.png"
  780. // })
  781. players.volume = 100
  782. $(".leftmains").css({
  783. "right": "-4rem"
  784. })
  785. // console.log(players)
  786. // players.play();
  787. } else {
  788. $('.control-right-img').attr({
  789. "data-id": "1"
  790. })
  791. $(".leftmains").css({
  792. "right": "0rem"
  793. })
  794. // $('.control-right-img').find('img').attr({
  795. // "src": "../static/img/musicfalse.png"
  796. // })
  797. players.volume = 0
  798. // players.off('pause');
  799. // players.pause();
  800. // var embed = document.embedPlay;
  801. console.log(players, "fdsfdsf")
  802. }
  803. }
  804. }
  805. btnMuted.addEventListener("touchstart", function(e) {
  806. e.preventDefault();
  807. toMove = false;
  808. var point = e.changedTouches[0];
  809. touchPoint.pageX = point.pageX;
  810. touchPoint.pageY = point.pageY;
  811. var rect = e.target.getBoundingClientRect();
  812. currentLoc.top = rect.top;
  813. currentLoc.left = rect.left;
  814. window.addEventListener("touchmove", touchmove, {
  815. passive: false
  816. });
  817. window.addEventListener("touchend", touchend, {
  818. passive: false
  819. });
  820. }, {
  821. passive: false
  822. });
  823. var history = getHistory();
  824. if (history) {
  825. fixLoc(history);
  826. }
  827. btnMuted.classList.remove("hide");
  828. })();
  829. $(".boximg").on("click", function() {
  830. $(".mainbox").css({
  831. "display": "none"
  832. })
  833. })
  834. // 剪切板
  835. $(".sboxbu").on("click", function() {
  836. $(".sbox").css({
  837. "display": "none"
  838. })
  839. })
  840. // 剪切板
  841. $(".uploadss").on("click", function() {
  842. $(".sbox").css({
  843. "display": "none"
  844. })
  845. })
  846. $("#upload").on("click", function() {
  847. wx.miniProgram.switchTab({
  848. url: '/pages/home/home'
  849. })
  850. })
  851. function selectText(x) {
  852. if (document.selection) {
  853. var range = document.body.createTextRange();
  854. range.moveToElementText(x);
  855. range.select();
  856. } else if (window.getSelection) {
  857. var selection = window.getSelection();
  858. var range = document.createRange();
  859. selection.removeAllRanges();
  860. range.selectNodeContents(x);
  861. selection.addRange(range);
  862. }
  863. }
  864. function cp(x) {
  865. $(".mainbox").css({
  866. "display": "none"
  867. })
  868. $(".sbox").css({
  869. "display": "block"
  870. })
  871. selectText(x);
  872. document.execCommand("copy");
  873. }
  874. </script>
  875. </body>
  876. </html>