yuanfeiyang02

desc:app启动页代码迁移

Showing 28 changed files with 864 additions and 24 deletions
@@ -5,13 +5,13 @@ @@ -5,13 +5,13 @@
5 "name": "default", 5 "name": "default",
6 "type": "HarmonyOS", 6 "type": "HarmonyOS",
7 "material": { 7 "material": {
8 - "certpath": "/Users/ysy/.ohos/config/auto_debug_sight_harmony_com.wondertek.sight_30086000745972390.cer",  
9 - "storePassword": "0000001AD1ABE6FB1D5AEC538066BBDCACCDF8DFB85BA89D4A7B163112F48FDFAD37222DD5D2FBC6738C", 8 + "certpath": "/Users/jrl/.ohos/config/auto_debug_sight_harmony_com.wondertek.sight_2850086000431478878.cer",
  9 + "storePassword": "0000001B1B59DAB22B389A8BCD25A2C43C89DE581FD6AC3EEE1D3FC227D46727A7763AAE553A50B5E81310",
10 "keyAlias": "debugKey", 10 "keyAlias": "debugKey",
11 - "keyPassword": "0000001AA4301CF4CB6CD92BFD749A3C09BC771B02A1E544A47EBBC557DB27E8150CB2AB5CB13029999D",  
12 - "profile": "/Users/ysy/.ohos/config/auto_debug_sight_harmony_com.wondertek.sight_30086000745972390.p7b", 11 + "keyPassword": "0000001B2B0EDD642E43906A1B9A6B72A79F40316E908829B79DD96467FE5C3A8D1DF9E40957DA733DF77F",
  12 + "profile": "/Users/jrl/.ohos/config/auto_debug_sight_harmony_com.wondertek.sight_2850086000431478878.p7b",
13 "signAlg": "SHA256withECDSA", 13 "signAlg": "SHA256withECDSA",
14 - "storeFile": "/Users/ysy/.ohos/config/auto_debug_sight_harmony_com.wondertek.sight_30086000745972390.p12" 14 + "storeFile": "/Users/jrl/.ohos/config/auto_debug_sight_harmony_com.wondertek.sight_2850086000431478878.p12"
15 } 15 }
16 } 16 }
17 ], 17 ],
@@ -70,5 +70,13 @@ export class WDRouterPage { @@ -70,5 +70,13 @@ export class WDRouterPage {
70 70
71 static guidePage = new WDRouterPage("wdLogin", "ets/pages/guide/GuidePages"); 71 static guidePage = new WDRouterPage("wdLogin", "ets/pages/guide/GuidePages");
72 72
  73 + //隐私政策页面
  74 + static privacyPage = new WDRouterPage("phone", "ets/pages/launchPage/PrivacyPage");
  75 + //启动广告页面
  76 + static launchAdvertisingPage = new WDRouterPage("phone", "ets/pages/launchPage/LaunchAdvertisingPage");
  77 + //主页
  78 + static mainPage = new WDRouterPage("phone", "ets/pages/MainPage");
  79 +
  80 +
73 // static loginProtocolPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginProtocolWebview"); 81 // static loginProtocolPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginProtocolWebview");
74 } 82 }
@@ -29,4 +29,21 @@ export class WDRouterRule { @@ -29,4 +29,21 @@ export class WDRouterRule {
29 ToastUtils.showToast("功能开发中", 1000); 29 ToastUtils.showToast("功能开发中", 1000);
30 } 30 }
31 } 31 }
  32 +
  33 + static jumpWithReplacePage(page?: WDRouterPage, params?: object) {
  34 + if (page) {
  35 + if (params) {
  36 + // router.pushUrl({ url: 'pages/routerpage2', , params: params })
  37 + router.replaceUrl({ url: page.url(), params: params })
  38 + } else {
  39 + router.replaceUrl({ url: page.url() }).catch((error:Error)=>{
  40 + console.log("err",JSON.stringify(error))//100002 uri is not exist
  41 + })
  42 + }
  43 + } else {
  44 + ToastUtils.showToast("功能开发中", 1000);
  45 + }
  46 + }
  47 +
  48 +
32 } 49 }
@@ -8,12 +8,12 @@ @@ -8,12 +8,12 @@
8 "version": "1.0.0", 8 "version": "1.0.0",
9 "dependencies": { 9 "dependencies": {
10 "wdConstant": "file:../../commons/wdConstant", 10 "wdConstant": "file:../../commons/wdConstant",
  11 + "wdPlayer": "file:../../features/wdPlayer",
  12 + "wdLogin": "file:../../features/wdLogin",
11 "wdKit": "file:../../commons/wdKit", 13 "wdKit": "file:../../commons/wdKit",
12 "wdWebComponent": "file:../../commons/wdWebComponent", 14 "wdWebComponent": "file:../../commons/wdWebComponent",
13 "wdBean": "file:../../features/wdBean", 15 "wdBean": "file:../../features/wdBean",
14 "wdRouter": "file:../../commons/wdRouter", 16 "wdRouter": "file:../../commons/wdRouter",
15 - "wdNetwork": "file:../../commons/wdNetwork",  
16 - "wdPlayer": "file:../../features/wdPlayer",  
17 - "wdLogin": "file:../../features/wdLogin" 17 + "wdNetwork": "file:../../commons/wdNetwork"
18 } 18 }
19 } 19 }
1 { 1 {
2 - "lockfileVersion": 2, 2 + "lockfileVersion": 1,
3 "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", 3 "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
4 - "specifiers": {  
5 - "@ohos/axios@^2.1.1": "@ohos/axios@2.2.0"  
6 - },  
7 - "packages": {  
8 - "@ohos/axios@2.2.0": {  
9 - "resolved": "https://repo.harmonyos.com/ohpm/@ohos/axios/-/axios-2.2.0.har",  
10 - "integrity": "sha512-v1QBWk6DfcN8wUW3D0ieFbHTR1taSI5cOgxp5l6B5cegXuNYhSc8ggKlAIXe6h/14LsfM+NW0ZGfSXcNEIM5yA==",  
11 - "registryType": "ohpm"  
12 - }  
13 - } 4 + "specifiers": {},
  5 + "packages": {}
14 } 6 }
@@ -3,6 +3,14 @@ @@ -3,6 +3,14 @@
3 { 3 {
4 "name": "white", 4 "name": "white",
5 "value": "#FFFFFF" 5 "value": "#FFFFFF"
  6 + },
  7 + {
  8 + "name": "start_window_background",
  9 + "value": "#FFFFFF"
  10 + },
  11 + {
  12 + "name": "color_F9F9F9",
  13 + "value": "#F9F9F9"
6 } 14 }
7 ] 15 ]
8 } 16 }
1 { 1 {
2 - "name": "entry", 2 + "name": "phone",
3 "lockfileVersion": 2, 3 "lockfileVersion": 2,
4 "requires": true, 4 "requires": true,
5 "packages": {} 5 "packages": {}
@@ -32,7 +32,8 @@ export default class EntryAbility extends UIAbility { @@ -32,7 +32,8 @@ export default class EntryAbility extends UIAbility {
32 .catch((err: Error) => { 32 .catch((err: Error) => {
33 hilog.error(0x0000, 'testTag', `setPreferredOrientation catch, error error.name : ${err.name}, error.message:${err.message}`); 33 hilog.error(0x0000, 'testTag', `setPreferredOrientation catch, error error.name : ${err.name}, error.message:${err.message}`);
34 }) 34 })
35 - windowStage.loadContent('pages/MainPage', (err, data) => { 35 + //../../../../../../features/wdLogin/src/main/ets/pages/launchPage/LaunchPage
  36 + windowStage.loadContent('pages/launchPage/LaunchPage', (err, data) => {
36 if (err.code) { 37 if (err.code) {
37 hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); 38 hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');
38 return; 39 return;
@@ -4,6 +4,7 @@ import { BreakpointConstants } from 'wdConstant'; @@ -4,6 +4,7 @@ import { BreakpointConstants } from 'wdConstant';
4 import { BreakpointSystem, Logger } from 'wdKit'; 4 import { BreakpointSystem, Logger } from 'wdKit';
5 import router from '@ohos.router'; 5 import router from '@ohos.router';
6 6
  7 +
7 const TAG = 'MainPage'; 8 const TAG = 'MainPage';
8 9
9 @Entry 10 @Entry
  1 +import router from '@ohos.router'
  2 +import { WDRouterRule } from 'wdRouter';
  3 +import { WDRouterPage } from 'wdRouter';
  4 +@Entry
  5 +@Component
  6 +struct LaunchAdvertisingPage {
  7 + @State time: number = 4
  8 + timer :number = -1
  9 +
  10 + enter() {
  11 + // router.replaceUrl({
  12 + // url:'pages/MainPage'
  13 + // })
  14 + WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage)
  15 + }
  16 +
  17 + onPageShow(){
  18 + this.timer = setInterval(() => {
  19 + this.time--
  20 + if (this.time < 1) {
  21 + this.enter()
  22 + clearInterval(this.timer)
  23 + }
  24 + },1000)
  25 +
  26 + }
  27 +
  28 + build(){
  29 + Column(){
  30 + Stack({alignContent:Alignment.Bottom}){
  31 +
  32 + Stack({alignContent:Alignment.Bottom}){
  33 + Column(){
  34 + Image($r('app.media.app_icon'))
  35 + .margin({
  36 + top:'128lpx',left:'48lpx',right:'48lpx',bottom:'128lpx'
  37 + })
  38 + }
  39 + .justifyContent(FlexAlign.Center)
  40 + .width('100%')
  41 + .height('100%')
  42 + .margin({
  43 + bottom: 0
  44 + })
  45 +
  46 + Stack({alignContent:Alignment.TopEnd}){
  47 + Button(){
  48 + Text(this.time + 's 跳过')
  49 + .fontSize('27lpx')
  50 + .fontColor(Color.White)
  51 + .margin({left:'28lpx',right:'28lpx'})
  52 +
  53 + }
  54 + .width('148lpx')
  55 + .height('56lpx')
  56 + .margin({top:'54lpx',right:'19lpx'})
  57 + .backgroundColor('#80000000')
  58 + .onClick(() => {
  59 + this.enter()
  60 + })
  61 + }
  62 + .width('100%')
  63 + .height('100%')
  64 +
  65 + Button(){
  66 + Row(){
  67 + Text('点击跳转至详情或第三方应用')
  68 + .fontSize('31lpx')
  69 + .fontColor(Color.White)
  70 + .margin({
  71 + left:'55lpx'
  72 + })
  73 + Image($r('app.media.Slice'))
  74 + .width('46lpx')
  75 + .height('46lpx')
  76 + .margin({right:'55lpx'})
  77 + }.alignItems(VerticalAlign.Center)
  78 + }
  79 + .width('566lpx')
  80 + .height('111lpx')
  81 + .margin({
  82 + bottom: '51lpx'
  83 + })
  84 + .backgroundColor('#80000000')
  85 +
  86 + }
  87 +
  88 + }
  89 + .width('100%')
  90 + .height('84%')
  91 + .backgroundColor('#FF6C75')
  92 + .margin({top:'0'})
  93 +
  94 + Image($r('app.media.LaunchPage_logo'))
  95 + .width('278lpx')
  96 + .height('154lpx')
  97 + .margin({bottom: '48lpx'})
  98 + }
  99 + .width('100%')
  100 + .height('100%')
  101 + .backgroundColor(Color.White)
  102 +
  103 + }
  104 +
  105 +
  106 +
  107 +
  108 +}
  1 +import media from '@ohos.multimedia.media'
  2 +import App from '@system.app'
  3 +import Router from '@system.router'
  4 +import router from '@ohos.router'
  5 +import common from '@ohos.app.ability.common'
  6 +import CustomDialogComponent from '../view/CustomDialogComponent'
  7 +import preferences from '@ohos.data.preferences'
  8 +import { GlobalContext } from '../../utils/GlobalContext'
  9 +import { WDRouterRule } from 'wdRouter';
  10 +import { WDRouterPage } from 'wdRouter';
  11 +
  12 +@Entry
  13 +@Component
  14 +struct LaunchPage {
  15 + private context?: common.UIAbilityContext;
  16 + private timerId: number = 0;
  17 + private isJumpToAdvertising: boolean = false;
  18 +
  19 + dialogController: CustomDialogController = new CustomDialogController({
  20 + builder: CustomDialogComponent(
  21 + {
  22 + cancel: () => {
  23 + this.onCancel();
  24 + },
  25 + confirm: () => {
  26 + this.onConfirm();
  27 + }
  28 + }),
  29 + alignment: DialogAlignment.Center,
  30 + offset: { dx: 0, dy: '-24' },
  31 + customStyle: true,
  32 + autoCancel: false
  33 + });
  34 +
  35 + onCancel() {
  36 + // Exit the application.
  37 + this.context?.terminateSelf();
  38 + }
  39 +
  40 + onConfirm() {
  41 + // Save privacy agreement status.
  42 + this.saveIsPrivacy();
  43 + this.jumpToAdvertisingPage();
  44 + }
  45 +
  46 + jumpToAdvertisingPage() {
  47 + this.timerId = setTimeout(() => {
  48 + this.isJumpToAdvertising = true;
  49 +
  50 + WDRouterRule.jumpWithPage(WDRouterPage.launchAdvertisingPage)
  51 +
  52 + // router.pushUrl({
  53 + // url: 'pages/LaunchAdvertisingPage'
  54 + // }).catch((error: Error) => {
  55 + // //Logger.error(CommonConstants.LAUNCHER_PAGE_TAG, 'LauncherPage pushUrl error ' + JSON.stringify(error));
  56 + // });
  57 + }, 1000);
  58 + }
  59 +
  60 + onPageShow() {
  61 + this.context = getContext(this) as common.UIAbilityContext;
  62 + // Get the operation class for saving data.
  63 + this.getDataPreferences(this).then((preferences: preferences.Preferences) => {
  64 + preferences.get('isPrivacy', true).then((value: preferences.ValueType) => {
  65 + //Logger.info(CommonConstants.LAUNCHER_PAGE_TAG, 'onPageShow value: ' + value);
  66 + if (value) {
  67 + // let isJumpPrivacy: boolean = globalThis.isJumpPrivacy ?? false;
  68 + // let isJumpPrivacy: boolean = (GlobalContext.getContext().getObject('isJumpPrivacy') as boolean) ?? false;
  69 + // if (!isJumpPrivacy) {
  70 + this.dialogController.open();
  71 + // }
  72 + } else {
  73 + this.jumpToAdvertisingPage();
  74 + }
  75 + });
  76 + });
  77 + }
  78 +
  79 + onPageHide() {
  80 + if (this.isJumpToAdvertising) {
  81 + router.clear();
  82 + }
  83 + // globalThis.isJumpPrivacy = true;
  84 + //GlobalContext.getContext().setObject('isJumpPrivacy', true);
  85 + clearTimeout(this.timerId);
  86 + }
  87 +
  88 + getDataPreferences(common: Object) {
  89 + return preferences.getPreferences(getContext(common), 'myStore');
  90 + }
  91 +
  92 + saveIsPrivacy() {
  93 + let preferences: Promise<preferences.Preferences> = this.getDataPreferences(this);
  94 + preferences.then((result: preferences.Preferences) => {
  95 + let privacyPut = result.put('isPrivacy', false);
  96 + result.flush();
  97 + privacyPut.then(() => {
  98 + //Logger.info('LauncherPage', 'Put the value of startup Successfully.');
  99 + }).catch((err: Error) => {
  100 + //Logger.error('LauncherPage', 'Put the value of startup Failed, err: ' + err);
  101 + });
  102 + }).catch((err: Error) => {
  103 + //Logger.error('LauncherPage', 'Get the preferences Failed, err: ' + err);
  104 + });
  105 + }
  106 +
  107 +
  108 +
  109 + build(){
  110 +
  111 + Stack({alignContent:Alignment.Bottom}){
  112 + Image($r('app.media.app_icon'))
  113 + .width('278lpx')
  114 + .height('154lpx')
  115 + .margin({
  116 + bottom:'48lpx'
  117 + })
  118 +
  119 + }
  120 + .width('100%')
  121 + .height('100%')
  122 + .backgroundColor(Color.White)
  123 +
  124 +
  125 + }
  126 +
  127 +
  128 +
  129 +}
  1 +
  2 +import webview from '@ohos.web.webview';
  3 +import router from '@ohos.router';
  4 +import { GlobalContext } from '../../utils/GlobalContext'
  5 +import { WDRouterRule } from 'wdRouter';
  6 +
  7 +@Entry
  8 +@Component
  9 +struct PrivacyPage {
  10 + @State message: string = 'Hello World'
  11 + webController: webview.WebviewController = new webview.WebviewController();
  12 + //@State params: object = router.getParams();
  13 +
  14 + build() {
  15 + Row() {
  16 + Column() {
  17 + // Web component loading H5.
  18 + Web({ src: 'https://www.baidu.com', controller: this.webController })
  19 + .zoomAccess(false)
  20 + .width('100%')
  21 + .height('100%')
  22 + .aspectRatio(1)
  23 + // .onConfirm((event) => {
  24 + // AlertDialog.show({
  25 + // message: Const.WEB_ALERT_DIALOG_TEXT_VALUE + event?.message,
  26 + // confirm: {
  27 + // value: $r('app.string.web_alert_dialog_button_value'),
  28 + // action: () => {
  29 + // event?.result.handleConfirm();
  30 + // }
  31 + // },
  32 + // cancel: () => {
  33 + // event?.result.handleCancel();
  34 + // }
  35 + // });
  36 + // return true;
  37 + // })
  38 + // .onErrorReceive((event) => {
  39 + // if (event?.error.getErrorInfo() === 'ERR_INTERNET_DISCONNECTED') {
  40 + // prompt.showToast({
  41 + // message: $r('app.string.internet_err'),
  42 + // duration: Const.WebConstant_DURATION
  43 + // })
  44 + // }
  45 + // if (event?.error.getErrorInfo() === 'ERR_CONNECTION_TIMED_OUT') {
  46 + // prompt.showToast({
  47 + // message: $r('app.string.internet_err'),
  48 + // duration: Const.WebConstant_DURATION
  49 + // })
  50 + // }
  51 + // })
  52 + // .onProgressChange((event) => {
  53 + // if (event?.newProgress === Const.WebConstant_PROGRESS_MAX) {
  54 + // this.isLoading = false;
  55 + // clearInterval(this.intervalLoading);
  56 + // this.intervalLoading = -1;
  57 + // }
  58 + // })
  59 + }
  60 + .width('100%')
  61 + }
  62 + .height('100%')
  63 + }
  64 +}
  1 +import router from '@ohos.router';
  2 +import { GlobalContext } from '../../utils/GlobalContext'
  3 +import { NavigatorModel } from '../viewModel/NavigatorModel';
  4 +import { WDRouterRule } from 'wdRouter';
  5 +import { WDRouterPage } from 'wdRouter';
  6 +@CustomDialog
  7 +export default struct CustomDialogComponent {
  8 +
  9 + controller: CustomDialogController = new CustomDialogController({'builder': ''})
  10 + cancel: Function = () => {}
  11 + confirm: Function = () => {}
  12 +
  13 +
  14 + build(){
  15 + Column(){
  16 + Text($r('app.string.dialog_text_title'))
  17 + .width("90%")
  18 + .fontColor($r('app.color.dialog_text_color'))
  19 + .fontSize($r('app.float.dialog_text_privacy_size'))
  20 + .textAlign(TextAlign.Center)
  21 + .fontWeight('500')
  22 + .margin({
  23 + top: $r('app.float.dialog_text_privacy_top'),
  24 + bottom: $r('app.float.dialog_text_privacy_bottom')
  25 + })
  26 + Text($r('app.string.dialog_text_subTitle'))
  27 + .fontSize($r('app.float.dialog_common_text_size'))
  28 + .width('90%')
  29 + Text($r('app.string.dialog_text_privacy_content'))
  30 + .fontSize($r('app.float.dialog_common_text_size'))
  31 + .width('90%')
  32 + Row(){
  33 +
  34 + // Button(){
  35 + // Text($r('app.string.privacy_text_title_policy'))
  36 + // .fontSize('27lpx')
  37 + // .fontColor(Color.Red)
  38 + // .margin({left:'10lpx',right:'10lpx'})
  39 + // }
  40 + // .width('90%')
  41 + // .height('56lpx')
  42 + // .margin({top:'54lpx',right:'19lpx'})
  43 + // .backgroundColor('#80000000')
  44 + // .onClick(() => {
  45 + //
  46 + // })
  47 + // Button(){
  48 + // Text($r('app.string.privacy_text_title_protocol'))
  49 + // .fontSize('27lpx')
  50 + // .fontColor(Color.Red)
  51 + // .margin({left:'10lpx',right:'10lpx'})
  52 + // }
  53 + // .width('90%')
  54 + // .height('56lpx')
  55 + // .margin({top:'54lpx',right:'19lpx'})
  56 + // .backgroundColor('#80000000')
  57 + // .onClick(() => {
  58 + //
  59 + // })
  60 +
  61 + // Navigator({ target: 'pages/PrivacyPage', type: NavigationType.Push }) {
  62 + // Button($r('app.string.privacy_text_title_policy'))
  63 + // .onClick(()=>{
  64 + // GlobalContext.getContext().setObject('isJumpPrivacy', true);
  65 + // })
  66 + // {
  67 + // // Text($r('app.string.privacy_text_title_policy'))
  68 + // // .fontSize($r('app.float.dialog_common_text_size'))
  69 + // // .width('50%')
  70 + // // .fontColor(Color.Red)
  71 + // // .onClick(() => {
  72 + // // GlobalContext.getContext().setObject('isJumpPrivacy', true);
  73 + // // })
  74 + // }
  75 + // .fancy(Const.MainConstant_BUTTON_MARGIN_TOP)
  76 + // }
  77 + // .params({ path: 'https://www.baidu.com', tips: '在线' } as NavigatorModel)
  78 +
  79 + Text($r('app.string.privacy_text_title_policy'))
  80 + .fontSize($r('app.float.dialog_common_text_size'))
  81 + .width('40%')
  82 + .fontColor(Color.Red)
  83 + .onClick(() => {
  84 + //GlobalContext.getContext().setObject('isJumpPrivacy', false);
  85 +
  86 + // WDRouterRule.jumpWithPage(WDRouterPage.privacyPage)
  87 + // router.pushUrl({
  88 + // url: 'pages/PrivacyPage'
  89 + // }).catch((error: Error) => {
  90 + // //Logger.error(CommonConstants.CUSTOM_DIALOG_TAG, 'CustomDialog pushUrl error ' + JSON.stringify(error));
  91 + // });
  92 + })
  93 + Text($r('app.string.privacy_text_title_protocol'))
  94 + .fontSize($r('app.float.dialog_common_text_size'))
  95 + .width('40%')
  96 + .fontColor(Color.Red)
  97 + .onClick(() => {
  98 + //GlobalContext.getContext().setObject('isJumpPrivacy', true);
  99 + // WDRouterRule.jumpWithPage(WDRouterPage.privacyPage)
  100 + // router.pushUrl({
  101 + // url: 'pages/PrivacyPage'
  102 + // }).catch((error: Error) => {
  103 + // //Logger.error(CommonConstants.CUSTOM_DIALOG_TAG, 'CustomDialog pushUrl error ' + JSON.stringify(error));
  104 + // });
  105 + })
  106 + }
  107 + .margin({
  108 + top:'36lpx',
  109 + bottom:'21lpx'
  110 + })
  111 + Text($r('app.string.dialog_text_privacy_statement'))
  112 + .width('90%')
  113 + .fontColor($r('app.color.dialog_text_color'))
  114 + .fontSize($r('app.float.dialog_common_text_size'))
  115 + Row() {
  116 + Text($r('app.string.dialog_button_disagree'))
  117 + .fancy()
  118 + .onClick(() => {
  119 + this.controller.close();
  120 + this.cancel();
  121 + })
  122 + Blank()
  123 + .backgroundColor($r('app.color.dialog_blank_background_color'))
  124 + .width($r('app.float.dialog_blank_width'))
  125 + .height($r('app.float.dialog_blank_height'))
  126 + Text($r('app.string.dialog_button_agree'))
  127 + .fancyAgree()
  128 + .onClick(() => {
  129 + this.controller.close();
  130 + this.confirm();
  131 + })
  132 +
  133 + }
  134 + .margin({ bottom: '21lpx',top:'42lpx' })
  135 +
  136 + }
  137 + .width('528lpx')
  138 + .borderRadius('15')
  139 + .backgroundColor(Color.White)
  140 +
  141 + }
  142 +
  143 +
  144 +
  145 +}
  146 +// Common text styles.
  147 +@Extend(Text) function fancy () {
  148 + .fontColor($r("app.color.dialog_fancy_text_left_color"))
  149 + .fontSize($r("app.float.dialog_fancy_text_size"))
  150 + .textAlign(TextAlign.Center)
  151 + .fontWeight(FontWeight.Medium)
  152 + .layoutWeight('1')
  153 +}
  154 +// Common text styles.
  155 +@Extend(Text) function fancyAgree () {
  156 + .fontColor($r("app.color.dialog_fancy_text_right_color"))
  157 + .fontSize($r("app.float.dialog_fancy_text_size"))
  158 + .textAlign(TextAlign.Center)
  159 + .fontWeight(FontWeight.Medium)
  160 + .layoutWeight('1')
  161 +}
  1 +/**
  2 + * NewsData params info.
  3 + */
  4 +export class NavigatorModel {
  5 + /**
  6 + * Jumping Path.
  7 + */
  8 + path: Resource | string = '';
  9 +
  10 + /**
  11 + * Prompt message.
  12 + */
  13 + tips: Resource | string = '';
  14 +}
  1 +export class GlobalContext {
  2 + private constructor() { }
  3 + private static instance: GlobalContext;
  4 + private _objects = new Map<string, Object>();
  5 +
  6 + public static getContext(): GlobalContext {
  7 + if (!GlobalContext.instance) {
  8 + GlobalContext.instance = new GlobalContext();
  9 + }
  10 + return GlobalContext.instance;
  11 + }
  12 +
  13 + getObject(value: string): Object | undefined {
  14 + return this._objects.get(value);
  15 + }
  16 +
  17 + setObject(key: string, objectClass: Object): void {
  18 + this._objects.set(key, objectClass);
  19 + }
  20 +}
@@ -3,6 +3,54 @@ @@ -3,6 +3,54 @@
3 { 3 {
4 "name": "start_window_background", 4 "name": "start_window_background",
5 "value": "#FFFFFF" 5 "value": "#FFFFFF"
  6 + },
  7 + {
  8 + "name": "color_F9F9F9",
  9 + "value": "#F9F9F9"
  10 + },
  11 + {
  12 + "name": "privacy_back_text",
  13 + "value": "#007DFF"
  14 + },
  15 + {
  16 + "name": "launcher_text_title_color",
  17 + "value": "#182431"
  18 + },
  19 + {
  20 + "name": "launcher_text_introduce_color",
  21 + "value": "#182431"
  22 + },
  23 + {
  24 + "name": "advertising_text_title_color",
  25 + "value": "#182431"
  26 + },
  27 + {
  28 + "name": "advertising_text_background_color",
  29 + "value": "#33000000"
  30 + },
  31 + {
  32 + "name": "home_page_text_color",
  33 + "value": "#14224D"
  34 + },
  35 + {
  36 + "name": "dialog_fancy_text_left_color",
  37 + "value": "#999999"
  38 + },
  39 + {
  40 + "name": "dialog_fancy_text_right_color",
  41 + "value": "#ED2800"
  42 + },
  43 + {
  44 + "name": "dialog_text_color",
  45 + "value": "#222222"
  46 + },
  47 + {
  48 + "name": "dialog_blank_background_color",
  49 + "value": "#F5F5F5"
  50 + },
  51 + {
  52 + "name": "dialog_text_statement_color",
  53 + "value": "#007DFF"
6 } 54 }
7 ] 55 ]
8 -}  
  56 +}
  1 +{
  2 + "float": [
  3 + {
  4 + "name": "float_1",
  5 + "value": "30.6"
  6 + },
  7 + {
  8 + "name": "launcher_logo_size",
  9 + "value": "119vp"
  10 + },
  11 + {
  12 + "name": "launcher_life_text_width",
  13 + "value": "105vp"
  14 + },
  15 + {
  16 + "name": "launcher_life_text_height",
  17 + "value": "35vp"
  18 + },
  19 + {
  20 + "name": "launcher_text_title_size",
  21 + "value": "26fp"
  22 + },
  23 + {
  24 + "name": "launcher_text_introduce_size",
  25 + "value": "16fp"
  26 + },
  27 + {
  28 + "name": "launcher_text_opacity",
  29 + "value": "0.6"
  30 + },
  31 + {
  32 + "name": "advertising_text_opacity",
  33 + "value": "0.4"
  34 + },
  35 + {
  36 + "name": "advertising_image_width",
  37 + "value": "54vp"
  38 + },
  39 + {
  40 + "name": "advertising_image_height",
  41 + "value": "54vp"
  42 + },
  43 + {
  44 + "name": "advertising_text_font_size",
  45 + "value": "12fp"
  46 + },
  47 + {
  48 + "name": "advertising_text_introduce_size",
  49 + "value": "16fp"
  50 + },
  51 + {
  52 + "name": "advertising_text_title_size",
  53 + "value": "26fp"
  54 + },
  55 + {
  56 + "name": "advertising_text_border_width",
  57 + "value": "1"
  58 + },
  59 + {
  60 + "name": "advertising_title_text_margin_top",
  61 + "value": "30vp"
  62 + },
  63 + {
  64 + "name": "advertising_title_text_margin_left",
  65 + "value": "260vp"
  66 + },
  67 + {
  68 + "name": "advertising_text_padding_top",
  69 + "value": "8vp"
  70 + },
  71 + {
  72 + "name": "advertising_text_padding_bottom",
  73 + "value": "8vp"
  74 + },
  75 + {
  76 + "name": "advertising_text_padding_left",
  77 + "value": "12vp"
  78 + },
  79 + {
  80 + "name": "advertising_text_padding_right",
  81 + "value": "12vp"
  82 + },
  83 + {
  84 + "name": "advertising_text_radius",
  85 + "value": "18vp"
  86 + },
  87 + {
  88 + "name": "dialog_blank_height",
  89 + "value": "32vp"
  90 + },
  91 + {
  92 + "name": "dialog_blank_width",
  93 + "value": "1vp"
  94 + },
  95 + {
  96 + "name": "dialog_common_text_size",
  97 + "value": "18fp"
  98 + },
  99 + {
  100 + "name": "dialog_text_privacy_size",
  101 + "value": "20fp"
  102 + },
  103 + {
  104 + "name": "dialog_fancy_text_size",
  105 + "value": "18fp"
  106 + },
  107 + {
  108 + "name": "dialog_text_button_left_color",
  109 + "value": "#999999"
  110 + },
  111 + {
  112 + "name": "dialog_text_button_right_color",
  113 + "value": "#ED2800"
  114 + },
  115 + {
  116 + "name": "dialog_text_privacy_bottom",
  117 + "value": "23lpx"
  118 + },
  119 + {
  120 + "name": "dialog_text_privacy_top",
  121 + "value": "38lpx"
  122 + },
  123 + {
  124 + "name": "dialog_text_declaration_bottom",
  125 + "value": "24"
  126 + },
  127 + {
  128 + "name": "dialog_text_opacity",
  129 + "value": "0.6"
  130 + },
  131 + {
  132 + "name": "privacy_text_title_size",
  133 + "value": "20fp"
  134 + },
  135 + {
  136 + "name": "privacy_back_text_size",
  137 + "value": "20fp"
  138 + },
  139 + {
  140 + "name": "privacy_text_margin_top",
  141 + "value": "10"
  142 + },
  143 + {
  144 + "name": "privacy_text_margin_bottom",
  145 + "value": "10"
  146 + },
  147 + {
  148 + "name": "privacy_bottom_text_margin",
  149 + "value": "12"
  150 + },
  151 + {
  152 + "name": "privacy_text_content_left",
  153 + "value": "24"
  154 + },
  155 + {
  156 + "name": "privacy_text_content_right",
  157 + "value": "24"
  158 + },
  159 + {
  160 + "name": "home_page_text_size",
  161 + "value": "30vp"
  162 + }
  163 + ]
  164 +}
@@ -11,6 +11,39 @@ @@ -11,6 +11,39 @@
11 { 11 {
12 "name": "EntryAbility_label", 12 "name": "EntryAbility_label",
13 "value": "$string:app_name" 13 "value": "$string:app_name"
  14 + },
  15 + {
  16 + "name": "dialog_text_title",
  17 + "value": "个人隐私保护指引"
  18 + },
  19 + {
  20 + "name": "dialog_text_subTitle",
  21 + "value": "欢迎您使用人民日报客户端!"
  22 + },
  23 + {
  24 + "name": "dialog_text_privacy_content",
  25 + "value": "为了更好地为您提供阅读新闻、发布评论等相关服务,我们会根据您使用服务的具体功能需要,收集必要的用户信息。您可通过阅读《隐私政策》和《用户协议》了解我们收集、使用、存储和共享个人信息的情况,以及对您个人隐私的保护措施。人民日报客户端深知个人信息对您的重要性,我们将以最高标准遵守法律法规要求,尽全力保护您的个人信息安全。"
  26 + },
  27 + {
  28 + "name": "dialog_text_privacy_statement",
  29 + "value": "如您同意,请点击“同意”开始接受"
  30 + },
  31 + {
  32 + "name": "dialog_button_disagree",
  33 + "value": "暂不使用"
  34 + },
  35 + {
  36 + "name": "dialog_button_agree",
  37 + "value": "同意"
  38 + },
  39 + {
  40 + "name": "privacy_text_title_policy",
  41 + "value": "《隐私政策》"
  42 + },
  43 + {
  44 + "name": "privacy_text_title_protocol",
  45 + "value": "《用户协议》"
14 } 46 }
  47 +
15 ] 48 ]
16 } 49 }
@@ -6,6 +6,9 @@ @@ -6,6 +6,9 @@
6 "pages/ImageAndTextDetailPage", 6 "pages/ImageAndTextDetailPage",
7 "pages/MorningEveningPaperPage", 7 "pages/MorningEveningPaperPage",
8 "pages/detail/AudioDetail", 8 "pages/detail/AudioDetail",
9 - "pages/detail/MultiPictureDetailPage" 9 + "pages/detail/MultiPictureDetailPage",
  10 + "pages/launchPage/PrivacyPage",
  11 + "pages/launchPage/LaunchPage",
  12 + "pages/launchPage/LaunchAdvertisingPage"
10 ] 13 ]
11 -}  
  14 +}
@@ -11,6 +11,39 @@ @@ -11,6 +11,39 @@
11 { 11 {
12 "name": "EntryAbility_label", 12 "name": "EntryAbility_label",
13 "value": "$string:app_name" 13 "value": "$string:app_name"
  14 + },
  15 + {
  16 + "name": "dialog_text_title",
  17 + "value": "个人隐私保护指引"
  18 + },
  19 + {
  20 + "name": "dialog_text_subTitle",
  21 + "value": "欢迎您使用人民日报客户端!"
  22 + },
  23 + {
  24 + "name": "dialog_text_privacy_content",
  25 + "value": "为了更好地为您提供阅读新闻、发布评论等相关服务,我们会根据您使用服务的具体功能需要,收集必要的用户信息。您可通过阅读《隐私政策》和《用户协议》了解我们收集、使用、存储和共享个人信息的情况,以及对您个人隐私的保护措施。人民日报客户端深知个人信息对您的重要性,我们将以最高标准遵守法律法规要求,尽全力保护您的个人信息安全。"
  26 + },
  27 + {
  28 + "name": "dialog_text_privacy_statement",
  29 + "value": "如您同意,请点击“同意”开始接受"
  30 + },
  31 + {
  32 + "name": "dialog_button_disagree",
  33 + "value": "暂不使用"
  34 + },
  35 + {
  36 + "name": "dialog_button_agree",
  37 + "value": "同意"
  38 + },
  39 + {
  40 + "name": "privacy_text_title_policy",
  41 + "value": "《隐私政策》"
  42 + },
  43 + {
  44 + "name": "privacy_text_title_protocol",
  45 + "value": "《用户协议》"
14 } 46 }
  47 +
15 ] 48 ]
16 } 49 }
@@ -11,6 +11,38 @@ @@ -11,6 +11,38 @@
11 { 11 {
12 "name": "EntryAbility_label", 12 "name": "EntryAbility_label",
13 "value": "$string:app_name" 13 "value": "$string:app_name"
  14 + },
  15 + {
  16 + "name": "dialog_text_title",
  17 + "value": "个人隐私保护指引"
  18 + },
  19 + {
  20 + "name": "dialog_text_subTitle",
  21 + "value": "欢迎您使用人民日报客户端!"
  22 + },
  23 + {
  24 + "name": "dialog_text_privacy_content",
  25 + "value": "为了更好地为您提供阅读新闻、发布评论等相关服务,我们会根据您使用服务的具体功能需要,收集必要的用户信息。您可通过阅读《隐私政策》和《用户协议》了解我们收集、使用、存储和共享个人信息的情况,以及对您个人隐私的保护措施。人民日报客户端深知个人信息对您的重要性,我们将以最高标准遵守法律法规要求,尽全力保护您的个人信息安全。"
  26 + },
  27 + {
  28 + "name": "dialog_text_privacy_statement",
  29 + "value": "如您同意,请点击“同意”开始接受"
  30 + },
  31 + {
  32 + "name": "dialog_button_disagree",
  33 + "value": "暂不使用"
  34 + },
  35 + {
  36 + "name": "dialog_button_agree",
  37 + "value": "同意"
  38 + },
  39 + {
  40 + "name": "privacy_text_title_policy",
  41 + "value": "《隐私政策》"
  42 + },
  43 + {
  44 + "name": "privacy_text_title_protocol",
  45 + "value": "《用户协议》"
14 } 46 }
15 ] 47 ]
16 } 48 }