Showing
28 changed files
with
146 additions
and
72 deletions
| @@ -17,6 +17,14 @@ export enum EmitterEventId { | @@ -17,6 +17,14 @@ export enum EmitterEventId { | ||
| 17 | 17 | ||
| 18 | // 关注,取消关注 | 18 | // 关注,取消关注 |
| 19 | PEOPLE_SHIP_ATTENTION = 7, | 19 | PEOPLE_SHIP_ATTENTION = 7, |
| 20 | + // 我的关注 为null | ||
| 21 | + MY_FOLLOW_EMPTY = 8, | ||
| 22 | + | ||
| 23 | + // 登录成功 | ||
| 24 | + LOGIN_SUCCESS = 8, | ||
| 25 | + | ||
| 26 | + // 换绑成功 | ||
| 27 | + PHONE_CHANGE_SUCCESS = 9, | ||
| 20 | 28 | ||
| 21 | // App回到前台 | 29 | // App回到前台 |
| 22 | APP_ENTER_FOREGROUD = 100, | 30 | APP_ENTER_FOREGROUD = 100, |
| @@ -44,7 +44,7 @@ export struct CompParser { | @@ -44,7 +44,7 @@ export struct CompParser { | ||
| 44 | 44 | ||
| 45 | @Builder | 45 | @Builder |
| 46 | componentBuilder(compDTO: CompDTO, compIndex: number) { | 46 | componentBuilder(compDTO: CompDTO, compIndex: number) { |
| 47 | - // if (compDTO.operDataList[0]?.objectType !== '3' && compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口 | 47 | + if (compDTO.operDataList[0]?.objectType !== '3' && compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口 |
| 48 | if (compDTO.compStyle === CompStyle.Label_03) { | 48 | if (compDTO.compStyle === CompStyle.Label_03) { |
| 49 | LabelComponent({ compDTO: compDTO }) | 49 | LabelComponent({ compDTO: compDTO }) |
| 50 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 50 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) |
| @@ -119,6 +119,6 @@ export struct CompParser { | @@ -119,6 +119,6 @@ export struct CompParser { | ||
| 119 | } | 119 | } |
| 120 | } | 120 | } |
| 121 | 121 | ||
| 122 | - // } | 122 | + } |
| 123 | } | 123 | } |
| 124 | 124 |
| 1 | -import { AccountManagerUtils, Logger, DateTimeUtils, SPHelper, NumberFormatterUtils } from 'wdKit'; | 1 | +import { AccountManagerUtils, Logger, DateTimeUtils, SPHelper, NumberFormatterUtils, DisplayUtils } from 'wdKit'; |
| 2 | import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; | 2 | import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; |
| 3 | import { ContentDetailDTO,postBatchAttentionStatusParams, | 3 | import { ContentDetailDTO,postBatchAttentionStatusParams, |
| 4 | PhotoListBean, | 4 | PhotoListBean, |
| @@ -83,7 +83,7 @@ export struct DynamicDetailComponent { | @@ -83,7 +83,7 @@ export struct DynamicDetailComponent { | ||
| 83 | Image($r('app.media.ic_news_detail_division')) | 83 | Image($r('app.media.ic_news_detail_division')) |
| 84 | .width('100%') | 84 | .width('100%') |
| 85 | .height($r('app.float.margin_7')) | 85 | .height($r('app.float.margin_7')) |
| 86 | - .margin({left: $r('app.float.margin_16'), right: $r('app.float.margin_16')} ) | 86 | + .padding({left: $r('app.float.margin_16'), right: $r('app.float.margin_16')} ) |
| 87 | Stack({ alignContent: Alignment.Bottom }) { | 87 | Stack({ alignContent: Alignment.Bottom }) { |
| 88 | Scroll(this.scroller) { | 88 | Scroll(this.scroller) { |
| 89 | Column() { | 89 | Column() { |
| @@ -275,8 +275,8 @@ export struct DynamicDetailComponent { | @@ -275,8 +275,8 @@ export struct DynamicDetailComponent { | ||
| 275 | Image(this.contentDetailData.fullColumnImgUrls!= null && this.contentDetailData.fullColumnImgUrls.length>0&&!StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url)? | 275 | Image(this.contentDetailData.fullColumnImgUrls!= null && this.contentDetailData.fullColumnImgUrls.length>0&&!StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url)? |
| 276 | this.contentDetailData.fullColumnImgUrls[0].url: | 276 | this.contentDetailData.fullColumnImgUrls[0].url: |
| 277 | this.contentDetailData.videoInfo[0].firstFrameImageUri) | 277 | this.contentDetailData.videoInfo[0].firstFrameImageUri) |
| 278 | - .width(CommonConstants.FULL_WIDTH) | ||
| 279 | - .aspectRatio(16 / 9) | 278 | + .width(DisplayUtils.getDeviceWidth()- 32) |
| 279 | + .height((DisplayUtils.getDeviceWidth()-32)* 9 / 16) | ||
| 280 | .borderRadius($r('app.float.image_border_radius')) | 280 | .borderRadius($r('app.float.image_border_radius')) |
| 281 | CardMediaInfo({ contentDTO: this.mJumpInfo }) | 281 | CardMediaInfo({ contentDTO: this.mJumpInfo }) |
| 282 | } | 282 | } |
| @@ -291,7 +291,8 @@ export struct DynamicDetailComponent { | @@ -291,7 +291,8 @@ export struct DynamicDetailComponent { | ||
| 291 | Image(this.contentDetailData.fullColumnImgUrls!= null && this.contentDetailData.fullColumnImgUrls.length>0&&!StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url)? | 291 | Image(this.contentDetailData.fullColumnImgUrls!= null && this.contentDetailData.fullColumnImgUrls.length>0&&!StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url)? |
| 292 | this.contentDetailData.fullColumnImgUrls[0].url: | 292 | this.contentDetailData.fullColumnImgUrls[0].url: |
| 293 | this.contentDetailData.videoInfo[0].firstFrameImageUri) | 293 | this.contentDetailData.videoInfo[0].firstFrameImageUri) |
| 294 | - .width(CommonConstants.FULL_WIDTH) | 294 | + .width(DisplayUtils.getDeviceWidth()/2) |
| 295 | + .height(DisplayUtils.getDeviceWidth()/2* 4 / 3) | ||
| 295 | .borderRadius($r('app.float.image_border_radius')) | 296 | .borderRadius($r('app.float.image_border_radius')) |
| 296 | CardMediaInfo({ contentDTO: this.mJumpInfo }) | 297 | CardMediaInfo({ contentDTO: this.mJumpInfo }) |
| 297 | } | 298 | } |
| @@ -299,7 +300,7 @@ export struct DynamicDetailComponent { | @@ -299,7 +300,7 @@ export struct DynamicDetailComponent { | ||
| 299 | } | 300 | } |
| 300 | } | 301 | } |
| 301 | } | 302 | } |
| 302 | - .margin({ left: $r('app.float.margin_16'),right: $r('app.float.margin_16'),top: $r('app.float.margin_8')}) | 303 | + .padding({ left: this.contentDetailData.videoInfo[0].videoLandScape === 1?0: 16,top: $r('app.float.margin_8')}) |
| 303 | .onClick((event: ClickEvent) => { | 304 | .onClick((event: ClickEvent) => { |
| 304 | ProcessUtils.processPage(this.mJumpInfo) | 305 | ProcessUtils.processPage(this.mJumpInfo) |
| 305 | }) | 306 | }) |
| @@ -362,7 +363,7 @@ export struct DynamicDetailComponent { | @@ -362,7 +363,7 @@ export struct DynamicDetailComponent { | ||
| 362 | }) | 363 | }) |
| 363 | // 评论 | 364 | // 评论 |
| 364 | if (this.contentDetailData?.openComment) { | 365 | if (this.contentDetailData?.openComment) { |
| 365 | - Divider().strokeWidth(6).color('#f5f5f5') | 366 | + Divider().strokeWidth(6).color('#f5f5f5').margin({top:$r('app.float.margin_24')}) |
| 366 | CommentComponent({ | 367 | CommentComponent({ |
| 367 | publishCommentModel: { | 368 | publishCommentModel: { |
| 368 | targetId: String(this.contentDetailData?.newsId || ''), | 369 | targetId: String(this.contentDetailData?.newsId || ''), |
| 1 | import { ContentDTO, slideShows } from 'wdBean'; | 1 | import { ContentDTO, slideShows } from 'wdBean'; |
| 2 | -import { CommonConstants } from 'wdConstant' | ||
| 3 | -import { DateTimeUtils } from 'wdKit'; | 2 | +import { CommonConstants } from 'wdConstant'; |
| 4 | import { ProcessUtils } from 'wdRouter'; | 3 | import { ProcessUtils } from 'wdRouter'; |
| 5 | -import { CardSourceInfo } from '../cardCommon/CardSourceInfo' | ||
| 6 | -import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | 4 | +import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; |
| 7 | 5 | ||
| 8 | /** | 6 | /** |
| 9 | * 大专题卡--CompStyle: 10 | 7 | * 大专题卡--CompStyle: 10 |
| @@ -25,6 +23,9 @@ export struct Card10Component { | @@ -25,6 +23,9 @@ export struct Card10Component { | ||
| 25 | .maxLines(2) | 23 | .maxLines(2) |
| 26 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 24 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 27 | .margin({ bottom: 19 }) | 25 | .margin({ bottom: 19 }) |
| 26 | + .onClick((event: ClickEvent) => { | ||
| 27 | + ProcessUtils.processPage(this.contentDTO) | ||
| 28 | + }) | ||
| 28 | } | 29 | } |
| 29 | // 大图 | 30 | // 大图 |
| 30 | Stack() { | 31 | Stack() { |
| 1 | import { ContentDTO, slideShows } from 'wdBean'; | 1 | import { ContentDTO, slideShows } from 'wdBean'; |
| 2 | -import { CommonConstants } from 'wdConstant' | 2 | +import { CommonConstants } from 'wdConstant'; |
| 3 | import { DateTimeUtils } from 'wdKit'; | 3 | import { DateTimeUtils } from 'wdKit'; |
| 4 | import { ProcessUtils } from 'wdRouter'; | 4 | import { ProcessUtils } from 'wdRouter'; |
| 5 | 5 | ||
| @@ -104,10 +104,12 @@ export struct Card9Component { | @@ -104,10 +104,12 @@ export struct Card9Component { | ||
| 104 | Column() { | 104 | Column() { |
| 105 | Row() { | 105 | Row() { |
| 106 | // 标题 | 106 | // 标题 |
| 107 | - Image($r("app.media.timeline_rect")) | 107 | + Image($r("app.media.timeAxis")) |
| 108 | .width(9) | 108 | .width(9) |
| 109 | .height(9) | 109 | .height(9) |
| 110 | .margin({ right: 5 }) | 110 | .margin({ right: 5 }) |
| 111 | + .fillColor(item.newsTitleColor) | ||
| 112 | + | ||
| 111 | Text(DateTimeUtils.formatDate(item.publishTime, "MM月dd日 HH:mm")) | 113 | Text(DateTimeUtils.formatDate(item.publishTime, "MM月dd日 HH:mm")) |
| 112 | .fontSize($r('app.float.font_size_12')) | 114 | .fontSize($r('app.float.font_size_12')) |
| 113 | .fontColor($r('app.color.color_222222')) | 115 | .fontColor($r('app.color.color_222222')) |
| @@ -19,7 +19,7 @@ export struct FollowChildComponent{ | @@ -19,7 +19,7 @@ export struct FollowChildComponent{ | ||
| 19 | Row() { | 19 | Row() { |
| 20 | Row(){ | 20 | Row(){ |
| 21 | Stack({alignContent: Alignment.Bottom}){ | 21 | Stack({alignContent: Alignment.Bottom}){ |
| 22 | - Image(StringUtils.isEmpty(this.data.headPhotoUrl)?$r('app.media.default_head'):this.data.headPhotoUrl) | 22 | + Image(StringUtils.isEmpty(this.data.headPhotoUrl)?$r('app.media.icon_default_head_mater'):this.data.headPhotoUrl) |
| 23 | .objectFit(ImageFit.Auto) | 23 | .objectFit(ImageFit.Auto) |
| 24 | .width('92lpx') | 24 | .width('92lpx') |
| 25 | .height('92lpx') | 25 | .height('92lpx') |
| @@ -128,7 +128,7 @@ export struct FollowChildComponent{ | @@ -128,7 +128,7 @@ export struct FollowChildComponent{ | ||
| 128 | Row() { | 128 | Row() { |
| 129 | Row(){ | 129 | Row(){ |
| 130 | Stack({alignContent: Alignment.Bottom}){ | 130 | Stack({alignContent: Alignment.Bottom}){ |
| 131 | - Image(StringUtils.isEmpty(this.data.headPhotoUrl)?$r('app.media.default_head'):this.data.headPhotoUrl) | 131 | + Image(StringUtils.isEmpty(this.data.headPhotoUrl)?$r('app.media.icon_default_head_mater'):this.data.headPhotoUrl) |
| 132 | .objectFit(ImageFit.Auto) | 132 | .objectFit(ImageFit.Auto) |
| 133 | .width('92lpx') | 133 | .width('92lpx') |
| 134 | .height('92lpx') | 134 | .height('92lpx') |
| 1 | +import { EmitterUtils, EmitterEventId, Logger } from 'wdKit/Index' | ||
| 1 | import MinePageDatasModel from '../../../model/MinePageDatasModel' | 2 | import MinePageDatasModel from '../../../model/MinePageDatasModel' |
| 2 | import { FollowListItem } from '../../../viewmodel/FollowListItem' | 3 | import { FollowListItem } from '../../../viewmodel/FollowListItem' |
| 3 | import { CustomTitleUI } from '../../reusable/CustomTitleUI' | 4 | import { CustomTitleUI } from '../../reusable/CustomTitleUI' |
| @@ -20,16 +21,26 @@ export struct FollowFirstTabsComponent{ | @@ -20,16 +21,26 @@ export struct FollowFirstTabsComponent{ | ||
| 20 | }) | 21 | }) |
| 21 | 22 | ||
| 22 | if(this.controller != null && this.data.length>1 && this.changeIndex === 1){ | 23 | if(this.controller != null && this.data.length>1 && this.changeIndex === 1){ |
| 23 | - //个人主页 跳转 关注页 tab 2 | ||
| 24 | - let intervalID = setInterval(() => { | ||
| 25 | - this.currentIndex = this.changeIndex | ||
| 26 | - this.controller.changeIndex(this.currentIndex) | ||
| 27 | - clearInterval(intervalID); | ||
| 28 | - }, 500); | 24 | + this.jumpFollowNextPage() |
| 29 | } | 25 | } |
| 30 | }).catch((err:Error)=>{ | 26 | }).catch((err:Error)=>{ |
| 31 | console.log(TAG,JSON.stringify(err)) | 27 | console.log(TAG,JSON.stringify(err)) |
| 32 | }) | 28 | }) |
| 29 | + | ||
| 30 | + EmitterUtils.receiveEvent(EmitterEventId.MY_FOLLOW_EMPTY, (() => { | ||
| 31 | + if(this.controller != null && this.data.length>1 ){ | ||
| 32 | + this.jumpFollowNextPage() | ||
| 33 | + } | ||
| 34 | + })) | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + jumpFollowNextPage(){ | ||
| 38 | + //个人主页 跳转 关注页 tab 2 | ||
| 39 | + let intervalID = setInterval(() => { | ||
| 40 | + this.currentIndex = 1 | ||
| 41 | + this.controller.changeIndex(this.currentIndex) | ||
| 42 | + clearInterval(intervalID); | ||
| 43 | + }, 500); | ||
| 33 | } | 44 | } |
| 34 | 45 | ||
| 35 | @Builder TabBuilder(index: number, item: FollowListItem) { | 46 | @Builder TabBuilder(index: number, item: FollowListItem) { |
| 1 | -import { LazyDataSource, SPHelper, UserDataLocal } from 'wdKit'; | 1 | +import { EmitterEventId, EmitterUtils, LazyDataSource, SPHelper, UserDataLocal } from 'wdKit'; |
| 2 | import MinePageDatasModel from '../../../model/MinePageDatasModel'; | 2 | import MinePageDatasModel from '../../../model/MinePageDatasModel'; |
| 3 | import SearcherAboutDataModel from '../../../model/SearcherAboutDataModel'; | 3 | import SearcherAboutDataModel from '../../../model/SearcherAboutDataModel'; |
| 4 | import { CreatorDetailRequestItem } from '../../../viewmodel/CreatorDetailRequestItem'; | 4 | import { CreatorDetailRequestItem } from '../../../viewmodel/CreatorDetailRequestItem'; |
| @@ -70,7 +70,7 @@ export struct FollowListDetailUI { | @@ -70,7 +70,7 @@ export struct FollowListDetailUI { | ||
| 70 | Column() { | 70 | Column() { |
| 71 | if (this.count === 0) { | 71 | if (this.count === 0) { |
| 72 | if (this.isGetRequest == true) { | 72 | if (this.isGetRequest == true) { |
| 73 | - EmptyComponent({ emptyType: 14 }) | 73 | + EmptyComponent({ emptyType: 14,emptyHeight:"100%" }) |
| 74 | .layoutWeight(1) | 74 | .layoutWeight(1) |
| 75 | .width('100%') | 75 | .width('100%') |
| 76 | } | 76 | } |
| @@ -156,10 +156,12 @@ export struct FollowListDetailUI { | @@ -156,10 +156,12 @@ export struct FollowListDetailUI { | ||
| 156 | } | 156 | } |
| 157 | this.isLoading = false | 157 | this.isLoading = false |
| 158 | this.isGetRequest = true | 158 | this.isGetRequest = true |
| 159 | + this.sendFollowMessage() | ||
| 159 | }).catch((err: Error) => { | 160 | }).catch((err: Error) => { |
| 160 | console.log(TAG, "请求失败") | 161 | console.log(TAG, "请求失败") |
| 161 | this.isGetRequest = true | 162 | this.isGetRequest = true |
| 162 | this.isLoading = false | 163 | this.isLoading = false |
| 164 | + this.sendFollowMessage() | ||
| 163 | }) | 165 | }) |
| 164 | } else { | 166 | } else { |
| 165 | this.isLoading = false | 167 | this.isLoading = false |
| @@ -167,6 +169,12 @@ export struct FollowListDetailUI { | @@ -167,6 +169,12 @@ export struct FollowListDetailUI { | ||
| 167 | } | 169 | } |
| 168 | } | 170 | } |
| 169 | 171 | ||
| 172 | + sendFollowMessage(){ | ||
| 173 | + if(this.count === 0){ | ||
| 174 | + EmitterUtils.sendEvent(EmitterEventId.MY_FOLLOW_EMPTY) | ||
| 175 | + } | ||
| 176 | + } | ||
| 177 | + | ||
| 170 | getNewPageData() { | 178 | getNewPageData() { |
| 171 | //我的关注列表 | 179 | //我的关注列表 |
| 172 | if (this.creatorDirectoryId === -1) { | 180 | if (this.creatorDirectoryId === -1) { |
| @@ -179,6 +187,7 @@ export struct FollowListDetailUI { | @@ -179,6 +187,7 @@ export struct FollowListDetailUI { | ||
| 179 | if (!this.data || value.list.length == 0) { | 187 | if (!this.data || value.list.length == 0) { |
| 180 | this.hasMore = false | 188 | this.hasMore = false |
| 181 | this.isLoading = false | 189 | this.isLoading = false |
| 190 | + this.isGetRequest = true | ||
| 182 | } else { | 191 | } else { |
| 183 | this.getFollowListStatus(value) | 192 | this.getFollowListStatus(value) |
| 184 | } | 193 | } |
| @@ -226,6 +235,8 @@ export struct FollowListDetailUI { | @@ -226,6 +235,8 @@ export struct FollowListDetailUI { | ||
| 226 | }) | 235 | }) |
| 227 | }) | 236 | }) |
| 228 | this.getFollowStatus(data_temp, result.totalCount) | 237 | this.getFollowStatus(data_temp, result.totalCount) |
| 238 | + }else{ | ||
| 239 | + this.isGetRequest = true | ||
| 229 | } | 240 | } |
| 230 | }).catch((err: Error) => { | 241 | }).catch((err: Error) => { |
| 231 | console.log(TAG, JSON.stringify(err)) | 242 | console.log(TAG, JSON.stringify(err)) |
| @@ -284,6 +284,7 @@ export struct HomePageBottomComponent{ | @@ -284,6 +284,7 @@ export struct HomePageBottomComponent{ | ||
| 284 | if (!this.data_comment || value.list.length == 0){ | 284 | if (!this.data_comment || value.list.length == 0){ |
| 285 | this.hasMore = false | 285 | this.hasMore = false |
| 286 | this.isLoading = false | 286 | this.isLoading = false |
| 287 | + this.isGetRequest = true | ||
| 287 | }else{ | 288 | }else{ |
| 288 | this.getCommentListStatus(value) | 289 | this.getCommentListStatus(value) |
| 289 | } | 290 | } |
| @@ -101,6 +101,7 @@ export struct OtherHomePageBottomCommentComponent { | @@ -101,6 +101,7 @@ export struct OtherHomePageBottomCommentComponent { | ||
| 101 | if (!this.data_comment || value.list.length == 0) { | 101 | if (!this.data_comment || value.list.length == 0) { |
| 102 | this.hasMore = false | 102 | this.hasMore = false |
| 103 | this.isLoading = false | 103 | this.isLoading = false |
| 104 | + this.isGetRequest = true | ||
| 104 | } else { | 105 | } else { |
| 105 | this.getCommentListStatus(value) | 106 | this.getCommentListStatus(value) |
| 106 | } | 107 | } |
| @@ -449,7 +449,7 @@ struct ChannelDialog { | @@ -449,7 +449,7 @@ struct ChannelDialog { | ||
| 449 | }.width('100%').height('100%') | 449 | }.width('100%').height('100%') |
| 450 | .scrollBar(BarState.Off) | 450 | .scrollBar(BarState.Off) |
| 451 | } | 451 | } |
| 452 | - .padding({ top: 40, right: 15, bottom: 20, left: 15 }) | 452 | + .padding({ top: 40, right: 15, bottom: 40, left: 15 }) |
| 453 | .backgroundColor('#ffffff') | 453 | .backgroundColor('#ffffff') |
| 454 | } | 454 | } |
| 455 | } | 455 | } |
| @@ -526,10 +526,9 @@ struct ChannelSubscriptionLayout { | @@ -526,10 +526,9 @@ struct ChannelSubscriptionLayout { | ||
| 526 | .width(18) | 526 | .width(18) |
| 527 | } | 527 | } |
| 528 | .width(36) | 528 | .width(36) |
| 529 | - .height(36) | 529 | + .height(40) |
| 530 | .justifyContent(FlexAlign.Center) | 530 | .justifyContent(FlexAlign.Center) |
| 531 | - .padding({ bottom: 6 }) | ||
| 532 | - .backgroundColor('#ffffff') | 531 | + .backgroundColor(Color.White) |
| 533 | .onClick(() => { | 532 | .onClick(() => { |
| 534 | if (this.dialogController != null) { | 533 | if (this.dialogController != null) { |
| 535 | this.dialogController.open() | 534 | this.dialogController.open() |
| @@ -5,12 +5,14 @@ import { RefreshConstants } from '../../utils/RefreshConstants' | @@ -5,12 +5,14 @@ import { RefreshConstants } from '../../utils/RefreshConstants' | ||
| 5 | */ | 5 | */ |
| 6 | @Component | 6 | @Component |
| 7 | export default struct NoMoreLayout { | 7 | export default struct NoMoreLayout { |
| 8 | + | ||
| 9 | + | ||
| 8 | build() { | 10 | build() { |
| 9 | - Row() { | 11 | + Column() { |
| 10 | Text($r('app.string.footer_text')) | 12 | Text($r('app.string.footer_text')) |
| 11 | - .margin({ left: RefreshConstants.NoMoreLayoutConstant_NORMAL_PADDING }) | ||
| 12 | .fontSize(RefreshConstants.NoMoreLayoutConstant_TITLE_FONT) | 13 | .fontSize(RefreshConstants.NoMoreLayoutConstant_TITLE_FONT) |
| 13 | .textAlign(TextAlign.Center) | 14 | .textAlign(TextAlign.Center) |
| 15 | + .margin({bottom:40}) | ||
| 14 | } | 16 | } |
| 15 | .width(RefreshConstants.FULL_WIDTH) | 17 | .width(RefreshConstants.FULL_WIDTH) |
| 16 | .justifyContent(FlexAlign.Center) | 18 | .justifyContent(FlexAlign.Center) |
| @@ -64,6 +64,8 @@ export struct TopNavigationComponent { | @@ -64,6 +64,8 @@ export struct TopNavigationComponent { | ||
| 64 | @State indicatorLeftMargin: number = 0 | 64 | @State indicatorLeftMargin: number = 0 |
| 65 | @State indicatorWidth: number = 0 | 65 | @State indicatorWidth: number = 0 |
| 66 | private tabsWidth: number = 0 | 66 | private tabsWidth: number = 0 |
| 67 | + //定时器延时处理切换至版面、播报tab时 返回上一个tab | ||
| 68 | + @State tabTimmer: number = 0 | ||
| 67 | 69 | ||
| 68 | topOrBottomNavChange() { | 70 | topOrBottomNavChange() { |
| 69 | if (this.currentBottomNavName === this.currentBottomNavInfo?.name) { | 71 | if (this.currentBottomNavName === this.currentBottomNavInfo?.name) { |
| @@ -261,6 +263,9 @@ export struct TopNavigationComponent { | @@ -261,6 +263,9 @@ export struct TopNavigationComponent { | ||
| 261 | }) | 263 | }) |
| 262 | .animationDuration(this.animationDuration) | 264 | .animationDuration(this.animationDuration) |
| 263 | .onChange((index: number) => { | 265 | .onChange((index: number) => { |
| 266 | + if(this.tabTimmer){ | ||
| 267 | + clearTimeout(this.tabTimmer) | ||
| 268 | + } | ||
| 264 | this.currentTopNavName = | 269 | this.currentTopNavName = |
| 265 | this._currentNavIndex === 0 ? this.myChannelList[index].name : this.topNavList[index].name | 270 | this._currentNavIndex === 0 ? this.myChannelList[index].name : this.topNavList[index].name |
| 266 | Logger.info(TAG, `onChange index : ${index}`); | 271 | Logger.info(TAG, `onChange index : ${index}`); |
| @@ -272,11 +277,15 @@ export struct TopNavigationComponent { | @@ -272,11 +277,15 @@ export struct TopNavigationComponent { | ||
| 272 | if (this.isBroadcast(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])) { | 277 | if (this.isBroadcast(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])) { |
| 273 | // 跳转到播报页面 | 278 | // 跳转到播报页面 |
| 274 | ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId) | 279 | ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId) |
| 275 | - this.tabsController.changeIndex(this.currentTopNavSelectedIndex) | 280 | + this.tabTimmer = setTimeout(() => { |
| 281 | + this.tabsController.changeIndex(this.currentTopNavSelectedIndex) | ||
| 282 | + }, 500) | ||
| 276 | } | 283 | } |
| 277 | if (this.isLayout(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])) { | 284 | if (this.isLayout(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])) { |
| 278 | ProcessUtils.gotoENewsPaper() | 285 | ProcessUtils.gotoENewsPaper() |
| 279 | - this.tabsController.changeIndex(this.currentTopNavSelectedIndex) | 286 | + this.tabTimmer = setTimeout(() => { |
| 287 | + this.tabsController.changeIndex(this.currentTopNavSelectedIndex) | ||
| 288 | + }, 500) | ||
| 280 | } | 289 | } |
| 281 | }) | 290 | }) |
| 282 | .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { | 291 | .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { |
| @@ -34,6 +34,8 @@ export struct SearchComponent { | @@ -34,6 +34,8 @@ export struct SearchComponent { | ||
| 34 | aboutToAppear() { | 34 | aboutToAppear() { |
| 35 | //获取提示滚动 | 35 | //获取提示滚动 |
| 36 | this.getSearchHint() | 36 | this.getSearchHint() |
| 37 | + //清除缓存 | ||
| 38 | + SearcherAboutDataModel.searchHistoryData = [] | ||
| 37 | //获取搜索历史 | 39 | //获取搜索历史 |
| 38 | this.getSearchHistoryData() | 40 | this.getSearchHistoryData() |
| 39 | } | 41 | } |
| @@ -80,7 +80,7 @@ export struct SearchHotsComponent{ | @@ -80,7 +80,7 @@ export struct SearchHotsComponent{ | ||
| 80 | .fontWeight('400lpx') | 80 | .fontWeight('400lpx') |
| 81 | .lineHeight('42lpx') | 81 | .lineHeight('42lpx') |
| 82 | }.layoutWeight(1) | 82 | }.layoutWeight(1) |
| 83 | - if(item.mark!=0){ | 83 | + if(item.mark===1 || item.mark===2){ |
| 84 | Image(item.mark===1?$r('app.media.search_hots_mark1'):$r('app.media.search_hots_mark2')) | 84 | Image(item.mark===1?$r('app.media.search_hots_mark1'):$r('app.media.search_hots_mark2')) |
| 85 | .width('42lpx') | 85 | .width('42lpx') |
| 86 | .height('31lpx') | 86 | .height('31lpx') |
| 1 | import { Params } from 'wdBean'; | 1 | import { Params } from 'wdBean'; |
| 2 | import { AppUtils, StringUtils } from 'wdKit/Index'; | 2 | import { AppUtils, StringUtils } from 'wdKit/Index'; |
| 3 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; | 3 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; |
| 4 | +import { CustomTitleUI } from '../reusable/CustomTitleUI'; | ||
| 4 | import { EnvironmentCustomDialog } from './EnvironmentCustomDialog'; | 5 | import { EnvironmentCustomDialog } from './EnvironmentCustomDialog'; |
| 5 | 6 | ||
| 6 | const TAG = 'AboutPageUI'; | 7 | const TAG = 'AboutPageUI'; |
| @@ -23,11 +24,11 @@ export struct AboutPageUI { | @@ -23,11 +24,11 @@ export struct AboutPageUI { | ||
| 23 | }) | 24 | }) |
| 24 | 25 | ||
| 25 | build() { | 26 | build() { |
| 26 | - Navigation() { | 27 | + // Navigation() { |
| 27 | //滑动区域 | 28 | //滑动区域 |
| 28 | this.aboutUi() | 29 | this.aboutUi() |
| 29 | - }.titleMode(NavigationTitleMode.Mini) | ||
| 30 | - .title('关于') | 30 | + // }.titleMode(NavigationTitleMode.Mini) |
| 31 | + // .title('关于') | ||
| 31 | } | 32 | } |
| 32 | 33 | ||
| 33 | aboutToAppear() { | 34 | aboutToAppear() { |
| @@ -42,6 +43,8 @@ export struct AboutPageUI { | @@ -42,6 +43,8 @@ export struct AboutPageUI { | ||
| 42 | @Builder | 43 | @Builder |
| 43 | aboutUi() { | 44 | aboutUi() { |
| 44 | Column() { | 45 | Column() { |
| 46 | + CustomTitleUI({titleName:'关于'}) | ||
| 47 | + | ||
| 45 | Image($r('app.media.setting_about_logo')) | 48 | Image($r('app.media.setting_about_logo')) |
| 46 | .width('278lpx') | 49 | .width('278lpx') |
| 47 | .height('154lpx') | 50 | .height('154lpx') |
| @@ -76,7 +76,7 @@ export struct AccountAndSecurityLayout { | @@ -76,7 +76,7 @@ export struct AccountAndSecurityLayout { | ||
| 76 | addEmitEvent(){ | 76 | addEmitEvent(){ |
| 77 | // 定义一个eventId为1的事件 | 77 | // 定义一个eventId为1的事件 |
| 78 | let event: emitter.InnerEvent = { | 78 | let event: emitter.InnerEvent = { |
| 79 | - eventId: 10010 | 79 | + eventId: EmitterEventId.PHONE_CHANGE_SUCCESS |
| 80 | }; | 80 | }; |
| 81 | 81 | ||
| 82 | // 收到eventId为1的事件后执行该回调 | 82 | // 收到eventId为1的事件后执行该回调 |
| @@ -197,7 +197,7 @@ export struct EmptyComponent { | @@ -197,7 +197,7 @@ export struct EmptyComponent { | ||
| 197 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) { | 197 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) { |
| 198 | contentString = '网络出小差了,请检查网络后重试' | 198 | contentString = '网络出小差了,请检查网络后重试' |
| 199 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_ContentFailed) { | 199 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_ContentFailed) { |
| 200 | - contentString = '获取内容失败请重试' | 200 | + contentString = '获取内容失败,请重试' |
| 201 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCreation) { | 201 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCreation) { |
| 202 | contentString = '暂无作品' | 202 | contentString = '暂无作品' |
| 203 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoBooking) { | 203 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoBooking) { |
| 1 | 1 | ||
| 2 | -import { Logger, SPHelper, UserDataLocal } from 'wdKit'; | 2 | +import { Logger, SPHelper, StringUtils, UserDataLocal } from 'wdKit'; |
| 3 | import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork'; | 3 | import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork'; |
| 4 | import { SearchHistoryItem } from '../viewmodel/SearchHistoryItem'; | 4 | import { SearchHistoryItem } from '../viewmodel/SearchHistoryItem'; |
| 5 | import { SearchHotContentItem } from '../viewmodel/SearchHotContentItem'; | 5 | import { SearchHotContentItem } from '../viewmodel/SearchHotContentItem'; |
| @@ -18,7 +18,7 @@ const TAG = "SearcherAboutDataModel" | @@ -18,7 +18,7 @@ const TAG = "SearcherAboutDataModel" | ||
| 18 | class SearcherAboutDataModel{ | 18 | class SearcherAboutDataModel{ |
| 19 | private static instance: SearcherAboutDataModel; | 19 | private static instance: SearcherAboutDataModel; |
| 20 | public searchHistoryData:SearchHistoryItem[] = [] | 20 | public searchHistoryData:SearchHistoryItem[] = [] |
| 21 | - public SEARCH_HISTORY_KEY:string = "SEARCH_HISTORY_KEY" + UserDataLocal.getUserId() | 21 | + public SEARCH_HISTORY_KEY:string = "SEARCH_HISTORY_KEY" |
| 22 | 22 | ||
| 23 | private constructor() { } | 23 | private constructor() { } |
| 24 | 24 | ||
| @@ -37,7 +37,7 @@ class SearcherAboutDataModel{ | @@ -37,7 +37,7 @@ class SearcherAboutDataModel{ | ||
| 37 | * 插入搜索记录(单个) | 37 | * 插入搜索记录(单个) |
| 38 | */ | 38 | */ |
| 39 | public async putSearchHistoryData(content:string){ | 39 | public async putSearchHistoryData(content:string){ |
| 40 | - let history = SPHelper.default.getSync(this.SEARCH_HISTORY_KEY,"[]") as string | 40 | + let history = SPHelper.default.getSync(this.generationSearchKey(),"[]") as string |
| 41 | this.searchHistoryData = JSON.parse(history) | 41 | this.searchHistoryData = JSON.parse(history) |
| 42 | this.searchHistoryData.forEach((element,index) => { | 42 | this.searchHistoryData.forEach((element,index) => { |
| 43 | if (element.searchContent == content) { | 43 | if (element.searchContent == content) { |
| @@ -45,14 +45,14 @@ class SearcherAboutDataModel{ | @@ -45,14 +45,14 @@ class SearcherAboutDataModel{ | ||
| 45 | } | 45 | } |
| 46 | }); | 46 | }); |
| 47 | this.searchHistoryData.splice(0,0,new SearchHistoryItem(content)) | 47 | this.searchHistoryData.splice(0,0,new SearchHistoryItem(content)) |
| 48 | - await SPHelper.default.saveSync(this.SEARCH_HISTORY_KEY, JSON.stringify(this.searchHistoryData)); | 48 | + await SPHelper.default.saveSync(this.generationSearchKey(), JSON.stringify(this.searchHistoryData)); |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | /** | 51 | /** |
| 52 | * 删除搜索记录(所有) | 52 | * 删除搜索记录(所有) |
| 53 | */ | 53 | */ |
| 54 | public async delSearchHistoryData(){ | 54 | public async delSearchHistoryData(){ |
| 55 | - SPHelper.default.deleteSync(this.SEARCH_HISTORY_KEY) | 55 | + SPHelper.default.deleteSync(this.generationSearchKey()) |
| 56 | this.searchHistoryData = [] | 56 | this.searchHistoryData = [] |
| 57 | } | 57 | } |
| 58 | /** | 58 | /** |
| @@ -62,11 +62,11 @@ class SearcherAboutDataModel{ | @@ -62,11 +62,11 @@ class SearcherAboutDataModel{ | ||
| 62 | if(this.searchHistoryData!=null && this.searchHistoryData.length>0){ | 62 | if(this.searchHistoryData!=null && this.searchHistoryData.length>0){ |
| 63 | this.searchHistoryData.splice(index,1) | 63 | this.searchHistoryData.splice(index,1) |
| 64 | }else{ | 64 | }else{ |
| 65 | - let history = SPHelper.default.getSync(this.SEARCH_HISTORY_KEY,"[]") as string | 65 | + let history = SPHelper.default.getSync(this.generationSearchKey(),"[]") as string |
| 66 | this.searchHistoryData = JSON.parse(history) | 66 | this.searchHistoryData = JSON.parse(history) |
| 67 | this.searchHistoryData.splice(index,1) | 67 | this.searchHistoryData.splice(index,1) |
| 68 | } | 68 | } |
| 69 | - SPHelper.default.saveSync(this.SEARCH_HISTORY_KEY, JSON.stringify(this.searchHistoryData)) | 69 | + SPHelper.default.saveSync(this.generationSearchKey(), JSON.stringify(this.searchHistoryData)) |
| 70 | } | 70 | } |
| 71 | 71 | ||
| 72 | /** | 72 | /** |
| @@ -79,7 +79,7 @@ class SearcherAboutDataModel{ | @@ -79,7 +79,7 @@ class SearcherAboutDataModel{ | ||
| 79 | } | 79 | } |
| 80 | return this.searchHistoryData | 80 | return this.searchHistoryData |
| 81 | } | 81 | } |
| 82 | - let history = SPHelper.default.getSync(this.SEARCH_HISTORY_KEY,"[]") as string | 82 | + let history = SPHelper.default.getSync(this.generationSearchKey(),"[]") as string |
| 83 | 83 | ||
| 84 | this.searchHistoryData = JSON.parse(history) | 84 | this.searchHistoryData = JSON.parse(history) |
| 85 | if(this.searchHistoryData.length>10){ | 85 | if(this.searchHistoryData.length>10){ |
| @@ -91,6 +91,15 @@ class SearcherAboutDataModel{ | @@ -91,6 +91,15 @@ class SearcherAboutDataModel{ | ||
| 91 | return this.searchHistoryData | 91 | return this.searchHistoryData |
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | + public generationSearchKey():string{ | ||
| 95 | + let userId = UserDataLocal.getUserId() | ||
| 96 | + if(StringUtils.isEmpty(userId)){ | ||
| 97 | + return this.SEARCH_HISTORY_KEY + "_" + "0000111122223333" | ||
| 98 | + }else{ | ||
| 99 | + return this.SEARCH_HISTORY_KEY + "_" + userId | ||
| 100 | + } | ||
| 101 | + } | ||
| 102 | + | ||
| 94 | /** | 103 | /** |
| 95 | * 首页 搜索提示滚动内容 | 104 | * 首页 搜索提示滚动内容 |
| 96 | */ | 105 | */ |
| @@ -34,7 +34,7 @@ export class RefreshConstants { | @@ -34,7 +34,7 @@ export class RefreshConstants { | ||
| 34 | /** | 34 | /** |
| 35 | * The refresh and load height. | 35 | * The refresh and load height. |
| 36 | */ | 36 | */ |
| 37 | - static readonly CUSTOM_LAYOUT_HEIGHT: number = 90; | 37 | + static readonly CUSTOM_LAYOUT_HEIGHT: number = 80; |
| 38 | /** | 38 | /** |
| 39 | * Full the width. | 39 | * Full the width. |
| 40 | */ | 40 | */ |
| @@ -54,7 +54,7 @@ export class PageHelper { | @@ -54,7 +54,7 @@ export class PageHelper { | ||
| 54 | PageViewModel.getPageInfo(pageModel.pageId).then(pageInfo => { | 54 | PageViewModel.getPageInfo(pageModel.pageId).then(pageInfo => { |
| 55 | if (pageInfo == null) { | 55 | if (pageInfo == null) { |
| 56 | pageModel.viewType = ViewType.EMPTY; | 56 | pageModel.viewType = ViewType.EMPTY; |
| 57 | - pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoListContent; | 57 | + pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoContent1; |
| 58 | return; | 58 | return; |
| 59 | } | 59 | } |
| 60 | pageModel.pageInfo = pageInfo; | 60 | pageModel.pageInfo = pageInfo; |
| @@ -96,7 +96,7 @@ export class PageHelper { | @@ -96,7 +96,7 @@ export class PageHelper { | ||
| 96 | // 没数据,展示空页面 | 96 | // 没数据,展示空页面 |
| 97 | Logger.debug(TAG, 'aboutToAppear, data response page ' + pageModel.pageId + ', comp list is empty.'); | 97 | Logger.debug(TAG, 'aboutToAppear, data response page ' + pageModel.pageId + ', comp list is empty.'); |
| 98 | pageModel.viewType = ViewType.EMPTY; | 98 | pageModel.viewType = ViewType.EMPTY; |
| 99 | - pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoListContent; | 99 | + pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoContent1; |
| 100 | 100 | ||
| 101 | } | 101 | } |
| 102 | } | 102 | } |
| @@ -312,7 +312,7 @@ export class PageHelper { | @@ -312,7 +312,7 @@ export class PageHelper { | ||
| 312 | this.collectPageComp(pageModel, data) | 312 | this.collectPageComp(pageModel, data) |
| 313 | // | 313 | // |
| 314 | // pageModel.compList.push(...data.compList) | 314 | // pageModel.compList.push(...data.compList) |
| 315 | - PageViewModel.getInteractData(pageModel.compList.getDataArray()).then((data: CompDTO[]) => { | 315 | + PageViewModel.getInteractData(data.compList).then((data: CompDTO[]) => { |
| 316 | // 刷新,替换所有数据 | 316 | // 刷新,替换所有数据 |
| 317 | pageModel.compList.updateItems(sizeBefore, data) | 317 | pageModel.compList.updateItems(sizeBefore, data) |
| 318 | pageModel.timestamp = DateTimeUtils.getTimeStamp().toString() | 318 | pageModel.timestamp = DateTimeUtils.getTimeStamp().toString() |
| 1 | +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="9" height="6" viewBox="0 0 9 6"><g><g><path d="M2.63066,0.5L7.79156,0.5C8.13703,0.5,8.3784,0.8420000000000001,8.26266,1.167505L6.84044,5.1675C6.76957,5.36684,6.5809,5.5,6.36934,5.5L1.208442,5.5C0.862974,5.5,0.6216,5.158,0.737335,4.8325L2.15956,0.832495C2.23043,0.633155,2.4191000000000003,0.5,2.63066,0.5" fill-rule="evenodd" fill="#ED2800" fill-opacity="1"/></g></g></svg> |
| @@ -58,10 +58,10 @@ export struct TabLiveComponent { | @@ -58,10 +58,10 @@ export struct TabLiveComponent { | ||
| 58 | // 加载更多 | 58 | // 加载更多 |
| 59 | ListItem() { | 59 | ListItem() { |
| 60 | if (this.pageModel.hasMore) { | 60 | if (this.pageModel.hasMore) { |
| 61 | - LoadMoreLayout({ | ||
| 62 | - refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage, | ||
| 63 | - this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight) | ||
| 64 | - }) | 61 | + // LoadMoreLayout({ |
| 62 | + // refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage, | ||
| 63 | + // this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight) | ||
| 64 | + // }) | ||
| 65 | } else { | 65 | } else { |
| 66 | ListHasNoMoreDataUI() | 66 | ListHasNoMoreDataUI() |
| 67 | } | 67 | } |
| @@ -89,7 +89,7 @@ export struct TabLiveComponent { | @@ -89,7 +89,7 @@ export struct TabLiveComponent { | ||
| 89 | if (data.barrageResponses && data.barrageResponses.length > 0) { | 89 | if (data.barrageResponses && data.barrageResponses.length > 0) { |
| 90 | /** | 90 | /** |
| 91 | * 在直播聊天添加一条新内容逻辑: | 91 | * 在直播聊天添加一条新内容逻辑: |
| 92 | - 判断 oldNewsId:迁移id非空 且 直播状态不是预约:"wait" | 92 | + 判断 oldNewsId:迁移id为空 且 直播状态不是预约:"wait" |
| 93 | 消息内容: | 93 | 消息内容: |
| 94 | 1.头像固定:APP默认头像 | 94 | 1.头像固定:APP默认头像 |
| 95 | 2.名称固定:人民日报主持人 | 95 | 2.名称固定:人民日报主持人 |
| @@ -105,22 +105,17 @@ export struct TabLiveComponent { | @@ -105,22 +105,17 @@ export struct TabLiveComponent { | ||
| 105 | if (StringUtils.isEmpty(this.liveDetailsBean.oldNewsId) | 105 | if (StringUtils.isEmpty(this.liveDetailsBean.oldNewsId) |
| 106 | && this.liveDetailsBean | 106 | && this.liveDetailsBean |
| 107 | && this.liveDetailsBean.liveInfo.liveState != 'wait') { | 107 | && this.liveDetailsBean.liveInfo.liveState != 'wait') { |
| 108 | - let liveRoomItemBeanTemp: LiveRoomItemBean = {} as LiveRoomItemBean | ||
| 109 | - liveRoomItemBeanTemp.text = this.liveDetailsBean.newIntroduction | ||
| 110 | - liveRoomItemBeanTemp.senderUserName = '人民日报主持人' | ||
| 111 | - liveRoomItemBeanTemp.pictureUrls = [] | ||
| 112 | - liveRoomItemBeanTemp.pictureUrls.push(this.liveDetailsBean?.fullColumnImgUrls[0]?.url) | ||
| 113 | - liveRoomItemBeanTemp.dataType = 'ZH_TEXT_AND_IMAGE_MSG' | ||
| 114 | - let temp = this.liveDetailsBean?.fullColumnImgUrls[0] | ||
| 115 | - if (temp) { | ||
| 116 | - liveRoomItemBeanTemp.pictureResolutions = [] | ||
| 117 | - liveRoomItemBeanTemp.pictureResolutions.push(`${temp.height}*${temp.weight}`) | ||
| 118 | - } | ||
| 119 | - this.liveList.push(liveRoomItemBeanTemp) | 108 | + this.updateLiveListData() |
| 120 | } | 109 | } |
| 121 | } | 110 | } |
| 122 | } else { | 111 | } else { |
| 123 | - this.pageModel.viewType = ViewType.EMPTY; | 112 | + if (StringUtils.isEmpty(this.liveDetailsBean.oldNewsId) |
| 113 | + && this.liveDetailsBean | ||
| 114 | + && this.liveDetailsBean.liveInfo.liveState != 'wait') { | ||
| 115 | + this.updateLiveListData() | ||
| 116 | + } else { | ||
| 117 | + this.pageModel.viewType = ViewType.EMPTY; | ||
| 118 | + } | ||
| 124 | } | 119 | } |
| 125 | }, | 120 | }, |
| 126 | () => { | 121 | () => { |
| @@ -128,6 +123,21 @@ export struct TabLiveComponent { | @@ -128,6 +123,21 @@ export struct TabLiveComponent { | ||
| 128 | }) | 123 | }) |
| 129 | } | 124 | } |
| 130 | 125 | ||
| 126 | + updateLiveListData() { | ||
| 127 | + let liveRoomItemBeanTemp: LiveRoomItemBean = {} as LiveRoomItemBean | ||
| 128 | + liveRoomItemBeanTemp.text = this.liveDetailsBean.newIntroduction | ||
| 129 | + liveRoomItemBeanTemp.senderUserName = '人民日报主持人' | ||
| 130 | + liveRoomItemBeanTemp.pictureUrls = [] | ||
| 131 | + liveRoomItemBeanTemp.pictureUrls.push(this.liveDetailsBean?.fullColumnImgUrls[0]?.url) | ||
| 132 | + liveRoomItemBeanTemp.dataType = 'ZH_TEXT_AND_IMAGE_MSG' | ||
| 133 | + let temp = this.liveDetailsBean?.fullColumnImgUrls[0] | ||
| 134 | + if (temp) { | ||
| 135 | + liveRoomItemBeanTemp.pictureResolutions = [] | ||
| 136 | + liveRoomItemBeanTemp.pictureResolutions.push(`${temp.height}*${temp.weight}`) | ||
| 137 | + } | ||
| 138 | + this.liveList.push(liveRoomItemBeanTemp) | ||
| 139 | + } | ||
| 140 | + | ||
| 131 | aboutToDisappear(): void { | 141 | aboutToDisappear(): void { |
| 132 | } | 142 | } |
| 133 | } | 143 | } |
| @@ -7,7 +7,7 @@ import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/ | @@ -7,7 +7,7 @@ import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/ | ||
| 7 | import { WDRouterRule, WDRouterPage } from 'wdRouter'; | 7 | import { WDRouterRule, WDRouterPage } from 'wdRouter'; |
| 8 | import { SettingPasswordParams } from './SettingPasswordLayout' | 8 | import { SettingPasswordParams } from './SettingPasswordLayout' |
| 9 | import { Router } from '@ohos.arkui.UIContext' | 9 | import { Router } from '@ohos.arkui.UIContext' |
| 10 | -import { SPHelper, ToastUtils } from 'wdKit/Index' | 10 | +import { EmitterEventId, EmitterUtils, SPHelper, ToastUtils } from 'wdKit/Index' |
| 11 | import { SpConstants } from 'wdConstant/Index' | 11 | import { SpConstants } from 'wdConstant/Index' |
| 12 | import { emitter } from '@kit.BasicServicesKit' | 12 | import { emitter } from '@kit.BasicServicesKit' |
| 13 | 13 | ||
| @@ -189,7 +189,7 @@ struct ForgetPasswordPage { | @@ -189,7 +189,7 @@ struct ForgetPasswordPage { | ||
| 189 | sendEmitEvent(){ | 189 | sendEmitEvent(){ |
| 190 | // 定义一个eventId为1的事件,事件优先级为Low | 190 | // 定义一个eventId为1的事件,事件优先级为Low |
| 191 | let event: emitter.InnerEvent = { | 191 | let event: emitter.InnerEvent = { |
| 192 | - eventId: 10010, | 192 | + eventId: EmitterEventId.PHONE_CHANGE_SUCCESS, |
| 193 | priority: emitter.EventPriority.LOW | 193 | priority: emitter.EventPriority.LOW |
| 194 | }; | 194 | }; |
| 195 | 195 |
| 1 | import { Logger } from 'wdKit/src/main/ets/utils/Logger' | 1 | import { Logger } from 'wdKit/src/main/ets/utils/Logger' |
| 2 | import { LoginModel } from './LoginModel' | 2 | import { LoginModel } from './LoginModel' |
| 3 | import { LoginBean } from './LoginBean' | 3 | import { LoginBean } from './LoginBean' |
| 4 | -import { SPHelper, StringUtils } from 'wdKit' | 4 | +import { EmitterEventId, EmitterUtils, SPHelper, StringUtils, UserDataLocal } from 'wdKit' |
| 5 | import { CheckVerifyBean } from './CheckVerifyBean' | 5 | import { CheckVerifyBean } from './CheckVerifyBean' |
| 6 | import cryptoFramework from '@ohos.security.cryptoFramework' | 6 | import cryptoFramework from '@ohos.security.cryptoFramework' |
| 7 | import buffer from '@ohos.buffer' | 7 | import buffer from '@ohos.buffer' |
| @@ -55,6 +55,7 @@ export class LoginViewModel { | @@ -55,6 +55,7 @@ export class LoginViewModel { | ||
| 55 | SPHelper.default.saveSync(SpConstants.USER_STATUS, data.status) | 55 | SPHelper.default.saveSync(SpConstants.USER_STATUS, data.status) |
| 56 | SPHelper.default.saveSync(SpConstants.USER_Type, data.userType) | 56 | SPHelper.default.saveSync(SpConstants.USER_Type, data.userType) |
| 57 | SPHelper.default.saveSync(SpConstants.USER_NAME, data.userName) | 57 | SPHelper.default.saveSync(SpConstants.USER_NAME, data.userName) |
| 58 | + EmitterUtils.sendEmptyEvent(EmitterEventId.LOGIN_SUCCESS) | ||
| 58 | success(data) | 59 | success(data) |
| 59 | }).catch((error:string) => { | 60 | }).catch((error:string) => { |
| 60 | fail(error) | 61 | fail(error) |
| @@ -82,6 +83,7 @@ export class LoginViewModel { | @@ -82,6 +83,7 @@ export class LoginViewModel { | ||
| 82 | SPHelper.default.saveSync(SpConstants.USER_STATUS, data.status) | 83 | SPHelper.default.saveSync(SpConstants.USER_STATUS, data.status) |
| 83 | SPHelper.default.saveSync(SpConstants.USER_Type, data.userType) | 84 | SPHelper.default.saveSync(SpConstants.USER_Type, data.userType) |
| 84 | SPHelper.default.saveSync(SpConstants.USER_NAME, data.userName) | 85 | SPHelper.default.saveSync(SpConstants.USER_NAME, data.userName) |
| 86 | + EmitterUtils.sendEmptyEvent(EmitterEventId.LOGIN_SUCCESS) | ||
| 85 | success(data) | 87 | success(data) |
| 86 | }).catch((value: string) => { | 88 | }).catch((value: string) => { |
| 87 | fail(value) | 89 | fail(value) |
| @@ -157,6 +159,7 @@ export class LoginViewModel { | @@ -157,6 +159,7 @@ export class LoginViewModel { | ||
| 157 | SPHelper.default.saveSync(SpConstants.USER_STATUS, '') | 159 | SPHelper.default.saveSync(SpConstants.USER_STATUS, '') |
| 158 | SPHelper.default.saveSync(SpConstants.USER_Type, '') | 160 | SPHelper.default.saveSync(SpConstants.USER_Type, '') |
| 159 | SPHelper.default.saveSync(SpConstants.USER_NAME, '') | 161 | SPHelper.default.saveSync(SpConstants.USER_NAME, '') |
| 162 | + UserDataLocal.clearUserData() | ||
| 160 | success(data) | 163 | success(data) |
| 161 | }).catch((message: string) => { | 164 | }).catch((message: string) => { |
| 162 | fail(message) | 165 | fail(message) |
-
Please register or login to post a comment