Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
yuanfeiyang02
2024-03-29 16:43:05 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c67153c040197f7e4137dcf41ce1817cde047c14
c67153c0
1 parent
a4abe07b
desc:串联启动页与引导页
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
10 deletions
sight_harmony/features/wdLogin/src/main/ets/pages/guide/GuidePages.ets
sight_harmony/products/phone/src/main/ets/pages/launchPage/LaunchPage.ets
sight_harmony/products/phone/src/main/ets/pages/view/CustomDialogComponent.ets
sight_harmony/features/wdLogin/src/main/ets/pages/guide/GuidePages.ets
View file @
c67153c
import { WDRouterRule } from 'wdRouter';
import { WDRouterPage } from 'wdRouter';
@Entry
@Component
struct GuidePages {
...
...
@@ -56,6 +59,7 @@ struct GuidePages {
.onClick(() => {
if (index == 3) {
// 跳转到首页
WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage)
}
})
.id('index')
...
...
sight_harmony/products/phone/src/main/ets/pages/launchPage/LaunchPage.ets
View file @
c67153c
...
...
@@ -15,6 +15,7 @@ struct LaunchPage {
private context?: common.UIAbilityContext;
private timerId: number = 0;
private isJumpToAdvertising: boolean = false;
private isJumpToGuide: boolean = false;
dialogController: CustomDialogController = new CustomDialogController({
builder: CustomDialogComponent(
...
...
@@ -40,7 +41,9 @@ struct LaunchPage {
onConfirm() {
// Save privacy agreement status.
this.saveIsPrivacy();
this.jumpToAdvertisingPage();
//跳转引导页
this.jumpToGuidePage();
}
jumpToAdvertisingPage() {
...
...
@@ -57,6 +60,21 @@ struct LaunchPage {
}, 1000);
}
jumpToGuidePage() {
this.timerId = setTimeout(() => {
this.isJumpToGuide = true;
WDRouterRule.jumpWithPage(WDRouterPage.guidePage)
// router.pushUrl({
// url: 'pages/LaunchAdvertisingPage'
// }).catch((error: Error) => {
// //Logger.error(CommonConstants.LAUNCHER_PAGE_TAG, 'LauncherPage pushUrl error ' + JSON.stringify(error));
// });
}, 1000);
}
onPageShow() {
this.context = getContext(this) as common.UIAbilityContext;
// Get the operation class for saving data.
...
...
@@ -66,11 +84,13 @@ struct LaunchPage {
if (value) {
// let isJumpPrivacy: boolean = globalThis.isJumpPrivacy ?? false;
// let isJumpPrivacy: boolean = (GlobalContext.getContext().getObject('isJumpPrivacy') as boolean) ?? false;
//
if (!isJumpPrivacy) {
//if (!isJumpPrivacy) {
this.dialogController.open();
// }
// }
} else {
//跳转广告页
this.jumpToAdvertisingPage();
}
});
});
...
...
@@ -80,9 +100,13 @@ struct LaunchPage {
if (this.isJumpToAdvertising) {
router.clear();
}
if (this.isJumpToGuide) {
router.clear();
}
// globalThis.isJumpPrivacy = true;
//GlobalContext.getContext().setObject('isJumpPrivacy', true);
//
GlobalContext.getContext().setObject('isJumpPrivacy', true);
clearTimeout(this.timerId);
this.dialogController.close();
}
getDataPreferences(common: Object) {
...
...
@@ -104,8 +128,6 @@ struct LaunchPage {
});
}
build(){
Stack({alignContent:Alignment.Bottom}){
...
...
sight_harmony/products/phone/src/main/ets/pages/view/CustomDialogComponent.ets
View file @
c67153c
...
...
@@ -81,9 +81,8 @@ export default struct CustomDialogComponent {
.width('40%')
.fontColor(Color.Red)
.onClick(() => {
//GlobalContext.getContext().setObject('isJumpPrivacy', false);
// WDRouterRule.jumpWithPage(WDRouterPage.privacyPage)
//GlobalContext.getContext().setObject('isJumpPrivacy', true);
//WDRouterRule.jumpWithPage(WDRouterPage.privacyPage)
// router.pushUrl({
// url: 'pages/PrivacyPage'
// }).catch((error: Error) => {
...
...
@@ -96,7 +95,7 @@ export default struct CustomDialogComponent {
.fontColor(Color.Red)
.onClick(() => {
//GlobalContext.getContext().setObject('isJumpPrivacy', true);
//
WDRouterRule.jumpWithPage(WDRouterPage.privacyPage)
//
WDRouterRule.jumpWithPage(WDRouterPage.privacyPage)
// router.pushUrl({
// url: 'pages/PrivacyPage'
// }).catch((error: Error) => {
...
...
Please
register
or
login
to post a comment