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-04-28 19:53:58 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3b17d01adf5d2e20b7ec98611fd815c4d7635236
3b17d01a
1 parent
7eb480c1
fix:1)直播详情页面和电子报模块修改优化
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
157 additions
and
64 deletions
sight_harmony/features/wdBean/src/main/ets/bean/live/LiveDetailsBean.ets
sight_harmony/features/wdBean/src/main/ets/bean/live/LiveRoomBean.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardCommon/LiveFollowComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/LiveCommentComponent.ets
sight_harmony/features/wdComponent/src/main/ets/dialog/ENewspaperListDialog.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/LiveCountdownComponent.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/TabComponent.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/TabLiveComponent.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/TabLiveItemComponent.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/wdBean/src/main/ets/bean/live/LiveDetailsBean.ets
View file @
3b17d01
...
...
@@ -159,7 +159,7 @@ export interface LiveDetailsBean {
}
*/
liveInfo: LiveInfo
fullColumnImgUrls: Array<FullColumnImgUrl
s
>
fullColumnImgUrls: Array<FullColumnImgUrl
Bean
>
newsTitle: string
newsId: string
newIntroduction: string
...
...
@@ -186,8 +186,12 @@ export interface MLive {
mliveId: string
}
export interface FullColumnImgUrl
s
{
export interface FullColumnImgUrl
Bean
{
url: string
height: string
landscape: number
size: string
weight: string
}
export interface Vlive {
...
...
sight_harmony/features/wdBean/src/main/ets/bean/live/LiveRoomBean.ets
View file @
3b17d01
import { FullColumnImgUrlBean } from './LiveDetailsBean'
export interface LiveRoomBean {
pageNum: number
pageSize: number
...
...
@@ -15,6 +17,7 @@ export interface LiveRoomItemBean {
isWall: number
//是否置顶 1置顶0不置顶
isTop: number
//guest :嘉宾,host:主持人
role: string
//ZH_TEXT_AND_IMAGE_MSG :图文,ZH_TEXT_MSG:文本,ZH_VIDEO_MSG:视频,ZH_AUDIO_MSG:音频
dataType: string
...
...
@@ -28,5 +31,7 @@ export interface LiveRoomItemBean {
duration: number
//音频地址
audioUrl: string
//详情页面插入数据bean
fullColumnImgUrlDto: FullColumnImgUrlBean
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardCommon/LiveFollowComponent.ets
View file @
3b17d01
...
...
@@ -30,7 +30,7 @@ export struct LiveFollowComponent {
Stack() {
Stack()
.height(22)
.width(1
3
0)
.width(1
5
0)
.backgroundColor('#000000')
.opacity(0.3)
.borderRadius({
...
...
@@ -71,7 +71,7 @@ export struct LiveFollowComponent {
})
}
.height(22)
.width(1
3
0)
.width(1
5
0)
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/LiveCommentComponent.ets
View file @
3b17d01
...
...
@@ -71,6 +71,7 @@ export struct LiveCommentComponent {
left: 6,
right: 2
})
.visibility(this.heartNum > 0 ? Visibility.Visible : Visibility.Hidden)
Image(this.isLike ? $r('app.media.icon_like_selected_redheart') : $r('app.media.iv_live_heart_normal'))
.width(24)
.height(24)
...
...
sight_harmony/features/wdComponent/src/main/ets/dialog/ENewspaperListDialog.ets
View file @
3b17d01
...
...
@@ -12,7 +12,7 @@ export struct ENewspaperListDialog {
@Consume @Watch('onCurrentPageNumUpdated') currentPageNum: string
@State pageDialogShow: boolean = false
@State scrollIndex: number = 0
@Prop newspaperListBean: NewspaperListBean = {} as NewspaperListBean
@Prop
@Watch('updateRecordsData')
newspaperListBean: NewspaperListBean = {} as NewspaperListBean
private listScroller: Scroller = new Scroller();
//文字版选择弹框
pageListDialogController: CustomDialogController = new CustomDialogController({
...
...
@@ -114,16 +114,24 @@ export struct ENewspaperListDialog {
.fontSize($r('app.float.font_size_14'))
.fontColor($r('app.color.color_ED2800'))
.fontWeight(600)
.margin({ top: 16, bottom: 16 })
.width('100%')
.textAlign(TextAlign.Start)
.margin({
// top: 16,
bottom: 16
})
.maxLines(1)
}
Column() {
if (positionItem.shortTitle) {
Text(positionItem.shortTitle)
.fontSize($r('app.float.font_size_14'))
.fontColor($r('app.color.color_222222'))
.fontWeight(600)
.maxLines(2)
.margin({
bottom: 8
})
}
if (positionItem.title) {
...
...
@@ -131,7 +139,9 @@ export struct ENewspaperListDialog {
.fontSize($r('app.float.font_size_17'))
.fontColor($r('app.color.color_222222'))
.fontWeight(600)
.margin({ top: 8 })
.margin({
bottom: 8
})
.maxLines(2)
}
...
...
@@ -140,19 +150,23 @@ export struct ENewspaperListDialog {
.fontSize($r('app.float.font_size_14'))
.fontColor($r('app.color.color_222222'))
.fontWeight(600)
.margin({ top: 8 })
.margin({
bottom: 8
})
.maxLines(2)
}
if (positionItem.newsTxt) {
Text(positionItem.newsTxt)
.fontSize($r('app.float.font_size_14'))
.fontColor($r('app.color.color_999999'))
.margin({ top: 15, bottom: 15 })
.margin({
// bottom: 15
})
.maxLines(5)
.textOverflow({ overflow: TextOverflow.Ellipsis })
}
}
.width('100%')
.alignItems(HorizontalAlign.Start)
.onClick(() => {
let taskAction: Action = {
...
...
@@ -172,34 +186,56 @@ export struct ENewspaperListDialog {
// this.listDialogController.close()
// }
})
if (item.items.length != itemIndex + 1) {
Divider()
.strokeWidth(0.5)
.color('#EDEDED')
.padding({
top: 15,
bottom: 15
})
}
}
}
})
}
.divider({
strokeWidth: 0.5,
color: '#EDEDED'
// .divider({
// color: '#EDEDED',
// strokeWidth: 0.5
// })
.padding({
top: 16,
bottom: 16
})
}
})
}
.divider({
color: '#EDEDED',
strokeWidth: 0.5
})
.width('100%')
.padding({ left: 15, right: 15 })
.padding({
left: 15,
right: 15,
top: 16,
bottom: 16
})
.margin({
bottom: 85
})
.scrollBar(BarState.Off)
.divider({
strokeWidth: 0.5,
color: '#EDEDED'
})
.onScrollIndex((firstIndex: number) => {
console.log('firstIndex', firstIndex)
})
.onScrollIndex((firstIndex: number, lastIndex: number, centerIndex: number) => {
console.info('first' + firstIndex)
console.info('last' + lastIndex)
console.info('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
}
this.currentPageNum = `${centerIndex < 9 ? '0' + (centerIndex + 1) : centerIndex + 1}`
})
.onScroll((scrollOffset: number, scrollState: ScrollState) => {
...
...
@@ -222,23 +258,25 @@ export struct ENewspaperListDialog {
})
}
updateCurrentPageNum(firstIndex: number): void {
if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
let index = 0;
for (let itemBean of this.newspaperListBean.list) {
if (itemBean.items && itemBean.items.length > 0) {
for (let item of itemBean.items) {
index++
if (index == firstIndex) {
this.currentPageNum = itemBean.pageNum
return
}
}
}
}
updateRecordsData() {
// if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
// for (let itemBean of this.newspaperListBean.list) {
// index += itemBean.items.length
// this.records.push(index)
// }
// }
}
}
// findClassIndex(index: number): number {
// let ans = 0;
// for (let i = 0; i < this.records.length; i++) {
// if (index >= this.records[i] && index < this.records[i + 1]) {
// ans = i;
// break;
// }
// }
// return ans;
// }
}
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/LiveCountdownComponent.ets
View file @
3b17d01
import font from '@ohos.font'
import { LiveDetailsBean } from 'wdBean/Index'
import { DateTimeUtils, StringUtils } from 'wdKit/Index'
import { DateTimeUtils, StringUtils
, ToastUtils
} from 'wdKit/Index'
import { LiveViewModel } from '../../viewModel/LiveViewModel'
import { HttpUtils } from 'wdNetwork/Index'
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'
...
...
@@ -167,6 +167,11 @@ export struct LiveCountdownComponent {
(data) => {
if (data.success) {
this.isAppointmentLive = !this.isAppointmentLive
if (this.isAppointmentLive) {
ToastUtils.showToast('预约成功', 1000)
} else {
ToastUtils.showToast('取消预约成功', 1000)
}
}
},
() => {
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/TabComponent.ets
View file @
3b17d01
...
...
@@ -34,7 +34,7 @@ export struct TabComponent {
.layoutWeight(1)
.vertical(false)
.barMode(BarMode.Fixed)
.barWidth(
200
)
.barWidth(
70 * this.tabs.length
)
.barHeight(48)
.animationDuration(100)
.onChange((index: number) => {
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/TabLiveComponent.ets
View file @
3b17d01
import { LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index'
import { EmptyComponent, ErrorComponent, ListHasNoMoreDataUI,
WDViewDefaultType } from 'wdComponent/Index'
import { EmptyComponent, ErrorComponent, ListHasNoMoreDataUI, WDViewDefaultType } from 'wdComponent/Index'
import { TabLiveItemComponent } from './TabLiveItemComponent'
import CustomRefreshLoadLayout from 'wdComponent/src/main/ets/components/page/CustomRefreshLoadLayout'
import { RefreshLayoutBean } from 'wdComponent/src/main/ets/components/page/RefreshLayoutBean'
...
...
@@ -109,9 +108,14 @@ export struct TabLiveComponent {
let liveRoomItemBeanTemp: LiveRoomItemBean = {} as LiveRoomItemBean
liveRoomItemBeanTemp.text = this.liveDetailsBean.newIntroduction
liveRoomItemBeanTemp.senderUserName = '人民日报主持人'
liveRoomItemBeanTemp.pictureUrls
=
[]
liveRoomItemBeanTemp.pictureUrls
=
[]
liveRoomItemBeanTemp.pictureUrls.push(this.liveDetailsBean?.fullColumnImgUrls[0]?.url)
liveRoomItemBeanTemp.dataType='ZH_TEXT_AND_IMAGE_MSG'
liveRoomItemBeanTemp.dataType = 'ZH_TEXT_AND_IMAGE_MSG'
let temp = this.liveDetailsBean?.fullColumnImgUrls[0]
if (temp) {
liveRoomItemBeanTemp.pictureResolutions = []
liveRoomItemBeanTemp.pictureResolutions.push(`${temp.height}*${temp.weight}`)
}
this.liveList.push(liveRoomItemBeanTemp)
}
}
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/TabLiveItemComponent.ets
View file @
3b17d01
...
...
@@ -28,7 +28,7 @@ export struct TabLiveItemComponent {
.fontSize('14fp')
.fontWeight(400)
.fontColor('#222222')
Text(
'主持人
')
Text(
this.item.role === 'host' ? '主持人' : '嘉宾
')
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.fontSize('11fp')
...
...
@@ -43,7 +43,7 @@ export struct TabLiveItemComponent {
})
.borderRadius(2)
.margin({ left: 8 })
.visibility(
'host' == this.item.role
? Visibility.Visible : Visibility.None)
.visibility(
StringUtils.isNotEmpty(this.item.role)
? Visibility.Visible : Visibility.None)
Text(DateTimeUtils.getCommentTime(new Date(this.item.time).getTime()))
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
...
...
@@ -85,21 +85,21 @@ export struct TabLiveItemComponent {
List({ space: this.item.pictureUrls.length == 1 ? 0 : 5 }) {
ForEach(this.item.pictureUrls, (itemSub: string, index: number) => {
ListItem() {
if (this.item.pictureUrls.length > 1) {
Image(itemSub)
.width(`${100 / this.item.pictureUrls.length}%`)
.height(this.item.pictureUrls.length > 1 ? 70 : 174)
.height(70)
.objectFit(ImageFit.Auto)
.borderRadius(4)
} else {
Image(itemSub)
.width(`100%`)
// .aspectRatio(this.getAspectRation())
.height(177)
.objectFit(ImageFit.Auto)
.borderRadius(4)
}.onClick(() => {
this.photoList = []
for (let item of this.item.pictureUrls) {
this.photoList.push({
width: 0,
height: 0,
picPath: item,
picDesc: ''
})
}
}.onClick(() => {
this.gotoMultipleListImagePage(index)
})
})
...
...
@@ -147,7 +147,7 @@ export struct TabLiveItemComponent {
.margin({
top: 8,
})
.aspectRatio(
Number.parseFloat(this.item.pictureResolutions[0]?.split('*')[0]) / Number.parseFloat(this.item.pictureResolutions[0]?.split('*')[1]
))
.aspectRatio(
this.getAspectRation(
))
.onClick(() => {
this.gotoVideoPlayPage()
})
...
...
@@ -188,6 +188,15 @@ export struct TabLiveItemComponent {
* @param content
* */
gotoMultipleListImagePage(index: number) {
this.photoList = []
for (let item of this.item.pictureUrls) {
this.photoList.push({
width: 0,
height: 0,
picPath: item,
picDesc: ''
})
}
let taskAction: Action = {
type: 'JUMP_DETAIL_PAGE',
params: {
...
...
@@ -204,4 +213,20 @@ export struct TabLiveItemComponent {
aboutToDisappear(): void {
}
getAspectRation(): number {
try {
if (this.item && this.item.pictureResolutions && this.item.pictureResolutions.length > 0) {
let temp: string[] = this.item.pictureResolutions[0]?.split('*')
if (temp && temp.length == 2) {
let width = Number.parseFloat(this.item.pictureResolutions[0]?.split('*')[0])
let height = Number.parseFloat(this.item.pictureResolutions[0]?.split('*')[1])
return height / width
}
}
} catch (e) {
return 1
}
return 1
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/PlayUIComponent.ets
View file @
3b17d01
...
...
@@ -20,6 +20,9 @@ export struct PlayUIComponent {
@Consume displayDirection: DisplayDirection
onChangeMenuVisible() {
if (!this.liveDetailsBean || !this.liveDetailsBean.liveInfo || this.liveDetailsBean?.liveInfo?.liveState === 'wait') {
return
}
let time: number = 0
if (this.isMenuVisible) {
setTimeout(() => {
...
...
@@ -38,15 +41,16 @@ export struct PlayUIComponent {
this.totalTime = DateFormatUtil.secondToTime(Math.floor(duration / 1000));
this.progressVal = Math.floor(position * 100 / duration);
}
}
build() {
Column() {
if (this.liveDetailsBean && this.liveDetailsBean.liveInfo) {
this.getTopUIComponent()
this.getMiddleUIComponent()
this.getBottomUIComponent()
}
}
.width('100%')
.height('100%')
.alignItems(HorizontalAlign.Start)
...
...
@@ -67,7 +71,7 @@ export struct PlayUIComponent {
this.displayDirection = DisplayDirection.VERTICAL
WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ?
window.Orientation.PORTRAIT :
window.Orientation.LANDSCAPE)
window.Orientation.LANDSCAPE
_INVERTED
)
// devicePLSensorManager.devicePLSensorOn(this.displayDirection == DisplayDirection.VERTICAL ?
// window.Orientation.PORTRAIT :
// window.Orientation.LANDSCAPE);
...
...
@@ -106,15 +110,17 @@ export struct PlayUIComponent {
}
this.getLiveStatusView()
}
}.width('100%')
}
.width('100%')
.padding({
top:
20
,
top:
15
,
bottom: 6,
left: 10,
right: 10
})
.alignItems(HorizontalAlign.Start)
.visibility(this.isMenuVisible ? Visibility.Visible : Visibility.None)
.linearGradient({ angle: 0, colors: [['#00000000', 0], ['#99000000', 1]] })
}
@Builder
...
...
@@ -194,6 +200,9 @@ export struct PlayUIComponent {
.layoutWeight(1)
.width('100%')
.onClick(() => {
if (this.liveDetailsBean?.liveInfo?.liveState === 'wait') {
return
}
this.isMenuVisible = !this.isMenuVisible
})
}
...
...
@@ -233,11 +242,12 @@ export struct PlayUIComponent {
this.displayDirection = this.displayDirection == DisplayDirection.VERTICAL ? DisplayDirection.VIDEO_HORIZONTAL : DisplayDirection.VERTICAL
WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ?
window.Orientation.PORTRAIT :
window.Orientation.LANDSCAPE)
window.Orientation.LANDSCAPE
_INVERTED
)
// devicePLSensorManager.devicePLSensorOn(this.displayDirection == DisplayDirection.VERTICAL ?
// window.Orientation.PORTRAIT :
// window.Orientation.LANDSCAPE);
})
.visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
}
}
.alignItems(VerticalAlign.Center)
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/TopPlayComponet.ets
View file @
3b17d01
...
...
@@ -32,6 +32,7 @@ export struct TopPlayComponent {
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');
}
}
...
...
Please
register
or
login
to post a comment