wangyujian_wd

feat:1)直播详情底部评论模块添加

@@ -64,5 +64,8 @@ export { SpacialTopicPageComponent } from './src/main/ets/components/SpacialTopi @@ -64,5 +64,8 @@ export { SpacialTopicPageComponent } from './src/main/ets/components/SpacialTopi
64 export { LogoutViewModel } from "./src/main/ets/viewmodel/LogoutViewModel" 64 export { LogoutViewModel } from "./src/main/ets/viewmodel/LogoutViewModel"
65 65
66 export { ImageSwiperComponent } from "./src/main/ets/components/ImageSwiperComponent" 66 export { ImageSwiperComponent } from "./src/main/ets/components/ImageSwiperComponent"
  67 +
67 export { newsSkeleton } from "./src/main/ets/components/skeleton/newsSkeleton" 68 export { newsSkeleton } from "./src/main/ets/components/skeleton/newsSkeleton"
68 69
  70 +export { LiveCommentComponent } from "./src/main/ets/components/comment/view/LiveCommentComponent"
  71 +
  1 +import { router } from '@kit.ArkUI'
  2 +import { NumberFormatterUtils, ToastUtils } from 'wdKit/Index'
  3 +
  4 +@Component
  5 +export struct LiveCommentComponent {
  6 + public clickCollect?: (isCollect: boolean) => void
  7 + public clickHeart?: (isHeart: boolean) => void
  8 + @State isCollect: boolean = false
  9 + @State isLike: boolean = false
  10 + @State heartNum: number = 0
  11 +
  12 + build() {
  13 + Row() {
  14 + Image($r('app.media.back_icon'))
  15 + .width(24)
  16 + .height(24)
  17 + .margin({
  18 + left: 16,
  19 + right: 12
  20 + })
  21 + .onClick(() => {
  22 + router.back()
  23 + })
  24 + Stack() {
  25 + Image($r('app.media.background_search'))
  26 + .interpolation(ImageInterpolation.High)
  27 + .width('100%')
  28 + .height(30)
  29 + TextArea({ placeholder: '说两句...' })
  30 + .backgroundColor(Color.Transparent)
  31 + .enabled(false)
  32 + .margin({
  33 + left: 5,
  34 + right: 20
  35 + })
  36 + }
  37 + .layoutWeight(1)
  38 + .onClick(() => {
  39 + ToastUtils.shortToast('依赖其它功能开发')
  40 + })
  41 +
  42 + Image(this.isCollect ? $r('app.media.ic_collect_check') : $r('app.media.iv_live_comment_collect_un'))
  43 + .width(24)
  44 + .height(24)
  45 + .margin({
  46 + left: 20,
  47 + right: 24
  48 + })
  49 + .onClick(() => {
  50 + this.isCollect = !this.isCollect
  51 + })
  52 + Image($r('app.media.iv_live_comment_share'))
  53 + .width(24)
  54 + .height(24)
  55 + .onClick(() => {
  56 + ToastUtils.shortToast('依赖其它功能开发')
  57 + })
  58 + Stack() {
  59 + Text(NumberFormatterUtils.formatNumberWithWan(this.heartNum))
  60 + .height(12)
  61 + .fontSize('8fp')
  62 + .fontWeight(500)
  63 + .fontColor(Color.White)
  64 + .backgroundImage($r('app.media.iv_live_comment_hert_num'))
  65 + .backgroundImageSize(ImageSize.Cover)
  66 + .margin({
  67 + left: 6,
  68 + bottom: 33
  69 + })
  70 + .padding({
  71 + left: 6,
  72 + right: 2
  73 + })
  74 + Image(this.isLike ? $r('app.media.iv_live_comment_hert_light') : $r('app.media.comment_like_normal'))
  75 + .width(24)
  76 + .height(24)
  77 + .margin({
  78 + right: 20,
  79 + })
  80 + }
  81 + .width(44)
  82 + .height(56)
  83 + .margin({
  84 + left: 24
  85 + })
  86 + .onClick(() => {
  87 + this.isLike = !this.isLike
  88 + })
  89 + }
  90 + .height(56)
  91 + .width('100%')
  92 + .backgroundColor(Color.White)
  93 + }
  94 +}
1 -import { BottomComponent } from '../widgets/details/BottomComponent';  
2 import { TabComponent } from '../widgets/details/TabComponent'; 1 import { TabComponent } from '../widgets/details/TabComponent';
3 import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet'; 2 import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet';
4 3
@@ -13,7 +12,6 @@ export struct DetailPlayHLivePage { @@ -13,7 +12,6 @@ export struct DetailPlayHLivePage {
13 Column() { 12 Column() {
14 TopPlayComponent() 13 TopPlayComponent()
15 TabComponent() 14 TabComponent()
16 - BottomComponent()  
17 } 15 }
18 .height('100%') 16 .height('100%')
19 .width('100%') 17 .width('100%')
1 import { Action, LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index'; 1 import { Action, LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index';
2 import { LiveViewModel } from '../viewModel/LiveViewModel'; 2 import { LiveViewModel } from '../viewModel/LiveViewModel';
3 -import { BottomComponent } from '../widgets/details/BottomComponent';  
4 import { TabComponent } from '../widgets/details/TabComponent'; 3 import { TabComponent } from '../widgets/details/TabComponent';
5 import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet'; 4 import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet';
6 import router from '@ohos.router'; 5 import router from '@ohos.router';
@@ -9,6 +8,7 @@ import mediaquery from '@ohos.mediaquery'; @@ -9,6 +8,7 @@ import mediaquery from '@ohos.mediaquery';
9 import { Logger, WindowModel } from 'wdKit/Index'; 8 import { Logger, WindowModel } from 'wdKit/Index';
10 import { window } from '@kit.ArkUI'; 9 import { window } from '@kit.ArkUI';
11 import { devicePLSensorManager } from 'wdDetailPlayApi/Index'; 10 import { devicePLSensorManager } from 'wdDetailPlayApi/Index';
  11 +import { LiveCommentComponent } from 'wdComponent/Index';
12 12
13 @Entry 13 @Entry
14 @Component 14 @Component
@@ -28,7 +28,7 @@ export struct DetailPlayLivePage { @@ -28,7 +28,7 @@ export struct DetailPlayLivePage {
28 //监听屏幕横竖屏变化 28 //监听屏幕横竖屏变化
29 let listener = mediaquery.matchMediaSync('(orientation: landscape)'); 29 let listener = mediaquery.matchMediaSync('(orientation: landscape)');
30 listener.on("change", (mediaQueryResult) => { 30 listener.on("change", (mediaQueryResult) => {
31 - Logger.info(this.TAG,`change;${mediaQueryResult.matches}`) 31 + Logger.info(this.TAG, `change;${mediaQueryResult.matches}`)
32 if (mediaQueryResult.matches) { 32 if (mediaQueryResult.matches) {
33 this.displayDirection = DisplayDirection.VIDEO_HORIZONTAL 33 this.displayDirection = DisplayDirection.VIDEO_HORIZONTAL
34 } else { 34 } else {
@@ -52,7 +52,7 @@ export struct DetailPlayLivePage { @@ -52,7 +52,7 @@ export struct DetailPlayLivePage {
52 TabComponent({ tabs: this.tabs }) 52 TabComponent({ tabs: this.tabs })
53 .layoutWeight(503) 53 .layoutWeight(503)
54 .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) 54 .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
55 - BottomComponent() 55 + LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum })
56 .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) 56 .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
57 } 57 }
58 .height('100%') 58 .height('100%')
1 -@Component  
2 -export struct BottomComponent {  
3 - aboutToAppear(): void {  
4 - }  
5 -  
6 - build() {  
7 - Row() {  
8 -  
9 - }.backgroundColor(Color.Gray)  
10 - .height(56)  
11 - .width('100%')  
12 - }  
13 -  
14 - aboutToDisappear(): void {  
15 - }  
16 -}