feat(uikit): 引入明缘主题色板与通用组件

This commit is contained in:
AndyChen1024
2026-09-11 20:47:22 +08:00
parent 35a70f5091
commit 8321991b45
10 changed files with 378 additions and 15 deletions

View File

@@ -0,0 +1,23 @@
import { AppColor } from '../theme/Theme';
/**
* 首字母圆形头像:金色底白字。
*/
@ComponentV2
export struct Avatar {
@Param name: string = '';
@Param diameter: number = 40;
build() {
Stack({ alignContent: Alignment.Center }) {
Text(this.name.length > 0 ? this.name.charAt(0) : '明')
.fontSize(this.diameter * 0.42)
.fontWeight(FontWeight.Bold)
.fontColor(AppColor.white)
}
.width(this.diameter)
.height(this.diameter)
.borderRadius(this.diameter / 2)
.backgroundColor(AppColor.gold)
}
}