|
|
@@ -1,23 +1,34 @@
|
|
|
@Entry
|
|
|
@Component
|
|
|
struct Index {
|
|
|
- @State message: string = 'Hello World';
|
|
|
+ @State message: string = '快速入门';
|
|
|
|
|
|
build() {
|
|
|
- RelativeContainer() {
|
|
|
+ Column() {
|
|
|
Text(this.message)
|
|
|
- .id('HelloWorld')
|
|
|
- .fontSize($r('app.float.page_text_font_size'))
|
|
|
- .fontWeight(FontWeight.Bold)
|
|
|
- .alignRules({
|
|
|
- center: { anchor: '__container__', align: VerticalAlign.Center },
|
|
|
- middle: { anchor: '__container__', align: HorizontalAlign.Center }
|
|
|
- })
|
|
|
- .onClick(() => {
|
|
|
- this.message = 'Welcome';
|
|
|
- })
|
|
|
+ .fontSize(24)
|
|
|
+ .fontWeight(700)
|
|
|
+ .width('100%')
|
|
|
+ .textAlign(TextAlign.Start)
|
|
|
+ .padding({ left: 16 })
|
|
|
+ .fontFamily('HarmonyHeiTi-Bold')
|
|
|
+ .lineHeight(33)
|
|
|
+ Banner()
|
|
|
}
|
|
|
.height('100%')
|
|
|
.width('100%')
|
|
|
+ .backgroundColor('#F1F3F5')
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+@Preview
|
|
|
+@Component
|
|
|
+struct Banner {
|
|
|
+ build() {
|
|
|
+ Image($r('app.media.banner_pic1'))
|
|
|
+ .objectFit(ImageFit.Contain)
|
|
|
+ .width('100%')
|
|
|
+ .padding({ top: 11, left: 16, right: 16})
|
|
|
+ .borderRadius(16)
|
|
|
}
|
|
|
}
|