chenqs

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

@@ -46,6 +46,7 @@ struct ChannelSubscriptionLayout { @@ -46,6 +46,7 @@ struct ChannelSubscriptionLayout {
46 navItem: BottomNavDTO = {} as BottomNavDTO 46 navItem: BottomNavDTO = {} as BottomNavDTO
47 // 顶部导航栏是否有临时跳转频道数据不 47 // 顶部导航栏是否有临时跳转频道数据不
48 @Prop haveTempTabData: boolean 48 @Prop haveTempTabData: boolean
  49 +
49 changeTab: (index: number) => void = () => { 50 changeTab: (index: number) => void = () => {
50 } 51 }
51 52
@@ -272,6 +273,25 @@ struct ChannelSubscriptionLayout { @@ -272,6 +273,25 @@ struct ChannelSubscriptionLayout {
272 } 273 }
273 } 274 }
274 275
  276 +
  277 + @Builder
  278 + firstSettingItemBuilder (item:TopNavDTO, index: number){
  279 + if (this.homeChannelList.length == 1) {
  280 + Image('')
  281 + .width('100%')
  282 + .height('100%')
  283 + .backgroundColor('#ED2800')
  284 + .borderRadius(4)
  285 + }else {
  286 + Image(item.channelId === this.indexSettingChannelId ? $r('app.media.index_setting_button_active') :
  287 + $r('app.media.index_setting_button'))
  288 + .objectFit(ImageFit.Contain)
  289 + .rotate({
  290 + angle: index === 1 ? 180 : 0
  291 + })
  292 + }
  293 + }
  294 +
275 @Builder 295 @Builder
276 sheetBuilder() { 296 sheetBuilder() {
277 Column() { 297 Column() {
@@ -290,6 +310,8 @@ struct ChannelSubscriptionLayout { @@ -290,6 +310,8 @@ struct ChannelSubscriptionLayout {
290 .padding({ bottom: 10 }) 310 .padding({ bottom: 10 })
291 311
292 List() { 312 List() {
  313 +
  314 + if (this.homeChannelList.length > 0) {
293 ListItem() { 315 ListItem() {
294 Row() { 316 Row() {
295 Text(INDEX_SETTING_TITLE) 317 Text(INDEX_SETTING_TITLE)
@@ -311,12 +333,13 @@ struct ChannelSubscriptionLayout { @@ -311,12 +333,13 @@ struct ChannelSubscriptionLayout {
311 Flex({ justifyContent: FlexAlign.SpaceBetween }) { 333 Flex({ justifyContent: FlexAlign.SpaceBetween }) {
312 ForEach(this.homeChannelList, (item: TopNavDTO, index: number) => { 334 ForEach(this.homeChannelList, (item: TopNavDTO, index: number) => {
313 Stack() { 335 Stack() {
314 - Image(item.channelId === this.indexSettingChannelId ? $r('app.media.index_setting_button_active') :  
315 - $r('app.media.index_setting_button'))  
316 - .objectFit(ImageFit.Auto)  
317 - .rotate({  
318 - angle: index === 1 ? 180 : 0  
319 - }) 336 + this.firstSettingItemBuilder(item,index)
  337 + // Image(item.channelId === this.indexSettingChannelId ? $r('app.media.index_setting_button_active') :
  338 + // $r('app.media.index_setting_button'))
  339 + // .objectFit(ImageFit.Contain)
  340 + // .rotate({
  341 + // angle: index === 1 ? 180 : 0
  342 + // })
320 Row() { 343 Row() {
321 if (index === 0) { 344 if (index === 0) {
322 Image(item.channelId === this.indexSettingChannelId ? $r('app.media.recommend_icon') : 345 Image(item.channelId === this.indexSettingChannelId ? $r('app.media.recommend_icon') :
@@ -334,6 +357,7 @@ struct ChannelSubscriptionLayout { @@ -334,6 +357,7 @@ struct ChannelSubscriptionLayout {
334 } 357 }
335 .alignContent(Alignment.Start) 358 .alignContent(Alignment.Start)
336 .height(36) 359 .height(36)
  360 + .layoutWeight(1)
337 .onClick(() => { 361 .onClick(() => {
338 this.indexSettingChannelId = item.channelId 362 this.indexSettingChannelId = item.channelId
339 AppStorage.set('indexSettingChannelId', item.channelId) 363 AppStorage.set('indexSettingChannelId', item.channelId)
@@ -343,7 +367,7 @@ struct ChannelSubscriptionLayout { @@ -343,7 +367,7 @@ struct ChannelSubscriptionLayout {
343 .height(36) 367 .height(36)
344 .margin({ bottom: 36 }) 368 .margin({ bottom: 36 })
345 } 369 }
346 - 370 + }
347 ListItem() { 371 ListItem() {
348 Row() { 372 Row() {
349 Row() { 373 Row() {
@@ -366,7 +390,7 @@ struct ChannelSubscriptionLayout { @@ -366,7 +390,7 @@ struct ChannelSubscriptionLayout {
366 } 390 }
367 .width('100%') 391 .width('100%')
368 .justifyContent(FlexAlign.SpaceBetween) 392 .justifyContent(FlexAlign.SpaceBetween)
369 - .margin({ bottom: 12 }) 393 + .margin({ top:this.homeChannelList.length > 0?0:22,bottom: 12 })
370 } 394 }
371 395
372 // 我的频道列表 396 // 我的频道列表