Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
Showing
38 changed files
with
425 additions
and
131 deletions
| @@ -29,6 +29,14 @@ | @@ -29,6 +29,14 @@ | ||
| 29 | "value": "14fp" | 29 | "value": "14fp" |
| 30 | }, | 30 | }, |
| 31 | { | 31 | { |
| 32 | + "name": "font_size_14_5", | ||
| 33 | + "value": "14.5fp" | ||
| 34 | + }, | ||
| 35 | + { | ||
| 36 | + "name": "font_size_15", | ||
| 37 | + "value": "15fp" | ||
| 38 | + }, | ||
| 39 | + { | ||
| 32 | "name": "font_size_16", | 40 | "name": "font_size_16", |
| 33 | "value": "16fp" | 41 | "value": "16fp" |
| 34 | }, | 42 | }, |
| @@ -681,6 +681,15 @@ export class HttpUrlUtils { | @@ -681,6 +681,15 @@ export class HttpUrlUtils { | ||
| 681 | return url | 681 | return url |
| 682 | } | 682 | } |
| 683 | 683 | ||
| 684 | + static getLiveSendBarrageUrl() { | ||
| 685 | + let url = HttpUrlUtils.getHost() + "/api/live-center-message/zh/c/live/message/chat/send" | ||
| 686 | + return url | ||
| 687 | + } | ||
| 688 | + static getLiveTouristSendBarrageUrl() { | ||
| 689 | + let url = HttpUrlUtils.getHost() + "/api/live-center-message/zh/a/live/message/chat/tourist/send" | ||
| 690 | + return url | ||
| 691 | + } | ||
| 692 | + | ||
| 684 | static getAppointmentStatusUrl() { | 693 | static getAppointmentStatusUrl() { |
| 685 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.LIVE_APPOINTMENT_BATCH_PATH | 694 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.LIVE_APPOINTMENT_BATCH_PATH |
| 686 | return url | 695 | return url |
| @@ -59,6 +59,7 @@ export class ContentDTO implements BaseDTO { | @@ -59,6 +59,7 @@ export class ContentDTO implements BaseDTO { | ||
| 59 | source: string = ''; | 59 | source: string = ''; |
| 60 | objectId: string = ''; | 60 | objectId: string = ''; |
| 61 | objectType: string = ''; | 61 | objectType: string = ''; |
| 62 | + objectLevel: string = ''; | ||
| 62 | channelId: string = ''; | 63 | channelId: string = ''; |
| 63 | relId: string = ''; | 64 | relId: string = ''; |
| 64 | relType: string = ''; | 65 | relType: string = ''; |
| @@ -102,6 +103,7 @@ export class ContentDTO implements BaseDTO { | @@ -102,6 +103,7 @@ export class ContentDTO implements BaseDTO { | ||
| 102 | liveRoomDataBean : LiveRoomDataBean = {} as LiveRoomDataBean// 批查获取到的直播观看人数 | 103 | liveRoomDataBean : LiveRoomDataBean = {} as LiveRoomDataBean// 批查获取到的直播观看人数 |
| 103 | //本地字段:时间轴专题页节点组件时间;【如果开启模糊则显示时间->左右;0:否,1:是】 | 104 | //本地字段:时间轴专题页节点组件时间;【如果开启模糊则显示时间->左右;0:否,1:是】 |
| 104 | timeBlurred:number = 0 | 105 | timeBlurred:number = 0 |
| 106 | + top:number = 0 | ||
| 105 | 107 | ||
| 106 | static clone(old: ContentDTO): ContentDTO { | 108 | static clone(old: ContentDTO): ContentDTO { |
| 107 | let content = new ContentDTO(); | 109 | let content = new ContentDTO(); |
| @@ -32,6 +32,10 @@ export struct CardParser { | @@ -32,6 +32,10 @@ export struct CardParser { | ||
| 32 | pageShowTime:number = 0; | 32 | pageShowTime:number = 0; |
| 33 | pageHideTime:number = 0; | 33 | pageHideTime:number = 0; |
| 34 | 34 | ||
| 35 | + aboutToAppear(): void { | ||
| 36 | + console.log('CardParser-', JSON.stringify(this.contentDTO)) | ||
| 37 | + } | ||
| 38 | + | ||
| 35 | onPageShow() { | 39 | onPageShow() { |
| 36 | this.pageShowTime = DateTimeUtils.getTimeStamp() | 40 | this.pageShowTime = DateTimeUtils.getTimeStamp() |
| 37 | } | 41 | } |
| @@ -49,10 +49,15 @@ export struct FeedBackActivity { | @@ -49,10 +49,15 @@ export struct FeedBackActivity { | ||
| 49 | Column() { | 49 | Column() { |
| 50 | Text($r('app.string.feedback_opinion_type')) | 50 | Text($r('app.string.feedback_opinion_type')) |
| 51 | .fontColor($r('app.color.color_222222')) | 51 | .fontColor($r('app.color.color_222222')) |
| 52 | - .fontSize($r('app.float.font_size_16')) | ||
| 53 | - .fontWeight(FontWeight.Bold) | 52 | + .fontSize($r('app.float.font_size_14_5')) |
| 53 | + .fontWeight(600) | ||
| 54 | .width('100%') | 54 | .width('100%') |
| 55 | .margin({ left: 24, top: $r('app.float.vp_14') }) | 55 | .margin({ left: 24, top: $r('app.float.vp_14') }) |
| 56 | + Blank() | ||
| 57 | + .height(0.5) | ||
| 58 | + .width('94%') | ||
| 59 | + .margin({ top: $r('app.float.vp_12') }) | ||
| 60 | + .backgroundColor($r('app.color.color_EDEDED')) | ||
| 56 | GridRow({ | 61 | GridRow({ |
| 57 | columns:3, | 62 | columns:3, |
| 58 | }) { | 63 | }) { |
| @@ -82,15 +87,15 @@ export struct FeedBackActivity { | @@ -82,15 +87,15 @@ export struct FeedBackActivity { | ||
| 82 | } | 87 | } |
| 83 | }) | 88 | }) |
| 84 | } | 89 | } |
| 85 | - .width('94%') | 90 | + .width('90%') |
| 86 | .margin({top:$r('app.float.vp_16')}) | 91 | .margin({top:$r('app.float.vp_16')}) |
| 87 | Blank() | 92 | Blank() |
| 88 | .height($r('app.float.margin_5')) | 93 | .height($r('app.float.margin_5')) |
| 89 | .backgroundColor($r('app.color.color_F5F5F5')) | 94 | .backgroundColor($r('app.color.color_F5F5F5')) |
| 90 | Text($r('app.string.feedback_opinion_tv')) | 95 | Text($r('app.string.feedback_opinion_tv')) |
| 91 | .fontColor($r('app.color.color_222222')) | 96 | .fontColor($r('app.color.color_222222')) |
| 92 | - .fontSize($r('app.float.font_size_16')) | ||
| 93 | - .fontWeight(FontWeight.Bold) | 97 | + .fontSize($r('app.float.font_size_14_5')) |
| 98 | + .fontWeight(600) | ||
| 94 | .width(CommonConstants.FULL_WIDTH) | 99 | .width(CommonConstants.FULL_WIDTH) |
| 95 | .margin({ left: 24, top: $r('app.float.vp_12') }) | 100 | .margin({ left: 24, top: $r('app.float.vp_12') }) |
| 96 | Stack({ alignContent: Alignment.BottomEnd }) { | 101 | Stack({ alignContent: Alignment.BottomEnd }) { |
| @@ -191,26 +196,46 @@ export struct FeedBackActivity { | @@ -191,26 +196,46 @@ export struct FeedBackActivity { | ||
| 191 | .fontSize($r('app.float.font_size_13_2')) | 196 | .fontSize($r('app.float.font_size_13_2')) |
| 192 | .width('94%') | 197 | .width('94%') |
| 193 | .margin({ top: $r('app.float.margin_24') }) | 198 | .margin({ top: $r('app.float.margin_24') }) |
| 199 | + | ||
| 194 | Row() { | 200 | Row() { |
| 201 | + Blank().width('3%') | ||
| 195 | Text($r('app.string.feedback_mail')) | 202 | Text($r('app.string.feedback_mail')) |
| 203 | + .height(CommonConstants.FULL_HEIGHT) | ||
| 196 | .fontColor($r('app.color.color_222222')) | 204 | .fontColor($r('app.color.color_222222')) |
| 197 | - .fontSize($r('app.float.font_size_14')) | ||
| 198 | - .fontWeight(FontWeight.Bold) | 205 | + .fontSize($r('app.float.font_size_13_2')) |
| 206 | + .fontWeight(600) | ||
| 207 | + .padding({left: $r('app.float.margin_12') }) | ||
| 208 | + .backgroundColor($r('app.color.color_F5F5F5')) | ||
| 209 | + .borderRadius({ | ||
| 210 | + topLeft: 4, | ||
| 211 | + topRight: 0, | ||
| 212 | + bottomLeft: 4, | ||
| 213 | + bottomRight: 0, | ||
| 214 | + }) | ||
| 215 | + | ||
| 199 | TextInput({ placeholder: $r('app.string.feedback_hideemail') }) | 216 | TextInput({ placeholder: $r('app.string.feedback_hideemail') }) |
| 200 | - .width(CommonConstants.FULL_WIDTH) | 217 | + .width(0) |
| 218 | + .layoutWeight(1) | ||
| 201 | .height(CommonConstants.FULL_HEIGHT) | 219 | .height(CommonConstants.FULL_HEIGHT) |
| 202 | - // .margin({left:15}) | 220 | + .fontColor($r('app.color.color_222222')) |
| 221 | + .fontSize($r('app.float.font_size_13_2')) | ||
| 222 | + .placeholderColor($r('app.color.color_CCCCCC')) | ||
| 223 | + .placeholderFont({size:$r('app.float.font_size_13_2')}) | ||
| 203 | .backgroundColor($r('app.color.color_F5F5F5')) | 224 | .backgroundColor($r('app.color.color_F5F5F5')) |
| 225 | + .borderRadius({ | ||
| 226 | + topLeft: 0, | ||
| 227 | + topRight: 4, | ||
| 228 | + bottomLeft: 0, | ||
| 229 | + bottomRight: 4, | ||
| 230 | + }) | ||
| 204 | .onChange((value) => { | 231 | .onChange((value) => { |
| 205 | - // Logger.debug(TAG, "onChange" + value + "/" + this.passwordContent) | ||
| 206 | this.email = value | 232 | this.email = value |
| 207 | }) | 233 | }) |
| 234 | + Blank().width('3%') | ||
| 208 | } | 235 | } |
| 209 | - .height(44) | ||
| 210 | - .width('94%') | ||
| 211 | - .backgroundColor($r('app.color.color_F5F5F5')) | ||
| 212 | - .margin({top: $r('app.float.margin_16') }) | ||
| 213 | - .borderRadius(4) | 236 | + .height(42) |
| 237 | + .width(CommonConstants.FULL_WIDTH) | ||
| 238 | + .margin({top: $r('app.float.margin_16')}) | ||
| 214 | Blank().layoutWeight(1) | 239 | Blank().layoutWeight(1) |
| 215 | } | 240 | } |
| 216 | } | 241 | } |
| @@ -222,8 +247,8 @@ export struct FeedBackActivity { | @@ -222,8 +247,8 @@ export struct FeedBackActivity { | ||
| 222 | Column(){ | 247 | Column(){ |
| 223 | Text($r('app.string.submit')) | 248 | Text($r('app.string.submit')) |
| 224 | .textAlign(TextAlign.Center) | 249 | .textAlign(TextAlign.Center) |
| 225 | - .height(44) | ||
| 226 | - .width('90%') | 250 | + .height(42) |
| 251 | + .width('94%') | ||
| 227 | .fontColor(this.canSubmit ? $r('app.color.color_fff') : $r('app.color.color_FFFFFF_40')) | 252 | .fontColor(this.canSubmit ? $r('app.color.color_fff') : $r('app.color.color_FFFFFF_40')) |
| 228 | .fontSize($r('app.float.font_size_18')) | 253 | .fontSize($r('app.float.font_size_18')) |
| 229 | .backgroundColor(this.canSubmit ? $r('app.color.color_ED2800') : $r('app.color.color_ED2800_99')) | 254 | .backgroundColor(this.canSubmit ? $r('app.color.color_ED2800') : $r('app.color.color_ED2800_99')) |
| @@ -169,8 +169,8 @@ export struct SingleColumn999Component { | @@ -169,8 +169,8 @@ export struct SingleColumn999Component { | ||
| 169 | */ | 169 | */ |
| 170 | @Builder | 170 | @Builder |
| 171 | buildPaperItem(item: ContentDTO, index: number) { | 171 | buildPaperItem(item: ContentDTO, index: number) { |
| 172 | - ///屏蔽早晚报 音频 | ||
| 173 | - if (item.objectType != '13'){ | 172 | + ///屏蔽早晚报 音频 和 音频专题 |
| 173 | + if (item.objectType != '13'&&!(item.objectType == '5' && item.objectLevel === '22')){ | ||
| 174 | PaperSingleColumn999CardView({ | 174 | PaperSingleColumn999CardView({ |
| 175 | item: item, | 175 | item: item, |
| 176 | index: index, | 176 | index: index, |
| @@ -39,13 +39,16 @@ export struct Card11Component { | @@ -39,13 +39,16 @@ export struct Card11Component { | ||
| 39 | Column() { | 39 | Column() { |
| 40 | Stack() { | 40 | Stack() { |
| 41 | if(this.contentDTO.objectType == '5'){ | 41 | if(this.contentDTO.objectType == '5'){ |
| 42 | - Notes({ objectType: this.contentDTO.objectType }).height(20).align(Alignment.Center) | 42 | + Notes({ objectType: this.contentDTO.objectType }).height(28).align(Alignment.Center) |
| 43 | } else { | 43 | } else { |
| 44 | if (this.contentDTO.seoTags) { | 44 | if (this.contentDTO.seoTags) { |
| 45 | - Notes({ newTags: this.contentDTO.seoTags }).height(20).align(Alignment.Center) | 45 | + Notes({ newTags: this.contentDTO.seoTags }).height(28).align(Alignment.Center) |
| 46 | } | 46 | } |
| 47 | if (this.contentDTO.newTags) { | 47 | if (this.contentDTO.newTags) { |
| 48 | - Notes({ newTags: this.contentDTO.newTags }).height(20).align(Alignment.Center) | 48 | + Notes({ newTags: this.contentDTO.newTags }).height(28).align(Alignment.Center) |
| 49 | + } | ||
| 50 | + if (this.contentDTO.top === 1) { | ||
| 51 | + Notes({ newTags: '置顶' }).height(28).align(Alignment.Center) | ||
| 49 | } | 52 | } |
| 50 | } | 53 | } |
| 51 | Text() { | 54 | Text() { |
| @@ -70,7 +73,7 @@ export struct Card11Component { | @@ -70,7 +73,7 @@ export struct Card11Component { | ||
| 70 | .width(CommonConstants.FULL_WIDTH) | 73 | .width(CommonConstants.FULL_WIDTH) |
| 71 | .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && | 74 | .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && |
| 72 | (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : | 75 | (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : |
| 73 | - ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 : | 76 | + ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5' || this.contentDTO.top === 1) ? 35 : |
| 74 | 0 ) | 77 | 0 ) |
| 75 | 78 | ||
| 76 | }.alignContent(Alignment.TopStart) | 79 | }.alignContent(Alignment.TopStart) |
| @@ -69,6 +69,9 @@ export struct Card2Component { | @@ -69,6 +69,9 @@ export struct Card2Component { | ||
| 69 | if (this.contentDTO.newTags) { | 69 | if (this.contentDTO.newTags) { |
| 70 | Notes({ newTags: this.contentDTO.newTags }).height(29).align(Alignment.Center) | 70 | Notes({ newTags: this.contentDTO.newTags }).height(29).align(Alignment.Center) |
| 71 | } | 71 | } |
| 72 | + if (this.contentDTO.top === 1) { | ||
| 73 | + Notes({ newTags: '置顶' }).height(29).align(Alignment.Center) | ||
| 74 | + } | ||
| 72 | } | 75 | } |
| 73 | //新闻标题 | 76 | //新闻标题 |
| 74 | // if (this.contentDTO.newTags) { | 77 | // if (this.contentDTO.newTags) { |
| @@ -101,7 +104,7 @@ export struct Card2Component { | @@ -101,7 +104,7 @@ export struct Card2Component { | ||
| 101 | .align(Alignment.Start) | 104 | .align(Alignment.Start) |
| 102 | .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && | 105 | .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && |
| 103 | (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : | 106 | (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : |
| 104 | - ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 : | 107 | + ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5' || this.contentDTO.top === 1) ? 35 : |
| 105 | 0 ) | 108 | 0 ) |
| 106 | }.alignContent(Alignment.TopStart) | 109 | }.alignContent(Alignment.TopStart) |
| 107 | 110 |
| @@ -50,6 +50,9 @@ export struct Card3Component { | @@ -50,6 +50,9 @@ export struct Card3Component { | ||
| 50 | if (this.contentDTO.newTags) { | 50 | if (this.contentDTO.newTags) { |
| 51 | Notes({ newTags: this.contentDTO.newTags }).height(29).align(Alignment.Center) | 51 | Notes({ newTags: this.contentDTO.newTags }).height(29).align(Alignment.Center) |
| 52 | } | 52 | } |
| 53 | + if (this.contentDTO.top === 1) { | ||
| 54 | + Notes({ newTags: '置顶' }).height(29).align(Alignment.Center) | ||
| 55 | + } | ||
| 53 | } | 56 | } |
| 54 | Text() { | 57 | Text() { |
| 55 | if (this.titleMarked) { | 58 | if (this.titleMarked) { |
| @@ -71,7 +74,7 @@ export struct Card3Component { | @@ -71,7 +74,7 @@ export struct Card3Component { | ||
| 71 | .width(CommonConstants.FULL_WIDTH) | 74 | .width(CommonConstants.FULL_WIDTH) |
| 72 | .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && | 75 | .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && |
| 73 | (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : | 76 | (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : |
| 74 | - ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 : | 77 | + ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5' || this.contentDTO.top === 1) ? 35 : |
| 75 | 0 ) | 78 | 0 ) |
| 76 | }.alignContent(Alignment.TopStart) | 79 | }.alignContent(Alignment.TopStart) |
| 77 | 80 |
| @@ -55,6 +55,9 @@ export struct Card4Component { | @@ -55,6 +55,9 @@ export struct Card4Component { | ||
| 55 | if (this.contentDTO.newTags) { | 55 | if (this.contentDTO.newTags) { |
| 56 | Notes({ newTags: this.contentDTO.newTags }).height(19).align(Alignment.Center) | 56 | Notes({ newTags: this.contentDTO.newTags }).height(19).align(Alignment.Center) |
| 57 | } | 57 | } |
| 58 | + if (this.contentDTO.top === 1) { | ||
| 59 | + Notes({ newTags: '置顶' }).height(20).align(Alignment.Center) | ||
| 60 | + } | ||
| 58 | } | 61 | } |
| 59 | Text() { | 62 | Text() { |
| 60 | if (this.titleMarked) { | 63 | if (this.titleMarked) { |
| @@ -76,7 +79,7 @@ export struct Card4Component { | @@ -76,7 +79,7 @@ export struct Card4Component { | ||
| 76 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 79 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 77 | .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && | 80 | .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && |
| 78 | (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : | 81 | (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : |
| 79 | - ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 : | 82 | + ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5' || this.contentDTO.top === 1) ? 35 : |
| 80 | 0 ) | 83 | 0 ) |
| 81 | }.alignContent(Alignment.TopStart) | 84 | }.alignContent(Alignment.TopStart) |
| 82 | //新闻标题 | 85 | //新闻标题 |
| @@ -82,6 +82,9 @@ export struct Card5Component { | @@ -82,6 +82,9 @@ export struct Card5Component { | ||
| 82 | if (this.contentDTO.newTags) { | 82 | if (this.contentDTO.newTags) { |
| 83 | Notes({ newTags: this.contentDTO.newTags }).height(20).align(Alignment.Center) | 83 | Notes({ newTags: this.contentDTO.newTags }).height(20).align(Alignment.Center) |
| 84 | } | 84 | } |
| 85 | + if (this.contentDTO.top === 1) { | ||
| 86 | + Notes({ newTags: '置顶' }).height(20).align(Alignment.Center) | ||
| 87 | + } | ||
| 85 | } | 88 | } |
| 86 | 89 | ||
| 87 | Text() { | 90 | Text() { |
| @@ -106,7 +109,7 @@ export struct Card5Component { | @@ -106,7 +109,7 @@ export struct Card5Component { | ||
| 106 | .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 | 109 | .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 |
| 107 | .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && | 110 | .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && |
| 108 | (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : | 111 | (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : |
| 109 | - ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 : | 112 | + ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5' || this.contentDTO.top === 1) ? 35 : |
| 110 | 0 ) | 113 | 0 ) |
| 111 | }.alignContent(Alignment.TopStart) | 114 | }.alignContent(Alignment.TopStart) |
| 112 | } | 115 | } |
| @@ -61,6 +61,9 @@ export struct Card6Component { | @@ -61,6 +61,9 @@ export struct Card6Component { | ||
| 61 | if (this.contentDTO.newTags) { | 61 | if (this.contentDTO.newTags) { |
| 62 | Notes({ newTags: this.contentDTO.newTags }).height(28).align(Alignment.Center) | 62 | Notes({ newTags: this.contentDTO.newTags }).height(28).align(Alignment.Center) |
| 63 | } | 63 | } |
| 64 | + if (this.contentDTO.top === 1) { | ||
| 65 | + Notes({ newTags: '置顶' }).height(28).align(Alignment.Center) | ||
| 66 | + } | ||
| 64 | } | 67 | } |
| 65 | 68 | ||
| 66 | Text() { | 69 | Text() { |
| @@ -86,7 +89,7 @@ export struct Card6Component { | @@ -86,7 +89,7 @@ export struct Card6Component { | ||
| 86 | .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 | 89 | .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 |
| 87 | .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && | 90 | .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && |
| 88 | (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : | 91 | (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : |
| 89 | - ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 : | 92 | + ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5' || this.contentDTO.top === 1) ? 35 : |
| 90 | 0 ) | 93 | 0 ) |
| 91 | }.alignContent(Alignment.TopStart) | 94 | }.alignContent(Alignment.TopStart) |
| 92 | // .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 60: 156) | 95 | // .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 60: 156) |
| @@ -98,6 +98,9 @@ export struct Card9Component { | @@ -98,6 +98,9 @@ export struct Card9Component { | ||
| 98 | if (this.contentDTO.newTags) { | 98 | if (this.contentDTO.newTags) { |
| 99 | Notes({ newTags: this.contentDTO.newTags }).height(20).align(Alignment.Center) | 99 | Notes({ newTags: this.contentDTO.newTags }).height(20).align(Alignment.Center) |
| 100 | } | 100 | } |
| 101 | + if (this.contentDTO.top === 1) { | ||
| 102 | + Notes({ newTags: '置顶' }).height(20).align(Alignment.Center) | ||
| 103 | + } | ||
| 101 | } | 104 | } |
| 102 | 105 | ||
| 103 | }.alignContent(Alignment.BottomStart) | 106 | }.alignContent(Alignment.BottomStart) |
| @@ -438,7 +438,8 @@ export struct PaperSingleColumn999CardView { | @@ -438,7 +438,8 @@ export struct PaperSingleColumn999CardView { | ||
| 438 | Stack({ alignContent: Alignment.BottomEnd }) { | 438 | Stack({ alignContent: Alignment.BottomEnd }) { |
| 439 | Image(this.item?.coverUrl) | 439 | Image(this.item?.coverUrl) |
| 440 | .borderRadius(5) | 440 | .borderRadius(5) |
| 441 | - .aspectRatio(319 / 179) ///图片设计比例 | 441 | + .objectFit(ImageFit.Fill) |
| 442 | + .aspectRatio(16 / 10) ///图片设计比例 | ||
| 442 | .padding({ top: 10 }) | 443 | .padding({ top: 10 }) |
| 443 | //视频 | 444 | //视频 |
| 444 | if (this.item?.videoInfo) { | 445 | if (this.item?.videoInfo) { |
| @@ -629,7 +630,11 @@ export struct PaperSingleColumn999CardView { | @@ -629,7 +630,11 @@ export struct PaperSingleColumn999CardView { | ||
| 629 | }else if(this.item.liveInfo.liveState === 'running'){ | 630 | }else if(this.item.liveInfo.liveState === 'running'){ |
| 630 | contentString = '直播中' | 631 | contentString = '直播中' |
| 631 | }else if(this.item.liveInfo.liveState === 'end'){ | 632 | }else if(this.item.liveInfo.liveState === 'end'){ |
| 633 | + if (this.item.liveInfo.replayUri.length > 0) { | ||
| 632 | contentString = '回看' | 634 | contentString = '回看' |
| 635 | + }else { | ||
| 636 | + contentString = '已结束' | ||
| 637 | + } | ||
| 633 | } | 638 | } |
| 634 | return contentString; | 639 | return contentString; |
| 635 | } | 640 | } |
| @@ -643,7 +648,10 @@ export struct PaperSingleColumn999CardView { | @@ -643,7 +648,10 @@ export struct PaperSingleColumn999CardView { | ||
| 643 | }else if(this.item.liveInfo.liveState === 'running'){ | 648 | }else if(this.item.liveInfo.liveState === 'running'){ |
| 644 | imageString = $r('app.media.card_live') | 649 | imageString = $r('app.media.card_live') |
| 645 | }else if(this.item.liveInfo.liveState === 'end'){ | 650 | }else if(this.item.liveInfo.liveState === 'end'){ |
| 651 | + if (this.item.liveInfo.replayUri.length > 0) { | ||
| 646 | imageString = $r('app.media.card_play') | 652 | imageString = $r('app.media.card_play') |
| 653 | + }else { | ||
| 654 | + } | ||
| 647 | } | 655 | } |
| 648 | return imageString; | 656 | return imageString; |
| 649 | } | 657 | } |
| @@ -23,7 +23,7 @@ struct ChannelSubscriptionLayout { | @@ -23,7 +23,7 @@ struct ChannelSubscriptionLayout { | ||
| 23 | @Link myChannelList: TopNavDTO [] | 23 | @Link myChannelList: TopNavDTO [] |
| 24 | @Link moreChannelList: TopNavDTO [] | 24 | @Link moreChannelList: TopNavDTO [] |
| 25 | @Link localChannelList: TopNavDTO [] | 25 | @Link localChannelList: TopNavDTO [] |
| 26 | - @Link channelIds: number [] | 26 | + @State channelIds: number [] = [] |
| 27 | @State isShow: boolean = false | 27 | @State isShow: boolean = false |
| 28 | @State dragItem: number = -1 | 28 | @State dragItem: number = -1 |
| 29 | private dragRefOffsetX: number = 0 | 29 | private dragRefOffsetX: number = 0 |
| @@ -40,6 +40,9 @@ struct ChannelSubscriptionLayout { | @@ -40,6 +40,9 @@ struct ChannelSubscriptionLayout { | ||
| 40 | 40 | ||
| 41 | aboutToAppear() { | 41 | aboutToAppear() { |
| 42 | this.currentTopNavSelectedItem = this.myChannelList[this.currentTopNavSelectedIndex] | 42 | this.currentTopNavSelectedItem = this.myChannelList[this.currentTopNavSelectedIndex] |
| 43 | + this.myChannelList.forEach(item=>{ | ||
| 44 | + this.channelIds.push(item.channelId) | ||
| 45 | + }) | ||
| 43 | } | 46 | } |
| 44 | 47 | ||
| 45 | //交换我的频道数组中的位置 | 48 | //交换我的频道数组中的位置 |
| @@ -54,7 +57,7 @@ struct ChannelSubscriptionLayout { | @@ -54,7 +57,7 @@ struct ChannelSubscriptionLayout { | ||
| 54 | delChannelItem(index: number){ | 57 | delChannelItem(index: number){ |
| 55 | let item = this.myChannelList.splice(index, 1)[0] | 58 | let item = this.myChannelList.splice(index, 1)[0] |
| 56 | this.channelIds.splice(index, 1) | 59 | this.channelIds.splice(index, 1) |
| 57 | - AppStorage.setOrCreate('channelIds', this.channelIds.join(',')) | 60 | + AppStorage.setOrCreate('channelIds', JSON.stringify(this.channelIds)) |
| 58 | if (item.moreChannel === '1') { | 61 | if (item.moreChannel === '1') { |
| 59 | this.moreChannelList.unshift(item) | 62 | this.moreChannelList.unshift(item) |
| 60 | } | 63 | } |
| @@ -28,7 +28,7 @@ struct PeopleShipHomePage { | @@ -28,7 +28,7 @@ struct PeopleShipHomePage { | ||
| 28 | // 总滑动空间 | 28 | // 总滑动空间 |
| 29 | scroller: Scroller = new Scroller() | 29 | scroller: Scroller = new Scroller() |
| 30 | // 顶部透明度 | 30 | // 顶部透明度 |
| 31 | - @State topOpacity: number = 0 | 31 | + @Watch('topOpacityChange') @State topOpacity: number = 0 |
| 32 | //发布数量 | 32 | //发布数量 |
| 33 | @State publishCount: number = 0 | 33 | @State publishCount: number = 0 |
| 34 | // 是否关注 | 34 | // 是否关注 |
| @@ -42,6 +42,22 @@ struct PeopleShipHomePage { | @@ -42,6 +42,22 @@ struct PeopleShipHomePage { | ||
| 42 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | 42 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 |
| 43 | @State isConnectNetwork : boolean = NetworkUtil.isNetConnected() | 43 | @State isConnectNetwork : boolean = NetworkUtil.isNetConnected() |
| 44 | 44 | ||
| 45 | + onPageShow(): void { | ||
| 46 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'}) | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | + onPageHide(): void { | ||
| 50 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + topOpacityChange(){ | ||
| 54 | + if(this.topOpacity > 0.8){ | ||
| 55 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) | ||
| 56 | + }else{ | ||
| 57 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff'}) | ||
| 58 | + } | ||
| 59 | + } | ||
| 60 | + | ||
| 45 | build() { | 61 | build() { |
| 46 | if(this.isConnectNetwork){ | 62 | if(this.isConnectNetwork){ |
| 47 | Stack({ alignContent: Alignment.TopStart }) { | 63 | Stack({ alignContent: Alignment.TopStart }) { |
| @@ -50,7 +66,8 @@ struct PeopleShipHomePage { | @@ -50,7 +66,8 @@ struct PeopleShipHomePage { | ||
| 50 | Image($r('app.media.home_page_bg')) | 66 | Image($r('app.media.home_page_bg')) |
| 51 | .width('100%') | 67 | .width('100%') |
| 52 | .height('120vp') | 68 | .height('120vp') |
| 53 | - .objectFit(ImageFit.Fill) | 69 | + .objectFit(ImageFit.Auto) |
| 70 | + .objectRepeat(ImageRepeat.NoRepeat) | ||
| 54 | .backgroundColor(Color.White) | 71 | .backgroundColor(Color.White) |
| 55 | .visibility(this.isLoading ? Visibility.None : Visibility.Visible) | 72 | .visibility(this.isLoading ? Visibility.None : Visibility.Visible) |
| 56 | .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) | 73 | .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) |
| @@ -46,8 +46,6 @@ export struct TopNavigationComponentNew { | @@ -46,8 +46,6 @@ export struct TopNavigationComponentNew { | ||
| 46 | // 顶导数据 | 46 | // 顶导数据 |
| 47 | @State @Watch('onTopNavigationDataUpdated') topNavList: TopNavDTO[] = [] | 47 | @State @Watch('onTopNavigationDataUpdated') topNavList: TopNavDTO[] = [] |
| 48 | @State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002 | 48 | @State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002 |
| 49 | - //我的频道id列表 | ||
| 50 | - @State channelIds: number[] = [] | ||
| 51 | //本地缓存频道id列表 | 49 | //本地缓存频道id列表 |
| 52 | @State storageChannelIds: string = AppStorage.get<string>('channelIds') || '' | 50 | @State storageChannelIds: string = AppStorage.get<string>('channelIds') || '' |
| 53 | @State homeChannelList: TopNavDTO[] = [] | 51 | @State homeChannelList: TopNavDTO[] = [] |
| @@ -192,7 +190,6 @@ export struct TopNavigationComponentNew { | @@ -192,7 +190,6 @@ export struct TopNavigationComponentNew { | ||
| 192 | myChannelList: $myChannelList, | 190 | myChannelList: $myChannelList, |
| 193 | moreChannelList: $moreChannelList, | 191 | moreChannelList: $moreChannelList, |
| 194 | localChannelList: $localChannelList, | 192 | localChannelList: $localChannelList, |
| 195 | - channelIds: $channelIds, | ||
| 196 | changeTab: (index) => { | 193 | changeTab: (index) => { |
| 197 | this.changePage(index) | 194 | this.changePage(index) |
| 198 | } | 195 | } |
| @@ -260,7 +257,7 @@ export struct TopNavigationComponentNew { | @@ -260,7 +257,7 @@ export struct TopNavigationComponentNew { | ||
| 260 | .edgeEffect(EdgeEffect.None) | 257 | .edgeEffect(EdgeEffect.None) |
| 261 | .height($r('app.float.top_tab_bar_height_common')) | 258 | .height($r('app.float.top_tab_bar_height_common')) |
| 262 | .backgroundColor(this.barBackgroundColor) | 259 | .backgroundColor(this.barBackgroundColor) |
| 263 | - .margin({top:10}) | 260 | + .margin({ top: 10 }) |
| 264 | .onAreaChange((oldValue: Area, newValue: Area) => { | 261 | .onAreaChange((oldValue: Area, newValue: Area) => { |
| 265 | let width = Number.parseFloat(newValue.width.toString()) | 262 | let width = Number.parseFloat(newValue.width.toString()) |
| 266 | this.tabsWidth = Number.isNaN(width) ? 0 : width | 263 | this.tabsWidth = Number.isNaN(width) ? 0 : width |
| @@ -342,8 +339,6 @@ export struct TopNavigationComponentNew { | @@ -342,8 +339,6 @@ export struct TopNavigationComponentNew { | ||
| 342 | //处理新闻tab顶导频道数据 | 339 | //处理新闻tab顶导频道数据 |
| 343 | topNavListHandle() { | 340 | topNavListHandle() { |
| 344 | let cityName = SPHelper.default.getSync(SpConstants.LOCATION_CITY_NAME, '') as string | 341 | let cityName = SPHelper.default.getSync(SpConstants.LOCATION_CITY_NAME, '') as string |
| 345 | - | ||
| 346 | - let _channelIds: number [] = [] | ||
| 347 | let _myChannelList: TopNavDTO [] = [] | 342 | let _myChannelList: TopNavDTO [] = [] |
| 348 | let _storageChannelIds: string [] = [] //list1 | 343 | let _storageChannelIds: string [] = [] //list1 |
| 349 | let defaultMyChannelList: TopNavDTO[] = [] | 344 | let defaultMyChannelList: TopNavDTO[] = [] |
| @@ -379,11 +374,7 @@ export struct TopNavigationComponentNew { | @@ -379,11 +374,7 @@ export struct TopNavigationComponentNew { | ||
| 379 | } | 374 | } |
| 380 | }) | 375 | }) |
| 381 | defaultList.unshift(...defaultMyChannelList) | 376 | defaultList.unshift(...defaultMyChannelList) |
| 382 | - | ||
| 383 | defaultList.forEach((item, index) => { | 377 | defaultList.forEach((item, index) => { |
| 384 | - if (this.storageChannelIds && _storageChannelIds.includes(String(item.channelId))) { | ||
| 385 | - item.myChannel = '1' | ||
| 386 | - } | ||
| 387 | if (item.channelType === 2) { | 378 | if (item.channelType === 2) { |
| 388 | if (cityName.includes(item.name)) { | 379 | if (cityName.includes(item.name)) { |
| 389 | item.myChannel = '1' | 380 | item.myChannel = '1' |
| @@ -399,32 +390,34 @@ export struct TopNavigationComponentNew { | @@ -399,32 +390,34 @@ export struct TopNavigationComponentNew { | ||
| 399 | item.moreChannel = '1' | 390 | item.moreChannel = '1' |
| 400 | } | 391 | } |
| 401 | } | 392 | } |
| 402 | - | 393 | + if (this.storageChannelIds && _storageChannelIds.includes(String(item.channelId))) { |
| 394 | + item.myChannel = '1' | ||
| 395 | + } | ||
| 403 | //频道分类 | 396 | //频道分类 |
| 404 | if (item.name !== '播报') { //暂时隐藏播报 | 397 | if (item.name !== '播报') { //暂时隐藏播报 |
| 405 | - if (item.myChannel === '1' && !this.storageChannelIds) { | 398 | + if (item.myChannel === '1') { |
| 406 | _myChannelList.push(item) | 399 | _myChannelList.push(item) |
| 407 | - _channelIds.push(item.channelId) | ||
| 408 | } | 400 | } |
| 409 | - if (item.moreChannel === '1') { | 401 | + if (item.moreChannel === '1' && item.myChannel !== '1') { |
| 410 | this.moreChannelList.push(item) | 402 | this.moreChannelList.push(item) |
| 411 | } | 403 | } |
| 412 | if (item.localChannel === '1' && item.myChannel !== '1') { | 404 | if (item.localChannel === '1' && item.myChannel !== '1') { |
| 413 | this.localChannelList.push(item) | 405 | this.localChannelList.push(item) |
| 414 | } | 406 | } |
| 415 | } | 407 | } |
| 416 | - | ||
| 417 | }) | 408 | }) |
| 418 | 409 | ||
| 419 | - if(this.storageChannelIds){ | ||
| 420 | - _storageChannelIds.forEach((_item:string)=>{ | ||
| 421 | - let index = defaultList.findIndex(ele => Number(_item) === ele.channelId) | ||
| 422 | - if(index > -1){ | ||
| 423 | - _myChannelList.push(defaultList[index]) | ||
| 424 | - _channelIds.push(defaultList[index].channelId) | ||
| 425 | - } | ||
| 426 | - }) | 410 | + //根据缓存数组排序 |
| 411 | + if (this.storageChannelIds) { | ||
| 412 | + let sortedyChannelList = _myChannelList.sort((item1, item2) => { | ||
| 413 | + let index1 = this.storageChannelIds.indexOf(String(item1.channelId)); | ||
| 414 | + let index2 = this.storageChannelIds.indexOf(String(item2.channelId)); | ||
| 415 | + return index1 - index2; | ||
| 416 | + }); | ||
| 417 | + _myChannelList = sortedyChannelList | ||
| 427 | } | 418 | } |
| 419 | + | ||
| 420 | + | ||
| 428 | if (cityName) { | 421 | if (cityName) { |
| 429 | let index = _myChannelList.findIndex(ele => cityName.includes(ele.name)) | 422 | let index = _myChannelList.findIndex(ele => cityName.includes(ele.name)) |
| 430 | const localChannelitem = _myChannelList.splice(index, 1)[0]; | 423 | const localChannelitem = _myChannelList.splice(index, 1)[0]; |
| @@ -432,7 +425,6 @@ export struct TopNavigationComponentNew { | @@ -432,7 +425,6 @@ export struct TopNavigationComponentNew { | ||
| 432 | _myChannelList.splice(3, 0, localChannelitem); | 425 | _myChannelList.splice(3, 0, localChannelitem); |
| 433 | } | 426 | } |
| 434 | 427 | ||
| 435 | - this.channelIds = _channelIds | ||
| 436 | this.myChannelList = _myChannelList | 428 | this.myChannelList = _myChannelList |
| 437 | 429 | ||
| 438 | //缓存首页频道 | 430 | //缓存首页频道 |
| @@ -620,22 +612,22 @@ export struct TopNavigationComponentNew { | @@ -620,22 +612,22 @@ export struct TopNavigationComponentNew { | ||
| 620 | }) | 612 | }) |
| 621 | } | 613 | } |
| 622 | 614 | ||
| 623 | - clickMorningEveningPaper(){ | 615 | + clickMorningEveningPaper() { |
| 624 | if (NetworkUtil.isNetConnected()) { | 616 | if (NetworkUtil.isNetConnected()) { |
| 625 | - DailyPaperTopicModel.getDailyPaperTopic().then(dailyPaperTopicBean =>{ | 617 | + DailyPaperTopicModel.getDailyPaperTopic().then(dailyPaperTopicBean => { |
| 626 | if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) { | 618 | if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) { |
| 627 | SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id); | 619 | SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id); |
| 628 | ProcessUtils.gotoMorningEveningPaper() | 620 | ProcessUtils.gotoMorningEveningPaper() |
| 629 | - TrackingButton.click('morning_evening_news_click',TrackConstants.SummaryType.MorningAndEveningNews,TrackConstants.SummaryType.MorningAndEveningNews) | ||
| 630 | - }else { | 621 | + TrackingButton.click('morning_evening_news_click', TrackConstants.SummaryType.MorningAndEveningNews, |
| 622 | + TrackConstants.SummaryType.MorningAndEveningNews) | ||
| 623 | + } else { | ||
| 631 | ToastUtils.showToast('暂无早晚报信息', 1000) | 624 | ToastUtils.showToast('暂无早晚报信息', 1000) |
| 632 | } | 625 | } |
| 633 | - }).catch((err:string) =>{ | 626 | + }).catch((err: string) => { |
| 634 | ToastUtils.showToast('暂无早晚报信息', 1000) | 627 | ToastUtils.showToast('暂无早晚报信息', 1000) |
| 635 | }) | 628 | }) |
| 636 | } else { | 629 | } else { |
| 637 | ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000) | 630 | ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000) |
| 638 | } | 631 | } |
| 639 | } | 632 | } |
| 640 | - | ||
| 641 | } | 633 | } |
| @@ -276,6 +276,7 @@ export struct PeopleShipHomeArticleListComponent { | @@ -276,6 +276,7 @@ export struct PeopleShipHomeArticleListComponent { | ||
| 276 | let extModel = element.contentExt[0]; | 276 | let extModel = element.contentExt[0]; |
| 277 | contentDTO.openLikes = extModel.openLikes; | 277 | contentDTO.openLikes = extModel.openLikes; |
| 278 | contentDTO.openComment = extModel.openComment; | 278 | contentDTO.openComment = extModel.openComment; |
| 279 | + contentDTO.top = extModel.top //是否置顶 | ||
| 279 | } | 280 | } |
| 280 | // 页面 | 281 | // 页面 |
| 281 | if (contentDTO.appStyle == '2' || contentDTO.appStyle == '13' || contentDTO.appStyle == '20') { | 282 | if (contentDTO.appStyle == '2' || contentDTO.appStyle == '13' || contentDTO.appStyle == '20') { |
| @@ -40,7 +40,9 @@ export struct PeopleShipHomePageTopComponent { | @@ -40,7 +40,9 @@ export struct PeopleShipHomePageTopComponent { | ||
| 40 | Image($r('app.media.home_page_bg')) | 40 | Image($r('app.media.home_page_bg')) |
| 41 | .width('100%') | 41 | .width('100%') |
| 42 | .height('48vp') | 42 | .height('48vp') |
| 43 | - .objectFit(ImageFit.Fill) | 43 | + .objectFit(ImageFit.Auto) |
| 44 | + .objectRepeat(ImageRepeat.NoRepeat) | ||
| 45 | + .objectFit(ImageFit.Auto) | ||
| 44 | .backgroundColor(Color.White) | 46 | .backgroundColor(Color.White) |
| 45 | // 头像和名称 | 47 | // 头像和名称 |
| 46 | Row() { | 48 | Row() { |
| @@ -28,10 +28,10 @@ export struct CustomTitleUI { | @@ -28,10 +28,10 @@ export struct CustomTitleUI { | ||
| 28 | Text(this.titleName) | 28 | Text(this.titleName) |
| 29 | .maxLines(1) | 29 | .maxLines(1) |
| 30 | .id("title") | 30 | .id("title") |
| 31 | - .fontSize('35lpx') | 31 | + .fontSize('30lpx') |
| 32 | .fontWeight(400) | 32 | .fontWeight(400) |
| 33 | .fontColor($r('app.color.color_222222')) | 33 | .fontColor($r('app.color.color_222222')) |
| 34 | - .lineHeight('42lpx') | 34 | + .lineHeight('43lpx') |
| 35 | .alignRules({ | 35 | .alignRules({ |
| 36 | center: {anchor: "__container__", align: VerticalAlign.Center}, | 36 | center: {anchor: "__container__", align: VerticalAlign.Center}, |
| 37 | middle: {anchor: "__container__", align: HorizontalAlign.Center} | 37 | middle: {anchor: "__container__", align: HorizontalAlign.Center} |
| @@ -372,6 +372,7 @@ export struct LiveOperRowListView { | @@ -372,6 +372,7 @@ export struct LiveOperRowListView { | ||
| 372 | this.publishCommentModel.rootCommentId = '-1'; | 372 | this.publishCommentModel.rootCommentId = '-1'; |
| 373 | this.publishCommentModel.parentId = '-1'; | 373 | this.publishCommentModel.parentId = '-1'; |
| 374 | this.publishCommentModel.placeHolderText = "说两句..." | 374 | this.publishCommentModel.placeHolderText = "说两句..." |
| 375 | + this.publishCommentModel.commentContent = "" | ||
| 375 | this.commentInputDialogController?.open(); | 376 | this.commentInputDialogController?.open(); |
| 376 | } | 377 | } |
| 377 | 378 | ||
| @@ -466,14 +467,20 @@ export struct LiveOperRowListView { | @@ -466,14 +467,20 @@ export struct LiveOperRowListView { | ||
| 466 | this.showCommentInput = canComment | 467 | this.showCommentInput = canComment |
| 467 | 468 | ||
| 468 | let mLiveId: string = this.contentDetailData.liveInfo.mlive.mliveId as string | 469 | let mLiveId: string = this.contentDetailData.liveInfo.mlive.mliveId as string |
| 469 | - if (!HttpUtils.isLogin() || mLiveId == undefined) { | 470 | + if (!mLiveId) { |
| 471 | + return | ||
| 472 | + } | ||
| 473 | + if (!HttpUtils.isLogin()) { | ||
| 474 | + this.banComment = false | ||
| 470 | return | 475 | return |
| 471 | } | 476 | } |
| 472 | 477 | ||
| 473 | // 查询是否被禁言 | 478 | // 查询是否被禁言 |
| 474 | PageRepository.fetchLiveBarrageBan(mLiveId).then(res => { | 479 | PageRepository.fetchLiveBarrageBan(mLiveId).then(res => { |
| 480 | + if (res.code == 0) { | ||
| 475 | this.banComment = res.data as boolean | 481 | this.banComment = res.data as boolean |
| 476 | this.showCommentInput = !this.banComment && canComment | 482 | this.showCommentInput = !this.banComment && canComment |
| 483 | + } | ||
| 477 | }) | 484 | }) |
| 478 | } | 485 | } |
| 479 | } | 486 | } |
| @@ -27,32 +27,60 @@ export class SearchShowRed { | @@ -27,32 +27,60 @@ export class SearchShowRed { | ||
| 27 | res.push(content); | 27 | res.push(content); |
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | - SearchShowRed.formatTitle(html, res, 0, textArr); | 30 | + console.log('SearchShowRed-res', JSON.stringify(res)) |
| 31 | + | ||
| 32 | + SearchShowRed.formatTitle( | ||
| 33 | + html.replaceAll('<em>', '').replaceAll('</em>', ''), | ||
| 34 | + res, | ||
| 35 | + 0, | ||
| 36 | + textArr | ||
| 37 | + ); | ||
| 31 | } | 38 | } |
| 32 | 39 | ||
| 33 | const titleInitRes: titleInitRes = { | 40 | const titleInitRes: titleInitRes = { |
| 34 | titleMarked, | 41 | titleMarked, |
| 35 | textArr | 42 | textArr |
| 36 | } | 43 | } |
| 44 | + console.log('SearchShowRed-titleInitRes', JSON.stringify(titleInitRes)) | ||
| 37 | return titleInitRes | 45 | return titleInitRes |
| 38 | } | 46 | } |
| 39 | 47 | ||
| 40 | private static formatTitle(textStr: string, matchArr: string[], index: number, textArr: textItem[]) { | 48 | private static formatTitle(textStr: string, matchArr: string[], index: number, textArr: textItem[]) { |
| 41 | const item: string = matchArr[index]; | 49 | const item: string = matchArr[index]; |
| 42 | - const arr = textStr.split(item); | ||
| 43 | - arr.forEach((str: string, ind: number) => { | 50 | + if (!item) { |
| 51 | + textArr.push({ | ||
| 52 | + content: textStr, | ||
| 53 | + isRed: false | ||
| 54 | + }) | ||
| 55 | + return; | ||
| 56 | + } | ||
| 57 | + const ind = textStr.indexOf(item); | ||
| 58 | + const len = item.length; | ||
| 44 | if (ind === 0) { | 59 | if (ind === 0) { |
| 45 | textArr.push({ | 60 | textArr.push({ |
| 46 | - content: str.replaceAll('<em>', '').replaceAll('</em>', ''), | 61 | + content: item, |
| 62 | + isRed: true | ||
| 63 | + }) | ||
| 64 | + SearchShowRed.formatTitle(textStr.slice(len), matchArr, index + 1, textArr); | ||
| 65 | + } else if (ind + len === textStr.length) { | ||
| 66 | + textArr.push({ | ||
| 67 | + content: textStr.slice(0, ind), | ||
| 47 | isRed: false | 68 | isRed: false |
| 48 | - } as textItem) | 69 | + }) |
| 49 | textArr.push({ | 70 | textArr.push({ |
| 50 | content: item, | 71 | content: item, |
| 51 | isRed: true | 72 | isRed: true |
| 52 | }) | 73 | }) |
| 53 | - } else if (ind === 1) { | ||
| 54 | - SearchShowRed.formatTitle(str, matchArr, index + 1, textArr) | ||
| 55 | - } | 74 | + } else { |
| 75 | + textArr.push({ | ||
| 76 | + content: textStr.slice(0, ind), | ||
| 77 | + isRed: false | ||
| 56 | }) | 78 | }) |
| 79 | + textArr.push({ | ||
| 80 | + content: item, | ||
| 81 | + isRed: true | ||
| 82 | + }) | ||
| 83 | + SearchShowRed.formatTitle(textStr.slice(ind + len), matchArr, index + 1, textArr); | ||
| 84 | + } | ||
| 57 | } | 85 | } |
| 58 | } | 86 | } |
| @@ -29,6 +29,14 @@ | @@ -29,6 +29,14 @@ | ||
| 29 | "value": "14fp" | 29 | "value": "14fp" |
| 30 | }, | 30 | }, |
| 31 | { | 31 | { |
| 32 | + "name": "font_size_14_5", | ||
| 33 | + "value": "14.5fp" | ||
| 34 | + }, | ||
| 35 | + { | ||
| 36 | + "name": "font_size_15", | ||
| 37 | + "value": "15fp" | ||
| 38 | + }, | ||
| 39 | + { | ||
| 32 | "name": "font_size_16", | 40 | "name": "font_size_16", |
| 33 | "value": "16fp" | 41 | "value": "16fp" |
| 34 | }, | 42 | }, |
| @@ -68,19 +68,35 @@ export struct DetailPlayLiveCommon { | @@ -68,19 +68,35 @@ export struct DetailPlayLiveCommon { | ||
| 68 | */ | 68 | */ |
| 69 | getContentDetail() { | 69 | getContentDetail() { |
| 70 | this.liveViewModel.getContentDetail(this.contentId, this.relId, this.relType) | 70 | this.liveViewModel.getContentDetail(this.contentId, this.relId, this.relType) |
| 71 | - .then((data: Array<ContentDetailDTO>) => { | 71 | + .then(async (data: Array<ContentDetailDTO>) => { |
| 72 | console.log(TAG, '查询视频详情用于评论展示 getContentDetail:', JSON.stringify(data)) | 72 | console.log(TAG, '查询视频详情用于评论展示 getContentDetail:', JSON.stringify(data)) |
| 73 | if (data) { | 73 | if (data) { |
| 74 | + | ||
| 74 | let detailData = data[0] | 75 | let detailData = data[0] |
| 76 | + //人民号类型单独获取直播地址 | ||
| 77 | + if (detailData.rmhPlatform === 1) { | ||
| 78 | + | ||
| 79 | + let vliveId = detailData.liveInfo.vlive[0].vliveId as string | ||
| 80 | + console.error(TAG, 'vliveId==' + vliveId) | ||
| 81 | + let pullStreamAddressData = await this.liveViewModel.getLiveRoomPullAddress(vliveId) as GetPullAddressBean | ||
| 82 | + | ||
| 83 | + if (pullStreamAddressData) { | ||
| 84 | + console.log(TAG, ' GetPullAddressBean:', JSON.stringify(pullStreamAddressData)) | ||
| 85 | + let m3u8uUrl = pullStreamAddressData.transCode[0].m3u8Url | ||
| 86 | + detailData.liveInfo.vlive[0].liveUrl = m3u8uUrl | ||
| 87 | + this.playUrl = m3u8uUrl | ||
| 88 | + console.log(TAG, ' GetPullAddressBean:', m3u8uUrl) | ||
| 89 | + } | ||
| 90 | + | ||
| 91 | + } | ||
| 92 | + | ||
| 75 | this.liveLandscape = | 93 | this.liveLandscape = |
| 76 | - detailData?.liveInfo?.liveLandScape //String(this.contentDetailData?.liveInfo?.liveLandScape || '') | 94 | + detailData?.liveInfo?.liveLandScape |
| 77 | 95 | ||
| 78 | this.liveState = detailData.liveInfo?.liveState | 96 | this.liveState = detailData.liveInfo?.liveState |
| 79 | 97 | ||
| 80 | - | ||
| 81 | this.contentDetailData = data[0] | 98 | this.contentDetailData = data[0] |
| 82 | 99 | ||
| 83 | - console.log(TAG, '查询视频详情用于评论展示 openComment:', detailData.openComment) | ||
| 84 | this.publishCommentModel.targetId = String(detailData?.newsId || '') | 100 | this.publishCommentModel.targetId = String(detailData?.newsId || '') |
| 85 | this.publishCommentModel.targetRelId = String(detailData?.reLInfo?.relId || '') | 101 | this.publishCommentModel.targetRelId = String(detailData?.reLInfo?.relId || '') |
| 86 | this.publishCommentModel.targetTitle = detailData?.newsTitle | 102 | this.publishCommentModel.targetTitle = detailData?.newsTitle |
| @@ -100,18 +116,6 @@ export struct DetailPlayLiveCommon { | @@ -100,18 +116,6 @@ export struct DetailPlayLiveCommon { | ||
| 100 | this.playUrl = detailData.liveInfo.vlive[0].replayUri | 116 | this.playUrl = detailData.liveInfo.vlive[0].replayUri |
| 101 | } | 117 | } |
| 102 | 118 | ||
| 103 | - //人民号类型单独获取直播地址 | ||
| 104 | - if (detailData.rmhPlatform === 1) { | ||
| 105 | - | ||
| 106 | - let vliveId = detailData.liveInfo.vlive[0].vliveId as string | ||
| 107 | - console.error(TAG, 'vliveId==' + vliveId) | ||
| 108 | - this.liveViewModel.getLiveRoomPullAddress(vliveId) | ||
| 109 | - .then((data: GetPullAddressBean) => { | ||
| 110 | - console.log(TAG, ' GetPullAddressBean:', JSON.stringify(data)) | ||
| 111 | - | ||
| 112 | - }) | ||
| 113 | - | ||
| 114 | - } | ||
| 115 | 119 | ||
| 116 | } | 120 | } |
| 117 | }) | 121 | }) |
| 1 | -import { ContentDetailDTO, LiveRoomDataBean } from 'wdBean/Index'; | 1 | +import { ContentDetailDTO, LiveRoomDataBean, LiveRoomItemBean } from 'wdBean/Index'; |
| 2 | import { LiveViewModel } from '../viewModel/LiveViewModel'; | 2 | import { LiveViewModel } from '../viewModel/LiveViewModel'; |
| 3 | import { TabComponent } from '../widgets/details/TabComponent'; | 3 | import { TabComponent } from '../widgets/details/TabComponent'; |
| 4 | import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet'; | 4 | import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet'; |
| @@ -35,6 +35,10 @@ export struct DetailPlayLivePage { | @@ -35,6 +35,10 @@ export struct DetailPlayLivePage { | ||
| 35 | @Consume contentDetailData: ContentDetailDTO | 35 | @Consume contentDetailData: ContentDetailDTO |
| 36 | @Consume publishCommentModel: publishCommentModel | 36 | @Consume publishCommentModel: publishCommentModel |
| 37 | 37 | ||
| 38 | + // 尽量不要动属性。用来作为输入了评论之后,值传递 | ||
| 39 | + @State lastInputedLiveComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的直播间消息 | ||
| 40 | + @State lastInputedChatComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的大家聊消息 | ||
| 41 | + | ||
| 38 | aboutToAppear(): void { | 42 | aboutToAppear(): void { |
| 39 | Logger.info(TAG, `wyj-aboutToAppear`) | 43 | Logger.info(TAG, `wyj-aboutToAppear`) |
| 40 | 44 | ||
| @@ -65,7 +69,10 @@ export struct DetailPlayLivePage { | @@ -65,7 +69,10 @@ export struct DetailPlayLivePage { | ||
| 65 | TopPlayComponent({ playerController: this.playerController }) | 69 | TopPlayComponent({ playerController: this.playerController }) |
| 66 | .height(this.displayDirection == DisplayDirection.VERTICAL ? 211 : '100%') | 70 | .height(this.displayDirection == DisplayDirection.VERTICAL ? 211 : '100%') |
| 67 | 71 | ||
| 68 | - TabComponent({ tabs: this.tabs, changeToTab: this.changeToTab }) | 72 | + TabComponent({ tabs: this.tabs, |
| 73 | + changeToTab: this.changeToTab, | ||
| 74 | + lastInputedLiveComment: this.lastInputedLiveComment, | ||
| 75 | + lastInputedChatComment: this.lastInputedChatComment}) | ||
| 69 | .layoutWeight(1) | 76 | .layoutWeight(1) |
| 70 | .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) | 77 | .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) |
| 71 | 78 | ||
| @@ -79,7 +86,16 @@ export struct DetailPlayLivePage { | @@ -79,7 +86,16 @@ export struct DetailPlayLivePage { | ||
| 79 | }, | 86 | }, |
| 80 | onCommentInputed: (content) => { | 87 | onCommentInputed: (content) => { |
| 81 | if (content.comment) { | 88 | if (content.comment) { |
| 82 | - this.liveViewModel.sendComment(content.comment) | 89 | + this.liveViewModel.sendComment(content.comment, this.contentDetailData).then(result => { |
| 90 | + if (!result) { | ||
| 91 | + return | ||
| 92 | + } | ||
| 93 | + if (result.isWall == 1) { | ||
| 94 | + this.lastInputedLiveComment = result | ||
| 95 | + } else { | ||
| 96 | + this.lastInputedChatComment = result | ||
| 97 | + } | ||
| 98 | + }) | ||
| 83 | } | 99 | } |
| 84 | } | 100 | } |
| 85 | }).visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) | 101 | }).visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) |
| 1 | -import { HttpUrlUtils, ResponseDTO } from 'wdNetwork'; | 1 | +import { HttpUrlUtils, HttpUtils, ResponseDTO } from 'wdNetwork'; |
| 2 | import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; | 2 | import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; |
| 3 | -import { Logger, ToastUtils, EmitterEventId, EmitterUtils } from 'wdKit'; | ||
| 4 | -import { ContentDetailDTO, LiveDetailsBean, LiveRoomBean, LiveRoomDataBean, ReserveItemBean, ValueType } from 'wdBean/Index'; | 3 | +import { Logger, ToastUtils, EmitterEventId, EmitterUtils, SPHelper } from 'wdKit'; |
| 4 | +import { ContentDetailDTO, LiveDetailsBean, LiveRoomBean, LiveRoomDataBean, | ||
| 5 | + LiveRoomItemBean, | ||
| 6 | + ReserveItemBean, ValueType } from 'wdBean/Index'; | ||
| 5 | import { ContentDetailRequest } from 'wdDetailPlayApi/Index'; | 7 | import { ContentDetailRequest } from 'wdDetailPlayApi/Index'; |
| 8 | +import { SpConstants } from 'wdConstant/Index'; | ||
| 6 | 9 | ||
| 7 | const TAG = 'LiveModel' | 10 | const TAG = 'LiveModel' |
| 8 | 11 | ||
| @@ -266,5 +269,61 @@ export class LiveModel { | @@ -266,5 +269,61 @@ export class LiveModel { | ||
| 266 | }) | 269 | }) |
| 267 | }) | 270 | }) |
| 268 | } | 271 | } |
| 272 | + | ||
| 273 | + liveSendComment(comment: string, content: ContentDetailDTO) { | ||
| 274 | + let tourist: boolean = !HttpUtils.isLogin() | ||
| 275 | + let roomId: string = content.liveInfo.mlive.roomId as string | ||
| 276 | + let liveId: string = content.newsId + '' | ||
| 277 | + let mLiveId: string = content.liveInfo.mlive.mliveId as string | ||
| 278 | + | ||
| 279 | + let commentItem: LiveRoomItemBean = {} as LiveRoomItemBean | ||
| 280 | + commentItem.text = comment | ||
| 281 | + commentItem.isWall = 0 | ||
| 282 | + commentItem.dataType = "ZH_TEXT_MSG" | ||
| 283 | + | ||
| 284 | + let params: Record<string, string | number> = {}; | ||
| 285 | + params["liveId"] = liveId | ||
| 286 | + params["mliveId"] = mLiveId | ||
| 287 | + params["roomId"] = roomId | ||
| 288 | + params["title"] = content.newsTitle | ||
| 289 | + params["text"] = comment | ||
| 290 | + | ||
| 291 | + if (tourist) { | ||
| 292 | + params["deviceId"] = HttpUtils.getDeviceId() | ||
| 293 | + params["senderUserName"] = SPHelper.default.getSync(SpConstants.TOURIST_NICK_NAME, "") as string | ||
| 294 | + } else { | ||
| 295 | + params["senderUserId"] = SPHelper.default.getSync(SpConstants.USER_ID, "") as string | ||
| 296 | + params["senderAvatarUrl"] = SPHelper.default.getSync(SpConstants.USER_HEAD_PHOTO_URL, "") as string | ||
| 297 | + params["senderUserName"] = SPHelper.default.getSync(SpConstants.USER_NAME, "") as string | ||
| 298 | + commentItem.senderUserAvatarUrl = params["senderAvatarUrl"] | ||
| 299 | + } | ||
| 300 | + commentItem.senderUserName = params["senderUserName"] | ||
| 301 | + params["customizeExpression"] = 0 | ||
| 302 | + params["role"] = tourist ? "tourist" : "audience" | ||
| 303 | + commentItem.role = tourist ? "tourist" : "audience" | ||
| 304 | + | ||
| 305 | + let url = tourist ? HttpUrlUtils.getLiveTouristSendBarrageUrl() : HttpUrlUtils.getLiveSendBarrageUrl() | ||
| 306 | + return new Promise<SendLiveCommentRes>((success, fail) => { | ||
| 307 | + HttpRequest.post<ResponseDTO<SendLiveCommentInterfaceRes>>(url, params).then((data) => { | ||
| 308 | + let res:SendLiveCommentRes = { | ||
| 309 | + preDisplay: data.data?.preDisplay || false, | ||
| 310 | + tipMessage: data.message, | ||
| 311 | + commentItem: commentItem | ||
| 312 | + } | ||
| 313 | + success(res) | ||
| 314 | + }, (error: Error) => { | ||
| 315 | + fail(error.message) | ||
| 316 | + Logger.debug(TAG + ":error ", error.toString()) | ||
| 317 | + }) | ||
| 318 | + }) | ||
| 319 | + } | ||
| 269 | } | 320 | } |
| 270 | 321 | ||
| 322 | +interface SendLiveCommentInterfaceRes { | ||
| 323 | + preDisplay: boolean | ||
| 324 | +} | ||
| 325 | +export interface SendLiveCommentRes { | ||
| 326 | + preDisplay: boolean | ||
| 327 | + tipMessage: string | ||
| 328 | + commentItem: LiveRoomItemBean | ||
| 329 | +} |
| 1 | import { ContentDetailDTO, | 1 | import { ContentDetailDTO, |
| 2 | GetPullAddressBean, | 2 | GetPullAddressBean, |
| 3 | - LiveDetailsBean, LiveRoomBean, LiveRoomDataBean, ValueType } from 'wdBean/Index' | 3 | + LiveDetailsBean, LiveRoomBean, LiveRoomDataBean, |
| 4 | + LiveRoomItemBean, | ||
| 5 | + ValueType } from 'wdBean/Index' | ||
| 4 | import { ContentDetailRequest } from 'wdDetailPlayApi/Index' | 6 | import { ContentDetailRequest } from 'wdDetailPlayApi/Index' |
| 5 | - | 7 | +import { Logger } from 'wdKit/Index' |
| 8 | +import { ToastUtils } from 'wdKit/src/main/ets/utils/ToastUtils' | ||
| 6 | import { ResponseDTO } from 'wdNetwork/Index' | 9 | import { ResponseDTO } from 'wdNetwork/Index' |
| 7 | import { LiveModel } from './LiveModel' | 10 | import { LiveModel } from './LiveModel' |
| 8 | 11 | ||
| @@ -27,14 +30,7 @@ export class LiveViewModel { | @@ -27,14 +30,7 @@ export class LiveViewModel { | ||
| 27 | 30 | ||
| 28 | } | 31 | } |
| 29 | 32 | ||
| 30 | - getLiveRoomPullAddress(vliveId:string){ | ||
| 31 | - // return new Promise<GetPullAddressBean>((success, fail) => { | ||
| 32 | - // this.liveModel.getContentDetail(contentId, relId, relType).then((data) => { | ||
| 33 | - // success(data) | ||
| 34 | - // }).catch((message: string) => { | ||
| 35 | - // fail(message) | ||
| 36 | - // }) | ||
| 37 | - // }) | 33 | + async getLiveRoomPullAddress(vliveId:string) : Promise<GetPullAddressBean>{ |
| 38 | 34 | ||
| 39 | return new Promise<GetPullAddressBean>((success, fail) => { | 35 | return new Promise<GetPullAddressBean>((success, fail) => { |
| 40 | ContentDetailRequest.getLiveRoomPullStream(vliveId).then(async (resDTO: ResponseDTO<GetPullAddressBean>) => { | 36 | ContentDetailRequest.getLiveRoomPullStream(vliveId).then(async (resDTO: ResponseDTO<GetPullAddressBean>) => { |
| @@ -136,7 +132,40 @@ export class LiveViewModel { | @@ -136,7 +132,40 @@ export class LiveViewModel { | ||
| 136 | }) | 132 | }) |
| 137 | } | 133 | } |
| 138 | 134 | ||
| 139 | - sendComment(comment: string) { | 135 | + // 发送评论 |
| 136 | + sendComment(comment: string, content: ContentDetailDTO) { | ||
| 137 | + return new Promise<LiveRoomItemBean | undefined>((success, fail) => { | ||
| 138 | + this.liveModel.liveSendComment(comment, content).then((data) => { | ||
| 139 | + Logger.debug(TAG, "发送评论结果: " + JSON.stringify(data)) | ||
| 140 | + if (data.preDisplay) { | ||
| 141 | + success(data.commentItem) | ||
| 142 | + } else { | ||
| 143 | + success(undefined) | ||
| 144 | + } | ||
| 145 | + ToastUtils.showToast(data.tipMessage, 3000) | ||
| 146 | + }).catch((message: string) => { | ||
| 147 | + fail(message) | ||
| 148 | + }) | ||
| 149 | + }) | ||
| 150 | + } | ||
| 140 | 151 | ||
| 152 | + deepCopyLiveRoomItem(item: LiveRoomItemBean) { | ||
| 153 | + return item | ||
| 154 | + let retItem: LiveRoomItemBean = {} as LiveRoomItemBean | ||
| 155 | + retItem.text = item.text | ||
| 156 | + retItem.senderUserAvatarUrl = item.senderUserAvatarUrl | ||
| 157 | + retItem.senderUserName = item.senderUserName | ||
| 158 | + retItem.pictureUrls = item.pictureUrls | ||
| 159 | + retItem.time = item.time | ||
| 160 | + retItem.isWall = item.isWall | ||
| 161 | + retItem.isTop = item.isTop | ||
| 162 | + retItem.dataType = item.dataType | ||
| 163 | + retItem.transcodeImageUrl = item.transcodeImageUrl | ||
| 164 | + retItem.videoUrl = item.videoUrl | ||
| 165 | + retItem.pictureResolutions = item.pictureResolutions | ||
| 166 | + retItem.duration = item.duration | ||
| 167 | + retItem.audioUrl = item.audioUrl | ||
| 168 | + retItem.fullColumnImgUrlDto = item.fullColumnImgUrlDto | ||
| 169 | + return retItem | ||
| 141 | } | 170 | } |
| 142 | } | 171 | } |
| @@ -23,6 +23,7 @@ export struct TabChatComponent { | @@ -23,6 +23,7 @@ export struct TabChatComponent { | ||
| 23 | @State liveChatList: Array<LiveRoomItemBean> = [] | 23 | @State liveChatList: Array<LiveRoomItemBean> = [] |
| 24 | @Consume contentDetailData: ContentDetailDTO | 24 | @Consume contentDetailData: ContentDetailDTO |
| 25 | @Consume publishCommentModel: publishCommentModel | 25 | @Consume publishCommentModel: publishCommentModel |
| 26 | + @Prop @Watch("lastInputedCommentChanged") lastInputedComment: LiveRoomItemBean | ||
| 26 | 27 | ||
| 27 | aboutToAppear(): void { | 28 | aboutToAppear(): void { |
| 28 | this.getLiveChatList() | 29 | this.getLiveChatList() |
| @@ -46,6 +47,12 @@ export struct TabChatComponent { | @@ -46,6 +47,12 @@ export struct TabChatComponent { | ||
| 46 | }) | 47 | }) |
| 47 | } | 48 | } |
| 48 | 49 | ||
| 50 | + lastInputedCommentChanged(info: string) { | ||
| 51 | + Logger.debug(TAG, "2显示评论》》》: " + JSON.stringify(this.lastInputedComment)) | ||
| 52 | + this.liveChatList.push(this.liveViewModel.deepCopyLiveRoomItem(this.lastInputedComment)) | ||
| 53 | + this.pageModel.viewType = ViewType.LOADED; | ||
| 54 | + } | ||
| 55 | + | ||
| 49 | build() { | 56 | build() { |
| 50 | Stack() { | 57 | Stack() { |
| 51 | if (this.pageModel.viewType == ViewType.LOADING) { | 58 | if (this.pageModel.viewType == ViewType.LOADING) { |
| 1 | import { LiveRoomItemBean, Action, PhotoListBean, Params } from 'wdBean/Index' | 1 | import { LiveRoomItemBean, Action, PhotoListBean, Params } from 'wdBean/Index' |
| 2 | -import { StringUtils } from 'wdKit/Index' | 2 | +import { Logger, StringUtils } from 'wdKit/Index' |
| 3 | // import { Action, LiveRoomItemBean, Params, PhotoListBean } from 'wdBean/Index' | 3 | // import { Action, LiveRoomItemBean, Params, PhotoListBean } from 'wdBean/Index' |
| 4 | import { WDRouterRule } from 'wdRouter' | 4 | import { WDRouterRule } from 'wdRouter' |
| 5 | import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' | 5 | import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' |
| 6 | 6 | ||
| 7 | +const TAG = "TabChatItemComponent" | ||
| 8 | + | ||
| 7 | @Component | 9 | @Component |
| 8 | export struct TabChatItemComponent { | 10 | export struct TabChatItemComponent { |
| 9 | item: LiveRoomItemBean = {} as LiveRoomItemBean | 11 | item: LiveRoomItemBean = {} as LiveRoomItemBean |
| 10 | 12 | ||
| 11 | aboutToAppear(): void { | 13 | aboutToAppear(): void { |
| 14 | + Logger.debug(TAG, "评论内容: " + this.item.text + " 评论sender: " + this.item.senderUserName) | ||
| 12 | } | 15 | } |
| 13 | 16 | ||
| 14 | build() { | 17 | build() { |
| 1 | +import { LiveRoomItemBean } from 'wdBean/Index' | ||
| 1 | import { TabChatComponent } from './TabChatComponent' | 2 | import { TabChatComponent } from './TabChatComponent' |
| 2 | import { TabInfoComponent } from './TabInfoComponent' | 3 | import { TabInfoComponent } from './TabInfoComponent' |
| 3 | import { TabLiveComponent } from './TabLiveComponent' | 4 | import { TabLiveComponent } from './TabLiveComponent' |
| @@ -13,6 +14,9 @@ export struct TabComponent { | @@ -13,6 +14,9 @@ export struct TabComponent { | ||
| 13 | @State currentIndex: number = 0 | 14 | @State currentIndex: number = 0 |
| 14 | private controller: TabsController = new TabsController() | 15 | private controller: TabsController = new TabsController() |
| 15 | @Prop tabs: string[] = [] | 16 | @Prop tabs: string[] = [] |
| 17 | + @Prop lastInputedLiveComment: LiveRoomItemBean // 上次输入的直播间消息 | ||
| 18 | + @Prop lastInputedChatComment: LiveRoomItemBean // 上次输入的大家聊消息 | ||
| 19 | + | ||
| 16 | aboutToAppear(): void { | 20 | aboutToAppear(): void { |
| 17 | 21 | ||
| 18 | } | 22 | } |
| @@ -34,9 +38,9 @@ export struct TabComponent { | @@ -34,9 +38,9 @@ export struct TabComponent { | ||
| 34 | if ('简介' === item) { | 38 | if ('简介' === item) { |
| 35 | TabInfoComponent() | 39 | TabInfoComponent() |
| 36 | } else if ('直播间' === item) { | 40 | } else if ('直播间' === item) { |
| 37 | - TabLiveComponent() | 41 | + TabLiveComponent({lastInputedComment: this.lastInputedLiveComment}) |
| 38 | } else if ('大家聊' === item) { | 42 | } else if ('大家聊' === item) { |
| 39 | - TabChatComponent() | 43 | + TabChatComponent({lastInputedComment: this.lastInputedChatComment}) |
| 40 | } | 44 | } |
| 41 | } | 45 | } |
| 42 | .backgroundColor('#F5F5F5') | 46 | .backgroundColor('#F5F5F5') |
| @@ -23,11 +23,18 @@ export struct TabLiveComponent { | @@ -23,11 +23,18 @@ export struct TabLiveComponent { | ||
| 23 | @Consume @Watch('updateData') contentDetailData: ContentDetailDTO | 23 | @Consume @Watch('updateData') contentDetailData: ContentDetailDTO |
| 24 | @State private pageModel: PageModel = new PageModel() | 24 | @State private pageModel: PageModel = new PageModel() |
| 25 | private scroller: Scroller = new Scroller() | 25 | private scroller: Scroller = new Scroller() |
| 26 | + @Prop @Watch("lastInputedCommentChanged") lastInputedComment: LiveRoomItemBean | ||
| 26 | 27 | ||
| 27 | aboutToAppear(): void { | 28 | aboutToAppear(): void { |
| 28 | this.getLiveList() | 29 | this.getLiveList() |
| 29 | } | 30 | } |
| 30 | 31 | ||
| 32 | + lastInputedCommentChanged(info: string) { | ||
| 33 | + Logger.debug(TAG, "1显示评论》》》: " + JSON.stringify(this.lastInputedComment)) | ||
| 34 | + this.liveList.push(this.liveViewModel.deepCopyLiveRoomItem(this.lastInputedComment)) | ||
| 35 | + this.pageModel.viewType = ViewType.LOADED; | ||
| 36 | + } | ||
| 37 | + | ||
| 31 | build() { | 38 | build() { |
| 32 | Stack() { | 39 | Stack() { |
| 33 | if (this.pageModel.viewType == ViewType.LOADING) { | 40 | if (this.pageModel.viewType == ViewType.LOADING) { |
| @@ -15,6 +15,7 @@ export struct TopPlayComponent { | @@ -15,6 +15,7 @@ export struct TopPlayComponent { | ||
| 15 | playerController?: WDAliPlayerController | 15 | playerController?: WDAliPlayerController |
| 16 | // 预告片图片/视频url | 16 | // 预告片图片/视频url |
| 17 | @State previewUrl: string = '' | 17 | @State previewUrl: string = '' |
| 18 | + // 预告资源是否是视频资源 | ||
| 18 | @State isVideoSource: boolean = false | 19 | @State isVideoSource: boolean = false |
| 19 | //未开始 | 20 | //未开始 |
| 20 | @State isWait: boolean = false | 21 | @State isWait: boolean = false |
| @@ -61,6 +62,9 @@ export struct TopPlayComponent { | @@ -61,6 +62,9 @@ export struct TopPlayComponent { | ||
| 61 | this.updateData() | 62 | this.updateData() |
| 62 | } | 63 | } |
| 63 | 64 | ||
| 65 | + /** | ||
| 66 | + * 更新直播播放数据 | ||
| 67 | + */ | ||
| 64 | updateData() { | 68 | updateData() { |
| 65 | // 检测等待中的直播预告是否视频资源 | 69 | // 检测等待中的直播预告是否视频资源 |
| 66 | if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.previewType === 1 | 70 | if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.previewType === 1 |
| @@ -91,8 +95,11 @@ export struct TopPlayComponent { | @@ -91,8 +95,11 @@ export struct TopPlayComponent { | ||
| 91 | } | 95 | } |
| 92 | } | 96 | } |
| 93 | 97 | ||
| 98 | + | ||
| 94 | this.isEnd = this.contentDetailData?.liveInfo?.liveState === 'end' && | 99 | this.isEnd = this.contentDetailData?.liveInfo?.liveState === 'end' && |
| 95 | StringUtils.isEmpty(this.contentDetailData?.liveInfo?.vlive[0]?.replayUri) | 100 | StringUtils.isEmpty(this.contentDetailData?.liveInfo?.vlive[0]?.replayUri) |
| 101 | + | ||
| 102 | + Logger.debug(TAG, `---0------>` + this.isWait + ' ->' + this.isLoading + ' ->' + this.isEnd) | ||
| 96 | if (!this.isWait && this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.vlive.length > 0) { | 103 | if (!this.isWait && this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.vlive.length > 0) { |
| 97 | let playUrl = '' | 104 | let playUrl = '' |
| 98 | if (this.contentDetailData.liveInfo.liveState == 'running') { | 105 | if (this.contentDetailData.liveInfo.liveState == 'running') { |
| @@ -105,17 +112,29 @@ export struct TopPlayComponent { | @@ -105,17 +112,29 @@ export struct TopPlayComponent { | ||
| 105 | this.playUrl = this.previewUrl | 112 | this.playUrl = this.previewUrl |
| 106 | this.tryToPlay() | 113 | this.tryToPlay() |
| 107 | } else { | 114 | } else { |
| 115 | + Logger.debug(TAG, `---0------>${playUrl}`) | ||
| 108 | if (StringUtils.isNotEmpty(playUrl)) { | 116 | if (StringUtils.isNotEmpty(playUrl)) { |
| 109 | - Logger.debug(TAG, `${playUrl}`) | ||
| 110 | this.playUrl = playUrl | 117 | this.playUrl = playUrl |
| 111 | this.tryToPlay() | 118 | this.tryToPlay() |
| 112 | } | 119 | } |
| 113 | } | 120 | } |
| 121 | + } | ||
| 114 | 122 | ||
| 123 | + // 文字直播 running 状态 | ||
| 124 | + if (this.contentDetailData?.liveInfo?.liveWay === 1 && this.contentDetailData?.liveInfo?.liveState === 'running') { | ||
| 125 | + this.isWait = true | ||
| 126 | + this.isLoading = true | ||
| 127 | + if (this.contentDetailData.fullColumnImgUrls && this.contentDetailData.fullColumnImgUrls.length > 0) { | ||
| 128 | + this.previewUrl = this.contentDetailData.fullColumnImgUrls[0].url | ||
| 129 | + } else { | ||
| 130 | + this.previewUrl = '' | ||
| 115 | } | 131 | } |
| 116 | } | 132 | } |
| 117 | 133 | ||
| 134 | + } | ||
| 135 | + | ||
| 118 | tryToPlay() { | 136 | tryToPlay() { |
| 137 | + Logger.debug(TAG, `---1------>`) | ||
| 119 | if (!this.xComponentIsLoaded) { | 138 | if (!this.xComponentIsLoaded) { |
| 120 | Logger.debug(TAG, "需要xComponent加载完成") | 139 | Logger.debug(TAG, "需要xComponent加载完成") |
| 121 | return | 140 | return |
| @@ -136,6 +155,7 @@ export struct TopPlayComponent { | @@ -136,6 +155,7 @@ export struct TopPlayComponent { | ||
| 136 | this.isLoading = false | 155 | this.isLoading = false |
| 137 | this.isError = false | 156 | this.isError = false |
| 138 | this.xComponentIsLoaded = true | 157 | this.xComponentIsLoaded = true |
| 158 | + Logger.debug(TAG, `---onLoad------>`) | ||
| 139 | this.tryToPlay() | 159 | this.tryToPlay() |
| 140 | } | 160 | } |
| 141 | }) | 161 | }) |
| @@ -149,6 +169,7 @@ export struct TopPlayComponent { | @@ -149,6 +169,7 @@ export struct TopPlayComponent { | ||
| 149 | // 直播房间图 | 169 | // 直播房间图 |
| 150 | Image(this.previewUrl) | 170 | Image(this.previewUrl) |
| 151 | .objectFit(ImageFit.Cover) | 171 | .objectFit(ImageFit.Cover) |
| 172 | + .alt($r('app.media.live_room_image_fail')) | ||
| 152 | .visibility(this.isWait || this.isEnd ? Visibility.Visible : Visibility.None) | 173 | .visibility(this.isWait || this.isEnd ? Visibility.Visible : Visibility.None) |
| 153 | .contrast(this.isEnd ? 0.2 : 1) | 174 | .contrast(this.isEnd ? 0.2 : 1) |
| 154 | .width('100%') | 175 | .width('100%') |
| @@ -10,7 +10,7 @@ import { LiveViewModel } from '../../viewModel/LiveViewModel' | @@ -10,7 +10,7 @@ import { LiveViewModel } from '../../viewModel/LiveViewModel' | ||
| 10 | import { ChartItemCompereComponent } from './ChartItemCompereComponent' | 10 | import { ChartItemCompereComponent } from './ChartItemCompereComponent' |
| 11 | import { ChatItemComponent } from './ChartItemComponent' | 11 | import { ChatItemComponent } from './ChartItemComponent' |
| 12 | import { router } from '@kit.ArkUI' | 12 | import { router } from '@kit.ArkUI' |
| 13 | -import { EmitterEventId, EmitterUtils, SPHelper, WindowModel } from 'wdKit/Index' | 13 | +import { EmitterEventId, EmitterUtils, Logger, SPHelper, WindowModel } from 'wdKit/Index' |
| 14 | 14 | ||
| 15 | const TAG = "PlayerCommentComponent" | 15 | const TAG = "PlayerCommentComponent" |
| 16 | 16 | ||
| @@ -28,22 +28,6 @@ export struct PlayerCommentComponent { | @@ -28,22 +28,6 @@ export struct PlayerCommentComponent { | ||
| 28 | async aboutToAppear(): Promise<void> { | 28 | async aboutToAppear(): Promise<void> { |
| 29 | 29 | ||
| 30 | this.getLiveChatList() | 30 | this.getLiveChatList() |
| 31 | - //注册通知 | ||
| 32 | - EmitterUtils.receiveEvent(EmitterEventId.COMMENT_PUBLISH, async (targetId?: string) => { | ||
| 33 | - if (targetId) { | ||
| 34 | - if (targetId == this.publishCommentModel.targetId) { | ||
| 35 | - const info = { | ||
| 36 | - senderUserName: this.publishCommentModel.lastCommentModel.fromUserName, | ||
| 37 | - text: this.publishCommentModel.lastCommentModel.commentContent, | ||
| 38 | - } as LiveRoomItemBean | ||
| 39 | - | ||
| 40 | - this.liveChatList.push(info) | ||
| 41 | - this.scroller.scrollEdge(Edge.Bottom) | ||
| 42 | - console.log(TAG, '发布评论:', JSON.stringify(this.publishCommentModel.lastCommentModel)) | ||
| 43 | - } | ||
| 44 | - } | ||
| 45 | - }) | ||
| 46 | - | ||
| 47 | } | 31 | } |
| 48 | 32 | ||
| 49 | generateRandomString() { | 33 | generateRandomString() { |
| @@ -122,7 +106,14 @@ export struct PlayerCommentComponent { | @@ -122,7 +106,14 @@ export struct PlayerCommentComponent { | ||
| 122 | }, | 106 | }, |
| 123 | onCommentInputed: (content) => { | 107 | onCommentInputed: (content) => { |
| 124 | if (content.comment) { | 108 | if (content.comment) { |
| 125 | - this.liveViewModel.sendComment(content.comment) | 109 | + this.liveViewModel.sendComment(content.comment, this.contentDetailData).then(result => { |
| 110 | + if (!result) { | ||
| 111 | + return | ||
| 112 | + } | ||
| 113 | + Logger.debug(TAG, "3显示评论》》》: " + JSON.stringify(result)) | ||
| 114 | + this.liveChatList.push(result) | ||
| 115 | + this.scroller.scrollEdge(Edge.Bottom) | ||
| 116 | + }) | ||
| 126 | } | 117 | } |
| 127 | }, | 118 | }, |
| 128 | onBack: () => { | 119 | onBack: () => { |
| @@ -16,6 +16,7 @@ export struct PlayerComponent { | @@ -16,6 +16,7 @@ export struct PlayerComponent { | ||
| 16 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | 16 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 |
| 17 | @State imgUrl: string = '' | 17 | @State imgUrl: string = '' |
| 18 | @State isWait: boolean = false | 18 | @State isWait: boolean = false |
| 19 | + // 0-横屏流画面,1-竖屏幕流画面 | ||
| 19 | @State liveStreamType: number | null = -1 | 20 | @State liveStreamType: number | null = -1 |
| 20 | @State playUrl: string = '' | 21 | @State playUrl: string = '' |
| 21 | @State isCanplay: boolean = false | 22 | @State isCanplay: boolean = false |
sight_harmony/features/wdDetailPlayLive/src/main/resources/base/media/live_room_image_fail.png
0 → 100644
11.6 KB
| @@ -267,6 +267,7 @@ export class WDAliPlayerController { | @@ -267,6 +267,7 @@ export class WDAliPlayerController { | ||
| 267 | 267 | ||
| 268 | async firstPlay(url: string) { | 268 | async firstPlay(url: string) { |
| 269 | if (StringUtils.isEmpty(url)) { | 269 | if (StringUtils.isEmpty(url)) { |
| 270 | + Logger.error(TAG, "播放链接为空") | ||
| 270 | return | 271 | return |
| 271 | } | 272 | } |
| 272 | 273 | ||
| @@ -292,7 +293,7 @@ export class WDAliPlayerController { | @@ -292,7 +293,7 @@ export class WDAliPlayerController { | ||
| 292 | 293 | ||
| 293 | this.avPlayer?.setAutoPlay(false) | 294 | this.avPlayer?.setAutoPlay(false) |
| 294 | 295 | ||
| 295 | - Logger.debug(TAG, "开始播放:"+ this.url) | 296 | + Logger.debug(TAG, "开始播放: " + this.url) |
| 296 | this.setAliPlayerURL(this.url); | 297 | this.setAliPlayerURL(this.url); |
| 297 | 298 | ||
| 298 | Logger.info(TAG, "设置SurfaceId: " + this.surfaceId) | 299 | Logger.info(TAG, "设置SurfaceId: " + this.surfaceId) |
| @@ -95,6 +95,22 @@ struct LaunchAdvertisingPage { | @@ -95,6 +95,22 @@ struct LaunchAdvertisingPage { | ||
| 95 | .width('100%') | 95 | .width('100%') |
| 96 | .height('100%') | 96 | .height('100%') |
| 97 | 97 | ||
| 98 | + if (this.defaultModel.isAd === '1'){ | ||
| 99 | + Stack({alignContent:Alignment.TopStart}){ | ||
| 100 | + Text('广告') | ||
| 101 | + .fontColor(Color.White) | ||
| 102 | + .textAlign(TextAlign.Center) | ||
| 103 | + .fontSize('24lpx') | ||
| 104 | + .width('72lpx') | ||
| 105 | + .height('36lpx') | ||
| 106 | + .borderRadius(5) | ||
| 107 | + .margin({top:'10lpx',left:'19lpx'}) | ||
| 108 | + .backgroundColor('#80000000') | ||
| 109 | + } | ||
| 110 | + .width('100%') | ||
| 111 | + .height('100%') | ||
| 112 | + } | ||
| 113 | + | ||
| 98 | if(this.defaultModel.screenType != '2'){ | 114 | if(this.defaultModel.screenType != '2'){ |
| 99 | //底部logo样式 按钮加载在背景展示图上 | 115 | //底部logo样式 按钮加载在背景展示图上 |
| 100 | Button(){ | 116 | Button(){ |
-
Please register or login to post a comment