Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
liyubing
2024-06-18 16:10:08 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8b94e1937d30416188f9fa5e51e242096b631fb8
8b94e193
1 parent
287f56ce
feat:
1)编辑我的频道- 临时频道需要点击进入编辑页面,临时频道才能被录入我的频道栏目
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
5 deletions
sight_harmony/features/wdComponent/src/main/ets/components/page/ChannelSubscriptionLayout.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/ChannelSubscriptionLayout.ets
View file @
8b94e19
import { TopNavDTO } from 'wdBean';
import curves from '@ohos.curves';
import { Logger } from 'wdKit/Index';
const INDEX_SETTING_TITLE: string = '首页设置'
const INDEX_SETTING_SUBTITLE: string = '将指定频道设置为首页'
...
...
@@ -29,6 +30,7 @@ struct ChannelSubscriptionLayout {
@Link localChannelList: TopNavDTO []
// 收集到的我的频道栏目中的频道id
@State channelIds: number [] = []
// 是否显示频道编辑页面
@State isShow: boolean = false
@State dragItem: number = -1
private dragRefOffsetX: number = 0
...
...
@@ -39,6 +41,9 @@ struct ChannelSubscriptionLayout {
private FIX_VP_Y: number = 48
@State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002
@State isEditIng: boolean = false
// 顶部导航栏是否有临时跳转频道数据不
@Prop haveTempTabData: boolean
changeTab: (index: number) => void = () => {
}
...
...
@@ -566,15 +571,21 @@ struct ChannelSubscriptionLayout {
.backgroundColor(Color.White)
.onClick(() => {
this.isShow = true
if(this.haveTempTabData){
// 存储数据
AppStorage.setOrCreate('channelIds', this.channelIds.join(','))
this.haveTempTabData = false
}
})
.bindContentCover(this.isShow, this.sheetBuilder(), {
modalTransition: ModalTransition.DEFAULT,
onWillAppear: () => {console.log("BindContentCover onWillAppear.")},
onAppear: () => {console.log("BindContentCover onAppear.")},
onWillDisappear: () => {console.log("BindContentCover onWillDisappear.")},
onDisappear: () => {console.log("BindContentCover onDisappear.")
onWillDisappear: () => {console.log("BindContentCover onWillDisappear.")
this.isShow = false
this.isEditIng = false}
this.isEditIng = false},
onDisappear: () => {console.log("BindContentCover onDisappear.")
}
})
}
...
...
@@ -591,6 +602,8 @@ struct ChannelSubscriptionLayout {
this.channelIds.push(item.channelId)
}
})
// console.debug('TopNavigationComponent', '--changeMyChannelData channelIds--->' + this.channelIds.join(','))
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
View file @
8b94e19
...
...
@@ -64,6 +64,8 @@ export struct TopNavigationComponentNew {
@State indicatorLeftMargin: number = 0
@State indicatorWidth: number = 0
@State isClickMorningEveningPaper: boolean = false
// 顶部导航栏是否有临时跳转频道数据不
@State haveTempTabData : boolean = false
build() {
Column() {
...
...
@@ -215,6 +217,7 @@ export struct TopNavigationComponentNew {
myChannelList: $myChannelList,
moreChannelList: $moreChannelList,
localChannelList: $localChannelList,
haveTempTabData:this.haveTempTabData,
changeTab: (index) => {
this.channelJumpToPage(index)
}
...
...
@@ -501,8 +504,6 @@ export struct TopNavigationComponentNew {
}
let channelId = this.assignChannel.channelId
Logger.debug(TAG,'------onAssignChannelChange--------->'+channelId+' ==>'+this._currentNavIndex)
let index = -1
if (this._currentNavIndex === 0) {
// 第一个,新闻,先拿我的,再拿其他
...
...
@@ -556,6 +557,7 @@ export struct TopNavigationComponentNew {
return -1
}
/**
* 新闻,从其他里拿数据
*/
...
...
@@ -564,6 +566,7 @@ export struct TopNavigationComponentNew {
let topNavDTO: TopNavDTO = this.moreChannelList[i]
if (topNavDTO.channelId?.toString() === channelId) {
this.moreChannelList.splice(i,1)
this.haveTempTabData = true
return topNavDTO
}
}
...
...
@@ -571,6 +574,7 @@ export struct TopNavigationComponentNew {
let topNavDTO: TopNavDTO = this.localChannelList[j]
if (topNavDTO.channelId?.toString() === channelId) {
this.localChannelList.splice(j,1)
this.haveTempTabData = true
return topNavDTO
}
}
...
...
@@ -729,11 +733,14 @@ export struct TopNavigationComponentNew {
_myChannelList = sortedyChannelList
}
Logger.debug(TAG,'cityName===>'+cityName)
// if (cityName) {
// let index = _myChannelList.findIndex(ele => cityName.includes(ele.name))
// Logger.debug(TAG,'index===>'+index)
// const localChannelitem = _myChannelList.splice(index, 1)[0];
// // 将当前地区频道插入到第四个
// _myChannelList.splice(3, 0, localChannelitem);
// //_myChannelList[3] = localChannelitem
// }
this.myChannelList = _myChannelList
...
...
Please
register
or
login
to post a comment