ArkTS/ArkUI实战

鸿蒙ArkTS/ArkUI电商实战-闪屏页

2024-04-11  本文已影响0人  ISwiftUI

鸿蒙ArkTS/ArkUI电商实战系列

本章内容

应用启动闪屏展示广告、欢迎图,倒计时

效果图:


效果图

相关源码:
SplashPage.ets

import hilog from '@ohos.hilog'
import { CountDownView } from '../component/CountDownView'

@Entry
@Component
struct SplashPage {

  build() {
    Flex({ direction: FlexDirection.Column}) {
      Stack({alignContent: Alignment.TopEnd}) {
        Column() {
          CountDownView({onFinish: () => {
            this.onCountDownFinish()
          }})
            .width(50)
            .height(50)
            .margin({top: 15, right: 15})
        }

        Column({}) {
          Text('闪屏页').onClick(() => {
            hilog.debug(0xFF00, 'SplashPage', "闪屏页")
          })
        }
        .width('100%')
        .height('100%')
        .justifyContent(FlexAlign.Center)
        .alignItems(HorizontalAlign.Center)
      }
      .width('100%')
      .height('100%')
    }
    .width('100%')
    .height('100%')
    .backgroundColor(0x70DBDB)
  }

  onCountDownFinish = () => {

  }
}

CountDownView.ets

上一篇下一篇

猜你喜欢

热点阅读