wangliang_wd

feat:编辑资料全屏适配,优化我的收藏展示

1 import { CompStyle } from 'wdConstant'; 1 import { CompStyle } from 'wdConstant';
2 import { CompDTO, ContentDTO } from 'wdBean'; 2 import { CompDTO, ContentDTO } from 'wdBean';
3 import { Card2Component } from './cardview/Card2Component'; 3 import { Card2Component } from './cardview/Card2Component';
4 -// import { Card3Component } from './cardview/Card3Component'; 4 +import { Card3Component } from './cardview/Card3Component';
5 import { Card4Component } from './cardview/Card4Component'; 5 import { Card4Component } from './cardview/Card4Component';
6 import { Card5Component } from './cardview/Card5Component'; 6 import { Card5Component } from './cardview/Card5Component';
7 import { Card6Component } from './cardview/Card6Component'; 7 import { Card6Component } from './cardview/Card6Component';
@@ -61,10 +61,12 @@ export struct CardParser { @@ -61,10 +61,12 @@ export struct CardParser {
61 if (contentDTO.appStyle === CompStyle.Card_02) { 61 if (contentDTO.appStyle === CompStyle.Card_02) {
62 Card2Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName }) 62 Card2Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName })
63 } else if (contentDTO.appStyle === CompStyle.Card_04) { 63 } else if (contentDTO.appStyle === CompStyle.Card_04) {
  64 + Card3Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName })
  65 + }else if (contentDTO.appStyle === CompStyle.Card_03) {
64 Card4Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName }) 66 Card4Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName })
65 } else if (contentDTO.appStyle === CompStyle.Card_05) { 67 } else if (contentDTO.appStyle === CompStyle.Card_05) {
66 Card5Component({ compDTO: this.compDTO, contentDTO, titleShowPolicy: this.compDTO.titleShowPolicy, pageId: this.pageId, pageName: this.pageName}) 68 Card5Component({ compDTO: this.compDTO, contentDTO, titleShowPolicy: this.compDTO.titleShowPolicy, pageId: this.pageId, pageName: this.pageName})
67 - } else if (contentDTO.appStyle === CompStyle.Card_06 ) { 69 + } else if (contentDTO.appStyle === CompStyle.Card_06 || contentDTO.appStyle === CompStyle.Card_13 ) {
68 Card6Component({ compDTO: this.compDTO, contentDTO: this.contentDTO, pageId: this.pageId, pageName: this.pageName }) 70 Card6Component({ compDTO: this.compDTO, contentDTO: this.contentDTO, pageId: this.pageId, pageName: this.pageName })
69 } else if (contentDTO.appStyle === CompStyle.Card_10) { 71 } else if (contentDTO.appStyle === CompStyle.Card_10) {
70 Card10Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName }) 72 Card10Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName })
@@ -19,7 +19,8 @@ struct EditUserInfoPage { @@ -19,7 +19,8 @@ struct EditUserInfoPage {
19 @State headerImg: string = '' 19 @State headerImg: string = ''
20 @State dataSource: AreaListModel[] = [] 20 @State dataSource: AreaListModel[] = []
21 @State currentUserInfo: editModel = new editModel() 21 @State currentUserInfo: editModel = new editModel()
22 - @State bottomSafeHeight: number = 0; 22 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  23 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
23 24
24 dialogController: CustomDialogController = new CustomDialogController({ 25 dialogController: CustomDialogController = new CustomDialogController({
25 builder: AreaPickerDialog({dataSource:this.dataSource, 26 builder: AreaPickerDialog({dataSource:this.dataSource,
@@ -34,10 +35,7 @@ struct EditUserInfoPage { @@ -34,10 +35,7 @@ struct EditUserInfoPage {
34 }), 35 }),
35 alignment: DialogAlignment.Bottom, 36 alignment: DialogAlignment.Bottom,
36 customStyle: true, 37 customStyle: true,
37 - offset: {  
38 - dx: 0,  
39 - dy: -this.bottomSafeHeight  
40 - }, 38 + closeAnimation:{duration:0}
41 }) 39 })
42 40
43 dateDialogController: CustomDialogController = new CustomDialogController({ 41 dateDialogController: CustomDialogController = new CustomDialogController({
@@ -53,10 +51,7 @@ struct EditUserInfoPage { @@ -53,10 +51,7 @@ struct EditUserInfoPage {
53 }), 51 }),
54 alignment: DialogAlignment.Bottom, 52 alignment: DialogAlignment.Bottom,
55 customStyle: true, 53 customStyle: true,
56 - offset: {  
57 - dx: 0,  
58 - dy: -this.bottomSafeHeight  
59 - }, 54 + closeAnimation:{duration:0}
60 }) 55 })
61 56
62 sexDialogController: CustomDialogController = new CustomDialogController({ 57 sexDialogController: CustomDialogController = new CustomDialogController({
@@ -69,15 +64,10 @@ struct EditUserInfoPage { @@ -69,15 +64,10 @@ struct EditUserInfoPage {
69 }), 64 }),
70 alignment: DialogAlignment.Bottom, 65 alignment: DialogAlignment.Bottom,
71 customStyle: true, 66 customStyle: true,
72 - offset: {  
73 - dx: 0,  
74 - dy: -this.bottomSafeHeight  
75 - }, 67 + closeAnimation:{duration:0}
76 }) 68 })
77 69
78 - async aboutToAppear() {  
79 - let windowHight: window.Window = await window.getLastWindow(getContext(this));  
80 - this.bottomSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).bottomRect.height) 70 + aboutToAppear() {
81 this.getAccountOwnerInfo() 71 this.getAccountOwnerInfo()
82 this.getAreaList() 72 this.getAreaList()
83 } 73 }
@@ -142,6 +132,7 @@ struct EditUserInfoPage { @@ -142,6 +132,7 @@ struct EditUserInfoPage {
142 } 132 }
143 .width('100%') 133 .width('100%')
144 .height('100%') 134 .height('100%')
  135 + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
145 } 136 }
146 137
147 @Builder 138 @Builder
@@ -9,6 +9,8 @@ struct EditUserIntroductionPage { @@ -9,6 +9,8 @@ struct EditUserIntroductionPage {
9 @State textColor : string = '#222222' 9 @State textColor : string = '#222222'
10 @State introduction: string = '' 10 @State introduction: string = ''
11 @State params:editModelParams = router.getParams() as editModelParams; 11 @State params:editModelParams = router.getParams() as editModelParams;
  12 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  13 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
12 build() { 14 build() {
13 Column(){ 15 Column(){
14 CustomTitleUI({titleName:'修改简介'}) 16 CustomTitleUI({titleName:'修改简介'})
@@ -63,6 +65,7 @@ struct EditUserIntroductionPage { @@ -63,6 +65,7 @@ struct EditUserIntroductionPage {
63 this.updateEditModel() 65 this.updateEditModel()
64 }) 66 })
65 } 67 }
  68 + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
66 } 69 }
67 70
68 71
@@ -12,6 +12,8 @@ struct EditUserNikeNamePage { @@ -12,6 +12,8 @@ struct EditUserNikeNamePage {
12 @State textColor : string = '#222222' 12 @State textColor : string = '#222222'
13 @State nikeName: string = '' 13 @State nikeName: string = ''
14 @State params:editModelParams = router.getParams() as editModelParams; 14 @State params:editModelParams = router.getParams() as editModelParams;
  15 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  16 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
15 build() { 17 build() {
16 Column(){ 18 Column(){
17 CustomTitleUI({titleName:'修改昵称'}) 19 CustomTitleUI({titleName:'修改昵称'})
@@ -66,7 +68,7 @@ struct EditUserNikeNamePage { @@ -66,7 +68,7 @@ struct EditUserNikeNamePage {
66 ///内部更新 68 ///内部更新
67 this.updateEditModel() 69 this.updateEditModel()
68 }) 70 })
69 - } 71 + }.padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
70 } 72 }
71 73
72 async updateEditModel(){ 74 async updateEditModel(){
@@ -20,6 +20,8 @@ struct InteractMessagePage { @@ -20,6 +20,8 @@ struct InteractMessagePage {
20 private scroller: Scroller = new Scroller(); 20 private scroller: Scroller = new Scroller();
21 @State likeNum: number = 0 21 @State likeNum: number = 0
22 @State currentPage: number = 1; 22 @State currentPage: number = 1;
  23 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  24 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
23 25
24 aboutToAppear(){ 26 aboutToAppear(){
25 this.getData() 27 this.getData()
@@ -58,6 +60,8 @@ struct InteractMessagePage { @@ -58,6 +60,8 @@ struct InteractMessagePage {
58 } 60 }
59 .width(CommonConstants.FULL_WIDTH) 61 .width(CommonConstants.FULL_WIDTH)
60 .height(CommonConstants.FULL_HEIGHT) 62 .height(CommonConstants.FULL_HEIGHT)
  63 + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
  64 +
61 } 65 }
62 66
63 @Builder ListLayout() { 67 @Builder ListLayout() {
@@ -34,6 +34,8 @@ struct MyCollectionListPage { @@ -34,6 +34,8 @@ struct MyCollectionListPage {
34 @State currentPage: number = 1; 34 @State currentPage: number = 1;
35 private scroller: Scroller = new Scroller(); 35 private scroller: Scroller = new Scroller();
36 emptyType: WDViewDefaultType = WDViewDefaultType.WDViewDefaultType_Default 36 emptyType: WDViewDefaultType = WDViewDefaultType.WDViewDefaultType_Default
  37 + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
  38 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
37 39
38 dialogController: CustomDialogController = new CustomDialogController({ 40 dialogController: CustomDialogController = new CustomDialogController({
39 builder: MyCustomDialog({ 41 builder: MyCustomDialog({
@@ -120,6 +122,8 @@ struct MyCollectionListPage { @@ -120,6 +122,8 @@ struct MyCollectionListPage {
120 .backgroundColor('#FFFFFF') 122 .backgroundColor('#FFFFFF')
121 .width(CommonConstants.FULL_WIDTH) 123 .width(CommonConstants.FULL_WIDTH)
122 .height(CommonConstants.FULL_HEIGHT) 124 .height(CommonConstants.FULL_HEIGHT)
  125 + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)})
  126 +
123 } 127 }
124 128
125 @Builder ListLayout() { 129 @Builder ListLayout() {
@@ -149,16 +153,14 @@ struct MyCollectionListPage { @@ -149,16 +153,14 @@ struct MyCollectionListPage {
149 selectCallback:(isOn)=>{ 153 selectCallback:(isOn)=>{
150 this.addCompDTO(isOn,compDTO) 154 this.addCompDTO(isOn,compDTO)
151 } 155 }
152 - })  
153 - .margin({left:16})  
154 - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }); 156 + }).margin({left:16})
155 } 157 }
156 Column() { 158 Column() {
157 BigPicCardComponent({compDTO:new CompDTO,contentDTO:compDTO,pageId:TrackConstants.PageName.My_Collect,pageName:TrackConstants.PageName.My_Collect}) 159 BigPicCardComponent({compDTO:new CompDTO,contentDTO:compDTO,pageId:TrackConstants.PageName.My_Collect,pageName:TrackConstants.PageName.My_Collect})
158 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }); 160 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 });
159 } 161 }
160 }.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { 162 }.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
161 - if (isVisible) { 163 + if (isVisible && !this.isEditState) {
162 TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.My_Collect,TrackConstants.PageName.My_Collect, TrackParamConvert.program(compDTO)) 164 TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.My_Collect,TrackConstants.PageName.My_Collect, TrackParamConvert.program(compDTO))
163 } 165 }
164 }) 166 })
@@ -291,6 +293,7 @@ struct MyCollectionListPage { @@ -291,6 +293,7 @@ struct MyCollectionListPage {
291 compDTO.interactData = this.commentList[index] 293 compDTO.interactData = this.commentList[index]
292 datas.push(compDTO) 294 datas.push(compDTO)
293 } 295 }
  296 + this.allDatas = []
294 this.allDatas.push(...datas) 297 this.allDatas.push(...datas)
295 } catch (exception) { 298 } catch (exception) {
296 } 299 }