From 09a6f13e1d9b156ff5d25f20bcba42d8b099c2dd Mon Sep 17 00:00:00 2001 From: xiaoxiao Date: Tue, 20 May 2025 14:04:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E5=86=8C=E8=B5=84=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build-profile.json5 | 8 - commons/basic/Index.ets | 12 + commons/basic/oh-package.json5 | 2 +- .../src/main/ets/Views}/DatePickerDialog.ets | 4 +- .../src/main/ets/Views}/EditUserDataItem.ets | 23 +- .../src/main/ets/Views}/HeroPopWindow.ets | 7 +- .../main/ets/Views}/OfficeSelectedSheet.ets | 11 +- .../src/main/ets/Views/PerfactInputSheet.ets | 77 ++++ .../src/main/ets/Views}/PhotoActionSheet.ets | 0 .../main/ets/Views}/PositionSelectedSheet.ets | 14 +- .../src/main/ets/Views/SexSelectedSheet.ets | 68 ++++ .../ets/Views}/SpecialitySelectedSheet.ets | 28 +- .../basic/src/main/ets/components/HdNav.ets | 28 +- .../main/ets/models/RequestDefaultModel.ets | 2 + .../basic/src/main/ets/utils}/DateUtils.ets | 0 .../basic/src/main/ets/utils/PerfactAuth.ets | 44 +++ commons/basic/src/main/ets/utils/auth.ets | 17 + commons/basic/src/main/ets/utils/request.ets | 2 +- .../main/resources/base/media/heroPop_bg.png | Bin .../base/media/heroPop_headericon.png | Bin .../resources/base/media/heropop_delete.png | Bin .../main/resources/base/media/icon_camera.png | Bin .../base/media/icon_touxiang_persion_ws.png | Bin .../resources/base/media/icon_xiongpai_ws.png | Bin 0 -> 4533 bytes .../main/resources/base/media/ixon_album.png | Bin .../base/media/userPhoto_default.png | Bin commons/uicomponents/.gitignore | 6 - commons/uicomponents/Index.ets | 1 - commons/uicomponents/build-profile.json5 | 31 -- commons/uicomponents/consumer-rules.txt | 0 commons/uicomponents/hvigorfile.ts | 6 - commons/uicomponents/obfuscation-rules.txt | 23 -- commons/uicomponents/oh-package.json5 | 9 - .../src/main/ets/components/MainPage.ets | 19 - commons/uicomponents/src/main/module.json5 | 11 - .../main/resources/base/element/float.json | 8 - .../main/resources/base/element/string.json | 8 - .../src/ohosTest/ets/test/Ability.test.ets | 35 -- .../src/ohosTest/ets/test/List.test.ets | 5 - .../uicomponents/src/ohosTest/module.json5 | 13 - commons/uicomponents/src/test/List.test.ets | 5 - .../uicomponents/src/test/LocalUnit.test.ets | 33 -- commons/utils/.gitignore | 6 - commons/utils/BuildProfile.ets | 17 - commons/utils/Index.ets | 4 - commons/utils/build-profile.json5 | 31 -- commons/utils/consumer-rules.txt | 0 commons/utils/hvigorfile.ts | 6 - commons/utils/obfuscation-rules.txt | 23 -- commons/utils/oh-package-lock.json5 | 19 - commons/utils/oh-package.json5 | 13 - .../utils/src/main/ets/request/Base64Util.ets | 84 ---- .../utils/src/main/ets/request/ChangeUtil.ets | 61 --- commons/utils/src/main/ets/request/logger.ets | 33 -- .../utils/src/main/ets/request/request.ets | 288 -------------- commons/utils/src/main/module.json5 | 11 - .../main/resources/base/element/float.json | 8 - .../main/resources/base/element/string.json | 8 - .../src/ohosTest/ets/test/Ability.test.ets | 35 -- .../utils/src/ohosTest/ets/test/List.test.ets | 5 - commons/utils/src/ohosTest/module.json5 | 13 - commons/utils/src/test/List.test.ets | 5 - commons/utils/src/test/LocalUnit.test.ets | 33 -- features/mypage/Index.ets | 10 +- .../src/main/ets/view/EditUserDataComp.ets | 12 +- .../mypage/src/main/ets/view/HeaderView.ets | 2 +- features/register/Index.ets | 4 +- features/register/oh-package-lock.json5 | 12 +- features/register/oh-package.json5 | 2 +- .../register/src/main/ets/view/LoginComp.ets | 52 +-- .../src/main/ets/view/LoginSetInfo.ets | 10 +- .../src/main/ets/view/PerfectUserDataComp.ets | 362 +++++++++++++++++ .../main/ets/view/SelectedHospitalComp.ets | 369 ++++++++++++++++++ .../main/resources/base/element/float.json | 2 +- .../base/media/selected_hospital_ws.png | Bin 0 -> 2830 bytes products/expert/oh-package-lock.json5 | 16 +- products/expert/oh-package.json5 | 1 - .../ets/pages/LoginPage/LoginSetInfoPage.ets | 9 +- .../pages/LoginPage/SelectedHospitalPage.ets | 13 + .../resources/base/profile/main_pages.json | 1 + 80 files changed, 1102 insertions(+), 1038 deletions(-) rename {features/mypage/src/main/ets/view => commons/basic/src/main/ets/Views}/DatePickerDialog.ets (95%) rename {features/mypage/src/main/ets/view => commons/basic/src/main/ets/Views}/EditUserDataItem.ets (77%) rename {features/mypage/src/main/ets/view => commons/basic/src/main/ets/Views}/HeroPopWindow.ets (95%) rename {features/mypage/src/main/ets/view => commons/basic/src/main/ets/Views}/OfficeSelectedSheet.ets (87%) create mode 100644 commons/basic/src/main/ets/Views/PerfactInputSheet.ets rename {features/mypage/src/main/ets/view => commons/basic/src/main/ets/Views}/PhotoActionSheet.ets (100%) rename {features/mypage/src/main/ets/view => commons/basic/src/main/ets/Views}/PositionSelectedSheet.ets (87%) create mode 100644 commons/basic/src/main/ets/Views/SexSelectedSheet.ets rename {features/mypage/src/main/ets/view => commons/basic/src/main/ets/Views}/SpecialitySelectedSheet.ets (79%) rename {features/mypage/src/main/ets/util => commons/basic/src/main/ets/utils}/DateUtils.ets (100%) create mode 100644 commons/basic/src/main/ets/utils/PerfactAuth.ets rename {features/mypage => commons/basic}/src/main/resources/base/media/heroPop_bg.png (100%) rename {features/mypage => commons/basic}/src/main/resources/base/media/heroPop_headericon.png (100%) rename {features/mypage => commons/basic}/src/main/resources/base/media/heropop_delete.png (100%) rename {features/mypage => commons/basic}/src/main/resources/base/media/icon_camera.png (100%) rename {features/register => commons/basic}/src/main/resources/base/media/icon_touxiang_persion_ws.png (100%) create mode 100644 commons/basic/src/main/resources/base/media/icon_xiongpai_ws.png rename {features/mypage => commons/basic}/src/main/resources/base/media/ixon_album.png (100%) rename {features/mypage => commons/basic}/src/main/resources/base/media/userPhoto_default.png (100%) delete mode 100644 commons/uicomponents/.gitignore delete mode 100644 commons/uicomponents/Index.ets delete mode 100644 commons/uicomponents/build-profile.json5 delete mode 100644 commons/uicomponents/consumer-rules.txt delete mode 100644 commons/uicomponents/hvigorfile.ts delete mode 100644 commons/uicomponents/obfuscation-rules.txt delete mode 100644 commons/uicomponents/oh-package.json5 delete mode 100644 commons/uicomponents/src/main/ets/components/MainPage.ets delete mode 100644 commons/uicomponents/src/main/module.json5 delete mode 100644 commons/uicomponents/src/main/resources/base/element/float.json delete mode 100644 commons/uicomponents/src/main/resources/base/element/string.json delete mode 100644 commons/uicomponents/src/ohosTest/ets/test/Ability.test.ets delete mode 100644 commons/uicomponents/src/ohosTest/ets/test/List.test.ets delete mode 100644 commons/uicomponents/src/ohosTest/module.json5 delete mode 100644 commons/uicomponents/src/test/List.test.ets delete mode 100644 commons/uicomponents/src/test/LocalUnit.test.ets delete mode 100644 commons/utils/.gitignore delete mode 100644 commons/utils/BuildProfile.ets delete mode 100644 commons/utils/Index.ets delete mode 100644 commons/utils/build-profile.json5 delete mode 100644 commons/utils/consumer-rules.txt delete mode 100644 commons/utils/hvigorfile.ts delete mode 100644 commons/utils/obfuscation-rules.txt delete mode 100644 commons/utils/oh-package-lock.json5 delete mode 100644 commons/utils/oh-package.json5 delete mode 100644 commons/utils/src/main/ets/request/Base64Util.ets delete mode 100644 commons/utils/src/main/ets/request/ChangeUtil.ets delete mode 100644 commons/utils/src/main/ets/request/logger.ets delete mode 100644 commons/utils/src/main/ets/request/request.ets delete mode 100644 commons/utils/src/main/module.json5 delete mode 100644 commons/utils/src/main/resources/base/element/float.json delete mode 100644 commons/utils/src/main/resources/base/element/string.json delete mode 100644 commons/utils/src/ohosTest/ets/test/Ability.test.ets delete mode 100644 commons/utils/src/ohosTest/ets/test/List.test.ets delete mode 100644 commons/utils/src/ohosTest/module.json5 delete mode 100644 commons/utils/src/test/List.test.ets delete mode 100644 commons/utils/src/test/LocalUnit.test.ets create mode 100644 features/register/src/main/ets/view/PerfectUserDataComp.ets create mode 100644 features/register/src/main/ets/view/SelectedHospitalComp.ets create mode 100644 features/register/src/main/resources/base/media/selected_hospital_ws.png create mode 100644 products/expert/src/main/ets/pages/LoginPage/SelectedHospitalPage.ets diff --git a/build-profile.json5 b/build-profile.json5 index f3a94c2..f7f2fe0 100644 --- a/build-profile.json5 +++ b/build-profile.json5 @@ -37,14 +37,6 @@ } ] }, - { - "name": "uicomponents", - "srcPath": "./commons/uicomponents", - }, - { - "name": "utils", - "srcPath": "./commons/utils", - }, { "name": "mypage", "srcPath": "./features/mypage" diff --git a/commons/basic/Index.ets b/commons/basic/Index.ets index 5cf688f..5ae6c38 100644 --- a/commons/basic/Index.ets +++ b/commons/basic/Index.ets @@ -2,6 +2,8 @@ export { hdHttp, HdResponse } from './src/main/ets/utils/request' export { authStore, HdUser, AUTH_STORE_KEY } from './src/main/ets/utils/auth' +export { perfactAuth } from './src/main/ets/utils/PerfactAuth' + export { logger } from './src/main/ets/utils/logger' export { getTimeText, getPercentText } from './src/main/ets/utils/base' @@ -32,4 +34,14 @@ export { AESEncryptionDecryption } from './src/main/ets/utils/AESEncryptionDecry export { HdGrid } from './src/main/ets/components/HdGrid' +export { PhotoActionSheet } from './src/main/ets/Views/PhotoActionSheet' + +export { DatePickerDialog } from './src/main/ets/Views/DatePickerDialog' + +export { OfficeSelectedSheet } from './src/main/ets/Views/OfficeSelectedSheet' + +export { PositionSelectedSheet } from './src/main/ets/Views/PositionSelectedSheet' + +export { SpecialitySelectedSheet } from './src/main/ets/Views/SpecialitySelectedSheet' + diff --git a/commons/basic/oh-package.json5 b/commons/basic/oh-package.json5 index 65b9b86..1353439 100644 --- a/commons/basic/oh-package.json5 +++ b/commons/basic/oh-package.json5 @@ -6,6 +6,6 @@ "author": "", "license": "Apache-2.0", "dependencies": { - + "mypage": "file:../../features/mypage" } } diff --git a/features/mypage/src/main/ets/view/DatePickerDialog.ets b/commons/basic/src/main/ets/Views/DatePickerDialog.ets similarity index 95% rename from features/mypage/src/main/ets/view/DatePickerDialog.ets rename to commons/basic/src/main/ets/Views/DatePickerDialog.ets index 3ce28ff..42af721 100644 --- a/features/mypage/src/main/ets/view/DatePickerDialog.ets +++ b/commons/basic/src/main/ets/Views/DatePickerDialog.ets @@ -1,5 +1,5 @@ -import { formatDate } from '../util/DateUtils' -import { authStore } from '@itcast/basic' +import { formatDate } from '../utils/DateUtils' +import { authStore } from '../utils/auth' @CustomDialog export struct DatePickerDialog { diff --git a/features/mypage/src/main/ets/view/EditUserDataItem.ets b/commons/basic/src/main/ets/Views/EditUserDataItem.ets similarity index 77% rename from features/mypage/src/main/ets/view/EditUserDataItem.ets rename to commons/basic/src/main/ets/Views/EditUserDataItem.ets index e80aa59..db597bd 100644 --- a/features/mypage/src/main/ets/view/EditUserDataItem.ets +++ b/commons/basic/src/main/ets/Views/EditUserDataItem.ets @@ -4,6 +4,7 @@ export struct EditUserDataItem { private required: boolean = false @Prop content: string = '' private hasArrow: boolean = false + @Prop isLine:boolean = true; build() { Column() { @@ -12,7 +13,7 @@ export struct EditUserDataItem { Text(this.label) .fontSize(16) .fontColor('#333333') - .margin({ left: 15 }) + .margin({ left: this.isLine?15:10 }) if (this.required) { Text('*') .margin({ left: 0 }) @@ -26,7 +27,7 @@ export struct EditUserDataItem { Row({space:5}) { if (this.label == '头像') { Image(this.content) - .alt($r('app.media.userPhoto_default')) + .alt(this.isLine?$r('app.media.userPhoto_default'):$r('app.media.icon_touxiang_persion_ws')) .onComplete(() => console.log('图片加载完成')) .onError(() => console.error('图片加载失败'+this.content)) .width(40) @@ -35,6 +36,7 @@ export struct EditUserDataItem { .borderRadius(8) } else if (this.label == '执业医师证图片或胸牌') { Image(this.content) + .alt(this.isLine?null:$r('app.media.icon_xiongpai_ws')) .onComplete(() => console.log('图片加载完成')) .onError(() => console.error('图片加载失败'+this.content)) .width(60) @@ -44,7 +46,10 @@ export struct EditUserDataItem { Text(this.content) .fontSize(14) .fontColor('#333333') - .width('60%') + .width('auto') + .constraintSize({ + maxWidth:this.label='专长(可选一到十项)'?'50%':'70%' + }) .textOverflow({ overflow: TextOverflow.Ellipsis }) .maxLines(1) .margin({right: this.hasArrow?0:10 }) @@ -62,11 +67,13 @@ export struct EditUserDataItem { .height(50) .alignItems(VerticalAlign.Center) - Divider() - .color('#F4F4F4') - .strokeWidth(1) - .height(1) - .margin({ left: 10, top: 0 }) + if (this.isLine) { + Divider() + .color('#F4F4F4') + .strokeWidth(1) + .height(1) + .margin({ left: 10, top: 0 }) + } } } } diff --git a/features/mypage/src/main/ets/view/HeroPopWindow.ets b/commons/basic/src/main/ets/Views/HeroPopWindow.ets similarity index 95% rename from features/mypage/src/main/ets/view/HeroPopWindow.ets rename to commons/basic/src/main/ets/Views/HeroPopWindow.ets index 953dfd1..eb657bc 100644 --- a/features/mypage/src/main/ets/view/HeroPopWindow.ets +++ b/commons/basic/src/main/ets/Views/HeroPopWindow.ets @@ -1,8 +1,9 @@ -import { hdHttp, HdResponse,BasicConstant, logger,RequestDefaultModel, Data } from '@itcast/basic' -import { promptAction } from '@kit.ArkUI' import HashMap from '@ohos.util.HashMap'; +import { promptAction } from '@kit.ArkUI' import { BusinessError } from '@kit.BasicServicesKit'; -import { authStore } from '@itcast/basic' +import { RequestDefaultModel } from '../models/RequestDefaultModel' +import { hdHttp, HdResponse } from '../utils/request' +import { BasicConstant } from '../constants/BasicConstant' interface DefaultData { diff --git a/features/mypage/src/main/ets/view/OfficeSelectedSheet.ets b/commons/basic/src/main/ets/Views/OfficeSelectedSheet.ets similarity index 87% rename from features/mypage/src/main/ets/view/OfficeSelectedSheet.ets rename to commons/basic/src/main/ets/Views/OfficeSelectedSheet.ets index ff9d777..c9852ca 100644 --- a/features/mypage/src/main/ets/view/OfficeSelectedSheet.ets +++ b/commons/basic/src/main/ets/Views/OfficeSelectedSheet.ets @@ -1,8 +1,10 @@ -import { hdHttp, HdResponse,BasicConstant, logger,RequestDefaultModel, Data } from '@itcast/basic' +import { BasicConstant } from '../constants/BasicConstant' +import { RequestDefaultModel } from '../models/RequestDefaultModel' import { promptAction } from '@kit.ArkUI' import HashMap from '@ohos.util.HashMap'; import { BusinessError } from '@kit.BasicServicesKit'; -import { authStore } from '@itcast/basic' +import { authStore } from '../utils/auth' +import { hdHttp, HdResponse } from '../utils/request' interface DefaultData { 'officeName':string; @@ -48,6 +50,10 @@ export struct OfficeSelectedSheet { if (name == authStore.getUser().officeName) { this.selectedIndex = index; this.selectedModel = {officeName:name,officeUuid:officeObject.officeUuid} + } else { + const defaultModel = this.officeArr[0] as DefaultData; + this.selectedIndex = 0; + this.selectedModel = {officeName:defaultModel.officeName,officeUuid:defaultModel.officeUuid}; } } } else { @@ -93,6 +99,7 @@ export struct OfficeSelectedSheet { range:this.officeNameArr, selected:this.selectedIndex }) + .canLoop(false) .selectedTextStyle({ color: '#007AFF', font: { size: 20, weight: FontWeight.Medium } diff --git a/commons/basic/src/main/ets/Views/PerfactInputSheet.ets b/commons/basic/src/main/ets/Views/PerfactInputSheet.ets new file mode 100644 index 0000000..0cad328 --- /dev/null +++ b/commons/basic/src/main/ets/Views/PerfactInputSheet.ets @@ -0,0 +1,77 @@ +import { promptAction } from '@kit.ArkUI' + +@CustomDialog +export struct PerfactInputSheet { + controller:CustomDialogController; + + @Prop inputTitle:string = ''; + @Prop inputPlaceholder:string = '' + @State inputText:string = '' + + // 添加回调函数属性 + private inputCallBack: (input: string,title:string) => void = () => {}; + + // 修改构造函数 + constructor(controller: CustomDialogController, inputCallBack: (input: string,title:string) => void) { + super(); + this.controller = controller; + this.inputCallBack = inputCallBack; + } + + build() { + Column() { + // 操作按钮区域 + Row() { + Button('取消') + .layoutWeight(1) + .backgroundColor(Color.Transparent) + .fontColor($r('app.color.main_color')) + .backgroundColor('#EEEEEE') + .width('15%') + .fontSize(15) + .onClick(() => { + this.controller.close() + }) + + Text(this.inputTitle) + .width('65%') + .fontSize(15) + .fontColor('#333333') + .textAlign(TextAlign.Center) + + Button('确定') + .layoutWeight(1) + .fontSize(15) + .backgroundColor(Color.Transparent) + .fontColor($r('app.color.main_color')) + .backgroundColor('#EEEEEE') + .width('15%') + .onClick(() => { + if (this.inputText.length <= 0) { + promptAction.showToast({ message: '输入不能为空', duration: 1000 }) + return; + } + this.controller.close() + this.inputCallBack(this.inputText, this.inputTitle); + }) + } + .height(30) + + Row(){ + TextInput({ + placeholder: this.inputPlaceholder + }) + .height(50) + .fontColor(Color.Black) + .backgroundColor(Color.White) + .onChange((value: string) => { + this.inputText = value; + }) + } + .backgroundColor(Color.White) + } + .width('100%') + .height(100) + .backgroundColor('#EEEEEE') + } +} diff --git a/features/mypage/src/main/ets/view/PhotoActionSheet.ets b/commons/basic/src/main/ets/Views/PhotoActionSheet.ets similarity index 100% rename from features/mypage/src/main/ets/view/PhotoActionSheet.ets rename to commons/basic/src/main/ets/Views/PhotoActionSheet.ets diff --git a/features/mypage/src/main/ets/view/PositionSelectedSheet.ets b/commons/basic/src/main/ets/Views/PositionSelectedSheet.ets similarity index 87% rename from features/mypage/src/main/ets/view/PositionSelectedSheet.ets rename to commons/basic/src/main/ets/Views/PositionSelectedSheet.ets index 50c8ef7..de50d18 100644 --- a/features/mypage/src/main/ets/view/PositionSelectedSheet.ets +++ b/commons/basic/src/main/ets/Views/PositionSelectedSheet.ets @@ -1,8 +1,10 @@ -import { hdHttp, HdResponse,BasicConstant,RequestDefaultModel } from '@itcast/basic' +import { BasicConstant } from '../constants/BasicConstant' +import { RequestDefaultModel } from '../models/RequestDefaultModel' import { promptAction } from '@kit.ArkUI' import HashMap from '@ohos.util.HashMap'; import { BusinessError } from '@kit.BasicServicesKit'; -import { authStore } from '@itcast/basic' +import { authStore } from '../utils/auth' +import { hdHttp, HdResponse } from '../utils/request' interface DefaultData { 'name':string; @@ -47,7 +49,12 @@ export struct PositionSelectedSheet { const nameIndex = this.officeNameArr[index]; if (nameIndex == authStore.getUser().positionName) { this.selectedIndex = index; - this.selectedModel = {name:nameIndex,uuid:object.uuid} + this.selectedModel = {name:nameIndex,uuid:object.uuid}; + break; + } else { + const defaultModel = this.officeArr[0] as DefaultData; + this.selectedIndex = 0; + this.selectedModel = {name:defaultModel.name,uuid:defaultModel.uuid}; } } console.log('职称名称数组:', this.officeNameArr); @@ -95,6 +102,7 @@ export struct PositionSelectedSheet { range:this.officeNameArr, selected:this.selectedIndex }) + .canLoop(false) .selectedTextStyle({ color: '#007AFF', font: { size: 20, weight: FontWeight.Medium } diff --git a/commons/basic/src/main/ets/Views/SexSelectedSheet.ets b/commons/basic/src/main/ets/Views/SexSelectedSheet.ets new file mode 100644 index 0000000..3f94d36 --- /dev/null +++ b/commons/basic/src/main/ets/Views/SexSelectedSheet.ets @@ -0,0 +1,68 @@ +@CustomDialog +export struct SexSelectedSheet { + controller:CustomDialogController; + + @State sexNameArr:Array = ['男','女']; + @Prop selectedSex:number = 0; + + // 添加回调函数属性 + private sexSelected: (index: number) => void = () => {}; + + // 修改构造函数 + constructor(controller: CustomDialogController, sexSelected: (index: number) => void) { + super(); + this.controller = controller; + this.sexSelected = sexSelected; + } + + build() { + Column() { + // 操作按钮区域 + Row({space:70}) { + Button('取消') + .layoutWeight(1) + .backgroundColor(Color.Transparent) + .fontColor($r('app.color.main_color')) + .backgroundColor(Color.White) + .width(80) + .onClick(() => { + this.controller.close() + }) + + Text('请选择性别') + .fontSize(15) + .fontColor('#666666') + + Button('确定') + .layoutWeight(1) + .backgroundColor(Color.Transparent) + .fontColor($r('app.color.main_color')) + .backgroundColor(Color.White) + .width(80) + .onClick(() => { + this.controller.close() + this.sexSelected(this.selectedSex); + }) + } + .height(40) + + TextPicker({ + range:this.sexNameArr, + }) + .canLoop(false) + .selectedTextStyle({ + color: '#007AFF', + font: { size: 20, weight: FontWeight.Medium } + }) + .onChange((name: string | string[], index: number | number[]) => { + // 处理单列选择场景 + if (typeof index === "number") { + this.selectedSex = index; + } + }) + } + .width('100%') + .height(240) + .backgroundColor(Color.White) + } +} diff --git a/features/mypage/src/main/ets/view/SpecialitySelectedSheet.ets b/commons/basic/src/main/ets/Views/SpecialitySelectedSheet.ets similarity index 79% rename from features/mypage/src/main/ets/view/SpecialitySelectedSheet.ets rename to commons/basic/src/main/ets/Views/SpecialitySelectedSheet.ets index 3d61835..24c8091 100644 --- a/features/mypage/src/main/ets/view/SpecialitySelectedSheet.ets +++ b/commons/basic/src/main/ets/Views/SpecialitySelectedSheet.ets @@ -1,7 +1,9 @@ -import { hdHttp, HdResponse,BasicConstant,RequestDefaultModel } from '@itcast/basic' import HashMap from '@ohos.util.HashMap'; import { promptAction } from '@kit.ArkUI' import { BusinessError } from '@kit.BasicServicesKit'; +import { RequestDefaultModel } from '../models/RequestDefaultModel' +import { hdHttp, HdResponse } from '../utils/request' +import { BasicConstant } from '../constants/BasicConstant' interface DefaultData { 'name':string; @@ -13,13 +15,13 @@ export struct SpecialitySelectedSheet { controller: CustomDialogController; @State specialityArr:Array = []; - @State specialityNameArr:Array = []; + @State selectedNames: Array = []; @State selectedTags: Array = []; // 添加回调函数属性 - private specialitySelected: (seletedTags:string) => void = () => {}; + private specialitySelected: (seletedTags:string,selectedNames:string) => void = () => {}; // 修改构造函数 - constructor(controller: CustomDialogController, specialitySelected: (seletedTags:string) => void) { + constructor(controller: CustomDialogController, specialitySelected: (seletedTags:string,selectedNames:string) => void) { super(); this.controller = controller; this.specialitySelected = specialitySelected; @@ -36,7 +38,6 @@ export struct SpecialitySelectedSheet { let json:RequestDefaultModel = JSON.parse(res+'') as RequestDefaultModel; if(json.code=='1') { this.specialityArr = json.data as DefaultData[]; - this.specialityNameArr = json.data.map(item => item.name); console.log('请求专长接口成功,信息:', this.specialityArr); } else { console.error('请求专长接口失败:'+json.message) @@ -74,9 +75,11 @@ export struct SpecialitySelectedSheet { .onClick(() => { this.controller.close() // 拼接为逗号分隔字符串 - const diseaseName = this.selectedTags.join(','); - console.log('当前选中标签的uuid字符串:', diseaseName); - this.specialitySelected(diseaseName); + const diseaseUuid = this.selectedTags.join(','); + const diseaseName = this.selectedNames.join(','); + console.log('当前选中标签的uuid字符串:', diseaseUuid); + console.log('当前选中标签的name字符串:', diseaseName); + this.specialitySelected(diseaseUuid,diseaseName); }) } .height(40) @@ -92,7 +95,7 @@ export struct SpecialitySelectedSheet { .textAlign(TextAlign.Center) .backgroundColor(this.isSelected(data.uuid) ? '#b58078' : '#FFFFFF') .onClick(() => { - this.handleTagClick(data.uuid) + this.handleTagClick(data.uuid,data.name) }) } .height(30) @@ -112,7 +115,7 @@ export struct SpecialitySelectedSheet { return this.selectedTags.includes(uuid) } - private handleTagClick(uuid: string) { + private handleTagClick(uuid: string,name:string) { const index = this.selectedTags.indexOf(uuid); if (index === -1) { // 添加选中(限制最多10个) @@ -121,11 +124,16 @@ export struct SpecialitySelectedSheet { return; } this.selectedTags = [...this.selectedTags, uuid]; + this.selectedNames = [...this.selectedNames,name]; } else { // 取消选中 const newSelected = [...this.selectedTags]; newSelected.splice(index, 1); this.selectedTags = newSelected; + + const nameSelected = [...this.selectedNames]; + nameSelected.splice(index, 1); + this.selectedNames = nameSelected; } console.log('当前选中标签:', this.selectedTags) } diff --git a/commons/basic/src/main/ets/components/HdNav.ets b/commons/basic/src/main/ets/components/HdNav.ets index 7984385..4fd0a8b 100644 --- a/commons/basic/src/main/ets/components/HdNav.ets +++ b/commons/basic/src/main/ets/components/HdNav.ets @@ -1,4 +1,5 @@ import { router } from '@kit.ArkUI' +import { emitter } from '@kit.BasicServicesKit' @Builder function defaultBuilder(): void { @@ -34,23 +35,30 @@ export struct HdNav { @BuilderParam menuBuilder: () => void = defaultBuilder + // 添加右侧点击处理 + private onRightItemClick() { + emitter.emit({ + eventId: 250516, + priority: emitter.EventPriority.HIGH + }) + } + build() { - Row({ space: 16 }) { + Row() { if (this.showLeftIcon) { Image(this.leftIcon) .size({ width: 24, height: 24 }) .margin({left:-5}) .onClick(() => router.back()) .fillColor($r('app.color.black')) - } - else { + } else { Blank() .width(24) } Row() { if (this.title) { Text(this.title) - .fontWeight(600) + // .fontWeight(600) .layoutWeight(1) .textAlign(TextAlign.Center) .fontSize(20) @@ -62,6 +70,7 @@ export struct HdNav { } } .height(56) + .width(150) .layoutWeight(1) if (this.showRightIcon) { @@ -69,14 +78,14 @@ export struct HdNav { .size({ width: 24, height: 24 }) .objectFit(ImageFit.Contain) .bindMenu(this.menuBuilder) - } else if (this.showRightText) - { + .onClick(()=>this.onRightItemClick()) + } else if (this.showRightText) { Text(this.rightText) .fontSize(16) .fontColor(this.textColor) - .margin({right:10}) - } - else { + .onClick(()=>this.onRightItemClick()) + // .margin({right:10}) + } else { Blank() .width(24) } @@ -85,6 +94,5 @@ export struct HdNav { .height(56 + this.topHeight) .width('100%') .backgroundColor(this.bgColor) - } } \ No newline at end of file diff --git a/commons/basic/src/main/ets/models/RequestDefaultModel.ets b/commons/basic/src/main/ets/models/RequestDefaultModel.ets index f8a7c1f..6089d57 100644 --- a/commons/basic/src/main/ets/models/RequestDefaultModel.ets +++ b/commons/basic/src/main/ets/models/RequestDefaultModel.ets @@ -50,4 +50,6 @@ export interface ExpertData{ state:number; realName:string; specialy:Array; + diseaseName:string; + diseaseUuid:string; } \ No newline at end of file diff --git a/features/mypage/src/main/ets/util/DateUtils.ets b/commons/basic/src/main/ets/utils/DateUtils.ets similarity index 100% rename from features/mypage/src/main/ets/util/DateUtils.ets rename to commons/basic/src/main/ets/utils/DateUtils.ets diff --git a/commons/basic/src/main/ets/utils/PerfactAuth.ets b/commons/basic/src/main/ets/utils/PerfactAuth.ets new file mode 100644 index 0000000..bafa1ca --- /dev/null +++ b/commons/basic/src/main/ets/utils/PerfactAuth.ets @@ -0,0 +1,44 @@ +import { preferences } from '@kit.ArkData' +import { ExpertData } from '../models/RequestDefaultModel' + +export const AUTH_STORE_KEY = 'perfactAuth' + +class PerfactAuth { + store: preferences.Preferences | null = null + + getStore() { + if (!this.store) { + this.store = preferences.getPreferencesSync(getContext(), { name: AUTH_STORE_KEY }) + } + return this.store + } + + async setUser(phone:string,user: ExpertData) { + AppStorage.setOrCreate(phone, user) + await this.getStore().put(phone, JSON.stringify(user)) + await this.getStore().flush() + } + + async updateUser(phone:string,user: ExpertData) { + AppStorage.setOrCreate(phone, user) + await this.getStore().put(phone, JSON.stringify(user)) + await this.getStore().flush() + } + + async delUser(phone:string) { + AppStorage.setOrCreate(phone, {}) + await this.getStore().put(phone, '{}') + await this.getStore().flush() + } + + initUser() { + const json = this.getStore().getSync(AUTH_STORE_KEY, '{}') as string + AppStorage.setOrCreate(AUTH_STORE_KEY, JSON.parse(json)) + } + + getUser(phone:string) { + return AppStorage.get(phone) || {} as ExpertData + } +} + +export const perfactAuth = new PerfactAuth() \ No newline at end of file diff --git a/commons/basic/src/main/ets/utils/auth.ets b/commons/basic/src/main/ets/utils/auth.ets index a2816ac..6b3135f 100644 --- a/commons/basic/src/main/ets/utils/auth.ets +++ b/commons/basic/src/main/ets/utils/auth.ets @@ -2,6 +2,7 @@ import { preferences } from '@kit.ArkData' import { router } from '@kit.ArkUI' import { Data } from '../models/LoginInfoModel' import { ExpertData } from '../models/RequestDefaultModel' +import { BusinessError } from '@kit.BasicServicesKit' export interface HdUser { id: string @@ -38,6 +39,18 @@ class AuthStore { await this.getStore().flush() } + async setPerfactUser(mobile:string,user:ExpertData) { + AppStorage.setOrCreate('mobile', mobile) + await this.getStore().put(mobile, JSON.stringify(user)) + await this.getStore().flush((err:BusinessError)=>{ + if (err) { + console.error('保存失败',err.code,err.message) + } else { + console.info('保存成功',JSON.stringify(user)) + } + }) + } + async delUser() { AppStorage.setOrCreate('user', {}) await this.getStore().put(AUTH_STORE_KEY, '{}') @@ -53,6 +66,10 @@ class AuthStore { return AppStorage.get('user') || {} as Data } + getPerfactUser(phone:string) { + return AppStorage.get(phone) || {} as ExpertData + } + checkAuth(options: router.RouterOptions | Function) { // if (this.getUser().token) { // if (typeof options === 'function') { diff --git a/commons/basic/src/main/ets/utils/request.ets b/commons/basic/src/main/ets/utils/request.ets index c20b78b..3a036ac 100644 --- a/commons/basic/src/main/ets/utils/request.ets +++ b/commons/basic/src/main/ets/utils/request.ets @@ -150,7 +150,7 @@ class HdHttp { logger.info('Response httpReq:' + data.result); let json:TimestampBean = JSON.parse(data.result.toString()) as TimestampBean; let tp = json.timestamp; - datas.set("user_uuid", authStore.getUser().uuid?authStore.getUser().uuid:''); + datas.set("user_uuid", authStore.getUser().uuid?authStore.getUser().uuid:'5kO57cuAL8seXQpxgtc'); datas.set("client_type", 'A'); datas.set("version",'4.0.0' ); datas.set('timestamp',tp+''); diff --git a/features/mypage/src/main/resources/base/media/heroPop_bg.png b/commons/basic/src/main/resources/base/media/heroPop_bg.png similarity index 100% rename from features/mypage/src/main/resources/base/media/heroPop_bg.png rename to commons/basic/src/main/resources/base/media/heroPop_bg.png diff --git a/features/mypage/src/main/resources/base/media/heroPop_headericon.png b/commons/basic/src/main/resources/base/media/heroPop_headericon.png similarity index 100% rename from features/mypage/src/main/resources/base/media/heroPop_headericon.png rename to commons/basic/src/main/resources/base/media/heroPop_headericon.png diff --git a/features/mypage/src/main/resources/base/media/heropop_delete.png b/commons/basic/src/main/resources/base/media/heropop_delete.png similarity index 100% rename from features/mypage/src/main/resources/base/media/heropop_delete.png rename to commons/basic/src/main/resources/base/media/heropop_delete.png diff --git a/features/mypage/src/main/resources/base/media/icon_camera.png b/commons/basic/src/main/resources/base/media/icon_camera.png similarity index 100% rename from features/mypage/src/main/resources/base/media/icon_camera.png rename to commons/basic/src/main/resources/base/media/icon_camera.png diff --git a/features/register/src/main/resources/base/media/icon_touxiang_persion_ws.png b/commons/basic/src/main/resources/base/media/icon_touxiang_persion_ws.png similarity index 100% rename from features/register/src/main/resources/base/media/icon_touxiang_persion_ws.png rename to commons/basic/src/main/resources/base/media/icon_touxiang_persion_ws.png diff --git a/commons/basic/src/main/resources/base/media/icon_xiongpai_ws.png b/commons/basic/src/main/resources/base/media/icon_xiongpai_ws.png new file mode 100644 index 0000000000000000000000000000000000000000..278f990637d817a21775b036e618728fd8ddaa38 GIT binary patch literal 4533 zcmaJ_c{o(<-yi$FB$d4}mXK|%V=~rZY$MtCb%wEw88d^Ks4QhISxTB@Ns-hbvKK;# zY-NbDWyvn2q#J;I@aW z*WsoaYxCoO>oJn>#e^R6m0Sz!j;e63RbF5DQ+7|7DqJ(v$bpZe-$v}H& zk~7i@>W9NB`~1czldP4WSfu_2*EC>aL&OBZ@*|2|d$0sn%Kf?=Tl z1m%ph0UF~7XrQLDrjnm3SOci7qYTyrYe2w?Ks8mcx{9j03RqnUtOixpfr2%Ge_xP-)D~{~x39w;41^((@K6<%$jC_LNOff#AwUJJqobpus-~i*rgVrpB-x_>8}I)qOth!q(JHoRA}*ZZci1?8so$>fP-6nxhlC^8<8UE=s%V43 zk#Ix|4i7Xo2Ff`FhN5thMESqqNF>xelt}Uk^+TJ(VW2|+<-kA`R7X=&)!0N+2LjfC zgTW@+I+{9K5Qw3+5d^NGW~^@fhYQE~g=5j7q(5BLf4PSL%KbeFSp1=9IGPX`fkv4U za9H498AAjAJr?bM)%%-^`uA8M|H@T43`XU5U;kI1{~R3-&u{aesXg5MGxzAw!(k^J zPPK^q+5!N;t6&Z{v?q_PxKZ$;!{QTB&l($KEVIK$!*U_7l8K|S($cY+%+w<3Sla?I z7$&CB24mS{^F6+Xdw{q4L7SE9SYNt-4&xPq9nDDewX|f~CuvBlldtIRkkS*{u;(wB zJeWC`*&o%pNPhCAYv}y*^|#;lE>3=%P^aH)-6*GC4H!hXv;#;%1qjgsM91?G`XWHE(dTV!Rhfg4!bBiKGX11YK(C<;}v3 zmCrWH8VV+DwjkQ98X(0p`YQP7h2xKgNS)8=9X-{Ux{w?BG17%?C#HA0j9d3_xGe?iD1hwIfB<8?dH;g znLE;1ncNwG;>IX$aiE~nbY4^^>}vPDxu{VXRwDW2I}yTckOb2VFwYVGzi#{26S@~VCT5AVf$!FIgj zNGbQVkdbL7zDYI#fNMdpmjQdqDWMf>xrP@D`5^fpxs4asavCdw_dYcg%t(g^wcheQ zvbXet>7F7`=bA21dU~vL)r#WdkDAN2VH@Sr_BLCVuE2FG_BS8BaiWJb3Ai59 zAirFtVO&6|rCA45R??OSxf{-3^5HXkamXbc6k>2k$%{@hkYd70od3py6g2d`qM$-B zPw~%l;qy4in!j*QzZdaxr=DxY(s60f?0vFbsDr;tjHz|%fO|8)n|Ci1YC}wP1LKPt zBj9@E$rlA^dTr<{PPJmW$HS&vvf}lK`6?cR?CGef8Ov7iQu63KQ?_cmw^MDpJi&Oe zDZ3$1tEx9XEJapMAQ}u{o*$Ticx{Y)AHn*6kWdl>J=PKgvNI0s>V`dSi_be&W|ewt zX?g%|U}sHA@61B$NX^L9YNdTHPIb1~A*1^ynqYU}-=F&RIdPTkOzpr_{{c;rk64vr=vP%wj`bFvuWIq z$Hm6#jaL?DazptGY=hGzMtgKTzUtSBs@g=9}!+;5dmF=TmhLdv5?AK3#|#lDL3u1ri>upU%Vi8b0hvvy>%ookn@#P|4#>A zUVz5!oti08l`5@HAq~}#2Xfsvdz9Pn>rRsvOWO9#UN5owa0_-gKmI|+wF0^BjqVS?D(|jyY@N{5-;is+(z^jP6HqYq=)Zzsx)m}j zdPkKyD6`mxxG1^vH4bM~jJ34Ri`QhWB#GBPC9@+P3}RZCxAuej zHy!vz(q3%bXkByP-a?q&Iz2MHJ4i>gU*F?S?;(>l|kw;8IH~v%32umiok=Q=O8(s2BBBEp>Ml2M>R#A~!9{=^O13Y@8;)$=h~3^ z_kUhg%y?&-z^@$eFiDn4+}`H6=)z_@Z?$+2qQeEe0ih~#c{W#3l1m%1BcoDSx{NU` zg!k%0*ZY_wQv!S3J5kH?kqa*=uu6dXkz}v?W}h0vhm5tgb+@NqZMhi#mgV_paWVz_Z$0) z{W~*{VZtRv5?XY0rZGW9b|l#44p(Vz#vIwx!5BYxf7(F*+J?-HkN^b!)72btLaGBYA{_A5t0(0jXw7I?;2 zA_Et>(@_Z~*WBarF@E(;$GJXf#ET-?HQBcZIuvXC_N34*sU|5A$*&Vl*)#7eIerMz zm-Q5k?XAu+YUJ11{~lq*v8tf>#)?VHXXLCMEE?fdlB$O!<%{Y}p-%3Tb?NKsJ# zURh6@h+I5oL9Sk}KeaVjG3ew`PeOklzGN^D5V#%WPs#SWtgbO%@lF3Lyd$n-#{fCG z)7fezAm_<{^R&~Q`P?kbVQ3q#O*%oho#XPpqlk-;VZS8y;XM)Zf@gMhxQp>ZDm}D63V*rY}6Lf&?KtN^=wUJ zq_0L>%Y<*GL&*OTk&WEvJWX#T7S*+`krX|qF&Jp|*Xahgb@;k$7IWK_;IUN<8&Xo3 zu3JPSe06$|m*)<#8X!qZh?2huKU9>tn>}-ce5-6*fVaeEt|;a7y~o4Z*G)K5;y8I$ z$pQ1)w8(Pj;peM-w2mHNtC(9$&XA7fh|lN^V3)4~z2WruTbUBuHWfX~JH2TvO3WQM zA{0&}LHsJOxJ5?j;>$BF(wmOFdi8_x>j?Heaq@bwmPg>7TKpu_w-y=mB6-*VUo_mp z$~K0oY{?(__SbX%$f&$g>e8|ymk;_$Y4XzNhLq1z&FxRWjglMXyT z!y)F32=Xm9vm4hFfaTizEBmk3Crw1i!YGHSqjwWGr)@T#I3*tZDyGb@G%VxtzB~~X z=W^pLl}?yn$~t_Ff3$QgcxKlM-!d9TJGle}#0&YHQm#E~zQ)gNo$)1p&sWGlzqVq2 zTzjq&8kK+X-k0orZ&N8aQAw9GS7hRgY&S=BIkbAOIlf$1g=LRe)OMr8k)0J0*}UNT z^n-W#0LmogG9T_jj^NeOKHl|5&pvNH_L<7>f2)Ns`Sf!(LwU-3-mEtBjRAx2oN^h* z;N6w3fn3p0rZn!ReGrwk7hQN=?!5*}N;k)1te#y#&CdLIRLy=``6kPY2otSQM40<3 z+9`vU@;zAPc5pzc?S$)OS7VvMdC|~1o(AX1nochBZGHZ=t?XrLP_S#e%Svu%DjX`2 z=#gSGuElrY=crNCIs%%8j*4n8`q&|! z;Ar{FJ-97e=9XpcYM7$i;zv?=1gaw4q7^cId7>G&elT9Mk$0EbDaS@Bh$YxA^I z2Pn>70G)kbq^DQsSGjIkJR7Y0)g$><@j87ODMv+5&ZJq829fXa` z!sj*|jhRx`#-?*>`K2R1dzGK#p9_BuENZ zdL-&DcwrviWf`%T>87hXr66FZRbHDI2Wc2>MpK^EKNc4M3Ep;18zH*5tH$E!nH;&r zVF`nqEmAzlUor1lBwE{A3dIZtJBL`KR|1bHy-Sz2PM1SrL>OoycN21}m1Vh)DU`OsARv*cQ#>h1n6IESo9VzJ|o z6C&HG9T!R;WX7hpWZ6caUWd) Q{{17x+{7AAGxCo6A6FX`00000 literal 0 HcmV?d00001 diff --git a/features/mypage/src/main/resources/base/media/ixon_album.png b/commons/basic/src/main/resources/base/media/ixon_album.png similarity index 100% rename from features/mypage/src/main/resources/base/media/ixon_album.png rename to commons/basic/src/main/resources/base/media/ixon_album.png diff --git a/features/mypage/src/main/resources/base/media/userPhoto_default.png b/commons/basic/src/main/resources/base/media/userPhoto_default.png similarity index 100% rename from features/mypage/src/main/resources/base/media/userPhoto_default.png rename to commons/basic/src/main/resources/base/media/userPhoto_default.png diff --git a/commons/uicomponents/.gitignore b/commons/uicomponents/.gitignore deleted file mode 100644 index e2713a2..0000000 --- a/commons/uicomponents/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/commons/uicomponents/Index.ets b/commons/uicomponents/Index.ets deleted file mode 100644 index 42bf416..0000000 --- a/commons/uicomponents/Index.ets +++ /dev/null @@ -1 +0,0 @@ -export { MainPage } from './src/main/ets/components/MainPage'; diff --git a/commons/uicomponents/build-profile.json5 b/commons/uicomponents/build-profile.json5 deleted file mode 100644 index e6773f9..0000000 --- a/commons/uicomponents/build-profile.json5 +++ /dev/null @@ -1,31 +0,0 @@ -{ - "apiType": "stageMode", - "buildOption": { - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - }, - "consumerFiles": [ - "./consumer-rules.txt" - ] - } - }, - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest" - } - ] -} diff --git a/commons/uicomponents/consumer-rules.txt b/commons/uicomponents/consumer-rules.txt deleted file mode 100644 index e69de29..0000000 diff --git a/commons/uicomponents/hvigorfile.ts b/commons/uicomponents/hvigorfile.ts deleted file mode 100644 index 4218707..0000000 --- a/commons/uicomponents/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { harTasks } from '@ohos/hvigor-ohos-plugin'; - -export default { - system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ - plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ -} diff --git a/commons/uicomponents/obfuscation-rules.txt b/commons/uicomponents/obfuscation-rules.txt deleted file mode 100644 index 272efb6..0000000 --- a/commons/uicomponents/obfuscation-rules.txt +++ /dev/null @@ -1,23 +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://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5 - -# 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 - --enable-property-obfuscation --enable-toplevel-obfuscation --enable-filename-obfuscation --enable-export-obfuscation \ No newline at end of file diff --git a/commons/uicomponents/oh-package.json5 b/commons/uicomponents/oh-package.json5 deleted file mode 100644 index ba99f3b..0000000 --- a/commons/uicomponents/oh-package.json5 +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "uicomponents", - "version": "1.0.0", - "description": "Please describe the basic information.", - "main": "Index.ets", - "author": "", - "license": "Apache-2.0", - "dependencies": {} -} diff --git a/commons/uicomponents/src/main/ets/components/MainPage.ets b/commons/uicomponents/src/main/ets/components/MainPage.ets deleted file mode 100644 index 9de5eb3..0000000 --- a/commons/uicomponents/src/main/ets/components/MainPage.ets +++ /dev/null @@ -1,19 +0,0 @@ -@Component -export struct MainPage { - @State message: string = 'Hello World'; - - build() { - Row() { - Column() { - Text(this.message) - .fontSize($r('app.float.page_text_font_size')) - .fontWeight(FontWeight.Bold) - .onClick(() => { - this.message = 'Welcome'; - }) - } - .width('100%') - } - .height('100%') - } -} diff --git a/commons/uicomponents/src/main/module.json5 b/commons/uicomponents/src/main/module.json5 deleted file mode 100644 index 7a1010d..0000000 --- a/commons/uicomponents/src/main/module.json5 +++ /dev/null @@ -1,11 +0,0 @@ -{ - "module": { - "name": "uicomponents", - "type": "har", - "deviceTypes": [ - "default", - "tablet", - "2in1" - ] - } -} diff --git a/commons/uicomponents/src/main/resources/base/element/float.json b/commons/uicomponents/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea223..0000000 --- a/commons/uicomponents/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/commons/uicomponents/src/main/resources/base/element/string.json b/commons/uicomponents/src/main/resources/base/element/string.json deleted file mode 100644 index f51a9c8..0000000 --- a/commons/uicomponents/src/main/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "page_show", - "value": "page from package" - } - ] -} diff --git a/commons/uicomponents/src/ohosTest/ets/test/Ability.test.ets b/commons/uicomponents/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 85c78f6..0000000 --- a/commons/uicomponents/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/commons/uicomponents/src/ohosTest/ets/test/List.test.ets b/commons/uicomponents/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 794c7dc..0000000 --- a/commons/uicomponents/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/commons/uicomponents/src/ohosTest/module.json5 b/commons/uicomponents/src/ohosTest/module.json5 deleted file mode 100644 index 0e061dc..0000000 --- a/commons/uicomponents/src/ohosTest/module.json5 +++ /dev/null @@ -1,13 +0,0 @@ -{ - "module": { - "name": "uicomponents_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet", - "2in1" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/commons/uicomponents/src/test/List.test.ets b/commons/uicomponents/src/test/List.test.ets deleted file mode 100644 index bb5b5c3..0000000 --- a/commons/uicomponents/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/commons/uicomponents/src/test/LocalUnit.test.ets b/commons/uicomponents/src/test/LocalUnit.test.ets deleted file mode 100644 index 165fc16..0000000 --- a/commons/uicomponents/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 diff --git a/commons/utils/.gitignore b/commons/utils/.gitignore deleted file mode 100644 index e2713a2..0000000 --- a/commons/utils/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/node_modules -/oh_modules -/.preview -/build -/.cxx -/.test \ No newline at end of file diff --git a/commons/utils/BuildProfile.ets b/commons/utils/BuildProfile.ets deleted file mode 100644 index 3a501e5..0000000 --- a/commons/utils/BuildProfile.ets +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Use these variables when you tailor your ArkTS code. They must be of the const type. - */ -export const HAR_VERSION = '1.0.0'; -export const BUILD_MODE_NAME = 'debug'; -export const DEBUG = true; -export const TARGET_NAME = 'default'; - -/** - * BuildProfile Class is used only for compatibility purposes. - */ -export default class BuildProfile { - static readonly HAR_VERSION = HAR_VERSION; - static readonly BUILD_MODE_NAME = BUILD_MODE_NAME; - static readonly DEBUG = DEBUG; - static readonly TARGET_NAME = TARGET_NAME; -} \ No newline at end of file diff --git a/commons/utils/Index.ets b/commons/utils/Index.ets deleted file mode 100644 index e2e89d9..0000000 --- a/commons/utils/Index.ets +++ /dev/null @@ -1,4 +0,0 @@ -export { logger } from './src/main/ets/request/logger' -export { Base64Util } from './src/main/ets/request/Base64Util' -export { HdResponse } from './src/main/ets/request/request' -export { ChangeUtil } from './src/main/ets/request/ChangeUtil' diff --git a/commons/utils/build-profile.json5 b/commons/utils/build-profile.json5 deleted file mode 100644 index e6773f9..0000000 --- a/commons/utils/build-profile.json5 +++ /dev/null @@ -1,31 +0,0 @@ -{ - "apiType": "stageMode", - "buildOption": { - }, - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - }, - "consumerFiles": [ - "./consumer-rules.txt" - ] - } - }, - }, - ], - "targets": [ - { - "name": "default" - }, - { - "name": "ohosTest" - } - ] -} diff --git a/commons/utils/consumer-rules.txt b/commons/utils/consumer-rules.txt deleted file mode 100644 index e69de29..0000000 diff --git a/commons/utils/hvigorfile.ts b/commons/utils/hvigorfile.ts deleted file mode 100644 index 4218707..0000000 --- a/commons/utils/hvigorfile.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { harTasks } from '@ohos/hvigor-ohos-plugin'; - -export default { - system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ - plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ -} diff --git a/commons/utils/obfuscation-rules.txt b/commons/utils/obfuscation-rules.txt deleted file mode 100644 index 272efb6..0000000 --- a/commons/utils/obfuscation-rules.txt +++ /dev/null @@ -1,23 +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://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5 - -# 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 - --enable-property-obfuscation --enable-toplevel-obfuscation --enable-filename-obfuscation --enable-export-obfuscation \ No newline at end of file diff --git a/commons/utils/oh-package-lock.json5 b/commons/utils/oh-package-lock.json5 deleted file mode 100644 index 47887dd..0000000 --- a/commons/utils/oh-package-lock.json5 +++ /dev/null @@ -1,19 +0,0 @@ -{ - "meta": { - "stableOrder": true - }, - "lockfileVersion": 3, - "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", - "specifiers": { - "@ohos/crypto-js@^2.0.4": "@ohos/crypto-js@2.0.4" - }, - "packages": { - "@ohos/crypto-js@2.0.4": { - "name": "@ohos/crypto-js", - "version": "2.0.4", - "integrity": "sha512-589ur6oqU1UNibqefMly2cwEeEhkSoCAA3uc+oNUwRnYYtevn/kQnO+Coi36N+VJSeeg/uFzZk1K/wUMdovpOA==", - "resolved": "https://repo.harmonyos.com/ohpm/@ohos/crypto-js/-/crypto-js-2.0.4.har", - "registryType": "ohpm" - } - } -} \ No newline at end of file diff --git a/commons/utils/oh-package.json5 b/commons/utils/oh-package.json5 deleted file mode 100644 index 38e98ed..0000000 --- a/commons/utils/oh-package.json5 +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "utils", - "version": "1.0.0", - "description": "Please describe the basic information.", - "main": "Index.ets", - "author": "", - "license": "Apache-2.0", - "dependencies": { - "@ohos/crypto-js": "^2.0.4" - }, - "devDependencies": {}, - "dynamicDependencies": {} -} \ No newline at end of file diff --git a/commons/utils/src/main/ets/request/Base64Util.ets b/commons/utils/src/main/ets/request/Base64Util.ets deleted file mode 100644 index e0fb889..0000000 --- a/commons/utils/src/main/ets/request/Base64Util.ets +++ /dev/null @@ -1,84 +0,0 @@ -import util from '@ohos.util'; - -import { buffer } from '@kit.ArkTS'; - -/** - * Base64 工具类 - * author: 鸿蒙布道师 - * since: 2025/03/31 - */ -export class Base64Util { - /** - * 创建 Base64Helper 实例 - * @returns Base64Helper 实例 - */ - private static createBase64Helper(): util.Base64Helper { - return new util.Base64Helper(); - } - - /** - * 编码为 Uint8Array(异步) - * @param array 输入的 Uint8Array 数据 - * @returns 编码后的 Uint8Array 对象 - */ - static encode(array: Uint8Array): Promise { - const base64 = Base64Util.createBase64Helper(); - return base64.encode(array); - } - - /** - * 编码为 Uint8Array(同步) - * @param array 输入的 Uint8Array 数据 - * @returns 编码后的 Uint8Array 对象 - */ - static encodeSync(array: Uint8Array): Uint8Array { - const base64 = Base64Util.createBase64Helper(); - return base64.encodeSync(array); - } - - /** - * 编码为字符串(异步) - * @param array 输入的 Uint8Array 数据 - * @param options 可选参数 - * @returns 编码后的字符串 - */ - static encodeToStr(array: Uint8Array, options?: util.Type): Promise { - const base64 = Base64Util.createBase64Helper(); - return base64.encodeToString(array, options); - } - - /** - * 编码为字符串(同步) - * @param array 输入的 Uint8Array 数据 - * @param options 可选参数 - * @returns 编码后的字符串 - */ - static encodeToStrSync(keyValueStr:string): string { - let array: Uint8Array=new Uint8Array(buffer.from(keyValueStr, 'utf-8').buffer) - const base64 = Base64Util.createBase64Helper(); - - return base64.encodeToStringSync(array, util.Type.BASIC).replaceAll("=", ""); - } - - /** - * 解码为 Uint8Array(异步) - * @param input 输入的 Uint8Array 或字符串 - * @param options 可选参数 - * @returns 解码后的 Uint8Array 对象 - */ - static decode(input: Uint8Array | string, options?: util.Type): Promise { - const base64 = Base64Util.createBase64Helper(); - return base64.decode(input, options); - } - - /** - * 解码为 Uint8Array(同步) - * @param input 输入的 Uint8Array 或字符串 - * @param options 可选参数 - * @returns 解码后的 Uint8Array 对象 - */ - static decodeSync(input: Uint8Array | string, options?: util.Type): Uint8Array { - const base64 = Base64Util.createBase64Helper(); - return base64.decodeSync(input, options); - } -} \ No newline at end of file diff --git a/commons/utils/src/main/ets/request/ChangeUtil.ets b/commons/utils/src/main/ets/request/ChangeUtil.ets deleted file mode 100644 index f75b932..0000000 --- a/commons/utils/src/main/ets/request/ChangeUtil.ets +++ /dev/null @@ -1,61 +0,0 @@ - -import HashMap from '@ohos.util.HashMap'; -import { Base64Util } from './Base64Util'; - - -export class ChangeUtil { - /** - * 将HashMap转成JsonString - * @param map - * @returns - */ - static map2Json(map:HashMap): string { - let jsonObject: Record = {}; - map.forEach((value, key) => { - if(key != undefined && value != undefined){ - jsonObject[key] = value; - } - }) - return JSON.stringify(jsonObject); - } - - static getSign(extraDatas1:HashMap): string { - let secret= extraDatas1.get("timestamp") - if(secret!=null) { - let keyValueStr: string = ""; - let entriesArray: Array = Array.from(extraDatas1.keys()); - entriesArray.sort(); - - let sortedMap:HashMap = new HashMap(); - entriesArray.forEach((value: string, index: number) => { - sortedMap.set(value,extraDatas1.get(value)); - keyValueStr +=value+extraDatas1.get(value) - }); - keyValueStr = keyValueStr.replace(" ", ""); - keyValueStr = keyValueStr + CryptoJS.MD5(secret).toString(); - let Md5keyValueStr: string = CryptoJS.MD5(keyValueStr).toString(); - let base64Str:string=Base64Util.encodeToStrSync(Md5keyValueStr); - return base64Str; - } - else - { - return ''; - } - - - } - - - static isMobileNum(mobiles:string): boolean { - const reg2: RegExp = new RegExp('^(1[3-9])[0-9]{9}$') - - return reg2.test(mobiles); -} - static isPassword(password:string): boolean { - const reg2: RegExp = new RegExp('^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$') - - return reg2.test(password); - } - - -} \ No newline at end of file diff --git a/commons/utils/src/main/ets/request/logger.ets b/commons/utils/src/main/ets/request/logger.ets deleted file mode 100644 index 7881389..0000000 --- a/commons/utils/src/main/ets/request/logger.ets +++ /dev/null @@ -1,33 +0,0 @@ -import hilog from '@ohos.hilog' - -const DOMAIN = 0xFF09 -const PREFIX = 'PASS_INTERVIEW_LOGGER' -const FORMAT = '%{public}s, %{public}s' - -class Logger { - debug(...args: string[]) { - hilog.debug(DOMAIN, PREFIX, FORMAT, args) - } - - info(...args: string[]) { - hilog.info(DOMAIN, PREFIX, FORMAT, args) - } - - warn(...args: string[]) { - hilog.warn(DOMAIN, PREFIX, FORMAT, args) - } - - error(...args: string[]) { - hilog.error(DOMAIN, PREFIX, FORMAT, args) - } - - fatal(...args: string[]) { - hilog.fatal(DOMAIN, PREFIX, FORMAT, args) - } - - isLoggable(level: hilog.LogLevel) { - hilog.isLoggable(DOMAIN, PREFIX, level) - } -} - -export const logger = new Logger() \ No newline at end of file diff --git a/commons/utils/src/main/ets/request/request.ets b/commons/utils/src/main/ets/request/request.ets deleted file mode 100644 index ff0970a..0000000 --- a/commons/utils/src/main/ets/request/request.ets +++ /dev/null @@ -1,288 +0,0 @@ -import { http } from '@kit.NetworkKit'; -import { promptAction, router } from '@kit.ArkUI'; -import { BusinessError } from '@ohos.base'; -import { HashMap } from '@kit.ArkTS'; -import { CryptoJS } from '@ohos/crypto-js' -import { Base64Util } from './Base64Util'; -import { ChangeUtil } from './ChangeUtil' -import { logger } from './logger' - -interface HdRequestOptions { - baseURL?: string -} - -type HdParams = Record - -export interface HdResponse { - code: number - message: string - data: T -} -export interface TimestampBean { - timestamp:string - - -} -class HdHttp { - baseURL: string - - constructor(options: HdRequestOptions) { - this.baseURL = options.baseURL || '' - } - - private request1(path: string, method: http.RequestMethod = http.RequestMethod.GET, extraDatas:HashMap) { - const httpInstance = http.createHttp() - let fullUrl = this.baseURL + path - let promise = httpInstance.request( - // 请求url地址 - fullUrl, - { - // 请求方式 - method: http.RequestMethod.POST, - // 可选,默认为60s - connectTimeout: 60000, - // 可选,默认为60s - readTimeout: 60000, - // 开发者根据自身业务需要添加header字段 - header: { - 'Content-Type': 'application/json', - 'sign':this.getSign(extraDatas) - }, - extraData:ChangeUtil.map2Json(extraDatas) - }); - logger.info('Response JSON.stringify(extraDatas)' + ChangeUtil.map2Json(extraDatas)) - return promise.then((data) => { - logger.info('Response request:' + data.result); - if (data.result) { - const result = data.result as HdResponse - logger.info('Response result:' + result); - return result - - } - return Promise.reject(data.result) - // if (data.responseCode === http.ResponseCode.OK) { - // console.info('Response request:' + data.result); - // - // } - // else - // { - // - // } - // return Promise.reject(data.result) - } - - ).catch((err:BusinessError) => { - logger.info('Response httpReq request:' + JSON.stringify(err)); - return Promise.reject(err) - - }).finally(() => { - httpInstance.destroy() - }) - - } - private request(path: string, method: http.RequestMethod = http.RequestMethod.POST, extraDatas :HashMap) { - const httpInstance = http.createHttp() - - const options: http.HttpRequestOptions = { - method: http.RequestMethod.POST, - // 可选,默认为60s - connectTimeout: 60000, - // 可选,默认为60s - readTimeout: 60000, - // 开发者根据自身业务需要添加header字段 - header: { - 'Content-Type': 'application/json', - 'sign':this.getSign(extraDatas) - }, - extraData:ChangeUtil.map2Json(extraDatas) - } - - let fullUrl = this.baseURL + path - - - return httpInstance.request(fullUrl, options).then((res) => { - logger.info('Response fullUrl:' +fullUrl+ res.result); - const result = res.result as HdResponse - return result - }).catch((err: BusinessError) => { - logger.info(fullUrl+`Response succeeded: ${err}`); - promptAction.showToast({ message: err.message || '网络错误' }) - return Promise.reject(err) - }).finally(() => { - httpInstance.destroy() - }) - } - - - private requestafter(path: string, method: http.RequestMethod = http.RequestMethod.GET, extraData?: Object) { - const httpInstance = http.createHttp() - - const options: http.HttpRequestOptions = { - method: http.RequestMethod.GET, - // 可选,默认为60s - connectTimeout: 60000, - // 可选,默认为60s - readTimeout: 60000, - // 开发者根据自身业务需要添加header字段 - header: { - 'Content-Type': 'application/json' - } - } - - let fullUrl = this.baseURL + path - if (method === http.RequestMethod.GET && extraData) { - const strArr = Object.keys(extraData) - .filter(key => (extraData as HdParams)[key] !== undefined) - .map(key => `${key}=${(extraData as HdParams)[key]}`) - fullUrl += `?${strArr.join('&')}` - } else { - options.extraData = extraData - } - - return httpInstance.request(fullUrl, options).then((res) => { - return Promise.reject(res.result) - }).catch((err: BusinessError) => { - logger.error(fullUrl+`Response succeeded: ${err}+${err.name}+${err.message}+${err.data}+${err.stack}`); - // logger.error(fullUrl, err.code?.toString(), err.message) - promptAction.showToast({ message: err.message || '网络错误' }) - return Promise.reject(err) - }).finally(() => { - httpInstance.destroy() - }) - } - - - get(url: string, data?: Object): Promise> { - return this.requestafter(url, http.RequestMethod.GET, data) - } - - post(url: string, data?: Object): Promise> { - return this.requestafter(url, http.RequestMethod.POST, data) - } - - put(url: string, data?: Object): Promise> { - return this.requestafter(url, http.RequestMethod.PUT, data) - } - - delete(url: string, data?: Object): Promise> { - return this.requestafter(url, http.RequestMethod.DELETE, data) - } - posts(url: string, data: HashMap): Promise> { - return this.request(url, http.RequestMethod.POST, data) - } - httpReq(url: string, datas: HashMap): Promise> { - - // 创建httpRequest对象。 - let httpRequest = http.createHttp(); - let url1 = "https://dev-app.igandan.com/app/manager/getSystemTimeStamp"; - let promise = httpRequest.request( - // 请求url地址 - url1, - { - // 请求方式 - method: http.RequestMethod.GET, - // 可选,默认为60s - connectTimeout: 60000, - // 可选,默认为60s - readTimeout: 60000, - // 开发者根据自身业务需要添加header字段 - header: { - 'Content-Type': 'application/json' - } - }); - // 处理响应结果。 - return promise.then((data) => { - if (data.responseCode === http.ResponseCode.OK) { - logger.info('Response httpReq:' + data.result); - let json:TimestampBean = JSON.parse(data.result.toString()) as TimestampBean; - let tp = json.timestamp; - datas.set("user_uuid", ''); - datas.set("client_type", 'A'); - datas.set("version",'4.0.0' ); - datas.set('timestamp',tp+''); - - return this.posts(url, datas); - } - else - { - return this.posts(url, datas); - } - } - - ).catch((err:BusinessError) => { - logger.info('Response httpReq error:' + JSON.stringify(err)); - return Promise.reject(err); - - }).finally(() => { - httpRequest.destroy() - }) - - } - httpReqSimply(url: string) { - - // 创建httpRequest对象。 - let httpRequest = http.createHttp(); - - let promise = httpRequest.request( - // 请求url地址 - url, - { - // 请求方式 - method: http.RequestMethod.POST, - // 可选,默认为60s - connectTimeout: 60000, - // 可选,默认为60s - readTimeout: 60000, - // 开发者根据自身业务需要添加header字段 - header: { - 'Content-Type': 'application/json' - } - }); - // 处理响应结果。 - return promise.then((data) => { - logger.info('Response httpReqSimply:' + JSON.stringify(data)); - const result = data.result as HdResponse - return result - } - - ).catch((err:BusinessError) => { - logger.info('Response httpReq error:' + JSON.stringify(err)); - return Promise.reject(err); - - }).finally(() => { - httpRequest.destroy() - }) - - } - getSign(extraDatas1:HashMap): string { - let secret= extraDatas1.get("timestamp") - if(secret!=null) { - let keyValueStr: string = ""; - let entriesArray: Array = Array.from(extraDatas1.keys()); - entriesArray.sort(); - - let sortedMap:HashMap = new HashMap(); - entriesArray.forEach((value: string, index: number) => { - sortedMap.set(value,extraDatas1.get(value)); - keyValueStr +=value+extraDatas1.get(value) - }); - keyValueStr = keyValueStr.replace(" ", ""); - keyValueStr = keyValueStr + CryptoJS.MD5(secret).toString(); - let Md5keyValueStr: string = CryptoJS.MD5(keyValueStr).toString(); - let base64Str:string=Base64Util.encodeToStrSync(Md5keyValueStr); - return base64Str; - } - else - { - return ''; - } - - -} -} - -export const hdHttp = new HdHttp({ baseURL: '' }) - - - - diff --git a/commons/utils/src/main/module.json5 b/commons/utils/src/main/module.json5 deleted file mode 100644 index 2355b2e..0000000 --- a/commons/utils/src/main/module.json5 +++ /dev/null @@ -1,11 +0,0 @@ -{ - "module": { - "name": "utils", - "type": "har", - "deviceTypes": [ - "default", - "tablet", - "2in1" - ] - } -} diff --git a/commons/utils/src/main/resources/base/element/float.json b/commons/utils/src/main/resources/base/element/float.json deleted file mode 100644 index 33ea223..0000000 --- a/commons/utils/src/main/resources/base/element/float.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "float": [ - { - "name": "page_text_font_size", - "value": "50fp" - } - ] -} diff --git a/commons/utils/src/main/resources/base/element/string.json b/commons/utils/src/main/resources/base/element/string.json deleted file mode 100644 index f51a9c8..0000000 --- a/commons/utils/src/main/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "page_show", - "value": "page from package" - } - ] -} diff --git a/commons/utils/src/ohosTest/ets/test/Ability.test.ets b/commons/utils/src/ohosTest/ets/test/Ability.test.ets deleted file mode 100644 index 85c78f6..0000000 --- a/commons/utils/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/commons/utils/src/ohosTest/ets/test/List.test.ets b/commons/utils/src/ohosTest/ets/test/List.test.ets deleted file mode 100644 index 794c7dc..0000000 --- a/commons/utils/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/commons/utils/src/ohosTest/module.json5 b/commons/utils/src/ohosTest/module.json5 deleted file mode 100644 index 5a67a48..0000000 --- a/commons/utils/src/ohosTest/module.json5 +++ /dev/null @@ -1,13 +0,0 @@ -{ - "module": { - "name": "utils_test", - "type": "feature", - "deviceTypes": [ - "default", - "tablet", - "2in1" - ], - "deliveryWithInstall": true, - "installationFree": false - } -} diff --git a/commons/utils/src/test/List.test.ets b/commons/utils/src/test/List.test.ets deleted file mode 100644 index bb5b5c3..0000000 --- a/commons/utils/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/commons/utils/src/test/LocalUnit.test.ets b/commons/utils/src/test/LocalUnit.test.ets deleted file mode 100644 index 165fc16..0000000 --- a/commons/utils/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 diff --git a/features/mypage/Index.ets b/features/mypage/Index.ets index 851a54d..cea36cf 100644 --- a/features/mypage/Index.ets +++ b/features/mypage/Index.ets @@ -1,15 +1,9 @@ export { MyHomePage } from './src/main/ets/pages/MyHomePage' - export { ChangePasswordComp } from './src/main/ets/view/ChangePasswordComp' - export { ForgetPasswordComp } from './src/main/ets/view/ForgetPasswordComp' - export { ChangePhoneComp } from './src/main/ets/view/ChangePhoneComp' - export { ChooseEmailComp } from './src/main/ets/view/ChooseEmailComp' - export { ChooseOfficePhoneComp } from './src/main/ets/view/ChooseOfficePhoneComp' - export { EditUserDataComp } from './src/main/ets/view/EditUserDataComp' - -export { SpecialitySelectedSheet } from './src/main/ets/view/SpecialitySelectedSheet' \ No newline at end of file +export { EditUserDataItem } from '@itcast/basic/src/main/ets/Views/EditUserDataItem' +export { SpecialitySelectedSheet } from '@itcast/basic/src/main/ets/Views/SpecialitySelectedSheet' \ No newline at end of file diff --git a/features/mypage/src/main/ets/view/EditUserDataComp.ets b/features/mypage/src/main/ets/view/EditUserDataComp.ets index 939e038..e7682a9 100644 --- a/features/mypage/src/main/ets/view/EditUserDataComp.ets +++ b/features/mypage/src/main/ets/view/EditUserDataComp.ets @@ -2,12 +2,12 @@ import { hdHttp, HdResponse,BasicConstant,ExpertData, authStore, ChangeUtil } f import HashMap from '@ohos.util.HashMap' import { BusinessError } from '@kit.BasicServicesKit'; import { promptAction, router } from '@kit.ArkUI' -import { EditUserDataItem } from './EditUserDataItem' -import { PhotoActionSheet } from './PhotoActionSheet' -import { DatePickerDialog } from './DatePickerDialog' -import { OfficeSelectedSheet } from './OfficeSelectedSheet' -import { PositionSelectedSheet } from './PositionSelectedSheet' -import { SpecialitySelectedSheet } from './SpecialitySelectedSheet' +import { EditUserDataItem } from '@itcast/basic/src/main/ets/Views/EditUserDataItem' +import { PhotoActionSheet } from '@itcast/basic/src/main/ets/Views/PhotoActionSheet' +import { DatePickerDialog } from '@itcast/basic/src/main/ets/Views//DatePickerDialog' +import { OfficeSelectedSheet } from '@itcast/basic/src/main/ets/Views//OfficeSelectedSheet' +import { PositionSelectedSheet } from '@itcast/basic/src/main/ets/Views//PositionSelectedSheet' +import { SpecialitySelectedSheet } from '@itcast/basic/src/main/ets/Views//SpecialitySelectedSheet' import { http } from '@kit.NetworkKit'; import { rcp } from '@kit.RemoteCommunicationKit'; interface extraData { diff --git a/features/mypage/src/main/ets/view/HeaderView.ets b/features/mypage/src/main/ets/view/HeaderView.ets index 8acc359..cf59696 100644 --- a/features/mypage/src/main/ets/view/HeaderView.ets +++ b/features/mypage/src/main/ets/view/HeaderView.ets @@ -1,6 +1,6 @@ import { hdHttp, HdResponse,BasicConstant,ExpertData, authStore,RequestDefaultModel } from '@itcast/basic' import { BusinessError } from '@kit.BasicServicesKit'; -import { HeroPopWindow } from '../view/HeroPopWindow' +import { HeroPopWindow } from '@itcast/basic/src/main/ets/Views/HeroPopWindow' import HashMap from '@ohos.util.HashMap' import { router } from '@kit.ArkUI' diff --git a/features/register/Index.ets b/features/register/Index.ets index e6d77b0..fadc18f 100644 --- a/features/register/Index.ets +++ b/features/register/Index.ets @@ -1,7 +1,7 @@ export { MainPage } from './src/main/ets/components/MainPage'; export { GuidePage } from './src/main/ets/view/GuidePage' export { LoginComp } from './src/main/ets/view/LoginComp' - export { WebHeightPage } from './src/main/ets/view/WebHeightPage' - export { LoginSetInfo } from './src/main/ets/view/LoginSetInfo' +export { PerfectUserDataComp } from './src/main/ets/view/PerfectUserDataComp' +export { SelectedHospitalComp } from './src/main/ets/view/SelectedHospitalComp' \ No newline at end of file diff --git a/features/register/oh-package-lock.json5 b/features/register/oh-package-lock.json5 index cc3bce5..e1df1ae 100644 --- a/features/register/oh-package-lock.json5 +++ b/features/register/oh-package-lock.json5 @@ -5,7 +5,8 @@ "lockfileVersion": 3, "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", "specifiers": { - "@itcast/basic@../../commons/basic": "@itcast/basic@../../commons/basic" + "@itcast/basic@../../commons/basic": "@itcast/basic@../../commons/basic", + "mypage@../mypage": "mypage@../mypage" }, "packages": { "@itcast/basic@../../commons/basic": { @@ -13,6 +14,15 @@ "version": "1.0.0", "resolved": "../../commons/basic", "registryType": "local" + }, + "mypage@../mypage": { + "name": "mypage", + "version": "1.0.0", + "resolved": "../mypage", + "registryType": "local", + "dependencies": { + "@itcast/basic": "file:../../commons/basic" + } } } } \ No newline at end of file diff --git a/features/register/oh-package.json5 b/features/register/oh-package.json5 index 8a8ca3f..7871989 100644 --- a/features/register/oh-package.json5 +++ b/features/register/oh-package.json5 @@ -6,6 +6,6 @@ "author": "", "license": "Apache-2.0", "dependencies": { - "@itcast/basic": "file:../../commons/basic" + "@itcast/basic": "file:../../commons/basic", } } diff --git a/features/register/src/main/ets/view/LoginComp.ets b/features/register/src/main/ets/view/LoginComp.ets index f5637ca..14f0c4b 100644 --- a/features/register/src/main/ets/view/LoginComp.ets +++ b/features/register/src/main/ets/view/LoginComp.ets @@ -41,18 +41,14 @@ export struct LoginComp { if (!ChangeUtil.isMobileNum(this.mobile)) { return promptAction.showToast({ message: "手机号码不正确" }) } - if(this.isPassLogin) - { - + if(this.isPassLogin) { if (!this.code) { return promptAction.showToast({ message: '密码不为空' }) } if (!ChangeUtil.isPassword(this.code)) { return promptAction.showToast({ message: "请输入6-16位字母、数字组合密码" }) } - } - else - { + } else { if (!this.current_code) { return promptAction.showToast({ message: '请输入验证码' }) } @@ -64,13 +60,10 @@ export struct LoginComp { this.loading = true this.hashMap.clear(); this.hashMap.set('mobile',this.mobile) - if(this.isPassLogin) - { + if(this.isPassLogin) { this.hashMap.set('password',this.code) this.loginUrl=BasicConstant.urlExpertAPI+'login' - } - else - { + } else { this.hashMap.set('sms',this.current_code) this.loginUrl=BasicConstant.urlExpertAPI+'umSmsLogin' } @@ -80,46 +73,39 @@ export struct LoginComp { logger.info('Response login'+res); console.info(`Response login succeeded: ${res}`); let json:LoginInfo = JSON.parse(res+'') as LoginInfo; - - if(json.code=='1') - { + if(json.code=='1') { this.getSaveUserInfor(1,json) - } - else - { + } else { promptAction.showToast({ message: json.message, duration: 1000 }) } - }).catch((err: BusinessError) => { this.loading = false console.info(`Response login fail: ${err}`); }) - } - getSaveUserInfor(type:number,objs:LoginInfo) - { - authStore.setUser(objs.data) - promptAction.showToast({ message: '登录成功', duration: 1000 }) - // emitter.emit({ eventId: 100401 }) + + getSaveUserInfor(type:number,objs:LoginInfo) { let state:number=objs.data.state - logger.info('Response state'+state); - if(state!=6) - { + if(state!=6) { router.pushUrl({ url: 'pages/LoginPage/LoginSetInfoPage', // 目标url + params: { + loginInputPhone:this.mobile + } }) - } - else - { + } else { + authStore.setUser(objs.data) + // emitter.emit({ eventId: 100401 }) + logger.info('Response state'+state); + promptAction.showToast({ message: '登录成功', duration: 1000 }) preferenceStore.setItemBoolean('isLogin',true) router.replaceUrl({ url: 'pages/Home', // 目标url }) } - } - getMessage() - { + + getMessage() { if (!this.mobile) { return promptAction.showToast({ message: '手机号码不为空' }) } diff --git a/features/register/src/main/ets/view/LoginSetInfo.ets b/features/register/src/main/ets/view/LoginSetInfo.ets index 2bd6da2..deff32d 100644 --- a/features/register/src/main/ets/view/LoginSetInfo.ets +++ b/features/register/src/main/ets/view/LoginSetInfo.ets @@ -5,11 +5,11 @@ import { ComponentContent } from '@kit.ArkUI'; @Component export struct LoginSetInfo{ scroller: Scroller = new Scroller(); - @State + @Prop realName:string='' - @State + @Prop officePhone:string='' - @State + @Prop certificate:string='111111111' @State titleName: string = "" private ctx: UIContext = this.getUIContext(); @@ -139,7 +139,6 @@ function customStyleR() { @Builder function buildText( title: string ) { - Column() { Row(){ Text('取消') @@ -166,7 +165,6 @@ function buildText( title: string ) { case '': break } - }) } .width('100%') .padding(10) @@ -175,5 +173,7 @@ function buildText( title: string ) { .padding(10) .backgroundColor($r('app.color.white')) .borderRadius(0) + .onChange((value:string)=>{ + }) }.backgroundColor('#FFF0F0F0') } diff --git a/features/register/src/main/ets/view/PerfectUserDataComp.ets b/features/register/src/main/ets/view/PerfectUserDataComp.ets new file mode 100644 index 0000000..7d8ea66 --- /dev/null +++ b/features/register/src/main/ets/view/PerfectUserDataComp.ets @@ -0,0 +1,362 @@ +import { BasicConstant,ExpertData, authStore,perfactAuth } from '@itcast/basic' +import { promptAction, router } from '@kit.ArkUI' +import { EditUserDataItem } from '@itcast/basic/src/main/ets/Views/EditUserDataItem' +import { PerfactInputSheet } from '@itcast/basic/src/main/ets/Views/PerfactInputSheet' +import { PhotoActionSheet } from '@itcast/basic/src/main/ets/Views/PhotoActionSheet' +import { SexSelectedSheet } from '@itcast/basic/src/main/ets/Views/SexSelectedSheet' +import { OfficeSelectedSheet } from '@itcast/basic/src/main/ets/Views/OfficeSelectedSheet' +import { PositionSelectedSheet } from '@itcast/basic/src/main/ets/Views/PositionSelectedSheet' +import { SpecialitySelectedSheet } from '@itcast/basic/src/main/ets/Views/SpecialitySelectedSheet' +import { emitter } from '@kit.BasicServicesKit' + +interface extraData { + uuid: string +} + +interface updateExtraData { + uuid: string, + userName: string, + birthDate: string, + type: string, + photo: string, + certificateImg: string, + positionUuid: string, + officeUuid: string, + officeName: string, + diseaseUuids: string +} + +interface callBackData { + expert:ExpertData, + code:number, + message:string, + specialy:[], + data:ExpertData, + special:[] +} + +@Component +export struct PerfectUserDataComp { + scroller: Scroller = new Scroller(); + + @Prop loginPhone:string = '13419527489'; + + @State photoPath:string = BasicConstant.urlImage+authStore.getUser().photo; + @State name:string = perfactAuth.getUser('13419527489').realName?perfactAuth.getUser('13419527489').realName:'请输入姓名'; + @State sex:string = perfactAuth.getUser('13419527489').sex?perfactAuth.getUser('13419527489').sex == 0 ? '男' : '女':'请选择性别'; + @State sexnum:number = perfactAuth.getUser('13419527489').sex; + @State hospatilName:string = perfactAuth.getUser('13419527489').hospitalName?'':'请选择所在医院'; + @State officeName:string = perfactAuth.getUser('13419527489').officeName?perfactAuth.getUser('13419527489').officeName.length>0?perfactAuth.getUser('13419527489').officeName:'请选择科室':'请选择科室'; + @State officeUuid:string = perfactAuth.getUser('13419527489').officeUuid; + @State officePhone:string = authStore.getUser().officePhone?perfactAuth.getUser('13419527489').officePhone.length?perfactAuth.getUser('13419527489').officePhone:'请输入所在科室的电话':'请输入所在科室的电话'; + @State positionName:string = authStore.getUser().positionName?perfactAuth.getUser('13419527489').positionName.length>0?perfactAuth.getUser('13419527489').positionName:'请选择职称':'请选择职称'; + @State positionUuid:string = authStore.getUser().positionUuid; + @State certificate:string = authStore.getUser().certificate?perfactAuth.getUser('13419527489').certificate.length>0?perfactAuth.getUser('13419527489').certificate:'请输入执业医师证号码':'请输入执业医师证号码'; + @State certificatePhoto:string = BasicConstant.urlImage+perfactAuth.getUser('13419527489').certificateImg; + // @State diseaseName:string = authStore.getUser().diseaseName?authStore.getUser().diseaseName.length>0?authStore.getUser().diseaseName:'请选择专长':'请选择专长'; + // @State diswaseUuid:string = authStore.getUser().diseaseName; + @State diseaseName:string = '请选择专长'; + @State diswaseUuid:string = ''; + + @State inputTitle:string = ''; + @State inputPlaceholder:string = ''; + + private photoSheetDialog!: CustomDialogController; + private officePickerDialog!: CustomDialogController; + private positionPickerDialog!: CustomDialogController; + private certificatePhotoSheetDialog!: CustomDialogController; + private diseaseSheetDialog!:CustomDialogController; + private sexSheetDilog!:CustomDialogController; + private perfactInputSheet!:CustomDialogController; + + aboutToAppear() { + this.initSexDialog(); + this.initPhotoDialog(); + this.initPerfactInputDialog(); + this.initOfficePickerDialog(); + this.initPositionPickerDialog(); + this.initCerficatePhotoDialog(); + this.initDiseaseSheetDIalog(); + + authStore.initUser() + emitter.on({ eventId: 250516 }, () => { + this.handleSave() + }) + } + + aboutToDisappear() { + emitter.off(250516) + } + + private handleSave() { + promptAction.showToast({ message: '您输入的个人资料已经保存,请完善所有信息后提交审核', duration: 1000 }) + const userData:ExpertData = { + positionName: this.positionName='请选择职称'?'':this.positionName, + userName: this.loginPhone, + createDate: '', + password: '', + officeName: this.officeName='请选择科室'?'':this.officeName, + certificateImg: this.certificatePhoto, + birthDate: '', + isStar: 0, + countyId: 0, + cityId: 0, + email: '', + photo: this.photoPath, + qrcode: '', + mobile: this.loginPhone, + hospitalName: '', + officeUuid: this.officeUuid, + checkInfo: '', + hospitalUuid: '', + officePhone: this.officePhone='请输入所在科室的电话'?'':this.officePhone, + positionUuid: this.positionUuid, + sex: this.sexnum, + provId: 0, + certificate: this.certificate='请输入执业医师证号码'?'':this.certificate, + realName: this.name, + isEnable: 0, + isVisit: 0, + modifyDate: '', + currentSpec: '', + deviceType: 0, + currentType: 0, + deviceSpec: '', + nation: 0, + wechat_qrcode: '', + uuid: '', + intro: '', + state: 0, + specialy: [], + diseaseName:this.diseaseName='请选择专长'?'':this.diseaseName, + diseaseUuid:this.diswaseUuid + }; + perfactAuth.setUser('13419527489',userData); + console.info('个人资料=name:',perfactAuth.getUser('13419527489').realName,'\n科室:',perfactAuth.getUser('13419527489').positionName); + } + + initSexDialog(){ + this.sexSheetDilog = new CustomDialogController({ + builder:SexSelectedSheet({ + controller:this.sexSheetDilog, + sexSelected:(index: number)=>{ + this.sex = index == 0 ? '男' : '女'; + this.sexnum = index; + } + }), + alignment: DialogAlignment.Bottom, + customStyle: true, + autoCancel: false, + backgroundColor: ('rgba(0,0,0,0.5)'), + height: '100%' + }) + } + + initPerfactInputDialog() { + this.perfactInputSheet = new CustomDialogController({ + builder:PerfactInputSheet({ + controller:this.perfactInputSheet, + inputTitle:this.inputTitle, + inputPlaceholder:this.inputPlaceholder, + inputCallBack:(input: string,title:string)=>{ + if (title == '请输入姓名') { + this.name = input; + } else if (title == '请输入所在科室电话') { + this.officePhone = input; + } else if (title == '请输入执业医师资格证号码') { + this.certificate = input; + } + } + }), + keyboardAvoidDistance: {value:-2000} as LengthMetrics, // 设置弹窗底部与键盘顶部间距(单位:vp) + alignment: DialogAlignment.Bottom, + customStyle: true, + autoCancel: false, + backgroundColor: ('rgba(0,0,0,0.5)'), + height: '100%' + }) + } + + private initPhotoDialog() { + this.photoSheetDialog = new CustomDialogController({ + builder: PhotoActionSheet({ + controller: this.photoSheetDialog, + onPhotoSelected: async (uri: string) => { + this.photoPath = uri; + } + }), + alignment: DialogAlignment.Bottom, + customStyle: true, + autoCancel: false, + backgroundColor: ('rgba(0,0,0,0.5)'), + height: '100%' + }); + } + + private initOfficePickerDialog() { + this.officePickerDialog = new CustomDialogController({ + builder:OfficeSelectedSheet({ + controller:this.officePickerDialog, + officeSelected: (name:string , uuid:string) => { + this.officeName = name; + this.officeUuid = uuid; + } + }), + alignment: DialogAlignment.Bottom, + customStyle: true, + autoCancel: false, + backgroundColor: ('rgba(0,0,0,0.5)'), + height: '100%' + }) + } + + private initPositionPickerDialog() { + this.positionPickerDialog = new CustomDialogController({ + builder:PositionSelectedSheet({ + controller:this.officePickerDialog, + officeSelected: (name:string , uuid:string) => { + this.positionName = name; + this.positionUuid = uuid; + } + }), + alignment: DialogAlignment.Bottom, + customStyle: true, + autoCancel: false, + backgroundColor: ('rgba(0,0,0,0.5)'), + height: '100%' + }) + } + + private initCerficatePhotoDialog() { + this.certificatePhotoSheetDialog = new CustomDialogController({ + builder: PhotoActionSheet({ + controller: this.certificatePhotoSheetDialog, + onPhotoSelected: (url: string) => { + this.certificatePhoto = url; + console.log('Selected image URI:', url); + } + }), + alignment: DialogAlignment.Bottom, + customStyle: true, + autoCancel: false, + backgroundColor: ('rgba(0,0,0,0.5)'), + height: '100%' + }); + } + + private initDiseaseSheetDIalog() { + this.diseaseSheetDialog = new CustomDialogController({ + builder: SpecialitySelectedSheet({ + controller:this.diseaseSheetDialog, + specialitySelected: (diseaseUuids:string,diseaseName:string)=>{ + this.diseaseName = diseaseName; + this.diswaseUuid = diseaseUuids; + } + }), + alignment: DialogAlignment.Bottom, + customStyle: true, + autoCancel: false, + backgroundColor: ('rgba(0,0,0,0.5)'), + height: '100%' + }) + } + + build() { + Scroll(this.scroller) { + Column() { + // 基本信息字段 + EditUserDataItem({ label: '头像', required: false, content: this.photoPath, hasArrow: true, isLine:false }) + .backgroundColor(Color.White) + .onClick(()=>this.photoSheetDialog.open()) + EditUserDataItem({ label: '姓名', required: false, content: this.name, hasArrow:true, isLine:false }) + .backgroundColor(Color.White) + .margin({top:8}) + .onClick(()=>{ + this.inputTitle = '请输入姓名'; + this.inputPlaceholder = this.name; + this.perfactInputSheet.open() + }) + EditUserDataItem({ label: '性别', required: false, content: this.sex, hasArrow:true, isLine:false }) + .backgroundColor(Color.White) + .margin({top:8}) + .onClick(()=>this.sexSheetDilog.open()) + EditUserDataItem({ label: '医院', required: false, content: this.hospatilName, hasArrow: true, isLine:false }) + .backgroundColor(Color.White) + .margin({top:8}) + .onClick(()=> { + router.pushUrl({ + url: 'pages/LoginPage/SelectedHospitalPage' + }) + }) + EditUserDataItem({ label: '科室', required: false, content: this.officeName, hasArrow: true, isLine:false }) + .backgroundColor(Color.White) + .margin({top:8}) + .onClick(()=>this.officePickerDialog.open()) + EditUserDataItem({ label: '科室电话', required: false, content: this.officePhone, hasArrow: true, isLine:false }) + .backgroundColor(Color.White) + .margin({top:8}) + .onClick(()=>{ + this.inputTitle = '请输入所在科室电话'; + this.inputPlaceholder = this.officePhone; + this.perfactInputSheet.open() + }) + EditUserDataItem({ label: '职称', required: false, content: this.positionName, hasArrow: true, isLine:false }) + .backgroundColor(Color.White) + .margin({top:8}) + .onClick(()=>this.positionPickerDialog.open()) + EditUserDataItem({ label: '执业医师证编号', required: false, content: this.certificate ,hasArrow: true, isLine:false }) + .backgroundColor(Color.White) + .margin({top:8}) + .onClick(()=>{ + this.inputTitle = '请输入执业医师资格证号码'; + this.inputPlaceholder = this.certificate; + this.perfactInputSheet.open()} + ) + EditUserDataItem({ label: '执业医师证图片或胸牌', required: false, content: this.certificatePhoto, hasArrow: true, isLine:false }) + .backgroundColor(Color.White) + .margin({top:8}) + .onClick(()=>this.certificatePhotoSheetDialog.open()) + EditUserDataItem({ label: '专长(可选一到十项)', required: false, content: this.diseaseName , hasArrow: true, isLine:false }) + .backgroundColor(Color.White) + .margin({top:8}) + .onClick(()=>this.diseaseSheetDialog.open()) + + Column() { + // 登录按钮 + Button({type:ButtonType.Normal}){ + Text('提交') + } + .width('95%') + .height(48) + .borderRadius(8) + .backgroundColor($r('app.color.main_color')) + .fontColor('#FFFFFF') + .fontSize(18) + .position({x:'2.5%'}) + .onClick(() => { + // 提交逻辑 + router.pushUrl({ + url: 'pages/LoginPage/SelectedHospitalPage' + }) + }) + } + .width('100%') + .height(48) + .margin({top:50}) + } + .width('100%') + .height('100%') + .padding(8) + .backgroundImage($r('app.media.bg_reg')) + .backgroundImageSize(ImageSize.FILL) + } + .height('auto') + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.Off) + .backgroundColor('#ffffff') + } +} + +function handleSave() { + +} \ No newline at end of file diff --git a/features/register/src/main/ets/view/SelectedHospitalComp.ets b/features/register/src/main/ets/view/SelectedHospitalComp.ets new file mode 100644 index 0000000..bce4af2 --- /dev/null +++ b/features/register/src/main/ets/view/SelectedHospitalComp.ets @@ -0,0 +1,369 @@ +import { hdHttp, HdResponse,BasicConstant } from '@itcast/basic' +import { promptAction, CommonModifier } from '@kit.ArkUI' +import { BusinessError } from '@kit.BasicServicesKit'; +import HashMap from '@ohos.util.HashMap'; +import { it } from '@ohos/hypium'; + +@Component +export struct SelectedHospitalComp { + scrollerForList: Scroller = new Scroller(); + + @State provincerSelectedName:string = '请选择'; + @State provincerId:string = ''; + @State citySelectedName:string = ''; + @State cityId:string = ''; + @State districtsSelectedName:string = ''; + @State districtsId:string = ''; + @State hospitalSelectedName:string = ''; + @State inputSearch:string = ''; + @State tabBarModifier: CommonModifier = new CommonModifier(); + @State isHidenCity:boolean = false; + @State isHiddenSearchView:boolean = false; + // 当前选中的层级索引(0-省 1-市 2-区 3-医院) + @State currentTabIndex: number = 0 + // 存储各层级选择状态 + @State selections: number[] = [0, 1,2 ,3] + // 数据集合 + @State provinces: ProvinceOrCiry[] = [] + @State cities: ProvinceOrCiry[] = [] + @State districts: ProvinceOrCiry[] = [] + @State hospitals: Hospital[] = [] + @State searchHospitals: Hospital[] = [] + // 搜索关键词 + @Prop searchKey: string = '' + + aboutToAppear() { + this.loadProvinces(0,0) + } + + // 加载省份数据 + private loadProvinces(type:number,provinceIdOrCity:number) { + const areaListUrl:string = BasicConstant.urlExpertAPI+'areaList'; + const hashMap: HashMap = new HashMap(); + + hashMap.clear(); + if (type != 0) { + hashMap.set('parent_id',provinceIdOrCity.toString()) + } + hdHttp.httpReq(areaListUrl,hashMap).then(async (res: HdResponse) => { + console.info(`Response areaList succeeded: ${res}`); + let json:RequestProvinceCallData = JSON.parse(res+'') as RequestProvinceCallData; + if(json.code=='200') { + if (type == 0) { + this.provinces = json.data; + this.onTabChange(0) + } else if (type == 1) { + this.cities = json.data; + this.onTabChange(1); + } else if (type == 2) { + this.onTabChange(2); + if (json.data.length>0) { + this.isHidenCity = false; + this.districts = json.data; + } else { + this.isHidenCity = true; + this.searchHospitalList('',false); + } + } else { + this.searchHospitalList('',false); + } + } else { + promptAction.showToast({ message: json.msg, duration: 1000 }) + } + }).catch((err: BusinessError) => { + console.info(`Response areaList fail: ${err}`); + }) + } + + searchHospitalList(input:string,isSearchStatus:boolean) { + const areaListUrl:string = BasicConstant.urlExpertAPI+'hospitalList'; + const hashMap: HashMap = new HashMap(); + hashMap.clear(); + hashMap.set('name',input); + hashMap.set('prov_id',this.provincerId); + hashMap.set('city_id',this.cityId); + hashMap.set('county_id',this.districtsId); + hdHttp.httpReq(areaListUrl,hashMap).then(async (res: HdResponse) => { + console.info(`Response hospitalList succeeded: ${res}`); + let json:HospitalCallData = JSON.parse(res+'') as HospitalCallData; + if(json.code=='200') { + if (isSearchStatus) { + if (json.data.length > 0) { + this.isHiddenSearchView = true; + } else { + this.isHiddenSearchView = false; + } + this.searchHospitals = json.data; + } else { + this.isHiddenSearchView = false; + this.hospitalSelectedName = '请选择'; + this.hospitals = json.data; + if (this.isHidenCity) { + this.onTabChange(2); + } else { + this.onTabChange(3); + } + } + } else { + promptAction.showToast({ message: json.msg, duration: 1000 }) + } + }).catch((err: BusinessError) => { + console.info(`Response hospitalList fail: ${err}`); + }) + } + + // Tab切换事件 + private onTabChange(index: number) { + if (index < this.currentTabIndex) { // 允许回退 + this.currentTabIndex = index + return + } + // 验证数据完整性 + if (index === 1 && !this.selections[0]) return + if (index === 2 && !this.selections[1]) return + if (index === 3 && !this.selections[2]) return + if (index === 4 && !this.selections[3]) return + this.currentTabIndex = index + } + + private handleSearchInput(value:string) { + if (value.length<0) { + return; + } + this.searchHospitalList(value,true); + } + + build() { + Column() { + SearchInput((input:string)=>{ + this.handleSearchInput(input); + }) + + // 内容区域 + Tabs({ index: this.currentTabIndex,barModifier:this.tabBarModifier.align(Alignment.Start) }) { + // 省份列表 + TabContent() { + List() { + ForEach(this.provinces, (item : ProvinceOrCiry) => { + ListItem() { + Text(item.name) + .fontColor(item.name == this.provincerSelectedName?$r('app.color.main_color'):'#666666') + .fontSize(17) + .height(40) + .margin({left:20}) + .onClick(() => { + this.selections[0] = 1; + this.provincerSelectedName = item.name; + this.citySelectedName = '请选择' + this.districtsSelectedName = ''; + this.hospitalSelectedName = ''; + this.provincerId = item.id.toString(); + this.loadProvinces(1,item.id); + }) + } + }) + } + .width('100%') + .height('100%') + }.tabBar(this.provincerSelectedName) + + // 城市列表 + TabContent() { + List() { + ForEach(this.cities, (item : ProvinceOrCiry) => { + ListItem() { + Text(item.name) + .fontColor(item.name == this.citySelectedName?$r('app.color.main_color'):'#666666') + .fontSize(17) + .height(40) + .margin({left:20}) + .onClick(() => { + this.selections[1] = 2; + this.citySelectedName = item.name; + this.districtsSelectedName = '请选择' + this.hospitalSelectedName = ''; + this.cityId = item.id.toString(); + this.loadProvinces(2,item.id) + }) + } + }) + } + .width('100%') + .height('100%') + }.tabBar(this.citySelectedName) + + // 区县列表 + TabContent() { + List() { + if (this.isHidenCity) { + ForEach(this.hospitals, (item: Hospital) => { + ListItem() { + Text(item.name) + // .fontColor(item.name == this.districtsSelectedName?$r('app.color.main_color'):'#666666') + .fontSize(17) + .height(40) + .margin({left:20}) + .onClick(() => { + // this.districtsSelectedName = item.name; + this.selections[2] = 3; + //医院点击 + }) + } + }) + } else { + ForEach(this.districts, (item: ProvinceOrCiry) => { + ListItem() { + Text(item.name) + .fontColor(item.name == this.districtsSelectedName?$r('app.color.main_color'):'#666666') + .fontSize(17) + .height(40) + .margin({left:20}) + .onClick(() => { + this.districtsSelectedName = item.name; + this.selections[3] = 4; + this.districtsId = item.id.toString(); + this.searchHospitalList('',false); + }) + } + }) + } + } + .width('100%') + .height('100%') + }.tabBar(this.districtsSelectedName) + + if (!this.isHidenCity) { + // 医院列表 + TabContent() { + List() { + ForEach(this.hospitals, (item:Hospital) => { + ListItem() { + Text(item.name) + .fontSize(17) + .height(40) + .margin({left:20}) + .onClick(()=>{ + //医院点击 + }) + } + }) + } + .width('100%') + .height('100%') + }.tabBar(this.hospitalSelectedName) + } + } + .onChange(index => this.onTabChange(index)) + .barWidth('100%') + .barMode(BarMode.Scrollable) + .height('100%') + + if (this.isHiddenSearchView) { + Column() { + List() { + ForEach(this.searchHospitals, (item: Hospital) => { + ListItem() { + Text(item.name) + .fontSize(17) + .height(40) + .margin({ left: 20 }) + .onClick(() => { + //医院点击 + }) + } + }) + } + .width('100%') + .height('100%') + } + .position({ y: 60 }) + .width('100%') + .height('82%') + .backgroundColor(Color.White) + } + } + .height('100%') + } + + @Builder + CustomTabBuilder(title: string, index: number) { + Column() { + Text(title) + .fontSize(17) + .fontColor(this.currentTabIndex === index ? $r('app.color.main_color') : '#333333') + Divider() + .width('auto') + .height(3) + .color($r('app.color.main_color')) + .visibility(this.currentTabIndex === index ? Visibility.Visible : Visibility.Hidden) + } + .width('auto') + .width('auto') + .height(50) + } +} + +@Builder +function SearchInput(onSearchInput:(input:string)=>void) { + // inputText:String = ; + Row() { + // 返回按钮 + Image($r('app.media.selected_hospital_ws')) + .width(20) + .height(20) + .margin({left:10}) + + TextInput({ placeholder: '搜索医院标准名别名' }) + .width('80%') + .backgroundColor('#EEEEEE') + .onChange((value:string)=>{ + onSearchInput(value); + }) + // .onEditChange((isEditing: boolean) => { + // if (!isEditing) { + // onSearchInput(value); + // } + // }) + // .onSubmit(() => { + // onSearchInput(value); + // }) + } + .borderRadius(20) + .width('90%') + .height(40) + .margin({top:10}) + .backgroundColor('#EEEEEE') + .justifyContent(FlexAlign.Start) +} + +interface RequestProvinceCallData { + msg:string, + code:string, + data:ProvinceOrCiry[] +} + +interface HospitalCallData { + msg:string, + code:string, + data:Hospital[] +} + +// DataModel.ts +interface ProvinceOrCiry { + treePath: string + name: string, + parent:number, + id:number, + fullName:string +} + +interface Hospital { + city_name: string + county_id: string + prov_id: string + prov_name: string + name:string + county_name:string + uuid:string + city_id:string +} diff --git a/features/register/src/main/resources/base/element/float.json b/features/register/src/main/resources/base/element/float.json index 33ea223..a0a93dd 100644 --- a/features/register/src/main/resources/base/element/float.json +++ b/features/register/src/main/resources/base/element/float.json @@ -5,4 +5,4 @@ "value": "50fp" } ] -} +} \ No newline at end of file diff --git a/features/register/src/main/resources/base/media/selected_hospital_ws.png b/features/register/src/main/resources/base/media/selected_hospital_ws.png new file mode 100644 index 0000000000000000000000000000000000000000..35fa8c488c82ec7241d6ed333e823b50b896c784 GIT binary patch literal 2830 zcmaJ@X;f3!7EVP5L9i&3K_vu5Kr<4im@s8Pq+v!V3K)`@1k6AZNdj04bTL>4t%w6E z7f?hjMg*i*1Y1QEH3TC?5CbSkEQ3OW6%c*FihVzx@2++48TR*md+)RNTIc2l2l^Qs zf(=0+kg@+(VyJeEUU&`kv|slspC#I1wTKiY3ghh-iKzkx$cN60XF&WpR3;;oL8VKR z?lN#7kd7@oJW3Qr`36hlap2Si3|zwDYuO+W&P&3l(h?aWNIZkd=Hj8RuC+iRY&sqq z=|VwL_yh)vy){L^2uleJr==v)Jm^p_PY6ze)e3MJA}U0}*~1lLC3xsZU95J#u#JF1 zK0-u^c<4VtMNxtw1fGBaae=$QXh;+W;^qNIxu7uasLc>G66K6QIwMfdFccb#^uVHA zAfFzn)|-I78yiX_fAXbW;h`*%h>t}e#9}dA>(3R6s9YMupNNNQ1>kHp9ZSUcVn{A%q>mc`jY5%J zd@wF9L=@T89pmhRawd=#xkMgqFNeVuEpqAqa#3I8E_4Eiuk}o12-wLCI$6NuKt5)S zWq&ai6zPk4pSbid#)2Y$k&DmC^fM4xa;@7O7$J!T}UHhrflB+1kv^vrMw=YYe89Md?+vkS){zggz`ep5s)Z!)vf zE3FFoxq%Eg<$&{T6Nt#IX&VmMhXV#?OU)CH9Dpu?mX+iF{2**GQp!@VtEQ8g;w^Dg z9pm?tx}Wy%n|t6^=S(P>olRjpNKH&MjZ#?DyBPImaL1E<16lx#%+JZj8f5OPQzisd z!Io94N|n?qlV1HUUu)ojg3L-h2$DZ;zGtKGe+SS2sCuP??0D(DbUmMnhF^JQ5eh?= zM|i&z4x2vgy9#*Hlc=Q5Y@U@TuuvMbW=G;u3UvTgW!1j*HSeYB$+GdR_us!y$9g{n zCW2jy%tz|x-@dw^)n1kj=+x+Ho+{=Q=aW=%`uj|3vZ?{Fy5GK8hJR#BSGSA z%S4p{zql`pZnxdg2OJ`JWgp#0+-scrNF>jkN4C4$6DoFIUNKu{V+>R-(>weeAl1|fhpbR@lb_;+)CC?<&1VCuf+LAKIXLCvLO9d)VHi-6@(GwQr%M$I8|!&H9>6bxzs&#y2=BtXGNd z-sD;yn6d~1Hj!pBa?+cli@L48%7=>^)a3;QR_c2VwCI=9nU00_b6dB_{W6c)nBJ); z65=fD9u*chI;KVzy~;IE`eJ$MamL^4TG<0s zbTNQ9e#}5-vLlufw((+jd-f9j6SRhtnT;zi-9)Et3kn+ArW1{9^CI#i zy>we+gXKRp9qX)rdZDN-^WDqWtPD!n&54y=MQGS^D|)nR%-Bx^nQIc-5vE=`CY4Bu z;r+L3Wp&gW_#<_B@lE$q-6rP-K@Tq3B>NY#YS-tF#?lPXttyJ5HA!V-xbN)4M(cvV zfz__Ch~j`%f!V6;*zotTlV@6Hz|56XGcTT357MetxGSA_4A4_$6hP||{A8SekP|5v z?3Uqj*2(a#`t2zmPj(`WB4KmJSj`_dC*I>UQf?IQmOZL*i0^O>GW`|YLs z$f2~huLn{io?rKMXgSwYR+==EI*hY@$h7Yij2gDYCzljYTp7LmYVFxnVZ=K}LoX-h zUF2RUt0q1_A;sRz=gjfbBT3fCre#6zVmy8v{FYM zJ-U5MXEH9=zF(pHQ015U__;$jr%g<7d-KcBOZz7;2$BKEuw3!7iYJsQg zuX0tSs2z4A5U&Rc`tIis;Ewcp+Rl5B13EkdHh2iHTm`PHN{W8H79?z1BRB4@wD^v> z!R?Y|t+=>q$cxcdPf)g1B58E`bLlOS7Yv629$~Yj!X-s=b`-I zN@ZI{pe!Qk{vY@fy_!F&ES3|$Rd{L{qGz}#97uJe?l|RiP4=Ov)2A3dbBCFc_J^4} z6z4~J9(ivsdNHkL`<(OYC^jDYAa&iPHK;HL(H*fykN0g>YqCub^vo(YOEq9s{^N{5 z;c5J>4ILLR0oNz@9A}P1D^xFfx|ZW6&?ByIKAfCx``K^D;k literal 0 HcmV?d00001 diff --git a/products/expert/oh-package-lock.json5 b/products/expert/oh-package-lock.json5 index 3009694..3bf4886 100644 --- a/products/expert/oh-package-lock.json5 +++ b/products/expert/oh-package-lock.json5 @@ -11,7 +11,6 @@ "@itcast/basic@../../commons/basic": "@itcast/basic@../../commons/basic", "@ohos/crypto-js@2.0.3": "@ohos/crypto-js@2.0.4", "@ohos/crypto-js@^2.0.2": "@ohos/crypto-js@2.0.4", - "@ohos/crypto-js@^2.0.4": "@ohos/crypto-js@2.0.4", "@ohos/httpclient@2.0.2": "@ohos/httpclient@2.0.2", "@polyvharmony/httpdns-api@1.0.2": "@polyvharmony/httpdns-api@1.0.2", "@polyvharmony/httpdns-impl-ali@1.0.2": "@polyvharmony/httpdns-impl-ali@1.0.2", @@ -28,8 +27,7 @@ "mypage@../../features/mypage": "mypage@../../features/mypage", "pako@^2.1.0": "pako@2.1.0", "register@../../features/register": "register@../../features/register", - "scene_single_video@../../scene_single_video": "scene_single_video@../../scene_single_video", - "utils@../../commons/utils": "utils@../../commons/utils" + "scene_single_video@../../scene_single_video": "scene_single_video@../../scene_single_video" }, "packages": { "@aliyun/error@1.0.2": { @@ -234,7 +232,8 @@ "resolved": "../../features/register", "registryType": "local", "dependencies": { - "@itcast/basic": "file:../../commons/basic" + "@itcast/basic": "file:../../commons/basic", + "mypage": "file:../../features/mypage" } }, "scene_single_video@../../scene_single_video": { @@ -246,15 +245,6 @@ "media-player-common": "file:../polyv", "@polyvharmony/media-player-sdk": "2.5.0" } - }, - "utils@../../commons/utils": { - "name": "utils", - "version": "1.0.0", - "resolved": "../../commons/utils", - "registryType": "local", - "dependencies": { - "@ohos/crypto-js": "^2.0.4" - } } } } \ No newline at end of file diff --git a/products/expert/oh-package.json5 b/products/expert/oh-package.json5 index f16fc4b..2343fee 100644 --- a/products/expert/oh-package.json5 +++ b/products/expert/oh-package.json5 @@ -7,7 +7,6 @@ "license": "", "dependencies": { "@itcast/basic": "file:../../commons/basic", - "utils": "file:../../commons/utils", "mypage":"file:../../features/mypage", "home": 'file:../../features/Home', "register": 'file:../../features/register', diff --git a/products/expert/src/main/ets/pages/LoginPage/LoginSetInfoPage.ets b/products/expert/src/main/ets/pages/LoginPage/LoginSetInfoPage.ets index d874021..f7da198 100644 --- a/products/expert/src/main/ets/pages/LoginPage/LoginSetInfoPage.ets +++ b/products/expert/src/main/ets/pages/LoginPage/LoginSetInfoPage.ets @@ -1,11 +1,16 @@ -import { LoginSetInfo } from 'register' +import { LoginSetInfo,PerfectUserDataComp } from 'register' +import { HdNav } from '@itcast/basic' @Entry @Component struct LoginSetInfoPage { + @Prop loginInputPhone:string; + build() { Column() { - LoginSetInfo() + // LoginSetInfo() + HdNav({ title: '完善个人资料', showRightIcon: false, showLeftIcon: true,showRightText:true,rightText:'保存' }) + PerfectUserDataComp({loginPhone:this.loginInputPhone}); } } } \ No newline at end of file diff --git a/products/expert/src/main/ets/pages/LoginPage/SelectedHospitalPage.ets b/products/expert/src/main/ets/pages/LoginPage/SelectedHospitalPage.ets new file mode 100644 index 0000000..d492685 --- /dev/null +++ b/products/expert/src/main/ets/pages/LoginPage/SelectedHospitalPage.ets @@ -0,0 +1,13 @@ +import { SelectedHospitalComp } from 'register' +import { HdNav } from '@itcast/basic' + +@Entry +@Component +struct SelectedHospitalPage { + build() { + Column(){ + HdNav({ title: '选择医院', showRightIcon: false, showLeftIcon: true,showRightText:false}) + SelectedHospitalComp(); + } + } +} \ No newline at end of file diff --git a/products/expert/src/main/resources/base/profile/main_pages.json b/products/expert/src/main/resources/base/profile/main_pages.json index f4cd59e..8ca7ade 100644 --- a/products/expert/src/main/resources/base/profile/main_pages.json +++ b/products/expert/src/main/resources/base/profile/main_pages.json @@ -5,6 +5,7 @@ "pages/Home", "pages/LoginPage/LoginPage", "pages/LoginPage/LoginSetInfoPage", + "pages/LoginPage/SelectedHospitalPage", "pages/MinePage/MyPage", "pages/VideoPage/ScienceVideoPage", "pages/MinePage/SettingPage",