Showing
5 changed files
with
70 additions
and
54 deletions
| @@ -42,7 +42,7 @@ export struct InteractMComponent { | @@ -42,7 +42,7 @@ export struct InteractMComponent { | ||
| 42 | .constraintSize({maxHeight:500}) | 42 | .constraintSize({maxHeight:500}) |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | - if(this.messageModel.contentType != '211' && this.messageModel.contentType != '210'){ | 45 | + if(this.messageModel.contentType != '211'){ |
| 46 | Column(){ | 46 | Column(){ |
| 47 | if (this.messageModel.contentType === '207' || this.messageModel.contentType === '209'){ | 47 | if (this.messageModel.contentType === '207' || this.messageModel.contentType === '209'){ |
| 48 | Text('[你的评论]'+this.buildCommentContent()).fontSize('14fp').fontColor('#666666').constraintSize({maxHeight:500}) | 48 | Text('[你的评论]'+this.buildCommentContent()).fontSize('14fp').fontColor('#666666').constraintSize({maxHeight:500}) |
| @@ -27,7 +27,7 @@ struct EditUserInfoPage { | @@ -27,7 +27,7 @@ struct EditUserInfoPage { | ||
| 27 | } | 27 | } |
| 28 | }), | 28 | }), |
| 29 | alignment: DialogAlignment.Bottom, | 29 | alignment: DialogAlignment.Bottom, |
| 30 | - offset:{dx:0,dy:-20}, | 30 | + offset:{dx:0,dy:0}, |
| 31 | }) | 31 | }) |
| 32 | 32 | ||
| 33 | aboutToAppear() { | 33 | aboutToAppear() { |
| @@ -104,7 +104,7 @@ struct EditUserInfoPage { | @@ -104,7 +104,7 @@ struct EditUserInfoPage { | ||
| 104 | .textOverflow({overflow:TextOverflow.Ellipsis}) | 104 | .textOverflow({overflow:TextOverflow.Ellipsis}) |
| 105 | .maxLines(1) | 105 | .maxLines(1) |
| 106 | .fontSize(14) | 106 | .fontSize(14) |
| 107 | - .fontColor(r.subTitle === '待完善'?'#999999':'#666666') | 107 | + .fontColor(r.subTitle === '待完善'?'#cccccc':'#666666') |
| 108 | .padding({right:10}) | 108 | .padding({right:10}) |
| 109 | .width('70%') | 109 | .width('70%') |
| 110 | .textAlign(TextAlign.End) | 110 | .textAlign(TextAlign.End) |
| @@ -8,6 +8,7 @@ import { CustomTitleUI } from '../reusable/CustomTitleUI'; | @@ -8,6 +8,7 @@ import { CustomTitleUI } from '../reusable/CustomTitleUI'; | ||
| 8 | import { InteractMComponent } from '../InteractMessage/InteractMComponent'; | 8 | import { InteractMComponent } from '../InteractMessage/InteractMComponent'; |
| 9 | import { InteractMessageModel, WDMessageCenterMessageType } from '../../model/InteractMessageModel'; | 9 | import { InteractMessageModel, WDMessageCenterMessageType } from '../../model/InteractMessageModel'; |
| 10 | import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh'; | 10 | import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh'; |
| 11 | +import { NetworkUtil } from 'wdKit/Index'; | ||
| 11 | 12 | ||
| 12 | @Entry | 13 | @Entry |
| 13 | @Component | 14 | @Component |
| @@ -28,10 +29,9 @@ struct InteractMessagePage { | @@ -28,10 +29,9 @@ struct InteractMessagePage { | ||
| 28 | build() { | 29 | build() { |
| 29 | Column(){ | 30 | Column(){ |
| 30 | CustomTitleUI({titleName:'互动消息'}) | 31 | CustomTitleUI({titleName:'互动消息'}) |
| 31 | - if(this.browSingModel.viewType == ViewType.ERROR){ | ||
| 32 | - EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NetworkFailed}) | ||
| 33 | - }else if(this.browSingModel.viewType == ViewType.EMPTY){ | ||
| 34 | - EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoMessage}) | 32 | + |
| 33 | + if(this.browSingModel.viewType == ViewType.EMPTY){ | ||
| 34 | + EmptyComponent({emptyType:this.browSingModel.emptyType}) | ||
| 35 | }else { | 35 | }else { |
| 36 | CustomPullToRefresh({ | 36 | CustomPullToRefresh({ |
| 37 | alldata:this.allDatas, | 37 | alldata:this.allDatas, |
| @@ -114,32 +114,40 @@ struct InteractMessagePage { | @@ -114,32 +114,40 @@ struct InteractMessagePage { | ||
| 114 | } | 114 | } |
| 115 | 115 | ||
| 116 | async getData(resolve?: (value: string | PromiseLike<string>) => void){ | 116 | async getData(resolve?: (value: string | PromiseLike<string>) => void){ |
| 117 | - InteractMessageViewModel.fetchMessageList(WDMessageCenterMessageType.WDMessageCenterMessageType_Interact,this.currentPage).then(InteractMessageMItem => { | ||
| 118 | - if(resolve) resolve('刷新成功') | ||
| 119 | - if (InteractMessageMItem && InteractMessageMItem.list && InteractMessageMItem.list.length > 0) { | ||
| 120 | - this.browSingModel.viewType = ViewType.LOADED; | ||
| 121 | 117 | ||
| 122 | - if (this.currentPage === 1) { | ||
| 123 | - this.allDatas = [] | ||
| 124 | - } | 118 | + let netStatus = NetworkUtil.isNetConnected() |
| 119 | + if (netStatus) { | ||
| 120 | + InteractMessageViewModel.fetchMessageList(WDMessageCenterMessageType.WDMessageCenterMessageType_Interact,this.currentPage).then(InteractMessageMItem => { | ||
| 121 | + if(resolve) resolve('刷新成功') | ||
| 122 | + if (InteractMessageMItem && InteractMessageMItem.list && InteractMessageMItem.list.length > 0) { | ||
| 123 | + this.browSingModel.viewType = ViewType.LOADED; | ||
| 125 | 124 | ||
| 126 | - for (let index = 0; index < InteractMessageMItem.list.length; index++) { | ||
| 127 | - const element = InteractMessageMItem.list[index]; | ||
| 128 | - element.InteractMsubM = JSON.parse(element.remark) | ||
| 129 | - this.allDatas.push(element) | ||
| 130 | - } | 125 | + if (this.currentPage === 1) { |
| 126 | + this.allDatas = [] | ||
| 127 | + } | ||
| 131 | 128 | ||
| 132 | - if (InteractMessageMItem.hasNext === 0) { | ||
| 133 | - this.browSingModel.hasMore = false; | 129 | + for (let index = 0; index < InteractMessageMItem.list.length; index++) { |
| 130 | + const element = InteractMessageMItem.list[index]; | ||
| 131 | + element.InteractMsubM = JSON.parse(element.remark) | ||
| 132 | + this.allDatas.push(element) | ||
| 133 | + } | ||
| 134 | + | ||
| 135 | + if (InteractMessageMItem.hasNext === 0) { | ||
| 136 | + this.browSingModel.hasMore = false; | ||
| 137 | + } else { | ||
| 138 | + this.browSingModel.hasMore = true; | ||
| 139 | + } | ||
| 134 | } else { | 140 | } else { |
| 135 | - this.browSingModel.hasMore = true; | ||
| 136 | - } | ||
| 137 | - } else { | ||
| 138 | - if (this.currentPage === 1) { | ||
| 139 | - this.browSingModel.viewType = ViewType.EMPTY; | 141 | + if (this.currentPage === 1) { |
| 142 | + this.browSingModel.viewType = ViewType.EMPTY; | ||
| 143 | + this.browSingModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoMessage; | ||
| 144 | + } | ||
| 140 | } | 145 | } |
| 141 | - } | ||
| 142 | - }) | 146 | + }) |
| 147 | + }else { | ||
| 148 | + this.browSingModel.viewType = ViewType.EMPTY; | ||
| 149 | + this.browSingModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoNetwork; | ||
| 150 | + } | ||
| 143 | } | 151 | } |
| 144 | 152 | ||
| 145 | async getMessageLikeCount(){ | 153 | async getMessageLikeCount(){ |
| @@ -12,6 +12,7 @@ import { BigPicCardComponent } from '../view/BigPicCardComponent'; | @@ -12,6 +12,7 @@ import { BigPicCardComponent } from '../view/BigPicCardComponent'; | ||
| 12 | import { contentListItemParams } from '../../model/MyCollectionModel'; | 12 | import { contentListItemParams } from '../../model/MyCollectionModel'; |
| 13 | import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh'; | 13 | import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh'; |
| 14 | import { MyCustomDialog } from '../reusable/MyCustomDialog' | 14 | import { MyCustomDialog } from '../reusable/MyCustomDialog' |
| 15 | +import { NetworkUtil } from 'wdKit/Index'; | ||
| 15 | 16 | ||
| 16 | @Entry | 17 | @Entry |
| 17 | @Component | 18 | @Component |
| @@ -26,6 +27,7 @@ struct MyCollectionListPage { | @@ -26,6 +27,7 @@ struct MyCollectionListPage { | ||
| 26 | 27 | ||
| 27 | @State currentPage: number = 1; | 28 | @State currentPage: number = 1; |
| 28 | private scroller: Scroller = new Scroller(); | 29 | private scroller: Scroller = new Scroller(); |
| 30 | + emptyType: WDViewDefaultType = WDViewDefaultType.WDViewDefaultType_Default | ||
| 29 | 31 | ||
| 30 | dialogController: CustomDialogController = new CustomDialogController({ | 32 | dialogController: CustomDialogController = new CustomDialogController({ |
| 31 | builder: MyCustomDialog({ | 33 | builder: MyCustomDialog({ |
| @@ -53,10 +55,8 @@ struct MyCollectionListPage { | @@ -53,10 +55,8 @@ struct MyCollectionListPage { | ||
| 53 | this.deleteNum = 0 | 55 | this.deleteNum = 0 |
| 54 | }}) | 56 | }}) |
| 55 | 57 | ||
| 56 | - if(this.browSingModel.viewType == ViewType.ERROR){ | ||
| 57 | - ErrorComponent() | ||
| 58 | - }else if(this.browSingModel.viewType == ViewType.EMPTY){ | ||
| 59 | - EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoCollection}) | 58 | + if(this.browSingModel.viewType == ViewType.EMPTY){ |
| 59 | + EmptyComponent({emptyType:this.browSingModel.emptyType}) | ||
| 60 | }else { | 60 | }else { |
| 61 | CustomPullToRefresh({ | 61 | CustomPullToRefresh({ |
| 62 | alldata:this.allDatas, | 62 | alldata:this.allDatas, |
| @@ -137,31 +137,39 @@ struct MyCollectionListPage { | @@ -137,31 +137,39 @@ struct MyCollectionListPage { | ||
| 137 | } | 137 | } |
| 138 | } | 138 | } |
| 139 | 139 | ||
| 140 | + | ||
| 140 | async getData(resolve?: (value: string | PromiseLike<string>) => void) { | 141 | async getData(resolve?: (value: string | PromiseLike<string>) => void) { |
| 141 | - MyCollectionViewModel.fetchMyCollectList(1,'1',this.currentPage,getContext(this)).then(collectionItem => { | ||
| 142 | - if(resolve) resolve('刷新成功') | ||
| 143 | - if (collectionItem && collectionItem.list && collectionItem.list.length > 0) { | ||
| 144 | - if (this.currentPage === 1) { | ||
| 145 | - this.allDatas = [] | ||
| 146 | - } | 142 | + let netStatus = NetworkUtil.isNetConnected() |
| 143 | + if (netStatus) { | ||
| 144 | + MyCollectionViewModel.fetchMyCollectList(1,'1',this.currentPage,getContext(this)).then(collectionItem => { | ||
| 145 | + if(resolve) resolve('刷新成功') | ||
| 146 | + if (collectionItem && collectionItem.list && collectionItem.list.length > 0) { | ||
| 147 | + if (this.currentPage === 1) { | ||
| 148 | + this.allDatas = [] | ||
| 149 | + } | ||
| 147 | 150 | ||
| 148 | - for (let index = 0; index < collectionItem.list.length; index++) { | ||
| 149 | - const compDTO = collectionItem.list[index]; | ||
| 150 | - compDTO.isCollection = true ///用于时间展示 | ||
| 151 | - this.allDatas.push(compDTO) | ||
| 152 | - } | 151 | + for (let index = 0; index < collectionItem.list.length; index++) { |
| 152 | + const compDTO = collectionItem.list[index]; | ||
| 153 | + compDTO.isCollection = true ///用于时间展示 | ||
| 154 | + this.allDatas.push(compDTO) | ||
| 155 | + } | ||
| 153 | 156 | ||
| 154 | - if (collectionItem.hasNext === 0) { | ||
| 155 | - this.browSingModel.hasMore = false; | 157 | + if (collectionItem.hasNext === 0) { |
| 158 | + this.browSingModel.hasMore = false; | ||
| 159 | + } else { | ||
| 160 | + this.browSingModel.hasMore = true; | ||
| 161 | + } | ||
| 156 | } else { | 162 | } else { |
| 157 | - this.browSingModel.hasMore = true; | ||
| 158 | - } | ||
| 159 | - } else { | ||
| 160 | - if (this.currentPage === 1) { | ||
| 161 | - this.browSingModel.viewType = ViewType.EMPTY; | 163 | + if (this.currentPage === 1) { |
| 164 | + this.browSingModel.viewType = ViewType.EMPTY; | ||
| 165 | + this.browSingModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoCollection | ||
| 166 | + } | ||
| 162 | } | 167 | } |
| 163 | - } | ||
| 164 | - }) | 168 | + }) |
| 169 | + } else { | ||
| 170 | + this.browSingModel.viewType = ViewType.EMPTY; | ||
| 171 | + this.browSingModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoNetwork; | ||
| 172 | + } | ||
| 165 | } | 173 | } |
| 166 | 174 | ||
| 167 | //数据处理 | 175 | //数据处理 |
| @@ -52,11 +52,11 @@ class EditInfoViewModel { | @@ -52,11 +52,11 @@ class EditInfoViewModel { | ||
| 52 | if (editDTO.code == 0) { | 52 | if (editDTO.code == 0) { |
| 53 | success(editDTO.data) | 53 | success(editDTO.data) |
| 54 | }else { | 54 | }else { |
| 55 | - success(this.GetqueryAccountOwnerLocal(context)) | 55 | + // success(this.GetqueryAccountOwnerLocal(context)) |
| 56 | } | 56 | } |
| 57 | }).catch((error: Error) => { | 57 | }).catch((error: Error) => { |
| 58 | Logger.info(TAG,'queryAccountOwnerInfo','EditInfoViewModel') | 58 | Logger.info(TAG,'queryAccountOwnerInfo','EditInfoViewModel') |
| 59 | - success(this.GetqueryAccountOwnerLocal(context)) | 59 | + // success(this.GetqueryAccountOwnerLocal(context)) |
| 60 | }) | 60 | }) |
| 61 | })) | 61 | })) |
| 62 | } | 62 | } |
-
Please register or login to post a comment