Merge branches 'main' and 'main' of http://192.168.1.42/developOne/harmonyPool
Showing
9 changed files
with
42 additions
and
25 deletions
| @@ -38,8 +38,12 @@ export struct CommentListDialogView { | @@ -38,8 +38,12 @@ export struct CommentListDialogView { | ||
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | closeAction() { | 40 | closeAction() { |
| 41 | + if (this.onClose) { | ||
| 42 | + this.onClose() | ||
| 43 | + } else { | ||
| 41 | this.showCommentList = false | 44 | this.showCommentList = false |
| 42 | } | 45 | } |
| 46 | + } | ||
| 43 | 47 | ||
| 44 | build() { | 48 | build() { |
| 45 | } | 49 | } |
| @@ -20,12 +20,10 @@ struct ChannelSubscriptionLayout { | @@ -20,12 +20,10 @@ struct ChannelSubscriptionLayout { | ||
| 20 | //当前选中的频道 | 20 | //当前选中的频道 |
| 21 | @Link currentTopNavSelectedIndex: number; | 21 | @Link currentTopNavSelectedIndex: number; |
| 22 | @Prop homeChannelList: TopNavDTO [] | 22 | @Prop homeChannelList: TopNavDTO [] |
| 23 | - @Prop indexSettingChannelId: number | ||
| 24 | @Link myChannelList: TopNavDTO [] | 23 | @Link myChannelList: TopNavDTO [] |
| 25 | @Link moreChannelList: TopNavDTO [] | 24 | @Link moreChannelList: TopNavDTO [] |
| 26 | @Link localChannelList: TopNavDTO [] | 25 | @Link localChannelList: TopNavDTO [] |
| 27 | @Link channelIds: number [] | 26 | @Link channelIds: number [] |
| 28 | - @StorageLink('channelIds') storeChannelIds: string = '' | ||
| 29 | @State isShow: boolean = false | 27 | @State isShow: boolean = false |
| 30 | @State dragItem: number = -1 | 28 | @State dragItem: number = -1 |
| 31 | private dragRefOffsetX: number = 0 | 29 | private dragRefOffsetX: number = 0 |
| @@ -34,7 +32,7 @@ struct ChannelSubscriptionLayout { | @@ -34,7 +32,7 @@ struct ChannelSubscriptionLayout { | ||
| 34 | @State offsetY: number = 0 | 32 | @State offsetY: number = 0 |
| 35 | private FIX_VP_X: number = 80 | 33 | private FIX_VP_X: number = 80 |
| 36 | private FIX_VP_Y: number = 48 | 34 | private FIX_VP_Y: number = 48 |
| 37 | - @State indexSettingTabIndex: number = 0 | 35 | + @State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002 |
| 38 | @State isEditIng: boolean = false | 36 | @State isEditIng: boolean = false |
| 39 | @State currentTopNavSelectedItem: TopNavDTO = {} as TopNavDTO | 37 | @State currentTopNavSelectedItem: TopNavDTO = {} as TopNavDTO |
| 40 | changeTab: (index: number) => void = () => { | 38 | changeTab: (index: number) => void = () => { |
| @@ -50,13 +48,13 @@ struct ChannelSubscriptionLayout { | @@ -50,13 +48,13 @@ struct ChannelSubscriptionLayout { | ||
| 50 | let channelIdTmp = this.channelIds.splice(index1, 1) | 48 | let channelIdTmp = this.channelIds.splice(index1, 1) |
| 51 | this.myChannelList.splice(index2, 0, tmp[0]) | 49 | this.myChannelList.splice(index2, 0, tmp[0]) |
| 52 | this.channelIds.splice(index2, 0, channelIdTmp[0]) | 50 | this.channelIds.splice(index2, 0, channelIdTmp[0]) |
| 53 | - this.storeChannelIds = this.channelIds.join(',') | 51 | + AppStorage.setOrCreate('channelIds', this.channelIds.join(',')) |
| 54 | } | 52 | } |
| 55 | //删除频道 | 53 | //删除频道 |
| 56 | delChannelItem(index: number){ | 54 | delChannelItem(index: number){ |
| 57 | let item = this.myChannelList.splice(index, 1)[0] | 55 | let item = this.myChannelList.splice(index, 1)[0] |
| 58 | this.channelIds.splice(index, 1) | 56 | this.channelIds.splice(index, 1) |
| 59 | - this.storeChannelIds = this.channelIds.join(',') | 57 | + AppStorage.setOrCreate('channelIds', this.channelIds.join(',')) |
| 60 | if (item.moreChannel === '1') { | 58 | if (item.moreChannel === '1') { |
| 61 | this.moreChannelList.unshift(item) | 59 | this.moreChannelList.unshift(item) |
| 62 | } | 60 | } |
| @@ -68,7 +66,7 @@ struct ChannelSubscriptionLayout { | @@ -68,7 +66,7 @@ struct ChannelSubscriptionLayout { | ||
| 68 | addChannelItem(item: TopNavDTO){ | 66 | addChannelItem(item: TopNavDTO){ |
| 69 | this.channelIds.push(item.channelId) | 67 | this.channelIds.push(item.channelId) |
| 70 | this.myChannelList.push(item) | 68 | this.myChannelList.push(item) |
| 71 | - this.storeChannelIds = this.channelIds.join(',') | 69 | + AppStorage.setOrCreate('channelIds', this.channelIds.join(',')) |
| 72 | } | 70 | } |
| 73 | 71 | ||
| 74 | itemMove(index: number, newIndex: number): void { | 72 | itemMove(index: number, newIndex: number): void { |
| @@ -265,6 +263,7 @@ struct ChannelSubscriptionLayout { | @@ -265,6 +263,7 @@ struct ChannelSubscriptionLayout { | ||
| 265 | .alignContent(Alignment.Start) | 263 | .alignContent(Alignment.Start) |
| 266 | .height(36) | 264 | .height(36) |
| 267 | .onClick(() => { | 265 | .onClick(() => { |
| 266 | + this.indexSettingChannelId = item.channelId | ||
| 268 | AppStorage.set('indexSettingChannelId', item.channelId) | 267 | AppStorage.set('indexSettingChannelId', item.channelId) |
| 269 | }) | 268 | }) |
| 270 | }) | 269 | }) |
| @@ -13,9 +13,6 @@ import DailyPaperTopicModel from '../../model/DailyPaperTopicModel' | @@ -13,9 +13,6 @@ import DailyPaperTopicModel from '../../model/DailyPaperTopicModel' | ||
| 13 | 13 | ||
| 14 | const TAG = 'TopNavigationComponent'; | 14 | const TAG = 'TopNavigationComponent'; |
| 15 | 15 | ||
| 16 | -PersistentStorage.persistProp('channelIds', ''); | ||
| 17 | -PersistentStorage.persistProp('indexSettingChannelId', 2002); | ||
| 18 | - | ||
| 19 | const storage = LocalStorage.getShared(); | 16 | const storage = LocalStorage.getShared(); |
| 20 | 17 | ||
| 21 | /** | 18 | /** |
| @@ -48,11 +45,11 @@ export struct TopNavigationComponentNew { | @@ -48,11 +45,11 @@ export struct TopNavigationComponentNew { | ||
| 48 | @State currentTopNavSelectedIndex: number = 0; | 45 | @State currentTopNavSelectedIndex: number = 0; |
| 49 | // 顶导数据 | 46 | // 顶导数据 |
| 50 | @State @Watch('onTopNavigationDataUpdated') topNavList: TopNavDTO[] = [] | 47 | @State @Watch('onTopNavigationDataUpdated') topNavList: TopNavDTO[] = [] |
| 51 | - @StorageProp('indexSettingChannelId') indexSettingChannelId: number = 2002 | 48 | + @State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002 |
| 52 | //我的频道id列表 | 49 | //我的频道id列表 |
| 53 | @State channelIds: number[] = [] | 50 | @State channelIds: number[] = [] |
| 54 | //本地缓存频道id列表 | 51 | //本地缓存频道id列表 |
| 55 | - @StorageProp('channelIds') storageChannelIds: string = '' | 52 | + @State storageChannelIds: string = AppStorage.get<string>('channelIds') || '' |
| 56 | @State homeChannelList: TopNavDTO[] = [] | 53 | @State homeChannelList: TopNavDTO[] = [] |
| 57 | // 我的频道列表 | 54 | // 我的频道列表 |
| 58 | @State myChannelList: TopNavDTO[] = [] | 55 | @State myChannelList: TopNavDTO[] = [] |
| @@ -191,7 +188,6 @@ export struct TopNavigationComponentNew { | @@ -191,7 +188,6 @@ export struct TopNavigationComponentNew { | ||
| 191 | this.topBar() | 188 | this.topBar() |
| 192 | ChannelSubscriptionLayout({ | 189 | ChannelSubscriptionLayout({ |
| 193 | currentTopNavSelectedIndex: $currentTopNavSelectedIndex, | 190 | currentTopNavSelectedIndex: $currentTopNavSelectedIndex, |
| 194 | - indexSettingChannelId: this.indexSettingChannelId, | ||
| 195 | homeChannelList: this.homeChannelList, | 191 | homeChannelList: this.homeChannelList, |
| 196 | myChannelList: $myChannelList, | 192 | myChannelList: $myChannelList, |
| 197 | moreChannelList: $moreChannelList, | 193 | moreChannelList: $moreChannelList, |
| @@ -406,18 +402,29 @@ export struct TopNavigationComponentNew { | @@ -406,18 +402,29 @@ export struct TopNavigationComponentNew { | ||
| 406 | 402 | ||
| 407 | //频道分类 | 403 | //频道分类 |
| 408 | if (item.name !== '播报') { //暂时隐藏播报 | 404 | if (item.name !== '播报') { //暂时隐藏播报 |
| 409 | - if (item.myChannel === '1') { | 405 | + if (item.myChannel === '1' && !this.storageChannelIds) { |
| 410 | _myChannelList.push(item) | 406 | _myChannelList.push(item) |
| 411 | _channelIds.push(item.channelId) | 407 | _channelIds.push(item.channelId) |
| 412 | - } else if (item.moreChannel === '1') { | 408 | + } |
| 409 | + if (item.moreChannel === '1') { | ||
| 413 | this.moreChannelList.push(item) | 410 | this.moreChannelList.push(item) |
| 414 | - } else if (item.localChannel === '1' && item.myChannel !== '1') { | 411 | + } |
| 412 | + if (item.localChannel === '1' && item.myChannel !== '1') { | ||
| 415 | this.localChannelList.push(item) | 413 | this.localChannelList.push(item) |
| 416 | } | 414 | } |
| 417 | } | 415 | } |
| 418 | 416 | ||
| 419 | }) | 417 | }) |
| 420 | 418 | ||
| 419 | + if(this.storageChannelIds){ | ||
| 420 | + _storageChannelIds.forEach((_item:string)=>{ | ||
| 421 | + let index = defaultList.findIndex(ele => Number(_item) === ele.channelId) | ||
| 422 | + if(index > -1){ | ||
| 423 | + _myChannelList.push(defaultList[index]) | ||
| 424 | + _channelIds.push(defaultList[index].channelId) | ||
| 425 | + } | ||
| 426 | + }) | ||
| 427 | + } | ||
| 421 | if (cityName) { | 428 | if (cityName) { |
| 422 | let index = _myChannelList.findIndex(ele => cityName.includes(ele.name)) | 429 | let index = _myChannelList.findIndex(ele => cityName.includes(ele.name)) |
| 423 | const localChannelitem = _myChannelList.splice(index, 1)[0]; | 430 | const localChannelitem = _myChannelList.splice(index, 1)[0]; |
| @@ -466,10 +473,6 @@ export struct TopNavigationComponentNew { | @@ -466,10 +473,6 @@ export struct TopNavigationComponentNew { | ||
| 466 | this.changePage(this.currentTopNavSelectedIndex) | 473 | this.changePage(this.currentTopNavSelectedIndex) |
| 467 | } | 474 | } |
| 468 | 475 | ||
| 469 | - aboutToDisappear() { | ||
| 470 | - AppStorage.set('channelIds', this.channelIds.join(',')) | ||
| 471 | - } | ||
| 472 | - | ||
| 473 | onTopNavigationDataUpdated() { | 476 | onTopNavigationDataUpdated() { |
| 474 | Logger.info(TAG, | 477 | Logger.info(TAG, |
| 475 | `onTopNavigationDataUpdated currentTopNavIndex: ${this.currentTopNavSelectedIndex},topNavList.length:${this.topNavList.length}`); | 478 | `onTopNavigationDataUpdated currentTopNavIndex: ${this.currentTopNavSelectedIndex},topNavList.length:${this.topNavList.length}`); |
| @@ -73,9 +73,9 @@ class MinePageDatasModel{ | @@ -73,9 +73,9 @@ class MinePageDatasModel{ | ||
| 73 | this.personalData.push(new MinePagePersonalFunctionsItem("关注",$r('app.media.mine_follow_icon'))) | 73 | this.personalData.push(new MinePagePersonalFunctionsItem("关注",$r('app.media.mine_follow_icon'))) |
| 74 | this.personalData.push(new MinePagePersonalFunctionsItem("收藏",$r('app.media.mine_collect_icon'))) | 74 | this.personalData.push(new MinePagePersonalFunctionsItem("收藏",$r('app.media.mine_collect_icon'))) |
| 75 | // this.personalData.push(new MinePagePersonalFunctionsItem("历史",$r('app.media.mine_history_icon'))) | 75 | // this.personalData.push(new MinePagePersonalFunctionsItem("历史",$r('app.media.mine_history_icon'))) |
| 76 | - this.personalData.push(new MinePagePersonalFunctionsItem("消息",$r('app.media.mine_msg_icon'))) | ||
| 77 | // this.personalData.push(new MinePagePersonalFunctionsItem("留言板",$r('app.media.mine_msgboard_icon'))) | 76 | // this.personalData.push(new MinePagePersonalFunctionsItem("留言板",$r('app.media.mine_msgboard_icon'))) |
| 78 | this.personalData.push(new MinePagePersonalFunctionsItem("预约",$r('app.media.mine_order_icon'))) | 77 | this.personalData.push(new MinePagePersonalFunctionsItem("预约",$r('app.media.mine_order_icon'))) |
| 78 | + this.personalData.push(new MinePagePersonalFunctionsItem("消息",$r('app.media.mine_msg_icon'))) | ||
| 79 | return this.personalData | 79 | return this.personalData |
| 80 | } | 80 | } |
| 81 | 81 |
| @@ -182,7 +182,8 @@ export struct DetailPlayShortVideoPage { | @@ -182,7 +182,8 @@ export struct DetailPlayShortVideoPage { | ||
| 182 | index: $index, | 182 | index: $index, |
| 183 | currentIndex: $currentIndex, | 183 | currentIndex: $currentIndex, |
| 184 | showCommentList: $showCommentList, | 184 | showCommentList: $showCommentList, |
| 185 | - publishCommentModel: $publishCommentModel | 185 | + publishCommentModel: $publishCommentModel, |
| 186 | + interactData: $interactData, | ||
| 186 | }) | 187 | }) |
| 187 | this.playerViewBuilder() | 188 | this.playerViewBuilder() |
| 188 | 189 |
| 1 | -import { ContentDetailDTO, PageInfoDTO } from 'wdBean/Index' | 1 | +import { ContentDetailDTO, InteractDataDTO, PageInfoDTO } from 'wdBean/Index' |
| 2 | 2 | ||
| 3 | import { CommentListDialogView, publishCommentModel } from 'wdComponent/Index' | 3 | import { CommentListDialogView, publishCommentModel } from 'wdComponent/Index' |
| 4 | 4 | ||
| @@ -9,6 +9,7 @@ export struct CommentDialogView { | @@ -9,6 +9,7 @@ export struct CommentDialogView { | ||
| 9 | @Link currentIndex: number | 9 | @Link currentIndex: number |
| 10 | @Link publishCommentModel: publishCommentModel | 10 | @Link publishCommentModel: publishCommentModel |
| 11 | @Consume contentDetailData: ContentDetailDTO | 11 | @Consume contentDetailData: ContentDetailDTO |
| 12 | + @Link interactData: InteractDataDTO | ||
| 12 | @State fakePageInfo: PageInfoDTO = {} as PageInfoDTO | 13 | @State fakePageInfo: PageInfoDTO = {} as PageInfoDTO |
| 13 | @State dialogOffsetY: number = 0 // (this.windowHeight - this.windowWidth * 9 / 16) | 14 | @State dialogOffsetY: number = 0 // (this.windowHeight - this.windowWidth * 9 / 16) |
| 14 | 15 | ||
| @@ -34,6 +35,9 @@ export struct CommentDialogView { | @@ -34,6 +35,9 @@ export struct CommentDialogView { | ||
| 34 | pageInfo: this.fakePageInfo, | 35 | pageInfo: this.fakePageInfo, |
| 35 | onClose: () => { | 36 | onClose: () => { |
| 36 | this.showCommentList = false | 37 | this.showCommentList = false |
| 38 | + if (Number.parseInt(this.publishCommentModel.totalCommentNumer) > Number.parseInt(this.interactData.commentNum + "")) { | ||
| 39 | + this.interactData.commentNum = Number.parseInt(this.publishCommentModel.totalCommentNumer) | ||
| 40 | + } | ||
| 37 | } | 41 | } |
| 38 | }) | 42 | }) |
| 39 | } | 43 | } |
| @@ -387,7 +387,7 @@ export struct PlayerRightView { | @@ -387,7 +387,7 @@ export struct PlayerRightView { | ||
| 387 | .width(32) | 387 | .width(32) |
| 388 | .aspectRatio(1) | 388 | .aspectRatio(1) |
| 389 | 389 | ||
| 390 | - Text(this.transNum2String('commentNum') || '抢首评') | 390 | + Text(this.interactData.commentNum > 0 ? this.transNum2String('commentNum') : '抢首评') |
| 391 | .width('100%') | 391 | .width('100%') |
| 392 | .fontWeight(500) | 392 | .fontWeight(500) |
| 393 | .textAlign(TextAlign.Center) | 393 | .textAlign(TextAlign.Center) |
| @@ -9,6 +9,9 @@ import { VideoChannelPage } from './VideoChannelPage'; | @@ -9,6 +9,9 @@ import { VideoChannelPage } from './VideoChannelPage'; | ||
| 9 | import ChannelViewModel from 'wdComponent/src/main/ets/viewmodel/ChannelViewModel'; | 9 | import ChannelViewModel from 'wdComponent/src/main/ets/viewmodel/ChannelViewModel'; |
| 10 | 10 | ||
| 11 | const TAG = 'BottomNavigationComponent'; | 11 | const TAG = 'BottomNavigationComponent'; |
| 12 | +PersistentStorage.persistProp('channelIds', ''); | ||
| 13 | +PersistentStorage.persistProp('indexSettingChannelId', 2002); | ||
| 14 | + | ||
| 12 | let storage = LocalStorage.getShared(); | 15 | let storage = LocalStorage.getShared(); |
| 13 | 16 | ||
| 14 | /** | 17 | /** |
| @@ -6,7 +6,8 @@ import { | @@ -6,7 +6,8 @@ import { | ||
| 6 | postInteractBrowsOperateParams, | 6 | postInteractBrowsOperateParams, |
| 7 | postBatchAttentionStatusParams, | 7 | postBatchAttentionStatusParams, |
| 8 | postInteractAccentionOperateParams, | 8 | postInteractAccentionOperateParams, |
| 9 | - Params | 9 | + Params, |
| 10 | + InteractDataDTO | ||
| 10 | } from 'wdBean'; | 11 | } from 'wdBean'; |
| 11 | import display from '@ohos.display'; | 12 | import display from '@ohos.display'; |
| 12 | import { DateTimeUtils } from 'wdKit/Index'; | 13 | import { DateTimeUtils } from 'wdKit/Index'; |
| @@ -59,6 +60,7 @@ export struct MultiPictureDetailPageComponent { | @@ -59,6 +60,7 @@ export struct MultiPictureDetailPageComponent { | ||
| 59 | @State operationButtonList: string[] = ['comment', 'like', 'collect', 'share'] | 60 | @State operationButtonList: string[] = ['comment', 'like', 'collect', 'share'] |
| 60 | @State currentOffset: number = 0 | 61 | @State currentOffset: number = 0 |
| 61 | @State duration: number = 0 | 62 | @State duration: number = 0 |
| 63 | + @Provide interactData: InteractDataDTO = {} as InteractDataDTO | ||
| 62 | pageParam: ParamType = {} | 64 | pageParam: ParamType = {} |
| 63 | followUserId: string = '' | 65 | followUserId: string = '' |
| 64 | followUserName: string = '' | 66 | followUserName: string = '' |
| @@ -116,7 +118,8 @@ export struct MultiPictureDetailPageComponent { | @@ -116,7 +118,8 @@ export struct MultiPictureDetailPageComponent { | ||
| 116 | index: $index, | 118 | index: $index, |
| 117 | currentIndex: $currentIndex, | 119 | currentIndex: $currentIndex, |
| 118 | showCommentList: $showCommentList, | 120 | showCommentList: $showCommentList, |
| 119 | - publishCommentModel: $publishCommentModel | 121 | + publishCommentModel: $publishCommentModel, |
| 122 | + interactData:$interactData | ||
| 120 | }) | 123 | }) |
| 121 | 124 | ||
| 122 | } | 125 | } |
-
Please register or login to post a comment