From 3057955ea46171fffbf621904cbe8d571372eed3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=B8=96=E7=9D=BF?= <2839904623@qq.com> Date: Thu, 2 Jul 2026 15:02:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20H5=20=E9=A1=B6=E6=A0=8F?= =?UTF-8?q?=E8=8E=AB=E5=90=8D=E4=B8=8B=E7=A7=BB22px:=E6=B8=85=E9=99=A4=20h?= =?UTF-8?q?ead=20=E9=87=8C=E5=AD=97=E4=BD=93=E6=B3=A8=E5=85=A5=E6=AE=8B?= =?UTF-8?q?=E7=95=99=E7=9A=84=20\x01=20=E6=8E=A7=E5=88=B6=E5=AD=97?= =?UTF-8?q?=E7=AC=A6(5=E9=A1=B5),=E5=B9=B6=E7=BB=9F=E4=B8=80=E5=8E=BB?= =?UTF-8?q?=E6=8E=89=20min-height:100vh=20:=20Co-Authored-By:=20Claude=20F?= =?UTF-8?q?able=205=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- h5/feedback/index.html | 4 ++-- h5/feedback_history/index.html | 8 ++++---- h5/mine/index.html | 6 ++++-- h5/records/index.html | 33 +++++++++++++++++++++------------ h5/reports/index.html | 11 +++++------ 5 files changed, 36 insertions(+), 26 deletions(-) diff --git a/h5/feedback/index.html b/h5/feedback/index.html index 37cd7c1..e20ffed 100644 --- a/h5/feedback/index.html +++ b/h5/feedback/index.html @@ -1,7 +1,7 @@ - + @@ -22,7 +22,7 @@ body { #feedback { position: absolute; inset: 0; display: flex; flex-direction: column; background: #F5F5F5; } /* header —— 返回 | 标题 | 反馈历史(原型 .header space-between;去框后顶部内距由 40 改 10,状态栏交给原生) */ -.header { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px 12px; background: #F5F5F5; flex-shrink: 0; position: relative; } +.header { display: flex; align-items: center; justify-content: space-between; height: 48px; padding: 0 16px; background: #F5F5F5; flex-shrink: 0; position: relative; } .btn-back { background: none; border: none; cursor: pointer; padding: 0; display: flex; align-items: center; } .btn-back svg { width: 24px; height: 24px; display: block; } .btn-back:active { opacity: .5; } diff --git a/h5/feedback_history/index.html b/h5/feedback_history/index.html index d1fc62f..ec8ab12 100644 --- a/h5/feedback_history/index.html +++ b/h5/feedback_history/index.html @@ -1,7 +1,7 @@ - + @@ -35,7 +35,7 @@ --font-num: 'DIN Alternate', 'DIN Pro', 'SF Pro Display', system-ui; } -html, body { height: 100%; } +html, body { height: 100%; overflow: hidden; } /* 【去框】原型 body 黑底 + flex 居中(浏览器预览用)→ 铺页面色、不居中。 */ body { font-family: 'PuHuiTi', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif; @@ -43,13 +43,13 @@ body { color: var(--color-ink); } /* 【去框】原型 .device 375x812 预览框 → 全屏自适应容器。 */ -.device { position: relative; width: 100%; height: 100%; min-height: 100vh; background: var(--color-surface-page); overflow: hidden; } +.device { position: relative; width: 100%; height: 100%; background: var(--color-surface-page); overflow: hidden; } .screen { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; } /* 隐藏原型假状态栏(顶部状态栏交给原生) */ .statusbar { display: none; } -.topnav { height: 44px; display: flex; align-items: center; padding: 0 12px; background: var(--color-surface-page); flex-shrink: 0; position: relative; } +.topnav { height: 48px; display: flex; align-items: center; padding: 0 12px; background: var(--color-surface-page); flex-shrink: 0; position: relative; } .topnav-back { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; background: none; border: none; padding: 0; } .topnav-back:active { opacity: .5; } .topnav-title { position: absolute; left: 50%; transform: translateX(-50%); font-size: 17px; font-weight: 600; color: var(--color-ink); } diff --git a/h5/mine/index.html b/h5/mine/index.html index 5eafa9d..78a1e8c 100644 --- a/h5/mine/index.html +++ b/h5/mine/index.html @@ -4,7 +4,7 @@ - + @@ -4685,6 +4685,8 @@ let isLoggedIn = (window.SGBridge ? !!SGBridge.getAuthState().loggedIn // ===== webview 改造(阶段0):我的页真实数据接入 ===== // 战绩卡(累计可省/完成比价/赚取金币)从 app-server 真接口拉;无桥/无后端环境静默降级,保留原型 mock 展示。 function sgFmtYuan(cents){ return (Number(cents||0)/100).toLocaleString('zh-CN',{minimumFractionDigits:2,maximumFractionDigits:2}); } +// 把"1,287.50"拆成 整数(大/粗,继承 .prof-amount)+ .50(小, 对齐原型) +function sgYuanHtml(cents){ var y=sgFmtYuan(cents), d=y.lastIndexOf('.'); return d>=0 ? y.slice(0,d)+''+y.slice(d)+'' : y; } // 【临时调试浮层 — 诊断数据接通,定位后删】顶部黑条显示登录态/token/各接口结果 // sgDbg:诊断输出改走 console.log → WebChromeClient 落 logcat "[H5]",不再在屏上画黑底绿字浮层。 // (顶部满屏后该浮层会顶到屏幕最上沿露脸;排 #1「数据没显示」仍可凭 logcat 里的 [sgDbg] 行诊断。) @@ -4710,7 +4712,7 @@ function loadMineData(){ sgDbg('compare/stats OK compare_count='+(s&&s.compare_count)+' discovered_saved='+(s&&s.discovered_saved_cents)); if(!s) return; var amt=document.querySelector('#profSavingsCard .prof-amount'); - if(amt) amt.innerHTML='¥'+sgFmtYuan(s.discovered_saved_cents); + if(amt) amt.innerHTML='¥'+sgYuanHtml(s.discovered_saved_cents); var nums=document.querySelectorAll('#profSavingsCard .prof-stat-num'); // [0]领券 [1]完成比价 [2]赚取金币 if(nums[1]) nums[1].innerHTML=(s.compare_count||0)+''; if(typeof applySavingsLock==='function') applySavingsLock((s.compare_count||0)===0); diff --git a/h5/records/index.html b/h5/records/index.html index f4c4e57..5d53b09 100644 --- a/h5/records/index.html +++ b/h5/records/index.html @@ -1,7 +1,7 @@ - + @@ -37,7 +37,7 @@ } * { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; } -html, body { height: 100%; } +html, body { height: 100%; overflow: hidden; } /* 【去框】原型 body 是黑底 + flex 居中(浏览器预览用)。WebView 里直接铺页面色、不居中。 */ body { font-family: 'PuHuiTi', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif; @@ -47,15 +47,15 @@ body { /* 【去框】原型 .device 是 375x812 的手机预览框(圆角 + 阴影 + 固定宽高)。 WebView 里改成全屏自适应容器:满宽、最少占满视口高、无圆角/阴影。 */ -.device { position: relative; width: 100%; height: 100%; min-height: 100vh; background: #F5F5F5; overflow: hidden; } +.device { position: relative; width: 100%; height: 100%; background: #F5F5F5; overflow: hidden; } /* status bar —— App 顶部有原生状态栏/标题栏,这里隐藏原型自带的假状态栏 */ .status-bar { display: none; } /* header —— 标题居中 + 右侧搜索按钮 */ -.hist-header { height: 44px; background: #F5F5F5; display: flex; align-items: center; justify-content: center; padding: 0 16px; position: relative; } +.hist-header { height: 48px; background: #F5F5F5; display: flex; align-items: center; justify-content: center; padding: 0 16px; position: relative; } .hist-header-title { font-size: 17px; font-weight: 600; color: var(--color-ink); } -.hist-header-back { display: none; position: absolute; left: 0; top: 0; width: 44px; height: 44px; align-items: center; justify-content: center; background: transparent; border: none; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; } +.hist-header-back { display: none; position: absolute; left: 0; top: 0; width: 44px; height: 48px; align-items: center; justify-content: center; background: transparent; border: none; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; } .hist-header-back:active { opacity: .5; } .hist-header-back svg { width: 24px; height: 24px; display: block; } .hist-header-search { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; } @@ -70,14 +70,14 @@ body { /* scroll area —— 【去框】原型用 absolute + 顶/底偏移定位(top:132 = header44+filter44+留白;bottom:60 = 给原生 tab-bar 留位)。 WebView 隐藏了底部 tab-bar,故 bottom 改 0。其余偏移沿用原型不动。 */ -.hist-scroll { position: absolute; top: 88px; left: 0; right: 0; bottom: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; padding: 8px 12px 24px; } +.hist-scroll { position: absolute; top: 92px; left: 0; right: 0; bottom: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; padding: 8px 12px 24px; } .device.profile-entry .hist-header-back { display: flex; } .device.profile-entry .hist-scroll { bottom: 0; padding-bottom: 32px; } .device.profile-entry .tab-bar { display: none; } .device.profile-entry.logged-out .hist-empty-logout { bottom: 0; } /* 顶部筛选 tab(仿淘宝订单页 tab + 下划线) */ -.hist-filter { position: absolute; left: 0; right: 0; top: 44px; height: 44px; display: flex; align-items: center; padding: 0 16px; gap: 22px; background: #F5F5F5; z-index: 2; } +.hist-filter { position: absolute; left: 0; right: 0; top: 48px; height: 44px; display: flex; align-items: center; padding: 0 16px; gap: 22px; background: #F5F5F5; z-index: 2; } /* tab 字号字重对齐店名 15/600,激活态只改颜色 + 黄下划线,不改字号字重(避免跳字) */ .hist-filter-tab { font-size: 15px; color: var(--color-ink-muted); font-weight: 600; cursor: pointer; position: relative; height: 44px; line-height: 44px; padding: 0 2px; transition: color .15s ease; } .hist-filter-tab:active { opacity: .6; } @@ -265,7 +265,7 @@ body.transitioning-tab { /* no animation */ } /* ============ 未登录态:骨架模糊 + 居中登录卡(保留 tab / 上报 / 搜索骨架,点任意元素引导登录,不展示任何真实数据) ============ */ /* 骨架占位列表(模糊处理,不是真实记录)—— 【去框】bottom 60→0(无原生 tab-bar 占位) */ -.hist-logout-skeleton { display: none; position: absolute; top: 88px; left: 0; right: 0; bottom: 0; overflow: hidden; padding: 8px 12px 24px; filter: blur(3px); pointer-events: none; } +.hist-logout-skeleton { display: none; position: absolute; top: 92px; left: 0; right: 0; bottom: 0; overflow: hidden; padding: 8px 12px 24px; filter: blur(3px); pointer-events: none; } .device.logged-out .hist-logout-skeleton { display: block; } .hist-sk-item { background: #FFFFFF; border-radius: 14px; padding: 14px; margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.04); } .hist-sk-line { height: 12px; border-radius: 6px; background: linear-gradient(90deg,#ECECEC 0%,#F4F4F4 50%,#ECECEC 100%); } @@ -276,10 +276,10 @@ body.transitioning-tab { /* no animation */ } .hist-sk-cells { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 14px; } .hist-sk-cell { height: 46px; border-radius: 10px; background: linear-gradient(90deg,#EEE 0%,#F6F6F6 50%,#EEE 100%); border: .5px solid #ECECEC; } /* 半透明蒙层,压住骨架,提示"锁定" —— 【去框】bottom 60→0 */ -.hist-logout-scrim { display: none; position: absolute; top: 88px; left: 0; right: 0; bottom: 0; background: rgba(245,245,245,.45); z-index: 6; cursor: pointer; } +.hist-logout-scrim { display: none; position: absolute; top: 92px; left: 0; right: 0; bottom: 0; background: rgba(245,245,245,.45); z-index: 6; cursor: pointer; } .device.logged-out .hist-logout-scrim { display: block; } /* 居中登录卡容器:本身不拦点击(让 tab / 上报 / 骨架区的点击穿透到下层引导登录),只有卡片可点 —— 【去框】bottom 60→0 */ -.hist-empty-logout { display: none; position: absolute; top: 44px; left: 0; right: 0; bottom: 0; align-items: center; justify-content: center; padding: 0 24px; z-index: 8; pointer-events: none; } +.hist-empty-logout { display: none; position: absolute; top: 48px; left: 0; right: 0; bottom: 0; align-items: center; justify-content: center; padding: 0 24px; z-index: 8; pointer-events: none; } .hist-login-card { pointer-events: auto; } .device.logged-out .hist-empty-logout { display: flex; } .device.logged-out .hist-scroll { display: none; } @@ -316,11 +316,11 @@ body.transitioning-tab { /* no animation */ } .device.selecting .hist-header-search { display: none; } .device.selecting .hist-header-title { font-size: 0; } .device.selecting .hist-header-title::before { content: '选择一条记录上报'; font-size: 17px; font-weight: 600; color: var(--color-ink); } -.select-task-panel { display: none; position: absolute; left: 0; right: 0; top: 44px; padding: 8px 16px 6px; background: #F5F5F5; z-index: 2; } +.select-task-panel { display: none; position: absolute; left: 0; right: 0; top: 48px; padding: 8px 16px 6px; background: #F5F5F5; z-index: 2; } .select-task-panel .fb-task-card { margin: 0; } .device.selecting .select-task-panel { display: block; } /* 【去框】单选态滚动区 bottom 76→0(action bar 改为 fixed 浮在视口底) */ -.device.selecting .hist-scroll { top: 154px; bottom: 0; padding-bottom: 92px; } +.device.selecting .hist-scroll { top: 158px; bottom: 0; padding-bottom: 92px; } /* 单选模式顶部 3 步指引 */ .device.selecting .tab-bar { display: none; } @@ -1068,6 +1068,15 @@ function goBackToProfile() { else { console.log('[nav stub] goBackToProfile(浏览器预览)'); } } +// 系统返回(REPORT_FLOW 开 backToH5 时由原生委托到此):上报表单(步骤2)→ 关表单回选记录(步骤1); +// 选记录态(从我的进)→ 退回我的;其余 → 关页。与表单自身返回键 closeFeedbackSheet 行为一致。 +window.onBack = function () { + var sheet = document.getElementById('fbSheet'); + if (sheet && sheet.classList.contains('show')) { closeFeedbackSheet(); return; } + if (cameFromProfile) { goBackToProfile(); return; } + if (window.SGBridge && SGBridge.closePage) { SGBridge.closePage(); } +}; + // 导航占位:原型内部跳转(home/profile/reports/welfare/comparing…)在 App 里走不通,统一打 log function navigateStub(id) { console.log('[nav stub] go("' + id + '")(App 内由原生处理,H5 不跳转)'); diff --git a/h5/reports/index.html b/h5/reports/index.html index f39e235..d5d8263 100644 --- a/h5/reports/index.html +++ b/h5/reports/index.html @@ -1,7 +1,7 @@ - + @@ -9,8 +9,9 @@