shishuangxi

引导页绘制

@@ -67,5 +67,7 @@ export class WDRouterPage { @@ -67,5 +67,7 @@ export class WDRouterPage {
67 //其他普通用户 主页 67 //其他普通用户 主页
68 static otherNormalUserHomePagePage = new WDRouterPage("wdComponent", "ets/pages/OtherNormalUserHomePage"); 68 static otherNormalUserHomePagePage = new WDRouterPage("wdComponent", "ets/pages/OtherNormalUserHomePage");
69 69
  70 + static guidePage = new WDRouterPage("wdLogin", "ets/pages/guide/GuidePages");
  71 +
70 // static loginProtocolPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginProtocolWebview"); 72 // static loginProtocolPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginProtocolWebview");
71 } 73 }
  1 +@Entry
  2 +@Component
  3 +struct GuidePages {
  4 + guideImage = [$r('app.media.guide_static1'), $r('app.media.guide_static2'), $r('app.media.guide_static3'), $r('app.media.guide_static4')]
  5 + guideTitle = [$r('app.media.guide_title1'), $r('app.media.guide_title2'), $r('app.media.guide_title3'), $r('app.media.guide_title4')]
  6 + guideIndex = [$r('app.media.guide_index1'), $r('app.media.guide_index2'), $r('app.media.guide_index3'), $r('app.media.guide_button')]
  7 +
  8 + build() {
  9 + Column() {
  10 + Swiper() {
  11 + ForEach(this.guideImage, (item: number, index: number) => {
  12 + this.ChildItem(index)
  13 +
  14 + }, (item: number) => JSON.stringify(item))
  15 + }.loop(false)
  16 + .indicator(false)
  17 + .width('100%')
  18 + .height('100%')
  19 + }.width('100%')
  20 + .height('100%')
  21 +
  22 + }
  23 +
  24 + @Builder
  25 + ChildItem(index: number) {
  26 + RelativeContainer() {
  27 + Image(this.guideImage[index])
  28 + .alignRules({
  29 + top: { anchor: "__container__", align: VerticalAlign.Top },
  30 + bottom: { anchor: "__container__", align: VerticalAlign.Bottom }
  31 + })
  32 + .width('100%')
  33 + .height('100%')
  34 + .id('image')
  35 + Image(this.guideTitle[index])
  36 + .objectFit(ImageFit.ScaleDown)
  37 + .alignRules({
  38 + bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
  39 + left: { anchor: "__container__", align: HorizontalAlign.Start },
  40 + right: { anchor: "__container__", align: HorizontalAlign.End },
  41 + })
  42 + .margin({ left: 60, bottom: 150, right: 60 })
  43 + .alignSelf(ItemAlign.Center)
  44 + .id('title')
  45 +
  46 + Image(this.guideIndex[index])
  47 + .objectFit(ImageFit.ScaleDown)
  48 + .alignRules({
  49 + bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
  50 + left: { anchor: "__container__", align: HorizontalAlign.Start },
  51 + right: { anchor: "__container__", align: HorizontalAlign.End },
  52 +
  53 + })
  54 + .margin({ bottom: 85 })
  55 + .height(40)
  56 + .onClick(() => {
  57 + if (index == 3) {
  58 + // 跳转到首页
  59 + }
  60 + })
  61 + .id('index')
  62 +
  63 +
  64 + }.width('100%').height('100%')
  65 + }
  66 +}
@@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
5 "pages/login/ForgetPasswordPage", 5 "pages/login/ForgetPasswordPage",
6 "pages/login/LoginProtocolWebview", 6 "pages/login/LoginProtocolWebview",
7 "pages/login/SettingPasswordPage", 7 "pages/login/SettingPasswordPage",
8 - "pages/login/SettingPasswordLayout" 8 + "pages/login/SettingPasswordLayout",
  9 + "pages/guide/GuidePages"
9 ] 10 ]
10 } 11 }