diff --git a/apps/frontend/src/App.tsx b/apps/frontend/src/App.tsx
index 90487e23..fb314618 100644
--- a/apps/frontend/src/App.tsx
+++ b/apps/frontend/src/App.tsx
@@ -163,6 +163,7 @@ export default function App() {
function DouyuFulfillmentApplication() {
useClearStrayHash()
+ useCustomerMobileViewport()
return (
}>
@@ -192,21 +193,7 @@ function OrderServiceApplication() {
function CustomerFulfillmentApplication() {
useClearStrayHash()
- /**
- * 客户履约页固定移动端:
- * 全局 base.css 给 body 设了 min-width:320px,worker.css 又用 overflow-x:hidden
- * 裁掉横向溢出。应用内浏览器/分屏/系统显示放大时,实际视口可能小于 320px,
- * 页面右侧(输入框、商品值、提示文案)会被直接裁掉。
- * 这里只给客户履约路由挂移动端根类,覆盖最小宽度,不影响后台与打手端。
- */
- useLayoutEffect(() => {
- document.documentElement.classList.add('customer-mobile-html')
- document.body.classList.add('customer-mobile-body')
- return () => {
- document.documentElement.classList.remove('customer-mobile-html')
- document.body.classList.remove('customer-mobile-body')
- }
- }, [])
+ useCustomerMobileViewport()
// 非标准子路径也按首段路径绑定平台,避免 /c/.../extra 这类地址绕过严格绑定。
const prefix = window.location.pathname.split('/').filter(Boolean)[0]
const wildcardPlatform = prefix === 'c' ? 'huya' : prefix === 'd' ? 'weibo' : undefined
@@ -387,6 +374,24 @@ function useClearStrayHash() {
}, [])
}
+/**
+ * 客户领取/履约页固定按移动端处理:
+ * 全局 base.css 给 body 设了 min-width:320px,worker.css 又用 overflow-x:hidden
+ * 裁掉横向溢出。应用内浏览器/分屏/系统显示放大时,实际视口可能小于 320px,
+ * 页面右侧(输入框、商品值、提示文案)会被直接裁掉。
+ * 这里只给客户页面路由挂移动端根类,覆盖最小宽度,不影响后台与打手端。
+ */
+function useCustomerMobileViewport() {
+ useLayoutEffect(() => {
+ document.documentElement.classList.add('customer-mobile-html')
+ document.body.classList.add('customer-mobile-body')
+ return () => {
+ document.documentElement.classList.remove('customer-mobile-html')
+ document.body.classList.remove('customer-mobile-body')
+ }
+ }, [])
+}
+
function WorkerApplication() {
return (
diff --git a/apps/frontend/src/pages/douyu-fulfillment/DouyuFulfillmentPage.tsx b/apps/frontend/src/pages/douyu-fulfillment/DouyuFulfillmentPage.tsx
index f7903aa7..1d80b102 100644
--- a/apps/frontend/src/pages/douyu-fulfillment/DouyuFulfillmentPage.tsx
+++ b/apps/frontend/src/pages/douyu-fulfillment/DouyuFulfillmentPage.tsx
@@ -413,15 +413,17 @@ export default function DouyuFulfillmentPage() {
{roleNameIssue ? : null}
{roleNameIssue || DOUYU_ROLE_NAME_FORMAT_HINT}
-
+
+
+
) : waitingForSupport ? (
diff --git a/apps/frontend/src/styles/customer/mobile.css b/apps/frontend/src/styles/customer/mobile.css
index ef7cb1c9..6e981401 100644
--- a/apps/frontend/src/styles/customer/mobile.css
+++ b/apps/frontend/src/styles/customer/mobile.css
@@ -13,6 +13,8 @@ body.customer-mobile-body {
width: 100%;
max-width: 100%;
overflow-x: hidden;
+ scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom));
+ -webkit-overflow-scrolling: touch;
}
body.customer-mobile-body #root {
diff --git a/apps/frontend/src/styles/customer/platform/douyu.css b/apps/frontend/src/styles/customer/platform/douyu.css
index ecfe79d7..d3acf1e9 100644
--- a/apps/frontend/src/styles/customer/platform/douyu.css
+++ b/apps/frontend/src/styles/customer/platform/douyu.css
@@ -555,6 +555,15 @@
font-weight: 700;
}
+.customer-douyu-submit-bar {
+ min-width: 0;
+ margin-top: 14px;
+}
+
+.customer-douyu-submit-bar .customer-collect-submit.ant-btn {
+ margin-top: 0;
+}
+
.customer-auth-page.is-douyu .customer-douyu-role-name-help {
display: flex;
align-items: flex-start;
@@ -589,3 +598,47 @@
border-color: #4a83ff !important;
background: #4a83ff !important;
}
+
+@media (max-width: 640px) {
+ /*
+ * Safari 的地址栏和底部工具栏会动态压缩可视区域。资料阶段必须由页面滚动承载,
+ * 不能把内容锁在 100vh 容器里;同时保留 dvh 和底部安全区,适配刘海屏与短屏。
+ */
+ .customer-auth-page.is-douyu:not(.is-compact) {
+ height: auto;
+ min-height: 100vh;
+ min-height: 100dvh;
+ overflow-x: hidden;
+ overflow-y: visible;
+ -webkit-overflow-scrolling: touch;
+ }
+
+ .customer-auth-page.is-douyu:not(.is-compact) .customer-auth-shell {
+ height: auto;
+ overflow: visible;
+ }
+
+ .customer-auth-page.is-douyu:not(.is-compact) .customer-auth-main {
+ padding-bottom: calc(40px + env(safe-area-inset-bottom));
+ }
+
+ .customer-auth-page.is-douyu:not(.is-compact) .customer-collect-body {
+ padding-bottom: calc(20px + env(safe-area-inset-bottom));
+ }
+
+ .customer-auth-page.is-douyu:not(.is-compact) .customer-douyu-submit-bar {
+ position: sticky;
+ bottom: 0;
+ z-index: 5;
+ margin-inline: -16px;
+ margin-top: 4px;
+ padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
+ background: linear-gradient(180deg, rgba(35, 41, 54, 0) 0%, #232936 28%, #232936 100%);
+ }
+
+ .customer-auth-page.is-douyu.is-compact .customer-binding-stage {
+ overflow-y: auto;
+ overscroll-behavior-y: contain;
+ -webkit-overflow-scrolling: touch;
+ }
+}
diff --git a/apps/frontend/tests/douyu-customer-mobile-layout.test.ts b/apps/frontend/tests/douyu-customer-mobile-layout.test.ts
new file mode 100644
index 00000000..270430f8
--- /dev/null
+++ b/apps/frontend/tests/douyu-customer-mobile-layout.test.ts
@@ -0,0 +1,44 @@
+import assert from 'node:assert/strict'
+import { readFile } from 'node:fs/promises'
+import test from 'node:test'
+
+function source(relativePath: string) {
+ return new URL(`../src/${relativePath}`, import.meta.url)
+}
+
+test('斗鱼客户页复用客户移动端根类,避免 iOS Safari 动态视口裁切', async () => {
+ const [app, css] = await Promise.all([
+ readFile(source('App.tsx'), 'utf8'),
+ readFile(source('styles/customer/mobile.css'), 'utf8'),
+ ])
+
+ assert.match(
+ app,
+ /function DouyuFulfillmentApplication\(\)\s*\{[^}]*useCustomerMobileViewport\(\)/s,
+ )
+ assert.match(
+ css,
+ /html\.customer-mobile-html,\s*body\.customer-mobile-body\s*\{[^}]*scroll-padding-bottom:/s,
+ )
+})
+
+test('斗鱼资料提交按钮在手机端保持可见且页面可滚动', async () => {
+ const [page, css] = await Promise.all([
+ readFile(source('pages/douyu-fulfillment/DouyuFulfillmentPage.tsx'), 'utf8'),
+ readFile(source('styles/customer/platform/douyu.css'), 'utf8'),
+ ])
+
+ assert.ok(page.includes('customer-douyu-submit-bar'))
+ assert.match(
+ css,
+ /\.customer-auth-page\.is-douyu:not\(\.is-compact\)\s*\{[^}]*min-height:\s*100dvh;[^}]*overflow-y:\s*visible/s,
+ )
+ assert.match(
+ css,
+ /\.customer-auth-page\.is-douyu:not\(\.is-compact\) \.customer-douyu-submit-bar\s*\{[^}]*position:\s*sticky;[^}]*bottom:\s*0;[^}]*env\(safe-area-inset-bottom\)/s,
+ )
+ assert.match(
+ css,
+ /\.customer-auth-page\.is-douyu\.is-compact \.customer-binding-stage\s*\{[^}]*overflow-y:\s*auto/s,
+ )
+})