diff --git a/app/src/main/assets/h5/css/app.css b/app/src/main/assets/h5/css/app.css index 41ef4df..facf780 100644 --- a/app/src/main/assets/h5/css/app.css +++ b/app/src/main/assets/h5/css/app.css @@ -483,6 +483,33 @@ body { color: var(--text-dim); } +/* 下载离线包图标(右下角,云端有离线包时显示) */ +/* Download-offline-package icon (bottom-right, shown when cloud has a package) */ +.wcell-dl { + position: absolute; + bottom: 6px; + right: 6px; + width: 26px; + height: 26px; + border-radius: 999px; + background: var(--glass-bg); + border: 1px solid var(--glass-border); + color: var(--accent); + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; +} + +.wcell-dl svg { + width: 14px; + height: 14px; +} + +.wcell-dl:active { + opacity: 0.6; +} + /* webAPP 顶栏:浮层玻璃条 + 标签面板 */ /* webapp topbar: floating glass bar + tab panel */ /* 前台有 webapp 时隐藏 webapp 列表内容,避免半透明顶栏透出列表控件 */ diff --git a/app/src/main/assets/h5/js/pages/webapplist.js b/app/src/main/assets/h5/js/pages/webapplist.js index 1eab162..0b9d6b2 100644 --- a/app/src/main/assets/h5/js/pages/webapplist.js +++ b/app/src/main/assets/h5/js/pages/webapplist.js @@ -29,6 +29,19 @@ window.loadWebAppList = async function () { tag.className = 'tag'; tag.textContent = a.offline ? '离线' : '在线'; btn.append(img, lbl, tag); + // 云端有离线包 → 加下载图标(点击自动拉取安装) + // Cloud has an offline package -> add a download icon (tap to auto-install) + if (a.offline) { + const dl = document.createElement('span'); + dl.className = 'wcell-dl'; + dl.title = '下载离线包'; + dl.innerHTML = ''; + dl.onclick = (e) => { + e.stopPropagation(); + bridge.call('updateOfflinePackage', a.id).then(() => refreshList()).catch(() => {}); + }; + btn.appendChild(dl); + } btn.onclick = () => bridge.call('openWebApp', btn.dataset.id); setupLongPress(btn, a); grid.appendChild(btn);