Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
wangyujian_wd
2024-05-07 16:54:29 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
74924bcd7ecfe1f2db5c1ce9e5f27ae9c55fc4cd
74924bcd
1 parent
326d242d
fix:1)电子报修改优化(滚动列表);2)直播详情样式修改优化。
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
64 additions
and
17 deletions
sight_harmony/features/wdComponent/src/main/ets/components/ENewspaperPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/dialog/ENewspaperListDialog.ets
sight_harmony/features/wdComponent/src/main/ets/dialog/ENewspaperPageDialog.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/PlayUIComponent.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/TopPlayComponet.ets
sight_harmony/features/wdComponent/src/main/ets/components/ENewspaperPageComponent.ets
View file @
74924bc
...
...
@@ -295,15 +295,15 @@ export struct ENewspaperPageComponent {
.backgroundColor($r('app.color.color_80000000'))
.id('e_newspaper_container')
if (this.isOpenListDialog) {
ENewspaperListDialog({
newspaperListBean: this.newspaperListBean,
closeDialog: () => {
this.isOpenListDialog = false
}
})
.visibility(this.isOpenListDialog ? Visibility.Visible : Visibility.None)
}
}
}
private async getNewspaperTime() {
...
...
sight_harmony/features/wdComponent/src/main/ets/dialog/ENewspaperListDialog.ets
View file @
74924bc
...
...
@@ -15,11 +15,15 @@ export struct ENewspaperListDialog {
@Prop @Watch('updateRecordsData') newspaperListBean: NewspaperListBean = {} as NewspaperListBean
private listScroller: Scroller = new Scroller()
@State scrollOffset: number = 0
@State isCurrentViewOpen: boolean = false
//文字版选择弹框
pageListDialogController: CustomDialogController = new CustomDialogController({
builder: ENewspaperPageDialog({
dialogType: 1,
newspaperListBean: this.newspaperListBean,
dialogVisibility: (visibility: boolean) => {
this.isCurrentViewOpen = !visibility
}
}),
alignment: DialogAlignment.TopStart,
offset: { dx: 0, dy: 224 },
...
...
@@ -37,10 +41,13 @@ export struct ENewspaperListDialog {
let _scrollIndex = Number.parseInt(this.currentPageNum)
console.log("ENewspaperListDialog-onCurrentPageNumUpdated", "_scrollIndex:", _scrollIndex)
let scrollIndexEnd = _scrollIndex > 0 ? _scrollIndex - 1 : _scrollIndex
if (!this.isCurrentViewOpen) {
this.listScroller.scrollToIndex(scrollIndexEnd)
}
}
aboutToAppear(): void {
this.isCurrentViewOpen = true
console.log("ENewspaperListDialog-aboutToAppear", "currentPageNum:", this.currentPageNum)
let _scrollIndex = Number.parseInt(this.currentPageNum)
console.log("ENewspaperListDialog-aboutToAppear", "_scrollIndex:", _scrollIndex)
...
...
@@ -52,6 +59,7 @@ export struct ENewspaperListDialog {
// if (this.pageListDialogController) {
// this.pageListDialogController = null
// }
this.isCurrentViewOpen = false
}
build() {
...
...
@@ -228,19 +236,19 @@ export struct ENewspaperListDialog {
bottom: 85
})
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
.onScrollIndex((firstIndex: number, lastIndex: number, centerIndex: number) => {
// console.info('ENewspaperListDialog::first' + firstIndex)
// console.info('ENewspaperListDialog::last' + lastIndex)
// console.info('ENewspaperListDialog::center' + centerIndex)
console.info('ENewspaperListDialog::first' + firstIndex)
console.info('ENewspaperListDialog::last' + lastIndex)
console.info('ENewspaperListDialog::center' + centerIndex)
// this.updateCurrentPageNum(firstIndex)
// const tempIndex = this.findClassIndex(firstIndex)
if (firstIndex !== centerIndex) {
return
}
// if (firstIndex !== centerIndex) {
// return
// }
// console.info(`this.scrollOffset:` + this.scrollOffset)
// if (this.scrollOffset == 0) {
this.currentPageNum = `${centerIndex < 9 ? '0' + (centerIndex + 1) : center
Index + 1}`
this.currentPageNum = `${firstIndex < 9 ? '0' + (firstIndex + 1) : first
Index + 1}`
// }
})
.onScroll((scrollOffset: number, scrollState: ScrollState) => {
...
...
sight_harmony/features/wdComponent/src/main/ets/dialog/ENewspaperPageDialog.ets
View file @
74924bc
...
...
@@ -9,11 +9,24 @@ export struct ENewspaperPageDialog {
pageDialogController?: CustomDialogController
@Consume @Watch('onCurrentPageNumUpdated') currentPageNum: string
@Prop newspaperListBean: NewspaperListBean = {} as NewspaperListBean
public dialogVisibility?: (visibility: boolean) => void
onCurrentPageNumUpdated(): void {
console.log("ENewspaperListDialog-onCurrentPageNumUpdated", "currentPageNum:", this.currentPageNum)
}
aboutToAppear(): void {
if (this.dialogType == 1 && this.dialogVisibility) {
this.dialogVisibility(true)
}
}
aboutToDisappear(): void {
if (this.dialogType == 1 && this.dialogVisibility) {
this.dialogVisibility(false)
}
}
build() {
Column() {
if (this.dialogType == 1) {
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/PlayUIComponent.ets
View file @
74924bc
import { window } from '@kit.ArkUI'
import { NumberFormatterUtils, WindowModel } from 'wdKit/Index'
import { NumberFormatterUtils,
StringUtils,
WindowModel } from 'wdKit/Index'
import { DateFormatUtil, WDPlayerController } from 'wdPlayer/Index'
import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index'
import { DisplayDirection } from 'wdConstant/Index'
...
...
@@ -20,7 +20,8 @@ export struct PlayUIComponent {
@Consume displayDirection: DisplayDirection
onChangeMenuVisible() {
if (!this.liveDetailsBean || !this.liveDetailsBean.liveInfo || this.liveDetailsBean?.liveInfo?.liveState === 'wait') {
if (!this.liveDetailsBean || !this.liveDetailsBean.liveInfo ||
this.liveDetailsBean?.liveInfo?.liveState === 'wait') {
return
}
let time: number = 0
...
...
@@ -216,6 +217,9 @@ export struct PlayUIComponent {
this.playOrPauseBtn()
Blank()
} else if (this.liveDetailsBean?.liveInfo?.liveState == 'end') {
if (StringUtils.isEmpty(this.liveDetailsBean?.liveInfo?.vlive[0]?.replayUri)) {
Blank()
} else {
this.playOrPauseBtn()
Text(this.currentTime)
.fontColor(Color.White)
...
...
@@ -233,13 +237,18 @@ export struct PlayUIComponent {
right: 16
})
}
}
if (this.liveDetailsBean?.liveInfo?.liveState == 'running'
|| this.liveDetailsBean?.liveInfo?.liveState == 'end') {
|| (this.liveDetailsBean?.liveInfo?.liveState == 'end' &&
StringUtils.isNotEmpty(this.liveDetailsBean?.liveInfo?.vlive[0]?.replayUri))
) {
Image($r('app.media.icon_live_player_full_screen'))
.width(24)
.height(24)
.onClick(() => {
this.displayDirection = this.displayDirection == DisplayDirection.VERTICAL ? DisplayDirection.VIDEO_HORIZONTAL : DisplayDirection.VERTICAL
this.displayDirection =
this.displayDirection == DisplayDirection.VERTICAL ? DisplayDirection.VIDEO_HORIZONTAL :
DisplayDirection.VERTICAL
WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ?
window.Orientation.PORTRAIT :
window.Orientation.LANDSCAPE_INVERTED)
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/TopPlayComponet.ets
View file @
74924bc
import { LiveDetailsBean } from 'wdBean/Index';
import { StringUtils } from 'wdKit/Index';
import { WDPlayerController, WDPlayerRenderLiveView } from 'wdPlayer/Index';
import { PlayUIComponent } from './PlayUIComponent';
...
...
@@ -8,7 +9,10 @@ export struct TopPlayComponent {
@Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean
playerController?: WDPlayerController
@State imgUrl: string = ''
//未开始
@State isWait: boolean = false
//已结束直播
@State isEnd: boolean = false
aboutToAppear(): void {
if (this.playerController) {
...
...
@@ -24,6 +28,8 @@ export struct TopPlayComponent {
this.imgUrl = this.liveDetailsBean.fullColumnImgUrls[0].url
}
this.isWait = this.liveDetailsBean?.liveInfo?.liveState == 'wait'
this.isEnd = this.liveDetailsBean?.liveInfo?.liveState === 'end' &&
StringUtils.isEmpty(this.liveDetailsBean?.liveInfo?.vlive[0]?.replayUri)
if (!this.isWait && this.liveDetailsBean.liveInfo && this.liveDetailsBean.liveInfo.vlive.length > 0) {
let playUrl = ''
if (this.liveDetailsBean.liveInfo.liveState == 'running') {
...
...
@@ -31,8 +37,10 @@ export struct TopPlayComponent {
} else if (this.liveDetailsBean.liveInfo.liveState == 'end') {
playUrl = this.liveDetailsBean.liveInfo.vlive[0].replayUri
}
this.playerController?.firstPlay(playUrl);
// this.playerController?.firstPlay('https://rmrbcmsonline.peopleapp.com/upload/rmh/video/mp4/202404/1713752415708fb81d0b8f137b.mp4');
if (StringUtils.isNotEmpty(playUrl)) {
this.playerController?.firstPlay(playUrl);
}
}
}
...
...
@@ -46,12 +54,21 @@ export struct TopPlayComponent {
.height('100%')
.width('100%')
.visibility(this.isWait ? Visibility.None : Visibility.Visible)
Image(this.imgUrl)
Image('')
.backgroundImage(this.imgUrl)
.objectFit(ImageFit.Contain)
.visibility(this.isWait ? Visibility.Visible : Visibility.None)
.visibility(this.isWait || this.isEnd ? Visibility.Visible : Visibility.None)
.backdropBlur(this.isEnd ? 3 : 0)
PlayUIComponent({ playerController: this.playerController })
Text('直播已结束')
.fontSize('20fp')
.fontWeight(500)
.fontColor(Color.White)
.visibility(this.isEnd ? Visibility.Visible :
Visibility.None)
}
.width('100%')
.alignSelf(ItemAlign.Center)
}
aboutToDisappear(): void {
...
...
Please
register
or
login
to post a comment