chenqs

fix |> 频道编辑页首页设置问题修复

... ... @@ -46,6 +46,7 @@ struct ChannelSubscriptionLayout {
navItem: BottomNavDTO = {} as BottomNavDTO
// 顶部导航栏是否有临时跳转频道数据不
@Prop haveTempTabData: boolean
changeTab: (index: number) => void = () => {
}
... ... @@ -272,6 +273,25 @@ struct ChannelSubscriptionLayout {
}
}
@Builder
firstSettingItemBuilder (item:TopNavDTO, index: number){
if (this.homeChannelList.length == 1) {
Image('')
.width('100%')
.height('100%')
.backgroundColor('#ED2800')
.borderRadius(4)
}else {
Image(item.channelId === this.indexSettingChannelId ? $r('app.media.index_setting_button_active') :
$r('app.media.index_setting_button'))
.objectFit(ImageFit.Contain)
.rotate({
angle: index === 1 ? 180 : 0
})
}
}
@Builder
sheetBuilder() {
Column() {
... ... @@ -290,60 +310,64 @@ struct ChannelSubscriptionLayout {
.padding({ bottom: 10 })
List() {
ListItem() {
Row() {
Text(INDEX_SETTING_TITLE)
.fontSize(16)
.fontWeight(600)
.margin({ right: 4 })
Text(INDEX_SETTING_SUBTITLE)
.fontSize(12)
.fontWeight(400)
.fontColor('#80222222')
if (this.homeChannelList.length > 0) {
ListItem() {
Row() {
Text(INDEX_SETTING_TITLE)
.fontSize(16)
.fontWeight(600)
.margin({ right: 4 })
Text(INDEX_SETTING_SUBTITLE)
.fontSize(12)
.fontWeight(400)
.fontColor('#80222222')
}
.width('100%')
.margin({ top: 22, bottom: 16 })
}
.width('100%')
.margin({ top: 22, bottom: 16 })
}
ListItem() {
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
ForEach(this.homeChannelList, (item: TopNavDTO, index: number) => {
Stack() {
this.firstSettingItemBuilder(item,index)
// Image(item.channelId === this.indexSettingChannelId ? $r('app.media.index_setting_button_active') :
// $r('app.media.index_setting_button'))
// .objectFit(ImageFit.Contain)
// .rotate({
// angle: index === 1 ? 180 : 0
// })
Row() {
if (index === 0) {
Image(item.channelId === this.indexSettingChannelId ? $r('app.media.recommend_icon') :
$r('app.media.recommend_icon_active'))
.width(20)
}
Text(item.name)
.textAlign(TextAlign.Center)
.fontSize(16)
.fontColor(item.channelId === this.indexSettingChannelId ? '#ffffff' : '#ED2800')
ListItem() {
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
ForEach(this.homeChannelList, (item: TopNavDTO, index: number) => {
Stack() {
Image(item.channelId === this.indexSettingChannelId ? $r('app.media.index_setting_button_active') :
$r('app.media.index_setting_button'))
.objectFit(ImageFit.Auto)
.rotate({
angle: index === 1 ? 180 : 0
})
Row() {
if (index === 0) {
Image(item.channelId === this.indexSettingChannelId ? $r('app.media.recommend_icon') :
$r('app.media.recommend_icon_active'))
.width(20)
}
Text(item.name)
.textAlign(TextAlign.Center)
.fontSize(16)
.fontColor(item.channelId === this.indexSettingChannelId ? '#ffffff' : '#ED2800')
.width('100%')
.justifyContent(FlexAlign.Center)
}
.width('100%')
.justifyContent(FlexAlign.Center)
}
.alignContent(Alignment.Start)
.height(36)
.onClick(() => {
this.indexSettingChannelId = item.channelId
AppStorage.set('indexSettingChannelId', item.channelId)
.alignContent(Alignment.Start)
.height(36)
.layoutWeight(1)
.onClick(() => {
this.indexSettingChannelId = item.channelId
AppStorage.set('indexSettingChannelId', item.channelId)
})
})
})
}
.height(36)
.margin({ bottom: 36 })
}
.height(36)
.margin({ bottom: 36 })
}
ListItem() {
Row() {
Row() {
... ... @@ -366,7 +390,7 @@ struct ChannelSubscriptionLayout {
}
.width('100%')
.justifyContent(FlexAlign.SpaceBetween)
.margin({ bottom: 12 })
.margin({ top:this.homeChannelList.length > 0?0:22,bottom: 12 })
}
// 我的频道列表
... ...