refactor(mp): CSS 变量主题 + 登录页改造 — UI 优化 Phase 0-2
Phase 0: 建立 design token 体系 - tokens.scss 新增 --tk-pri/--tk-pri-l/--tk-pri-d/--tk-shadow-btn/--tk-shadow-tab - .doctor-mode 覆盖为靛蓝色系,.elder-mode 非线性放大字号 - variables.scss 新增医生端色彩 + 阴影变量 Phase 1: 组件库 + 页面全局替换 - 75 个页面 SCSS $pri → var(--tk-pri) 全量替换 - 11 个新 UI 组件(PrimaryButton/TabFilter/FormInput/ProgressRing 等) - 8 个现有组件 SCSS 更新 - 18 个医生端页面 useElderClass → useDoctorClass - PageHeader 匹配原型 NavBar 规格 Phase 2: 登录页重写 - Logo: 方形+ → 圆形渐变 H - 登录方式: 纯微信 → 账号密码 + 微信一键登录 - 新增 credentialLogin API + store action - 字号/间距严格匹配原型 mp-01-login.html
This commit is contained in:
37
apps/miniprogram/src/components/ui/ChatBubble/index.scss
Normal file
37
apps/miniprogram/src/components/ui/ChatBubble/index.scss
Normal file
@@ -0,0 +1,37 @@
|
||||
@import '../../../styles/variables.scss';
|
||||
|
||||
.chat-bubble-wrap {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-bottom: var(--tk-gap-xs);
|
||||
}
|
||||
|
||||
.chat-bubble {
|
||||
max-width: 75%;
|
||||
padding: var(--tk-gap-md) var(--tk-gap-lg);
|
||||
font-size: var(--tk-font-body);
|
||||
line-height: 1.5;
|
||||
|
||||
&--other {
|
||||
align-self: flex-start;
|
||||
background: $card;
|
||||
border-radius: $r $r $r $r-xs;
|
||||
}
|
||||
|
||||
&--mine {
|
||||
align-self: flex-end;
|
||||
background: var(--tk-pri-l);
|
||||
border-radius: $r $r $r-xs $r;
|
||||
}
|
||||
|
||||
&__text {
|
||||
color: $tx;
|
||||
}
|
||||
|
||||
&__time {
|
||||
font-size: var(--tk-font-micro);
|
||||
color: $tx3;
|
||||
margin-top: 4px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
34
apps/miniprogram/src/components/ui/ChatBubble/index.tsx
Normal file
34
apps/miniprogram/src/components/ui/ChatBubble/index.tsx
Normal file
@@ -0,0 +1,34 @@
|
||||
import React, { ReactNode } from 'react';
|
||||
import { View, Text } from '@tarojs/components';
|
||||
import './index.scss';
|
||||
|
||||
interface ChatBubbleProps {
|
||||
content: string;
|
||||
isMine?: boolean;
|
||||
time?: string;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
const ChatBubble: React.FC<ChatBubbleProps> = ({
|
||||
content,
|
||||
isMine = false,
|
||||
time,
|
||||
className = '',
|
||||
}) => {
|
||||
const cls = [
|
||||
'chat-bubble',
|
||||
isMine ? 'chat-bubble--mine' : 'chat-bubble--other',
|
||||
className,
|
||||
].filter(Boolean).join(' ');
|
||||
|
||||
return (
|
||||
<View className='chat-bubble-wrap'>
|
||||
<View className={cls}>
|
||||
<Text className='chat-bubble__text'>{content}</Text>
|
||||
</View>
|
||||
{time && <Text className='chat-bubble__time'>{time}</Text>}
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
export default React.memo(ChatBubble);
|
||||
Reference in New Issue
Block a user