Commit 64da3cdc by liimin

refactor(layout): 重构布局适配系统并优化权益页面样式

- 移除旧的分散式适配文件,统一到services/adapter目录
- 新增LayoutRoot组件的适配类绑定功能
- 集成分辨率配置服务和CSS类名动态应用
- 将权益页面样式拆分为通用、横屏、竖屏三个SCSS文件
- 为权益页面添加响应式轮播图高度计算逻辑
- 优化横屏大屏设备下的UI元素尺寸和间距适配
1 parent 164a7c97
...@@ -66,20 +66,7 @@ export default { ...@@ -66,20 +66,7 @@ export default {
/* 引入自定义 CSS 工具类 */ /* 引入自定义 CSS 工具类 */
@import url("./common.css"); @import url("./common.css");
/* I18n 布局适配:横竖屏 + 分辨率 */ /* I18n 布局适配:横竖屏 + 分辨率 */
@import "./adapt/landscape/1080/home-frame.scss"; @import "./services/adapter/styles/layout-adapt.scss";
@import "./adapt/landscape/1920/home-frame.scss";
@import "./adapt/portrait/1080/home-frame.scss";
@import "./adapt/portrait/1920/home-frame.scss";
@import "./adapt/landscape/1080/boutique-index.scss";
@import "./adapt/landscape/1920/boutique-index.scss";
@import "./adapt/portrait/1080/boutique-index.scss";
@import "./adapt/portrait/1920/boutique-index.scss";
@import "./adapt/landscape/1080/login.scss";
@import "./adapt/landscape/1920/login.scss";
@import "./adapt/portrait/1080/login.scss";
@import "./adapt/portrait/1920/login.scss";
@import "./adapt/portrait/1080/account-items.scss";
@import "./adapt/portrait/1920/account-items.scss";
/* 全局默认样式:App 端 view 不支持 font-size,基准字号用 var(--l-font-*) 落在 <text> 上 */ /* 全局默认样式:App 端 view 不支持 font-size,基准字号用 var(--l-font-*) 落在 <text> 上 */
.layout-root { .layout-root {
......
/* 精品页 横屏 1080 档位适配
* 目前主要依赖全局 spacing/font/radius 变量,这里预留结构,后续可按需补充页面级变量
*/
.mode-landscape.res-1080 {
/* 示例:可在此处为精品页单独定义变量,例如:
* --boutique-card-height: 200px;
*/
}
/* HomeFrame 横屏 1080 档位适配 */
.home-frame-container.mode-landscape.res-1080 {
/* 对应 layout-vars.uts 中 1024/1174 档的值 */
--l-content-left-width: 605px;
--l-module-box-height: 332px;
--l-tool-box-min-height: 120px;
--l-common-title-height: 60px;
}
/* 登录选择账号页 横屏 1080 档位适配
* 通过 LayoutRoot 上的 .mode-landscape.res-1080 类控制,仅在横屏 1080 档时生效。
*/
.mode-landscape.res-1080 {
/* 示例:可根据登录页设计调整根容器
* .page-container {
* padding: 0 var(--l-spacing-lg);
* }
*/
}
/* 精品页 横屏 1920 档位适配(预留) */
.mode-landscape.res-1920 {
/* 示例:后续可在此定义 1920 档变量 */
}
/* HomeFrame 横屏 1920 档位适配 */
.home-frame-container.mode-landscape.res-1920 {
/* 对应 layout-vars.uts 中 1920 档的值 */
--l-content-left-width: 1134px;
--l-module-box-height: 623px;
--l-tool-box-min-height: 225px;
--l-common-title-height: 113px;
}
/* 登录选择账号页 横屏 1920 档位适配
* 大屏(如 1920 宽度)下,可在此增加更宽松的留白和布局。
*/
.mode-landscape.res-1920 {
/* 示例:后续按实际设计稿补充
* .page-container {
* max-width: 1600px;
* margin: 0 auto;
* }
*/
}
/* 账号选择页 竖屏 1080 档位适配
* 典型手机竖屏场景(如 360 x 800 等宽度归为 1080 档)。
* 通过 .account-page 避免影响其他页面。
*/
.mode-portrait.res-1080 .account-page {
.layout {
padding-top: 48px;
padding-bottom: 24px;
}
.content-box {
top: 120px;
bottom: 48px;
width: 94%;
border-radius: 16px;
}
.step-box {
transform: scale(0.9);
}
/* 竖屏下账号/门店列表:一行一个,撑满宽度 */
.box {
padding: 0 16px;
justify-content: flex-start;
}
.box .items {
width: 100%;
margin-bottom: 16px;
}
}
/* 精品页 竖屏 1080 档位适配
* 使用 LayoutRoot 提供的 mode/res class:
* - .mode-portrait.res-1080
* 可在此范围内定制精品页在竖屏手机上的布局与尺寸。
*/
.mode-portrait.res-1080 {
/* 精品首页竖屏下“开始接待”区域适配,降低高度避免图片拉伸感 */
.start {
height: 96px;
// padding-top: 24px;
}
}
/* HomeFrame 竖屏 1080 档位适配
* 注意:数值暂时复用横屏 1080 档,后续可根据你的竖屏设计稿单独调整
*/
.home-frame-container.mode-portrait.res-1080 {
--l-content-left-width: 605px;
--l-module-box-height: 332px;
--l-tool-box-min-height: 120px;
--l-common-title-height: 60px;
}
/* 账号选择页 竖屏 1920 档位适配(预留)
* 如后续有竖屏大屏需求,可在此补充。
*/
.mode-portrait.res-1920 .account-page {
}
/* 精品页 竖屏 1920 档位适配(预留)
* 当前大屏场景通常为横屏,此处作为扩展占位。
*/
.mode-portrait.res-1920 {
/* 根据后续竖屏大屏设计补充 */
}
/* HomeFrame 竖屏 1920 档位适配
* 注意:数值暂时复用横屏 1920 档,后续可根据你的竖屏设计稿单独调整
*/
.home-frame-container.mode-portrait.res-1920 {
--l-content-left-width: 1134px;
--l-module-box-height: 623px;
--l-tool-box-min-height: 225px;
--l-common-title-height: 113px;
}
/* 登录选择账号页 竖屏 1920 档位适配(预留)
* 如后续有竖屏大屏设备需求,可在此补充。
*/
.mode-portrait.res-1920 {
/* 预留占位,不影响现有布局 */
}
<template> <template>
<view class="layout-root" :class="[modeClass, resolutionClass]" :style="styleObj"> <view class="layout-root" :class="[modeClass, resolutionClass, adapterClass]" :style="styleObj">
<slot></slot> <slot></slot>
</view> </view>
</template> </template>
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
<script setup lang="uts"> <script setup lang="uts">
import { computed, type Ref } from 'vue' import { computed, type Ref } from 'vue'
import { useLayout } from '@/composables/useLayout' import { useLayout } from '@/composables/useLayout'
import { resolutionState, useResolutionConfig } from '@/services/adapter/index.uts'
import { layoutService } from '@/services/LayoutService.uts' import { layoutService } from '@/services/LayoutService.uts'
const layout = useLayout() const layout = useLayout()
...@@ -16,17 +17,27 @@ const styleObj = computed((): UTSJSONObject => { ...@@ -16,17 +17,27 @@ const styleObj = computed((): UTSJSONObject => {
const r = rawCssVars const r = rawCssVars
if (r == null) return {} if (r == null) return {}
const v = r.value const v = r.value
console.log(11111111111,v != null ? v : {})
return v != null ? v : {} return v != null ? v : {}
}) })
useResolutionConfig()
const adapterClass = computed((): string => {
const cls = resolutionState.cssClass
return cls != null ? cls : ''
})
const modeClass = computed((): string => { const modeClass = computed((): string => {
const modeRef = layoutService.getCurrentMode() const modeRef = layoutService.getCurrentMode()
const m = modeRef.value const m = modeRef.value
console.log(22222222222,m == 'portrait' ? 'mode-portrait' : 'mode-landscape')
return m == 'portrait' ? 'mode-portrait' : 'mode-landscape' return m == 'portrait' ? 'mode-portrait' : 'mode-landscape'
}) })
const resolutionClass = computed((): string => { const resolutionClass = computed((): string => {
const bucket = layoutService.getResolutionBucket() const bucket = layoutService.getResolutionBucket()
console.log(333333333333333,`res-${bucket}`)
return `res-${bucket}` return `res-${bucket}`
}) })
</script> </script>
......
<template> <template>
<layout-root> <layout-root>
<view class="page-container fade-in"> <view class="page-container equity-page fade-in">
<HomeFrame ref="homeRef" <HomeFrame ref="homeRef"
:show-footer="true" :show-footer="true"
:swiper-custom="true" :swiper-custom="true"
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
:autoplay="moduleList.length > 1" :autoplay="moduleList.length > 1"
:circular="moduleList.length > 1" :circular="moduleList.length > 1"
:indicator="false" :indicator="false"
height="220" :height="equitySwiperHeight"
@change="(e: number) => onSwiperChange(e)" @change="(e: number) => onSwiperChange(e)"
@click="(e: number) => onEquitySlideTap(e)" @click="(e: number) => onEquitySlideTap(e)"
></un-swiper> ></un-swiper>
...@@ -67,6 +67,7 @@ import { getCarBrandsListApi, getEmployeeListApi, getMerchantCarBrandList } from ...@@ -67,6 +67,7 @@ import { getCarBrandsListApi, getEmployeeListApi, getMerchantCarBrandList } from
import { getMockData, getSoureData } from "@/api/system-api.uts"; import { getMockData, getSoureData } from "@/api/system-api.uts";
import BannerSkeleton from "@/components/Skeleton/BannerSkeleton.uvue"; import BannerSkeleton from "@/components/Skeleton/BannerSkeleton.uvue";
import HomeFrame from "@/components/HomeFrame/index.uvue"; import HomeFrame from "@/components/HomeFrame/index.uvue";
import { layoutService } from "@/services/LayoutService.uts";
import { dispatch, state } from "@/store/index.uts"; import { dispatch, state } from "@/store/index.uts";
// import { onLoad, onShow } from '@dcloudio/uni-app' // import { onLoad, onShow } from '@dcloudio/uni-app'
import { storage } from "@/utils/storage.uts"; import { storage } from "@/utils/storage.uts";
...@@ -81,6 +82,11 @@ const currentSwiperIndex = ref<number>(0); ...@@ -81,6 +82,11 @@ const currentSwiperIndex = ref<number>(0);
const EQUITY_SWIPER_PLACEHOLDER = "/static/images/login/nothing.webp"; const EQUITY_SWIPER_PLACEHOLDER = "/static/images/login/nothing.webp";
const equitySwiperHeight = computed((): number => {
const isLandscape = !layoutService.isMode("portrait");
return isLandscape && layoutService.getResolutionBucket() == "1920" ? 320 : 220;
});
function normalizeModuleItem(item: any): UTSJSONObject { function normalizeModuleItem(item: any): UTSJSONObject {
const obj = item as UTSJSONObject; const obj = item as UTSJSONObject;
const detailTitle = const detailTitle =
...@@ -562,284 +568,7 @@ onShow(() => { ...@@ -562,284 +568,7 @@ onShow(() => {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.page-container { @import "./styles/common.scss";
width: 100%; @import "./styles/landscape.scss";
height: 100%; @import "./styles/portrait.scss";
background: linear-gradient(180deg, #edf4ff 0%, #f4f8ff 36%, #f8fafd 100%);
}
.swiper-loading {
width: 100%;
height: 100%;
padding: 12px;
box-sizing: border-box;
}
.swiper-custom-wrap {
width: 100%;
height: 100%;
position: relative;
padding: 0;
box-sizing: border-box;
}
.swiper-custom-content {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
border-radius: 16px;
background: rgba(255, 255, 255, 0.86);
box-shadow: 0 12px 32px rgba(15, 23, 42, 0.10);
overflow: hidden;
}
.equity-hero-head {
width: 100%;
height: 40px;
padding: 0 10px;
box-sizing: border-box;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid rgba(226, 236, 248, 0.8);
background: linear-gradient(135deg, rgba(248, 251, 255, 0.95) 0%, rgba(240, 246, 255, 0.95) 100%);
}
.hero-title-wrap {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
}
.hero-eyebrow {
font-size: 10px;
color: #8ea0ba;
line-height: 12px;
}
.hero-title {
margin-top: 0;
font-size: 14px;
font-weight: 700;
color: #1e293b;
line-height: 18px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.hero-indicator-pill {
height: 22px;
min-width: 44px;
padding: 0 8px;
border-radius: 13px;
background: #e9f1ff;
border: 1px solid #cfe0f8;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
}
.hero-indicator-text {
font-size: 11px;
font-weight: 600;
color: #2a5ecf;
}
.equity-swiper-stack {
flex: 1;
width: 100%;
min-height: 0;
position: relative;
padding: 0;
box-sizing: border-box;
}
.equity-swiper {
width: 100%;
height: 100%;
border-radius: 10px;
overflow: hidden;
box-shadow: 0 8px 18px rgba(15, 23, 42, 0.10);
}
.equity-swiper-overlay {
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
z-index: 10;
pointer-events: none;
display: flex;
flex-direction: column;
justify-content: flex-end;
background-image: linear-gradient(to top, rgba(30, 58, 138, 0.56) 0%, rgba(30, 58, 138, 0.0) 26%);
border-radius: 10px;
}
.swiper-dots {
position: absolute;
left: 0;
right: 0;
bottom: 2px;
display: flex;
flex-direction: row;
justify-content: center;
padding: 0;
}
.dot {
width: 5px;
height: 5px;
border-radius: 3px;
background: rgba(255, 255, 255, 0.42);
margin: 0 3px;
transition: all 0.3s ease;
}
.dot.active {
width: 14px;
background: rgba(255, 255, 255, 0.95);
}
.swiper-empty {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
box-sizing: border-box;
}
.empty-card {
margin: auto;
width: 70%;
min-height: 118px;
border-radius: 18px;
background: rgba(255, 255, 255, 0.86);
box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
border: 1px solid #e3ecf8;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.empty-title {
font-size: 16px;
font-weight: 600;
color: #1e293b;
margin-bottom: 6px;
}
.empty-text {
font-size: 13px;
color: #94a3b8;
}
.page-container :deep(.right-content-box) {
padding: 6px 0 var(--l-spacing-2xl);
}
.page-container :deep(.module-box) {
margin-bottom: 10px;
}
.page-container :deep(.module-box .common-title),
.page-container :deep(.tool-box .common-title) {
height: 44px;
padding-left: 14px;
}
.page-container :deep(.module-box .title-text),
.page-container :deep(.tool-box .title-text) {
font-size: 15px;
font-weight: 600;
color: #1e293b;
}
.page-container :deep(.module-box .content-box) {
padding: 0 2px 2px;
}
.page-container :deep(.tool-box) {
background: rgba(255, 255, 255, 0.9);
border: 1px solid #deebfb;
box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
flex: 1.25;
min-height: 0;
}
.page-container :deep(.tool-box .common-title) {
border-bottom: 1px solid #e6eef9;
background: linear-gradient(135deg, rgba(243, 248, 255, 0.95) 0%, rgba(236, 244, 255, 0.95) 100%);
}
.page-container :deep(.tool-box .content-box) {
flex: 1;
min-height: 0;
padding: 6px 10px 8px;
overflow-y: auto;
overflow-x: hidden;
display: block;
}
.page-container :deep(.tool-box .content-box > *) {
width: 100%;
max-width: 100%;
margin-left: auto;
margin-right: auto;
}
.page-container :deep(.tool-box .content-box .entrance-list) {
justify-content: space-between;
align-content: flex-start;
width: 100%;
padding: 0;
box-sizing: border-box;
}
.page-container :deep(.tool-box .content-box .entrance-item) {
width: 31.5%;
margin-right: 0;
margin-left: 0;
margin-bottom: 14px;
}
.page-container :deep(.tool-box .content-box .entrance-box) {
height: auto;
}
.page-container :deep(.tool-box .content-box .entrance-item-compact) {
margin-bottom: 10px;
}
.page-container :deep(.tool-box .content-box .entrance-icon-compact) {
width: 40px;
height: 40px;
}
.page-container :deep(.tool-box .content-box .entrance-name-compact) {
font-size: 11px;
margin-top: 3px;
}
.detail-content {
width: 100%;
height: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.detail-title {
font-size: 24px;
color: #333;
}
</style> </style>
.page-container {
width: 100%;
height: 100%;
background: linear-gradient(180deg, #edf4ff 0%, #f4f8ff 36%, #f8fafd 100%);
}
.swiper-loading {
width: 100%;
height: 100%;
padding: 12px;
box-sizing: border-box;
}
.swiper-custom-wrap {
width: 100%;
height: 100%;
position: relative;
padding: 0;
box-sizing: border-box;
}
.swiper-custom-content {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
border-radius: 16px;
background: rgba(255, 255, 255, 0.86);
box-shadow: 0 12px 32px rgba(15, 23, 42, 0.10);
overflow: hidden;
}
.equity-hero-head {
width: 100%;
height: 40px;
padding: 0 10px;
box-sizing: border-box;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid rgba(226, 236, 248, 0.8);
background: linear-gradient(135deg, rgba(248, 251, 255, 0.95) 0%, rgba(240, 246, 255, 0.95) 100%);
}
.hero-title-wrap {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
}
.hero-eyebrow {
font-size: 10px;
color: #8ea0ba;
line-height: 12px;
}
.hero-title {
margin-top: 0;
font-size: 14px;
font-weight: 700;
color: #1e293b;
line-height: 18px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.hero-indicator-pill {
height: 22px;
min-width: 44px;
padding: 0 8px;
border-radius: 13px;
background: #e9f1ff;
border: 1px solid #cfe0f8;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
}
.hero-indicator-text {
font-size: 11px;
font-weight: 600;
color: #2a5ecf;
}
.equity-swiper-stack {
flex: 1;
width: 100%;
min-height: 0;
position: relative;
padding: 0;
box-sizing: border-box;
}
.equity-swiper {
width: 100%;
height: 100%;
border-radius: 10px;
overflow: hidden;
box-shadow: 0 8px 18px rgba(15, 23, 42, 0.10);
}
.equity-swiper-overlay {
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
z-index: 10;
pointer-events: none;
display: flex;
flex-direction: column;
justify-content: flex-end;
background-image: linear-gradient(to top, rgba(30, 58, 138, 0.56) 0%, rgba(30, 58, 138, 0.0) 26%);
border-radius: 10px;
}
.swiper-dots {
position: absolute;
left: 0;
right: 0;
bottom: 2px;
display: flex;
flex-direction: row;
justify-content: center;
padding: 0;
}
.dot {
width: 5px;
height: 5px;
border-radius: 3px;
background: rgba(255, 255, 255, 0.42);
margin: 0 3px;
transition: all 0.3s ease;
}
.dot.active {
width: 14px;
background: rgba(255, 255, 255, 0.95);
}
.swiper-empty {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
box-sizing: border-box;
}
.empty-card {
margin: auto;
width: 70%;
min-height: 118px;
border-radius: 18px;
background: rgba(255, 255, 255, 0.86);
box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
border: 1px solid #e3ecf8;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.empty-title {
font-size: 16px;
font-weight: 600;
color: #1e293b;
margin-bottom: 6px;
}
.empty-text {
font-size: 13px;
color: #94a3b8;
}
.page-container :deep(.right-content-box) {
padding: 6px 0 var(--l-spacing-2xl);
}
.page-container :deep(.module-box) {
margin-bottom: 10px;
}
.page-container :deep(.module-box .common-title),
.page-container :deep(.tool-box .common-title) {
height: 44px;
padding-left: 14px;
}
.page-container :deep(.module-box .title-text),
.page-container :deep(.tool-box .title-text) {
font-size: 15px;
font-weight: 600;
color: #1e293b;
}
.page-container :deep(.module-box .content-box) {
padding: 0 2px 2px;
}
.page-container :deep(.tool-box) {
background: rgba(255, 255, 255, 0.9);
border: 1px solid #deebfb;
box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
flex: 1.25;
min-height: 0;
}
.page-container :deep(.tool-box .common-title) {
border-bottom: 1px solid #e6eef9;
background: linear-gradient(135deg, rgba(243, 248, 255, 0.95) 0%, rgba(236, 244, 255, 0.95) 100%);
}
.page-container :deep(.tool-box .content-box) {
flex: 1;
min-height: 0;
padding: 6px 10px 8px;
overflow-y: auto;
overflow-x: hidden;
display: block;
}
.page-container :deep(.tool-box .content-box > *) {
width: 100%;
max-width: 100%;
margin-left: auto;
margin-right: auto;
}
.page-container :deep(.tool-box .content-box .entrance-list) {
justify-content: space-between;
align-content: flex-start;
width: 100%;
padding: 0;
box-sizing: border-box;
}
.page-container :deep(.tool-box .content-box .entrance-item) {
width: 31.5%;
margin-right: 0;
margin-left: 0;
margin-bottom: 14px;
}
.page-container :deep(.tool-box .content-box .entrance-box) {
height: auto;
}
.page-container :deep(.tool-box .content-box .entrance-item-compact) {
margin-bottom: 10px;
}
.page-container :deep(.tool-box .content-box .entrance-icon-compact) {
width: 40px;
height: 40px;
}
.page-container :deep(.tool-box .content-box .entrance-name-compact) {
font-size: 11px;
margin-top: 3px;
}
.detail-content {
width: 100%;
height: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.detail-title {
font-size: 24px;
color: #333;
}
.layout-landscape-1920x1080 .equity-page {
.swiper-custom-content {
border-radius: 24px;
}
.equity-hero-head {
height: 64px;
padding: 0 18px;
}
.hero-eyebrow {
font-size: 16px;
line-height: 20px;
}
.hero-title {
font-size: 24px;
line-height: 30px;
}
.hero-indicator-pill {
height: 34px;
min-width: 72px;
padding: 0 14px;
border-radius: 18px;
}
.hero-indicator-text {
font-size: 16px;
}
.equity-swiper,
.equity-swiper-overlay {
border-radius: 18px;
}
.swiper-dots {
bottom: 10px;
}
.dot {
width: 9px;
height: 9px;
border-radius: 6px;
margin: 0 5px;
}
.dot.active {
width: 24px;
}
.empty-card {
min-height: 180px;
border-radius: 24px;
}
.empty-title {
font-size: 24px;
margin-bottom: 10px;
}
.empty-text {
font-size: 18px;
}
:deep(.right-content-box) {
padding-top: 10px;
}
:deep(.module-box .common-title),
:deep(.tool-box .common-title) {
height: 72px;
padding-left: 24px;
}
:deep(.module-box .title-text),
:deep(.tool-box .title-text) {
font-size: 24px;
}
:deep(.module-box) {
margin-bottom: 16px;
}
:deep(.tool-box .content-box) {
padding: 12px 16px 16px;
}
:deep(.tool-box .content-box .entrance-item) {
margin-bottom: 20px;
}
:deep(.tool-box .content-box .entrance-icon-compact) {
width: 64px;
height: 64px;
}
:deep(.tool-box .content-box .entrance-name-compact) {
font-size: 17px;
margin-top: 8px;
}
}
.layout-landscape-1174x768 .equity-page {
.swiper-custom-content {
border-radius: 18px;
background: rgba(255, 255, 255, 0.9);
}
.equity-hero-head {
height: 48px;
padding: 0 12px;
}
.hero-eyebrow {
font-size: 12px;
line-height: 14px;
}
.hero-title {
font-size: 16px;
line-height: 22px;
}
.hero-indicator-pill {
height: 26px;
min-width: 52px;
padding: 0 10px;
border-radius: 14px;
}
.hero-indicator-text {
font-size: 12px;
}
.equity-swiper,
.equity-swiper-overlay {
border-radius: 12px;
}
.swiper-dots {
bottom: 5px;
}
.dot {
width: 6px;
height: 6px;
border-radius: 4px;
margin: 0 3px;
}
.dot.active {
width: 16px;
}
.empty-card {
width: 74%;
min-height: 132px;
border-radius: 18px;
}
.empty-title {
font-size: 18px;
margin-bottom: 7px;
}
.empty-text {
font-size: 14px;
}
:deep(.right-content-box) {
padding-top: 6px;
}
:deep(.module-box .common-title),
:deep(.tool-box .common-title) {
height: 52px;
padding-left: 16px;
}
:deep(.module-box .title-text),
:deep(.tool-box .title-text) {
font-size: 17px;
}
:deep(.module-box) {
margin-bottom: 12px;
}
:deep(.tool-box .content-box) {
padding: 8px 12px 10px;
}
:deep(.tool-box .content-box .entrance-item) {
margin-bottom: 12px;
}
:deep(.tool-box .content-box .entrance-icon-compact) {
width: 46px;
height: 46px;
}
:deep(.tool-box .content-box .entrance-name-compact) {
font-size: 12px;
margin-top: 4px;
}
}
.layout-landscape-common .equity-page {
.swiper-custom-content {
border-radius: 16px;
background: rgba(255, 255, 255, 0.88);
}
.equity-hero-head {
height: 44px;
padding: 0 11px;
}
.hero-eyebrow {
font-size: 11px;
line-height: 14px;
}
.hero-title {
font-size: 15px;
line-height: 20px;
}
.hero-indicator-pill {
height: 24px;
min-width: 48px;
padding: 0 9px;
border-radius: 13px;
}
.hero-indicator-text {
font-size: 11px;
}
.equity-swiper,
.equity-swiper-overlay {
border-radius: 11px;
}
.swiper-dots {
bottom: 4px;
}
.dot {
width: 6px;
height: 6px;
border-radius: 4px;
margin: 0 2px;
}
.dot.active {
width: 14px;
}
.empty-card {
width: 76%;
min-height: 126px;
border-radius: 16px;
}
.empty-title {
font-size: 17px;
margin-bottom: 6px;
}
.empty-text {
font-size: 13px;
}
:deep(.right-content-box) {
padding-top: 6px;
}
:deep(.module-box .common-title),
:deep(.tool-box .common-title) {
height: 48px;
padding-left: 15px;
}
:deep(.module-box .title-text),
:deep(.tool-box .title-text) {
font-size: 16px;
}
:deep(.module-box) {
margin-bottom: 10px;
}
:deep(.tool-box .content-box) {
padding: 7px 10px 8px;
}
:deep(.tool-box .content-box .entrance-item) {
margin-bottom: 11px;
}
:deep(.tool-box .content-box .entrance-icon-compact) {
width: 42px;
height: 42px;
}
:deep(.tool-box .content-box .entrance-name-compact) {
font-size: 11px;
margin-top: 3px;
}
}
.layout-portrait-common .equity-page {
}
...@@ -34,14 +34,17 @@ export function updateResolutionConfig(): void { ...@@ -34,14 +34,17 @@ export function updateResolutionConfig(): void {
let target = configMap.get(key); let target = configMap.get(key);
let usedKey = key; let usedKey = key;
let cssClass = `layout-${prefix}-${key}`; let cssClass = `layout-${prefix}-${key}`;
let matchType = "exact";
if (target == null) { if (target == null) {
target = configMap.get('common'); target = configMap.get('common');
usedKey = `${prefix}/common`; usedKey = `${prefix}/common`;
cssClass = `layout-${prefix}-common`; cssClass = `layout-${prefix}-common`;
matchType = "fallback-common";
} }
if (target != null) { if (target != null) {
console.log(`[ResolutionAdapt] match=${matchType} screen=${w}x${h} key=${key} used=${usedKey} cssClass=${cssClass}`);
applyResolutionConfig(target, usedKey, cssClass, pr, w, h); applyResolutionConfig(target, usedKey, cssClass, pr, w, h);
} }
} }
...@@ -75,10 +78,29 @@ function applyResolutionConfig( ...@@ -75,10 +78,29 @@ function applyResolutionConfig(
* 获取分辨率配置(惰性加载) * 获取分辨率配置(惰性加载)
*/ */
export function useResolutionConfig(): AppResolutionConfig { export function useResolutionConfig(): AppResolutionConfig {
if (!resolutionState.config) { const current = resolutionState.config;
if (current != null) {
return current;
}
updateResolutionConfig(); updateResolutionConfig();
const next = resolutionState.config;
if (next != null) {
return next;
}
const fallbackLandscape = landscapeMap.get("common");
if (fallbackLandscape != null) {
return fallbackLandscape;
}
const fallbackPortrait = portraitMap.get("common");
if (fallbackPortrait != null) {
return fallbackPortrait;
} }
return resolutionState.config;
throw new Error("Resolution config is unavailable");
} }
/** /**
......
/* 登录页 竖屏 1080 档位适配(如 360 x 800 等宽度归为 1080 档) .home-frame-container.mode-landscape.res-1080 {
* 通过 .login-page 避免影响其他页面;仅在手机竖屏时生效。 --l-content-left-width: 605px;
*/ --l-module-box-height: 332px;
--l-tool-box-min-height: 120px;
--l-common-title-height: 60px;
}
.home-frame-container.mode-landscape.res-1920 {
--l-content-left-width: 1134px;
--l-module-box-height: 623px;
--l-tool-box-min-height: 225px;
--l-common-title-height: 113px;
}
.home-frame-container.mode-portrait.res-1080 {
--l-content-left-width: 605px;
--l-module-box-height: 332px;
--l-tool-box-min-height: 120px;
--l-common-title-height: 60px;
}
.home-frame-container.mode-portrait.res-1920 {
--l-content-left-width: 1134px;
--l-module-box-height: 623px;
--l-tool-box-min-height: 225px;
--l-common-title-height: 113px;
}
.mode-landscape.res-1080 {
}
.mode-landscape.res-1920 {
}
.mode-portrait.res-1080 {
.start {
height: 96px;
}
}
.mode-portrait.res-1920 {
}
.mode-portrait.res-1080 .login-page { .mode-portrait.res-1080 .login-page {
.layout { .layout {
justify-content: flex-start; justify-content: flex-start;
...@@ -47,7 +87,6 @@ ...@@ -47,7 +87,6 @@
.app-code { .app-code {
bottom: 12px; bottom: 12px;
/* 手机端登录页 APP 编码:完全使用固定像素,不参与变量缩放 */
font-size: 10px !important; font-size: 10px !important;
line-height: 14px; line-height: 14px;
left: 50%; left: 50%;
...@@ -55,3 +94,33 @@ ...@@ -55,3 +94,33 @@
} }
} }
.mode-portrait.res-1920 .account-page {
}
.mode-portrait.res-1080 .account-page {
.layout {
padding-top: 48px;
padding-bottom: 24px;
}
.content-box {
top: 120px;
bottom: 48px;
width: 94%;
border-radius: 16px;
}
.step-box {
transform: scale(0.9);
}
.box {
padding: 0 16px;
justify-content: flex-start;
}
.box .items {
width: 100%;
margin-bottom: 16px;
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!