Showing
8 changed files
with
61 additions
and
41 deletions
| @@ -5,6 +5,7 @@ import EditInfoViewModel from '../../viewmodel/EditInfoViewModel'; | @@ -5,6 +5,7 @@ import EditInfoViewModel from '../../viewmodel/EditInfoViewModel'; | ||
| 5 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; | 5 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; |
| 6 | import {AreaPickerDialog} from '../view/areaPickerDialog/AreaPickerDialog' | 6 | import {AreaPickerDialog} from '../view/areaPickerDialog/AreaPickerDialog' |
| 7 | import { AreaListModel } from '../../model/AreaListModel'; | 7 | import { AreaListModel } from '../../model/AreaListModel'; |
| 8 | +import router from '@ohos.router'; | ||
| 8 | 9 | ||
| 9 | 10 | ||
| 10 | @Entry | 11 | @Entry |
| @@ -25,6 +26,10 @@ struct EditUserInfoPage { | @@ -25,6 +26,10 @@ struct EditUserInfoPage { | ||
| 25 | this.getAreaList() | 26 | this.getAreaList() |
| 26 | } | 27 | } |
| 27 | 28 | ||
| 29 | + onPageShow(){ | ||
| 30 | + | ||
| 31 | + } | ||
| 32 | + | ||
| 28 | build() { | 33 | build() { |
| 29 | Row() { | 34 | Row() { |
| 30 | Column() { | 35 | Column() { |
| @@ -89,7 +94,6 @@ struct EditUserInfoPage { | @@ -89,7 +94,6 @@ struct EditUserInfoPage { | ||
| 89 | .width('100%') | 94 | .width('100%') |
| 90 | .onClick(()=>{ | 95 | .onClick(()=>{ |
| 91 | if (i === 1){ | 96 | if (i === 1){ |
| 92 | - // WDRouterRule.jumpWithPage(WDRouterPage.editUserInfoPage) | ||
| 93 | WDRouterRule.jumpWithPage(WDRouterPage.editUserNikeNamePage) | 97 | WDRouterRule.jumpWithPage(WDRouterPage.editUserNikeNamePage) |
| 94 | }else if (i === 2){ | 98 | }else if (i === 2){ |
| 95 | WDRouterRule.jumpWithPage(WDRouterPage.editUserIntroductionPage) | 99 | WDRouterRule.jumpWithPage(WDRouterPage.editUserIntroductionPage) |
| 1 | import { CustomTitleUI } from '../reusable/CustomTitleUI' | 1 | import { CustomTitleUI } from '../reusable/CustomTitleUI' |
| 2 | +import router from '@ohos.router' | ||
| 2 | 3 | ||
| 3 | @Entry | 4 | @Entry |
| 4 | @Component | 5 | @Component |
| 5 | struct EditUserIntroductionPage { | 6 | struct EditUserIntroductionPage { |
| 6 | @State numCount: number = 0 | 7 | @State numCount: number = 0 |
| 7 | @State textColor : string = '#222222' | 8 | @State textColor : string = '#222222' |
| 9 | + @State introduction: string = '' | ||
| 8 | 10 | ||
| 9 | build() { | 11 | build() { |
| 10 | Column(){ | 12 | Column(){ |
| @@ -23,6 +25,7 @@ struct EditUserIntroductionPage { | @@ -23,6 +25,7 @@ struct EditUserIntroductionPage { | ||
| 23 | }else { | 25 | }else { |
| 24 | this.textColor = '#222222' | 26 | this.textColor = '#222222' |
| 25 | } | 27 | } |
| 28 | + this.introduction = value | ||
| 26 | }) | 29 | }) |
| 27 | 30 | ||
| 28 | Text(this.numCount.toString() + '/60') | 31 | Text(this.numCount.toString() + '/60') |
| @@ -46,6 +49,12 @@ struct EditUserIntroductionPage { | @@ -46,6 +49,12 @@ struct EditUserIntroductionPage { | ||
| 46 | .backgroundColor('#ED2800') | 49 | .backgroundColor('#ED2800') |
| 47 | .borderRadius(5) | 50 | .borderRadius(5) |
| 48 | .margin(30) | 51 | .margin(30) |
| 52 | + .onClick(()=>{ | ||
| 53 | + router.back({ | ||
| 54 | + url:'', | ||
| 55 | + params:{nikeName:this.introduction} | ||
| 56 | + }) | ||
| 57 | + }) | ||
| 49 | } | 58 | } |
| 50 | } | 59 | } |
| 51 | } | 60 | } |
| 1 | import { CustomTitleUI } from '../reusable/CustomTitleUI' | 1 | import { CustomTitleUI } from '../reusable/CustomTitleUI' |
| 2 | +import router from '@ohos.router' | ||
| 2 | 3 | ||
| 3 | @Entry | 4 | @Entry |
| 4 | @Component | 5 | @Component |
| @@ -6,6 +7,7 @@ struct EditUserNikeNamePage { | @@ -6,6 +7,7 @@ struct EditUserNikeNamePage { | ||
| 6 | ///接收传参 | 7 | ///接收传参 |
| 7 | @State numCount: number = 0 | 8 | @State numCount: number = 0 |
| 8 | @State textColor : string = '#222222' | 9 | @State textColor : string = '#222222' |
| 10 | + @State nikeName: string = '' | ||
| 9 | 11 | ||
| 10 | build() { | 12 | build() { |
| 11 | Column(){ | 13 | Column(){ |
| @@ -24,6 +26,7 @@ struct EditUserNikeNamePage { | @@ -24,6 +26,7 @@ struct EditUserNikeNamePage { | ||
| 24 | }else { | 26 | }else { |
| 25 | this.textColor = '#222222' | 27 | this.textColor = '#222222' |
| 26 | } | 28 | } |
| 29 | + this.nikeName = value | ||
| 27 | }) | 30 | }) |
| 28 | 31 | ||
| 29 | Text(this.numCount.toString() + '/16') | 32 | Text(this.numCount.toString() + '/16') |
| @@ -46,6 +49,12 @@ struct EditUserNikeNamePage { | @@ -46,6 +49,12 @@ struct EditUserNikeNamePage { | ||
| 46 | .backgroundColor('#ED2800') | 49 | .backgroundColor('#ED2800') |
| 47 | .borderRadius(5) | 50 | .borderRadius(5) |
| 48 | .margin(30) | 51 | .margin(30) |
| 52 | + .onClick(()=>{ | ||
| 53 | + router.back({ | ||
| 54 | + url:'', | ||
| 55 | + params:{nikeName:this.nikeName} | ||
| 56 | + }) | ||
| 57 | + }) | ||
| 49 | } | 58 | } |
| 50 | } | 59 | } |
| 51 | } | 60 | } |
| @@ -51,9 +51,7 @@ struct MyCollectionListPage { | @@ -51,9 +51,7 @@ struct MyCollectionListPage { | ||
| 51 | 51 | ||
| 52 | LazyForEach(this.browSingModel.compList, (compDTO: CompDTO, compIndex: number) => { | 52 | LazyForEach(this.browSingModel.compList, (compDTO: CompDTO, compIndex: number) => { |
| 53 | ListItem() { | 53 | ListItem() { |
| 54 | - Column() { | ||
| 55 | - CompParser({ compDTO: compDTO, compIndex: compIndex }); | ||
| 56 | - } | 54 | + this.newCompParser(compDTO,compIndex) |
| 57 | } | 55 | } |
| 58 | }) | 56 | }) |
| 59 | 57 | ||
| @@ -72,6 +70,23 @@ struct MyCollectionListPage { | @@ -72,6 +70,23 @@ struct MyCollectionListPage { | ||
| 72 | .height(CommonConstants.FULL_PARENT) | 70 | .height(CommonConstants.FULL_PARENT) |
| 73 | } | 71 | } |
| 74 | 72 | ||
| 73 | + @Builder | ||
| 74 | + newCompParser(compDTO: CompDTO, compIndex: number){ | ||
| 75 | + Row(){ | ||
| 76 | + Button() | ||
| 77 | + .type(ButtonType.Normal) | ||
| 78 | + .width('20') | ||
| 79 | + .height('20') | ||
| 80 | + .backgroundColor('#ED2800') | ||
| 81 | + .borderRadius(5) | ||
| 82 | + .margin({left:16}) | ||
| 83 | + | ||
| 84 | + Column() { | ||
| 85 | + CompParser({ compDTO: compDTO, compIndex: compIndex }); | ||
| 86 | + } | ||
| 87 | + } | ||
| 88 | + } | ||
| 89 | + | ||
| 75 | @Builder LoadingLayout() { | 90 | @Builder LoadingLayout() { |
| 76 | CustomRefreshLoadLayout({ refreshBean: new RefreshLayoutBean(true, | 91 | CustomRefreshLoadLayout({ refreshBean: new RefreshLayoutBean(true, |
| 77 | $r('app.media.ic_pull_up_load'), $r('app.string.pull_up_load_text'), this.browSingModel.pullDownRefreshHeight) }) | 92 | $r('app.media.ic_pull_up_load'), $r('app.string.pull_up_load_text'), this.browSingModel.pullDownRefreshHeight) }) |
| 1 | +import { Logger } from 'wdKit'; | ||
| 1 | import { AreaListManageModel, AreaListModel } from '../../../model/AreaListModel'; | 2 | import { AreaListManageModel, AreaListModel } from '../../../model/AreaListModel'; |
| 2 | import EditInfoViewModel from '../../../viewmodel/EditInfoViewModel'; | 3 | import EditInfoViewModel from '../../../viewmodel/EditInfoViewModel'; |
| 3 | import { FirstLevelComponent } from './FirstLevelComponent'; | 4 | import { FirstLevelComponent } from './FirstLevelComponent'; |
| @@ -13,12 +14,6 @@ export struct AreaPickerDialog { | @@ -13,12 +14,6 @@ export struct AreaPickerDialog { | ||
| 13 | @Provide dataSource: AreaListModel[] = [] | 14 | @Provide dataSource: AreaListModel[] = [] |
| 14 | result: JSON[] = []; | 15 | result: JSON[] = []; |
| 15 | 16 | ||
| 16 | - aboutToAppear(){ | ||
| 17 | - this.currentFirst = EditInfoViewModel.getAreaListManageModel(this.dataSource[0]) | ||
| 18 | - this.currentSecondBean = EditInfoViewModel.getAreaListManageModel(this.dataSource[0].children[0]) | ||
| 19 | - this.currentThirdBean = EditInfoViewModel.getAreaListManageModel(this.dataSource[0].children[0].children[0]) | ||
| 20 | - } | ||
| 21 | - | ||
| 22 | build() { | 17 | build() { |
| 23 | Column(){ | 18 | Column(){ |
| 24 | Row(){ | 19 | Row(){ |
| @@ -39,7 +34,8 @@ export struct AreaPickerDialog { | @@ -39,7 +34,8 @@ export struct AreaPickerDialog { | ||
| 39 | 34 | ||
| 40 | Button('确定',{type:ButtonType.Normal}) | 35 | Button('确定',{type:ButtonType.Normal}) |
| 41 | .onClick(()=> { | 36 | .onClick(()=> { |
| 42 | - | 37 | + this.controller.close() |
| 38 | + Logger.info('area',this.currentFirst.label+this.currentSecondBean.label+this.currentThirdBean.label); | ||
| 43 | }) | 39 | }) |
| 44 | .backgroundColor(0xffffff) | 40 | .backgroundColor(0xffffff) |
| 45 | .fontColor(Color.Blue) | 41 | .fontColor(Color.Blue) |
| @@ -12,6 +12,7 @@ export struct FirstLevelComponent { | @@ -12,6 +12,7 @@ export struct FirstLevelComponent { | ||
| 12 | const element = this.dataSource[index]; | 12 | const element = this.dataSource[index]; |
| 13 | this.labelList.push(element.label) | 13 | this.labelList.push(element.label) |
| 14 | } | 14 | } |
| 15 | + this.currentFirst = EditInfoViewModel.getAreaListManageModel(this.dataSource[this.select]) | ||
| 15 | } | 16 | } |
| 16 | 17 | ||
| 17 | build() { | 18 | build() { |
| @@ -21,10 +22,10 @@ export struct FirstLevelComponent { | @@ -21,10 +22,10 @@ export struct FirstLevelComponent { | ||
| 21 | Text('暂无数据').fontSize(20) | 22 | Text('暂无数据').fontSize(20) |
| 22 | }else { | 23 | }else { |
| 23 | TextPicker({range:this.labelList,selected:this.select}) | 24 | TextPicker({range:this.labelList,selected:this.select}) |
| 24 | - // .onChange((value:string,index:number) => { | ||
| 25 | - // this.select = index | ||
| 26 | - // this.currentFirst = EditInfoViewModel.getAreaListManageModel(this.dataSource[index]) | ||
| 27 | - // }) | 25 | + .onChange((value: string | string[], index: number | number[]) => { |
| 26 | + this.select = index as number | ||
| 27 | + this.currentFirst = EditInfoViewModel.getAreaListManageModel(this.dataSource[index as number]) | ||
| 28 | + }) | ||
| 28 | .backgroundColor(Color.White) | 29 | .backgroundColor(Color.White) |
| 29 | .border({color:'#e2e2e2',width:{right:0.5}}) | 30 | .border({color:'#e2e2e2',width:{right:0.5}}) |
| 30 | .width('100%') | 31 | .width('100%') |
| 1 | import { AreaListManageModel, AreaListModel } from '../../../model/AreaListModel'; | 1 | import { AreaListManageModel, AreaListModel } from '../../../model/AreaListModel'; |
| 2 | - | 2 | +import EditInfoViewModel from '../../../viewmodel/EditInfoViewModel'; |
| 3 | @Component | 3 | @Component |
| 4 | export struct SecondLevelComponent { | 4 | export struct SecondLevelComponent { |
| 5 | @State mTip: string = '暂无数据' | 5 | @State mTip: string = '暂无数据' |
| @@ -8,13 +8,6 @@ export struct SecondLevelComponent { | @@ -8,13 +8,6 @@ export struct SecondLevelComponent { | ||
| 8 | @Consume @Watch('onFirstChange') currentFirst: AreaListManageModel; | 8 | @Consume @Watch('onFirstChange') currentFirst: AreaListManageModel; |
| 9 | @Consume currentSecondBean: AreaListManageModel | 9 | @Consume currentSecondBean: AreaListManageModel |
| 10 | 10 | ||
| 11 | - aboutToAppear(){ | ||
| 12 | - for (let index = 0; index < this.currentFirst.children.length; index++) { | ||
| 13 | - const element = this.currentFirst.children[index]; | ||
| 14 | - this.labelList.push(element.label) | ||
| 15 | - } | ||
| 16 | - } | ||
| 17 | - | ||
| 18 | build() { | 11 | build() { |
| 19 | Column(){ | 12 | Column(){ |
| 20 | Column(){ | 13 | Column(){ |
| @@ -22,10 +15,10 @@ export struct SecondLevelComponent { | @@ -22,10 +15,10 @@ export struct SecondLevelComponent { | ||
| 22 | Text(this.mTip).fontSize(20) | 15 | Text(this.mTip).fontSize(20) |
| 23 | }else { | 16 | }else { |
| 24 | TextPicker({range:this.labelList,selected:this.select}) | 17 | TextPicker({range:this.labelList,selected:this.select}) |
| 25 | - // .onChange((value:string,index:number) => { | ||
| 26 | - // this.select = index | ||
| 27 | - // this.currentSecondBean = this.currentFirst.children[index] | ||
| 28 | - // }) | 18 | + .onChange((value: string | string[], index: number | number[]) => { |
| 19 | + this.select = index as number | ||
| 20 | + this.currentSecondBean = EditInfoViewModel.getAreaListManageModel(this.currentFirst.children[index as number]) | ||
| 21 | + }) | ||
| 29 | .backgroundColor(Color.White) | 22 | .backgroundColor(Color.White) |
| 30 | .border({color:'#e2e2e2',width:{right:0.5}}) | 23 | .border({color:'#e2e2e2',width:{right:0.5}}) |
| 31 | .width('100%') | 24 | .width('100%') |
| @@ -47,7 +40,7 @@ export struct SecondLevelComponent { | @@ -47,7 +40,7 @@ export struct SecondLevelComponent { | ||
| 47 | const element = this.currentFirst.children[index]; | 40 | const element = this.currentFirst.children[index]; |
| 48 | this.labelList.push(element.label) | 41 | this.labelList.push(element.label) |
| 49 | } | 42 | } |
| 50 | - // this.currentSecondBean = this.currentFirst.children[this.select] | 43 | + this.currentSecondBean = EditInfoViewModel.getAreaListManageModel(this.currentFirst.children[this.select]) |
| 51 | } | 44 | } |
| 52 | } | 45 | } |
| 53 | } | 46 | } |
| 1 | import { AreaListManageModel, AreaListModel } from '../../../model/AreaListModel'; | 1 | import { AreaListManageModel, AreaListModel } from '../../../model/AreaListModel'; |
| 2 | - | 2 | +import EditInfoViewModel from '../../../viewmodel/EditInfoViewModel'; |
| 3 | @Component | 3 | @Component |
| 4 | export struct ThirdLevelComponent { | 4 | export struct ThirdLevelComponent { |
| 5 | @State mTip: string = '暂无数据' | 5 | @State mTip: string = '暂无数据' |
| @@ -9,13 +9,6 @@ export struct ThirdLevelComponent { | @@ -9,13 +9,6 @@ export struct ThirdLevelComponent { | ||
| 9 | @Consume @Watch('onSecondChange') currentSecondBean: AreaListManageModel; | 9 | @Consume @Watch('onSecondChange') currentSecondBean: AreaListManageModel; |
| 10 | @Consume currentThirdBean: AreaListManageModel | 10 | @Consume currentThirdBean: AreaListManageModel |
| 11 | 11 | ||
| 12 | - aboutToAppear(){ | ||
| 13 | - for (let index = 0; index < this.currentSecondBean.children.length; index++) { | ||
| 14 | - const element = this.currentSecondBean.children[index]; | ||
| 15 | - this.labelList.push(element.label) | ||
| 16 | - } | ||
| 17 | - } | ||
| 18 | - | ||
| 19 | build() { | 12 | build() { |
| 20 | Column(){ | 13 | Column(){ |
| 21 | Column(){ | 14 | Column(){ |
| @@ -23,10 +16,10 @@ export struct ThirdLevelComponent { | @@ -23,10 +16,10 @@ export struct ThirdLevelComponent { | ||
| 23 | Text(this.mTip).fontSize(20) | 16 | Text(this.mTip).fontSize(20) |
| 24 | }else { | 17 | }else { |
| 25 | TextPicker({range:this.labelList,selected:this.select}) | 18 | TextPicker({range:this.labelList,selected:this.select}) |
| 26 | - // .onChange((value:string,index:number) => { | ||
| 27 | - // this.select = index | ||
| 28 | - // this.currentThirdBean = this.currentSecondBean.children[index] | ||
| 29 | - // }) | 19 | + .onChange((value: string | string[], index: number | number[]) => { |
| 20 | + this.select = index as number | ||
| 21 | + this.currentThirdBean = EditInfoViewModel.getAreaListManageModel(this.currentSecondBean.children[index as number]) | ||
| 22 | + }) | ||
| 30 | .backgroundColor(Color.White) | 23 | .backgroundColor(Color.White) |
| 31 | .border({color:'#e2e2e2',width:{right:0.5}}) | 24 | .border({color:'#e2e2e2',width:{right:0.5}}) |
| 32 | .width('100%') | 25 | .width('100%') |
| @@ -52,7 +45,7 @@ export struct ThirdLevelComponent { | @@ -52,7 +45,7 @@ export struct ThirdLevelComponent { | ||
| 52 | const element = this.currentSecondBean.children[index]; | 45 | const element = this.currentSecondBean.children[index]; |
| 53 | this.labelList.push(element.label) | 46 | this.labelList.push(element.label) |
| 54 | } | 47 | } |
| 55 | - // this.currentThirdBean = this.currentSecondBean.children[this.select] | 48 | + this.currentThirdBean = EditInfoViewModel.getAreaListManageModel(this.currentSecondBean.children[this.select]) |
| 56 | } | 49 | } |
| 57 | } | 50 | } |
| 58 | } | 51 | } |
-
Please register or login to post a comment