张善主

Merge remote-tracking branch 'origin/main'

1 /** 1 /**
2 * More_Comp 2 * More_Comp
3 */ 3 */
4 -import { ContentDTO , contentListParams, FullColumnImgUrlDTO, 4 +import { ContentDTO , contentListParams, FullColumnImgUrlDTO, CompDTO
5 } from 'wdBean/Index'; 5 } from 'wdBean/Index';
6 import MinePageDatasModel from '../../model/MinePageDatasModel'; 6 import MinePageDatasModel from '../../model/MinePageDatasModel';
7 import SearcherAboutDataModel from '../../model/SearcherAboutDataModel'; 7 import SearcherAboutDataModel from '../../model/SearcherAboutDataModel';
8 import { SearchDescription } from '../../viewmodel/SearchResultContentItem'; 8 import { SearchDescription } from '../../viewmodel/SearchResultContentItem';
  9 +import { CardParser } from '../CardParser'
9 10
10 const TAG: string = 'More_Comp'; 11 const TAG: string = 'More_Comp';
11 12
@@ -13,26 +14,54 @@ const TAG: string = 'More_Comp'; @@ -13,26 +14,54 @@ const TAG: string = 'More_Comp';
13 @Component 14 @Component
14 export struct MoreComponent { 15 export struct MoreComponent {
15 @State contentDTO: ContentDTO = new ContentDTO(); 16 @State contentDTO: ContentDTO = new ContentDTO();
  17 + @State showDetail: boolean = false;
16 18
17 aboutToAppear(): void { 19 aboutToAppear(): void {
18 this.dealSearchSameList() 20 this.dealSearchSameList()
19 } 21 }
20 22
21 build() { 23 build() {
22 - Row() {  
23 - Text('点击展开更多相似')  
24 - .fontSize(16)  
25 - Text(`(${this.contentDTO.sameContentListSize})`)  
26 - .fontSize(16)  
27 - Image($r('app.media.comment_unfold'))  
28 - .width(16)  
29 - .height(16) 24 + if (this.showDetail) {
  25 + ForEach(this.contentDTO.sameContentList, (item: ContentDTO, index: number) => {
  26 + CardParser({compDTO:new CompDTO, contentDTO: item })
  27 + })
  28 + } else {
  29 + Column() {
  30 +
  31 + Divider()
  32 + .width('100%')
  33 + .height(10)
  34 + .color($r('app.color.color_F5F5F5'))
  35 + .strokeWidth('1lpx')
  36 +
  37 + Row() {
  38 + Text('点击展开更多相似')
  39 + .fontSize(16)
  40 + Text(`(${this.contentDTO.sameContentListSize})`)
  41 + .fontSize(16)
  42 + Image($r('app.media.comment_unfold'))
  43 + .width(16)
  44 + .height(16)
  45 + }
  46 + .justifyContent(FlexAlign.Center)
  47 + .width('100%')
  48 + .height(48)
  49 + .backgroundColor(0xffffff)
  50 + .onClick(() => {
  51 + this.showDetail = true;
  52 + })
  53 +
  54 + Divider()
  55 + .width('100%')
  56 + .height(10)
  57 + .color($r('app.color.color_F5F5F5'))
  58 + .strokeWidth('1lpx')
30 59
  60 + }
31 } 61 }
32 - .justifyContent(FlexAlign.Center)  
33 - .width('100%')  
34 - .height(48)  
35 - .backgroundColor(0xffffff) 62 +
  63 +
  64 +
36 } 65 }
37 66
38 dealSearchSameList() { 67 dealSearchSameList() {
@@ -88,6 +117,8 @@ export struct MoreComponent { @@ -88,6 +117,8 @@ export struct MoreComponent {
88 console.log("ycg","123") 117 console.log("ycg","123")
89 } 118 }
90 }) 119 })
  120 +
  121 + console.log("MoreComponent", JSON.stringify(this.contentDTO.sameContentList))
91 }).catch((err: Error) => { 122 }).catch((err: Error) => {
92 console.log(TAG, JSON.stringify(err)) 123 console.log(TAG, JSON.stringify(err))
93 }) 124 })
@@ -176,6 +176,7 @@ export struct QualityCommentsComponent { @@ -176,6 +176,7 @@ export struct QualityCommentsComponent {
176 .fontWeight(400) 176 .fontWeight(400)
177 .fontColor($r('app.color.color_222222')) 177 .fontColor($r('app.color.color_222222'))
178 .lineHeight('42lpx') 178 .lineHeight('42lpx')
  179 + .visibility(this.tileOpacity < 0.8 ? 1 : 0)
179 } 180 }
180 .height(44) 181 .height(44)
181 .width('100%') 182 .width('100%')
@@ -37,10 +37,14 @@ export struct PlayerRightView { @@ -37,10 +37,14 @@ export struct PlayerRightView {
37 @Consume showCommentList: boolean 37 @Consume showCommentList: boolean
38 @Consume displayDirection: DisplayDirection 38 @Consume displayDirection: DisplayDirection
39 @Consume publishCommentModel: publishCommentModel 39 @Consume publishCommentModel: publishCommentModel
40 - @State likesStyle: number = this.contentDetailData.likesStyle // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空  
41 - 40 + @State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
  41 + @State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以
42 aboutToAppear() { 42 aboutToAppear() {
43 - 43 + // 内容用 点赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
  44 + this.likesStyle = this.contentDetailData.likesStyle
  45 + this.openLikes = this.contentDetailData.openLikes == 1 ? true : false
  46 + // console.log(TAG, 'this.likesStyle', this.likesStyle)
  47 + // console.log(TAG, 'this.openLikes', this.openLikes)
44 } 48 }
45 49
46 /** 50 /**
@@ -299,7 +303,7 @@ export struct PlayerRightView { @@ -299,7 +303,7 @@ export struct PlayerRightView {
299 .margin({ top: 2 }) 303 .margin({ top: 2 })
300 } 304 }
301 .margin({ bottom: 20 }) 305 .margin({ bottom: 20 })
302 - .visibility(this.likesStyle !== 4 ? Visibility.Visible : Visibility.None) 306 + .visibility(this.likesStyle == 4 || this.likesStyle == 'empty' || !this.openLikes ? Visibility.None : Visibility.Visible)
303 .onClick(() => { 307 .onClick(() => {
304 // TODO:点赞动画 308 // TODO:点赞动画
305 this.toggleLikeStatus() 309 this.toggleLikeStatus()