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-19 19:59:18 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
da741f3839564c975fd90495a2901de6863efa82
da741f38
1 parent
ca058302
fix:1)直播详情修改优化
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
216 additions
and
56 deletions
sight_harmony/commons/wdRouter/src/main/ets/router/Action2Page.ets
sight_harmony/commons/wdRouter/src/main/ets/router/WDRouterPage.ets
sight_harmony/features/wdBean/src/main/ets/bean/component/extra/ExtraDTO.ts
sight_harmony/features/wdBean/src/main/ets/bean/content/Params.ts
sight_harmony/features/wdComponent/src/main/ets/components/view/EmptyComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/ImageItemView.ets
sight_harmony/features/wdComponent/src/main/ets/pages/MultiPictureListPage.ets
sight_harmony/features/wdComponent/src/main/resources/base/profile/main_pages.json
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLivePage.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/LiveCountdownComponent.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/TabChatComponent.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/TopPlayComponet.ets
sight_harmony/commons/wdRouter/src/main/ets/router/Action2Page.ets
View file @
da741f3
...
...
@@ -67,6 +67,8 @@ export function registerRouter() {
return WDRouterPage.multiPictureDetailPage
} else if (action.params?.detailPageType == 13) {
return WDRouterPage.audioDetail
} else if (action.params?.detailPageType == 18) {
return WDRouterPage.multiPictureListPage
}
return WDRouterPage.detailPlayVodPage
})
...
...
sight_harmony/commons/wdRouter/src/main/ets/router/WDRouterPage.ets
View file @
da741f3
...
...
@@ -56,6 +56,8 @@ export class WDRouterPage {
static detailPlayVLivePage = new WDRouterPage("wdDetailPlayLive", "ets/pages/DetailPlayVLivePage");
// 多图(图集)详情页
static multiPictureDetailPage = new WDRouterPage("phone", "ets/pages/detail/MultiPictureDetailPage");
//大图列表页
static multiPictureListPage = new WDRouterPage("wdComponent", "ets/pages/MultiPictureListPage");
// 音乐详情页
static audioDetail = new WDRouterPage("phone", "ets/pages/detail/AudioDetail");
// 动态详情页
...
...
sight_harmony/features/wdBean/src/main/ets/bean/component/extra/ExtraDTO.ts
View file @
da741f3
import
{
LabelDTO
}
from
'./LabelDTO'
;
import
{
ItemDTO
}
from
'../../ItemDTO'
;
import
{
PhotoListBean
}
from
'../../detail/MultiPictureDetailPageDTO'
;
// 附加字段集合,不同组件,额外附加参数不同
export
interface
ExtraDTO
extends
ItemDTO
{
...
...
@@ -12,5 +13,6 @@ export interface ExtraDTO extends ItemDTO {
sourcePage
:
string
;
relId
:
string
;
relType
:
string
;
liveStreamType
?:
number
liveStreamType
?:
number
;
photoList
:
PhotoListBean
[];
}
\ No newline at end of file
...
...
sight_harmony/features/wdBean/src/main/ets/bean/content/Params.ts
View file @
da741f3
...
...
@@ -18,6 +18,7 @@ export interface Params {
// 8.专辑竖屏详情页
// 13.音频详情页
// 17.多图(图集)详情页
// 18.大图列表页
detailPageType
?:
number
;
// 详情页类型
liveStyle
?:
number
;
// 直播类型:0横屏,1竖屏
creatorId
?:
string
;
//号主id
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/EmptyComponent.ets
View file @
da741f3
...
...
@@ -170,7 +170,7 @@ export struct EmptyComponent {
imageString = $r('app.media.icon_no_end')
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoVideo) {
imageString = $r('app.media.icon_no_content')
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_No
Video
) {
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_No
Content1
) {
imageString = $r('app.media.icon_no_appointmentMade')
}
return imageString
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/ImageItemView.ets
View file @
da741f3
...
...
@@ -12,7 +12,7 @@ import { http } from '@kit.NetworkKit';
@Reusable
@Component
export struct ImageItemView {
@Consume private bgc: Color;
//
@Consume private bgc: Color;
@Link isEnableSwipe: boolean; // TODO:需求:多图切换
@State isEnableOffset: boolean = false;
@State imageScaleInfo: ScaleModel = new ScaleModel(1.0, 1.0, 1.5, 0.3);
...
...
sight_harmony/features/wdComponent/src/main/ets/pages/MultiPictureListPage.ets
0 → 100644
View file @
da741f3
import { PhotoListBean } from 'wdBean/Index';
import { display, router } from '@kit.ArkUI';
import { Logger } from 'wdKit/Index';
import { ImageItemView } from '../components/view/ImageItemView';
import { ImageDownloadComponent } from '../components/ImageDownloadComponent';
import { Action } from 'wdBean';
const TAG = 'MultiPictureListPage';
@Entry
@Component
export struct MultiPictureListPage {
@Provide @Watch('onCurrentPageNumUpdated') currentPageNum: string = '01'
private scroller: Scroller = new Scroller()
@State swiperIndex: number = 0;
photoList: PhotoListBean[] = [];
private swiperController: SwiperController = new SwiperController()
private displayTool = display.getDefaultDisplaySync()
private screenWidth: number = 0
private picWidth: number = 0
@State picHeight: number = 0
@State isEnableSwipe: boolean = true;
// @Provide bgc: Color = Color.White;
//watch监听页码回调
onCurrentPageNumUpdated(): void {
Logger.info(TAG, `currentPageNum:${this.currentPageNum}`,)
let _swiperIndex = Number.parseInt(this.currentPageNum)
Logger.info(TAG, `_swiperIndex:${_swiperIndex}`)
this.swiperIndex = _swiperIndex > 0 ? _swiperIndex - 1 : _swiperIndex
}
aboutToAppear(): void {
//获取宽高尺寸
this.screenWidth = this.displayTool.width
// this.picWidth = this.screenWidth - vp2px(52)
this.picWidth = this.screenWidth
this.picHeight = this.picWidth * 578 / 375
let par: Action = router.getParams() as Action;
let params = par?.params;
this.photoList = params?.extra?.photoList || [];
}
build() {
RelativeContainer() {
Image($r('app.media.icon_arrow_left_white'))
.width(24)
.height(24)
.aspectRatio(1)
.interpolation(ImageInterpolation.High)
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})
.onClick(() => {
router.back();
})
.id("backImg")
if (this.photoList && this.photoList?.length > 0) {
Swiper(this.swiperController) {
ForEach(this.photoList, (item: PhotoListBean) => {
// MultiPictureDetailItemComponent({ MultiPictureDetailItem: item })
ImageItemView({ MultiPictureDetailItem: item, isEnableSwipe: this.isEnableSwipe })
})
}
.index(this.swiperIndex)
.width('100%')
.height(px2vp(this.picHeight) + 32)
.vertical(false)
.autoPlay(false)
.cachedCount(3)
.indicator(false)
.displayCount(1)
.id('e_swiper_content')
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.onChange((index: number) => {
this.swiperIndex = index
})
Row() {
Scroll(this.scroller) {
Row() {
Flex({
direction: FlexDirection.Column,
justifyContent: FlexAlign.Start
}) {
Text() {
Span(`${this.swiperIndex + 1}`)
.fontSize(24)
.fontFamily('PingFang SC-Medium')
.fontWeight(500)
.lineHeight(28)
Span(`/${this.photoList.length}`)
.fontSize(14)
.fontFamily('PingFang SC-Medium')
.fontWeight(500)
.lineHeight(19)
}.fontColor(Color.White).margin(4)
}
}
.width('100%')
.margin({
top: 8,
left: 18,
bottom: 24,
right: 18
})
}
.scrollable(ScrollDirection.Vertical)
.scrollBarWidth(0)
}
.id('e_swiper_titles')
.alignRules({
bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
}
ImageDownloadComponent({ url: this.photoList[this.swiperIndex].picPath })
.alignRules({
bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
right: { anchor: "__container__", align: HorizontalAlign.End }
})
.margin({
top: 8,
left: 18,
bottom: 24,
right: 18
})
.id("downloadImg")
}
.width('100%')
.height('100%')
.backgroundColor(Color.Black)
.id('e_picture_container')
// 设置顶部绘制延伸到状态栏
// 设置底部绘制延伸到导航条
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/resources/base/profile/main_pages.json
View file @
da741f3
...
...
@@ -16,6 +16,7 @@
"pages/OtherNormalUserHomePage"
,
"pages/SearchPage"
,
"pages/SearchCreatorPage"
,
"components/page/PeopleShipHomePage"
"components/page/PeopleShipHomePage"
,
"pages/MultiPictureListPage"
]
}
\ No newline at end of file
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLivePage.ets
View file @
da741f3
...
...
@@ -22,7 +22,7 @@ export struct DetailPlayLivePage {
@State relType: string = ''
@Provide liveDetailsBean: LiveDetailsBean = {} as LiveDetailsBean
@Provide liveRoomDataBean: LiveRoomDataBean = {} as LiveRoomDataBean
@State tabs: string[] = [
'直播间', '大家聊'
]
@State tabs: string[] = []
aboutToAppear(): void {
//监听屏幕横竖屏变化
...
...
@@ -75,6 +75,8 @@ export struct DetailPlayLivePage {
if (data.length > 0) {
if (data[0].liveInfo?.liveState == 'wait') {
this.tabs = ['简介', '直播间', '大家聊']
} else {
this.tabs = ['直播间', '大家聊']
}
this.liveDetailsBean = data[0]
}
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/LiveCountdownComponent.ets
View file @
da741f3
...
...
@@ -127,11 +127,8 @@ export struct LiveCountdownComponent {
}
updateData() {
if (!this.liveDetailsBean) {
return
}
this.getLiveAppointmentStatus()
let startTimeStamp: number = DateTimeUtils.getDateTimestamp(this.liveDetailsBean.liveInfo.planStartTime)
let startTimeStamp: number = DateTimeUtils.getDateTimestamp(this.liveDetailsBean.liveInfo
?
.planStartTime)
let currentTimeStamp: number = DateTimeUtils.getTimeStamp()
let _differenceTimeStampTmp = startTimeStamp - currentTimeStamp
this.isCountDownStart = _differenceTimeStampTmp <= 0 ? false : _differenceTimeStampTmp <= 4 * 60 * 60 * 1000
...
...
@@ -140,8 +137,8 @@ export struct LiveCountdownComponent {
return
}
//2024-04-01 19:44:00-trim->2024-04-0119:44:00
if (StringUtils.isNotEmpty(this.liveDetailsBean.liveInfo.planStartTime)) {
let playStartTimeTmp = this.liveDetailsBean.liveInfo.planStartTime.trim()
if (StringUtils.isNotEmpty(this.liveDetailsBean.liveInfo?.planStartTime)) {
let playStartTimeTmp = this.liveDetailsBean.liveInfo?.planStartTime?.trim()
this.month = playStartTimeTmp.substring(5, 7)
this.day = playStartTimeTmp.substring(8, 10)
this.hour = playStartTimeTmp.substring(11, 13)
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/TabChatComponent.ets
View file @
da741f3
import { LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index'
import { EmptyComponent, ErrorComponent, ListHasNoMoreDataUI,WDViewDefaultType } from 'wdComponent/Index'
import { EmptyComponent, ErrorComponent, ListHasNoMoreDataUI,
WDViewDefaultType } from 'wdComponent/Index'
import CustomRefreshLoadLayout from 'wdComponent/src/main/ets/components/page/CustomRefreshLoadLayout'
import LoadMoreLayout from 'wdComponent/src/main/ets/components/page/LoadMoreLayout'
import RefreshLayout from 'wdComponent/src/main/ets/components/page/RefreshLayout'
import { RefreshLayoutBean } from 'wdComponent/src/main/ets/components/page/RefreshLayoutBean'
import PageModel from 'wdComponent/src/main/ets/viewmodel/PageModel'
import { ViewType } from 'wdConstant/Index'
import { Logger } from 'wdKit/Index'
import { LiveViewModel } from '../../viewModel/LiveViewModel'
import { TabChatItemComponent } from './TabChatItemComponent'
...
...
@@ -27,7 +28,7 @@ export struct TabChatComponent {
} else if (this.pageModel.viewType == ViewType.ERROR) {
ErrorComponent()
} else if (this.pageModel.viewType == ViewType.EMPTY) {
EmptyComponent()
EmptyComponent(
{ emptyType: WDViewDefaultType.WDViewDefaultType_NoContent1 }
)
} else {
this.ListLayout()
}
...
...
@@ -55,16 +56,16 @@ export struct TabChatComponent {
}
})
// 加载更多
ListItem() {
if (this.pageModel.hasMore) {
LoadMoreLayout({
refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage,
this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight)
})
} else {
ListHasNoMoreDataUI()
}
}
// ListItem() {
// if (this.pageModel.hasMore) {
// LoadMoreLayout({
// refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage,
// this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight)
// })
// } else {
// ListHasNoMoreDataUI()
// }
// }
}
}
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/TabComponent.ets
View file @
da741f3
...
...
@@ -18,22 +18,13 @@ export struct TabComponent {
Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) {
ForEach(this.tabs, (item: string, index: number) => {
TabContent() {
if (this.tabs.length == 3) {
if (0 == index) {
if ('简介' === item) {
TabInfoComponent()
} else if (1 == index
) {
} else if ('直播间' === item
) {
TabLiveComponent()
} else
{
} else if ('大家聊' === item)
{
TabChatComponent()
}
}
else {
if (0 == index) {
TabLiveComponent()
} else {
TabChatComponent()
}
}
}.tabBar(this.tabBuilder(index, item))
.backgroundColor('#F5F5F5')
}, (item: string, index: number) => {
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/TabLiveComponent.ets
View file @
da741f3
import { LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index'
import { EmptyComponent, ErrorComponent, ListHasNoMoreDataUI } from 'wdComponent/Index'
import { StringUtils } from 'wdKit/Index'
import { EmptyComponent, ErrorComponent, ListHasNoMoreDataUI, WDViewDefaultType } from 'wdComponent/Index'
import { LiveViewModel } from '../../viewModel/LiveViewModel'
import { TabLiveItemComponent } from './TabLiveItemComponent'
import CustomRefreshLoadLayout from 'wdComponent/src/main/ets/components/page/CustomRefreshLoadLayout'
...
...
@@ -14,15 +13,11 @@ import RefreshLayout from 'wdComponent/src/main/ets/components/page/RefreshLayou
export struct TabLiveComponent {
liveViewModel: LiveViewModel = new LiveViewModel()
@State liveList: Array<LiveRoomItemBean> = []
@Consume
@Watch('updateDate')
liveDetailsBean: LiveDetailsBean
@Consume liveDetailsBean: LiveDetailsBean
@State private pageModel: PageModel = new PageModel()
updateDate() {
this.getLiveList()
}
aboutToAppear(): void {
this.getLiveList()
}
build() {
...
...
@@ -32,7 +27,7 @@ export struct TabLiveComponent {
} else if (this.pageModel.viewType == ViewType.ERROR) {
ErrorComponent()
} else if (this.pageModel.viewType == ViewType.EMPTY) {
EmptyComponent()
EmptyComponent(
{ emptyType: WDViewDefaultType.WDViewDefaultType_NoContent1 }
)
} else {
this.ListLayout()
}
...
...
@@ -99,15 +94,15 @@ export struct TabLiveComponent {
2.名称固定:人民日报主持人
3.内容:详情接口的简介,newIntroduction
*/
if (StringUtils.isNotEmpty(this.liveDetailsBean.oldNewsId)
&& this.liveDetailsBean
&& this.liveDetailsBean.liveInfo.liveState != 'wait'
&& this.pageModel.currentPage == 1) {
let liveRoomItemBeanTemp: LiveRoomItemBean = {} as LiveRoomItemBean
liveRoomItemBeanTemp.text = this.liveDetailsBean.newIntroduction
liveRoomItemBeanTemp.senderUserName = '人民日报主持人'
data.barrageResponses.push(liveRoomItemBeanTemp)
}
// if (StringUtils.isNotEmpty(this.liveDetailsBean.oldNewsId)
// && this.liveDetailsBean
// && this.liveDetailsBean.liveInfo.liveState != 'wait'
// && this.pageModel.currentPage == 1) {
// let liveRoomItemBeanTemp: LiveRoomItemBean = {} as LiveRoomItemBean
// liveRoomItemBeanTemp.text = this.liveDetailsBean.newIntroduction
// liveRoomItemBeanTemp.senderUserName = '人民日报主持人'
// data.barrageResponses.push(liveRoomItemBeanTemp)
// }
this.pageModel.viewType = ViewType.LOADED;
this.liveList.push(...data.barrageResponses)
if (data.barrageResponses.length === this.pageModel.pageSize) {
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/TabLiveItemComponent.ets
View file @
da741f3
import { LiveRoomItemBean, PhotoListBean } from 'wdBean/Index'
import { DateTimeUtils, StringUtils } from 'wdKit/Index'
import { LiveRoomItemBean, PhotoListBean, } from 'wdBean/Index';
import { DateTimeUtils, StringUtils } from 'wdKit/Index';
import { Action, Params } from 'wdBean';
import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO';
import { WDRouterRule } from 'wdRouter/Index';
@Component
export struct TabLiveItemComponent {
...
...
@@ -96,6 +99,7 @@ export struct TabLiveItemComponent {
picDesc: ''
})
}
this.gotoMultipleListImagePage()
})
})
}.margin({
...
...
@@ -112,4 +116,21 @@ export struct TabLiveItemComponent {
aboutToDisappear(): void {
}
/**
* 大图列表页
* @param content
* */
gotoMultipleListImagePage() {
let taskAction: Action = {
type: 'JUMP_DETAIL_PAGE',
params: {
detailPageType: 18,
extra: {
photoList: this.photoList
} as ExtraDTO
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/TopPlayComponet.ets
View file @
da741f3
...
...
@@ -21,7 +21,7 @@ export struct TopPlayComponent {
this.imgUrl = this.liveDetailsBean.fullColumnImgUrls[0].url
}
this.isWait = this.liveDetailsBean?.liveInfo?.liveState == 'wait'
if (this.liveDetailsBean.liveInfo && this.liveDetailsBean.liveInfo.vlive.length > 0) {
if (
!this.isWait &&
this.liveDetailsBean.liveInfo && this.liveDetailsBean.liveInfo.vlive.length > 0) {
let playUrl = ''
if (this.liveDetailsBean.liveInfo.liveState == 'running') {
playUrl = this.liveDetailsBean.liveInfo.vlive[0].liveUrl
...
...
Please
register
or
login
to post a comment