Commit 28721c93 by chenwq

Merge branch 'v1.0.0' of http://192.168.3.233:8090/app/sales-assist-mobile into v1.0.0

2 parents f3af23fd 3303c75c
......@@ -21,8 +21,11 @@
</view>
</view>
<!-- 宫格内容区 -->
<view v-if="modules.length > 0" class="intro-grid-body">
<view class="intro-grid-container">
<scroll-view v-if="modules.length > 0"
class="intro-grid-body"
scroll-y="true"
:show-scrollbar="false">
<view class="intro-grid-container" :style="gridStyleVars">
<view v-for="(item, index) in modules"
:key="index"
class="intro-grid-cell"
......@@ -47,7 +50,7 @@
</view>
</view>
</view>
</view>
</scroll-view>
<!-- 空状态 -->
<view v-else class="intro-grid-empty-wrap">
<un-empty mode="data" :text="emptyDisplayText" />
......@@ -126,6 +129,28 @@ const emptyDisplayText = computed((): string => {
return "暂无数据";
});
/** 宫格列宽:默认 3 列,兼容字符串/数字入参 */
const gridStyleVars = computed((): UTSJSONObject => {
let cols = 3;
const raw = props.gridCol;
if (typeof raw === "number") {
cols = raw as number;
} else if (raw != null && `${raw}` !== "") {
const parsed = parseInt(`${raw}`);
if (!isNaN(parsed)) {
cols = parsed;
}
}
if (cols < 1) {
cols = 1;
} else if (cols > 5) {
cols = 5;
}
return {
"--intro-grid-col-width": `${100 / cols}%`
} as UTSJSONObject;
});
/** 头部标题:取第一个素材的名称 */
const heroTitle = computed((): string => {
const list = props.modules;
......@@ -237,20 +262,32 @@ function onSwitchProductClick(): void {
<style scoped lang="scss">
.intro-grid-custom-wrap {
width: 100%;
height: 100%;
min-height: 0;
position: relative;
display: flex;
flex-direction: column;
box-sizing: border-box;
overflow: hidden;
}
.intro-grid-custom-content {
width: 100%;
height: 100%;
min-height: 0;
border-radius: 0;
background: rgba(255, 255, 255, 0.86);
box-shadow: 0 12px 32px rgba(15, 23, 42, 0.10);
/* 极淡阴影:浅灰容器内的大模糊阴影会显得脏 */
box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
display: flex;
flex-direction: column;
overflow: hidden;
}
.intro-grid-head {
width: 100%;
height: 40px;
flex-shrink: 0;
padding: 0 10px;
box-sizing: border-box;
display: flex;
......@@ -356,6 +393,8 @@ function onSwitchProductClick(): void {
/* 宫格内容区 */
.intro-grid-body {
width: 100%;
flex: 1;
min-height: 0;
padding: 0 8px;
box-sizing: border-box;
}
......@@ -365,10 +404,12 @@ function onSwitchProductClick(): void {
flex-direction: row;
flex-wrap: wrap;
width: 100%;
padding-bottom: 4px;
box-sizing: border-box;
}
.intro-grid-cell {
width: 33.33%;
width: var(--intro-grid-col-width, 33.33%);
box-sizing: border-box;
padding: 4px;
}
......
......@@ -39,6 +39,13 @@
"navigationBarTitleText": "首页"
}
},
{
"path": "pages/index/reception",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "客户接待"
}
},
{
"path": "pages/person/attendance",
"style": {
......
<template>
<view class="content-left">
<list-view class="module-box" :show-scrollbar="false">
<!-- ✅ 性能优化:骨架屏 + 异步加载 -->
<list-item v-if="!logic.loadComplete.value">
<ProductIntroSkeleton />
</list-item>
<list-item v-else>
<ProductIntroGrid
:modules="introModulesForHomeFrame"
eyebrow="展业素材"
empty-title="暂无数据"
:empty-text="boutiqueIntroEmptyText"
@item-tap="onIntroSlideTap" />
</list-item>
</list-view>
<view class="module-box">
<!-- ✅ 性能优化:骨架屏 + 异步加载 -->
<view v-if="!logic.loadComplete.value" class="module-item">
<view class="content-box">
<ProductIntroSkeleton />
</view>
</view>
<view v-else class="module-item">
<view class="content-box">
<ProductIntroGrid
:modules="introModulesForHomeFrame"
eyebrow="展业素材"
empty-title="暂无数据"
:empty-text="boutiqueIntroEmptyText"
@item-tap="onIntroSlideTap" />
</view>
</view>
</view>
<view class="recent-list-wrapper">
<RecentReceptionList />
</view>
......@@ -135,10 +139,18 @@ function closePackageDetail(): void {
flex-shrink: 0;
height: var(--module-box-height, 360px);
width: 100%;
overflow: hidden;
}
.module-box .module-item {
width: 100%;
height: 100%;
}
.module-box .content-box {
width: 100%;
height: 100%;
min-height: 0;
}
.recent-list-wrapper {
......
/* 施工单录入页样式:遵循 UniAppX 规范,px 单位、无 calc/伪元素、font-weight 仅 400|700 */
.page-container {
width: 100%;
height: 100%;
background-color: #f5f6f7;
background-color: #096;
display: flex;
flex-direction: column;
padding-top: 12px;
flex-direction: var(--order-page-direction);
padding: var(--order-page-padding);
box-sizing: border-box;
overflow-y: auto;
}
/* 右侧内容区 */
.order-content {
display:flex;
flex-direction: column;
background-color: #ef4444;
flex: 1;
}
/* 顶部 Tab */
.tab-bar {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-around;
width: auto;
flex-direction: var(--order-tab-direction);
align-items: var(--order-tab-align);
justify-content: var(--order-tab-justify);
width: var(--order-tab-width);
background-color: #ffffff;
border-radius: 12px;
padding: 12px 0;
margin: 0 16px 12px;
padding: var(--order-tab-padding);
margin-right: var(--order-tab-margin-right, 0);
}
.tab-item {
width: var(--order-tab-item-width, auto);
height: var(--order-tab-item-height, auto);
display: flex;
flex-direction: row;
flex-direction: var(--order-tab-direction);
align-items: center;
justify-content: center;
position: relative;
padding: 4px 12px;
padding: var(--order-tab-item-padding);
}
.tab-item .tab-icon {
margin-right: 6px;
margin: var(--order-tab-icon-margin);
}
.tab-item .tab-text {
font-size: 14px;
font-weight: 400;
color: #666666;
margin: var(--order-tab-text-margin);
}
.tab-item.active .tab-text {
......@@ -50,30 +58,38 @@
.tab-item .tab-active-line {
position: absolute;
bottom: -8px;
left: 50%;
margin-left: -10px;
width: 20px;
height: 3px;
bottom: var(--order-tab-line-bottom);
left: var(--order-tab-line-left);
top: var(--order-tab-line-top);
margin: var(--order-tab-line-margin);
width: var(--order-tab-line-width);
height: var(--order-tab-line-height);
background-color: #2c66f7;
border-radius: 2px;
display: var(--order-tab-line-display, block);
}
/* 表单卡片 */
.form-card {
width: auto;
width: var(--order-form-width);
flex: var(--order-form-flex);
background-color: #ffffff;
border-radius: 12px;
padding: 16px;
box-sizing: border-box;
margin: 0 16px 12px;
margin: var(--order-form-margin);
display: var(--order-form-display, flex);
flex-wrap: wrap;
flex-direction: var(--order-form-flex-direction, column);
}
.form-item {
display: flex;
flex-direction: column;
width: 100%;
margin-bottom: 16px;
width: var(--order-form-item-width, 100%);
margin: var(--order-form-item-margin);
padding: 0 16px;
box-sizing: border-box;
flex-shrink: 0;
}
.form-item--last {
......@@ -328,13 +344,13 @@
/* 提交按钮 */
.submit-wrap {
width: 100%;
margin-top: 20px;
padding:16px;
}
.submit-btn {
width: 100%;
height: 48px;
background-color: #22c55e;
background-color: #667eea;
border-radius: 24px;
display: flex;
flex-direction: row;
......@@ -368,12 +384,13 @@
/* 最近录单 */
.recent-section {
width: 100%;
flex: 1;
width: var(--order-recent-width);
flex: var(--order-recent-flex);
background-color: #ffffff;
border-radius: 12px 12px 0 0;
padding: 16px;
box-sizing: border-box;
margin: var(--order-recent-margin);
}
.recent-header {
......
// orderEntry 响应式样式配置 - 横屏时 Tab 在左、表单在右
export default {
common: {},
common: {
// 页面主容器
'--order-page-direction': 'column',
'--order-page-padding': '12px 0 0',
'--order-page-overflow': 'auto',
// Tab 栏
'--order-tab-width': 'auto',
'--order-tab-flex': 'none',
'--order-tab-direction': 'row',
'--order-tab-align': 'center',
'--order-tab-justify': 'space-around',
'--order-tab-padding': '12px 0',
'--order-tab-item-padding': '4px 12px',
'--order-tab-icon-margin': '0 6px 0 0',
'--order-tab-text-margin': '0',
'--order-tab-line-left': '50%',
'--order-tab-line-bottom': '-8px',
'--order-tab-line-top': 'auto',
'--order-tab-line-width': '20px',
'--order-tab-line-height': '3px',
'--order-tab-line-margin': '0 0 0 -10px',
'--order-tab-border-radius':'12px'
// 右侧内容区
'--order-content-width': 'auto',
'--order-content-margin': '0',
'--order-content-flex': '1',
'--order-content-overflow': 'visible',
// 表单卡片
'--order-form-flex': 'none',
'--order-form-width': 'auto',
'--order-form-margin': '0 0 12px',
'--order-form-item-margin': '0 0 16px 0'
// 提交按钮
'--order-submit-margin': '20px 0 0 0',
// 最近录单
'--order-recent-flex': 'none',
'--order-recent-width': 'auto',
'--order-recent-margin': '0',
},
portrait: {
// 竖屏布局参数
// 竖屏:Tab 在顶部,表单在下,保持现有布局
'--order-page-direction': 'column',
'--order-page-padding': '12px 0 0',
'--order-page-overflow': 'auto',
'--order-tab-width': 'auto',
'--order-tab-flex': 'none',
'--order-tab-direction': 'row',
'--order-tab-align': 'center',
'--order-tab-justify': 'space-around',
'--order-tab-padding': '12px 0',
'--order-tab-item-padding': '4px 12px',
'--order-tab-icon-margin': '0 6px 0 0',
'--order-tab-text-margin': '0',
'--order-tab-line-left': '50%',
'--order-tab-line-bottom': '-8px',
'--order-tab-line-top': 'auto',
'--order-tab-line-width': '20px',
'--order-tab-line-height': '3px',
'--order-tab-line-margin': '0 0 0 -10px',
'--order-content-width': 'auto',
'--order-content-margin': '0',
'--order-content-flex': 'none',
'--order-content-overflow': 'visible',
'--order-form-flex': 'none',
'--order-form-width': 'auto',
'--order-form-margin': '0 16px 12px',
'--order-submit-margin': '20px 0 0',
'--order-recent-flex': 'none',
'--order-recent-width': 'auto',
'--order-recent-margin': '0',
},
landscape: {
// 横屏布局参数
// 横屏:Tab 在左,表单在右
'--order-page-direction': 'row',
'--order-page-padding': '12px 0 12px 0',
'--order-page-overflow': 'hidden',
'--order-tab-width': '40px',
'--order-tab-flex': 'none',
'--order-tab-direction': 'column',
'--order-tab-align': 'flex-start',
'--order-tab-justify': 'flex-start',
'--order-tab-padding': '16px 0',
'--order-tab-margin-right': '16px',
'--order-tab-item-padding': '12px 16px',
'--order-tab-icon-margin': '0 0 6px 0',
'--order-tab-text-margin': '0 0 4px 0',
'--order-tab-line-left': '4px',
'--order-tab-line-bottom': 'auto',
'--order-tab-line-top': '50%',
'--order-tab-line-width': '3px',
'--order-tab-line-height': '20px',
'--order-tab-line-margin': '-10px 0 0 0',
'--order-content-width': '0',
'--order-content-margin': '0 16px 0 16px',
'--order-content-flex': '1',
'--order-content-overflow': 'auto',
'--order-form-flex': 'none',
'--order-form-width': 'auto',
'--order-form-margin': '0 0 12px',
'--order-submit-margin': '24px 0 0',
'--order-recent-flex': '1',
'--order-recent-width': '100%',
'--order-recent-margin': '0',
'--order-tab-item-width': '100%',
'--order-tab-border-radius':'12px 12px 12px 12px',
'--order-tab-line-display':'none',
'--order-form-display': 'flex',
'--order-form-item-width': '50%',
'--order-form-flex-direction': 'row',
'--order-form-item-margin': '0 16px 16px',
'--order-form-item-padding': '0 16px'
},
resolutions: {
// 大屏平板横屏 (1174x768)
'landscape-1174x768': {
'--order-tab-width': '100px',
'--order-tab-padding': '20px 0',
'--order-tab-item-padding': '14px 20px',
'--order-tab-item-height': '33%',
},
// 小屏 Pad 横屏 (816x393)
'landscape-816x393': {
'--order-tab-width': '120px',
'--order-tab-padding': '10px 0',
'--order-tab-item-padding': '8px 10px',
},
// 大屏平板竖屏 (768x1174)
'portrait-768x1174': {
'--order-tab-padding': '14px 0',
'--order-tab-item-padding': '6px 16px',
},
}
}
export default {
common: {
'--store-page-padding-x': '16px',
'--store-page-padding-y': '14px',
'--store-section-gap': '12px',
'--store-panel-radius': '18px',
'--store-panel-padding': '14px',
'--store-card-radius': '16px',
'--store-card-min-height': '92px',
'--store-title-size': '24px',
'--store-subtitle-size': '13px',
'--store-stat-width': '120px',
'--store-banner-layout': 'row',
},
portrait: {
'--store-page-padding-x': '14px',
'--store-page-padding-y': '12px',
'--store-banner-layout': 'column',
'--store-stat-width': '100%',
},
landscape: {
'--store-page-padding-x': '18px',
'--store-page-padding-y': '12px',
'--store-banner-layout': 'row',
'--store-stat-width': '132px',
},
resolutions: {
'portrait-393x816': {
'--store-page-padding-x': '12px',
'--store-page-padding-y': '10px',
'--store-panel-padding': '12px',
'--store-title-size': '22px'
},
'portrait-414x736': {
'--store-page-padding-x': '12px',
'--store-page-padding-y': '10px'
},
'landscape-816x393': {
'--store-page-padding-x': '10px',
'--store-page-padding-y': '8px',
'--store-panel-padding': '10px',
'--store-card-min-height': '82px',
'--store-stat-width': '112px'
},
'landscape-1024x640': {
'--store-stat-width': '120px'
},
'landscape-1174x768': {
'--store-page-padding-x': '20px',
'--store-stat-width': '140px'
}
}
}
......@@ -42,27 +42,21 @@ async function onStartClick(): Promise<void> {
return;
}
// 2. 获取 typeCode:优先使用传入值,否则从 storage 读取
let typeCode = props.typeCode;
if (typeCode === "") {
const typeItem = storage.get("typeItem") as UTSJSONObject | null;
if (typeItem != null) {
const tc = typeItem["typeCode"] as string | null;
typeCode = tc != null ? tc : "";
}
}
// 3. 校验 typeCode
if (typeCode === "") {
uni.showToast({ title: "请先加载或选择产品类型", icon: "none" });
return;
}
// // 2. 获取 typeCode:优先使用传入值,否则从 storage 读取
// let typeCode = props.typeCode;
// if (typeCode === "") {
// const typeItem = storage.get("typeItem") as UTSJSONObject | null;
// if (typeItem != null) {
// const tc = typeItem["typeCode"] as string | null;
// typeCode = tc != null ? tc : "";
// }
// }
// 4. 统一跳转接待详情页
const q = `typeCode=${encodeURIComponent(typeCode)}&type=edit`;
uni.navigateTo({ url: `/pages/equity/detail/index?${q}` });
// 3. 跳转接待页:有 typeCode 时加载当前产品素材,无 typeCode 时回退通用素材
// const q = typeCode !== "" ? `?typeCode=${encodeURIComponent(typeCode)}` : "";
uni.navigateTo({ url: `/pages/index/reception` });
// 5. 通知外部
// 4. 通知外部
emit("start");
}
</script>
......
// 客户接待页响应式变量:方向/分辨率维度由 useScreenVars 自动合并
// 设计规范(对齐 .qoder 规则):
// - 卡片用 1px 边框分隔,不使用 box-shadow,保证 App 端干净自然
// - 横竖屏差异用 CSS 变量承载(margin/宽度/列宽),避免后代选择器
export default {
common: {
// 页面左右/下内边距(顶部单独使用 --desk-shell-padding-top)
"--desk-shell-padding": "14px",
// 顶部内边距:紧贴导航栏占位,避免间距过大
"--desk-shell-padding-top": "2px",
// 面板间距
"--desk-panel-gap": "10px",
// 面板圆角
"--desk-panel-radius": "16px",
// 面板内边距
"--desk-panel-padding": "12px",
// 表单字段高度/间距/字号(紧凑优先)
"--desk-field-height": "42px",
"--desk-field-gap": "6px",
"--desk-field-label-size": "12px",
"--desk-field-input-size": "14px",
// 客户资料区:默认竖屏两行 3+2
"--desk-form-major-col-width": "33.33%",
"--desk-form-minor-col-width": "50%",
// 客户面板宽度:竖屏整行,横屏固定宽度
"--desk-customer-panel-width": "100%",
// 客户面板与素材面板的间距(方向不同,用 margin 变量表达)
"--desk-customer-panel-margin-right": "0px",
"--desk-customer-panel-margin-bottom": "12px"
},
portrait: {
"--desk-panel-gap": "12px",
"--desk-customer-panel-width": "100%",
"--desk-customer-panel-margin-right": "0px",
"--desk-customer-panel-margin-bottom": "12px"
},
landscape: {
// 横屏:1 字段 1 行,利用左侧充足高度换取更好的录入宽度
"--desk-form-major-col-width": "100%",
"--desk-form-minor-col-width": "100%",
"--desk-customer-panel-width": "340px",
"--desk-customer-panel-margin-right": "10px",
"--desk-customer-panel-margin-bottom": "0px",
"--desk-field-gap": "10px"
},
resolutions: {
// 手机竖屏:更紧凑
"portrait-393x816": {
"--desk-shell-padding": "10px",
"--desk-panel-padding": "10px",
"--desk-field-height": "40px",
"--desk-field-gap": "6px"
},
"portrait-414x736": {
"--desk-shell-padding": "10px",
"--desk-field-height": "40px",
"--desk-field-gap": "6px"
},
// 平板竖屏:字段两列
"portrait-768x1174": {
"--desk-form-major-col-width": "33.33%",
"--desk-form-minor-col-width": "50%",
"--desk-shell-padding": "16px"
},
// 小屏 Pad 横屏:压缩面板
"landscape-816x393": {
"--desk-shell-padding": "8px",
"--desk-panel-gap": "8px",
"--desk-customer-panel-width": "300px",
"--desk-panel-padding": "10px",
"--desk-field-height": "40px",
"--desk-field-gap": "8px"
},
"landscape-1024x640": {
"--desk-customer-panel-width": "320px",
"--desk-field-gap": "10px"
},
"landscape-1174x768": {
"--desk-customer-panel-width": "360px",
"--desk-field-gap": "12px"
}
}
}
import { getPadMaterialListApi } from "@/api/common-api.uts";
import { getContents } from "@/api/modules/contents.uts";
export type CustomerReceptionForm = {
customerName: string
phoneNumber: string
plateNumber: string
carBrand: string
carSeries: string
}
const _emptyArr: any[] = [] as any[];
export function createEmptyReceptionForm(): CustomerReceptionForm {
return {
customerName: "",
phoneNumber: "",
plateNumber: "",
carBrand: "",
carSeries: ""
};
}
function toStr(value: any | null): string {
if (value == null) {
return "";
}
return `${value}`;
}
function readShukeDataArray(res: any | null): any[] {
if (res == null) {
return _emptyArr.slice();
}
const root = res as UTSJSONObject;
const data = root["data"];
if (data != null && Array.isArray(data)) {
return data as any[];
}
return _emptyArr.slice();
}
function buildPadMaterialRows(list: any[]): any[] {
const rows: any[] = _emptyArr.slice();
for (let i = 0; i < list.length; i++) {
const raw = list[i] as UTSJSONObject;
const title = readMaterialTitle(raw);
rows.push({
id: raw["id"],
materialName: title,
title: title,
name: title,
contentType: raw["contentType"],
contentTypeName: raw["contentTypeName"],
coverUrl: toStr(raw["coverUrl"]),
thumbnailUrl: toStr(raw["thumbnailUrl"]),
detailUrl: toStr(raw["detailUrl"]),
materialUrl: toStr(raw["materialUrl"])
} as UTSJSONObject);
}
return rows;
}
function buildContentRows(list: any[]): any[] {
const rows: any[] = _emptyArr.slice();
for (let i = 0; i < list.length; i++) {
const raw = list[i] as UTSJSONObject;
const title = readMaterialTitle(raw);
const coverUrl = toStr(raw["coverUrl"]);
rows.push({
id: raw["id"],
materialName: title,
title: title,
name: title,
contentType: raw["contentType"],
contentTypeName: toStr(raw["contentTypeName"]),
coverUrl: coverUrl,
bannerImg: coverUrl,
materialUrl: toStr(raw["bodyUrl"])
} as UTSJSONObject);
}
return rows;
}
export function readMaterialTitle(item: any | null): string {
if (item == null) {
return "";
}
const obj = item as UTSJSONObject;
return (
(obj["detailTitle"] as null | string)
?? (obj["materialTitle"] as null | string)
?? (obj["shortTitle"] as null | string)
?? (obj["materialName"] as null | string)
?? (obj["title"] as null | string)
?? (obj["name"] as null | string)
?? ""
);
}
export function readMaterialCoverUrl(item: any | null): string {
if (item == null) {
return "";
}
const obj = item as UTSJSONObject;
const candidates = [
obj["coverUrl"],
obj["bannerImg"],
obj["thumbnail"],
obj["thumbnailUrl"],
obj["imageUrl"],
obj["imgUrl"],
obj["detailUrl"]
];
for (let i = 0; i < candidates.length; i++) {
const value = candidates[i];
if (value != null && typeof value === "string" && `${value}` !== "") {
return `${value}`;
}
}
return "";
}
export function readMaterialPreviewUrl(item: any | null): string {
if (item == null) {
return "";
}
const obj = item as UTSJSONObject;
const candidates = [
obj["materialUrl"],
obj["detailUrl"],
obj["bodyUrl"],
obj["contentPicUrl"],
obj["coverUrl"],
obj["thumbnailUrl"]
];
for (let i = 0; i < candidates.length; i++) {
const value = candidates[i];
if (value != null && typeof value === "string" && `${value}` !== "") {
return `${value}`;
}
}
return "";
}
export function buildCustomerInfoPayload(form: CustomerReceptionForm): UTSJSONObject {
return {
customerName: form.customerName,
phoneNumber: form.phoneNumber,
carPlateNumber: form.plateNumber,
carBrand: form.carBrand,
carModel: form.carSeries
} as UTSJSONObject;
}
/**
* 优先加载当前 typeCode 对应的 Pad 首页素材,若未配置则回退到通用展业素材。
*/
export async function loadReceptionMaterials(typeCode: string): Promise<any[]> {
if (typeCode != null && typeCode !== "") {
try {
const shukeHomeRes = await getPadMaterialListApi({
typeCode: typeCode,
status: 0,
showOnHomepage: 1
} as UTSJSONObject);
const padRows = buildPadMaterialRows(readShukeDataArray(shukeHomeRes));
if (padRows.length > 0) {
return padRows;
}
const shukeAllRes = await getPadMaterialListApi({
typeCode: typeCode,
status: 0
} as UTSJSONObject);
const allRows = buildPadMaterialRows(readShukeDataArray(shukeAllRes));
if (allRows.length > 0) {
return allRows;
}
} catch (e) {
console.warn("[ReceptionDesk] load pad materials failed", e);
}
}
try {
const contentRes = await getContents({} as UTSJSONObject);
if (contentRes == null) {
return _emptyArr.slice();
}
const root = contentRes as UTSJSONObject;
const list = root["list"];
if (list != null && Array.isArray(list)) {
return buildContentRows(list as any[]);
}
} catch (e) {
console.warn("[ReceptionDesk] load fallback contents failed", e);
}
return _emptyArr.slice();
}
<template>
<view class="person-page">
<!-- <scroll-view class="person-scroll" :scroll-y="true" :show-scrollbar="false"> -->
<!-- ✅ 统一布局:通过 CSS 变量控制单列/分栏 -->
<view class="person-unified-layout">
<!-- 左侧/上方:用户资料 + 账号信息 -->
<view class="person-primary-panel">
<!-- 用户资料卡片 -->
<ProfileCard
:user-name="userName"
:plain-phone="plainPhone"
:shop-name="shopName"
:avatar-text="avatarText" />
<!-- 账号信息 -->
<AccountInfo
:user-name="userName"
:shop-name="shopName"
:shop-merchant-id="shopMerchantId"
:plain-phone="plainPhone" />
</view>
<!-- 右侧/下方:常用功能 -->
<view class="person-secondary-panel">
<CommonFunctions
@select-store="goSelectStore"
@attendance="goAttendance"
@setting="onSetting"
@reception-entry="goReceptionCenter" />
</view>
<view class="person-page" :style="screenVars">
<scroll-view class="person-scroll" :scroll-y="true" :show-scrollbar="false">
<view class="person-scroll-body">
<view :class="personDashboardClassName">
<view class="person-primary-panel">
<view class="person-stack-card person-stack-card-first">
<ProfileCard
:user-name="displayName"
:plain-phone="displayPhone"
:shop-name="displayStoreName"
:avatar-text="avatarText"
:avatar-size="avatarSizeValue"
:avatar-font-size="avatarFontSizeValue" />
</view>
<view class="person-stack-card">
<AccountInfo
:user-name="displayName"
:shop-name="displayStoreName"
:shop-merchant-id="displayStoreCode"
:plain-phone="displayPhone" />
</view>
</view>
<view :class="personSecondaryClassName">
<view class="person-stack-card person-stack-card-first">
<CommonFunctions
@select-store="goSelectStore"
@attendance="goAttendance"
@setting="onSetting"
@reception-entry="goReceptionCenter" />
</view>
</view>
</view>
</view>
<!-- ✅ APP 编码页脚(固定在 scroll-view 底部正中间) -->
<view class="device-id-footer" @click="copyDeviceId">
<text class="device-id-footer-text">APP编码: {{ deviceId }}</text>
<un-icon name="fingerprint" size="16" color="#9ca3af" />
</view>
<!-- </scroll-view> -->
</scroll-view>
<view class="device-id-panel"
hover-class="device-id-panel-hover"
@click="copyDeviceId">
<text class="device-id-panel-text">APP编码: {{ deviceId }}</text>
<un-icon name="fingerprint" size="16" color="#94a3b8" />
</view>
<SettingBox :visible="showSetting"
@update:visible="onSettingVisible" />
</view>
</template>
<script setup lang="uts">
import { computed, onMounted, ref } from "vue";
import { computed, onMounted, ref, nextTick } from "vue";
import { navigateToSelectStoreWithSessionStores } from "@/utils/shukeSelectStoreNav.uts";
import { useOrientation, useScreenVars } from "@/services/adapter/hooks";
import SettingBox from "./SettingBox.uvue";
import ProfileCard from "./components/ProfileCard.uvue";
import AccountInfo from "./components/AccountInfo.uvue";
import CommonFunctions from "./components/CommonFunctions.uvue";
import { resolveHomeFrameDisplayName } from "@/components/TabBar/tabbarShared.uts";
import { toObj,toStr, type ObjOrNull } from "@/utils/common.uts";
import pageVars from "./styles/index.vars.uts";
import { toObj,toStr } from "@/utils/common.uts";
import { storage } from "@/utils/storage.uts";
const emit = defineEmits<{
......@@ -60,6 +65,8 @@ const emit = defineEmits<{
}>();
const showSetting = ref(false);
const screenVars = useScreenVars(pageVars);
const orientation = useOrientation();
// ✅ 修复响应式:使用 ref 确保视图能正确更新
const userName = ref<string>("");
......@@ -69,6 +76,42 @@ const shopMerchantId = ref<string>("");
const avatarText = ref<string>("我");
const deviceId = ref<string>("");
const displayName = computed((): string => {
return userName.value != "" ? userName.value : "当前账号";
});
const displayStoreName = computed((): string => {
return shopName.value != "" ? shopName.value : "未绑定门店";
});
const displayPhone = computed((): string => {
return plainPhone.value != "" ? plainPhone.value : "未填写手机号";
});
const displayStoreCode = computed((): string => {
return shopMerchantId.value != "" ? shopMerchantId.value : "--";
});
const personDashboardClassName = computed((): string => {
return orientation.isPortrait.value ? "person-dashboard person-dashboard-portrait person-dashboard-first" : "person-dashboard person-dashboard-first";
});
const personSecondaryClassName = computed((): string => {
return orientation.isPortrait.value ? "person-secondary-panel person-secondary-panel-portrait" : "person-secondary-panel";
});
const avatarSizeValue = computed((): string => {
const vars = screenVars.value as UTSJSONObject;
const value = vars["--person-avatar-size"] as string | null;
return value != null && value != "" ? value : "56";
});
const avatarFontSizeValue = computed((): string => {
const vars = screenVars.value as UTSJSONObject;
const value = vars["--person-avatar-font-size"] as string | null;
return value != null && value != "" ? value : "22";
});
/**
* 从 storage 获取并提取用户信息
*/
......@@ -126,15 +169,11 @@ function copyDeviceId(): void {
// ✅ 组件挂载完成后通知父组件
onMounted(() => {
// ✅ 修复白屏:直接从 storage 获取用户信息,不依赖 props
extractUserInfo();
// ✅ 获取设备 ID(APP 编码)
getDeviceId();
// ✅ 延迟一小段时间确保 DOM 渲染完成
setTimeout(() => {
void nextTick(() => {
emit('loaded');
}, 16); // 约 16ms,一个帧的时间
});
});
function onSettingVisible(v: boolean): void {
......
......@@ -24,7 +24,7 @@
<view class="btn-item btn-item-primary" @tap="changeAccount">
<text class="btn-item-text btn-item-text-primary">切换账号</text>
</view>
<view class="btn-item btn-item-ghost" @tap="handleLogout">
<view class="btn-item btn-item-ghost btn-item-last" @tap="handleLogout">
<text class="btn-item-text btn-item-text-ghost">退出</text>
</view>
</view>
......@@ -155,11 +155,13 @@ const panelStyle = computed<UTSJSONObject>(() => {
<style scoped lang="scss">
.setting-panel {
// ✅ UVUE 不支持 vw 单位,width 通过 panelStyle 动态计算
width: 100%;
border-radius: 18px;
overflow: hidden;
background: #ffffff;
box-shadow: none;
// border-width: 1px;
// border-style: solid;
// border-color: #e2e8f0;
margin: 0 auto;
}
......@@ -181,14 +183,13 @@ const panelStyle = computed<UTSJSONObject>(() => {
.logo-placeholder {
width: 68px;
height: 68px;
background: #1677ff;
background: #2c66f7;
border-radius: 18px;
margin-bottom: 10px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-shadow: 0 8px 18px rgba(22, 119, 255, 0.28);
}
.logo-text {
......@@ -199,21 +200,26 @@ const panelStyle = computed<UTSJSONObject>(() => {
.app-name {
font-size: 19px;
line-height: 24px;
font-weight: 700;
color: #1e293b;
color: #0f172a;
margin-bottom: 4px;
}
.version {
font-size: 12px;
color: #8391a7;
line-height: 16px;
color: #64748b;
}
.version-bar {
width: 100%;
height: 44px;
border-radius: 12px;
background-color: #eef5ff;
background-color: #f8fbff;
border-width: 1px;
border-style: solid;
border-color: #dbe6f7;
padding: 0 12px;
box-sizing: border-box;
display: flex;
......@@ -225,13 +231,14 @@ const panelStyle = computed<UTSJSONObject>(() => {
.version-bar-text {
font-size: 12px;
color: #5f7ea8;
line-height: 16px;
color: #64748b;
}
.check-btn {
height: 28px;
padding: 0 12px;
background: #eaf2ff;
background: #eef4ff;
border-radius: 14px;
display: flex;
flex-direction: row;
......@@ -241,7 +248,8 @@ const panelStyle = computed<UTSJSONObject>(() => {
.check-btn-text {
font-size: 12px;
color: #1677ff;
line-height: 16px;
color: #2c66f7;
font-weight: 600;
}
......@@ -261,28 +269,29 @@ const panelStyle = computed<UTSJSONObject>(() => {
flex-direction: row;
align-items: center;
justify-content: center;
margin-bottom: 12px;
}
.btn-item:last-child {
margin-bottom: 0;
margin-bottom: 12px;
}
.btn-item-primary {
background: #1677ff;
box-shadow: 0 8px 16px rgba(22, 119, 255, 0.24);
background: #2c66f7;
}
.btn-item-ghost {
background: #ffffff;
border: none;
border-width: 1px;
border-style: solid;
border-color: #dbe4f0;
}
.btn-item-last {
margin-bottom: 0;
}
.btn-item-text {
font-size: 14px;
line-height: 18px;
font-weight: 600;
opacity: 1;
// ✅ UVUE 不支持 display: block,父元素已是 flex,子元素默认为块级
}
.btn-item-text-primary {
......@@ -290,9 +299,6 @@ const panelStyle = computed<UTSJSONObject>(() => {
}
.btn-item-text-ghost {
color: #1e293b;
color: #0f172a;
}
// ✅ UVUE 只支持类名选择器,不能使用后代选择器 .setting-panel text
// opacity: 1 是默认值,无需设置
</style>
<template>
<InfoSection title="账号信息" :border="true">
<un-cell title="姓名" :value="userName" icon="account-fill" size="large"/>
<un-cell title="门店" :value="shopName" icon="home-fill" size="large"/>
<un-cell title="门店号" :value="shopMerchantId" icon="file-text-fill" size="large"/>
<un-cell title="手机号" :value="plainPhone" icon="phone-fill" size="large"/>
<InfoSection title="账号信息" subtitle="当前登录账号与门店基础信息">
<view class="account-section">
<view class="account-row">
<text class="account-row-label">姓名</text>
<text class="account-row-value">{{ userName }}</text>
</view>
<view class="account-row">
<text class="account-row-label">门店</text>
<text class="account-row-value">{{ shopName }}</text>
</view>
<view class="account-row">
<text class="account-row-label">门店号</text>
<text class="account-row-value">{{ shopMerchantId }}</text>
</view>
<view class="account-row account-row-last">
<text class="account-row-label">手机号</text>
<text class="account-row-value">{{ plainPhone }}</text>
</view>
</view>
</InfoSection>
</template>
......@@ -17,3 +31,53 @@ defineProps<{
plainPhone: string
}>()
</script>
<style scoped lang="scss">
.account-section {
width: 100%;
display: flex;
flex-direction: column;
box-sizing: border-box;
}
.account-row {
width: 100%;
min-height: var(--person-row-height, 52px);
border-radius: 12px;
border-width: 1px;
border-style: solid;
border-color: #e8edf5;
background-color: #fbfdff;
display: flex;
flex-direction: row;
align-items: center;
padding: 0 14px;
box-sizing: border-box;
margin-top: 10px;
}
.account-row-last {
margin-bottom: 0;
}
.account-row-label {
flex-shrink: 0;
width: var(--person-row-label-width, 72px);
font-size: 13px;
line-height: 18px;
font-weight: 600;
color: var(--person-text-secondary, #475569);
}
.account-row-value {
flex: 1;
min-width: 0;
font-size: 14px;
line-height: 18px;
font-weight: 600;
color: var(--person-text-primary, #0f172a);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
</style>
<template>
<InfoSection title="常用功能" :border="false">
<un-cell title="接待记录"
icon="chat-fill"
isLink
clickable
@click="onReceptionEntry"
size="large" />
<un-cell title="选择门店"
icon="home-fill"
isLink
clickable
@click="onSelectStore"
size="large" />
<un-cell title="个人考勤"
icon="clock-fill"
isLink
clickable
@click="onAttendance"
size="large" />
<un-cell title="系统设置"
icon="setting-fill"
isLink
@click="onSetting"
size="large" />
<InfoSection title="常用功能" subtitle="进入常用业务入口与设置管理">
<view class="function-list">
<view class="function-row"
hover-class="function-row-hover"
@click="onReceptionEntry">
<view class="function-row-main">
<text class="function-row-title">接待记录</text>
<text class="function-row-desc">查看接待相关入口与记录</text>
</view>
<un-icon name="arrow-right" size="16" color="#94a3b8" />
</view>
<view class="function-row"
hover-class="function-row-hover"
@click="onSelectStore">
<view class="function-row-main">
<text class="function-row-title">选择门店</text>
<text class="function-row-desc">切换当前登录门店</text>
</view>
<un-icon name="arrow-right" size="16" color="#94a3b8" />
</view>
<view class="function-row"
hover-class="function-row-hover"
@click="onAttendance">
<view class="function-row-main">
<text class="function-row-title">个人考勤</text>
<text class="function-row-desc">查看考勤与打卡信息</text>
</view>
<un-icon name="arrow-right" size="16" color="#94a3b8" />
</view>
<view class="function-row function-row-last"
hover-class="function-row-hover"
@click="onSetting">
<view class="function-row-main">
<text class="function-row-title">系统设置</text>
<text class="function-row-desc">检查版本并管理账号</text>
</view>
<un-icon name="arrow-right" size="16" color="#94a3b8" />
</view>
</view>
</InfoSection>
</template>
......@@ -52,3 +67,59 @@ function onReceptionEntry(): void {
emit('receptionEntry')
}
</script>
<style scoped lang="scss">
.function-list {
width: 100%;
display: flex;
flex-direction: column;
box-sizing: border-box;
}
.function-row {
width: 100%;
min-height: 62px;
border-radius: 14px;
border-width: 1px;
border-style: solid;
border-color: #e8edf5;
background-color: #fbfdff;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 0 14px;
box-sizing: border-box;
margin-top: 10px;
}
.function-row-hover {
opacity: 0.92;
}
.function-row-last {
margin-bottom: 0;
}
.function-row-main {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
margin-right: 12px;
}
.function-row-title {
font-size: 15px;
line-height: 20px;
font-weight: 700;
color: var(--person-text-primary, #0f172a);
}
.function-row-desc {
margin-top: 4px;
font-size: 12px;
line-height: 16px;
color: var(--person-text-secondary, #475569);
}
</style>
<template>
<view class="section-shell">
<view class="section-title">{{ title }}</view>
<un-cell-group :border="border" round="0" backgroundColor="transparent">
<view class="section-head">
<view class="section-title-row">
<view class="section-title-bar"></view>
<text class="section-title">{{ title }}</text>
</view>
<text v-if="subtitle !== ''" class="section-subtitle">{{ subtitle }}</text>
</view>
<view class="section-body">
<slot></slot>
</un-cell-group>
</view>
</view>
</template>
<script setup lang="uts">
defineProps<{
withDefaults(defineProps<{
title: string
subtitle?: string
border?: boolean
}>()
}>(), {
subtitle: "",
border: true
})
</script>
<style scoped lang="scss">
.section-shell {
background-color: var(--person-bg-card, #ffffff);
border: 1px solid var(--person-border, #dfe9f7);
border-radius: var(--person-radius-lg, 16px);
padding: var(--person-spacing-lg, 16px) 10px;
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;
width: 100%;
min-height: 0;
background-color: transparent;
box-sizing: border-box;
}
.section-head {
display: flex;
flex-direction: column;
margin-bottom: 12px;
}
.section-title-row {
display: flex;
flex-direction: row;
align-items: center;
}
.section-title-bar {
width: 4px;
height: 14px;
border-radius: 2px;
background-color: var(--person-primary, #2c66f7);
margin-right: 8px;
}
.section-title {
font-size: var(--person-section-title-size, 15px);
font-weight: var(--person-section-title-weight, 600);
color: var(--person-text-primary, #1a2433);
margin-bottom: var(--person-spacing-md, 12px);
flex-shrink: 0;
line-height: 20px;
font-weight: 700;
color: var(--person-text-primary, #0f172a);
}
.section-shell :deep(.uni-cell-group) {
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;
.section-subtitle {
margin-top: 4px;
font-size: var(--person-section-desc-size, 12px);
line-height: 16px;
color: var(--person-text-secondary, #475569);
}
/* ✅ 强制显示所有 un-cell 的下边框(包括最后一个) */
.section-shell :deep(.uni-cell) {
border-bottom: 1px solid #e5e7eb !important;
.section-body {
display: flex;
flex-direction: column;
width: 100%;
box-sizing: border-box;
}
</style>
<template>
<view class="profile-card">
<view class="profile-head">
<un-avatar :text="avatarText"
shape="circle"
:size="avatarSize"
bgColor="#2f6af7"
color="#ffffff"
:fontSize="avatarFontSize" />
<view class="profile-main">
<text class="profile-name">{{ userName }}</text>
<text class="profile-meta">{{ plainPhone }}</text>
<view class="profile-top">
<view class="profile-badge">
<text class="profile-badge-text">账号概览</text>
</view>
<view class="profile-head">
<un-avatar :text="avatarText"
shape="circle"
:size="avatarSize"
bgColor="#2c66f7"
color="#ffffff"
:fontSize="avatarFontSize" />
<view class="profile-main">
<text class="profile-name">{{ userName }}</text>
<text class="profile-meta">{{ plainPhone }}</text>
</view>
</view>
</view>
<view class="profile-divider"></view>
<view class="profile-shop-row">
<text class="profile-shop-label">当前门店</text>
<text class="profile-shop-value">{{ shopName }}</text>
<view class="profile-info-grid">
<view class="profile-info-item">
<text class="profile-shop-label">当前门店</text>
<text class="profile-shop-value">{{ shopName }}</text>
</view>
<view class="profile-info-item profile-info-item-right">
<text class="profile-shop-label">账号状态</text>
<text class="profile-shop-value">正常</text>
</view>
</view>
</view>
</template>
......@@ -36,18 +47,42 @@ const props = withDefaults(defineProps<{
<style scoped lang="scss">
.profile-card {
background-color: var(--person-bg-card, #ffffff);
border: 1px solid var(--person-border, #dfe9f7);
border-radius: var(--person-radius-lg, 16px);
padding: var(--person-profile-padding, 14px);
flex-shrink: 0;
margin-bottom: 16px;
width: 100%;
display: flex;
flex-direction: column;
background-color: transparent;
box-sizing: border-box;
}
.profile-top {
display: flex;
flex-direction: column;
}
.profile-badge {
width: 70px;
height: 24px;
border-radius: 12px;
background-color: var(--person-primary-soft, #eef4ff);
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
}
.profile-badge-text {
font-size: 11px;
line-height: 14px;
font-weight: 700;
color: var(--person-primary, #2c66f7);
}
.profile-head {
display: flex;
flex-direction: row;
align-items: center;
margin-top: 12px;
}
.profile-main {
......@@ -55,21 +90,24 @@ const props = withDefaults(defineProps<{
min-width: 0;
display: flex;
flex-direction: column;
margin-left: var(--person-spacing-md, 4px);
margin-left: 12px;
}
.profile-name {
font-size: var(--person-name-size, 19px);
font-weight: 600;
color: var(--person-text-primary, #1a2433);
line-height: 24px;
font-weight: 700;
color: var(--person-text-primary, #0f172a);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.profile-meta {
margin-top: 4px;
font-size: var(--person-meta-size, 13px);
color: var(--person-text-secondary, #64748b);
line-height: 18px;
color: var(--person-text-secondary, #475569);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
......@@ -78,25 +116,41 @@ const props = withDefaults(defineProps<{
.profile-divider {
height: 1px;
background-color: var(--person-border, #dfe9f7);
margin-top: var(--person-spacing-md, 12px);
margin-bottom: var(--person-spacing-md, 12px);
margin-top: 14px;
margin-bottom: 14px;
}
.profile-shop-row {
.profile-info-grid {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
align-items: stretch;
}
.profile-info-item {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
}
.profile-info-item-right {
margin-left: 12px;
}
.profile-shop-label {
font-size: var(--person-shop-label-size, 12px);
color: var(--person-text-tertiary, #94a3b8);
font-size: 12px;
line-height: 16px;
color: var(--person-text-tertiary, #94a3b8);
}
.profile-shop-value {
font-size: var(--person-shop-value-size, 14px);
color: var(--person-text-primary, #1a2433);
font-weight: 500;
margin-top: 4px;
font-size: 14px;
line-height: 18px;
color: var(--person-text-primary, #0f172a);
font-weight: 600;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
</style>
......@@ -7,7 +7,7 @@
<view class="skeleton-avatar-circle" style="margin-right: 12px"></view>
<view class="skeleton-text-group">
<view class="skeleton-line skeleton-line-short"></view>
<view class="skeleton-line skeleton-line-medium"></view>
<view class="skeleton-line skeleton-line-medium skeleton-line-last"></view>
</view>
</view>
<view class="skeleton-divider"></view>
......@@ -23,21 +23,21 @@
<view class="skeleton-line skeleton-line-md"></view>
</view>
<view class="skeleton-cell-group">
<view class="skeleton-cell-item">
<view class="skeleton-cell-item skeleton-cell-item-last">
<view class="skeleton-row-with-avatar-small">
<view class="skeleton-avatar-square" style="margin-right: 8px"></view>
<view class="skeleton-text-group-horizontal">
<view class="skeleton-line skeleton-line-sm"></view>
<view class="skeleton-line skeleton-line-md"></view>
<view class="skeleton-line skeleton-line-md skeleton-line-last"></view>
</view>
</view>
</view>
<view class="skeleton-cell-item">
<view class="skeleton-cell-item skeleton-cell-item-last">
<view class="skeleton-row-with-avatar-small">
<view class="skeleton-avatar-square" style="margin-right: 8px"></view>
<view class="skeleton-text-group-horizontal">
<view class="skeleton-line skeleton-line-sm"></view>
<view class="skeleton-line skeleton-line-md"></view>
<view class="skeleton-line skeleton-line-md skeleton-line-last"></view>
</view>
</view>
</view>
......@@ -100,8 +100,11 @@ const props = defineProps<{
<style scoped>
.person-skeleton {
display: flex;
padding: 16px;
flex-direction: column;
background-color: #F3F6FB;
box-sizing: border-box;
}
.person-skeleton-landscape {
......@@ -130,12 +133,15 @@ const props = defineProps<{
/* 区块标题 */
.skeleton-section-title {
display: flex;
flex-direction: row;
margin-bottom: 12px;
padding-left: 4px;
}
/* Cell 组 */
.skeleton-cell-group {
display: flex;
flex-direction: column;
}
......@@ -144,7 +150,7 @@ const props = defineProps<{
margin-bottom: 12px;
}
.skeleton-cell-item:last-child {
.skeleton-cell-item-last {
margin-bottom: 0;
}
......@@ -160,7 +166,7 @@ const props = defineProps<{
margin-bottom: 8px;
}
.skeleton-line:last-child {
.skeleton-line-last {
margin-bottom: 0;
}
......@@ -209,24 +215,28 @@ const props = defineProps<{
/* ✅ 带头像的行布局(竖排) */
.skeleton-row-with-avatar {
display: flex;
flex-direction: row;
align-items: center;
}
/* ✅ 带小头像的行布局(竖排) */
.skeleton-row-with-avatar-small {
display: flex;
flex-direction: row;
align-items: center;
}
/* ✅ 文本组(竖排) */
.skeleton-text-group {
display: flex;
flex: 1;
flex-direction: column;
}
/* ✅ 文本组(横排) */
.skeleton-text-group-horizontal {
display: flex;
flex: 1;
flex-direction: row;
justify-content: space-between;
......@@ -243,6 +253,7 @@ const props = defineProps<{
/* ✅ 左右分布的行 */
.skeleton-row-between {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
......
// 个人中心页面样式 - 高性能极简主义设计 v2.0
// ✅ 性能优化原则:零阴影、零动画、零复杂渐变
.person-page {
width: 100%;
flex: 1; /* ✅ 通过 flex 自动填充父容器剩余空间 */
background-color: var(--person-bg-page, #f8fafc);
// padding: var(--person-page-padding, 0px); /* ✅ 通过 CSS 变量控制 */
box-sizing: border-box;
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
min-height: 0;
display: flex;
flex-direction: column;
background-color: var(--person-bg-page, #f3f6fb);
box-sizing: border-box;
}
// .person-scroll {
// flex: 1;
// min-height: 0;
// width: 100%;
// display: flex;
// flex-direction: column;
// padding-bottom: var(--person-scroll-padding-bottom, 12px); /* ✅ 通过 CSS 变量控制 */
// }
/* ========================================
统一布局容器 - 通过 CSS 变量切换单列/分栏
======================================== */
.person-unified-layout {
flex:1;
display: flex;
flex-direction: var(--person-layout-direction, column); /* ✅ 竖屏: column, 横屏: row */
width: 100%; /* ✅ 确保占满宽度 */
padding: var(--person-container-padding) var(--person-container-padding) 0 var(--person-container-padding);
// padding-bottom: var(--person-container-padding-bottom);
background-color: var(--person-unified-layout-bg, transparent); /* ✅ 通过 CSS 变量控制 */
border-radius: var(--person-unified-layout-radius, 0px); /* ✅ 通过 CSS 变量控制 */
// margin-bottom: var(--person-unified-layout-margin-bottom, 0px); /* ✅ 通过 CSS 变量控制 */
border: var(--person-unified-layout-border, none); /* ✅ 通过 CSS 变量控制 */
.person-scroll {
flex: 1;
min-height: 0;
width: 100%;
box-sizing: border-box;
}
/* ✅ 主面板(用户资料 + 账号信息) */
.person-primary-panel {
flex: var(--person-primary-flex, none); /* ✅ 通过 CSS 变量控制 */
display: flex;
flex-direction: column;
.person-scroll-body {
width: 100%;
min-height: 100%;
display: flex;
flex-direction: column;
padding-top: var(--person-page-padding-y, 12px);
padding-right: var(--person-page-padding-x, 14px);
padding-bottom: var(--person-page-padding-y, 12px);
padding-left: var(--person-page-padding-x, 14px);
box-sizing: border-box;
}
/* ✅ 竖屏时,AccountInfo 与 ProfileCard 之间添加间距 */
.account-info-with-gap {
margin-top: var(--person-section-gap, 16px);
.person-dashboard {
width: 100%;
display: flex;
flex-direction: row;
align-items: stretch;
margin-top: var(--person-section-gap, 12px);
}
/* ✅ 次面板(常用功能) */
.person-secondary-panel {
flex: var(--person-secondary-flex, none); /* ✅ 通过 CSS 变量控制 */
display: flex;
flex-direction: column;
margin-top: var(--person-secondary-margin-top, 16px); /* ✅ 通过 CSS 变量控制 */
margin-left: var(--person-secondary-margin-left, 0px); /* ✅ 通过 CSS 变量控制 */
.person-dashboard-first {
margin-top: 0;
}
.person-dashboard-portrait {
flex-direction: column;
}
.person-primary-panel {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
}
/* ========================================
用户资料卡片 - 核心视觉焦点(已移至 ProfileCard 组件)
======================================== */
/* ========================================
区块容器(已移至 InfoSection 组件)
======================================== */
.person-secondary-panel {
flex-shrink: 0;
width: var(--person-side-panel-width, 360px);
margin-left: var(--person-section-gap, 12px);
display: flex;
flex-direction: column;
}
/* ========================================
间距工具类
======================================== */
.spacing-md {
height: var(--person-spacing-md, 12px);
.person-secondary-panel-portrait {
width: 100%;
margin-top: var(--person-section-gap, 12px);
margin-left: 0;
}
.spacing-lg {
height: var(--person-spacing-lg, 16px);
.person-stack-card {
width: 100%;
border-radius: var(--person-radius-lg, 18px);
border-width: 1px;
border-style: solid;
border-color: var(--person-card-border, #e2e8f0);
background-color: var(--person-bg-card, #ffffff);
padding: var(--person-panel-padding, 14px);
box-sizing: border-box;
margin-top: var(--person-section-gap, 12px);
}
.person-stack-card-first {
margin-top: 0;
}
/* ========================================
APP 编码页脚 - 固定在 scroll-view 底部正中间
======================================== */
.device-id-footer {
flex: 0;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 16px 20px; /* ✅ 添加内边距 */
margin-top: var(--person-section-gap, 16px); /* ✅ 与上方内容保持间距 */
cursor: pointer;
transition: background-color 0.15s ease;
height: var(--person-footer-height, 40px);
.device-id-panel {
width: auto;
height: var(--person-device-panel-height, 48px);
margin-top: 8px;
margin-right: var(--person-page-padding-x, 14px);
margin-bottom: var(--person-page-padding-y, 12px);
margin-left: var(--person-page-padding-x, 14px);
// border-radius: 14px;
// border-width: 1px;
// border-style: solid;
// border-color: var(--person-card-border, #e2e8f0);
// background-color: var(--person-bg-card, #ffffff);
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
flex-shrink: 0;
}
/* ✅ 点击反馈 */
.device-id-footer:active {
background-color: rgba(0, 0, 0, 0.03);
.device-id-panel-hover {
opacity: 0.92;
}
.device-id-footer-text {
font-size: 14px;
color: #9ca3af;
font-family: 'Courier New', monospace; /* ✅ 等宽字体 */
letter-spacing: 0.3px;
margin-right: 6px;
.device-id-panel-text {
font-size: 13px;
line-height: 18px;
color: var(--person-text-tertiary, #94a3b8);
margin-right: 6px;
}
// 个人中心响应式样式配置 - 企业级设计规范 v2.0
export default {
common: {
// 品牌色彩系统 - 科技蓝主题
'--person-primary': '#2f6af7',
'--person-primary-light': '#e8f0ff',
'--person-primary': '#2c66f7',
'--person-primary-soft': '#eef4ff',
'--person-success': '#10b981',
'--person-warning': '#f59e0b',
'--person-error': '#ef4444',
// 中性色阶
'--person-text-primary': '#1a2433',
'--person-text-secondary': '#64748b',
'--person-text-primary': '#0f172a',
'--person-text-secondary': '#475569',
'--person-text-tertiary': '#94a3b8',
'--person-border': '#dfe9f7',
'--person-border': '#dbe4f0',
'--person-card-border': '#e2e8f0',
'--person-bg-page': '#f3f6fb',
'--person-bg-card': '#ffffff',
'--person-bg-page': '#f8fafc',
'--person-bg-hover': '#f1f5f9',
// ✅ 性能优化:移除所有阴影定义,使用边框替代层级区分
// '--person-shadow-sm': '0 2px 8px rgba(0, 0, 0, 0.04)',
// '--person-shadow-md': '0 4px 16px rgba(0, 0, 0, 0.08)',
// 圆角系统
'--person-radius-sm': '8px',
'--person-radius-md': '12px',
'--person-radius-lg': '16px',
'--person-radius-xl': '20px',
// 间距系统
'--person-spacing-xs': '4px',
'--person-spacing-sm': '8px',
'--person-spacing-md': '12px',
'--person-spacing-lg': '16px',
'--person-spacing-xl': '24px',
'--person-spacing-2xl': '32px'
'--person-footer-height': '36px'
'--person-bg-soft': '#f8fbff',
'--person-radius-lg': '18px',
'--person-radius-md': '14px',
'--person-radius-sm': '10px',
'--person-page-padding-x': '16px',
'--person-page-padding-y': '14px',
'--person-section-gap': '12px',
'--person-banner-padding': '14px',
'--person-panel-padding': '14px',
'--person-profile-padding': '16px',
'--person-avatar-size': '56px',
'--person-avatar-font-size': '22px',
'--person-name-size': '22px',
'--person-meta-size': '13px',
'--person-section-title-size': '16px',
'--person-section-desc-size': '12px',
'--person-row-height': '52px',
'--person-row-label-width': '72px',
'--person-device-panel-height': '48px',
'--person-side-panel-width': '360px'
},
portrait: {
// 竖屏布局参数 - 单列流式布局
'--person-container-padding': '20px',
'--person-container-padding-bottom': '0'
'--person-section-gap': '16px',
// ✅ 统一布局控制:竖屏单列(column)
'--person-layout-direction': 'column',
'--person-primary-flex': 'none', /* ✅ 竖屏不占据剩余空间,自然高度(flex: none = 0 0 auto) */
'--person-secondary-flex': 'none', /* ✅ 竖屏不占据剩余空间,自然高度(flex: none = 0 0 auto) */
// ✅ 页面边距控制
'--person-page-padding': '0px', /* ✅ 竖屏无内边距 */
// ✅ scroll-view 底部留白
'--person-scroll-padding-bottom': '12px',
// ✅ 统一布局容器样式(竖屏无背景、无圆角)
'--person-unified-layout-bg': 'transparent',
'--person-unified-layout-radius': '0px',
'--person-unified-layout-border': 'none',
'--person-unified-layout-margin-bottom': '0px',
// ✅ 次面板间距(竖屏使用 margin-top)
'--person-secondary-margin-top': '16px',
'--person-secondary-margin-left': '0px',
// 用户资料卡片
'--person-profile-padding': '14px',
'--person-avatar-size': '52px',
'--person-name-size': '19px',
'--person-page-padding-x': '14px',
'--person-page-padding-y': '12px',
'--person-section-gap': '12px',
'--person-banner-padding': '14px',
'--person-panel-padding': '14px',
'--person-profile-padding': '16px',
'--person-avatar-size': '54px',
'--person-avatar-font-size': '20px',
'--person-name-size': '20px',
'--person-meta-size': '13px',
'--person-shop-label-size': '12px',
'--person-shop-value-size': '14px',
// 区块标题
'--person-section-title-size': '15px',
'--person-section-title-weight': '600',
// 列表项
'--person-cell-height': '48px',
'--person-cell-title-size': '15px',
'--person-cell-value-size': '14px',
'--person-cell-icon-size': '18px',
'--person-row-height': '50px',
'--person-row-label-width': '64px',
'--person-side-panel-width': '100%'
},
landscape: {
// 横屏布局参数 - 左右分栏布局
'--person-container-padding': '24px',
'--person-container-padding-bottom': '24px'
'--person-section-gap': '20px',
// ✅ 统一布局控制:横屏分栏(row)
'--person-layout-direction': 'row',
'--person-primary-flex': '1', /* ✅ 横屏占据剩余空间 */
'--person-secondary-flex': '1', /* ✅ 横屏占据剩余空间 */
// ✅ 页面边距控制
'--person-page-padding': '12px', /* ✅ 横屏有内边距 */
// ✅ scroll-view 底部不留白
'--person-scroll-padding-bottom': '0px',
// ✅ 统一布局容器样式(横屏有背景、圆角、边框)
'--person-unified-layout-bg': '#ffffff',
'--person-unified-layout-radius': '20px',
'--person-unified-layout-border': '1px solid #dfe9f7',
'--person-unified-layout-margin-bottom': '12px',
// ✅ 次面板间距(横屏使用 margin-left)
'--person-secondary-margin-top': '0px',
'--person-secondary-margin-left': '16px',
// 用户资料卡片(更大更醒目)
'--person-profile-padding': '24px',
'--person-avatar-size': '72px',
'--person-page-padding-x': '18px',
'--person-page-padding-y': '12px',
'--person-section-gap': '14px',
'--person-banner-padding': '16px',
'--person-panel-padding': '16px',
'--person-profile-padding': '18px',
'--person-avatar-size': '62px',
'--person-avatar-font-size': '24px',
'--person-name-size': '24px',
'--person-meta-size': '15px',
'--person-shop-label-size': '14px',
'--person-shop-value-size': '16px',
// 区块标题
'--person-section-title-size': '17px',
'--person-section-title-weight': '600',
// 列表项
'--person-cell-height': '56px',
'--person-cell-title-size': '16px',
'--person-cell-value-size': '15px',
'--person-cell-icon-size': '22px',
'--person-meta-size': '14px',
'--person-row-height': '54px',
'--person-row-label-width': '78px',
'--person-side-panel-width': '360px'
},
resolutions: {
// iPad 横屏优化 (1024x768)
'landscape-1024x768': {
'--person-container-padding': '32px',
'--person-section-gap': '24px',
'--person-avatar-size': '72px',
'--person-name-size': '24px',
'--person-profile-padding': '24px',
},
// 小屏 Pad 横屏 (816x393)
'landscape-816x393': {
'--person-container-padding': '16px',
'--person-section-gap': '12px',
'--person-avatar-size': '56px',
'--person-name-size': '20px',
'--person-profile-padding': '16px',
'portrait-393x816': {
'--person-page-padding-x': '12px',
'--person-page-padding-y': '10px',
'--person-section-gap': '10px'
},
// 大屏手机竖屏 (414x896)
'portrait-414x896': {
'--person-container-padding': '24px',
'--person-page-padding-x': '14px'
},
// iPhone 14 Pro 竖屏 (393x816)
'portrait-393x816': {
'--person-container-padding': '20px',
'landscape-816x393': {
'--person-page-padding-x': '10px',
'--person-page-padding-y': '8px',
'--person-banner-padding': '12px',
'--person-panel-padding': '12px',
'--person-profile-padding': '14px',
'--person-avatar-size': '52px',
'--person-avatar-font-size': '20px',
'--person-name-size': '20px',
'--person-row-height': '48px',
'--person-side-panel-width': '320px'
},
// 矮屏设备横屏优化 (如 iPad Mini 横屏 1024x640)
'landscape-1024x640': {
'--person-container-padding': '16px',
'--person-section-gap': '12px',
'--person-avatar-size': '56px',
'--person-name-size': '20px',
'--person-meta-size': '13px',
'--person-profile-padding': '14px',
'--person-cell-height': '44px',
'--person-side-panel-width': '332px'
},
'portrait-640x1024': {
'--person-section-gap': '12px',
'landscape-1024x768': {
'--person-page-padding-x': '20px',
'--person-side-panel-width': '372px'
},
'landscape-1174x768': {
'--person-page-padding-x': '22px',
'--person-side-panel-width': '392px'
}
}
}
......@@ -53,7 +53,7 @@ const navbarStyle = computed((): UTSJSONObject => {
const top = raw != null ? parseInt(`${raw}`) : 0;
return {
paddingTop: `${top}px`,
height: `${(top || 44) + 44}px`
height: `${(top) + 44}px`
} as UTSJSONObject;
});
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!