monitorList.html 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta
  6. name="viewport"
  7. content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"
  8. />
  9. <meta
  10. name="format-detection"
  11. content="telephone=no,email=no,date=no,address=no"
  12. />
  13. <title></title>
  14. <link rel="stylesheet" type="text/css" href="../../css/api.css" />
  15. <link rel="stylesheet" type="text/css" href="../../css/style.css" />
  16. <link rel="stylesheet" href="../../css/aui.css" />
  17. <link rel="stylesheet" href="../../css/projeck.css" />
  18. <style>
  19. body,
  20. html {
  21. background: #fff;
  22. overflow: hidden;
  23. -webkit-box-sizing: border-box;
  24. -moz-box-sizing: border-box;
  25. box-sizing: border-box;
  26. position: relative;
  27. }
  28. .api_layout {
  29. height: 100%;
  30. overflow-y: scroll;
  31. -webkit-overflow-scrolling: touch;
  32. }
  33. .monitorList {
  34. padding: 14px;
  35. }
  36. .monitorList li {
  37. display: flex;
  38. display: -webkit-flex;
  39. justify-content: flex-start;
  40. -webkit-justify-content: flex-start;
  41. height: 56px;
  42. line-height: 56px;
  43. align-items: center;
  44. color: #5a5a5a;
  45. font-size: 14px;
  46. position: relative;
  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. .right_side {
  68. position: absolute;
  69. top: 0;
  70. right: -100%;
  71. width: 100%;
  72. height: 100%;
  73. background: rgba(0, 0, 0, 0.6);
  74. transition: 0.5ms;
  75. }
  76. .list {
  77. position: absolute;
  78. top: 0;
  79. right: -75%;
  80. width: 75%;
  81. height: 100%;
  82. background: #fff;
  83. transition: 0.3s;
  84. }
  85. .titles {
  86. height: 38px;
  87. line-height: 38px;
  88. padding-left: 15px;
  89. font-size: 15px;
  90. color: #2c3e50;
  91. position: relative;
  92. }
  93. .titles:after {
  94. content: '';
  95. display: table;
  96. position: absolute;
  97. bottom: 0;
  98. left: 0;
  99. width: 100%;
  100. height: 1px;
  101. background: #009fe8;
  102. }
  103. .titles i {
  104. display: block;
  105. width: 19px;
  106. height: 19px;
  107. line-height: 19px;
  108. background: url('../../image/close.png') no-repeat;
  109. background-size: cover;
  110. text-align: center;
  111. -webkit-box-sizing: border-box;
  112. -moz-box-sizing: border-box;
  113. box-sizing: border-box;
  114. position: absolute;
  115. top: 8px;
  116. right: 10px;
  117. color: #ced3d6;
  118. font-size: 8px;
  119. }
  120. .api_lists {
  121. padding: 0 14px;
  122. height: 100%;
  123. overflow-y: scroll;
  124. padding-bottom: 38px;
  125. -webkit-overflow-scrolling: touch;
  126. }
  127. .api_lists li {
  128. display: flex;
  129. display: -webkit-flex;
  130. justify-content: flex-start;
  131. -webkit-justify-content: flex-start;
  132. height: 90px;
  133. align-items: center;
  134. position: relative;
  135. }
  136. .info p {
  137. font-size: 15px;
  138. }
  139. .api_lists li:after {
  140. content: '';
  141. display: table;
  142. position: absolute;
  143. bottom: 0;
  144. left: 0;
  145. width: 100%;
  146. height: 1px;
  147. background: #e8e9ea;
  148. }
  149. .api_lists li p {
  150. color: #2c3e50;
  151. font-size: 13px;
  152. }
  153. .monitorImg {
  154. width: 75px;
  155. height: 56px;
  156. display: block;
  157. margin-right: 20px;
  158. }
  159. .SeeBtn {
  160. height: 24px;
  161. line-height: 24px;
  162. width: 71px;
  163. text-align: center;
  164. color: #fff;
  165. background: #009fe8;
  166. font-size: 10px;
  167. -webkit-border-radius: 50px;
  168. -moz-border-radius: 50px;
  169. border-radius: 50px;
  170. margin-top: 15px;
  171. }
  172. .api_lists #contetnNo {
  173. text-align: center;
  174. font-size: 14px;
  175. color: #bdc3c7;
  176. height: 50px;
  177. margin-top: 20px;
  178. /*justify-content: center;
  179. -webkit-justify-content: center;*/
  180. display: none;
  181. }
  182. .api_lists #contetnNo:after {
  183. content: '';
  184. display: table;
  185. position: absolute;
  186. bottom: 0;
  187. left: 0;
  188. width: 100%;
  189. height: 0;
  190. background: #e8e9ea;
  191. }
  192. #noJurisdiction {
  193. background: url('../../image/no.png') no-repeat;
  194. background-size: contain;
  195. position: absolute;
  196. top: -50%;
  197. left: 0;
  198. bottom: 0;
  199. right: 0;
  200. margin: auto;
  201. width: 125px;
  202. height: 142px;
  203. display: none;
  204. }
  205. .ico-loading {
  206. position: absolute;
  207. top: 0;
  208. left: 0;
  209. bottom: 0;
  210. right: 0;
  211. margin: auto;
  212. width: 35px;
  213. height: 35px;
  214. background: url('../../icon/loading.gif') no-repeat;
  215. background-size: cover;
  216. background-position: center;
  217. }
  218. .loading {
  219. position: absolute;
  220. width: 100%;
  221. height: 100%;
  222. background: rgba(255, 255, 255, 0.3);
  223. top: 0;
  224. left: 0;
  225. }
  226. </style>
  227. </head>
  228. <body>
  229. <div class="api_layout">
  230. <ul class="monitorList" id="monitorList"></ul>
  231. <div id="noJurisdiction"></div>
  232. </div>
  233. <!--侧滑 遮罩层-->
  234. <div class="right_side" onclick="recoveryFun()"></div>
  235. <!--视频列表-->
  236. <div class="list">
  237. <p class="titles">
  238. <span></span>
  239. <i onclick="recoveryFun()"></i>
  240. </p>
  241. <ul class="api_lists" id="api_lists">
  242. <li id="contetnNo">-暂无内容-</li>
  243. </ul>
  244. <div class="loading">
  245. <i class="ico-loading"></i>
  246. </div>
  247. </div>
  248. <script type="text/template" id="template">
  249. {{~it:value}}
  250. {{?value.indexCode!='root000000'}}
  251. <li onclick="seeMonitorList('{{=value.indexCode}}','{{=value.name}}','')">
  252. <img src="../../icon/video.png" alt="">
  253. <span>{{=value.name}}</span>
  254. </li>
  255. {{?}}
  256. {{~}}
  257. </script>
  258. <script type="text/template" id="template01">
  259. {{~it:value}}
  260. <li>
  261. <img src="http://jiewei-icon.oss-cn-beijing.aliyuncs.com/default-img-150x112.png" alt="" class="monitorImg">
  262. <div class="info">
  263. <p>{{=value.cameraName}}</p>
  264. <button type="button" class="SeeBtn" onclick="SeeVideo('{{=value.cameraIndexCode}}','{{=value.cameraName}}','{{=value.regionIndexCode}}')">查看监控</button>
  265. </div>
  266. </li>
  267. {{~}}
  268. </script>
  269. <script src="../../script/api.js"></script>
  270. <script src="../../script/doT.min.js"></script>
  271. <script src="../../script/config.js"></script>
  272. <script>
  273. var toast = new auiToast(),
  274. headers = '';
  275. apiready = function () {
  276. var info = $api.getStorage('data'),
  277. token = JSON.parse(info).data.access_token;
  278. headers = {
  279. Authorization: 'Bearer ' + token,
  280. };
  281. monitorListFun(headers);
  282. };
  283. function monitorListFun(header) {
  284. $http.fnReuestData(
  285. jinfengUrlRouter.selectRootRequest,
  286. header,
  287. 'get',
  288. '',
  289. function (ret, err) {
  290. // console.log(JSON.stringify(ret));
  291. // console.log(JSON.stringify(err));
  292. if (ret.code === '0') {
  293. $apis.html(monitorList, '#template', ret.data.list);
  294. toast.hide();
  295. }
  296. }
  297. );
  298. }
  299. function seeMonitorList(id, title, name) {
  300. $api.removeCls($api.dom('.loading'), 'hide');
  301. $api.html($api.dom('.titles>span'), title);
  302. var list = document.querySelector('.list'),
  303. right_side = document.querySelector('.right_side');
  304. list.style.right = '0';
  305. right_side.style.right = '0';
  306. var regionUuid = {
  307. indexCode: id,
  308. pageNum: 1,
  309. pageSize: 200,
  310. };
  311. $http.fnReuestDataNologing(
  312. jinfengUrlRouter.selectResourceList,
  313. headers,
  314. 'get',
  315. regionUuid,
  316. function (ret, err) {
  317. toast.hide();
  318. if (ret.code === '0') {
  319. if (ret.data.list.length > 0) {
  320. $apis.html(api_lists, '#template01', ret.data.list);
  321. $api.addCls($api.dom('.loading'), 'hide');
  322. } else {
  323. $api.addCls($api.dom('.loading'), 'hide');
  324. document.getElementById('contetnNo').style.display = 'block';
  325. }
  326. }
  327. }
  328. );
  329. }
  330. function recoveryFun() {
  331. var list = document.querySelector('.list'),
  332. right_side = document.querySelector('.right_side');
  333. list.style.right = '-75%';
  334. right_side.style.right = '-100%';
  335. }
  336. // 查看视频
  337. function SeeVideo(id, title, regionIndexCode1) {
  338. $http.fnReuestDataNologing(
  339. jinfengUrlRouter.selectResourcePreviewURLs,
  340. headers,
  341. 'get',
  342. {cameraIndexCode: id, regionIndexCode: regionIndexCode1},
  343. function (ret, err) {
  344. if (ret.code === '0') {
  345. var pageParam = {
  346. videoUrl: ret.data.url,
  347. title: title,
  348. };
  349. var video = api.require('modulehikvision');
  350. var param = {
  351. url:
  352. 'rtsp://120.253.61.234' +
  353. ret.data.url.substring(ret.data.url.lastIndexOf(':')),
  354. };
  355. video.start2HikVisionLogin(param);
  356. }
  357. }
  358. );
  359. }
  360. </script>
  361. </body>
  362. </html>