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 ?