王士厅

Merge branches 'main' and 'main' of http://192.168.1.42/developOne/harmonyPool

... ... @@ -38,7 +38,11 @@ export struct CommentListDialogView {
}
closeAction() {
this.showCommentList = false
if (this.onClose) {
this.onClose()
} else {
this.showCommentList = false
}
}
build() {
... ...
... ... @@ -20,12 +20,10 @@ struct ChannelSubscriptionLayout {
//当前选中的频道
@Link currentTopNavSelectedIndex: number;
@Prop homeChannelList: TopNavDTO []
@Prop indexSettingChannelId: number
@Link myChannelList: TopNavDTO []
@Link moreChannelList: TopNavDTO []
@Link localChannelList: TopNavDTO []
@Link channelIds: number []
@StorageLink('channelIds') storeChannelIds: string = ''
@State isShow: boolean = false
@State dragItem: number = -1
private dragRefOffsetX: number = 0
... ... @@ -34,7 +32,7 @@ struct ChannelSubscriptionLayout {
@State offsetY: number = 0
private FIX_VP_X: number = 80
private FIX_VP_Y: number = 48
@State indexSettingTabIndex: number = 0
@State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002
@State isEditIng: boolean = false
@State currentTopNavSelectedItem: TopNavDTO = {} as TopNavDTO
changeTab: (index: number) => void = () => {
... ... @@ -50,13 +48,13 @@ struct ChannelSubscriptionLayout {
let channelIdTmp = this.channelIds.splice(index1, 1)
this.myChannelList.splice(index2, 0, tmp[0])
this.channelIds.splice(index2, 0, channelIdTmp[0])
this.storeChannelIds = this.channelIds.join(',')
AppStorage.setOrCreate('channelIds', this.channelIds.join(','))
}
//删除频道
delChannelItem(index: number){
let item = this.myChannelList.splice(index, 1)[0]
this.channelIds.splice(index, 1)
this.storeChannelIds = this.channelIds.join(',')
AppStorage.setOrCreate('channelIds', this.channelIds.join(','))
if (item.moreChannel === '1') {
this.moreChannelList.unshift(item)
}
... ... @@ -68,7 +66,7 @@ struct ChannelSubscriptionLayout {
addChannelItem(item: TopNavDTO){
this.channelIds.push(item.channelId)
this.myChannelList.push(item)
this.storeChannelIds = this.channelIds.join(',')
AppStorage.setOrCreate('channelIds', this.channelIds.join(','))
}
itemMove(index: number, newIndex: number): void {
... ... @@ -265,6 +263,7 @@ struct ChannelSubscriptionLayout {
.alignContent(Alignment.Start)
.height(36)
.onClick(() => {
this.indexSettingChannelId = item.channelId
AppStorage.set('indexSettingChannelId', item.channelId)
})
})
... ...
... ... @@ -13,9 +13,6 @@ import DailyPaperTopicModel from '../../model/DailyPaperTopicModel'
const TAG = 'TopNavigationComponent';
PersistentStorage.persistProp('channelIds', '');
PersistentStorage.persistProp('indexSettingChannelId', 2002);
const storage = LocalStorage.getShared();
/**
... ... @@ -48,11 +45,11 @@ export struct TopNavigationComponentNew {
@State currentTopNavSelectedIndex: number = 0;
// 顶导数据
@State @Watch('onTopNavigationDataUpdated') topNavList: TopNavDTO[] = []
@StorageProp('indexSettingChannelId') indexSettingChannelId: number = 2002
@State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002
//我的频道id列表
@State channelIds: number[] = []
//本地缓存频道id列表
@StorageProp('channelIds') storageChannelIds: string = ''
@State storageChannelIds: string = AppStorage.get<string>('channelIds') || ''
@State homeChannelList: TopNavDTO[] = []
// 我的频道列表
@State myChannelList: TopNavDTO[] = []
... ... @@ -191,7 +188,6 @@ export struct TopNavigationComponentNew {
this.topBar()
ChannelSubscriptionLayout({
currentTopNavSelectedIndex: $currentTopNavSelectedIndex,
indexSettingChannelId: this.indexSettingChannelId,
homeChannelList: this.homeChannelList,
myChannelList: $myChannelList,
moreChannelList: $moreChannelList,
... ... @@ -406,18 +402,29 @@ export struct TopNavigationComponentNew {
//频道分类
if (item.name !== '播报') { //暂时隐藏播报
if (item.myChannel === '1') {
if (item.myChannel === '1' && !this.storageChannelIds) {
_myChannelList.push(item)
_channelIds.push(item.channelId)
} else if (item.moreChannel === '1') {
}
if (item.moreChannel === '1') {
this.moreChannelList.push(item)
} else if (item.localChannel === '1' && item.myChannel !== '1') {
}
if (item.localChannel === '1' && item.myChannel !== '1') {
this.localChannelList.push(item)
}
}
})
if(this.storageChannelIds){
_storageChannelIds.forEach((_item:string)=>{
let index = defaultList.findIndex(ele => Number(_item) === ele.channelId)
if(index > -1){
_myChannelList.push(defaultList[index])
_channelIds.push(defaultList[index].channelId)
}
})
}
if (cityName) {
let index = _myChannelList.findIndex(ele => cityName.includes(ele.name))
const localChannelitem = _myChannelList.splice(index, 1)[0];
... ... @@ -466,10 +473,6 @@ export struct TopNavigationComponentNew {
this.changePage(this.currentTopNavSelectedIndex)
}
aboutToDisappear() {
AppStorage.set('channelIds', this.channelIds.join(','))
}
onTopNavigationDataUpdated() {
Logger.info(TAG,
`onTopNavigationDataUpdated currentTopNavIndex: ${this.currentTopNavSelectedIndex},topNavList.length:${this.topNavList.length}`);
... ...
... ... @@ -73,9 +73,9 @@ class MinePageDatasModel{
this.personalData.push(new MinePagePersonalFunctionsItem("关注",$r('app.media.mine_follow_icon')))
this.personalData.push(new MinePagePersonalFunctionsItem("收藏",$r('app.media.mine_collect_icon')))
// this.personalData.push(new MinePagePersonalFunctionsItem("历史",$r('app.media.mine_history_icon')))
this.personalData.push(new MinePagePersonalFunctionsItem("消息",$r('app.media.mine_msg_icon')))
// this.personalData.push(new MinePagePersonalFunctionsItem("留言板",$r('app.media.mine_msgboard_icon')))
this.personalData.push(new MinePagePersonalFunctionsItem("预约",$r('app.media.mine_order_icon')))
this.personalData.push(new MinePagePersonalFunctionsItem("消息",$r('app.media.mine_msg_icon')))
return this.personalData
}
... ...
... ... @@ -182,7 +182,8 @@ export struct DetailPlayShortVideoPage {
index: $index,
currentIndex: $currentIndex,
showCommentList: $showCommentList,
publishCommentModel: $publishCommentModel
publishCommentModel: $publishCommentModel,
interactData: $interactData,
})
this.playerViewBuilder()
... ...
import { ContentDetailDTO, PageInfoDTO } from 'wdBean/Index'
import { ContentDetailDTO, InteractDataDTO, PageInfoDTO } from 'wdBean/Index'
import { CommentListDialogView, publishCommentModel } from 'wdComponent/Index'
... ... @@ -9,6 +9,7 @@ export struct CommentDialogView {
@Link currentIndex: number
@Link publishCommentModel: publishCommentModel
@Consume contentDetailData: ContentDetailDTO
@Link interactData: InteractDataDTO
@State fakePageInfo: PageInfoDTO = {} as PageInfoDTO
@State dialogOffsetY: number = 0 // (this.windowHeight - this.windowWidth * 9 / 16)
... ... @@ -34,6 +35,9 @@ export struct CommentDialogView {
pageInfo: this.fakePageInfo,
onClose: () => {
this.showCommentList = false
if (Number.parseInt(this.publishCommentModel.totalCommentNumer) > Number.parseInt(this.interactData.commentNum + "")) {
this.interactData.commentNum = Number.parseInt(this.publishCommentModel.totalCommentNumer)
}
}
})
}
... ...
... ... @@ -387,7 +387,7 @@ export struct PlayerRightView {
.width(32)
.aspectRatio(1)
Text(this.transNum2String('commentNum') || '抢首评')
Text(this.interactData.commentNum > 0 ? this.transNum2String('commentNum') : '抢首评')
.width('100%')
.fontWeight(500)
.textAlign(TextAlign.Center)
... ...
... ... @@ -9,6 +9,9 @@ import { VideoChannelPage } from './VideoChannelPage';
import ChannelViewModel from 'wdComponent/src/main/ets/viewmodel/ChannelViewModel';
const TAG = 'BottomNavigationComponent';
PersistentStorage.persistProp('channelIds', '');
PersistentStorage.persistProp('indexSettingChannelId', 2002);
let storage = LocalStorage.getShared();
/**
... ...
... ... @@ -6,7 +6,8 @@ import {
postInteractBrowsOperateParams,
postBatchAttentionStatusParams,
postInteractAccentionOperateParams,
Params
Params,
InteractDataDTO
} from 'wdBean';
import display from '@ohos.display';
import { DateTimeUtils } from 'wdKit/Index';
... ... @@ -59,6 +60,7 @@ export struct MultiPictureDetailPageComponent {
@State operationButtonList: string[] = ['comment', 'like', 'collect', 'share']
@State currentOffset: number = 0
@State duration: number = 0
@Provide interactData: InteractDataDTO = {} as InteractDataDTO
pageParam: ParamType = {}
followUserId: string = ''
followUserName: string = ''
... ... @@ -116,7 +118,8 @@ export struct MultiPictureDetailPageComponent {
index: $index,
currentIndex: $currentIndex,
showCommentList: $showCommentList,
publishCommentModel: $publishCommentModel
publishCommentModel: $publishCommentModel,
interactData:$interactData
})
}
... ...