VM暫存
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

131 lines
3.9KB

  1. <!DOCTYPE html>
  2. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  3. <meta http-equiv="Cache-control" content="no-cache">
  4. <style>
  5. body{background-color:black;font-family:Microsoft JhengHei;overflow:hidden;}
  6. table{width:100%;text-align:center;}
  7. .line_1 /* 第一行 */
  8. {
  9. font-size:300px;
  10. font-family:微軟正黑體;
  11. font-weight:bolder;
  12. color:red;
  13. }
  14. .line_2 /* 第二行 */
  15. {
  16. width:15%;
  17. font-family:微軟正黑體;
  18. font-size:280px;
  19. color:greenyellow;
  20. text-align:center;
  21. font-weight:bolder;
  22. }
  23. </style>
  24. <script src="http://code.jquery.com/jquery-2.1.4.js"></script>
  25. <script src="http://61.220.179.128/jsid.i/uniqid=clientid&mqtt_ip=mqtt_ip"></script>
  26. <html>
  27. <head>
  28. <title>入口-VIP歡迎光臨</title>
  29. </head>
  30. <body>
  31. <!-- 閒置時間, 顯示: 輸入車號後即可繳費 -->
  32. <div id="waiting" class="vip_notice">
  33. <table style="border:0px;" cellpadding='0' bolder="0">
  34. <tr>
  35. <td style="font-size:100px;">&nbsp;</td>
  36. </tr>
  37. <tr>
  38. <td class="line_1" align="center" style="font-size:140px;">輸入車號後即可繳費</td>
  39. </tr>
  40. <tr>
  41. <td class="line_2"><marquee direction="left" scrollamount="40" style="font-size:170px;">本停車場使用無票卡繳費</marquee></td>
  42. </tr>
  43. </table>
  44. </div>
  45. <!-- 會員車入場, 顯示: 車號 歡迎光臨 -->
  46. <div id="member" class="vip_notice" style="display:none;">
  47. <!--div id="member" class="vip_notice"-->
  48. <img src="vip_map.jpg" width="1345" height="750"/>
  49. </div>
  50. <!-- VIP入場時, 顯示: VIP導車 -->
  51. <div id="vip_comein" class="vip_notice" style="display:none;background-color:white;">
  52. <table style="border:0px;" cellpadding='0' bolder="0">
  53. <tr>
  54. <td style="font-size:100px;">&nbsp;</td>
  55. </tr>
  56. <tr>
  57. <td class="line_1" align="center" style="font-size:140px;">貴賓請往前左方停車</td>
  58. </tr>
  59. <tr>
  60. <td class="line_2" style="color:red;"><marquee direction="left" scrollamount="40" style="font-size:170px;">歡迎貴賓蒞臨</marquee></td>
  61. </tr>
  62. </table>
  63. </div>
  64. </body>
  65. <script src="/libs/js/moment.min.js"></script>
  66. <script src="/libs/js/mqttws.min.js"></script>
  67. <script>
  68. var client = new Paho.MQTT.Client(mqtt_ip, 8000, clientid);
  69. // set callback handlers
  70. client.onConnectionLost = onConnectionLost;
  71. client.onMessageArrived = onMessageArrived;
  72. client.connect({onSuccess:onConnect});
  73. // called when the client connects
  74. function onConnect()
  75. {
  76. // Once a connection has been made, make a subscription and send a message.
  77. console.log("onConnect|"+mqtt_ip+"|"+clientid+"|"+"vip_welcome");
  78. client.subscribe("vip_welcome", 2);
  79. }
  80. // called when the client loses its connection
  81. function onConnectionLost(responseObject)
  82. {
  83. if (responseObject.errorCode !== 0)
  84. {
  85. console.log("onConnectionLost:"+responseObject.errorMessage);
  86. }
  87. }
  88. // called when a message arrives
  89. function onMessageArrived(message)
  90. {
  91. console.log("onMessageArrived:"+message.payloadString);
  92. $(".vip_notice").hide();
  93. $("#vip_comein").show();
  94. // 8秒後恢復原始畫面
  95. vip_start = setTimeout(function()
  96. {
  97. $(".vip_notice").hide();
  98. $("#waiting").show();
  99. clearTimeout(vip_start);
  100. }, 8000);
  101. }
  102. $(document).ready(function()
  103. {
  104. // 如果畫面沒動作, 自動更新頁面
  105. var reloadTimeMillis = 600000; // 每 10 min 自動重新載入頁面
  106. var checkReloadTimeMillis = 10000; // 每 10 sec 判斷一次
  107. // 如果畫面沒動作, 每10分鐘自動重新載入頁面
  108. var aliveTime = moment();
  109. $(document.body).bind("mousemove keypress", function(e) {
  110. aliveTime = moment();
  111. });
  112. function refresh() {
  113. if(moment() - aliveTime >= reloadTimeMillis)
  114. window.location.reload(true);
  115. else
  116. setTimeout(refresh, checkReloadTimeMillis);
  117. }
  118. setTimeout(refresh, checkReloadTimeMillis);
  119. });
  120. </script>
  121. </html>