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

鸿蒙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

还有 45% 的精彩内容
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
支付 ¥9.99 继续阅读

推荐阅读更多精彩内容