equipManage_jk_detail.html 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title></title>
  6. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  7. <link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
  8. <link rel="stylesheet" href="../css/mui.min.css" />
  9. <link rel="stylesheet" href="../css/reset.css" />
  10. <link rel="stylesheet" href="../css/common.css" />
  11. <link rel="stylesheet" type="text/css" href="../css/equipjk.css" />
  12. <script src="../js/base.js" type="text/javascript" charset="utf-8"></script>
  13. <script src="https://open.ys7.com/sdk/js/1.3/ezuikit.js"></script>
  14. <style type="text/css">
  15. .headRightIcon{
  16. margin-top: 10px;
  17. }
  18. /*视频*/
  19. .videobox>video,
  20. .videobox {
  21. width: 100%;
  22. height: 4.5rem;
  23. background: #000;
  24. }
  25. /*控制*/
  26. .topCtrl {
  27. text-align: center;
  28. }
  29. .topCtrl>div {
  30. display: inline-block;
  31. width: 1.5rem;
  32. height: 1.5rem;
  33. background-size: 100%;
  34. }
  35. .addBtn {
  36. background: url(../images/jkadd.png);
  37. margin-right: 4rem;
  38. }
  39. .minusBtn {
  40. background: url(../images/jkminus.png);
  41. }
  42. .topCtrl{
  43. left: 0;
  44. right: 0;
  45. bottom: 6rem;
  46. height: 1.5rem;
  47. /*background: red;*/
  48. }
  49. .bottomCtrl {
  50. position: absolute;
  51. left: 0;
  52. right: 0;
  53. top: 5rem;
  54. bottom: 0;
  55. height: 6rem;
  56. background-size: 5.5rem 5.5rem;
  57. }
  58. .bottomCtrl div {
  59. position: absolute;
  60. width: 1.2rem;
  61. height: 1.2rem;
  62. left: 50%;
  63. }
  64. .upBtn {
  65. top: 1.45rem;
  66. margin-left: -0.6rem;
  67. }
  68. .dowmBtn {
  69. left: 50%;
  70. bottom: 1.65rem;
  71. margin-left: -0.6rem;
  72. }
  73. .leftBtn {
  74. top: 2.8rem;
  75. margin-left: -2rem;
  76. }
  77. .rightBtn {
  78. top: 2.8rem;
  79. margin-left: 0.8rem;
  80. }
  81. .lookImg {
  82. position: absolute;
  83. left: 0;
  84. top: 11rem;
  85. width: 100%;
  86. }
  87. .lookImg_img {
  88. margin-left: 1.3rem;
  89. }
  90. </style>
  91. </head>
  92. <body>
  93. <header class="mui-bar mui-bar-nav">
  94. <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
  95. <h1 class="mui-title" id="equip_name"></h1>
  96. <!--<a class="headRightIcon fa fa-file-image-o mui-pull-right" id="lookPhotoBtn"></a>-->
  97. </header>
  98. <div class="mui-content">
  99. <div class="videobox">
  100. <!--<video id="myPlayer" poster="" controls playsInline webkit-playsinline autoplay>
  101. <source src="rtmp://rtmp01open.ys7.com/openlive/fce902662a5a4acc86bc4ae771b45c92.hd" type="" />
  102. <source src="http://hls01open.ys7.com/openlive/fce902662a5a4acc86bc4ae771b45c92.hd.m3u8" type="application/x-mpegURL" />
  103. </video>-->
  104. </div>
  105. <div class="controlPanel">
  106. <div class="topCtrl">
  107. <div class="addBtn"></div>
  108. <div class="minusBtn"></div>
  109. <!--<div></div>-->
  110. </div>
  111. <div class="bottomCtrl">
  112. <div class="upBtn"></div>
  113. <div class="dowmBtn"></div>
  114. <div class="leftBtn"></div>
  115. <div class="rightBtn"></div>
  116. </div>
  117. <div class="lookImg" id="lookPhotoBtn">
  118. <img src="../images/jk_image.png" alt="" class="lookImg_img" />
  119. </div>
  120. </div>
  121. <script src="../js/jquery-2.1.0.js"></script>
  122. <script src="../js/mui.min.js"></script>
  123. <script src="https://open.ys7.com/sdk/js/1.3/ezuikit.js"></script>
  124. <script type="text/javascript">
  125. mui.init({
  126. gestureConfig:{
  127. tap: true, //默认为true
  128. doubletap: true, //默认为false
  129. longtap: true, //默认为false
  130. swipe: true, //默认为true
  131. drag: true, //默认为true
  132. hold:true,//默认为false,不监听
  133. release:true//默认为false,不监听
  134. }
  135. });
  136. var equipId;
  137. mui.plusReady(function() {
  138. var self = plus.webview.currentWebview();
  139. equipId = self.equipId;
  140. $('#equip_name').html('设备:'+equipId);
  141. mui.ajax('http://120.27.222.26/app_moni', {
  142. data: {
  143. id: equipId
  144. },
  145. dataType: 'json', //服务器返回json格式数据
  146. type: 'post', //HTTP请求类型
  147. timeout: 100000, //超时时间设置为10秒;
  148. beforeSend: function() {
  149. plus.nativeUI.showWaiting('请求中...');
  150. },
  151. complete: function() {
  152. plus.nativeUI.closeWaiting();
  153. },
  154. success: function(data) {
  155. console.log(JSON.stringify(data))
  156. if(data[0].code == 200) {
  157. StartPlay(data[0].data[0]);
  158. } else {
  159. mui.toast('请求失败');
  160. }
  161. },
  162. error: function(xhr, type, errorThrown) {
  163. mui.toast('请求失败');
  164. }
  165. });
  166. })
  167. $('.addBtn').on('longtap',function(){
  168. configCamera('move',8)
  169. })
  170. $('.addBtn').on('release',function(){
  171. configCamera('stop')
  172. })
  173. $('.minusBtn').on('hold',function(){
  174. configCamera('move',9)
  175. })
  176. $('.minusBtn').on('release',function(){
  177. configCamera('stop')
  178. })
  179. $('.upBtn').on('hold',function(){
  180. configCamera('move',0)
  181. })
  182. $('.upBtn').on('release',function(){
  183. configCamera('stop')
  184. })
  185. $('.dowmBtn').on('hold',function(){
  186. configCamera('move',1)
  187. })
  188. $('.dowmBtn').on('release',function(){
  189. configCamera('stop')
  190. })
  191. $('.leftBtn').on('hold',function(){
  192. configCamera('move',2)
  193. })
  194. $('.leftBtn').on('release',function(){
  195. configCamera('stop')
  196. })
  197. $('.rightBtn').on('hold',function(){
  198. configCamera('move',3)
  199. })
  200. $('.rightBtn').on('release',function(){
  201. configCamera('stop')
  202. })
  203. function configCamera(ctrl, movenum) {
  204. console.log(111111)
  205. $.ajax({
  206. // url: 'http://120.27.222.26/equipmanage_jk',
  207. url: 'http://120.27.222.26/jk_view',
  208. type: 'post',
  209. dataType: 'json',
  210. data: {
  211. id: equipId,
  212. ctrl: ctrl,
  213. movenum: movenum
  214. },
  215. beforeSend: function() {
  216. if(ctrl == 'takephoto') {
  217. loadFlage = layer.load();
  218. }
  219. },
  220. success: function(data) {
  221. // console.log(data)
  222. },
  223. error: function(xhr, type, errorThrown) {
  224. mui.toast('请求失败');
  225. }
  226. })
  227. }
  228. //预览函数
  229. function StartPlay(dat) {
  230. var jkmsg = dat
  231. var playHtml = "<video id='myPlayer' class='videoNum' poster='' controls playsinline webkit-playsinline autoplay>";
  232. playHtml += "<source src='" + jkmsg.hlsHd + "' type='' />";
  233. playHtml += "</video>";
  234. var script = document.createElement("script");
  235. script.type = "text/javascript";
  236. script.appendChild(document.createTextNode(" new EZUIPlayer('myPlayer');"));
  237. $(".videobox").html(playHtml);
  238. $(".videobox").append(script);
  239. }
  240. //进入定时拍照页面
  241. document.getElementById('lookPhotoBtn').addEventListener('tap', function() {
  242. mui.openWindow({
  243. url: 'lookImage_jk.html',
  244. id: 'lookImage_jk',
  245. extras: {
  246. 'equipId': equipId,
  247. // 'equipName':equipName
  248. },
  249. })
  250. })
  251. </script>
  252. </body>
  253. </html>