From 52435dfa6918feed10d78796fbe5f3c10a592e71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E5=8B=A4=E6=B0=91?= Date: Tue, 7 May 2024 17:42:54 +0800 Subject: [PATCH] init --- app/.gitignore | 6 + app/build-profile.json5 | 28 +++ app/hvigorfile.ts | 6 + app/obfuscation-rules.txt | 18 ++ app/oh-package-lock.json5 | 26 +++ app/oh-package.json5 | 17 ++ app/patch.json | 11 ++ app/src/main/ets/entryability/EntryAbility.ets | 41 ++++ app/src/main/ets/pages/Home.ets | 0 app/src/main/ets/pages/Index.ets | 59 ++++++ app/src/main/ets/pages/PageOne.ets | 13 ++ app/src/main/ets/pages/PageTwo.ets | 24 +++ app/src/main/ets/pages/cert/CertHome.ets | 199 +++++++++++++++++++ app/src/main/ets/pages/evn/ChangeEvnView.ets | 142 ++++++++++++++ app/src/main/ets/pages/setting/SettingView.ets | 89 +++++++++ app/src/main/ets/pages/sign/Sign.ets | 213 +++++++++++++++++++++ app/src/main/ets/pages/sign/SignForAuto.ets | 81 ++++++++ app/src/main/ets/pages/sign/SignForPin.ets | 129 +++++++++++++ app/src/main/ets/pages/sign/SignHome.ets | 69 +++++++ app/src/main/ets/pages/sign/SynedData.ets | 11 ++ app/src/main/ets/pages/sign/SynedModel.ets | 12 ++ app/src/main/ets/router/NavPathStackHelper.ets | 12 ++ app/src/main/ets/router/RouterBuilder.ets | 23 +++ app/src/main/ets/router/ViewMap.ts | 14 ++ app/src/main/module.json5 | 40 ++++ app/src/main/resources/base/element/color.json | 8 + app/src/main/resources/base/element/string.json | 16 ++ app/src/main/resources/base/media/icon.png | Bin 0 -> 2041 bytes .../main/resources/base/media/icon_code_normal.png | Bin 0 -> 978 bytes .../resources/base/media/icon_code_selected.png | Bin 0 -> 1012 bytes .../main/resources/base/media/icon_home_normal.png | Bin 0 -> 791 bytes .../resources/base/media/icon_home_selected.png | Bin 0 -> 823 bytes .../resources/base/media/icon_setting_Normal.png | Bin 0 -> 1520 bytes .../resources/base/media/icon_setting_selected.png | Bin 0 -> 1584 bytes .../main/resources/base/media/icon_sign_normal.png | Bin 0 -> 1210 bytes .../resources/base/media/icon_sign_selected.png | Bin 0 -> 1271 bytes app/src/main/resources/base/media/startIcon.png | Bin 0 -> 4351 bytes .../main/resources/base/profile/main_pages.json | 5 + app/src/main/resources/en_US/element/string.json | 16 ++ app/src/main/resources/zh_CN/element/string.json | 16 ++ app/src/mock/mock-config.json5 | 2 + app/src/ohosTest/ets/test/Ability.test.ets | 35 ++++ app/src/ohosTest/ets/test/List.test.ets | 5 + app/src/ohosTest/ets/testability/TestAbility.ets | 48 +++++ app/src/ohosTest/ets/testability/pages/Index.ets | 17 ++ .../ets/testrunner/OpenHarmonyTestRunner.ets | 90 +++++++++ app/src/ohosTest/module.json5 | 38 ++++ app/src/ohosTest/resources/base/element/color.json | 8 + .../ohosTest/resources/base/element/string.json | 16 ++ app/src/ohosTest/resources/base/media/icon.png | Bin 0 -> 2041 bytes .../resources/base/profile/test_pages.json | 5 + app/src/test/List.test.ets | 5 + app/src/test/LocalUnit.test.ets | 33 ++++ build-profile.json5 | 4 +- entry/.gitignore | 6 - entry/build-profile.json5 | 28 --- entry/hvigorfile.ts | 6 - entry/obfuscation-rules.txt | 18 -- entry/oh-package-lock.json5 | 26 --- entry/oh-package.json5 | 17 -- entry/patch.json | 11 -- entry/src/main/ets/entryability/EntryAbility.ets | 41 ---- entry/src/main/ets/pages/Home.ets | 0 entry/src/main/ets/pages/Index.ets | 59 ------ entry/src/main/ets/pages/PageOne.ets | 13 -- entry/src/main/ets/pages/PageTwo.ets | 24 --- entry/src/main/ets/pages/cert/CertHome.ets | 199 ------------------- entry/src/main/ets/pages/evn/ChangeEvnView.ets | 142 -------------- entry/src/main/ets/pages/setting/SettingView.ets | 89 --------- entry/src/main/ets/pages/sign/Sign.ets | 213 --------------------- entry/src/main/ets/pages/sign/SignForAuto.ets | 81 -------- entry/src/main/ets/pages/sign/SignForPin.ets | 129 ------------- entry/src/main/ets/pages/sign/SignHome.ets | 69 ------- entry/src/main/ets/pages/sign/SynedData.ets | 11 -- entry/src/main/ets/pages/sign/SynedModel.ets | 12 -- entry/src/main/ets/router/NavPathStackHelper.ets | 12 -- entry/src/main/ets/router/RouterBuilder.ets | 23 --- entry/src/main/ets/router/ViewMap.ts | 14 -- entry/src/main/module.json5 | 40 ---- entry/src/main/resources/base/element/color.json | 8 - entry/src/main/resources/base/element/string.json | 16 -- entry/src/main/resources/base/media/icon.png | Bin 2041 -> 0 bytes .../main/resources/base/media/icon_code_normal.png | Bin 978 -> 0 bytes .../resources/base/media/icon_code_selected.png | Bin 1012 -> 0 bytes .../main/resources/base/media/icon_home_normal.png | Bin 791 -> 0 bytes .../resources/base/media/icon_home_selected.png | Bin 823 -> 0 bytes .../resources/base/media/icon_setting_Normal.png | Bin 1520 -> 0 bytes .../resources/base/media/icon_setting_selected.png | Bin 1584 -> 0 bytes .../main/resources/base/media/icon_sign_normal.png | Bin 1210 -> 0 bytes .../resources/base/media/icon_sign_selected.png | Bin 1271 -> 0 bytes entry/src/main/resources/base/media/startIcon.png | Bin 4351 -> 0 bytes .../main/resources/base/profile/main_pages.json | 5 - entry/src/main/resources/en_US/element/string.json | 16 -- entry/src/main/resources/zh_CN/element/string.json | 16 -- entry/src/mock/mock-config.json5 | 2 - entry/src/ohosTest/ets/test/Ability.test.ets | 35 ---- entry/src/ohosTest/ets/test/List.test.ets | 5 - entry/src/ohosTest/ets/testability/TestAbility.ets | 48 ----- entry/src/ohosTest/ets/testability/pages/Index.ets | 17 -- .../ets/testrunner/OpenHarmonyTestRunner.ets | 90 --------- entry/src/ohosTest/module.json5 | 38 ---- .../src/ohosTest/resources/base/element/color.json | 8 - .../ohosTest/resources/base/element/string.json | 16 -- entry/src/ohosTest/resources/base/media/icon.png | Bin 2041 -> 0 bytes .../resources/base/profile/test_pages.json | 5 - entry/src/test/List.test.ets | 5 - entry/src/test/LocalUnit.test.ets | 33 ---- 107 files changed, 1648 insertions(+), 1648 deletions(-) create mode 100644 app/.gitignore create mode 100644 app/build-profile.json5 create mode 100644 app/hvigorfile.ts create mode 100644 app/obfuscation-rules.txt create mode 100644 app/oh-package-lock.json5 create mode 100644 app/oh-package.json5 create mode 100644 app/patch.json create mode 100644 app/src/main/ets/entryability/EntryAbility.ets create mode 100644 app/src/main/ets/pages/Home.ets create mode 100644 app/src/main/ets/pages/Index.ets create mode 100644 app/src/main/ets/pages/PageOne.ets create mode 100644 app/src/main/ets/pages/PageTwo.ets create mode 100644 app/src/main/ets/pages/cert/CertHome.ets create mode 100644 app/src/main/ets/pages/evn/ChangeEvnView.ets create mode 100644 app/src/main/ets/pages/setting/SettingView.ets create mode 100644 app/src/main/ets/pages/sign/Sign.ets create mode 100644 app/src/main/ets/pages/sign/SignForAuto.ets create mode 100644 app/src/main/ets/pages/sign/SignForPin.ets create mode 100644 app/src/main/ets/pages/sign/SignHome.ets create mode 100644 app/src/main/ets/pages/sign/SynedData.ets create mode 100644 app/src/main/ets/pages/sign/SynedModel.ets create mode 100644 app/src/main/ets/router/NavPathStackHelper.ets create mode 100644 app/src/main/ets/router/RouterBuilder.ets create mode 100644 app/src/main/ets/router/ViewMap.ts create mode 100644 app/src/main/module.json5 create mode 100644 app/src/main/resources/base/element/color.json create mode 100644 app/src/main/resources/base/element/string.json create mode 100644 app/src/main/resources/base/media/icon.png create mode 100644 app/src/main/resources/base/media/icon_code_normal.png create mode 100644 app/src/main/resources/base/media/icon_code_selected.png create mode 100644 app/src/main/resources/base/media/icon_home_normal.png create mode 100644 app/src/main/resources/base/media/icon_home_selected.png create mode 100644 app/src/main/resources/base/media/icon_setting_Normal.png create mode 100644 app/src/main/resources/base/media/icon_setting_selected.png create mode 100644 app/src/main/resources/base/media/icon_sign_normal.png create mode 100644 app/src/main/resources/base/media/icon_sign_selected.png create mode 100644 app/src/main/resources/base/media/startIcon.png create mode 100644 app/src/main/resources/base/profile/main_pages.json create mode 100644 app/src/main/resources/en_US/element/string.json create mode 100644 app/src/main/resources/zh_CN/element/string.json create mode 100644 app/src/mock/mock-config.json5 create mode 100644 app/src/ohosTest/ets/test/Ability.test.ets create mode 100644 app/src/ohosTest/ets/test/List.test.ets create mode 100644 app/src/ohosTest/ets/testability/TestAbility.ets create mode 100644 app/src/ohosTest/ets/testability/pages/Index.ets create mode 100644 app/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ets create mode 100644 app/src/ohosTest/module.json5 create mode 100644 app/src/ohosTest/resources/base/element/color.json create mode 100644 app/src/ohosTest/resources/base/element/string.json create mode 100644 app/src/ohosTest/resources/base/media/icon.png create mode 100644 app/src/ohosTest/resources/base/profile/test_pages.json create mode 100644 app/src/test/List.test.ets create mode 100644 app/src/test/LocalUnit.test.ets delete mode 100644 entry/.gitignore delete mode 100644 entry/build-profile.json5 delete mode 100644 entry/hvigorfile.ts delete mode 100644 entry/obfuscation-rules.txt delete mode 100644 entry/oh-package-lock.json5 delete mode 100644 entry/oh-package.json5 delete mode 100644 entry/patch.json delete mode 100644 entry/src/main/ets/entryability/EntryAbility.ets delete mode 100644 entry/src/main/ets/pages/Home.ets delete mode 100644 entry/src/main/ets/pages/Index.ets delete mode 100644 entry/src/main/ets/pages/PageOne.ets delete mode 100644 entry/src/main/ets/pages/PageTwo.ets delete mode 100644 entry/src/main/ets/pages/cert/CertHome.ets delete mode 100644 entry/src/main/ets/pages/evn/ChangeEvnView.ets delete mode 100644 entry/src/main/ets/pages/setting/SettingView.ets delete mode 100644 entry/src/main/ets/pages/sign/Sign.ets delete mode 100644 entry/src/main/ets/pages/sign/SignForAuto.ets delete mode 100644 entry/src/main/ets/pages/sign/SignForPin.ets delete mode 100644 entry/src/main/ets/pages/sign/SignHome.ets delete mode 100644 entry/src/main/ets/pages/sign/SynedData.ets delete mode 100644 entry/src/main/ets/pages/sign/SynedModel.ets delete mode 100644 entry/src/main/ets/router/NavPathStackHelper.ets delete mode 100644 entry/src/main/ets/router/RouterBuilder.ets delete mode 100644 entry/src/main/ets/router/ViewMap.ts delete mode 100644 entry/src/main/module.json5 delete mode 100644 entry/src/main/resources/base/element/color.json delete mode 100644 entry/src/main/resources/base/element/string.json delete mode 100644 entry/src/main/resources/base/media/icon.png delete mode 100644 entry/src/main/resources/base/media/icon_code_normal.png delete mode 100644 entry/src/main/resources/base/media/icon_code_selected.png delete mode 100644 entry/src/main/resources/base/media/icon_home_normal.png delete mode 100644 entry/src/main/resources/base/media/icon_home_selected.png delete mode 100644 entry/src/main/resources/base/media/icon_setting_Normal.png delete mode 100644 entry/src/main/resources/base/media/icon_setting_selected.png delete mode 100644 entry/src/main/resources/base/media/icon_sign_normal.png delete mode 100644 entry/src/main/resources/base/media/icon_sign_selected.png delete mode 100644 entry/src/main/resources/base/media/startIcon.png delete mode 100644 entry/src/main/resources/base/profile/main_pages.json delete mode 100644 entry/src/main/resources/en_US/element/string.json delete mode 100644 entry/src/main/resources/zh_CN/element/string.json delete mode 100644 entry/src/mock/mock-config.json5 delete mode 100644 entry/src/ohosTest/ets/test/Ability.test.ets delete mode 100644 entry/src/ohosTest/ets/test/List.test.ets delete mode 100644 entry/src/ohosTest/ets/testability/TestAbility.ets delete mode 100644 entry/src/ohosTest/ets/testability/pages/Index.ets delete mode 100644 entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ets delete mode 100644 entry/src/ohosTest/module.json5 delete mode 100644 entry/src/ohosTest/resources/base/element/color.json delete mode 100644 entry/src/ohosTest/resources/base/element/string.json delete mode 100644 entry/src/ohosTest/resources/base/media/icon.png delete mode 100644 entry/src/ohosTest/resources/base/profile/test_pages.json delete mode 100644 entry/src/test/List.test.ets delete mode 100644 entry/src/test/LocalUnit.test.ets diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..e2713a2 --- /dev/null +++ b/app/.gitignore @@ -0,0 +1,6 @@ +/node_modules +/oh_modules +/.preview +/build +/.cxx +/.test \ No newline at end of file diff --git a/app/build-profile.json5 b/app/build-profile.json5 new file mode 100644 index 0000000..b695582 --- /dev/null +++ b/app/build-profile.json5 @@ -0,0 +1,28 @@ +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": true, + "files": [ + "./obfuscation-rules.txt" + ] + } + } + } + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/app/hvigorfile.ts b/app/hvigorfile.ts new file mode 100644 index 0000000..c6edcd9 --- /dev/null +++ b/app/hvigorfile.ts @@ -0,0 +1,6 @@ +import { hapTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/app/obfuscation-rules.txt b/app/obfuscation-rules.txt new file mode 100644 index 0000000..985b2ae --- /dev/null +++ b/app/obfuscation-rules.txt @@ -0,0 +1,18 @@ +# Define project specific obfuscation rules here. +# You can include the obfuscation configuration files in the current module's build-profile.json5. +# +# For more details, see +# https://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md + +# Obfuscation options: +# -disable-obfuscation: disable all obfuscations +# -enable-property-obfuscation: obfuscate the property names +# -enable-toplevel-obfuscation: obfuscate the names in the global scope +# -compact: remove unnecessary blank spaces and all line feeds +# -remove-log: remove all console.* statements +# -print-namecache: print the name cache that contains the mapping from the old names to new names +# -apply-namecache: reuse the given cache file + +# Keep options: +# -keep-property-name: specifies property names that you want to keep +# -keep-global-name: specifies names that you want to keep in the global scope \ No newline at end of file diff --git a/app/oh-package-lock.json5 b/app/oh-package-lock.json5 new file mode 100644 index 0000000..5363c7c --- /dev/null +++ b/app/oh-package-lock.json5 @@ -0,0 +1,26 @@ +{ + "meta": { + "stableOrder": false + }, + "lockfileVersion": 3, + "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", + "specifiers": { + "@szyx/sdk_ywx@../sdk_ywx": "@szyx/sdk_ywx@../sdk_ywx", + "@szyx/sdk_base@../basic": "@szyx/sdk_base@../basic" + }, + "packages": { + "@szyx/sdk_ywx@../sdk_ywx": { + "name": "@szyx/sdk_ywx", + "resolved": "../sdk_ywx", + "registryType": "local", + "dependencies": { + "@szyx/sdk_base": "file:../basic" + } + }, + "@szyx/sdk_base@../basic": { + "name": "@szyx/sdk_base", + "resolved": "../basic", + "registryType": "local" + } + } +} \ No newline at end of file diff --git a/app/oh-package.json5 b/app/oh-package.json5 new file mode 100644 index 0000000..fc32a70 --- /dev/null +++ b/app/oh-package.json5 @@ -0,0 +1,17 @@ +{ + "name": "app", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "", + "author": "", + "license": "", + "dependencies": { + "@szyx/sdk_ywx": "file:../sdk_ywx", +// "@szyx/sdk_ywx": "^1.0.4", + "@szyx/sdk_base": "file:../basic", +// "@szyx/sdk_base": "^1.0.2", +// "@yunkss/eftool": "^1.1.8" + }, + "devDependencies": {}, + "dynamicDependencies": {} +} \ No newline at end of file diff --git a/app/patch.json b/app/patch.json new file mode 100644 index 0000000..07c96fe --- /dev/null +++ b/app/patch.json @@ -0,0 +1,11 @@ +{ + "app": { + "bundleName": "com.xuqinmin.hw.demo", + "patchVersionCode": 2000109, + "versionCode": 1 + }, + "module": { + "name": "entry", + "type": "hotreload" + } +} \ No newline at end of file diff --git a/app/src/main/ets/entryability/EntryAbility.ets b/app/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000..64c7817 --- /dev/null +++ b/app/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,41 @@ +import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { window } from '@kit.ArkUI'; + +export default class EntryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy(): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/Index', (err, data) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy(): void { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground(): void { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/app/src/main/ets/pages/Home.ets b/app/src/main/ets/pages/Home.ets new file mode 100644 index 0000000..e69de29 diff --git a/app/src/main/ets/pages/Index.ets b/app/src/main/ets/pages/Index.ets new file mode 100644 index 0000000..a3ee1de --- /dev/null +++ b/app/src/main/ets/pages/Index.ets @@ -0,0 +1,59 @@ +import { CertHome } from './cert/CertHome' +import { SettingView } from './setting/SettingView' +import { RouterBuilder } from '../router/RouterBuilder' +import { BJCASDK } from '@szyx/sdk_ywx/Index' +import { SignHome } from './sign/SignHome' + +@Entry +@Component +struct Index { + @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() + @State currentIndex: number = 0 + + @Builder + tabBuilder(title: string, targetIndex: number, selectedImg: Resource, normalImg: Resource) { + Column() { + Image(this.currentIndex === targetIndex ? selectedImg : normalImg) + .size({ width: 25, height: 25 }) + Text(title) + .fontColor(this.currentIndex === targetIndex ? '#d81e06' : '#8a8a8a') + } + .width('100%') + .height(50) + .justifyContent(FlexAlign.Center) + } + + aboutToAppear(): void { + BJCASDK.settingManager().init() + } + + build() { + Navigation(this.pageInfos) { + Tabs({ barPosition: BarPosition.End }) { + TabContent() { + CertHome() + } + .tabBar(this.tabBuilder('证书', 0, $r('app.media.icon_home_selected'), $r('app.media.icon_home_normal'))) + + TabContent() { + SignHome() + } + .tabBar(this.tabBuilder('签名', 1, $r('app.media.icon_sign_selected'), $r('app.media.icon_sign_normal'))) + + TabContent() { + Text('1.0.1版本上线').fontSize(30) + } + .tabBar(this.tabBuilder('二维码', 2, $r('app.media.icon_code_selected'), $r('app.media.icon_code_normal'))) + + TabContent() { + SettingView() + } + .tabBar(this.tabBuilder('设置', 3, $r('app.media.icon_setting_selected'), $r('app.media.icon_setting_Normal'))) + + }.scrollable(false).barMode(BarMode.Fixed).animationDuration(0) + .onChange((index: number) => { + this.currentIndex = index + }) + }.navDestination(RouterBuilder).hideTitleBar(true) + } +} \ No newline at end of file diff --git a/app/src/main/ets/pages/PageOne.ets b/app/src/main/ets/pages/PageOne.ets new file mode 100644 index 0000000..b1d40a1 --- /dev/null +++ b/app/src/main/ets/pages/PageOne.ets @@ -0,0 +1,13 @@ +// PageOne.ets +@Entry +@Component +export struct PageOneTmp { + build() { + Button('pushPathByName', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + }) + } +} \ No newline at end of file diff --git a/app/src/main/ets/pages/PageTwo.ets b/app/src/main/ets/pages/PageTwo.ets new file mode 100644 index 0000000..b248b2b --- /dev/null +++ b/app/src/main/ets/pages/PageTwo.ets @@ -0,0 +1,24 @@ +// PageTwo.ets +export class Pages { + names: string = "" + values: NavPathStack | null = null +} + +@Builder +export function pageTwoTmp(info: Pages) { + NavDestination() { + Column() { + Button('pushPathByName', { stateEffect: true, type: ButtonType.Capsule }) + .width('80%') + .height(40) + .margin(20) + .onClick(() => { + (info.values as NavPathStack).pushPathByName('pageOne', null) + }) + }.width('100%').height('100%') + }.title('pageTwo') + .onBackPressed(() => { + (info.values as NavPathStack).pop() + return true + }) +} \ No newline at end of file diff --git a/app/src/main/ets/pages/cert/CertHome.ets b/app/src/main/ets/pages/cert/CertHome.ets new file mode 100644 index 0000000..3207947 --- /dev/null +++ b/app/src/main/ets/pages/cert/CertHome.ets @@ -0,0 +1,199 @@ +import promptAction from '@ohos.promptAction'; +import { HttpHelper, ToolsHelper } from '@szyx/sdk_base'; +import { BJCASDK } from '@szyx/sdk_ywx/Index'; +import { BJCACallMsg } from '@szyx/sdk_ywx/src/main/ets/public/callBack/BJCACallMsg'; + +@Component +@Preview +export struct CertHome { + @Consume('pageInfos') pageInfos: NavPathStack; + private oldTime = 0 + // 手机号 + @State phone: string = '15731028102' + @State draw: string | null = null + + build() { + NavDestination() { + Column() { + Text('证书下载完成后即可签名') + .margin({ top: 100 }) + Row({ space: FlexAlign.SpaceBetween }) { + TextInput({ + placeholder: '证书下载需要填写手机号', + text: $$this.phone, + }) + .width('70%') + .maxLength(11) + .fontSize(16) + .placeholderFont({ size: 16 }) + .type(InputType.PhoneNumber)/** + * 正则表达式,限制输入内容,而不是格式验证 + * 配置该参数后,上面的type会失效 + */ + .inputFilter('[-0-9]', error => { + ToolsHelper.showMessage(error) + }) + Button('证书下载', { stateEffect: true, type: ButtonType.Normal, buttonStyle: ButtonStyleMode.NORMAL }) + .width('30%') + .fontColor('#333333') + .height(40) + .onClick(() => { + BJCASDK.certManager().certDown(this.phone, undefined, (result) => { + ToolsHelper.showMessage(result.msg) + }) + }) + } + .width('100%') + .alignItems(VerticalAlign.Center) + .margin({ top: 50 }) + + Row() { + Button('查看证书页面', { stateEffect: true, type: ButtonType.Normal, buttonStyle: ButtonStyleMode.NORMAL }) + .width('40%') + .fontColor('#333333') + .height(40) + .onClick(() => { + if (BJCASDK.certManager().existsCert(this.phone)) { + BJCASDK.certManager().showCertPage(this.phone, (result) => { + ToolsHelper.showMessage(result.msg) + }) + } else { + ToolsHelper.showMessage("证书不存在,请先下证。") + } + }) + Button('查看用户信息', { stateEffect: true, type: ButtonType.Normal, buttonStyle: ButtonStyleMode.NORMAL }) + .width('40%') + .height(40) + .fontColor('#333333') + .onClick(() => { + if (BJCASDK.certManager().existsCert(this.phone)) { + BJCASDK.certManager().getUserInfo(this.phone, res => { + ToolsHelper.showMessage(JSON.stringify(res)) + }) + } else { + ToolsHelper.showMessage("证书不存在,请先下证。") + } + }) + + }.margin({ top: 20 }) + .width('100%') + .justifyContent(FlexAlign.SpaceAround) + + Grid() { + GridItem() { + Button('密码重置', { stateEffect: true, type: ButtonType.Normal, buttonStyle: ButtonStyleMode.NORMAL }) + .height(40) + .fontColor('#333333') + .width('100%') + .onClick(() => { + BJCASDK.certManager().certResetPin(undefined, res => { + if (res !== BJCACallMsg.SUCCESS) { + ToolsHelper.showMessage(JSON.stringify(res)) + } + }) + }) + } + + GridItem() { + Button('证书更新', { stateEffect: true, type: ButtonType.Normal, buttonStyle: ButtonStyleMode.NORMAL }) + .height(40) + .fontColor('#333333') + .width('100%') + .onClick(() => { + BJCASDK.certManager().certUpdate(this.phone, undefined, res => { + if (res !== BJCACallMsg.SUCCESS) { + ToolsHelper.showMessage(JSON.stringify(res)) + } + }) + }) + } + + GridItem() { + Button('存在本地证书', { stateEffect: true, type: ButtonType.Normal, buttonStyle: ButtonStyleMode.NORMAL }) + .height(40) + .fontColor('#333333') + .width('100%') + .onClick(() => { + ToolsHelper.showMessage(BJCASDK.certManager().existsCert(this.phone) ? "证书存在" : "证书不存在") + }) + } + + GridItem() { + Button('清除本地证书', { stateEffect: true, type: ButtonType.Normal, buttonStyle: ButtonStyleMode.NORMAL }) + .height(40) + .fontColor('#333333') + .width('100%') + .onClick(() => { + BJCASDK.certManager().certClear() + }) + } + } + .margin({ top: 20 }) + .width('100%') + .columnsGap(10) + .height(100) + .rowsTemplate('1fr 1fr') + .columnsTemplate('1fr 1fr') + + + Text('用户可以修改个人的手写签名图片') + .margin({ top: 20 }) + + Row() { + Button('查看个人签章图片', { + stateEffect: true, + type: ButtonType.Normal, + buttonStyle: ButtonStyleMode.NORMAL + }) + .width('40%') + .fontColor('#333333') + .height(40) + .onClick(() => { + BJCASDK.certManager().drawStamp(this.phone, res => { + if (res.code === BJCACallMsg.SUCCESS.code && res.data) { + this.draw = res.data + } else { + ToolsHelper.showMessage("未设置签名图片") + } + }) + }) + Button('修改个人签章图片', { + stateEffect: true, + type: ButtonType.Normal, + buttonStyle: ButtonStyleMode.NORMAL + }) + .width('40%') + .height(40) + .fontColor('#333333') + .onClick(() => { + ToolsHelper.showMessage('hello world1') + }) + + }.margin({ top: 10 }) + .width('100%') + .justifyContent(FlexAlign.SpaceAround) + + Image(`data:image/png;base64,${this.draw}`) + .width(300) + .height(200) + .margin({ top: 15 }) + .objectFit(ImageFit.Contain) + .visibility(this.draw ? Visibility.Visible : Visibility.None) + + } + }.padding({ left: 15, right: 15 }).hideTitleBar(true) + .onBackPressed(() => { + const currentTime = new Date().getTime() + + if (currentTime - this.oldTime > 1500) { + promptAction.showToast({ + message: '双击退出', + duration: 2000 + }); + this.oldTime = currentTime + return false + } + return true + }) + } +} \ No newline at end of file diff --git a/app/src/main/ets/pages/evn/ChangeEvnView.ets b/app/src/main/ets/pages/evn/ChangeEvnView.ets new file mode 100644 index 0000000..73866c8 --- /dev/null +++ b/app/src/main/ets/pages/evn/ChangeEvnView.ets @@ -0,0 +1,142 @@ +import { ToolsHelper } from '@szyx/sdk_base/Index'; +import { BJCASDK, EnvEnum } from '@szyx/sdk_ywx'; +import { AlertDialog } from '@ohos.arkui.advanced.Dialog'; + +@Component +@Preview +export struct ChangeEvnView { + @Consume('pageInfos') pageInfos: NavPathStack + // 环境信息 + @State envType: EnvEnum = BJCASDK.settingManager().getServerEnvType() + // 环境地址 + @State envUrl: String = BJCASDK.settingManager().getServerEnvUrl() + // 是否清理证书 + @State clean: boolean = true + // 切换确认 + dialogControllerConfirm: CustomDialogController = new CustomDialogController({ + builder: AlertDialog({ + content: '确定需要切换环境吗?', + primaryButton: { + value: '取消', + action: () => { + }, + }, + secondaryButton: { + value: '确认', + fontColor: $r('sys.color.ohos_id_color_warning'), + action: () => { + BJCASDK.settingManager().setServerEnvType(this.envType) + this.pageInfos.pop() + } + }, + }), + autoCancel: true, + customStyle: true, + alignment: DialogAlignment.Center + }) + + build() { + NavDestination() { + Column() { + Row() { + Text(`当前环境地址:${this.envType}\n${this.envUrl}`).margin({ left: 5 }) + }.width('100%') + + Row() { + Radio({ value: 'Radio1', group: 'evnGroup' }) + .height(20) + .width(20) + .onChange((isChecked: boolean) => { + if (isChecked) { + this.envType = EnvEnum.DEV + this.envUrl = BJCASDK.settingManager().getUrlByEnvType(EnvEnum.DEV) + } + }).checked(this.envType == EnvEnum.DEV) + Text('开发环境').margin({ left: 5 }).onClick(() => { + this.envType = EnvEnum.DEV + this.envUrl = BJCASDK.settingManager().getUrlByEnvType(EnvEnum.DEV) + }) + }.width('100%').margin({ top: 15 }) + + Row() { + Radio({ value: 'Radio2', group: 'evnGroup' }) + .height(20) + .width(20) + .onChange((isChecked: boolean) => { + if (isChecked) { + this.envType = EnvEnum.TEST + this.envUrl = BJCASDK.settingManager().getUrlByEnvType(EnvEnum.TEST) + } + }).checked(this.envType == EnvEnum.TEST) + Text('测试环境').margin({ left: 5 }).onClick(() => { + this.envType = EnvEnum.TEST + this.envUrl = BJCASDK.settingManager().getUrlByEnvType(EnvEnum.TEST) + }) + }.width('100%').margin({ top: 5 }) + + Row() { + Radio({ value: 'Radio3', group: 'evnGroup' }) + .height(20) + .width(20) + .onChange((isChecked: boolean) => { + if (isChecked) { + this.envType = EnvEnum.INTEGRATE + this.envUrl = BJCASDK.settingManager().getUrlByEnvType(EnvEnum.INTEGRATE) + } + }).checked(this.envType == EnvEnum.INTEGRATE) + Text('集成环境').margin({ left: 5 }).onClick(() => { + this.envType = EnvEnum.INTEGRATE + this.envUrl = BJCASDK.settingManager().getUrlByEnvType(EnvEnum.INTEGRATE) + }) + }.width('100%').margin({ top: 5 }) + + Row() { + Radio({ value: 'Radio3', group: 'evnGroup' }) + .height(20) + .width(20) + .onChange((isChecked: boolean) => { + if (isChecked) { + this.envType = EnvEnum.PUBLIC + this.envUrl = BJCASDK.settingManager().getUrlByEnvType(EnvEnum.PUBLIC) + } + }).checked(this.envType == EnvEnum.PUBLIC) + Text('运营环境').margin({ left: 5 }).onClick(() => { + this.envType = EnvEnum.PUBLIC + this.envUrl = BJCASDK.settingManager().getUrlByEnvType(EnvEnum.PUBLIC) + }) + }.width('100%').margin({ top: 5 }) + + Row() { + Toggle({ type: ToggleType.Checkbox, isOn: this.clean }) + + Text('清空本地数据').margin({ left: 5 }) + }.width('100%').margin({ top: 10 }) + + Row() { + Button('取消', { type: ButtonType.Normal, stateEffect: true }) + .borderRadius(8) + .backgroundColor(0x317aff) + .width(90) + .height(40) + .onClick(() => { + this.pageInfos.pop() + }) + Button('确定', { type: ButtonType.Normal, stateEffect: true }) + .borderRadius(8) + .backgroundColor(0x317aff) + .width(90) + .height(40) + .onClick(() => { + if (BJCASDK.settingManager().getServerEnvType() == this.envType) { + ToolsHelper.showMessage('环境没有变更!') + return + } + this.dialogControllerConfirm.open() + + }) + }.width('100%').margin({ top: 20 }).justifyContent(FlexAlign.SpaceAround) + + }.width('100%').height('100%').padding(20) + }.title('切换sdk环境') + } +} \ No newline at end of file diff --git a/app/src/main/ets/pages/setting/SettingView.ets b/app/src/main/ets/pages/setting/SettingView.ets new file mode 100644 index 0000000..8dd5744 --- /dev/null +++ b/app/src/main/ets/pages/setting/SettingView.ets @@ -0,0 +1,89 @@ +import { ToolsHelper } from '@szyx/sdk_base'; +import { BJCASDK } from '@szyx/sdk_ywx'; + +@Component +@Preview +export struct SettingView { + @Consume('pageInfos') pageInfos: NavPathStack + // 环境地址 + @State clientId: string | undefined = BJCASDK.settingManager().getClientId() + @State clientIdEdit: string | undefined = '2015112716143758' + + + build() { + NavDestination() { + Column() { + Row() { + Text(`当前厂商ID:${this.clientId}`).margin({ left: 5 }) + }.width('100%') + + Row({ space: FlexAlign.SpaceBetween }) { + TextInput({ + placeholder: '输入厂商ID', + text: $$this.clientIdEdit, + }) + .width('70%') + .fontSize(16) + .placeholderFont({ size: 16 }) + .type(InputType.PhoneNumber) + Button('确认', { stateEffect: true, type: ButtonType.Normal, buttonStyle: ButtonStyleMode.NORMAL }) + .width('30%') + .fontColor('#333333') + .height(40) + .onClick(() => { + if (!this.clientIdEdit) { + ToolsHelper.showMessage('请输入厂商ID') + return + } + BJCASDK.settingManager().setClientId(this.clientIdEdit) + this.clientId = BJCASDK.settingManager().getClientId() + }) + } + .width('80%') + .alignItems(VerticalAlign.Center) + .margin({ top: 10 }) + + Button('获取当前版本号', { stateEffect: true, type: ButtonType.Normal, buttonStyle: ButtonStyleMode.NORMAL }) + .width('80%') + .fontColor('#333333') + .height(40) + .onClick(() => { + ToolsHelper.showMessage(BJCASDK.settingManager().getVersion()) + }) + .margin({ top: 60 }) + Button('切换环境', { stateEffect: true, type: ButtonType.Normal, buttonStyle: ButtonStyleMode.NORMAL }) + .width('80%') + .fontColor('#333333') + .height(40) + .onClick(() => { + this.pageInfos.pushPathByName('ChangeEvnView', undefined) + }) + .margin({ top: 10 }) + Button('设置语言-中文', { stateEffect: true, type: ButtonType.Normal, buttonStyle: ButtonStyleMode.NORMAL }) + .width('80%') + .fontColor('#333333') + .height(40) + .onClick(() => { + ToolsHelper.showMessage('hello world1') + }) + .margin({ top: 30 }) + Button('设置语言-英文', { stateEffect: true, type: ButtonType.Normal, buttonStyle: ButtonStyleMode.NORMAL }) + .width('80%') + .fontColor('#333333') + .height(40) + .onClick(() => { + ToolsHelper.showMessage('hello world1') + }) + .margin({ top: 10 }) + Button('显示pin码输入框', { stateEffect: true, type: ButtonType.Normal, buttonStyle: ButtonStyleMode.NORMAL }) + .width('80%') + .fontColor('#333333') + .height(40) + .onClick(() => { + ToolsHelper.showMessage('hello world1') + }) + .margin({ top: 10 }) + } + }.padding({ left: 15, right: 15, top: 100 }).hideTitleBar(true) + } +} \ No newline at end of file diff --git a/app/src/main/ets/pages/sign/Sign.ets b/app/src/main/ets/pages/sign/Sign.ets new file mode 100644 index 0000000..ac2d307 --- /dev/null +++ b/app/src/main/ets/pages/sign/Sign.ets @@ -0,0 +1,213 @@ +import { HttpHelper, ToolsHelper } from '@szyx/sdk_base/Index' +import { BJCASDK, PinDialog } from '@szyx/sdk_ywx/Index' +import { SynedModel } from './SynedModel' + +@Component +@Preview +export struct Sign { + @Consume('pageInfos') pageInfos: NavPathStack + @State mDoctorId: string | null = '130427199604025922' + @State mNum: string = '1' + @State mListUniqueId: string[] = [] + @State mSynedNum: number = 0 + @State uniqueId: string | null = null + @State needSignNow: boolean = false + + private signRequest() { + this.needSignNow = false + BJCASDK.signManager().signWithFirmId(this.mListUniqueId, (res) => { + ToolsHelper.showMessage(JSON.stringify(res)) + }) + } + + private shouldSynAgain() { + this.mSynedNum += 1 + if (this.mSynedNum < Number.parseInt(this.mNum)) { + this.synUnSignData() + } else { + ToolsHelper.showMessage('处方同步完成') + if (this.needSignNow) { + this.signRequest() + } + } + } + + private synUnSignData() { + HttpHelper.get() + .get(BJCASDK.settingManager() + .getServerEnvUrl() + `AppOAuthDemo/synSdkRecipeInfoForBatch?clientId=${BJCASDK.settingManager() + .getClientId()!}&doctorId=${this.mDoctorId}`, undefined) + .then(res => { + console.log('---->', JSON.stringify(res)) + if (res.status === '0') { + this.mListUniqueId.push(res.data.uniqueId) + } + this.shouldSynAgain() + }).catch(() => { + ToolsHelper.showMessage(`同步第 ${this.mSynedNum + 1} 条处方失败!`) + this.shouldSynAgain() + }) + } + + build() { + NavDestination() { + Column() { + Text('第一步,模拟应用厂商将多条待签数据同步到医网信获取待签名数据的唯一标识uniqueId。') + .margin({ top: 20 }) + .fontSize(16) + .fontColor('#666666') + Row() { + Text('医师证号:') + .fontSize(16) + .fontColor('#666666') + TextInput({ + placeholder: '请输入医师证号', + text: $$this.mDoctorId, + }) + .margin({ left: 5 }) + .layoutWeight(1) + }.alignItems(VerticalAlign.Center) + .margin({ top: 10 }) + .width('100%') + + Row() { + Button('1.批量获取待签数据:', { + stateEffect: true, + type: ButtonType.Normal, + buttonStyle: ButtonStyleMode.NORMAL + }) + .fontSize(16) + .fontColor('#666666') + .enabled(this.mSynedNum === 0 || this.mSynedNum === this.mListUniqueId.length) + .onClick(() => { + if (!this.mDoctorId) { + ToolsHelper.showMessage('医师证号不能为空') + return + } + if (!this.mNum || Number.parseInt(this.mNum) < 1 || Number.parseInt(this.mNum) > 100) { + ToolsHelper.showMessage('需要批量签名数量不能小于1,不能大于100') + return + } + this.mListUniqueId = [] + this.mSynedNum = 0 + this.needSignNow = false + this.synUnSignData() + }) + TextInput({ + text: $$this.mNum, + }) + .enabled(this.mSynedNum === 0 || this.mSynedNum === this.mListUniqueId.length) + .margin({ left: 5 }) + .width(60) + .maxLength(3) + .type(InputType.Number) + Text('条') + .fontSize(16) + .fontColor('#666666') + .textAlign(TextAlign.Center) + .margin({ left: 3 }) + }.alignItems(VerticalAlign.Center) + .width('100%') + .margin({ top: 10 }) + + Text(`已同步 ${this.mListUniqueId.length}/${this.mNum} 条待签数据`) + .fontSize(14) + .fontColor('#666666') + .textAlign(TextAlign.Center) + .width('100%') + .margin({ top: 10 }) + Text(`当前待签名数据总量为: ${this.mListUniqueId.length}`) + .fontSize(14) + .fontColor('#666666') + .textAlign(TextAlign.Center) + .width('100%') + .margin({ top: 5 }) + Text('第二步,调用医网信接口进行签名,参数为厂商标识(clientId)和医网信待签数据唯一标识(uniqueId)的List列表(不大于100条)') + .margin({ top: 30 }) + .fontSize(16) + .fontColor('#666666') + Button(this.mSynedNum >= Number.parseInt(this.mNum) ? '2.签名' : '请耐心等待批量同步待签数据', { + stateEffect: true, + type: ButtonType.Normal, + buttonStyle: ButtonStyleMode.NORMAL, + }) + .enabled(this.mSynedNum >= Number.parseInt(this.mNum)) + .fontSize(16) + .width('100%') + .fontColor('#666666') + .margin({ top: 10 }) + .onClick(() => { + this.signRequest() + }) + Button(this.mSynedNum === 0 ? '立即签名(同步后立即签名)' : '正在同步处方数据', { + stateEffect: true, + type: ButtonType.Normal, + buttonStyle: ButtonStyleMode.NORMAL + }) + .fontSize(16) + .width('100%') + .fontColor('#666666') + .margin({ top: 10 }) + .enabled(this.mSynedNum === 0) + .onClick(() => { + if (!this.mDoctorId) { + ToolsHelper.showMessage('医师证号不能为空') + return + } + if (!this.mNum || Number.parseInt(this.mNum) < 1) { + ToolsHelper.showMessage('需要批量签名数量不能小于1,不能大于100') + return + } + this.mListUniqueId = [] + this.mSynedNum = 0 + this.needSignNow = true + this.synUnSignData() + }) + Row() { + TextInput({ + text: $$this.uniqueId, + placeholder: '请输入待签uniqueId' + }) + .margin({ left: 5 }) + .width(180) + .type(InputType.NUMBER_DECIMAL) + Button('添加uniqueId', { + stateEffect: true, + type: ButtonType.Normal, + buttonStyle: ButtonStyleMode.NORMAL + }) + .fontSize(16) + .layoutWeight(1) + .margin({ left: 3 }) + .fontColor('#666666') + .onClick(() => { + if (this.uniqueId) { + this.mListUniqueId.push(this.uniqueId) + this.uniqueId = null + } + }) + }.alignItems(VerticalAlign.Center) + .width('100%') + .margin({ top: 40 }) + + Button('手动签名', { + stateEffect: true, + type: ButtonType.Normal, + buttonStyle: ButtonStyleMode.NORMAL + }) + .fontSize(16) + .width('100%') + .fontColor('#666666') + .margin({ top: 10 }) + .onClick(() => { + this.signRequest() + }) + + PinDialog({ + controller: BJCASDK.signManager().dialogController + }) + + }.width('100%').height('100%').padding(20) + }.title('医师sdk签名演示') + } +} \ No newline at end of file diff --git a/app/src/main/ets/pages/sign/SignForAuto.ets b/app/src/main/ets/pages/sign/SignForAuto.ets new file mode 100644 index 0000000..3379982 --- /dev/null +++ b/app/src/main/ets/pages/sign/SignForAuto.ets @@ -0,0 +1,81 @@ +import { ToolsHelper } from '@szyx/sdk_base/Index' +import { BJCASDK, PinDialog } from '@szyx/sdk_ywx/Index' + +@Component +@Preview +export struct SignForAuto { + @State sysTag: string | null = null + + build() { + NavDestination() { + Column() { + + Row() { + Text('系统标识名称') + .fontSize(16) + .fontColor('#666666') + TextInput({ + text: $$this.sysTag, + placeholder: '开启自动签标识' + }) + .margin({ left: 5 }) + .width(160) + }.alignItems(VerticalAlign.Center) + .width('100%') + .margin({ top: 10 }) + + Row() { + Button('获取自动签信息', { + stateEffect: true, + type: ButtonType.Normal, + buttonStyle: ButtonStyleMode.NORMAL, + }) + .fontSize(16) + .fontColor('#666666') + .onClick(() => { + BJCASDK.signManager().getSignAutoInfo((res) => { + ToolsHelper.showMessage(JSON.stringify(res)) + }) + }) + Button('开启自动签名', { + stateEffect: true, + type: ButtonType.Normal, + buttonStyle: ButtonStyleMode.NORMAL, + }) + .fontSize(16) + .fontColor('#666666') + .margin({ left: 10 }) + .onClick(() => { + if (!this.sysTag) { + ToolsHelper.showMessage('请输入系统标识') + return + } + BJCASDK.signManager().signForSignAuto(this.sysTag, (res) => { + ToolsHelper.showMessage(JSON.stringify(res)) + }) + }) + }.alignItems(VerticalAlign.Center) + .width('100%') + .margin({ top: 15 }) + + Button('关闭自动签名', { + stateEffect: true, + type: ButtonType.Normal, + buttonStyle: ButtonStyleMode.NORMAL, + }) + .fontSize(16) + .fontColor('#666666') + .margin({ top: 10 }) + .onClick(() => { + BJCASDK.signManager().stopSignAuto(this.sysTag ?? undefined, (res) => { + ToolsHelper.showMessage(JSON.stringify(res)) + }) + }) + + PinDialog({ + controller: BJCASDK.signManager().dialogController + }) + }.width('100%').height('100%').padding(20) + }.title('医师sdk自动签名演示') + } +} \ No newline at end of file diff --git a/app/src/main/ets/pages/sign/SignForPin.ets b/app/src/main/ets/pages/sign/SignForPin.ets new file mode 100644 index 0000000..661e13a --- /dev/null +++ b/app/src/main/ets/pages/sign/SignForPin.ets @@ -0,0 +1,129 @@ +import { ToolsHelper } from '@szyx/sdk_base/Index' +import { BJCASDK, PinDialog } from '@szyx/sdk_ywx/Index' + +@Component +@Preview +export struct SignForPin { + @State mNum: string = '1' + + build() { + NavDestination() { + Column() { + Text('此页面的接口是为了让用户在签名过程中无需输入证书签名密码,如果不使用可以忽略。') + .margin({ top: 20 }) + .fontSize(16) + .fontColor('#666666') + Text('1.开启免密签名后,在开启时间内用户签名无需输入密码') + .margin({ top: 80 }) + .fontSize(16) + .fontColor('#666666') + + Row() { + Text('免密时间1-60天:') + .fontSize(16) + .fontColor('#666666') + TextInput({ + text: $$this.mNum, + placeholder: '天数' + }) + .margin({ left: 5 }) + .width(60) + .maxLength(3) + .type(InputType.Number) + + Button('开启免密', { + stateEffect: true, + type: ButtonType.Normal, + buttonStyle: ButtonStyleMode.NORMAL, + }) + .fontSize(16) + .margin({ left: 5 }) + .fontColor('#666666') + .onClick(() => { + BJCASDK.signManager().keepPin(Number.parseInt(this.mNum), (res) => { + ToolsHelper.showMessage(JSON.stringify(res)) + }) + }) + }.alignItems(VerticalAlign.Center) + .width('100%') + .margin({ top: 10 }) + + Row() { + + Button('判断免密状态', { + stateEffect: true, + type: ButtonType.Normal, + buttonStyle: ButtonStyleMode.NORMAL, + }) + .fontSize(16) + .fontColor('#666666') + .onClick(() => { + ToolsHelper.showMessage(BJCASDK.signManager().isPinExempt() ? '已开启' : '未开启') + }) + Button('取消免密', { + stateEffect: true, + type: ButtonType.Normal, + buttonStyle: ButtonStyleMode.NORMAL, + }) + .fontSize(16) + .fontColor('#666666') + .margin({ left: 10 }) + .onClick(() => { + BJCASDK.signManager().clearPin(() => { + ToolsHelper.showMessage('免密签名已关闭') + }) + }) + }.alignItems(VerticalAlign.Center) + .width('100%') + .margin({ top: 10 }) + + Text('---以下功能,1.0.1版本开始支持---') + .margin({ top: 80 }) + .fontSize(13) + .fontColor('#999999') + Text('2.开启指纹签名后,在开启状态内用户可以通过指纹验证来进行签名,当免密开启时无效') + .margin({ top: 10 }) + .fontSize(16) + .fontColor('#666666') + Row() { + Button('指纹签名状态', { + stateEffect: true, + type: ButtonType.Normal, + buttonStyle: ButtonStyleMode.NORMAL, + }) + .fontSize(16) + .fontColor('#666666') + .onClick(() => { + }) + Button('开启指纹签名', { + stateEffect: true, + type: ButtonType.Normal, + buttonStyle: ButtonStyleMode.NORMAL, + }) + .fontSize(16) + .fontColor('#666666') + .margin({ left: 10 }) + .onClick(() => { + }) + }.alignItems(VerticalAlign.Center) + .width('100%') + .margin({ top: 10 }) + + Button('关闭指纹签名', { + stateEffect: true, + type: ButtonType.Normal, + buttonStyle: ButtonStyleMode.NORMAL, + }) + .fontSize(16) + .fontColor('#666666') + .margin({ top: 5 }) + .onClick(() => { + }) + + PinDialog({ + controller: BJCASDK.signManager().dialogController + }) + }.width('100%').height('100%').padding(20) + }.title('医师sdk免密签名演示') + } +} \ No newline at end of file diff --git a/app/src/main/ets/pages/sign/SignHome.ets b/app/src/main/ets/pages/sign/SignHome.ets new file mode 100644 index 0000000..2d420c7 --- /dev/null +++ b/app/src/main/ets/pages/sign/SignHome.ets @@ -0,0 +1,69 @@ +import promptAction from '@ohos.promptAction'; +import { ToolsHelper } from '@szyx/sdk_base/Index'; +import { BJCASDK } from '@szyx/sdk_ywx/Index'; + +@Component +@Preview +export struct SignHome { + @Consume('pageInfos') pageInfos: NavPathStack; + private oldTime = 0 + + build() { + NavDestination() { + Column() { + Button('签名', { stateEffect: true, type: ButtonType.Normal, buttonStyle: ButtonStyleMode.NORMAL }) + .width('40%') + .fontColor('#333333') + .height(40) + .onClick(() => { + if (BJCASDK.certManager().existsCert()) { + this.pageInfos.pushPathByName('Sign', undefined) + } else { + ToolsHelper.showMessage("证书不存在,请先下证。") + } + }) + Button('自动签', { stateEffect: true, type: ButtonType.Normal, buttonStyle: ButtonStyleMode.NORMAL }) + .width('40%') + .fontColor('#333333') + .height(40) + .margin({ top: 40 }) + .onClick(() => { + if (BJCASDK.certManager().existsCert()) { + this.pageInfos.pushPathByName('SignForAuto', undefined) + } else { + ToolsHelper.showMessage("证书不存在,请先下证。") + } + }) + Button('免密签名', { stateEffect: true, type: ButtonType.Normal, buttonStyle: ButtonStyleMode.NORMAL }) + .width('40%') + .fontColor('#333333') + .height(40) + .margin({ top: 40 }) + .onClick(() => { + if (BJCASDK.certManager().existsCert()) { + this.pageInfos.pushPathByName('SignForPin', undefined) + } else { + ToolsHelper.showMessage("证书不存在,请先下证。") + } + }) + } + .width('100%') + .height("100%") + .padding(20) + .backgroundColor("#ffffff") + }.padding({ left: 15, right: 15 }).hideTitleBar(true) + .onBackPressed(() => { + const currentTime = new Date().getTime() + + if (currentTime - this.oldTime > 1500) { + promptAction.showToast({ + message: '双击退出', + duration: 2000 + }); + this.oldTime = currentTime + return false + } + return true + }) + } +} \ No newline at end of file diff --git a/app/src/main/ets/pages/sign/SynedData.ets b/app/src/main/ets/pages/sign/SynedData.ets new file mode 100644 index 0000000..7737209 --- /dev/null +++ b/app/src/main/ets/pages/sign/SynedData.ets @@ -0,0 +1,11 @@ +export class SynedData { + doctorId: string + clientId: string + + constructor(doctorId: string, clientId: string) { + this.doctorId = doctorId + this.clientId = clientId + } + + +} \ No newline at end of file diff --git a/app/src/main/ets/pages/sign/SynedModel.ets b/app/src/main/ets/pages/sign/SynedModel.ets new file mode 100644 index 0000000..9a67e7b --- /dev/null +++ b/app/src/main/ets/pages/sign/SynedModel.ets @@ -0,0 +1,12 @@ +export interface Data { + selfSign: boolean; + checkSelfToken: boolean; + uniqueId: string; + timeStampSignData: string; +} + +export interface SynedModel { + data: Data; + message: string; + status: string; +} \ No newline at end of file diff --git a/app/src/main/ets/router/NavPathStackHelper.ets b/app/src/main/ets/router/NavPathStackHelper.ets new file mode 100644 index 0000000..2357715 --- /dev/null +++ b/app/src/main/ets/router/NavPathStackHelper.ets @@ -0,0 +1,12 @@ +import { RouterParam } from './ViewMap'; + +/** + * 导航辅助方法 + */ +export class NavPathStackHelper { + + static pushPathByName(pageInfos: NavPathStack, param: RouterParam) { + console.log('-------------------------------',JSON.stringify(pageInfos)) + pageInfos.pushPathByName('ChangeEvnView', undefined) + } +} \ No newline at end of file diff --git a/app/src/main/ets/router/RouterBuilder.ets b/app/src/main/ets/router/RouterBuilder.ets new file mode 100644 index 0000000..20cd9bb --- /dev/null +++ b/app/src/main/ets/router/RouterBuilder.ets @@ -0,0 +1,23 @@ +import { ChangeEvnView } from '../pages/evn/ChangeEvnView' +import { PageOneTmp } from '../pages/PageOne' +import { Sign } from '../pages/sign/Sign' +import { SignForAuto } from '../pages/sign/SignForAuto' +import { SignForPin } from '../pages/sign/SignForPin' + + +@Builder +export function RouterBuilder(name: string) { + if (name === 'pageOne') { + PageOneTmp() + } else if (name === 'pageTwo') { + // pageTwoTmp() + } else if (name === 'ChangeEvnView') { + ChangeEvnView() + } else if (name === 'Sign') { + Sign() + } else if (name === 'SignForAuto') { + SignForAuto() + } else if (name === 'SignForPin') { + SignForPin() + } +} \ No newline at end of file diff --git a/app/src/main/ets/router/ViewMap.ts b/app/src/main/ets/router/ViewMap.ts new file mode 100644 index 0000000..7649ac9 --- /dev/null +++ b/app/src/main/ets/router/ViewMap.ts @@ -0,0 +1,14 @@ +/** + * 页面名称和参数定义 + */ +type RouterMap = { + ChangeEvnView: undefined +}; + + +export type RouterParam = { + [Key in keyof RouterMap]: { + name: Key; + param: RouterMap[Key]; + }; +}[keyof RouterMap]; \ No newline at end of file diff --git a/app/src/main/module.json5 b/app/src/main/module.json5 new file mode 100644 index 0000000..5c3abb8 --- /dev/null +++ b/app/src/main/module.json5 @@ -0,0 +1,40 @@ +{ + "module": { + "name": "app", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "phone", + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ets", + "description": "$string:EntryAbility_desc", + "icon": "$media:icon", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:startIcon", + "startWindowBackground": "$color:start_window_background", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ], + "requestPermissions": [ + {"name": "ohos.permission.INTERNET", + "reason": "$string:permission_internet"} + ] + } +} \ No newline at end of file diff --git a/app/src/main/resources/base/element/color.json b/app/src/main/resources/base/element/color.json new file mode 100644 index 0000000..3c71296 --- /dev/null +++ b/app/src/main/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] +} \ No newline at end of file diff --git a/app/src/main/resources/base/element/string.json b/app/src/main/resources/base/element/string.json new file mode 100644 index 0000000..f945955 --- /dev/null +++ b/app/src/main/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "label" + } + ] +} \ No newline at end of file diff --git a/app/src/main/resources/base/media/icon.png b/app/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..cd45accb1dfd2fd0da16c732c72faa6e46b26521 GIT binary patch literal 2041 zcmaJ?c~nzZ9u6@;0AXaYAVN(;Kr(@>EJ+}skOWf=BA~*l4us@ELY9{%0m5QX6pnb} z(jZF|S&pLAS}3BZAfeQSvJ_h>F2Q1PYqi?o5`;m_yjZdG$1v}l_wK#F^L^iMz2}uD z#K$>1dON~kFlWvhW+Jp=tuN9J`ZlM-rl4h+ij|^D0y9;4JOuz-EdVnB6i3R-0ulk9 zApi4zAQA>!N9@-o026$1@L`d124`3G5<@_m`0f)Ug_Ie~;HT2q<_a=HH> zDwTdfD^-cW-|_xWVP$f@93UhDN-#&khZ>jZXLTi~$0`7x3REP6pk%&^2|`c>DutjN zMJD4Zs6Z}{FOpd;*mo2zm(GzXRXiCV;4m3zNCYnu3Fy=i5;2An&Lp!#LP;bRD~1&s z%VH6UY+}r6YDgG+p34OJIZ{BTn&%4s=CT&#TBkuOhdeU@g(w#guoa*b^)73=XyI65 z7Swys6)YS}?1EeZ6b!-I+yCnIya^g0>-NLsLWd8t56GZ_S3r|ZGbR+mV2ErEb9J)X zIF!njY-D-7{qtF2(?nlQ$0}!pzt=}hc*m%%)0Jb#N_K4@IC-`Pi5DahPZN7N9rH;ol;Gc*>-Go@gXKTM{eP)iJj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{rcfnV_(LPwsDg``wtyS*V<19c3!PGJ3Kqy9ksvkwbJ%Z z*N(fT0{e*Wji-Ck5!3YE0j|PZ@&z`v=kitWL$bqSt!e4bH!+(|Q)CZ30^nVPfkx{s zX{6of`p=BiPb@u@IyL!tRk>?qgBqCmo-Zlt!636g?z`s~zdfwuB7DXZHvV`Usp+%Z zo*&;Biu@MHE&2j+?j^o`Cr12u<>vOe=a&8a2hlcmFjJiDR>XnD4c4DAhZWCkiAgW{ E51q9-lK=n! literal 0 HcmV?d00001 diff --git a/app/src/main/resources/base/media/icon_code_normal.png b/app/src/main/resources/base/media/icon_code_normal.png new file mode 100644 index 0000000000000000000000000000000000000000..15c45ae7fc3a35d55456e4d6db5860a53e8a5243 GIT binary patch literal 978 zcmV;@11Px&j7da6RCr$PT2YSUAPfyk?=jhvY&)*61BiNIZj z5Wm~Dy~gHe>H^sxQpyX*M%EVSy6#15{mK!@86$*vZQJ(EH&!Y2r>ZIdIqQk(z=BBt z0v~^yVBN@Td=EySNbIVB^7@xrMdcMy08D-j!r+18#9K~A=oUPr zl!Jbw3nI5IYTWhpeIG5KVIWMs0aEy(FoJa?r^7HoDFwv^5NaPVjBON}hh@Ou5A_Ad z<0xk$-&3m(0?3MxSs4H!yH1BJ4sIs{!b?Ws_3o`gh$B^eWdQ(#P&o@g$N>TjyMzj& z79gXq(ONe`h$nKX#{)h%A8x0R9+0Sfb;An)t6Q>}4Nmd^yEmuWkg_+Y>PVf(0>GRE z5SiVhEL9&X2&M|n8BYS>Fti+9!(6Jt0)U@Rr_`>{B-=;;9O`;sL9O+_3EG~~5gI(F z5#SGFV($!TgDzGQW2O26xVV_b&y9fts|n?KK#T{Vqjc{p&Dkq5 zDP_AQ0x;YXqbM_8S%*nJ8U{3aq4^ngw9fI@}QP0?>phMaxH z4lJQ#hjSNjQ6AuShPbtM9{`^Ig7+Mc#huvow@*0*Ob+i}UY^n!f>ssoCj|3#dzK3! zZoV3#`OqfB1E4)d^&Rj6krg3N&u%K~wDZ_qn_NYl`6K|AeVN8%PG@Lw1yT4m762S1 z*E*&Eu-28E%kJUby?GD#4Px#07*qoM6N<$g1KL? A7XSbN literal 0 HcmV?d00001 diff --git a/app/src/main/resources/base/media/icon_code_selected.png b/app/src/main/resources/base/media/icon_code_selected.png new file mode 100644 index 0000000000000000000000000000000000000000..9ce067844d75c9c84fb3473c2a0c168c39a99417 GIT binary patch literal 1012 zcmVPx&u1Q2eRCr$PT47e(FbtN%=-VMi*ZrbB#oCiVPXe5z>?FV`T7E4nJH%dTt)Y?#!w%sYJY3TrOF1p(sY_~msLk_XV-Ql`c>%K1A0IMZ0$I#$EM zZve<@13csO&IT#JR$7xV`cg!^3&{wp1&{H1vo}Dliz0VX)X4O~*_pL`#y6GM8?KoQ z;5xhkpb5{z!2$tDXz`^~ck}gxiVP~Q9Ml&|9_Oo|X1vS#d6CDiDYMLOw>Us3)M#x^04lw@%z_&6kFPcbaK)}r<2}s)KNw^Cjn7sWU4~5#kqty8FF=4Bpy-9Eevdsd)&zZD7CQy zyEO$s`v#~10B+?f=%4NZrvRX!-2_;bGWP-i+flLsz>k;DasBk>sOtzc1)xaU=&#Qe z+DZUSJiz7wk|10+rgZ=ad4RL;F9oD^0N8lI-pzNrX#HXdNJDyQr| z&v`lrK<*(^Op+N7b|1n7Pr(Cv&jcd??4@X{asi*fVhUE0w}7qkfP>DEu-0A&K()VM zqN}#JV|)JgA-6zQWH@}h?A;kcM5^)geu6PyFYaTF`BuI93Oa!2-mOIwEqX!%d$*#(Y i9?(_G9c$ga_kjP58xxEHDCi6T0000Px%(Md!>RCr$Pno(}!AP|NbB?n1Qvdu}hIfRk&)b=S7K17?7Y;LmNdl*rTg)5hZ z0YhtJf~7nK66WKdVP*`lJAdHL?PnE0RluDSs4j5l0;oZ-xNjI-8nipk z`9mszch31KH)Cz<5kg?#t^g)*ssgGDEExkZfkOF(WMV%NQ&x`w`UpKx3CPrNoo4@v zfq`kSdB(2_K&Q`mgfc1tnHrmzbp3b6uL{6OpvW|Igis6sEoD4|KOa;<-}hH49&8qX zmKp}U@k6;WmZrl;O8Ghkq5;H~+voyc612r!AhueRQa=3T39%Re9q_Pd3N4vC05~;G zbBl@ip>q}kfD4)dVG-kTO^X7UKp2ib;yH27-$QpXWn7j30O077e%rR#a*IlYlv4jp zuvr3Nj5!ss*<+AMWJamu&W-`n*-t15z|b`srH;~`bZ4Axsm%kxlVHE!A3Q$Ji0@Mx zuzA%2Dbah4xl~u!Y>IBCCpZUW1>mA($@4d*09}?}eaTmm3NU&SWCmIs0NWcas`@Mn z0P#BSTV9Q29Rp&FANrQL2SMFtd!{}hDXAQvCVAcJ^&&v*}#%B$H zD3Asv5Lb7c0ng^{S;v5gDsh(avlRdU*ExCi+_AQ5aR!8_Q!1+~GMsbkdIBIs8BZ!8 z;7{jnuy?!*08S*<6Ky;RK)06{y(UKia6m{h-V0#qi;_M7283key#Pkdjx8^xROlNZ zuiR||e5LE83H$h6ZxA002ovPDHLkV1jHARXP9w literal 0 HcmV?d00001 diff --git a/app/src/main/resources/base/media/icon_home_selected.png b/app/src/main/resources/base/media/icon_home_selected.png new file mode 100644 index 0000000000000000000000000000000000000000..53f55f29c458f3f2a3980b040c22f664469a4496 GIT binary patch literal 823 zcmV-71IYY|P)Px%@kvBMRCr$Pnq5-cFc5%OB4m09$e1URQ#3hA$w`2dgq(!jBJhM7dWcR4T9A=D zu10^BgDoratJjJ4+aK+&MBv09a^m_!29Q1A#0lgOIB^HaNic^%4gpUB+spGCPtpFx z5E+a{Y{vdF*J7+8uq}QRsDw4@N{|pI9S(LHAUP^U*8tZ0I2RS;t5epF*e&% zN`E0hJ!!M)ZhzGZ00DTo-tCvMDXUx0^JKir0I~<<5a=%lhyqH)rcWjI9XX}<93Z#Q z!d8IP6&GbTCFExy45se!y#gr9XU;_hDSB;V0a91CRneu{<9h|56j0VOw1SWf0O87n zkX7Bf!V5U1Yg;}TEP&G05DOqgBt2Kt!~l^ILKvs?z79kJ2x_+pz(y_5Itzi&ZV@TH z`pzAqGXOH-J$hKbiVB9DFK2%ao4}0k^;u^C#A+Hq=tOz3rcMFWAe395=|RNh?Dg%z z%Y-e3;sn6?!sPnfi_x4?8dL~z#NR5|I00BZV6fYusgMz~1Mv<4#4xqo9&Pi4bO6Yy zQRV8=wZEn_ma){}0hHa};ZWFOyzCAQ+uz^;v`pH)er}!$D?`yC%>Yca)H;7? z9w6Fs1X#O@uOvO7K9g`&pveKyooLy*&!hktkMoXkG!}af2vJ^EsQNS*OA?f0wp-hT zIaK-R0Vp#@?SQq7@=*iO4Oju-KL~A=j~albKPVv>ukKh9o-Wv<-US*rNez{6>;atf zb(1=~sjRMB^o0<*OGR}>X1d#J*W-c^s=U<$Tz}fsx<2wI0CLi+y|mRvc`E?%GW6iX zM_HYW4S)_pTjiYqy1pps0#Ju=4CS2wDl1hZFL?$SYGCJguGaP6dM-xuW1TML+u}~M zBrcFWAaMgb)yp2>M3lHd_JG6<>{Ks%fD=*T0v{|F!e3iJgXsVO002ovPDHLkV1f#s BaIOFV literal 0 HcmV?d00001 diff --git a/app/src/main/resources/base/media/icon_setting_Normal.png b/app/src/main/resources/base/media/icon_setting_Normal.png new file mode 100644 index 0000000000000000000000000000000000000000..334b12ca210db08a061b60cc7236d35e237ce325 GIT binary patch literal 1520 zcmVPx)s!2paRCr$PTitEkFbtO9+oS0uO(sb*#2Ls_lBWQ^A(~FoWRhO@I72N3(I9A1 zq%2)?K;oAKXIUmc{!_GfAN=wkoPYNTz^4YB34!P5=d0arcN;?Z?wmV%?_c-({gdT& zhr{6^gzyN@IpE1l})l1J+${0n!RY7Y&%EDF}=|f$B1;9_M+!xxc>$ zV3rF&9EJgyk6?N4A3<9R;J%FGcxPo)TGtE!u~&FURMXSx^pi4}m;<#&X#(@nFTg_~ z1o)jw`Z$i`R}K*IDX39*t-hfv0P{S5<&s4vxP%LmdmYE|M!KK&`JL`x769J+8_B+b zU=|rripZ`@V%(Xl{8MH0q^%PfocG( z#0ilCa|Cx008o{*YCtalG?TN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7?BgyC?XKY&- z6}>w!k-|Ceb}lA|HlAkVn54FEH)&v_pa`y618pz#+G z&f4eW7ZjzL5RpLAVOkmhBHeEmGf}!jp%MMh~YYaPsI_b!A^nShxr1TwlkK z_}msS8-b+1Qz!tmN;4HHq4Co_iKGg&b$wIpOX*gRz1*3ZO3Ew-lN6TTU&u^P;ybp0 z&14iq?kC|?3;?v#(=jQphP1|7z-&tCdlf-dr7@0!-EjTh}i%1azIA zjujWcX4tpb11K~E^0=pqnv=0cT`4pRxG)(n%oVV^xc}Vi02d}zsxSJ3EUlpGZzHUQ zd4Ns1OBdq|7-^_%_5ce3K-KA)R6h@3rS$;Y>Mdp?4`8a0DMbk6VbT>aU9ps>TJ_!w z*fuT+`|0f~?Iwq=W{|5zo8Drs8jy!cSHP$Nr747L8<&*(T6TI_jaFX$@LmerHZFy3~RF3D25;jkNU^1SBRr>xwQQP9ShY_x=v90l`qH21WD#D><>LeE?uHhhG3lUe8)U zp3cq2AlETo0ib<=Vlm;BHr2%j*M<8U?-zh{IusY1L>LT%AULKM9()-vBYx2bruN%= zB`Bw&c^j(}Jo$Q^=}d5L0QhFsc0O8PQ~*SmtV{rU)d16v&GUWb0i?V19s+r<%FdH@ zd2WXIQm!(+15lJ9zJ8|yz>5fa_``%RMqTHz{i8-^7I6L1MI2uNu!yYrTyy0CKG9sn hxhfA>MAm$+`9G;7oqevt{>A_R002ovPDHLkV1h*CNLl~@ literal 0 HcmV?d00001 diff --git a/app/src/main/resources/base/media/startIcon.png b/app/src/main/resources/base/media/startIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..366f76459ffd4494ec40d0ddd5c59385b9c5da11 GIT binary patch literal 4351 zcmaJ_c{r5o`$trELZWDz?8}%L>x?yK$i9!UFJmyqEM`W=l13t1vK18?bc9Hft+FQB zvZWA7vQ{XHEY)wEb2{JOAK&wRuj_rE=e@7{{@mN=ey`_xlk9BF_<1CG*x1mL!?jn!jg+b4^2 zLetRJR&Wf70P@|_0nrI$mNgrjo*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K<1Cfa7|^0|X~xVk%&sS|#S{KfJOYz6q-M!qY` z+)WxSIX`42MlEplojlQ(T-~1aE_pNU{4ehSi;BW;sp3%}QP*w5=OZ?p5P6WzS9UBS zLw3VaH{Ver>WU!p>e$Dfp=R~3M;KpUa#$W(IdsNmcPWm z_WG8J;=@yp#wSmMn7L2BviDw*M{1)B22X2qtW^%WMG)-nih2&F5AJv1RhWO!8_#RE zz0;<|v$SO=GGgk+z6FHKOl`pDtTPrPD%UkKINz9I5%@BW$;A8;Bn;ibJPu&O~sBZFQewfjqZ8of% znY3?5KcI8|c%rA96`;H$S8>M{G2rp&``kF_`$@W znJEtXUEg`=h&$@gYgOjNQzv=Uk}&Ls(m6u%F4L`YyePS3oL4jqq0<~BnXmrUq_SE|?M~j!BdLw~HoaTstBb7=HK+WcPWE@_ cIQZCt9|&h0`tm_w@0Wx*(gtzY*ysHJ0mylrOaK4? literal 0 HcmV?d00001 diff --git a/app/src/main/resources/base/profile/main_pages.json b/app/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000..1898d94 --- /dev/null +++ b/app/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/Index" + ] +} diff --git a/app/src/main/resources/en_US/element/string.json b/app/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000..f945955 --- /dev/null +++ b/app/src/main/resources/en_US/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "label" + } + ] +} \ No newline at end of file diff --git a/app/src/main/resources/zh_CN/element/string.json b/app/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000..597ecf9 --- /dev/null +++ b/app/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "模块描述" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "label" + } + ] +} \ No newline at end of file diff --git a/app/src/mock/mock-config.json5 b/app/src/mock/mock-config.json5 new file mode 100644 index 0000000..7a73a41 --- /dev/null +++ b/app/src/mock/mock-config.json5 @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/app/src/ohosTest/ets/test/Ability.test.ets b/app/src/ohosTest/ets/test/Ability.test.ets new file mode 100644 index 0000000..85c78f6 --- /dev/null +++ b/app/src/ohosTest/ets/test/Ability.test.ets @@ -0,0 +1,35 @@ +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; + +export default function abilityTest() { + describe('ActsAbilityTest', () => { + // Defines a test suite. Two parameters are supported: test suite name and test suite function. + beforeAll(() => { + // Presets an action, which is performed only once before all test cases of the test suite start. + // This API supports only one parameter: preset action function. + }) + beforeEach(() => { + // Presets an action, which is performed before each unit test case starts. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: preset action function. + }) + afterEach(() => { + // Presets a clear action, which is performed after each unit test case ends. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: clear action function. + }) + afterAll(() => { + // Presets a clear action, which is performed after all test cases of the test suite end. + // This API supports only one parameter: clear action function. + }) + it('assertContain', 0, () => { + // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. + hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); + let a = 'abc'; + let b = 'b'; + // Defines a variety of assertion methods, which are used to declare expected boolean conditions. + expect(a).assertContain(b); + expect(a).assertEqual(a); + }) + }) +} \ No newline at end of file diff --git a/app/src/ohosTest/ets/test/List.test.ets b/app/src/ohosTest/ets/test/List.test.ets new file mode 100644 index 0000000..794c7dc --- /dev/null +++ b/app/src/ohosTest/ets/test/List.test.ets @@ -0,0 +1,5 @@ +import abilityTest from './Ability.test'; + +export default function testsuite() { + abilityTest(); +} \ No newline at end of file diff --git a/app/src/ohosTest/ets/testability/TestAbility.ets b/app/src/ohosTest/ets/testability/TestAbility.ets new file mode 100644 index 0000000..3682558 --- /dev/null +++ b/app/src/ohosTest/ets/testability/TestAbility.ets @@ -0,0 +1,48 @@ +import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; +import { abilityDelegatorRegistry } from '@kit.TestKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { window } from '@kit.ArkUI'; +import { Hypium } from '@ohos/hypium'; +import testsuite from '../test/List.test'; + +export default class TestAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam) { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? ''); + let abilityDelegator: abilityDelegatorRegistry.AbilityDelegator; + abilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); + let abilityDelegatorArguments: abilityDelegatorRegistry.AbilityDelegatorArgs; + abilityDelegatorArguments = abilityDelegatorRegistry.getArguments(); + hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite); + } + + onDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage) { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); + windowStage.loadContent('testability/pages/Index', (err, data) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', + JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); + } + + onForeground() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); + } + + onBackground() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); + } +} \ No newline at end of file diff --git a/app/src/ohosTest/ets/testability/pages/Index.ets b/app/src/ohosTest/ets/testability/pages/Index.ets new file mode 100644 index 0000000..423b427 --- /dev/null +++ b/app/src/ohosTest/ets/testability/pages/Index.ets @@ -0,0 +1,17 @@ +@Entry +@Component +struct Index { + @State message: string = 'Hello World'; + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/app/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ets b/app/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ets new file mode 100644 index 0000000..0eb230c --- /dev/null +++ b/app/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ets @@ -0,0 +1,90 @@ +import { abilityDelegatorRegistry, TestRunner } from '@kit.TestKit'; +import { UIAbility, Want } from '@kit.AbilityKit'; +import { BusinessError } from '@kit.BasicServicesKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { resourceManager } from '@kit.LocalizationKit'; +import { util } from '@kit.ArkTS'; + +let abilityDelegator: abilityDelegatorRegistry.AbilityDelegator; +let abilityDelegatorArguments: abilityDelegatorRegistry.AbilityDelegatorArgs; +let jsonPath: string = 'mock/mock-config.json'; +let tag: string = 'testTag'; + +async function onAbilityCreateCallback(data: UIAbility) { + hilog.info(0x0000, 'testTag', 'onAbilityCreateCallback, data: ${}', JSON.stringify(data)); +} + +async function addAbilityMonitorCallback(err: BusinessError) { + hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); +} + +export default class OpenHarmonyTestRunner implements TestRunner { + constructor() { + } + + onPrepare() { + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare'); + } + + async onRun() { + let tag = 'testTag'; + hilog.info(0x0000, tag, '%{public}s', 'OpenHarmonyTestRunner onRun run'); + abilityDelegatorArguments = abilityDelegatorRegistry.getArguments() + abilityDelegator = abilityDelegatorRegistry.getAbilityDelegator() + let moduleName = abilityDelegatorArguments.parameters['-m']; + let context = abilityDelegator.getAppContext().getApplicationContext().createModuleContext(moduleName); + let mResourceManager = context.resourceManager; + await checkMock(abilityDelegator, mResourceManager); + const bundleName = abilityDelegatorArguments.bundleName; + const testAbilityName: string = 'TestAbility'; + let lMonitor: abilityDelegatorRegistry.AbilityMonitor = { + abilityName: testAbilityName, + onAbilityCreate: onAbilityCreateCallback, + moduleName: moduleName + }; + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) + const want: Want = { + bundleName: bundleName, + abilityName: testAbilityName, + moduleName: moduleName + }; + abilityDelegator.startAbility(want, (err: BusinessError, data: void) => { + hilog.info(0x0000, tag, 'startAbility : err : %{public}s', JSON.stringify(err) ?? ''); + hilog.info(0x0000, tag, 'startAbility : data : %{public}s', JSON.stringify(data) ?? ''); + }) + hilog.info(0x0000, tag, '%{public}s', 'OpenHarmonyTestRunner onRun end'); + } +} + +async function checkMock(abilityDelegator: abilityDelegatorRegistry.AbilityDelegator, resourceManager: resourceManager.ResourceManager) { + let rawFile: Uint8Array; + try { + rawFile = resourceManager.getRawFileContentSync(jsonPath); + hilog.info(0x0000, tag, 'MockList file exists'); + let mockStr: string = util.TextDecoder.create("utf-8", { ignoreBOM: true }).decodeWithStream(rawFile); + let mockMap: Record = getMockList(mockStr); + try { + abilityDelegator.setMockList(mockMap) + } catch (error) { + let code = (error as BusinessError).code; + let message = (error as BusinessError).message; + hilog.error(0x0000, tag, `abilityDelegator.setMockList failed, error code: ${code}, message: ${message}.`); + } + } catch (error) { + let code = (error as BusinessError).code; + let message = (error as BusinessError).message; + hilog.error(0x0000, tag, `ResourceManager:callback getRawFileContent failed, error code: ${code}, message: ${message}.`); + } +} + +function getMockList(jsonStr: string) { + let jsonObj: Record = JSON.parse(jsonStr); + let map: Map = new Map(Object.entries(jsonObj)); + let mockList: Record = {}; + map.forEach((value: object, key: string) => { + let realValue: string = value['source'].toString(); + mockList[key] = realValue; + }); + hilog.info(0x0000, tag, '%{public}s', 'mock-json value:' + JSON.stringify(mockList) ?? ''); + return mockList; +} \ No newline at end of file diff --git a/app/src/ohosTest/module.json5 b/app/src/ohosTest/module.json5 new file mode 100644 index 0000000..0b5dfb0 --- /dev/null +++ b/app/src/ohosTest/module.json5 @@ -0,0 +1,38 @@ +{ + "module": { + "name": "app_test", + "type": "feature", + "description": "$string:module_test_desc", + "mainElement": "TestAbility", + "deviceTypes": [ + "phone", + "tablet", + "2in1" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:test_pages", + "abilities": [ + { + "name": "TestAbility", + "srcEntry": "./ets/testability/TestAbility.ets", + "description": "$string:TestAbility_desc", + "icon": "$media:icon", + "label": "$string:TestAbility_label", + "exported": true, + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/app/src/ohosTest/resources/base/element/color.json b/app/src/ohosTest/resources/base/element/color.json new file mode 100644 index 0000000..3c71296 --- /dev/null +++ b/app/src/ohosTest/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] +} \ No newline at end of file diff --git a/app/src/ohosTest/resources/base/element/string.json b/app/src/ohosTest/resources/base/element/string.json new file mode 100644 index 0000000..65d8fa5 --- /dev/null +++ b/app/src/ohosTest/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_test_desc", + "value": "test ability description" + }, + { + "name": "TestAbility_desc", + "value": "the test ability" + }, + { + "name": "TestAbility_label", + "value": "test label" + } + ] +} \ No newline at end of file diff --git a/app/src/ohosTest/resources/base/media/icon.png b/app/src/ohosTest/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..cd45accb1dfd2fd0da16c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XF zPtSes*_JwI+^d>xW489MJw5R6=t5?{R zc|E8i?RL@p9)A3ZJAQOg`}+F;<_vnWA!KxR#g%jZ@y_1Qu#Uw)kFPw_xmZ?a^e*1{ zM|ImtqA|(CaDQ@Fyvcof`MN66&VI6m6gAyAXx`%cDx6BI{Bj#}V*Rn1(b~;Am)D2u zX7(027IO?Z2VYK^1vXXpoZ@AtH~N?0rYWwtyA15`6vEf6fk&;o-L;7zFt`5nk*iOy z`<918zB+k;EytI$FAXug)jk*e@e};4e9g__w4A5ev!!)H$yC@{?vsRqJ##X1R%xPG z&_R3oDi$MtTkVqfPj)HEUDx_7wd!y{8#1%$U*Dd0sK@=#6+!XlsE-s^1f5E`R9Wo71^b~mbVdU;Fw0LG~mUQg;xsX4QYRo3B@rH_=ry>DE8ef!c2ta8UcI#26# zF|`*4wtMHe@%#eGZw`#Yj|QWuB`eRD)b~)r9mM95p_JVG%-IdcbIX5qG#GpGD+IrS zEqxb1Rg&Dadk5#7t4j68I1f!@A$efp1?I%&d*56)yl!tkz!14<$0Od_&6cGw$WW0r zjSlQA7l*6;vgfhv!cR|RmAD$+w6j`rVf=-?-D@q>kOseUVSb*~jbAS^*1h?ZL)n(9 zDa}`4etXO6`}9;{k5E^N{rcfnV_(LPwsDg``wtyS*V<19c3!PGJ3Kqy9ksvkwbJ%Z z*N(fT0{e*Wji-Ck5!3YE0j|PZ@&z`v=kitWL$bqSt!e4bH!+(|Q)CZ30^nVPfkx{s zX{6of`p=BiPb@u@IyL!tRk>?qgBqCmo-Zlt!636g?z`s~zdfwuB7DXZHvV`Usp+%Z zo*&;Biu@MHE&2j+?j^o`Cr12u<>vOe=a&8a2hlcmFjJiDR>XnD4c4DAhZWCkiAgW{ E51q9-lK=n! literal 0 HcmV?d00001 diff --git a/app/src/ohosTest/resources/base/profile/test_pages.json b/app/src/ohosTest/resources/base/profile/test_pages.json new file mode 100644 index 0000000..b7e7343 --- /dev/null +++ b/app/src/ohosTest/resources/base/profile/test_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "testability/pages/Index" + ] +} diff --git a/app/src/test/List.test.ets b/app/src/test/List.test.ets new file mode 100644 index 0000000..bb5b5c3 --- /dev/null +++ b/app/src/test/List.test.ets @@ -0,0 +1,5 @@ +import localUnitTest from './LocalUnit.test'; + +export default function testsuite() { + localUnitTest(); +} \ No newline at end of file diff --git a/app/src/test/LocalUnit.test.ets b/app/src/test/LocalUnit.test.ets new file mode 100644 index 0000000..ed22d4d --- /dev/null +++ b/app/src/test/LocalUnit.test.ets @@ -0,0 +1,33 @@ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; + +export default function localUnitTest() { + describe('localUnitTest',() => { + // Defines a test suite. Two parameters are supported: test suite name and test suite function. + beforeAll(() => { + // Presets an action, which is performed only once before all test cases of the test suite start. + // This API supports only one parameter: preset action function. + }); + beforeEach(() => { + // Presets an action, which is performed before each unit test case starts. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: preset action function. + }); + afterEach(() => { + // Presets a clear action, which is performed after each unit test case ends. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: clear action function. + }); + afterAll(() => { + // Presets a clear action, which is performed after all test cases of the test suite end. + // This API supports only one parameter: clear action function. + }); + it('assertContain', 0, () => { + // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. + let a = 'abc'; + let b = 'b'; + // Defines a variety of assertion methods, which are used to declare expected boolean conditions. + expect(a).assertContain(b); + expect(a).assertEqual(a); + }); + }); +} \ No newline at end of file diff --git a/build-profile.json5 b/build-profile.json5 index 984e7c3..c2c3da1 100644 --- a/build-profile.json5 +++ b/build-profile.json5 @@ -21,8 +21,8 @@ }, "modules": [ { - "name": "entry", - "srcPath": "./entry", + "name": "app", + "srcPath": "./app", "targets": [ { "name": "default", diff --git a/entry/.gitignore b/entry/.gitignore deleted file mode 100644 index e2713a2..0000000 --- a/entry/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/entry/build-profile.json5 b/entry/build-profile.json5 deleted file mode 100644 index b695582..0000000 --- a/entry/build-profile.json5 +++ /dev/null @@ -1,28 +0,0 @@ -{ - "apiType": "stageMode", - "buildOption": { - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": true, - "files": [ - "./obfuscation-rules.txt" - ] - } - } - } - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest", - } - ] -} \ No newline at end of file diff --git a/entry/hvigorfile.ts b/entry/hvigorfile.ts deleted file mode 100644 index c6edcd9..0000000 --- a/entry/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { hapTasks } from '@ohos/hvigor-ohos-plugin'; - -export default { - system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ - plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ -} diff --git a/entry/obfuscation-rules.txt b/entry/obfuscation-rules.txt deleted file mode 100644 index 985b2ae..0000000 --- a/entry/obfuscation-rules.txt +++ /dev/null @@ -1,18 +0,0 @@ -# Define project specific obfuscation rules here. -# You can include the obfuscation configuration files in the current module's build-profile.json5. -# -# For more details, see -# https://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md - -# Obfuscation options: -# -disable-obfuscation: disable all obfuscations -# -enable-property-obfuscation: obfuscate the property names -# -enable-toplevel-obfuscation: obfuscate the names in the global scope -# -compact: remove unnecessary blank spaces and all line feeds -# -remove-log: remove all console.* statements -# -print-namecache: print the name cache that contains the mapping from the old names to new names -# -apply-namecache: reuse the given cache file - -# Keep options: -# -keep-property-name: specifies property names that you want to keep -# -keep-global-name: specifies names that you want to keep in the global scope \ No newline at end of file diff --git a/entry/oh-package-lock.json5 b/entry/oh-package-lock.json5 deleted file mode 100644 index 5363c7c..0000000 --- a/entry/oh-package-lock.json5 +++ /dev/null @@ -1,26 +0,0 @@ -{ - "meta": { - "stableOrder": false - }, - "lockfileVersion": 3, - "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", - "specifiers": { - "@szyx/sdk_ywx@../sdk_ywx": "@szyx/sdk_ywx@../sdk_ywx", - "@szyx/sdk_base@../basic": "@szyx/sdk_base@../basic" - }, - "packages": { - "@szyx/sdk_ywx@../sdk_ywx": { - "name": "@szyx/sdk_ywx", - "resolved": "../sdk_ywx", - "registryType": "local", - "dependencies": { - "@szyx/sdk_base": "file:../basic" - } - }, - "@szyx/sdk_base@../basic": { - "name": "@szyx/sdk_base", - "resolved": "../basic", - "registryType": "local" - } - } -} \ No newline at end of file diff --git a/entry/oh-package.json5 b/entry/oh-package.json5 deleted file mode 100644 index 7181753..0000000 --- a/entry/oh-package.json5 +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "entry", - "version": "1.0.0", - "description": "Please describe the basic information.", - "main": "", - "author": "", - "license": "", - "dependencies": { - "@szyx/sdk_ywx": "file:../sdk_ywx", -// "@szyx/sdk_ywx": "^1.0.4", - "@szyx/sdk_base": "file:../basic", -// "@szyx/sdk_base": "^1.0.2", -// "@yunkss/eftool": "^1.1.8" - }, - "devDependencies": {}, - "dynamicDependencies": {} -} \ No newline at end of file diff --git a/entry/patch.json b/entry/patch.json deleted file mode 100644 index 07c96fe..0000000 --- a/entry/patch.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "app": { - "bundleName": "com.xuqinmin.hw.demo", - "patchVersionCode": 2000109, - "versionCode": 1 - }, - "module": { - "name": "entry", - "type": "hotreload" - } -} \ No newline at end of file diff --git a/entry/src/main/ets/entryability/EntryAbility.ets b/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 64c7817..0000000 --- a/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,41 +0,0 @@ -import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; - -export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); - } - - onDestroy(): void { - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - // Main window is created, set main page for this ability - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/Index', (err, data) => { - if (err.code) { - hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); - return; - } - hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); - }); - } - - onWindowStageDestroy(): void { - // Main window is destroyed, release UI related resources - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); - } - - onForeground(): void { - // Ability has brought to foreground - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); - } - - onBackground(): void { - // Ability has back to background - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); - } -} diff --git a/entry/src/main/ets/pages/Home.ets b/entry/src/main/ets/pages/Home.ets deleted file mode 100644 index e69de29..0000000 diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets deleted file mode 100644 index a3ee1de..0000000 --- a/entry/src/main/ets/pages/Index.ets +++ /dev/null @@ -1,59 +0,0 @@ -import { CertHome } from './cert/CertHome' -import { SettingView } from './setting/SettingView' -import { RouterBuilder } from '../router/RouterBuilder' -import { BJCASDK } from '@szyx/sdk_ywx/Index' -import { SignHome } from './sign/SignHome' - -@Entry -@Component -struct Index { - @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack() - @State currentIndex: number = 0 - - @Builder - tabBuilder(title: string, targetIndex: number, selectedImg: Resource, normalImg: Resource) { - Column() { - Image(this.currentIndex === targetIndex ? selectedImg : normalImg) - .size({ width: 25, height: 25 }) - Text(title) - .fontColor(this.currentIndex === targetIndex ? '#d81e06' : '#8a8a8a') - } - .width('100%') - .height(50) - .justifyContent(FlexAlign.Center) - } - - aboutToAppear(): void { - BJCASDK.settingManager().init() - } - - build() { - Navigation(this.pageInfos) { - Tabs({ barPosition: BarPosition.End }) { - TabContent() { - CertHome() - } - .tabBar(this.tabBuilder('证书', 0, $r('app.media.icon_home_selected'), $r('app.media.icon_home_normal'))) - - TabContent() { - SignHome() - } - .tabBar(this.tabBuilder('签名', 1, $r('app.media.icon_sign_selected'), $r('app.media.icon_sign_normal'))) - - TabContent() { - Text('1.0.1版本上线').fontSize(30) - } - .tabBar(this.tabBuilder('二维码', 2, $r('app.media.icon_code_selected'), $r('app.media.icon_code_normal'))) - - TabContent() { - SettingView() - } - .tabBar(this.tabBuilder('设置', 3, $r('app.media.icon_setting_selected'), $r('app.media.icon_setting_Normal'))) - - }.scrollable(false).barMode(BarMode.Fixed).animationDuration(0) - .onChange((index: number) => { - this.currentIndex = index - }) - }.navDestination(RouterBuilder).hideTitleBar(true) - } -} \ No newline at end of file diff --git a/entry/src/main/ets/pages/PageOne.ets b/entry/src/main/ets/pages/PageOne.ets deleted file mode 100644 index b1d40a1..0000000 --- a/entry/src/main/ets/pages/PageOne.ets +++ /dev/null @@ -1,13 +0,0 @@ -// PageOne.ets -@Entry -@Component -export struct PageOneTmp { - build() { - Button('pushPathByName', { stateEffect: true, type: ButtonType.Capsule }) - .width('80%') - .height(40) - .margin(20) - .onClick(() => { - }) - } -} \ No newline at end of file diff --git a/entry/src/main/ets/pages/PageTwo.ets b/entry/src/main/ets/pages/PageTwo.ets deleted file mode 100644 index b248b2b..0000000 --- a/entry/src/main/ets/pages/PageTwo.ets +++ /dev/null @@ -1,24 +0,0 @@ -// PageTwo.ets -export class Pages { - names: string = "" - values: NavPathStack | null = null -} - -@Builder -export function pageTwoTmp(info: Pages) { - NavDestination() { - Column() { - Button('pushPathByName', { stateEffect: true, type: ButtonType.Capsule }) - .width('80%') - .height(40) - .margin(20) - .onClick(() => { - (info.values as NavPathStack).pushPathByName('pageOne', null) - }) - }.width('100%').height('100%') - }.title('pageTwo') - .onBackPressed(() => { - (info.values as NavPathStack).pop() - return true - }) -} \ No newline at end of file diff --git a/entry/src/main/ets/pages/cert/CertHome.ets b/entry/src/main/ets/pages/cert/CertHome.ets deleted file mode 100644 index 3207947..0000000 --- a/entry/src/main/ets/pages/cert/CertHome.ets +++ /dev/null @@ -1,199 +0,0 @@ -import promptAction from '@ohos.promptAction'; -import { HttpHelper, ToolsHelper } from '@szyx/sdk_base'; -import { BJCASDK } from '@szyx/sdk_ywx/Index'; -import { BJCACallMsg } from '@szyx/sdk_ywx/src/main/ets/public/callBack/BJCACallMsg'; - -@Component -@Preview -export struct CertHome { - @Consume('pageInfos') pageInfos: NavPathStack; - private oldTime = 0 - // 手机号 - @State phone: string = '15731028102' - @State draw: string | null = null - - build() { - NavDestination() { - Column() { - Text('证书下载完成后即可签名') - .margin({ top: 100 }) - Row({ space: FlexAlign.SpaceBetween }) { - TextInput({ - placeholder: '证书下载需要填写手机号', - text: $$this.phone, - }) - .width('70%') - .maxLength(11) - .fontSize(16) - .placeholderFont({ size: 16 }) - .type(InputType.PhoneNumber)/** - * 正则表达式,限制输入内容,而不是格式验证 - * 配置该参数后,上面的type会失效 - */ - .inputFilter('[-0-9]', error => { - ToolsHelper.showMessage(error) - }) - Button('证书下载', { stateEffect: true, type: ButtonType.Normal, buttonStyle: ButtonStyleMode.NORMAL }) - .width('30%') - .fontColor('#333333') - .height(40) - .onClick(() => { - BJCASDK.certManager().certDown(this.phone, undefined, (result) => { - ToolsHelper.showMessage(result.msg) - }) - }) - } - .width('100%') - .alignItems(VerticalAlign.Center) - .margin({ top: 50 }) - - Row() { - Button('查看证书页面', { stateEffect: true, type: ButtonType.Normal, buttonStyle: ButtonStyleMode.NORMAL }) - .width('40%') - .fontColor('#333333') - .height(40) - .onClick(() => { - if (BJCASDK.certManager().existsCert(this.phone)) { - BJCASDK.certManager().showCertPage(this.phone, (result) => { - ToolsHelper.showMessage(result.msg) - }) - } else { - ToolsHelper.showMessage("证书不存在,请先下证。") - } - }) - Button('查看用户信息', { stateEffect: true, type: ButtonType.Normal, buttonStyle: ButtonStyleMode.NORMAL }) - .width('40%') - .height(40) - .fontColor('#333333') - .onClick(() => { - if (BJCASDK.certManager().existsCert(this.phone)) { - BJCASDK.certManager().getUserInfo(this.phone, res => { - ToolsHelper.showMessage(JSON.stringify(res)) - }) - } else { - ToolsHelper.showMessage("证书不存在,请先下证。") - } - }) - - }.margin({ top: 20 }) - .width('100%') - .justifyContent(FlexAlign.SpaceAround) - - Grid() { - GridItem() { - Button('密码重置', { stateEffect: true, type: ButtonType.Normal, buttonStyle: ButtonStyleMode.NORMAL }) - .height(40) - .fontColor('#333333') - .width('100%') - .onClick(() => { - BJCASDK.certManager().certResetPin(undefined, res => { - if (res !== BJCACallMsg.SUCCESS) { - ToolsHelper.showMessage(JSON.stringify(res)) - } - }) - }) - } - - GridItem() { - Button('证书更新', { stateEffect: true, type: ButtonType.Normal, buttonStyle: ButtonStyleMode.NORMAL }) - .height(40) - .fontColor('#333333') - .width('100%') - .onClick(() => { - BJCASDK.certManager().certUpdate(this.phone, undefined, res => { - if (res !== BJCACallMsg.SUCCESS) { - ToolsHelper.showMessage(JSON.stringify(res)) - } - }) - }) - } - - GridItem() { - Button('存在本地证书', { stateEffect: true, type: ButtonType.Normal, buttonStyle: ButtonStyleMode.NORMAL }) - .height(40) - .fontColor('#333333') - .width('100%') - .onClick(() => { - ToolsHelper.showMessage(BJCASDK.certManager().existsCert(this.phone) ? "证书存在" : "证书不存在") - }) - } - - GridItem() { - Button('清除本地证书', { stateEffect: true, type: ButtonType.Normal, buttonStyle: ButtonStyleMode.NORMAL }) - .height(40) - .fontColor('#333333') - .width('100%') - .onClick(() => { - BJCASDK.certManager().certClear() - }) - } - } - .margin({ top: 20 }) - .width('100%') - .columnsGap(10) - .height(100) - .rowsTemplate('1fr 1fr') - .columnsTemplate('1fr 1fr') - - - Text('用户可以修改个人的手写签名图片') - .margin({ top: 20 }) - - Row() { - Button('查看个人签章图片', { - stateEffect: true, - type: ButtonType.Normal, - buttonStyle: ButtonStyleMode.NORMAL - }) - .width('40%') - .fontColor('#333333') - .height(40) - .onClick(() => { - BJCASDK.certManager().drawStamp(this.phone, res => { - if (res.code === BJCACallMsg.SUCCESS.code && res.data) { - this.draw = res.data - } else { - ToolsHelper.showMessage("未设置签名图片") - } - }) - }) - Button('修改个人签章图片', { - stateEffect: true, - type: ButtonType.Normal, - buttonStyle: ButtonStyleMode.NORMAL - }) - .width('40%') - .height(40) - .fontColor('#333333') - .onClick(() => { - ToolsHelper.showMessage('hello world1') - }) - - }.margin({ top: 10 }) - .width('100%') - .justifyContent(FlexAlign.SpaceAround) - - Image(`data:image/png;base64,${this.draw}`) - .width(300) - .height(200) - .margin({ top: 15 }) - .objectFit(ImageFit.Contain) - .visibility(this.draw ? Visibility.Visible : Visibility.None) - - } - }.padding({ left: 15, right: 15 }).hideTitleBar(true) - .onBackPressed(() => { - const currentTime = new Date().getTime() - - if (currentTime - this.oldTime > 1500) { - promptAction.showToast({ - message: '双击退出', - duration: 2000 - }); - this.oldTime = currentTime - return false - } - return true - }) - } -} \ No newline at end of file diff --git a/entry/src/main/ets/pages/evn/ChangeEvnView.ets b/entry/src/main/ets/pages/evn/ChangeEvnView.ets deleted file mode 100644 index 73866c8..0000000 --- a/entry/src/main/ets/pages/evn/ChangeEvnView.ets +++ /dev/null @@ -1,142 +0,0 @@ -import { ToolsHelper } from '@szyx/sdk_base/Index'; -import { BJCASDK, EnvEnum } from '@szyx/sdk_ywx'; -import { AlertDialog } from '@ohos.arkui.advanced.Dialog'; - -@Component -@Preview -export struct ChangeEvnView { - @Consume('pageInfos') pageInfos: NavPathStack - // 环境信息 - @State envType: EnvEnum = BJCASDK.settingManager().getServerEnvType() - // 环境地址 - @State envUrl: String = BJCASDK.settingManager().getServerEnvUrl() - // 是否清理证书 - @State clean: boolean = true - // 切换确认 - dialogControllerConfirm: CustomDialogController = new CustomDialogController({ - builder: AlertDialog({ - content: '确定需要切换环境吗?', - primaryButton: { - value: '取消', - action: () => { - }, - }, - secondaryButton: { - value: '确认', - fontColor: $r('sys.color.ohos_id_color_warning'), - action: () => { - BJCASDK.settingManager().setServerEnvType(this.envType) - this.pageInfos.pop() - } - }, - }), - autoCancel: true, - customStyle: true, - alignment: DialogAlignment.Center - }) - - build() { - NavDestination() { - Column() { - Row() { - Text(`当前环境地址:${this.envType}\n${this.envUrl}`).margin({ left: 5 }) - }.width('100%') - - Row() { - Radio({ value: 'Radio1', group: 'evnGroup' }) - .height(20) - .width(20) - .onChange((isChecked: boolean) => { - if (isChecked) { - this.envType = EnvEnum.DEV - this.envUrl = BJCASDK.settingManager().getUrlByEnvType(EnvEnum.DEV) - } - }).checked(this.envType == EnvEnum.DEV) - Text('开发环境').margin({ left: 5 }).onClick(() => { - this.envType = EnvEnum.DEV - this.envUrl = BJCASDK.settingManager().getUrlByEnvType(EnvEnum.DEV) - }) - }.width('100%').margin({ top: 15 }) - - Row() { - Radio({ value: 'Radio2', group: 'evnGroup' }) - .height(20) - .width(20) - .onChange((isChecked: boolean) => { - if (isChecked) { - this.envType = EnvEnum.TEST - this.envUrl = BJCASDK.settingManager().getUrlByEnvType(EnvEnum.TEST) - } - }).checked(this.envType == EnvEnum.TEST) - Text('测试环境').margin({ left: 5 }).onClick(() => { - this.envType = EnvEnum.TEST - this.envUrl = BJCASDK.settingManager().getUrlByEnvType(EnvEnum.TEST) - }) - }.width('100%').margin({ top: 5 }) - - Row() { - Radio({ value: 'Radio3', group: 'evnGroup' }) - .height(20) - .width(20) - .onChange((isChecked: boolean) => { - if (isChecked) { - this.envType = EnvEnum.INTEGRATE - this.envUrl = BJCASDK.settingManager().getUrlByEnvType(EnvEnum.INTEGRATE) - } - }).checked(this.envType == EnvEnum.INTEGRATE) - Text('集成环境').margin({ left: 5 }).onClick(() => { - this.envType = EnvEnum.INTEGRATE - this.envUrl = BJCASDK.settingManager().getUrlByEnvType(EnvEnum.INTEGRATE) - }) - }.width('100%').margin({ top: 5 }) - - Row() { - Radio({ value: 'Radio3', group: 'evnGroup' }) - .height(20) - .width(20) - .onChange((isChecked: boolean) => { - if (isChecked) { - this.envType = EnvEnum.PUBLIC - this.envUrl = BJCASDK.settingManager().getUrlByEnvType(EnvEnum.PUBLIC) - } - }).checked(this.envType == EnvEnum.PUBLIC) - Text('运营环境').margin({ left: 5 }).onClick(() => { - this.envType = EnvEnum.PUBLIC - this.envUrl = BJCASDK.settingManager().getUrlByEnvType(EnvEnum.PUBLIC) - }) - }.width('100%').margin({ top: 5 }) - - Row() { - Toggle({ type: ToggleType.Checkbox, isOn: this.clean }) - - Text('清空本地数据').margin({ left: 5 }) - }.width('100%').margin({ top: 10 }) - - Row() { - Button('取消', { type: ButtonType.Normal, stateEffect: true }) - .borderRadius(8) - .backgroundColor(0x317aff) - .width(90) - .height(40) - .onClick(() => { - this.pageInfos.pop() - }) - Button('确定', { type: ButtonType.Normal, stateEffect: true }) - .borderRadius(8) - .backgroundColor(0x317aff) - .width(90) - .height(40) - .onClick(() => { - if (BJCASDK.settingManager().getServerEnvType() == this.envType) { - ToolsHelper.showMessage('环境没有变更!') - return - } - this.dialogControllerConfirm.open() - - }) - }.width('100%').margin({ top: 20 }).justifyContent(FlexAlign.SpaceAround) - - }.width('100%').height('100%').padding(20) - }.title('切换sdk环境') - } -} \ No newline at end of file diff --git a/entry/src/main/ets/pages/setting/SettingView.ets b/entry/src/main/ets/pages/setting/SettingView.ets deleted file mode 100644 index 8dd5744..0000000 --- a/entry/src/main/ets/pages/setting/SettingView.ets +++ /dev/null @@ -1,89 +0,0 @@ -import { ToolsHelper } from '@szyx/sdk_base'; -import { BJCASDK } from '@szyx/sdk_ywx'; - -@Component -@Preview -export struct SettingView { - @Consume('pageInfos') pageInfos: NavPathStack - // 环境地址 - @State clientId: string | undefined = BJCASDK.settingManager().getClientId() - @State clientIdEdit: string | undefined = '2015112716143758' - - - build() { - NavDestination() { - Column() { - Row() { - Text(`当前厂商ID:${this.clientId}`).margin({ left: 5 }) - }.width('100%') - - Row({ space: FlexAlign.SpaceBetween }) { - TextInput({ - placeholder: '输入厂商ID', - text: $$this.clientIdEdit, - }) - .width('70%') - .fontSize(16) - .placeholderFont({ size: 16 }) - .type(InputType.PhoneNumber) - Button('确认', { stateEffect: true, type: ButtonType.Normal, buttonStyle: ButtonStyleMode.NORMAL }) - .width('30%') - .fontColor('#333333') - .height(40) - .onClick(() => { - if (!this.clientIdEdit) { - ToolsHelper.showMessage('请输入厂商ID') - return - } - BJCASDK.settingManager().setClientId(this.clientIdEdit) - this.clientId = BJCASDK.settingManager().getClientId() - }) - } - .width('80%') - .alignItems(VerticalAlign.Center) - .margin({ top: 10 }) - - Button('获取当前版本号', { stateEffect: true, type: ButtonType.Normal, buttonStyle: ButtonStyleMode.NORMAL }) - .width('80%') - .fontColor('#333333') - .height(40) - .onClick(() => { - ToolsHelper.showMessage(BJCASDK.settingManager().getVersion()) - }) - .margin({ top: 60 }) - Button('切换环境', { stateEffect: true, type: ButtonType.Normal, buttonStyle: ButtonStyleMode.NORMAL }) - .width('80%') - .fontColor('#333333') - .height(40) - .onClick(() => { - this.pageInfos.pushPathByName('ChangeEvnView', undefined) - }) - .margin({ top: 10 }) - Button('设置语言-中文', { stateEffect: true, type: ButtonType.Normal, buttonStyle: ButtonStyleMode.NORMAL }) - .width('80%') - .fontColor('#333333') - .height(40) - .onClick(() => { - ToolsHelper.showMessage('hello world1') - }) - .margin({ top: 30 }) - Button('设置语言-英文', { stateEffect: true, type: ButtonType.Normal, buttonStyle: ButtonStyleMode.NORMAL }) - .width('80%') - .fontColor('#333333') - .height(40) - .onClick(() => { - ToolsHelper.showMessage('hello world1') - }) - .margin({ top: 10 }) - Button('显示pin码输入框', { stateEffect: true, type: ButtonType.Normal, buttonStyle: ButtonStyleMode.NORMAL }) - .width('80%') - .fontColor('#333333') - .height(40) - .onClick(() => { - ToolsHelper.showMessage('hello world1') - }) - .margin({ top: 10 }) - } - }.padding({ left: 15, right: 15, top: 100 }).hideTitleBar(true) - } -} \ No newline at end of file diff --git a/entry/src/main/ets/pages/sign/Sign.ets b/entry/src/main/ets/pages/sign/Sign.ets deleted file mode 100644 index ac2d307..0000000 --- a/entry/src/main/ets/pages/sign/Sign.ets +++ /dev/null @@ -1,213 +0,0 @@ -import { HttpHelper, ToolsHelper } from '@szyx/sdk_base/Index' -import { BJCASDK, PinDialog } from '@szyx/sdk_ywx/Index' -import { SynedModel } from './SynedModel' - -@Component -@Preview -export struct Sign { - @Consume('pageInfos') pageInfos: NavPathStack - @State mDoctorId: string | null = '130427199604025922' - @State mNum: string = '1' - @State mListUniqueId: string[] = [] - @State mSynedNum: number = 0 - @State uniqueId: string | null = null - @State needSignNow: boolean = false - - private signRequest() { - this.needSignNow = false - BJCASDK.signManager().signWithFirmId(this.mListUniqueId, (res) => { - ToolsHelper.showMessage(JSON.stringify(res)) - }) - } - - private shouldSynAgain() { - this.mSynedNum += 1 - if (this.mSynedNum < Number.parseInt(this.mNum)) { - this.synUnSignData() - } else { - ToolsHelper.showMessage('处方同步完成') - if (this.needSignNow) { - this.signRequest() - } - } - } - - private synUnSignData() { - HttpHelper.get() - .get(BJCASDK.settingManager() - .getServerEnvUrl() + `AppOAuthDemo/synSdkRecipeInfoForBatch?clientId=${BJCASDK.settingManager() - .getClientId()!}&doctorId=${this.mDoctorId}`, undefined) - .then(res => { - console.log('---->', JSON.stringify(res)) - if (res.status === '0') { - this.mListUniqueId.push(res.data.uniqueId) - } - this.shouldSynAgain() - }).catch(() => { - ToolsHelper.showMessage(`同步第 ${this.mSynedNum + 1} 条处方失败!`) - this.shouldSynAgain() - }) - } - - build() { - NavDestination() { - Column() { - Text('第一步,模拟应用厂商将多条待签数据同步到医网信获取待签名数据的唯一标识uniqueId。') - .margin({ top: 20 }) - .fontSize(16) - .fontColor('#666666') - Row() { - Text('医师证号:') - .fontSize(16) - .fontColor('#666666') - TextInput({ - placeholder: '请输入医师证号', - text: $$this.mDoctorId, - }) - .margin({ left: 5 }) - .layoutWeight(1) - }.alignItems(VerticalAlign.Center) - .margin({ top: 10 }) - .width('100%') - - Row() { - Button('1.批量获取待签数据:', { - stateEffect: true, - type: ButtonType.Normal, - buttonStyle: ButtonStyleMode.NORMAL - }) - .fontSize(16) - .fontColor('#666666') - .enabled(this.mSynedNum === 0 || this.mSynedNum === this.mListUniqueId.length) - .onClick(() => { - if (!this.mDoctorId) { - ToolsHelper.showMessage('医师证号不能为空') - return - } - if (!this.mNum || Number.parseInt(this.mNum) < 1 || Number.parseInt(this.mNum) > 100) { - ToolsHelper.showMessage('需要批量签名数量不能小于1,不能大于100') - return - } - this.mListUniqueId = [] - this.mSynedNum = 0 - this.needSignNow = false - this.synUnSignData() - }) - TextInput({ - text: $$this.mNum, - }) - .enabled(this.mSynedNum === 0 || this.mSynedNum === this.mListUniqueId.length) - .margin({ left: 5 }) - .width(60) - .maxLength(3) - .type(InputType.Number) - Text('条') - .fontSize(16) - .fontColor('#666666') - .textAlign(TextAlign.Center) - .margin({ left: 3 }) - }.alignItems(VerticalAlign.Center) - .width('100%') - .margin({ top: 10 }) - - Text(`已同步 ${this.mListUniqueId.length}/${this.mNum} 条待签数据`) - .fontSize(14) - .fontColor('#666666') - .textAlign(TextAlign.Center) - .width('100%') - .margin({ top: 10 }) - Text(`当前待签名数据总量为: ${this.mListUniqueId.length}`) - .fontSize(14) - .fontColor('#666666') - .textAlign(TextAlign.Center) - .width('100%') - .margin({ top: 5 }) - Text('第二步,调用医网信接口进行签名,参数为厂商标识(clientId)和医网信待签数据唯一标识(uniqueId)的List列表(不大于100条)') - .margin({ top: 30 }) - .fontSize(16) - .fontColor('#666666') - Button(this.mSynedNum >= Number.parseInt(this.mNum) ? '2.签名' : '请耐心等待批量同步待签数据', { - stateEffect: true, - type: ButtonType.Normal, - buttonStyle: ButtonStyleMode.NORMAL, - }) - .enabled(this.mSynedNum >= Number.parseInt(this.mNum)) - .fontSize(16) - .width('100%') - .fontColor('#666666') - .margin({ top: 10 }) - .onClick(() => { - this.signRequest() - }) - Button(this.mSynedNum === 0 ? '立即签名(同步后立即签名)' : '正在同步处方数据', { - stateEffect: true, - type: ButtonType.Normal, - buttonStyle: ButtonStyleMode.NORMAL - }) - .fontSize(16) - .width('100%') - .fontColor('#666666') - .margin({ top: 10 }) - .enabled(this.mSynedNum === 0) - .onClick(() => { - if (!this.mDoctorId) { - ToolsHelper.showMessage('医师证号不能为空') - return - } - if (!this.mNum || Number.parseInt(this.mNum) < 1) { - ToolsHelper.showMessage('需要批量签名数量不能小于1,不能大于100') - return - } - this.mListUniqueId = [] - this.mSynedNum = 0 - this.needSignNow = true - this.synUnSignData() - }) - Row() { - TextInput({ - text: $$this.uniqueId, - placeholder: '请输入待签uniqueId' - }) - .margin({ left: 5 }) - .width(180) - .type(InputType.NUMBER_DECIMAL) - Button('添加uniqueId', { - stateEffect: true, - type: ButtonType.Normal, - buttonStyle: ButtonStyleMode.NORMAL - }) - .fontSize(16) - .layoutWeight(1) - .margin({ left: 3 }) - .fontColor('#666666') - .onClick(() => { - if (this.uniqueId) { - this.mListUniqueId.push(this.uniqueId) - this.uniqueId = null - } - }) - }.alignItems(VerticalAlign.Center) - .width('100%') - .margin({ top: 40 }) - - Button('手动签名', { - stateEffect: true, - type: ButtonType.Normal, - buttonStyle: ButtonStyleMode.NORMAL - }) - .fontSize(16) - .width('100%') - .fontColor('#666666') - .margin({ top: 10 }) - .onClick(() => { - this.signRequest() - }) - - PinDialog({ - controller: BJCASDK.signManager().dialogController - }) - - }.width('100%').height('100%').padding(20) - }.title('医师sdk签名演示') - } -} \ No newline at end of file diff --git a/entry/src/main/ets/pages/sign/SignForAuto.ets b/entry/src/main/ets/pages/sign/SignForAuto.ets deleted file mode 100644 index 3379982..0000000 --- a/entry/src/main/ets/pages/sign/SignForAuto.ets +++ /dev/null @@ -1,81 +0,0 @@ -import { ToolsHelper } from '@szyx/sdk_base/Index' -import { BJCASDK, PinDialog } from '@szyx/sdk_ywx/Index' - -@Component -@Preview -export struct SignForAuto { - @State sysTag: string | null = null - - build() { - NavDestination() { - Column() { - - Row() { - Text('系统标识名称') - .fontSize(16) - .fontColor('#666666') - TextInput({ - text: $$this.sysTag, - placeholder: '开启自动签标识' - }) - .margin({ left: 5 }) - .width(160) - }.alignItems(VerticalAlign.Center) - .width('100%') - .margin({ top: 10 }) - - Row() { - Button('获取自动签信息', { - stateEffect: true, - type: ButtonType.Normal, - buttonStyle: ButtonStyleMode.NORMAL, - }) - .fontSize(16) - .fontColor('#666666') - .onClick(() => { - BJCASDK.signManager().getSignAutoInfo((res) => { - ToolsHelper.showMessage(JSON.stringify(res)) - }) - }) - Button('开启自动签名', { - stateEffect: true, - type: ButtonType.Normal, - buttonStyle: ButtonStyleMode.NORMAL, - }) - .fontSize(16) - .fontColor('#666666') - .margin({ left: 10 }) - .onClick(() => { - if (!this.sysTag) { - ToolsHelper.showMessage('请输入系统标识') - return - } - BJCASDK.signManager().signForSignAuto(this.sysTag, (res) => { - ToolsHelper.showMessage(JSON.stringify(res)) - }) - }) - }.alignItems(VerticalAlign.Center) - .width('100%') - .margin({ top: 15 }) - - Button('关闭自动签名', { - stateEffect: true, - type: ButtonType.Normal, - buttonStyle: ButtonStyleMode.NORMAL, - }) - .fontSize(16) - .fontColor('#666666') - .margin({ top: 10 }) - .onClick(() => { - BJCASDK.signManager().stopSignAuto(this.sysTag ?? undefined, (res) => { - ToolsHelper.showMessage(JSON.stringify(res)) - }) - }) - - PinDialog({ - controller: BJCASDK.signManager().dialogController - }) - }.width('100%').height('100%').padding(20) - }.title('医师sdk自动签名演示') - } -} \ No newline at end of file diff --git a/entry/src/main/ets/pages/sign/SignForPin.ets b/entry/src/main/ets/pages/sign/SignForPin.ets deleted file mode 100644 index 661e13a..0000000 --- a/entry/src/main/ets/pages/sign/SignForPin.ets +++ /dev/null @@ -1,129 +0,0 @@ -import { ToolsHelper } from '@szyx/sdk_base/Index' -import { BJCASDK, PinDialog } from '@szyx/sdk_ywx/Index' - -@Component -@Preview -export struct SignForPin { - @State mNum: string = '1' - - build() { - NavDestination() { - Column() { - Text('此页面的接口是为了让用户在签名过程中无需输入证书签名密码,如果不使用可以忽略。') - .margin({ top: 20 }) - .fontSize(16) - .fontColor('#666666') - Text('1.开启免密签名后,在开启时间内用户签名无需输入密码') - .margin({ top: 80 }) - .fontSize(16) - .fontColor('#666666') - - Row() { - Text('免密时间1-60天:') - .fontSize(16) - .fontColor('#666666') - TextInput({ - text: $$this.mNum, - placeholder: '天数' - }) - .margin({ left: 5 }) - .width(60) - .maxLength(3) - .type(InputType.Number) - - Button('开启免密', { - stateEffect: true, - type: ButtonType.Normal, - buttonStyle: ButtonStyleMode.NORMAL, - }) - .fontSize(16) - .margin({ left: 5 }) - .fontColor('#666666') - .onClick(() => { - BJCASDK.signManager().keepPin(Number.parseInt(this.mNum), (res) => { - ToolsHelper.showMessage(JSON.stringify(res)) - }) - }) - }.alignItems(VerticalAlign.Center) - .width('100%') - .margin({ top: 10 }) - - Row() { - - Button('判断免密状态', { - stateEffect: true, - type: ButtonType.Normal, - buttonStyle: ButtonStyleMode.NORMAL, - }) - .fontSize(16) - .fontColor('#666666') - .onClick(() => { - ToolsHelper.showMessage(BJCASDK.signManager().isPinExempt() ? '已开启' : '未开启') - }) - Button('取消免密', { - stateEffect: true, - type: ButtonType.Normal, - buttonStyle: ButtonStyleMode.NORMAL, - }) - .fontSize(16) - .fontColor('#666666') - .margin({ left: 10 }) - .onClick(() => { - BJCASDK.signManager().clearPin(() => { - ToolsHelper.showMessage('免密签名已关闭') - }) - }) - }.alignItems(VerticalAlign.Center) - .width('100%') - .margin({ top: 10 }) - - Text('---以下功能,1.0.1版本开始支持---') - .margin({ top: 80 }) - .fontSize(13) - .fontColor('#999999') - Text('2.开启指纹签名后,在开启状态内用户可以通过指纹验证来进行签名,当免密开启时无效') - .margin({ top: 10 }) - .fontSize(16) - .fontColor('#666666') - Row() { - Button('指纹签名状态', { - stateEffect: true, - type: ButtonType.Normal, - buttonStyle: ButtonStyleMode.NORMAL, - }) - .fontSize(16) - .fontColor('#666666') - .onClick(() => { - }) - Button('开启指纹签名', { - stateEffect: true, - type: ButtonType.Normal, - buttonStyle: ButtonStyleMode.NORMAL, - }) - .fontSize(16) - .fontColor('#666666') - .margin({ left: 10 }) - .onClick(() => { - }) - }.alignItems(VerticalAlign.Center) - .width('100%') - .margin({ top: 10 }) - - Button('关闭指纹签名', { - stateEffect: true, - type: ButtonType.Normal, - buttonStyle: ButtonStyleMode.NORMAL, - }) - .fontSize(16) - .fontColor('#666666') - .margin({ top: 5 }) - .onClick(() => { - }) - - PinDialog({ - controller: BJCASDK.signManager().dialogController - }) - }.width('100%').height('100%').padding(20) - }.title('医师sdk免密签名演示') - } -} \ No newline at end of file diff --git a/entry/src/main/ets/pages/sign/SignHome.ets b/entry/src/main/ets/pages/sign/SignHome.ets deleted file mode 100644 index 2d420c7..0000000 --- a/entry/src/main/ets/pages/sign/SignHome.ets +++ /dev/null @@ -1,69 +0,0 @@ -import promptAction from '@ohos.promptAction'; -import { ToolsHelper } from '@szyx/sdk_base/Index'; -import { BJCASDK } from '@szyx/sdk_ywx/Index'; - -@Component -@Preview -export struct SignHome { - @Consume('pageInfos') pageInfos: NavPathStack; - private oldTime = 0 - - build() { - NavDestination() { - Column() { - Button('签名', { stateEffect: true, type: ButtonType.Normal, buttonStyle: ButtonStyleMode.NORMAL }) - .width('40%') - .fontColor('#333333') - .height(40) - .onClick(() => { - if (BJCASDK.certManager().existsCert()) { - this.pageInfos.pushPathByName('Sign', undefined) - } else { - ToolsHelper.showMessage("证书不存在,请先下证。") - } - }) - Button('自动签', { stateEffect: true, type: ButtonType.Normal, buttonStyle: ButtonStyleMode.NORMAL }) - .width('40%') - .fontColor('#333333') - .height(40) - .margin({ top: 40 }) - .onClick(() => { - if (BJCASDK.certManager().existsCert()) { - this.pageInfos.pushPathByName('SignForAuto', undefined) - } else { - ToolsHelper.showMessage("证书不存在,请先下证。") - } - }) - Button('免密签名', { stateEffect: true, type: ButtonType.Normal, buttonStyle: ButtonStyleMode.NORMAL }) - .width('40%') - .fontColor('#333333') - .height(40) - .margin({ top: 40 }) - .onClick(() => { - if (BJCASDK.certManager().existsCert()) { - this.pageInfos.pushPathByName('SignForPin', undefined) - } else { - ToolsHelper.showMessage("证书不存在,请先下证。") - } - }) - } - .width('100%') - .height("100%") - .padding(20) - .backgroundColor("#ffffff") - }.padding({ left: 15, right: 15 }).hideTitleBar(true) - .onBackPressed(() => { - const currentTime = new Date().getTime() - - if (currentTime - this.oldTime > 1500) { - promptAction.showToast({ - message: '双击退出', - duration: 2000 - }); - this.oldTime = currentTime - return false - } - return true - }) - } -} \ No newline at end of file diff --git a/entry/src/main/ets/pages/sign/SynedData.ets b/entry/src/main/ets/pages/sign/SynedData.ets deleted file mode 100644 index 7737209..0000000 --- a/entry/src/main/ets/pages/sign/SynedData.ets +++ /dev/null @@ -1,11 +0,0 @@ -export class SynedData { - doctorId: string - clientId: string - - constructor(doctorId: string, clientId: string) { - this.doctorId = doctorId - this.clientId = clientId - } - - -} \ No newline at end of file diff --git a/entry/src/main/ets/pages/sign/SynedModel.ets b/entry/src/main/ets/pages/sign/SynedModel.ets deleted file mode 100644 index 9a67e7b..0000000 --- a/entry/src/main/ets/pages/sign/SynedModel.ets +++ /dev/null @@ -1,12 +0,0 @@ -export interface Data { - selfSign: boolean; - checkSelfToken: boolean; - uniqueId: string; - timeStampSignData: string; -} - -export interface SynedModel { - data: Data; - message: string; - status: string; -} \ No newline at end of file diff --git a/entry/src/main/ets/router/NavPathStackHelper.ets b/entry/src/main/ets/router/NavPathStackHelper.ets deleted file mode 100644 index 2357715..0000000 --- a/entry/src/main/ets/router/NavPathStackHelper.ets +++ /dev/null @@ -1,12 +0,0 @@ -import { RouterParam } from './ViewMap'; - -/** - * 导航辅助方法 - */ -export class NavPathStackHelper { - - static pushPathByName(pageInfos: NavPathStack, param: RouterParam) { - console.log('-------------------------------',JSON.stringify(pageInfos)) - pageInfos.pushPathByName('ChangeEvnView', undefined) - } -} \ No newline at end of file diff --git a/entry/src/main/ets/router/RouterBuilder.ets b/entry/src/main/ets/router/RouterBuilder.ets deleted file mode 100644 index 20cd9bb..0000000 --- a/entry/src/main/ets/router/RouterBuilder.ets +++ /dev/null @@ -1,23 +0,0 @@ -import { ChangeEvnView } from '../pages/evn/ChangeEvnView' -import { PageOneTmp } from '../pages/PageOne' -import { Sign } from '../pages/sign/Sign' -import { SignForAuto } from '../pages/sign/SignForAuto' -import { SignForPin } from '../pages/sign/SignForPin' - - -@Builder -export function RouterBuilder(name: string) { - if (name === 'pageOne') { - PageOneTmp() - } else if (name === 'pageTwo') { - // pageTwoTmp() - } else if (name === 'ChangeEvnView') { - ChangeEvnView() - } else if (name === 'Sign') { - Sign() - } else if (name === 'SignForAuto') { - SignForAuto() - } else if (name === 'SignForPin') { - SignForPin() - } -} \ No newline at end of file diff --git a/entry/src/main/ets/router/ViewMap.ts b/entry/src/main/ets/router/ViewMap.ts deleted file mode 100644 index 7649ac9..0000000 --- a/entry/src/main/ets/router/ViewMap.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 页面名称和参数定义 - */ -type RouterMap = { - ChangeEvnView: undefined -}; - - -export type RouterParam = { - [Key in keyof RouterMap]: { - name: Key; - param: RouterMap[Key]; - }; -}[keyof RouterMap]; \ No newline at end of file diff --git a/entry/src/main/module.json5 b/entry/src/main/module.json5 deleted file mode 100644 index 703dafd..0000000 --- a/entry/src/main/module.json5 +++ /dev/null @@ -1,40 +0,0 @@ -{ - "module": { - "name": "entry", - "type": "entry", - "description": "$string:module_desc", - "mainElement": "EntryAbility", - "deviceTypes": [ - "phone", - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "EntryAbility", - "srcEntry": "./ets/entryability/EntryAbility.ets", - "description": "$string:EntryAbility_desc", - "icon": "$media:icon", - "label": "$string:EntryAbility_label", - "startWindowIcon": "$media:startIcon", - "startWindowBackground": "$color:start_window_background", - "exported": true, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ] - } - ], - "requestPermissions": [ - {"name": "ohos.permission.INTERNET", - "reason": "$string:permission_internet"} - ] - } -} \ No newline at end of file diff --git a/entry/src/main/resources/base/element/color.json b/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 3c71296..0000000 --- a/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/entry/src/main/resources/base/element/string.json b/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f945955..0000000 --- a/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/entry/src/main/resources/base/media/icon.png b/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index cd45accb1dfd2fd0da16c732c72faa6e46b26521..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2041 zcmaJ?c~nzZ9u6@;0AXaYAVN(;Kr(@>EJ+}skOWf=BA~*l4us@ELY9{%0m5QX6pnb} z(jZF|S&pLAS}3BZAfeQSvJ_h>F2Q1PYqi?o5`;m_yjZdG$1v}l_wK#F^L^iMz2}uD z#K$>1dON~kFlWvhW+Jp=tuN9J`ZlM-rl4h+ij|^D0y9;4JOuz-EdVnB6i3R-0ulk9 zApi4zAQA>!N9@-o026$1@L`d124`3G5<@_m`0f)Ug_Ie~;HT2q<_a=HH> zDwTdfD^-cW-|_xWVP$f@93UhDN-#&khZ>jZXLTi~$0`7x3REP6pk%&^2|`c>DutjN zMJD4Zs6Z}{FOpd;*mo2zm(GzXRXiCV;4m3zNCYnu3Fy=i5;2An&Lp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E8ef!c2ta8UcI#26# zF|`*4wtMHe@%#eGZw`#Yj|QWuB`eRD)b~)r9mM95p_JVG%-IdcbIX5qG#GpGD+IrS zEqxb1Rg&Dadk5#7t4j68I1f!@A$efp1?I%&d*56)yl!tkz!14<$0Od_&6cGw$WW0r zjSlQA7l*6;vgfhv!cR|RmAD$+w6j`rVf=-?-D@q>kOseUVSb*~jbAS^*1h?ZL)n(9 zDa}`4etXO6`}9;{k5E^N{rcfnV_(LPwsDg``wtyS*V<19c3!PGJ3Kqy9ksvkwbJ%Z z*N(fT0{e*Wji-Ck5!3YE0j|PZ@&z`v=kitWL$bqSt!e4bH!+(|Q)CZ30^nVPfkx{s zX{6of`p=BiPb@u@IyL!tRk>?qgBqCmo-Zlt!636g?z`s~zdfwuB7DXZHvV`Usp+%Z zo*&;Biu@MHE&2j+?j^o`Cr12u<>vOe=a&8a2hlcmFjJiDR>XnD4c4DAhZWCkiAgW{ E51q9-lK=n! diff --git a/entry/src/main/resources/base/media/icon_code_normal.png b/entry/src/main/resources/base/media/icon_code_normal.png deleted file mode 100644 index 15c45ae7fc3a35d55456e4d6db5860a53e8a5243..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 978 zcmV;@11Px&j7da6RCr$PT2YSUAPfyk?=jhvY&)*61BiNIZj z5Wm~Dy~gHe>H^sxQpyX*M%EVSy6#15{mK!@86$*vZQJ(EH&!Y2r>ZIdIqQk(z=BBt z0v~^yVBN@Td=EySNbIVB^7@xrMdcMy08D-j!r+18#9K~A=oUPr zl!Jbw3nI5IYTWhpeIG5KVIWMs0aEy(FoJa?r^7HoDFwv^5NaPVjBON}hh@Ou5A_Ad z<0xk$-&3m(0?3MxSs4H!yH1BJ4sIs{!b?Ws_3o`gh$B^eWdQ(#P&o@g$N>TjyMzj& z79gXq(ONe`h$nKX#{)h%A8x0R9+0Sfb;An)t6Q>}4Nmd^yEmuWkg_+Y>PVf(0>GRE z5SiVhEL9&X2&M|n8BYS>Fti+9!(6Jt0)U@Rr_`>{B-=;;9O`;sL9O+_3EG~~5gI(F z5#SGFV($!TgDzGQW2O26xVV_b&y9fts|n?KK#T{Vqjc{p&Dkq5 zDP_AQ0x;YXqbM_8S%*nJ8U{3aq4^ngw9fI@}QP0?>phMaxH z4lJQ#hjSNjQ6AuShPbtM9{`^Ig7+Mc#huvow@*0*Ob+i}UY^n!f>ssoCj|3#dzK3! zZoV3#`OqfB1E4)d^&Rj6krg3N&u%K~wDZ_qn_NYl`6K|AeVN8%PG@Lw1yT4m762S1 z*E*&Eu-28E%kJUby?GD#4Px#07*qoM6N<$g1KL? A7XSbN diff --git a/entry/src/main/resources/base/media/icon_code_selected.png b/entry/src/main/resources/base/media/icon_code_selected.png deleted file mode 100644 index 9ce067844d75c9c84fb3473c2a0c168c39a99417..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1012 zcmVPx&u1Q2eRCr$PT47e(FbtN%=-VMi*ZrbB#oCiVPXe5z>?FV`T7E4nJH%dTt)Y?#!w%sYJY3TrOF1p(sY_~msLk_XV-Ql`c>%K1A0IMZ0$I#$EM zZve<@13csO&IT#JR$7xV`cg!^3&{wp1&{H1vo}Dliz0VX)X4O~*_pL`#y6GM8?KoQ z;5xhkpb5{z!2$tDXz`^~ck}gxiVP~Q9Ml&|9_Oo|X1vS#d6CDiDYMLOw>Us3)M#x^04lw@%z_&6kFPcbaK)}r<2}s)KNw^Cjn7sWU4~5#kqty8FF=4Bpy-9Eevdsd)&zZD7CQy zyEO$s`v#~10B+?f=%4NZrvRX!-2_;bGWP-i+flLsz>k;DasBk>sOtzc1)xaU=&#Qe z+DZUSJiz7wk|10+rgZ=ad4RL;F9oD^0N8lI-pzNrX#HXdNJDyQr| z&v`lrK<*(^Op+N7b|1n7Pr(Cv&jcd??4@X{asi*fVhUE0w}7qkfP>DEu-0A&K()VM zqN}#JV|)JgA-6zQWH@}h?A;kcM5^)geu6PyFYaTF`BuI93Oa!2-mOIwEqX!%d$*#(Y i9?(_G9c$ga_kjP58xxEHDCi6T0000Px%(Md!>RCr$Pno(}!AP|NbB?n1Qvdu}hIfRk&)b=S7K17?7Y;LmNdl*rTg)5hZ z0YhtJf~7nK66WKdVP*`lJAdHL?PnE0RluDSs4j5l0;oZ-xNjI-8nipk z`9mszch31KH)Cz<5kg?#t^g)*ssgGDEExkZfkOF(WMV%NQ&x`w`UpKx3CPrNoo4@v zfq`kSdB(2_K&Q`mgfc1tnHrmzbp3b6uL{6OpvW|Igis6sEoD4|KOa;<-}hH49&8qX zmKp}U@k6;WmZrl;O8Ghkq5;H~+voyc612r!AhueRQa=3T39%Re9q_Pd3N4vC05~;G zbBl@ip>q}kfD4)dVG-kTO^X7UKp2ib;yH27-$QpXWn7j30O077e%rR#a*IlYlv4jp zuvr3Nj5!ss*<+AMWJamu&W-`n*-t15z|b`srH;~`bZ4Axsm%kxlVHE!A3Q$Ji0@Mx zuzA%2Dbah4xl~u!Y>IBCCpZUW1>mA($@4d*09}?}eaTmm3NU&SWCmIs0NWcas`@Mn z0P#BSTV9Q29Rp&FANrQL2SMFtd!{}hDXAQvCVAcJ^&&v*}#%B$H zD3Asv5Lb7c0ng^{S;v5gDsh(avlRdU*ExCi+_AQ5aR!8_Q!1+~GMsbkdIBIs8BZ!8 z;7{jnuy?!*08S*<6Ky;RK)06{y(UKia6m{h-V0#qi;_M7283key#Pkdjx8^xROlNZ zuiR||e5LE83H$h6ZxA002ovPDHLkV1jHARXP9w diff --git a/entry/src/main/resources/base/media/icon_home_selected.png b/entry/src/main/resources/base/media/icon_home_selected.png deleted file mode 100644 index 53f55f29c458f3f2a3980b040c22f664469a4496..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 823 zcmV-71IYY|P)Px%@kvBMRCr$Pnq5-cFc5%OB4m09$e1URQ#3hA$w`2dgq(!jBJhM7dWcR4T9A=D zu10^BgDoratJjJ4+aK+&MBv09a^m_!29Q1A#0lgOIB^HaNic^%4gpUB+spGCPtpFx z5E+a{Y{vdF*J7+8uq}QRsDw4@N{|pI9S(LHAUP^U*8tZ0I2RS;t5epF*e&% zN`E0hJ!!M)ZhzGZ00DTo-tCvMDXUx0^JKir0I~<<5a=%lhyqH)rcWjI9XX}<93Z#Q z!d8IP6&GbTCFExy45se!y#gr9XU;_hDSB;V0a91CRneu{<9h|56j0VOw1SWf0O87n zkX7Bf!V5U1Yg;}TEP&G05DOqgBt2Kt!~l^ILKvs?z79kJ2x_+pz(y_5Itzi&ZV@TH z`pzAqGXOH-J$hKbiVB9DFK2%ao4}0k^;u^C#A+Hq=tOz3rcMFWAe395=|RNh?Dg%z z%Y-e3;sn6?!sPnfi_x4?8dL~z#NR5|I00BZV6fYusgMz~1Mv<4#4xqo9&Pi4bO6Yy zQRV8=wZEn_ma){}0hHa};ZWFOyzCAQ+uz^;v`pH)er}!$D?`yC%>Yca)H;7? z9w6Fs1X#O@uOvO7K9g`&pveKyooLy*&!hktkMoXkG!}af2vJ^EsQNS*OA?f0wp-hT zIaK-R0Vp#@?SQq7@=*iO4Oju-KL~A=j~albKPVv>ukKh9o-Wv<-US*rNez{6>;atf zb(1=~sjRMB^o0<*OGR}>X1d#J*W-c^s=U<$Tz}fsx<2wI0CLi+y|mRvc`E?%GW6iX zM_HYW4S)_pTjiYqy1pps0#Ju=4CS2wDl1hZFL?$SYGCJguGaP6dM-xuW1TML+u}~M zBrcFWAaMgb)yp2>M3lHd_JG6<>{Ks%fD=*T0v{|F!e3iJgXsVO002ovPDHLkV1f#s BaIOFV diff --git a/entry/src/main/resources/base/media/icon_setting_Normal.png b/entry/src/main/resources/base/media/icon_setting_Normal.png deleted file mode 100644 index 334b12ca210db08a061b60cc7236d35e237ce325..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1520 zcmVPx)s!2paRCr$PTitEkFbtO9+oS0uO(sb*#2Ls_lBWQ^A(~FoWRhO@I72N3(I9A1 zq%2)?K;oAKXIUmc{!_GfAN=wkoPYNTz^4YB34!P5=d0arcN;?Z?w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Icon.png deleted file mode 100644 index 366f76459ffd4494ec40d0ddd5c59385b9c5da11..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4351 zcmaJ_c{r5o`$trELZWDz?8}%L>x?yK$i9!UFJmyqEM`W=l13t1vK18?bc9Hft+FQB zvZWA7vQ{XHEY)wEb2{JOAK&wRuj_rE=e@7{{@mN=ey`_xlk9BF_<1CG*x1mL!?jn!jg+b4^2 zLetRJR&Wf70P@|_0nrI$mNgrjo*|v=i@{@Q06%OXj;Ie@ebfR3;QaN0E}GV0YqAM8 z2zNS?f_03val%C6F))9ip#eaT4rc)nuryx)oe)B#!s+_JKXKu#{hnA22>4TlhSvxF z6%^Xq4q!r}U;$bnuqp-&)&gk5KoBhrZB2C*02B;`sDYts5KUDG1g;5%L(~C(UqF^O zihlsy0b%;LFV>qrFo;GY!`0Nn!^1)0>L3y&Pz?fu!S*nqP*s+ODm8*g^QEg2sV9FU zAh1*n1xKdgNJPLMqOTt*jHVA{Mfz6?1oA(yMC#vVViin{?n_pKfWUhx{Z_QL{@IO$Y>u zG)8KgAdz6ODcJawj)s=$Z(9Tj6Gp%iX}@j#|6_aVUv2l;Kp?X`Bd`?Q8LYo4g+u`S znKc~u@3CnAE8gF>{{J3}&cE8Kv4T+S#R^=}c2KzrMNn9F+khx=F}i|`Z{v!A;f zo3N&hY>qhPM1TFslQ-4LMdIhmr+ckEAWLQ}$bjCZe0XSBNyEsx@W>%w{_Hv}emPB) zOoHjD5ZtXSIb=|>s7#{F^~74>>3x2~*)FrfZ3hTsJmWQo0UC^b(hgMVUGey}I^`OR zJu^iexYqb9XYyKaUsL!%^ul|?UlF^%LWN}fh@4X2Rg}O2Ak&BgV5c-mSXIKwizyZg z4==`Py(>jdxzBp%%;~5u$Tt=5dv;+WT!=c;CU*OKQJKjx>TF2)F~Oe8RnB6fwWc@b z!di|+3AbqpJ7Si&73MeA5bym8cH?nt(nHrZfh7&(7PBdB*^ZImdWIkIIHY)et}Nx& zblijem4{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93s!uI zd$HZw=ecl{(s_F(pRCORFA>_zK=vGLhAIJP7giSF5U(1y7v?+BFC&mY`q}NM(F*E_ zO+V4esPBCBE@La%M>?SMW+0Cj-b5PD)A+~=SSTb^y)D?fvibbS*#JhMR$54=_-D6O z={SjR-Q#yIK2I5IV8A`5t5sXy@-OSHe@&arq_0a);W=0{8P=e6uq*b>3I&Y(F`Aj}@y zKnKJ9xdz8d%dO4{E>!4jbw3$t{*ZbEyLD0>`!SED72;`Hsa3$K<1Cfa7|^0|X~xVk%&sS|#S{KfJOYz6q-M!qY` z+)WxSIX`42MlEplojlQ(T-~1aE_pNU{4ehSi;BW;sp3%}QP*w5=OZ?p5P6WzS9UBS zLw3VaH{Ver>WU!p>e$Dfp=R~3M;KpUa#$W(IdsNmcPWm z_WG8J;=@yp#wSmMn7L2BviDw*M{1)B22X2qtW^%WMG)-nih2&F5AJv1RhWO!8_#RE zz0;<|v$SO=GGgk+z6FHKOl`pDtTPrPD%UkKINz9I5%@BW$;A8;Bn;ibJPu&O~sBZFQewfjqZ8of% znY3?5KcI8|c%rA96`;H$S8>M{G2rp&``kF_`$@W znJEtXUEg`=h&$@gYgOjNQzv=Uk}&Ls(m6u%F4L`YyePS3oL4jqq0<~BnXmrUq_SE|?M~j!BdLw~HoaTstBb7=HK+WcPWE@_ cIQZCt9|&h0`tm_w@0Wx*(gtzY*ysHJ0mylrOaK4? diff --git a/entry/src/main/resources/base/profile/main_pages.json b/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 1898d94..0000000 --- a/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/Index" - ] -} diff --git a/entry/src/main/resources/en_US/element/string.json b/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index f945955..0000000 --- a/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/entry/src/main/resources/zh_CN/element/string.json b/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 597ecf9..0000000 --- a/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/entry/src/mock/mock-config.json5 b/entry/src/mock/mock-config.json5 deleted file mode 100644 index 7a73a41..0000000 --- a/entry/src/mock/mock-config.json5 +++ /dev/null @@ -1,2 +0,0 @@ -{ -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/Ability.test.ets b/entry/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 85c78f6..0000000 --- a/entry/src/ohosTest/ets/test/Ability.test.ets +++ /dev/null @@ -1,35 +0,0 @@ -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function abilityTest() { - describe('ActsAbilityTest', () => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }) - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }) - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }) - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }) - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }) - }) -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/List.test.ets b/entry/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 794c7dc..0000000 --- a/entry/src/ohosTest/ets/test/List.test.ets +++ /dev/null @@ -1,5 +0,0 @@ -import abilityTest from './Ability.test'; - -export default function testsuite() { - abilityTest(); -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/testability/TestAbility.ets b/entry/src/ohosTest/ets/testability/TestAbility.ets deleted file mode 100644 index 3682558..0000000 --- a/entry/src/ohosTest/ets/testability/TestAbility.ets +++ /dev/null @@ -1,48 +0,0 @@ -import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; -import { abilityDelegatorRegistry } from '@kit.TestKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { window } from '@kit.ArkUI'; -import { Hypium } from '@ohos/hypium'; -import testsuite from '../test/List.test'; - -export default class TestAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam) { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); - hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); - hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? ''); - let abilityDelegator: abilityDelegatorRegistry.AbilityDelegator; - abilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); - let abilityDelegatorArguments: abilityDelegatorRegistry.AbilityDelegatorArgs; - abilityDelegatorArguments = abilityDelegatorRegistry.getArguments(); - hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite); - } - - onDestroy() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); - } - - onWindowStageCreate(windowStage: window.WindowStage) { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); - windowStage.loadContent('testability/pages/Index', (err, data) => { - if (err.code) { - hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); - return; - } - hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', - JSON.stringify(data) ?? ''); - }); - } - - onWindowStageDestroy() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); - } - - onForeground() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); - } - - onBackground() { - hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); - } -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/testability/pages/Index.ets b/entry/src/ohosTest/ets/testability/pages/Index.ets deleted file mode 100644 index 423b427..0000000 --- a/entry/src/ohosTest/ets/testability/pages/Index.ets +++ /dev/null @@ -1,17 +0,0 @@ -@Entry -@Component -struct Index { - @State message: string = 'Hello World'; - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ets b/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ets deleted file mode 100644 index 0eb230c..0000000 --- a/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ets +++ /dev/null @@ -1,90 +0,0 @@ -import { abilityDelegatorRegistry, TestRunner } from '@kit.TestKit'; -import { UIAbility, Want } from '@kit.AbilityKit'; -import { BusinessError } from '@kit.BasicServicesKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { resourceManager } from '@kit.LocalizationKit'; -import { util } from '@kit.ArkTS'; - -let abilityDelegator: abilityDelegatorRegistry.AbilityDelegator; -let abilityDelegatorArguments: abilityDelegatorRegistry.AbilityDelegatorArgs; -let jsonPath: string = 'mock/mock-config.json'; -let tag: string = 'testTag'; - -async function onAbilityCreateCallback(data: UIAbility) { - hilog.info(0x0000, 'testTag', 'onAbilityCreateCallback, data: ${}', JSON.stringify(data)); -} - -async function addAbilityMonitorCallback(err: BusinessError) { - hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); -} - -export default class OpenHarmonyTestRunner implements TestRunner { - constructor() { - } - - onPrepare() { - hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare'); - } - - async onRun() { - let tag = 'testTag'; - hilog.info(0x0000, tag, '%{public}s', 'OpenHarmonyTestRunner onRun run'); - abilityDelegatorArguments = abilityDelegatorRegistry.getArguments() - abilityDelegator = abilityDelegatorRegistry.getAbilityDelegator() - let moduleName = abilityDelegatorArguments.parameters['-m']; - let context = abilityDelegator.getAppContext().getApplicationContext().createModuleContext(moduleName); - let mResourceManager = context.resourceManager; - await checkMock(abilityDelegator, mResourceManager); - const bundleName = abilityDelegatorArguments.bundleName; - const testAbilityName: string = 'TestAbility'; - let lMonitor: abilityDelegatorRegistry.AbilityMonitor = { - abilityName: testAbilityName, - onAbilityCreate: onAbilityCreateCallback, - moduleName: moduleName - }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - const want: Want = { - bundleName: bundleName, - abilityName: testAbilityName, - moduleName: moduleName - }; - abilityDelegator.startAbility(want, (err: BusinessError, data: void) => { - hilog.info(0x0000, tag, 'startAbility : err : %{public}s', JSON.stringify(err) ?? ''); - hilog.info(0x0000, tag, 'startAbility : data : %{public}s', JSON.stringify(data) ?? ''); - }) - hilog.info(0x0000, tag, '%{public}s', 'OpenHarmonyTestRunner onRun end'); - } -} - -async function checkMock(abilityDelegator: abilityDelegatorRegistry.AbilityDelegator, resourceManager: resourceManager.ResourceManager) { - let rawFile: Uint8Array; - try { - rawFile = resourceManager.getRawFileContentSync(jsonPath); - hilog.info(0x0000, tag, 'MockList file exists'); - let mockStr: string = util.TextDecoder.create("utf-8", { ignoreBOM: true }).decodeWithStream(rawFile); - let mockMap: Record = getMockList(mockStr); - try { - abilityDelegator.setMockList(mockMap) - } catch (error) { - let code = (error as BusinessError).code; - let message = (error as BusinessError).message; - hilog.error(0x0000, tag, `abilityDelegator.setMockList failed, error code: ${code}, message: ${message}.`); - } - } catch (error) { - let code = (error as BusinessError).code; - let message = (error as BusinessError).message; - hilog.error(0x0000, tag, `ResourceManager:callback getRawFileContent failed, error code: ${code}, message: ${message}.`); - } -} - -function getMockList(jsonStr: string) { - let jsonObj: Record = JSON.parse(jsonStr); - let map: Map = new Map(Object.entries(jsonObj)); - let mockList: Record = {}; - map.forEach((value: object, key: string) => { - let realValue: string = value['source'].toString(); - mockList[key] = realValue; - }); - hilog.info(0x0000, tag, '%{public}s', 'mock-json value:' + JSON.stringify(mockList) ?? ''); - return mockList; -} \ No newline at end of file diff --git a/entry/src/ohosTest/module.json5 b/entry/src/ohosTest/module.json5 deleted file mode 100644 index d0dc5d5..0000000 --- a/entry/src/ohosTest/module.json5 +++ /dev/null @@ -1,38 +0,0 @@ -{ - "module": { - "name": "entry_test", - "type": "feature", - "description": "$string:module_test_desc", - "mainElement": "TestAbility", - "deviceTypes": [ - "phone", - "tablet", - "2in1" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:test_pages", - "abilities": [ - { - "name": "TestAbility", - "srcEntry": "./ets/testability/TestAbility.ets", - "description": "$string:TestAbility_desc", - "icon": "$media:icon", - "label": "$string:TestAbility_label", - "exported": true, - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ] - } -} diff --git a/entry/src/ohosTest/resources/base/element/color.json b/entry/src/ohosTest/resources/base/element/color.json deleted file mode 100644 index 3c71296..0000000 --- a/entry/src/ohosTest/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/entry/src/ohosTest/resources/base/element/string.json b/entry/src/ohosTest/resources/base/element/string.json deleted file mode 100644 index 65d8fa5..0000000 --- a/entry/src/ohosTest/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_test_desc", - "value": "test ability description" - }, - { - "name": "TestAbility_desc", - "value": "the test ability" - }, - { - "name": "TestAbility_label", - "value": "test label" - } - ] -} \ No newline at end of file diff --git a/entry/src/ohosTest/resources/base/media/icon.png b/entry/src/ohosTest/resources/base/media/icon.png deleted file mode 100644 index cd45accb1dfd2fd0da16c732c72faa6e46b26521..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2041 zcmaJ?c~nzZ9u6@;0AXaYAVN(;Kr(@>EJ+}skOWf=BA~*l4us@ELY9{%0m5QX6pnb} z(jZF|S&pLAS}3BZAfeQSvJ_h>F2Q1PYqi?o5`;m_yjZdG$1v}l_wK#F^L^iMz2}uD z#K$>1dON~kFlWvhW+Jp=tuN9J`ZlM-rl4h+ij|^D0y9;4JOuz-EdVnB6i3R-0ulk9 zApi4zAQA>!N9@-o026$1@L`d124`3G5<@_m`0f)Ug_Ie~;HT2q<_a=HH> zDwTdfD^-cW-|_xWVP$f@93UhDN-#&khZ>jZXLTi~$0`7x3REP6pk%&^2|`c>DutjN zMJD4Zs6Z}{FOpd;*mo2zm(GzXRXiCV;4m3zNCYnu3Fy=i5;2An&Lp!#LP;bRD~1&s z%VH6UY+}r6YDgG+p34OJIZ{BTn&%4s=CT&#TBkuOhdeU@g(w#guoa*b^)73=XyI65 z7Swys6)YS}?1EeZ6b!-I+yCnIya^g0>-NLsLWd8t56GZ_S3r|ZGbR+mV2ErEb9J)X zIF!njY-D-7{qtF2(?nlQ$0}!pzt=}hc*m%%)0Jb#N_K4@IC-`Pi5DahPZN7N9rH;ol;Gc*>-Go@gXKTM{eP)iJj6CYTIi}B#zLKZYD@_;m zrXmXXsFq@~ou-z!9bHoM8*(hwl>X(zm)TDcdkF4lZm$1jP*HbnD`o1$g}_R#+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kitWL$bqSt!e4bH!+(|Q)CZ30^nVPfkx{s zX{6of`p=BiPb@u@IyL!tRk>?qgBqCmo-Zlt!636g?z`s~zdfwuB7DXZHvV`Usp+%Z zo*&;Biu@MHE&2j+?j^o`Cr12u<>vOe=a&8a2hlcmFjJiDR>XnD4c4DAhZWCkiAgW{ E51q9-lK=n! diff --git a/entry/src/ohosTest/resources/base/profile/test_pages.json b/entry/src/ohosTest/resources/base/profile/test_pages.json deleted file mode 100644 index b7e7343..0000000 --- a/entry/src/ohosTest/resources/base/profile/test_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "testability/pages/Index" - ] -} diff --git a/entry/src/test/List.test.ets b/entry/src/test/List.test.ets deleted file mode 100644 index bb5b5c3..0000000 --- a/entry/src/test/List.test.ets +++ /dev/null @@ -1,5 +0,0 @@ -import localUnitTest from './LocalUnit.test'; - -export default function testsuite() { - localUnitTest(); -} \ No newline at end of file diff --git a/entry/src/test/LocalUnit.test.ets b/entry/src/test/LocalUnit.test.ets deleted file mode 100644 index ed22d4d..0000000 --- a/entry/src/test/LocalUnit.test.ets +++ /dev/null @@ -1,33 +0,0 @@ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; - -export default function localUnitTest() { - describe('localUnitTest',() => { - // Defines a test suite. Two parameters are supported: test suite name and test suite function. - beforeAll(() => { - // Presets an action, which is performed only once before all test cases of the test suite start. - // This API supports only one parameter: preset action function. - }); - beforeEach(() => { - // Presets an action, which is performed before each unit test case starts. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: preset action function. - }); - afterEach(() => { - // Presets a clear action, which is performed after each unit test case ends. - // The number of execution times is the same as the number of test cases defined by **it**. - // This API supports only one parameter: clear action function. - }); - afterAll(() => { - // Presets a clear action, which is performed after all test cases of the test suite end. - // This API supports only one parameter: clear action function. - }); - it('assertContain', 0, () => { - // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. - let a = 'abc'; - let b = 'b'; - // Defines a variety of assertion methods, which are used to declare expected boolean conditions. - expect(a).assertContain(b); - expect(a).assertEqual(a); - }); - }); -} \ No newline at end of file