monitorList.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
  6. <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
  7. <title></title>
  8. <link rel="stylesheet" type="text/css" href="../../css/api.css">
  9. <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
  10. <link rel="stylesheet" href="../../css/aui.css">
  11. <link rel="stylesheet" href="../../css/projeck.css">
  12. <style>
  13. body,html{
  14. background: #fff;
  15. overflow: hidden;
  16. -webkit-box-sizing: border-box;
  17. -moz-box-sizing: border-box;
  18. box-sizing: border-box;
  19. position: relative;
  20. }
  21. .api_layout{
  22. height: 100%;
  23. overflow-y: scroll;
  24. -webkit-overflow-scrolling: touch;
  25. }
  26. .monitorList{
  27. padding: 14px;
  28. }
  29. .monitorList li{
  30. display: flex;
  31. display: -webkit-flex;
  32. justify-content: space-between;
  33. -webkit-justify-content: space-between;
  34. height: 56px;
  35. align-items: center;
  36. color: #5a5a5a;
  37. font-size: 14px;
  38. position: relative;
  39. }
  40. .video-name{
  41. display: flex;
  42. display: -webkit-flex;
  43. justify-content: flex-start;
  44. -webkit-justify-content: flex-start;
  45. align-items: center;
  46. width: 80%;
  47. }
  48. .monitorList li:after{
  49. content: '';
  50. display: table;
  51. position: absolute;
  52. width: 100%;
  53. height: 1px;
  54. background: #e8e9ea;
  55. bottom: 0;
  56. left: 0;
  57. }
  58. .monitorList li img{
  59. width: 42px;
  60. height: 42px;
  61. display: block;
  62. -webkit-border-radius: 50%;
  63. -moz-border-radius: 50%;
  64. border-radius: 50%;
  65. margin-right: 19px;
  66. }
  67. </style>
  68. </head>
  69. <body>
  70. <div class="api_layout">
  71. <ul class="monitorList" id="monitorList">
  72. </ul>
  73. <div id="noJurisdiction"> </div>
  74. </div>
  75. <script type="text/template" id="template">
  76. {{~it:value}}
  77. <li onclick="SeeVideo('{{=value.deviceSerial}}','{{=value.channelNo}}','{{=value.channelName}}')">
  78. <div class="video-name">
  79. <img src="../../icon/video.png" alt="">
  80. <span>{{=value.channelName}}</span>
  81. </div>
  82. <span style="text-align: right;width:20%;margin-left:15px;color:{{=value.status==1?'green':'#ccc'}}">{{=value.status==1?'在线':'不在线'}}</span>
  83. </li>
  84. {{~}}
  85. </script>
  86. <script src="../../script/api.js"></script>
  87. <script src="../../script/doT.min.js"></script>
  88. <script src="../../script/config.js"></script>
  89. <script>
  90. var toast = new auiToast(),token = "";
  91. apiready = function () {
  92. var info = $api.getStorage('data'),
  93. token = JSON.parse(info).data.access_token;
  94. headers = {
  95. "Authorization": "Bearer " + token
  96. };
  97. getAccessToken()
  98. };
  99. // 获取AccessToken
  100. function getAccessToken() {
  101. var params = {
  102. appKey:'de05674f7915474ea9dcdade210636b3',
  103. appSecret:'7791659d81ad659d00b378718ee5d16f'
  104. }
  105. $http.fnReuestDataNologing(UrlRouter.getAccessToken,'','post',params,function (ret, err) {
  106. if (ret.code === '200') {
  107. token= ret.data.accessToken;
  108. monitorListFun(ret.data.accessToken)
  109. }
  110. })
  111. }
  112. function monitorListFun(token) {
  113. var params = {
  114. accessToken:token,
  115. deviceSerial:'C00693494'
  116. }
  117. $http.fnReuestData(UrlRouter.getVideoList,'','post',params,function (ret, err) {
  118. if (ret.data) {
  119. $apis.html(monitorList,'#template',ret.data);
  120. toast.hide()
  121. }
  122. })
  123. }
  124. // 查看视频
  125. function SeeVideo(deviceSerial,channelNo,name) {
  126. var params = {
  127. accessToken:token,
  128. source:deviceSerial+':'+channelNo
  129. }
  130. $http.fnReuestDataNologing(UrlRouter.getVideoUrl,'','post',params,function (ret, err) {
  131. if (ret.data) {
  132. if (ret.data[0].ret == '200') {
  133. $event.openWin('videoWin','videoWin',{url:ret.data[0].hls,title:name,token:token},'')
  134. }else {
  135. api.alert({
  136. title: '提示',
  137. msg: ret.data[0].desc,
  138. });
  139. }
  140. }
  141. })
  142. }
  143. </script>
  144. </body>
  145. </html>