From 0450b2569821cef5d0f9827afea8612bf645cbfe Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期二, 16 六月 2026 11:11:03 +0800
Subject: [PATCH] yxh
---
big.html | 202 +++++++++++++++++++++++++++++++++++++-------------
1 files changed, 148 insertions(+), 54 deletions(-)
diff --git a/big.html b/big.html
index 48e44da..54c827d 100644
--- a/big.html
+++ b/big.html
@@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, target-densitydpi=device-dpi" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>澶у巺</title>
<style>
@@ -11,28 +11,36 @@
margin: 0;
padding: 0;
box-sizing: border-box;
- font-family: "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
+ /* Android 6 鍙敤涓枃瀛椾綋 */;
+ font-family: "Droid Sans Fallback", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}
/* 1. 鍏ㄥ眬娣辫壊鑳屾櫙 */
body {
background: #001f3f;
- /* 娣辫摑鑹茶儗鏅紝閫傚悎澶у睆 */
color: #fff;
height: 100vh;
overflow: hidden;
+ display: -webkit-box;
+ display: -webkit-flex;
display: flex;
+ -webkit-box-orient: vertical;
+ -webkit-box-direction: normal;
+ -webkit-flex-direction: column;
flex-direction: column;
font-size: 14px;
}
- /* 2. 椤堕儴鏍� - 绠�鍖栬竟妗嗭紝娣辫壊涓婚 */
+ /* 2. 椤堕儴鏍� */
.top-header {
+ display: -webkit-box;
+ display: -webkit-flex;
display: flex;
+ -webkit-box-align: center;
+ -webkit-align-items: center;
align-items: center;
padding: 15px 30px;
background: rgba(0, 30, 60, 0.9);
- /* 娣辫壊鍗婇�忔槑 */
white-space: nowrap;
position: relative;
border-bottom: 1px solid #003366;
@@ -47,6 +55,7 @@
.top-header .title-text {
position: absolute;
left: 50%;
+ -webkit-transform: translateX(-50%);
transform: translateX(-50%);
font-size: 32px;
font-weight: bold;
@@ -61,37 +70,70 @@
z-index: 2;
}
- /* 3. 涓讳綋鍐呭 */
+ /* 3. 涓讳綋鍐呭锛坓ap 鏇挎崲涓� margin 鍏煎鏃� Chrome锛� */
.main-content {
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
flex: 1;
+ display: -webkit-box;
+ display: -webkit-flex;
display: flex;
padding: 15px 20px;
overflow: hidden;
- gap: 10px;
}
- /* 鍒楀鍣� - 绉婚櫎闃村奖鍜屽渾瑙掞紝鏇寸畝娲� */
+ .main-content > .column-box {
+ margin-left: 5px;
+ margin-right: 5px;
+ }
+
+ .main-content > .column-box:first-child {
+ margin-left: 0;
+ }
+
+ .main-content > .column-box:last-child {
+ margin-right: 0;
+ }
+
+ /* 鍒楀鍣� */
.column-box {
+ display: -webkit-box;
+ display: -webkit-flex;
display: flex;
+ -webkit-box-orient: vertical;
+ -webkit-box-direction: normal;
+ -webkit-flex-direction: column;
flex-direction: column;
background: rgba(10, 40, 80, 0.5);
- /* 娣辫壊鍗婇�忔槑鑳屾櫙 */
border-radius: 0;
padding: 10px;
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
flex: 1;
min-width: 0;
border: 1px solid #003366;
}
.column-box.col-wide {
+ -webkit-box-flex: 2.5;
+ -webkit-flex: 2.5;
flex: 2.5;
}
.column-box.col-normal {
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
flex: 1;
}
- /* 鏍囬鏍峰紡 - 绠�鍖栦笅鍒掔嚎 */
+ /* 鏍囬琛� */
+ .col-title-line {
+ font-size: 22px;
+ font-weight: bold;
+ color: #4da6ff;
+ text-align: center;
+ }
+
.col-title {
font-size: 22px;
font-weight: bold;
@@ -110,41 +152,52 @@
/* 鎮h�呭垪琛� */
.patient-list {
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
flex: 1;
overflow-y: auto;
padding-right: 5px;
}
- /* 銆愬叧閿慨鏀广�戠1鏍忓己鍒朵竴琛�2涓� */
+ /* 绗�1鏍忥細涓�琛屼袱涓� */
#col-0 {
+ display: -webkit-box;
+ display: -webkit-flex;
display: flex;
+ -webkit-flex-wrap: wrap;
flex-wrap: wrap;
+ -webkit-align-content: flex-start;
align-content: flex-start;
}
- /* 绗�2-5鏍忎繚鎸佸崟鍒� */
.col-normal .patient-list {
+ display: -webkit-box;
+ display: -webkit-flex;
display: flex;
+ -webkit-box-orient: vertical;
+ -webkit-box-direction: normal;
+ -webkit-flex-direction: column;
flex-direction: column;
}
- /* 4. 鎮h�呴」鐩� - 鏋佺畝妯″紡 */
+ /* 鎮h�呴」鐩� */
.patient-item {
font-size: 22px;
padding: 8px 5px;
+ display: -webkit-box;
+ display: -webkit-flex;
display: flex;
+ -webkit-box-align: center;
+ -webkit-align-items: center;
align-items: center;
color: #fff;
line-height: 1.4;
}
- /* 銆愪紭鍖栦慨鏀广�戠1鏍忥細澧炲姞鍒楅棿璺濓紝鏀瑰杽鎷ユ尋鎰� */
#col-0 .patient-item {
width: 45%;
- /* 1. 缂╁噺瀹藉害锛屼负闂撮殧鐣欏嚭绌洪棿 */
font-size: 20px;
margin: 0 2.5%;
- /* 2. 娣诲姞宸﹀彸澶栬竟璺濓紝涓ゅ垪涔嬮棿鎬婚棿闅斾负5% */
}
.p-number {
@@ -154,6 +207,8 @@
}
.p-name {
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
@@ -167,11 +222,16 @@
margin-left: 5px;
}
- /* 5. 搴曢儴鏍� - 灞呬腑鏄剧ず */
+ /* 搴曢儴鏍� */
.bottom-footer {
+ display: -webkit-box;
+ display: -webkit-flex;
display: flex;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
justify-content: center;
- /* 灞呬腑 */
+ -webkit-box-align: center;
+ -webkit-align-items: center;
align-items: center;
padding: 10px 30px;
background: rgba(0, 30, 60, 0.9);
@@ -185,17 +245,16 @@
text-align: center;
}
- /* 婊氬姩鏉$編鍖� - 缁嗕竴鐐� */
+ /* 婊氬姩鏉� */
.patient-list::-webkit-scrollbar {
width: 4px;
}
-
.patient-list::-webkit-scrollbar-thumb {
background: #444;
border-radius: 2px;
}
- /* 6. 璋冭瘯妗嗘牱寮� */
+ /* 璋冭瘯闈㈡澘 */
.debug-panel {
position: fixed;
right: 15px;
@@ -212,8 +271,14 @@
}
.debug-header {
+ display: -webkit-box;
+ display: -webkit-flex;
display: flex;
+ -webkit-box-pack: justify;
+ -webkit-justify-content: space-between;
justify-content: space-between;
+ -webkit-box-align: center;
+ -webkit-align-items: center;
align-items: center;
padding: 5px;
background: #333;
@@ -235,6 +300,8 @@
}
.debug-body {
+ -webkit-box-flex: 1;
+ -webkit-flex: 1;
flex: 1;
padding: 5px;
overflow-y: auto;
@@ -264,14 +331,13 @@
<!-- 搴曢儴鏍� -->
<div class="bottom-footer">
- <!-- 娓╅Θ鎻愮ず璇眳涓� -->
<div class="footer-tip">娓╅Θ鎻愮ず锛氳鍚埌鍛煎彨鍚庡墠寰�瀵瑰簲璇婂</div>
</div>
<!-- 璋冭瘯闈㈡澘 -->
<div class="debug-panel" id="debugPanel">
<div class="debug-header">
- <span>馃洜锔� 杩愯鏃ュ織</span>
+ <span>[璋冭瘯] 杩愯鏃ュ織</span>
<button onclick="document.getElementById('debugBody').innerHTML=''">娓呯┖</button>
</div>
<div class="debug-body" id="debugBody"></div>
@@ -279,15 +345,18 @@
<script src="./static/jquery.min.js"></script>
<script>
- // ================= 璋冭瘯鏃ュ織鍑芥暟 =================
+ // ================= 璋冭瘯鏃ュ織 =================
function logDebug(msg) {
var now = new Date();
- var timeStr = now.getHours() + ':' + now.getMinutes() + ':' + now.getSeconds();
- var logHtml = '<div class="debug-line"><span class="debug-time">[' + timeStr + ']</span>' + msg + '</div>';
+ function pad(num) { return num < 10 ? '0' + num : '' + num; }
+ var timeStr = pad(now.getHours()) + ':' + pad(now.getMinutes()) + ':' + pad(now.getSeconds());
+ var logHtml = '<div class="debug-line"><span class="debug-time">[' + timeStr + ']</span> ' + msg + '</div>';
console.log("[" + timeStr + "] " + msg);
- var $body = $("#debugBody");
- $body.append(logHtml);
- $body.scrollTop($body[0].scrollHeight);
+ var body = document.getElementById("debugBody");
+ if (body) {
+ body.insertAdjacentHTML("beforeend", logHtml);
+ body.scrollTop = body.scrollHeight;
+ }
}
// ================= 搴旂敤鐘舵�� =================
@@ -295,7 +364,7 @@
columnTitles: ["甯歌蹇冪數鍥�", "鍔ㄦ�佸績鐢�", "骞虫澘杩愬姩蹇冪數", "椋熼亾鐢电敓鐞�", "鍔ㄨ剦纭寲鐩戞祴"],
columnSubTitles: ["搴婅竟蹇冪數鍥�(甯歌+棰戣氨)M / 蹇冪數鍚戦噺鍥綨", "鍔ㄦ�佽鍘婥", "", "", ""],
patients: [],
- apiBaseUrl: "http://192.168.3.12/admin-api",
+ apiBaseUrl: "http://192.168.100.110/admin-api",
pollTimer: null,
callRepeatTimes: 2,
spokenPatients: {},
@@ -308,28 +377,39 @@
if (appState.isSpeaking || appState.ttsQueue.length === 0) return;
appState.isSpeaking = true;
var text = appState.ttsQueue.shift();
- logDebug("馃攰 寮�濮嬫挱鎶�: " + text);
+ logDebug("[鎾姤] " + text);
var utterance = new SpeechSynthesisUtterance(text);
+ // Android 6 榛樿璇�熷彲鑳藉緢蹇紝閫傚綋璋冩參
+ utterance.rate = 0.85;
utterance.onend = function () {
appState.isSpeaking = false;
processTtsQueue();
};
- utterance.onerror = function () {
+ utterance.onerror = function (e) {
+ logDebug("[TTS閿欒] " + (e.error || "unknown"));
appState.isSpeaking = false;
processTtsQueue();
};
+ // 浼樺厛灏濊瘯璁惧鍘熺敓 TTS 鎺ュ彛
if (typeof wowjoy !== 'undefined' && typeof wowjoy.speek === 'function') {
try {
wowjoy.speek(text);
setTimeout(function () { appState.isSpeaking = false; processTtsQueue(); }, 4000);
return;
- } catch (e) { logDebug("鉂� wowjoy 璋冪敤澶辫触: " + e.message); }
+ } catch (e) { logDebug("[wowjoy澶辫触] " + e.message); }
}
- if (window.speechSynthesis) { window.speechSynthesis.speak(utterance); }
- else { appState.isSpeaking = false; processTtsQueue(); }
+ if (window.speechSynthesis) {
+ // Android 6 WebView 鏈夋椂闇�瑕佸厛 cancel 鍐� speak
+ window.speechSynthesis.cancel();
+ window.speechSynthesis.speak(utterance);
+ } else {
+ logDebug("[TTS] 娴忚鍣ㄤ笉鏀寔璇煶鍚堟垚");
+ appState.isSpeaking = false;
+ processTtsQueue();
+ }
}
function speak(text) {
@@ -338,10 +418,10 @@
processTtsQueue();
}
- // ================= 娓叉煋鍑芥暟 =================
+ // ================= 娓叉煋 =================
function renderMainContent() {
- var $main = $("#mainContent");
- $main.empty();
+ var main = document.getElementById("mainContent");
+ main.innerHTML = "";
for (var i = 0; i < appState.columnTitles.length; i++) {
var titleHtml = '<div class="col-title-line">' + appState.columnTitles[i] + '</div>';
@@ -350,24 +430,25 @@
}
var colClass = (i === 0) ? 'col-wide' : 'col-normal';
- // 娉ㄦ剰锛氳繖閲屼笉鍐嶇粰绗�1鏍忓姞 col-flex锛岀敱 CSS #col-0 寮哄埗鎺у埗
var colHtml = '<div class="column-box ' + colClass + '">' +
'<div class="col-title">' + titleHtml + '</div>' +
'<div class="patient-list" id="col-' + i + '"></div>' +
'</div>';
- $main.append(colHtml);
+ main.insertAdjacentHTML("beforeend", colHtml);
}
}
function renderPatients() {
for (var i = 0; i < appState.columnTitles.length; i++) {
- $("#col-" + i).empty();
+ var col = document.getElementById("col-" + i);
+ if (col) col.innerHTML = "";
}
for (var c = 0; c < appState.patients.length; c++) {
var colData = appState.patients[c];
if (Array.isArray(colData)) {
- var $col = $("#col-" + c);
+ var col = document.getElementById("col-" + c);
+ if (!col) continue;
for (var p = 0; p < colData.length; p++) {
var pat = colData[p];
var roomHtml = pat.roomName ? '<span class="p-room">(' + pat.roomName + ')</span>' : '';
@@ -376,7 +457,7 @@
'<span class="p-name">' + (pat.patName || '') + '</span>' +
roomHtml +
'</div>';
- $col.append(itemHtml);
+ col.insertAdjacentHTML("beforeend", itemHtml);
}
}
}
@@ -409,7 +490,7 @@
}
speak(repeatText);
appState.spokenPatients[newPat.patId] = true;
- logDebug("馃敂 鍔犲叆鎾姤闃熷垪: " + newPat.patName);
+ logDebug("[鎺掗槦] " + newPat.patName + " -> " + newPat.roomName);
}
}
}
@@ -437,26 +518,29 @@
appState.patients = dataList;
renderPatients();
- if (window.performance && window.performance.memory) {
- var usedMB = (window.performance.memory.usedJSHeapSize / 1048576).toFixed(2);
- logDebug("馃捑 鍐呭瓨: " + usedMB + " MB");
- }
+ // Android 6 WebView 閫氬父涓嶆敮鎸� performance.memory锛屽畨鍏ㄥ畧鍗�
+ try {
+ if (window.performance && window.performance.memory) {
+ var usedMB = (window.performance.memory.usedJSHeapSize / 1048576).toFixed(2);
+ logDebug("[鍐呭瓨] " + usedMB + " MB");
+ }
+ } catch (e) {}
},
error: function (err) {
- logDebug("鉂� 璇锋眰澶辫触: " + err.statusText);
+ logDebug("[璇锋眰澶辫触] " + (err.statusText || "缃戠粶閿欒"));
}
});
}
// ================= 鍒濆鍖� =================
- $(document).ready(function () {
+ function onReady() {
renderMainContent();
updateHeaderTime();
setInterval(updateHeaderTime, 1000);
fetchQueueData();
appState.pollTimer = setInterval(fetchQueueData, 5000);
- logDebug("鉁� 绯荤粺鍚姩");
- });
+ logDebug("[绯荤粺] 鍚姩瀹屾垚 - Android 6.0.1");
+ }
function updateHeaderTime() {
var now = new Date();
@@ -464,9 +548,19 @@
function padZero(num) { return num < 10 ? '0' + num : '' + num; }
var dateStr = now.getFullYear() + "骞�" + padZero(now.getMonth() + 1) + "鏈�" + padZero(now.getDate()) + "鏃� " + weekDays[now.getDay()];
var timeStr = padZero(now.getHours()) + ":" + padZero(now.getMinutes());
- $("#headerTime").text(dateStr + " " + timeStr);
+ var el = document.getElementById("headerTime");
+ if (el) el.textContent = dateStr + " " + timeStr;
+ }
+
+ // 鍏煎 DOM ready锛圓ndroid 6 鏌愪簺 WebView 鍙兘娌℃湁 $锛�
+ if (typeof $ !== 'undefined') {
+ $(document).ready(onReady);
+ } else if (document.readyState === 'complete' || document.readyState === 'interactive') {
+ setTimeout(onReady, 1);
+ } else {
+ document.addEventListener('DOMContentLoaded', onReady);
}
</script>
</body>
-</html>
\ No newline at end of file
+</html>
--
Gitblit v1.9.3