shishuangxi

引导页绘制

... ... @@ -67,5 +67,7 @@ export class WDRouterPage {
//其他普通用户 主页
static otherNormalUserHomePagePage = new WDRouterPage("wdComponent", "ets/pages/OtherNormalUserHomePage");
static guidePage = new WDRouterPage("wdLogin", "ets/pages/guide/GuidePages");
// static loginProtocolPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginProtocolWebview");
}
... ...
@Entry
@Component
struct GuidePages {
guideImage = [$r('app.media.guide_static1'), $r('app.media.guide_static2'), $r('app.media.guide_static3'), $r('app.media.guide_static4')]
guideTitle = [$r('app.media.guide_title1'), $r('app.media.guide_title2'), $r('app.media.guide_title3'), $r('app.media.guide_title4')]
guideIndex = [$r('app.media.guide_index1'), $r('app.media.guide_index2'), $r('app.media.guide_index3'), $r('app.media.guide_button')]
build() {
Column() {
Swiper() {
ForEach(this.guideImage, (item: number, index: number) => {
this.ChildItem(index)
}, (item: number) => JSON.stringify(item))
}.loop(false)
.indicator(false)
.width('100%')
.height('100%')
}.width('100%')
.height('100%')
}
@Builder
ChildItem(index: number) {
RelativeContainer() {
Image(this.guideImage[index])
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
bottom: { anchor: "__container__", align: VerticalAlign.Bottom }
})
.width('100%')
.height('100%')
.id('image')
Image(this.guideTitle[index])
.objectFit(ImageFit.ScaleDown)
.alignRules({
bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
left: { anchor: "__container__", align: HorizontalAlign.Start },
right: { anchor: "__container__", align: HorizontalAlign.End },
})
.margin({ left: 60, bottom: 150, right: 60 })
.alignSelf(ItemAlign.Center)
.id('title')
Image(this.guideIndex[index])
.objectFit(ImageFit.ScaleDown)
.alignRules({
bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
left: { anchor: "__container__", align: HorizontalAlign.Start },
right: { anchor: "__container__", align: HorizontalAlign.End },
})
.margin({ bottom: 85 })
.height(40)
.onClick(() => {
if (index == 3) {
// 跳转到首页
}
})
.id('index')
}.width('100%').height('100%')
}
}
\ No newline at end of file
... ...
... ... @@ -5,6 +5,7 @@
"pages/login/ForgetPasswordPage",
"pages/login/LoginProtocolWebview",
"pages/login/SettingPasswordPage",
"pages/login/SettingPasswordLayout"
"pages/login/SettingPasswordLayout",
"pages/guide/GuidePages"
]
}
... ...