fix(mp): T40 UI 设计系统合规审计修复 — 60 页面全覆盖
- 新增 $white 语义变量 + --tk-font-display Token - 44 处 #fff → $white,2 处 background: #fff → $card - 14 处 border-radius 硬编码统一为 $r-xs/$r-lg/$r - 3 处 TSX inline 颜色提取为 SCSS 类(exchange/orders/action-inbox) - ErrorBoundary 重构:6 个 inline style → SCSS 类 + Design Token - 2 处离调色板颜色修正(#0284C7→$tx2, #94A3B8→$tx3) - 2 处静默 catch 块添加状态清理(article/health) - 趋势页补 Loading/EmptyState;咨询页 GuestGuard 统一 - 4 处 #FFFFFF → $white(mixins/index/exchange/variables)
This commit is contained in:
@@ -44,7 +44,7 @@
|
||||
.sync-btn {
|
||||
padding: 12rpx 28rpx;
|
||||
background: $pri;
|
||||
color: #fff;
|
||||
color: $white;
|
||||
border-radius: $r-pill;
|
||||
font-size: var(--tk-font-micro);
|
||||
}
|
||||
|
||||
@@ -46,5 +46,5 @@
|
||||
|
||||
.empty-state-action-text {
|
||||
font-size: var(--tk-font-body-lg);
|
||||
color: #fff;
|
||||
color: $white;
|
||||
}
|
||||
|
||||
52
apps/miniprogram/src/components/ErrorBoundary/index.scss
Normal file
52
apps/miniprogram/src/components/ErrorBoundary/index.scss
Normal file
@@ -0,0 +1,52 @@
|
||||
@import '../../styles/variables.scss';
|
||||
|
||||
.error-boundary {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 60vh;
|
||||
padding: 40px 24px;
|
||||
}
|
||||
|
||||
.error-icon-wrap {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
border-radius: 32px;
|
||||
background: $pri-l;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.error-icon-text {
|
||||
font-family: 'Georgia', 'Times New Roman', serif;
|
||||
font-size: var(--tk-font-h1);
|
||||
font-weight: 600;
|
||||
color: $pri-d;
|
||||
}
|
||||
|
||||
.error-title {
|
||||
font-size: var(--tk-font-h2);
|
||||
color: $tx;
|
||||
margin-bottom: 12px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.error-desc {
|
||||
font-size: var(--tk-font-body-lg);
|
||||
color: $tx3;
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
|
||||
.error-retry-btn {
|
||||
background: $pri;
|
||||
border-radius: $r-sm;
|
||||
padding: 14px 48px;
|
||||
}
|
||||
|
||||
.error-retry-text {
|
||||
color: $white;
|
||||
font-size: var(--tk-font-h1);
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import React, { Component } from 'react';
|
||||
import { View, Text } from '@tarojs/components';
|
||||
import './index.scss';
|
||||
|
||||
interface Props {
|
||||
children: React.ReactNode;
|
||||
@@ -30,17 +31,17 @@ export default class ErrorBoundary extends Component<Props, State> {
|
||||
render() {
|
||||
if (this.state.hasError) {
|
||||
return (
|
||||
<View style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', minHeight: '60vh', padding: '40px 24px' }}>
|
||||
<View style={{ width: '64px', height: '64px', borderRadius: '32px', background: '#F0DDD4', display: 'flex', alignItems: 'center', justifyContent: 'center', marginBottom: '20px' }}>
|
||||
<Text style={{ fontFamily: 'Georgia, serif', fontSize: '28px', fontWeight: 600, color: '#8B3E1F' }}>!</Text>
|
||||
<View className='error-boundary'>
|
||||
<View className='error-icon-wrap'>
|
||||
<Text className='error-icon-text'>!</Text>
|
||||
</View>
|
||||
<Text style={{ fontSize: '32px', color: '#2D2A26', marginBottom: '12px', fontWeight: 600 }}>页面出了点问题</Text>
|
||||
<Text style={{ fontSize: '24px', color: '#78716C', marginBottom: '32px' }}>请返回重试</Text>
|
||||
<Text className='error-title'>页面出了点问题</Text>
|
||||
<Text className='error-desc'>请返回重试</Text>
|
||||
<View
|
||||
className='error-retry-btn'
|
||||
onClick={this.handleRetry}
|
||||
style={{ background: '#C4623A', borderRadius: '12px', padding: '14px 48px' }}
|
||||
>
|
||||
<Text style={{ color: '#FFFFFF', fontSize: '28px' }}>重新加载</Text>
|
||||
<Text className='error-retry-text'>重新加载</Text>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
}
|
||||
|
||||
.error-state-icon {
|
||||
font-size: 80px; /* hero icon — kept as-is */
|
||||
font-size: var(--tk-font-display);
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
@@ -28,5 +28,5 @@
|
||||
|
||||
.error-state-retry-text {
|
||||
font-size: var(--tk-font-body-lg);
|
||||
color: #fff;
|
||||
color: $white;
|
||||
}
|
||||
|
||||
@@ -60,5 +60,5 @@
|
||||
.guard-btn-text {
|
||||
font-size: var(--tk-font-body-sm);
|
||||
font-weight: 600;
|
||||
color: #fff;
|
||||
color: $white;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user