Commit 9754b526 by liimin

refactor(common): 重构通用组件样式和响应式布局

- 更新LayoutRoot组件CSS类名并添加内边距
- 升级应用版本号从126到127
- 在账户项目页面添加响应式样式对象计算属性
- 将账户列表、商户列表和场景组件的容器类名从box更改为list-container
- 优化AccountList组件UI布局,改进视觉效果和交互反馈
- 调整MerchantList组件网格布局和激活状态样式
- 为Scene组件添加场景图标文本显示功能
- 修改登录页面引入响应式变量配置
- 重构登录页面样式文件结构,优化背景渐变效果
1 parent 9c8c02af
...@@ -90,8 +90,9 @@ onUnmounted(() => { ...@@ -90,8 +90,9 @@ onUnmounted(() => {
</script> </script>
<style> <style>
.layout-root-shell { .layout-root {
width: 100%; width: 100%;
height: 100%; height: 100%;
padding: 0;
} }
</style> </style>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"appid": "__UNI__B602BFA", "appid": "__UNI__B602BFA",
"description": "", "description": "",
"versionName": "1.0.0", "versionName": "1.0.0",
"versionCode": "126", "versionCode": "127",
"uni-app-x": { "uni-app-x": {
}, },
"quickapp": {}, "quickapp": {},
......
...@@ -60,15 +60,19 @@ ...@@ -60,15 +60,19 @@
<scroll-view class="list" <scroll-view class="list"
direction="vertical" direction="vertical"
:show-scrollbar="false"> :show-scrollbar="false"
:style="styleObject">
<AccountList v-if="stepIndex == 0" <AccountList v-if="stepIndex == 0"
ref="accountRef" ref="accountRef"
:style="styleObject"
@choose-account="chooseAccount" /> @choose-account="chooseAccount" />
<MerchantList v-else-if="stepIndex == 1" <MerchantList v-else-if="stepIndex == 1"
ref="merchantRef" ref="merchantRef"
:style="styleObject"
@choose-merchant="chooseMerchant" /> @choose-merchant="chooseMerchant" />
<Scene v-else <Scene v-else
ref="sceneRef" /> ref="sceneRef"
:style="styleObject" />
</scroll-view> </scroll-view>
</view> </view>
</view> </view>
...@@ -77,14 +81,20 @@ ...@@ -77,14 +81,20 @@
</template> </template>
<script setup lang="uts"> <script setup lang="uts">
import { ComponentPublicInstance, nextTick, ref } from "vue"; import { ComponentPublicInstance, nextTick, ref, computed, type Ref } from "vue";
import AccountList from "@/pages/common/components/AccountList.uvue"; import AccountList from "@/pages/common/components/AccountList.uvue";
import MerchantList from "@/pages/common/components/MerchantList.uvue"; import MerchantList from "@/pages/common/components/MerchantList.uvue";
import Scene from "@/pages/common/components/Scene.uvue"; import Scene from "@/pages/common/components/Scene.uvue";
import { updateOrientation, usePageVars,useScreenVars } from '@/services/adapter/hooks/index.uts' import { useScreenVars } from '@/services/adapter/hooks/index.uts'
import { cssClassRef } from "@/services/adapter"; import pageVars from './styles/index.vars'
import pageVars from '../styles/index.vars'
// 响应式样式变量
const screenVarsHook = useScreenVars(pageVars)
const styleObject = computed((): Any => {
const sv = screenVarsHook.screenVars as Ref<UTSJSONObject>
return sv.value as Any
})
// 不显式导入 onLoad,避免与编译器生成的 BasePage 构造函数中的 onLoad 冲突(error18) // 不显式导入 onLoad,避免与编译器生成的 BasePage 构造函数中的 onLoad 冲突(error18)
// import { onLoad } from "@dcloudio/uni-app"; // import { onLoad } from "@dcloudio/uni-app";
...@@ -167,205 +177,5 @@ const chooseMerchant = (userInfo: any): void => { ...@@ -167,205 +177,5 @@ const chooseMerchant = (userInfo: any): void => {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import "../styles/common.scss"; @import "./styles/common.scss";
// @import "../styles/landscape.scss";
// @import "../styles/portrait.scss";
.page-container {
width: 100%;
height: 100%;
position: relative;
overflow: hidden;
.bg {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
.bg-image {
width: 100%;
height: 100%;
opacity: 0.9;
filter: saturate(0.82) brightness(1.03);
}
}
.layout {
width: 100%;
height: 100%;
padding-top: 0;
padding-bottom: 0;
box-sizing: border-box;
display: flex;
flex-direction: column;
align-items: center;
display: flex;
.nav-wrap {
width: 100%;
height: 66px;
position:absolute;
left: 0;
top: 18px;
padding: 0 14px;
}
.back {
width: 34px;
height: 34px;
border-radius: 17px;
background: rgba(255, 255, 255, 0.78);
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}
.step-box {
height: 44px;
border-radius: 14px;
background: transparent;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
.step-item {
display: flex;
flex-direction: row;
align-items: center;
margin-right: 16px;
&:last-child {
margin-right: 0;
}
.step-label {
font-weight: 600;
font-size: 13px;
color: #90a0b5;
}
.step-label-active {
color: #1677ff;
}
.num {
width: 22px;
height: 22px;
position: relative;
margin-right: 6px;
.text {
width: 100%;
height: 100%;
background: #c7d2e3;
border-radius: 999px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
overflow: hidden;
}
.text-active {
background: #1677ff;
}
.num-text {
font-weight: 700;
font-size: 12px;
color: #ffffff;
}
}
}
.step-item.active-item .num .text,
.step-item .num .text-active {
background: #1677ff;
}
}
.content-box {
position:absolute;
top:60px;
flex: 1;
width: 86%;
box-sizing: border-box;
margin: 0 10px 2px;
padding-top: 0;
border-radius: 20px;
//ba ckground: rgba(255, 255, 255, 0.36);
flex-direction: column;
overflow: hidden;
min-height: 0;
}
.search-box {
margin: 0 12px 12px;
position: relative;
.search-input {
width: 100%;
height: 42px;
background: rgba(255, 255, 255, 0.88);
border-radius: 12px;
box-sizing: border-box;
padding: 0 8px;
position: relative;
box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
.input {
display: flex;
flex-direction: row;
align-items: center;
height: 100%;
width: 100%;
justify-content: center;
.search-input-text {
font-size: 14px;
text-align: center;
color: #334155;
}
}
.icon-search {
margin-left: 3px;
}
.placeholder {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
.search-placeholder-text {
font-size: 13px;
color: #96a4b8;
text-align: center;
}
}
}
.clear {
position: absolute;
top: 50%;
right: 4px;
transform: translateY(-50%);
padding: 0 2px;
height: 100%;
display: flex;
flex-direction: row;
align-items: center;
}
}
.list {
position: relative;
display: flex;
flex: 1;
flex-direction: column;
min-height: 0;
overflow: hidden;
}
}
}
</style> </style>
/* 账号选择页 - 企业级设计规范 */
// ==================== 页面容器 ====================
.page-container {
width: 100%;
height: 100%;
position: relative;
overflow: hidden;
// 背景层
.bg {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
.bg-image {
width: 100%;
height: 100%;
opacity: 0.85;
filter: saturate(0.9) brightness(1.05) blur(0.5px);
}
}
// 主布局
.layout {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
position: relative;
// ==================== 步骤条 ====================
.step-box {
height: var(--account-step-height);
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
padding: 0 var(--account-padding-horizontal);
margin-top: 20px;
.step-item {
display: flex;
flex-direction: row;
align-items: center;
margin-right: 20px;
cursor: pointer;
transition: all 0.3s ease;
&:last-child {
margin-right: 0;
}
// 步骤标签
.step-label {
font-weight: 500;
font-size: var(--account-step-fontsize);
color: var(--account-text-tertiary);
transition: all 0.3s ease;
}
.step-label-active {
color: var(--account-primary);
font-weight: 600;
}
// 数字圆圈
.num {
width: var(--account-num-size);
height: var(--account-num-size);
position: relative;
margin-right: 8px;
.text {
width: 100%;
height: 100%;
background: #c7d2e3;
border-radius: 50%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
overflow: hidden;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
&.text-active {
background-color: #1677ff !important;
box-shadow: 0 2px 8px rgba(22, 119, 255, 0.3) !important;
}
.num-text {
font-weight: 700;
font-size: var(--account-num-fontsize);
color: #ffffff;
}
}
// 激活状态(已完成和当前步骤)
&.active-item {
.text {
background-color: #1677ff !important;
box-shadow: 0 2px 8px rgba(22, 119, 255, 0.3) !important;
}
}
}
}
}
// ==================== 内容区域 ====================
.content-box {
position: absolute;
top: var(--account-content-top);
bottom: 0;
left: 0;
right: 0;
width: var(--account-container-width);
max-width: var(--account-container-max-width);
box-sizing: border-box;
margin: 0 auto;
padding-top: 0;
display: flex;
flex-direction: column;
overflow: hidden;
min-height: 0;
// ==================== 搜索框 ====================
.search-box {
margin: var(--account-content-gap);
position: relative;
.search-input {
width: 100%;
height: var(--account-search-height);
background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
border-radius: 20px;
box-sizing: border-box;
padding: 0 16px;
position: relative;
border: 1.5px solid rgba(226, 232, 240, 0.8);
box-shadow:
0 2px 8px rgba(15, 23, 42, 0.04),
0 4px 16px rgba(15, 23, 42, 0.06);
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
&:focus-within {
border-color: rgba(22, 119, 255, 0.5);
box-shadow:
0 4px 12px rgba(22, 119, 255, 0.1),
0 8px 24px rgba(22, 119, 255, 0.12);
transform: translateY(-1px);
}
.input {
display: flex;
flex-direction: row;
align-items: center;
height: 100%;
width: 100%;
justify-content: center;
.search-input-text {
font-size: var(--account-search-fontsize);
text-align: center;
color: #1e293b;
font-weight: 500;
letter-spacing: 0.3px;
}
}
.icon-search {
margin-left: 6px;
opacity: 0.5;
filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}
.placeholder {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
.search-placeholder-text {
font-size: calc(var(--account-search-fontsize) - 1px);
color: #94a3b8;
text-align: center;
font-weight: 400;
letter-spacing: 0.2px;
}
}
}
.clear {
position: absolute;
top: 50%;
right: 10px;
transform: translateY(-50%);
padding: 6px;
height: calc(100% - 12px);
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
border-radius: 50%;
background: rgba(22, 119, 255, 0.08);
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
&:active {
background: rgba(22, 119, 255, 0.15);
transform: translateY(-50%) scale(0.9);
}
}
}
// ==================== 列表区域 ====================
.list {
display: flex;
flex: 1;
flex-direction: column;
min-height: 0;
overflow-y: scroll;
width: 100%;
padding: 0;
}
}
}
}
// ==================== 动画效果 ====================
.fade-in {
animation: fadeIn 0.4s ease-out;
}
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
// 步骤项点击反馈
.step-item {
&:active {
opacity: 0.7;
transform: scale(0.98);
}
}
// 账号选择页响应式样式配置 - 企业级设计规范
export default {
common: {
// 品牌色彩系统
'--account-primary': '#1677ff',
'--account-primary-light': '#e6f4ff',
'--account-success': '#52c41a',
'--account-warning': '#faad14',
'--account-error': '#ff4d4f',
// 中性色阶
'--account-text-primary': '#1f2937',
'--account-text-secondary': '#6b7280',
'--account-text-tertiary': '#9ca3af',
'--account-border': '#e5e7eb',
'--account-bg-card': 'rgba(255, 255, 255, 0.95)',
'--account-bg-input': '#ffffff',
// 阴影系统
'--account-shadow-sm': '0 1px 2px rgba(0, 0, 0, 0.05)',
'--account-shadow-md': '0 4px 6px rgba(0, 0, 0, 0.07)',
'--account-shadow-lg': '0 10px 25px rgba(0, 0, 0, 0.10)',
'--account-shadow-xl': '0 20px 40px rgba(0, 0, 0, 0.12)',
// 圆角系统
'--account-radius-sm': '8px',
'--account-radius-md': '12px',
'--account-radius-lg': '16px',
'--account-radius-xl': '20px',
// 列表间距统一变量
'--account-list-gap': '16px',
},
portrait: {
// 竖屏布局参数
'--account-container-width': '92%',
'--account-container-max-width': '480px',
'--account-content-top': '70px',
'--account-step-height': '48px',
'--account-step-fontsize': '13px',
'--account-num-size': '24px',
'--account-num-fontsize': '13px',
'--account-search-height': '44px',
'--account-search-fontsize': '14px',
'--account-padding-horizontal': '16px',
'--account-content-gap': '16px',
},
landscape: {
// 横屏布局参数
'--account-container-width': '600px',
'--account-container-max-width': '600px',
'--account-content-top': '80px',
'--account-step-height': '52px',
'--account-step-fontsize': '14px',
'--account-num-size': '26px',
'--account-num-fontsize': '14px',
'--account-search-height': '48px',
'--account-search-fontsize': '15px',
'--account-padding-horizontal': '24px',
'--account-content-gap': '20px',
},
resolutions: {
// iPad 横屏优化
'landscape-1024x768': {
'--account-container-width': '650px',
'--account-content-top': '90px',
'--account-step-height': '56px',
'--account-step-fontsize': '15px',
'--account-num-size': '28px',
},
// 小屏 Pad 横屏
'landscape-816x393': {
'--account-container-width': '550px',
'--account-content-top': '75px',
},
// 大屏手机竖屏
'portrait-414x896': {
'--account-container-width': '90%',
'--account-content-top': '75px',
},
// iPhone 14 Pro 竖屏
'portrait-393x816': {
'--account-container-width': '90%',
'--account-content-top': '68px',
},
}
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<!-- 保持单根节点,确保父组件 v-show 生效 --> <!-- 保持单根节点,确保父组件 v-show 生效 -->
<view class="fade-in-up"> <view class="fade-in-up">
<ListSkeleton v-if="!flag" /> <ListSkeleton v-if="!flag" />
<view v-else class="box"> <view v-else class="list-container">
<template v-if="loginUserInfoList.length > 0"> <template v-if="loginUserInfoList.length > 0">
<view v-for="(item, index) in loginUserInfoList" <view v-for="(item, index) in loginUserInfoList"
:key="index" :key="index"
...@@ -222,6 +222,7 @@ function chooseAccount(item: AccountItem): void { ...@@ -222,6 +222,7 @@ function chooseAccount(item: AccountItem): void {
} }
i++; i++;
} }
console.log("选择账号:", list);
loginUserInfoList.value = list; loginUserInfoList.value = list;
selectedUuid.value = item.uuid; selectedUuid.value = item.uuid;
choiceAccountLogin(); choiceAccountLogin();
...@@ -315,7 +316,7 @@ function getListSelectAccount(autoLogin: boolean): void { ...@@ -315,7 +316,7 @@ function getListSelectAccount(autoLogin: boolean): void {
i++; i++;
} }
console.log("解析后的账号列表,数量:", accountList.length); console.log("解析后的账号列表,数量:", accountList.length,accountList);
loginUserInfoList.value = accountList; loginUserInfoList.value = accountList;
copyLoginUserInfoList.value = accountList; copyLoginUserInfoList.value = accountList;
flag.value = true; flag.value = true;
...@@ -360,32 +361,58 @@ onMounted(() => { ...@@ -360,32 +361,58 @@ onMounted(() => {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.box { .list-container {
display: flex; display: flex;
align-items: center; flex-direction: column;
flex-wrap: wrap;
padding: 2px 12px 12px;
justify-content: space-between;
width: 100%; width: 100%;
box-sizing: border-box; }
.items { .items {
width: 48%; min-height: 92px;
margin-bottom: 16px; background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
min-height: 86px; border-radius: 16px;
background: rgba(255, 255, 255, 0.92); padding: 18px;
border-radius: 14px;
padding: 16px;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
box-sizing: border-box; box-sizing: border-box;
border: 0; border: 1px solid rgba(226, 232, 240, 0.6);
box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06); box-shadow:
transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease; 0 2px 8px rgba(15, 23, 42, 0.04),
0 8px 24px rgba(15, 23, 42, 0.06);
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
width: 100%;
margin-bottom: 16px;
position: relative;
overflow: hidden;
// 微妙的光泽效果
&::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(
90deg,
transparent 0%,
rgba(255, 255, 255, 0.3) 50%,
transparent 100%
);
transition: left 0.6s ease;
}
&:last-child {
margin-bottom: 0;
}
&:active { &:active {
background: #f1f3f5; transform: translateY(-2px);
box-shadow:
0 4px 12px rgba(15, 23, 42, 0.08),
0 12px 32px rgba(15, 23, 42, 0.1);
border-color: rgba(22, 119, 255, 0.2);
} }
.left { .left {
...@@ -400,14 +427,17 @@ onMounted(() => { ...@@ -400,14 +427,17 @@ onMounted(() => {
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
font-size: 16px; font-size: 16px;
color: #334155; color: #1e293b;
letter-spacing: 0.3px;
line-height: 1.4;
} }
.shop_no { .shop_no {
font-weight: 400; font-weight: 400;
font-size: 13px; font-size: 13px;
margin-top: 6px; margin-top: 6px;
color: #8a9ab1; color: #94a3b8;
letter-spacing: 0.2px;
} }
} }
...@@ -416,58 +446,70 @@ onMounted(() => { ...@@ -416,58 +446,70 @@ onMounted(() => {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
margin-right: 14px; margin-right: 16px;
.midle { .midle {
width: 48px; width: 52px;
height: 48px; height: 52px;
border-radius: 24px; border-radius: 26px;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
transition: all 0.3s ease;
} }
.midle-text { .midle-text {
font-size: 14px; font-size: 14px;
font-weight: 700; font-weight: 700;
text-align: center; text-align: center;
letter-spacing: 0.5px;
} }
.midle_1 { .midle_1 {
background-color: rgba(242, 71, 36, 0.08); background: linear-gradient(135deg, rgba(242, 71, 36, 0.12) 0%, rgba(242, 71, 36, 0.06) 100%);
.midle-text { color: #f24724; } .midle-text { color: #f24724; }
} }
.midle_2 { .midle_2 {
background-color: rgba(255, 157, 10, 0.08); background: linear-gradient(135deg, rgba(255, 157, 10, 0.12) 0%, rgba(255, 157, 10, 0.06) 100%);
.midle-text { color: #ff9d0a; } .midle-text { color: #ff9d0a; }
} }
.midle_3 { .midle_3 {
background-color: rgba(52, 123, 255, 0.08); background: linear-gradient(135deg, rgba(52, 123, 255, 0.12) 0%, rgba(52, 123, 255, 0.06) 100%);
.midle-text { color: #347bff; } .midle-text { color: #347bff; }
} }
.midle_4 { .midle_4 {
background-color: rgba(53, 195, 118, 0.08); background: linear-gradient(135deg, rgba(53, 195, 118, 0.12) 0%, rgba(53, 195, 118, 0.06) 100%);
.midle-text { color: #35c376; } .midle-text { color: #35c376; }
} }
.midle_5 { .midle_5 {
background-color: rgba(53, 195, 118, 0.08); background: linear-gradient(135deg, rgba(53, 195, 118, 0.12) 0%, rgba(53, 195, 118, 0.06) 100%);
.midle-text { color: #35c376; } .midle-text { color: #35c376; }
} }
} }
} }
.active { .active {
background-color: rgba(22, 119, 255, 0.08); background: linear-gradient(135deg, rgba(22, 119, 255, 0.06) 0%, rgba(22, 119, 255, 0.02) 100%);
box-shadow: 0 8px 20px rgba(22, 119, 255, 0.16); border-color: rgba(22, 119, 255, 0.3);
box-shadow:
0 4px 16px rgba(22, 119, 255, 0.12),
0 12px 32px rgba(22, 119, 255, 0.16);
transform: translateY(-2px);
.left .name { .left .name {
color: #1677FF; color: #1677FF;
font-weight: 700;
} }
.right .midle {
box-shadow: 0 4px 12px rgba(22, 119, 255, 0.2);
transform: scale(1.05);
} }
} }
</style> </style>
<template> <template>
<view class="fade-in-up"> <view class="fade-in-up">
<ListSkeleton v-if="!flag" /> <ListSkeleton v-if="!flag" />
<view v-if="flag" class="box"> <view v-if="flag" class="list-container">
<template v-if="loginUserInfoList.length > 0"> <template v-if="loginUserInfoList.length > 0">
<view v-for="(item, index) in loginUserInfoList" <view v-for="(item, index) in loginUserInfoList"
:key="index" :key="index"
class="items" class="items"
:class="[item.active ? 'active' : '']" :class="[item.active ? 'active' : '', (index + 1) % 2 === 0 ? 'item-even' : '']"
@click="chooseMerchantItem(item)"> @click="chooseMerchantItem(item)">
<view class="right"> <view class="left">
<view class="store-badge">
<view class="sprite-icon icon-store"></view> <view class="sprite-icon icon-store"></view>
</view> </view>
<view class="left"> <view class="info">
<text class="name">{{ item.merchantName }}</text> <text class="name">{{ item.merchantName }}</text>
<text class="text_no">商户号:{{ item.merchantId }}</text> <text class="text_no">商户号:{{ item.merchantId }}</text>
</view> </view>
</view> </view>
</view>
</template> </template>
<no-data v-else /> <no-data v-else />
</view> </view>
...@@ -279,70 +281,120 @@ defineExpose({ ...@@ -279,70 +281,120 @@ defineExpose({
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.box { .list-container {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center;
flex-wrap: wrap; flex-wrap: wrap;
padding: 2px;
width: 100%; width: 100%;
box-sizing: border-box;
justify-content: space-between;
} }
.items { .items {
width: 48%; min-height: 72px;
min-height: 86px; background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
margin-bottom: var(--l-spacing-lg);
background: rgba(255, 255, 255, 0.92);
border-radius: 14px; border-radius: 14px;
padding: var(--l-spacing-md); padding: 12px 14px;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
box-sizing: border-box; box-sizing: border-box;
border: 0; border: 1px solid rgba(226, 232, 240, 0.6);
box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06); box-shadow:
transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease; 0 2px 8px rgba(15, 23, 42, 0.04),
0 6px 18px rgba(15, 23, 42, 0.05);
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
position: relative;
overflow: hidden;
// 竖屏默认2列
width: 48%;
margin-right: 4%;
margin-bottom: 12px;
// 每行第二个元素(偶数)去掉右边距
&.item-even {
margin-right: 0;
}
&:active { &:active {
background-color: #f1f3f5; transform: translateY(-1px) scale(0.99);
box-shadow:
0 3px 10px rgba(15, 23, 42, 0.06),
0 8px 24px rgba(15, 23, 42, 0.08);
border-color: rgba(22, 119, 255, 0.2);
} }
} }
.items .right { .items .left {
margin-right: 14px; flex: 1;
display: flex;
flex-direction: row;
align-items: center;
min-width: 0; // 允许文字截断
.store-badge {
flex-shrink: 0; flex-shrink: 0;
} margin-right: 10px;
.items .left { .sprite-icon {
width: 36px;
height: 36px;
border-radius: 10px;
background: linear-gradient(135deg, rgba(22, 119, 255, 0.08) 0%, rgba(22, 119, 255, 0.04) 100%);
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 1px 4px rgba(22, 119, 255, 0.08);
transition: all 0.3s ease;
}
}
.info {
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
min-width: 0;
}
} }
.items .name { .items .name {
font-weight: 600; font-weight: 600;
font-size: 16px; font-size: 13px;
color: #334155; color: #1e293b;
margin-bottom: 6px; margin-bottom: 3px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
letter-spacing: 0.2px;
line-height: 1.3;
} }
.items .text_no { .items .text_no {
font-size: 13px; font-size: 10px;
color: #8a9ab1; color: #94a3b8;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
letter-spacing: 0.1px;
} }
.items.active { .items.active {
background-color: rgba(22, 119, 255, 0.08); background: linear-gradient(135deg, rgba(22, 119, 255, 0.05) 0%, rgba(22, 119, 255, 0.02) 100%);
box-shadow: 0 8px 20px rgba(22, 119, 255, 0.16); border-color: rgba(22, 119, 255, 0.25);
box-shadow:
0 3px 12px rgba(22, 119, 255, 0.1),
0 8px 24px rgba(22, 119, 255, 0.12);
transform: translateY(-1px) scale(0.99);
} }
.items.active .name { .items.active .name {
color: #1677FF; color: #1677FF;
font-weight: 700;
}
.items.active .left .store-badge .sprite-icon {
background: linear-gradient(135deg, rgba(22, 119, 255, 0.12) 0%, rgba(22, 119, 255, 0.06) 100%);
box-shadow: 0 2px 8px rgba(22, 119, 255, 0.15);
transform: scale(1.08);
} }
</style> </style>
<template> <template>
<view class="fade-in-up"> <view class="fade-in-up">
<ListSkeleton v-if="loading" /> <ListSkeleton v-if="loading" />
<view v-else class="box"> <view v-else class="list-container">
<template v-if="sceneList.length > 0">
<view v-for="(item, index) in sceneList" <view v-for="(item, index) in sceneList"
:key="index" :key="index"
class="items" class="items"
:class="[item.actived ? 'active' : '']" :class="[item.actived ? 'active' : '']"
@click="selectScene(item, index)"> @click="selectScene(item, index)">
<view class="left"> <view class="left">
<view class="sprite-icon" :class="[`icon-scene-${ item.sceneType}`]"></view> <view class="scene-icon" :class="[`scene-type-${item.sceneType}`]">
<text class="scene-icon-text">{{ getSceneIconText(item.sceneType) }}</text>
</view>
</view> </view>
<view class="right"> <view class="right">
<text class="name">{{ item.sceneName }}</text> <text class="name">{{ item.sceneName }}</text>
<text class="shop_no">{{ item.sceneDesc }}</text> <text class="shop_no">{{ item.sceneDesc }}</text>
</view> </view>
</view> </view>
</template>
<no-data v-else />
</view> </view>
</view> </view>
</template> </template>
...@@ -44,6 +49,19 @@ const loading = ref<boolean>(true); ...@@ -44,6 +49,19 @@ const loading = ref<boolean>(true);
let userInfo: null | UTSJSONObject = null; let userInfo: null | UTSJSONObject = null;
let jumpTimer: number = 0; let jumpTimer: number = 0;
function getSceneIconText(sceneType: number): string {
switch (sceneType) {
case 0:
return "权益";
case 1:
return "轻改";
case 7:
return "二手";
default:
return "场景";
}
}
function jump(info: UTSJSONObject, data: any | null): void { function jump(info: UTSJSONObject, data: any | null): void {
const now = Date.now(); const now = Date.now();
if (now - jumpTimer < 3000) { if (now - jumpTimer < 3000) {
...@@ -209,37 +227,81 @@ defineExpose({ ...@@ -209,37 +227,81 @@ defineExpose({
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.box { .list-container {
display: flex; display: flex;
align-items: center; flex-direction: column;
flex-wrap: wrap;
padding: 2px 12px 12px;
justify-content: space-between;
width: 100%; width: 100%;
box-sizing: border-box; }
.items { .items {
width: 48%; min-height: 92px;
margin-bottom: 24px; background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
min-height: 86px; border-radius: 16px;
background: rgba(255, 255, 255, 0.92); padding: 18px;
border-radius: 14px;
padding: 16px;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
box-sizing: border-box; box-sizing: border-box;
border: 0; border: 1px solid rgba(226, 232, 240, 0.6);
box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06); box-shadow:
transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease; 0 2px 8px rgba(15, 23, 42, 0.04),
0 8px 24px rgba(15, 23, 42, 0.06);
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
width: 100%;
margin-bottom: 16px;
position: relative;
overflow: hidden;
&:last-child {
margin-bottom: 0;
}
&:active { &:active {
background: #f1f3f5; transform: translateY(-2px);
box-shadow:
0 4px 12px rgba(15, 23, 42, 0.08),
0 12px 32px rgba(15, 23, 42, 0.1);
border-color: rgba(22, 119, 255, 0.2);
} }
.left { .left {
margin-right: 14px; margin-right: 16px;
flex-shrink: 0; flex-shrink: 0;
.scene-icon {
width: 52px;
height: 52px;
border-radius: 26px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
transition: all 0.3s ease;
.scene-icon-text {
font-size: 13px;
font-weight: 700;
text-align: center;
letter-spacing: 0.5px;
}
}
// 不同场景的颜色(渐变增强)
.scene-type-0 {
background: linear-gradient(135deg, rgba(255, 157, 10, 0.12) 0%, rgba(255, 157, 10, 0.06) 100%);
.scene-icon-text { color: #ff9d0a; }
}
.scene-type-1 {
background: linear-gradient(135deg, rgba(242, 71, 36, 0.12) 0%, rgba(242, 71, 36, 0.06) 100%);
.scene-icon-text { color: #f24724; }
}
.scene-type-7 {
background: linear-gradient(135deg, rgba(52, 123, 255, 0.12) 0%, rgba(52, 123, 255, 0.06) 100%);
.scene-icon-text { color: #347bff; }
}
} }
.right { .right {
...@@ -251,24 +313,42 @@ defineExpose({ ...@@ -251,24 +313,42 @@ defineExpose({
.name { .name {
font-weight: 600; font-weight: 600;
font-size: 16px; font-size: 16px;
color: #334155; color: #1e293b;
margin-bottom: 6px; margin-bottom: 6px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
letter-spacing: 0.3px;
line-height: 1.4;
} }
.shop_no { .shop_no {
font-size: 13px; font-size: 13px;
color: #8a9ab1; color: #94a3b8;
} overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
letter-spacing: 0.2px;
} }
} }
}
.active { .active {
background-color: rgba(22, 119, 255, 0.08); background: linear-gradient(135deg, rgba(22, 119, 255, 0.06) 0%, rgba(22, 119, 255, 0.02) 100%);
box-shadow: 0 8px 20px rgba(22, 119, 255, 0.16); border-color: rgba(22, 119, 255, 0.3);
box-shadow:
0 4px 16px rgba(22, 119, 255, 0.12),
0 12px 32px rgba(22, 119, 255, 0.16);
transform: translateY(-2px);
.right .name { .right .name {
color: #1677FF; color: #1677FF;
font-weight: 700;
} }
.left .scene-icon {
box-shadow: 0 4px 12px rgba(22, 119, 255, 0.2);
transform: scale(1.05);
} }
} }
</style> </style>
<template> <template>
<layout-root> <layout-root :page-vars="pageVars">
<view class="layout login-page"> <view class="layout login-page">
<view class="bg"></view> <view class="bg"></view>
<view class="login flex-col"> <view class="login flex-col">
...@@ -96,8 +95,7 @@ import { ref, watch } from "vue"; ...@@ -96,8 +95,7 @@ import { ref, watch } from "vue";
import { apiAutoLogin, apiGetSmsCode, apiSmsLogin } from "@/api/user-api.uts"; import { apiAutoLogin, apiGetSmsCode, apiSmsLogin } from "@/api/user-api.uts";
import { storage } from "@/utils/storage.uts"; import { storage } from "@/utils/storage.uts";
// 不显式导入 onLoad,避免与编译器生成的 BasePage 构造函数中的 onLoad 冲突(error18) import pageVars from './styles/index.vars'
// import { onLoad } from "@dcloudio/uni-app";
// 手机号正则 // 手机号正则
const phoneRex = /^1([3-9])\d{9}$/; const phoneRex = /^1([3-9])\d{9}$/;
...@@ -390,122 +388,4 @@ function toggleNoSignIn(): void { ...@@ -390,122 +388,4 @@ function toggleNoSignIn(): void {
<style scoped lang="scss"> <style scoped lang="scss">
// 引入拆分后的样式文件 // 引入拆分后的样式文件
@import "./styles/common.scss"; @import "./styles/common.scss";
@import "./styles/landscape.scss";
@import "./styles/portrait.scss";
.test-entry {
position: fixed;
top: 20px;
right: 20px;
padding: 10px;
background-color: rgba(0, 0, 0, 0.5);
border-radius: 5px;
z-index: 999;
.test-entry-text {
color: #fff;
font-size: 14px;
}
}
.login-page .login {
width: 452px !important;
padding: 30px 28px 22px !important;
background: rgba(255, 255, 255, 0.92) !important;
border-radius: 16px !important;
box-shadow: 0 14px 30px rgba(15, 23, 42, 0.10) !important;
}
.login-page .login .title {
font-size: 32px !important;
margin-bottom: 6px !important;
color: #1e293b !important;
}
.login-page .login .sub-title {
font-size: 13px !important;
margin: 0 0 16px !important;
color: #7b8ba3 !important;
}
.login-page .login .input {
width: 100% !important;
height: 50px !important;
margin-bottom: 12px !important;
border-radius: 10px !important;
background: #f8fbff !important;
border: 1px solid #d5e1f2 !important;
box-shadow: none !important;
overflow: hidden !important;
box-sizing: border-box !important;
}
.login-page .login .btn {
width: 100% !important;
height: 50px !important;
border-radius: 10px !important;
background: #1677ff !important;
display: flex !important;
flex-direction: row !important;
align-items: center !important;
justify-content: center !important;
transition: transform .12s ease, opacity .12s ease !important;
}
.login-page .login .btn .btn-text {
color: #ffffff !important;
font-size: 17px !important;
font-weight: 600 !important;
line-height: 1 !important;
opacity: 1 !important;
display: block !important;
}
.login-page .login .btn.btn-pressing {
transform: scale(0.98) !important;
opacity: 0.92 !important;
}
.login-page .login .btn.btn-loading {
opacity: 0.9 !important;
}
.login-page .login .error-tip {
width: 100% !important;
min-height: 34px !important;
padding: 0 12px !important;
margin: 0 0 10px !important;
border-radius: 10px !important;
background: #fff1f2 !important;
border: 1px solid #fecdd3 !important;
display: flex !important;
flex-direction: row !important;
align-items: center !important;
box-sizing: border-box !important;
box-shadow: 0 4px 10px rgba(239, 68, 68, 0.10) !important;
overflow: hidden !important;
animation: errorTipFadeIn .18s ease-out !important;
}
.login-page .login .error-tip-text {
margin-left: 6px !important;
font-size: 12px !important;
color: #b42318 !important;
font-weight: 600 !important;
line-height: 1.3 !important;
opacity: 1 !important;
display: block !important;
flex: 1 !important;
}
@keyframes errorTipFadeIn {
0% {
opacity: 0;
transform: translateY(-4px);
}
100% {
opacity: 1;
transform: translateY(0);
}
}
</style> </style>
/* pages/common/login/styles/common.scss */ /* pages/common/login/styles/common.scss - 企业级登录页设计规范 */
// ==================== 全局布局 ====================
.layout { .layout {
flex: 1; flex: 1;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: 24px;
box-sizing: border-box;
} }
// ==================== 背景层 ====================
.bg { .bg {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
background-image: linear-gradient(165deg, #eef4ff 0%, #f5f8fd 52%, #f8fafc 100%); background-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
overflow: hidden;
// 添加装饰性渐变光晕效果
&::before {
content: '';
position: absolute;
top: -50%;
right: -20%;
width: 600px;
height: 600px;
background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
border-radius: 50%;
pointer-events: none;
}
&::after {
content: '';
position: absolute;
bottom: -30%;
left: -10%;
width: 500px;
height: 500px;
background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
border-radius: 50%;
pointer-events: none;
}
} }
// ==================== 登录卡片 ====================
.login { .login {
position: relative; position: relative;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
width: 452px; width: 100%;
padding: 30px 28px 22px; max-width: 420px;
background: rgba(255, 255, 255, 0.92); padding: 40px 32px 32px;
border-radius: 16px; background: rgba(255, 255, 255, 0.98);
box-shadow: 0 14px 30px rgba(15, 23, 42, 0.10); backdrop-filter: blur(20px);
border-radius: 24px;
box-shadow:
0 20px 60px rgba(0, 0, 0, 0.15),
0 0 0 1px rgba(255, 255, 255, 0.5) inset;
animation: cardSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
// 标题区域
.title { .title {
margin-bottom: 6px; margin-bottom: 8px;
font-size: 32px; font-size: 28px;
font-weight: 700; font-weight: 700;
color: #1e293b; color: #1a1a2e;
text-align: center; text-align: center;
letter-spacing: -0.5px;
} }
.sub-title { .sub-title {
margin: 0 0 16px; margin: 0 0 28px;
font-size: 13px; font-size: 14px;
font-weight: 500; font-weight: 400;
color: #7b8ba3; color: #6b7280;
text-align: center;
letter-spacing: 0.3px;
}
// 错误提示 - 参考 uView Alert 设计
.error-tip {
width: 100%;
display: flex;
flex-direction: row;
align-items: flex-start;
padding: 12px 16px;
margin-bottom: 16px;
background-color: #fef2f2;
border-radius: 12px;
border-left: 4px solid #ef4444;
animation: errorSlideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
.uni-icons {
margin-right: 10px;
margin-top: 1px;
flex-shrink: 0;
} }
.error-tip-text {
flex: 1;
font-size: 14px;
color: #991b1b;
line-height: 1.6;
font-weight: 400;
}
}
// 输入框组
.input { .input {
flex-direction: row; flex-direction: row;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
align-items: center; align-items: center;
width: 100%; width: 100%;
height: 50px; height: 52px;
padding-left: 20px; padding: 0 16px;
margin-bottom: 12px; margin-bottom: 14px;
background: #f8fbff; background: #fafafa;
border-radius: 10px; border-radius: 14px;
box-shadow: inset 0 0 0 1px #d5e1f2; border: 1.5px solid #e5e7eb;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
// 聚焦状态
&:focus-within {
background: #ffffff;
border-color: #667eea;
box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}
.input-control { .input-control {
flex: 1; flex: 1;
height: 100%; height: 100%;
font-size: 15px; font-size: 15px;
color: #334155; color: #1f2937;
font-weight: 400;
&::placeholder {
color: #9ca3af;
}
} }
.icon { .icon {
...@@ -65,98 +148,196 @@ ...@@ -65,98 +148,196 @@
flex-direction: row; flex-direction: row;
flex-shrink: 0; flex-shrink: 0;
align-items: center; align-items: center;
justify-content: center;
height: 100%; height: 100%;
padding: 0 20px; padding: 0 4px;
margin-left: auto; margin-left: auto;
opacity: 0.6;
transition: opacity 0.2s ease;
&:active {
opacity: 0.4;
}
} }
.code-btn { .code-btn {
flex-shrink: 0; flex-shrink: 0;
margin-right: 14px; margin-right: 8px;
border: none; padding: 6px 12px;
background-color: transparent !important;
border-radius: 8px;
transition: all 0.2s ease;
&:active {
background-color: rgba(102, 126, 234, 0.08);
}
.code-btn-text { .code-btn-text {
font-size: 13px; font-size: 13px;
font-weight: 500; font-weight: 600;
color: #2c66f7; color: #667eea;
white-space: nowrap;
} }
} }
.code-disabled { .code-disabled {
color: #9aa8bc; opacity: 0.5;
.code-btn-text {
color: #9ca3af;
}
} }
} }
// 登录按钮
.btn { .btn {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: 100%; width: 100%;
height: 50px; height: 52px;
background: linear-gradient(135deg, #1677ff 0%, #2f88ff 100%); margin-top: 8px;
border-radius: 10px; background-color: #667eea !important;
box-shadow: 0 8px 16px rgba(22, 119, 255, 0.24); border-radius: 14px;
border: 0px solid transparent;
outline: none;
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
padding: 0;
box-sizing: border-box;
}
.btn-pressing {
background-color: #5568d3 !important;
transform: scale(0.98);
}
.btn-loading {
opacity: 0.85;
} }
.btn-text { .btn-text {
font-size: 17px; font-size: 16px;
font-weight: 600; font-weight: 600;
color: #fff; color: #ffffff !important;
line-height: 1; line-height: 1;
text-align: center; text-align: center;
display: block; display: block;
letter-spacing: 0.5px;
padding-top: 1px;
} }
.btn-disabled { .btn-disabled {
background: #c9c9c9 !important; background: linear-gradient(135deg, #d1d5db 0%, #9ca3af 100%) !important;
box-shadow: none;
} }
// 表单底部
.form-footer { .form-footer {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
width: 100%; width: 100%;
padding-left: 2px; padding: 0 4px;
margin-top: 14px; margin-top: 20px;
.autoLogin { .autoLogin {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
margin-right: 10px; margin-bottom: 12px;
margin-bottom: 10px; padding: 4px 0;
cursor: pointer;
transition: opacity 0.2s ease;
.uni-icons { &:last-child {
margin-right: 4px; margin-bottom: 0;
}
&:active {
opacity: 0.7;
}
radio {
margin-right: 8px;
transform: scale(0.9);
} }
.auto-login-text { .auto-login-text {
font-size: 13px; font-size: 13px;
color: #5c6f8d; color: #6b7280;
line-height: 1.5;
&:nth-child(3) {
color: #667eea;
font-weight: 500;
}
} }
} }
} }
} }
// ==================== APP编码区域 ====================
.app-code { .app-code {
position: fixed; position: fixed;
bottom: 14px; bottom: 20px;
left: 50%; left: 50%;
transform: translate(-50%); transform: translateX(-50%);
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
padding: 8px 16px;
background: rgba(255, 255, 255, 0.9);
backdrop-filter: blur(10px);
border-radius: 20px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
transition: all 0.3s ease;
&:active {
transform: translateX(-50%) scale(0.95);
background: rgba(255, 255, 255, 0.95);
}
} }
.app-code-text { .app-code-text {
font-size: 11px; font-size: 11px;
line-height: 20px; line-height: 1.4;
color: #8fa0b8; color: #6b7280;
font-weight: 400;
letter-spacing: 0.3px;
} }
.icon-clone { .icon-clone {
width: 12px; width: 14px;
height: 12px; height: 14px;
margin-left: 10px; margin-left: 8px;
opacity: 0.6;
transition: opacity 0.2s ease;
&:active {
opacity: 0.4;
}
}
// ==================== 动画定义 ====================
@keyframes cardSlideUp {
from {
opacity: 0;
transform: translateY(30px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes errorSlideDown {
from {
opacity: 0;
transform: translateY(-10px);
}
to {
opacity: 1;
transform: translateY(0);
}
} }
// 登录页响应式样式配置 - 企业级设计规范 v2.0
export default {
common: {
// 品牌色彩系统 - 紫蓝渐变主题
'--login-primary': '#667eea',
'--login-primary-dark': '#764ba2',
'--login-primary-gradient': 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
'--login-success': '#10b981',
'--login-warning': '#f59e0b',
'--login-error': '#ef4444',
// 中性色阶
'--login-text-primary': '#1a1a2e',
'--login-text-secondary': '#6b7280',
'--login-text-tertiary': '#9ca3af',
'--login-border': '#e5e7eb',
'--login-bg-card': 'rgba(255, 255, 255, 0.98)',
'--login-bg-input': '#fafafa',
// 阴影系统
'--login-shadow-sm': '0 4px 12px rgba(0, 0, 0, 0.08)',
'--login-shadow-md': '0 20px 60px rgba(0, 0, 0, 0.15)',
'--login-shadow-lg': '0 25px 80px rgba(0, 0, 0, 0.2)',
// 圆角系统
'--login-radius-sm': '12px',
'--login-radius-md': '14px',
'--login-radius-lg': '24px',
},
portrait: {
// 竖屏布局参数
'--login-container-width': '100%',
'--login-container-max-width': '420px',
'--login-padding-horizontal': '32px',
'--login-padding-vertical': '40px',
'--login-title-size': '28px',
'--login-subtitle-size': '14px',
'--login-input-height': '52px',
'--login-input-fontsize': '15px',
'--login-btn-height': '52px',
'--login-btn-fontsize': '16px',
// 覆盖全局 padding,让 .layout 的 padding 生效
'--padding': '0px',
},
landscape: {
// 横屏布局参数
'--login-container-width': '100%',
'--login-container-max-width': '420px',
'--login-padding-horizontal': '32px',
'--login-padding-vertical': '40px',
'--login-title-size': '28px',
'--login-subtitle-size': '14px',
'--login-input-height': '52px',
'--login-input-fontsize': '15px',
'--login-btn-height': '52px',
'--login-btn-fontsize': '16px',
// 覆盖全局 padding,让 .layout 的 padding 生效
'--padding': '0px',
},
resolutions: {
// iPad 横屏优化
'landscape-1024x768': {
'--login-container-max-width': '420px',
},
// 小屏 Pad 横屏
'landscape-816x393': {
'--login-container-width': '100%',
'--login-container-max-width': '420px',
},
// 大屏手机竖屏
'portrait-414x896': {
'--login-container-width': '100%',
},
// iPhone 14 Pro 竖屏
'portrait-393x816': {
'--login-container-width': '100%',
},
}
}
.layout {
&.layout-landscape-1920x1080 {
.login {
width: 500px;
padding-top: 30px;
.title {
font-size: 36px;
color: #1e293b;
}
.btn {
height: 54px;
}
}
}
&.layout-landscape-1174x768 {
.login {
width: 470px;
padding-top: 24px;
}
}
&.layout-landscape-common {
.login {
width: 48%;
min-width: 430px;
}
}
}
.layout {
&.layout-portrait-common {
.login {
width: 88%;
margin-top: 94px;
padding: 24px 18px 18px;
.title {
font-size: 28px;
}
}
}
}
...@@ -5,6 +5,7 @@ export const globalScreenVars = { ...@@ -5,6 +5,7 @@ export const globalScreenVars = {
'--color-primary': '#1677FF', '--color-primary': '#1677FF',
'--radius': '8px', '--radius': '8px',
'--opacity': 1, '--opacity': 1,
'--padding': '12px',
}, },
// 竖屏全局 // 竖屏全局
......
...@@ -11,7 +11,7 @@ export function appMixin(app: VueApp) { ...@@ -11,7 +11,7 @@ export function appMixin(app: VueApp) {
}, },
onShow() { onShow() {
// 每个页面显示时统一按设备锁定方向(pad 横屏、手机竖屏),无需各页面或 LayoutRoot 单独写 // 每个页面显示时统一按设备锁定方向(pad 横屏、手机竖屏),无需各页面或 LayoutRoot 单独写
applyScreenOrientationLock(); //applyScreenOrientationLock();
}, },
onLoad() {}, onLoad() {},
onResize() { onResize() {
...@@ -20,8 +20,6 @@ export function appMixin(app: VueApp) { ...@@ -20,8 +20,6 @@ export function appMixin(app: VueApp) {
updateOrientation(); updateOrientation();
} }
}); });
console.log(app);
} }
// export * from "./utils"; // export * from "./utils";
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!