wangyujian_wd

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

... ... @@ -64,5 +64,8 @@ export { SpacialTopicPageComponent } from './src/main/ets/components/SpacialTopi
export { LogoutViewModel } from "./src/main/ets/viewmodel/LogoutViewModel"
export { ImageSwiperComponent } from "./src/main/ets/components/ImageSwiperComponent"
export { newsSkeleton } from "./src/main/ets/components/skeleton/newsSkeleton"
export { LiveCommentComponent } from "./src/main/ets/components/comment/view/LiveCommentComponent"
... ...
import { router } from '@kit.ArkUI'
import { NumberFormatterUtils, ToastUtils } from 'wdKit/Index'
@Component
export struct LiveCommentComponent {
public clickCollect?: (isCollect: boolean) => void
public clickHeart?: (isHeart: boolean) => void
@State isCollect: boolean = false
@State isLike: boolean = false
@State heartNum: number = 0
build() {
Row() {
Image($r('app.media.back_icon'))
.width(24)
.height(24)
.margin({
left: 16,
right: 12
})
.onClick(() => {
router.back()
})
Stack() {
Image($r('app.media.background_search'))
.interpolation(ImageInterpolation.High)
.width('100%')
.height(30)
TextArea({ placeholder: '说两句...' })
.backgroundColor(Color.Transparent)
.enabled(false)
.margin({
left: 5,
right: 20
})
}
.layoutWeight(1)
.onClick(() => {
ToastUtils.shortToast('依赖其它功能开发')
})
Image(this.isCollect ? $r('app.media.ic_collect_check') : $r('app.media.iv_live_comment_collect_un'))
.width(24)
.height(24)
.margin({
left: 20,
right: 24
})
.onClick(() => {
this.isCollect = !this.isCollect
})
Image($r('app.media.iv_live_comment_share'))
.width(24)
.height(24)
.onClick(() => {
ToastUtils.shortToast('依赖其它功能开发')
})
Stack() {
Text(NumberFormatterUtils.formatNumberWithWan(this.heartNum))
.height(12)
.fontSize('8fp')
.fontWeight(500)
.fontColor(Color.White)
.backgroundImage($r('app.media.iv_live_comment_hert_num'))
.backgroundImageSize(ImageSize.Cover)
.margin({
left: 6,
bottom: 33
})
.padding({
left: 6,
right: 2
})
Image(this.isLike ? $r('app.media.iv_live_comment_hert_light') : $r('app.media.comment_like_normal'))
.width(24)
.height(24)
.margin({
right: 20,
})
}
.width(44)
.height(56)
.margin({
left: 24
})
.onClick(() => {
this.isLike = !this.isLike
})
}
.height(56)
.width('100%')
.backgroundColor(Color.White)
}
}
\ No newline at end of file
... ...
import { BottomComponent } from '../widgets/details/BottomComponent';
import { TabComponent } from '../widgets/details/TabComponent';
import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet';
... ... @@ -13,7 +12,6 @@ export struct DetailPlayHLivePage {
Column() {
TopPlayComponent()
TabComponent()
BottomComponent()
}
.height('100%')
.width('100%')
... ...
import { Action, LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index';
import { LiveViewModel } from '../viewModel/LiveViewModel';
import { BottomComponent } from '../widgets/details/BottomComponent';
import { TabComponent } from '../widgets/details/TabComponent';
import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet';
import router from '@ohos.router';
... ... @@ -9,6 +8,7 @@ import mediaquery from '@ohos.mediaquery';
import { Logger, WindowModel } from 'wdKit/Index';
import { window } from '@kit.ArkUI';
import { devicePLSensorManager } from 'wdDetailPlayApi/Index';
import { LiveCommentComponent } from 'wdComponent/Index';
@Entry
@Component
... ... @@ -28,7 +28,7 @@ export struct DetailPlayLivePage {
//监听屏幕横竖屏变化
let listener = mediaquery.matchMediaSync('(orientation: landscape)');
listener.on("change", (mediaQueryResult) => {
Logger.info(this.TAG,`change;${mediaQueryResult.matches}`)
Logger.info(this.TAG, `change;${mediaQueryResult.matches}`)
if (mediaQueryResult.matches) {
this.displayDirection = DisplayDirection.VIDEO_HORIZONTAL
} else {
... ... @@ -52,7 +52,7 @@ export struct DetailPlayLivePage {
TabComponent({ tabs: this.tabs })
.layoutWeight(503)
.visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
BottomComponent()
LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum })
.visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
}
.height('100%')
... ...
@Component
export struct BottomComponent {
aboutToAppear(): void {
}
build() {
Row() {
}.backgroundColor(Color.Gray)
.height(56)
.width('100%')
}
aboutToDisappear(): void {
}
}
\ No newline at end of file