sample.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <html>
  2. <head>
  3. <script src="jstoue.js"></script>
  4. <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
  5. <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
  6. <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8. <style>
  9. /* 使整个页面使用 flexbox 布局,并让内容居中 */
  10. /* 页面整体样式 */
  11. body, html {
  12. margin: 0;
  13. padding: 0;
  14. height: 100%;
  15. display: flex;
  16. flex-direction: column; /* 纵向排列 */
  17. }
  18. /* 顶部部分样式 */
  19. .top {
  20. background: linear-gradient(to bottom, rgba(50, 100, 0, 1), rgba(50, 100, 0, 0.3));
  21. text-align: center;
  22. height: 12%; /* 高度占页面的 8% */
  23. }
  24. /* 底部左右部分的父容器,使用 flexbox */
  25. .bottom {
  26. display: flex;
  27. flex: 1; /* 占据剩余空间 */
  28. }
  29. /* 左边部分样式 */
  30. .left {
  31. background-color: rgba(0, 0, 0, 0.0);
  32. flex: 1;
  33. }
  34. /* 左边部分样式 */
  35. .center {
  36. background-color: rgba(0, 0, 0, 0.0);
  37. flex: 3;
  38. }
  39. /* 右边部分样式 */
  40. .right {
  41. flex: 1; /* 右边部分宽度是左边的两倍 */
  42. justify-content: flex-end;
  43. align-items: center;
  44. background: linear-gradient(to left, rgba(50, 100, 0, 1), rgba(50, 100, 0, 0));
  45. }
  46. /* 蓝色矩形 */
  47. .blue-rectangle {
  48. justify-content: left;
  49. align-items: left;
  50. height: 100%;
  51. background: linear-gradient(to right, rgba(0, 100, 0, 1.0), rgba(0, 100, 0, 0));
  52. }
  53. .translucent,.top-name-zh,.top-name-en {
  54. justify-content: center;
  55. align-items: center;
  56. color: yellow;
  57. font-size: 32px;
  58. }
  59. /* 蓝色矩形 */
  60. .dropdown,.dropdown-toggle,.dropdown-menu {
  61. justify-content: right;
  62. align-items: right;
  63. /*width:80px */
  64. /*background-color: blue; 背景颜色为蓝色 */
  65. /*background-color: #00000000; 背景颜色,非必须 */
  66. background: linear-gradient(to right, rgba(100, 100, 0, 1), rgba(100, 100, 0, 1));
  67. }
  68. </style>
  69. </head>
  70. <body style="background-color: transparent; -webkit-user-select: none;">
  71. <div class="top">
  72. <p class="top-name-zh">四川数演科技有限公司</p>
  73. <p class="top-name-en">Sichuan Shuyan Technology Co., Ltd.</p>
  74. </div>
  75. <div class="bottom">
  76. <div class="left">
  77. <div class="blue-rectangle">
  78. <p class="translucent">translucent</p>
  79. </div>
  80. </div>
  81. <div class="center">
  82. </div>
  83. <div class="right">
  84. <div>
  85. <button id="btn_json">json call </button>
  86. </div>
  87. <div>
  88. <button id="btn_obj">object call </button>
  89. </div>
  90. <div>
  91. <button id="btn_objp">object call param </button>
  92. </div>
  93. <div>
  94. <input id="volumeSlider" type="range" min="0.01" max="1" step="0.01" />
  95. </div>
  96. <li class="dropdown">
  97. <a class="dropdown-toggle" data-toggle="dropdown" href="#"> Java <span class="caret"></span>
  98. </a>
  99. <ul class="dropdown-menu">
  100. <li><a href="#">Swing</a></li>
  101. <li><a href="#">jMeter</a></li>
  102. <li><a href="#">EJB</a></li>
  103. <li class="divider"></li>
  104. <li><a href="#">分离的链接</a></li>
  105. </ul>
  106. </li>
  107. </div>
  108. </div>
  109. </body>
  110. <script>
  111. // response function from ue call
  112. ue.interface.jsfunc = function(jsonObject){
  113. console.log('jsonObject');
  114. alert('popup window');
  115. //console.log(JSON.stringify(jsonObject));
  116. };
  117. ue.interface.multiparams = function(paramStr0,paramStr1){
  118. console.log(paramStr0+'==='+paramStr1);
  119. };
  120. var total = 0;
  121. var response=0;
  122. var btn_json = document.getElementById('btn_json');
  123. btn_json.setAttribute("onclick", "JsonCall()");
  124. var btn_obj = document.getElementById('btn_obj');
  125. btn_obj.setAttribute("onclick", "ObjCall()");
  126. var btn_obj = document.getElementById('btn_objp');
  127. btn_obj.setAttribute("onclick", "ObjCallP()");
  128. // ue.call(key,json,callback,timeout) <==> OnJsEventStr(type,json,callback)
  129. // usage:
  130. // key : string
  131. // json: {"a":1} or [1,2,3,4]
  132. // callback : when success in ue,and ue callback to js
  133. // function(){} or ()=>{}
  134. // timeout: The effective time of the callback function, in seconds
  135. //
  136. function JsonCall() {
  137. //var url = 'rtsp://113.201.104.35:9090/dss/monitor/param?cameraid=1000054%247&substream=1' ;
  138. //alert('qweqwe');
  139. //for (var i=0; i<1000; i++){
  140. total++;
  141. ue.call("videoUrl", { "url": "www.baidu.com", "total": total },
  142. function (jsonObject) {
  143. //alert(rv);
  144. response = response + 1;
  145. console.log("succed " + JSON.stringify(jsonObject) + " " + response);
  146. }
  147. );
  148. //}
  149. }
  150. function ObjCall(){
  151. ue.GetBrowserWnd();
  152. }
  153. function ObjCallP() {
  154. ue.bpbind.help5("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21")
  155. }
  156. </script>
  157. </html>