wangliang_wd

Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  图文、动态详情页点赞,返回重新进入文章详情页,未展示已点赞状态。
  【验收问题】沉浸式播放,暂停视频后进入作者主页,返回视频详情页时视频继续播放,视频未暂停播放
  fix: 1)无网络进入直播预告和直播列表页,未显示无网络缺省图
  fix(时间轴专题):骨架图顶部适配
... ... @@ -648,7 +648,7 @@ export struct DynamicDetailComponent {
{
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType + '',
contentRelId: this.contentDetailData?.reLInfo?.relId + '',
contentRelId: this.contentDetailData?.reLInfo?.relId || '' + '',
}
]
}
... ...
... ... @@ -95,7 +95,7 @@ export struct ImageAndTextPageComponent {
if (this.contentDetailData?.openLikes && this.contentDetailData?.likesStyle !== 4) {
Row() {
Row() {
if (this.newsStatusOfUser?.likeStatus === '1') {
if (this.newsStatusOfUser?.likeStatus == '1') {
Image(this.contentDetailData?.likesStyle === 1 ? $r('app.media.ic_like_check') :
(this.contentDetailData?.likesStyle === 2 ? $r('app.media.icon_prayer_active') :
$r('app.media.icon_candle_active')))
... ... @@ -112,7 +112,7 @@ export struct ImageAndTextPageComponent {
if (this.likeNum > 0) {
Text(NumberFormatterUtils.formatNumberWithWan(this.likeNum))
.fontSize(16)
.fontColor(this.newsStatusOfUser?.likeStatus === '1' ? '#ED2800' : '#999999')
.fontColor(this.newsStatusOfUser?.likeStatus == '1' ? '#ED2800' : '#999999')
.fontWeight(500)
.margin({ left: 5 })
}
... ... @@ -343,7 +343,7 @@ export struct ImageAndTextPageComponent {
{
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType + '',
contentRelId: this.contentDetailData?.reLInfo?.relId + '',
contentRelId: this.contentDetailData?.reLInfo?.relId || '' + '',
}
]
}
... ... @@ -367,7 +367,7 @@ export struct ImageAndTextPageComponent {
return
}
const params: postExecuteLikeParams = {
status: this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1',
status: this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1',
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType + '',
}
... ... @@ -375,7 +375,7 @@ export struct ImageAndTextPageComponent {
console.log(TAG, '点赞、取消点赞', 'toggleLikeStatus==',)
if (this.newsStatusOfUser) {
//内容点赞、取消点赞Tracking 1点赞 0取消点赞
TrackingContent.like(this.newsStatusOfUser?.likeStatus === '1', TrackConstants.PageName.My, TrackConstants.PageName.My)
TrackingContent.like(this.newsStatusOfUser?.likeStatus == '1', TrackConstants.PageName.My, TrackConstants.PageName.My)
this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1'
this.queryContentInteractCount()
}
... ... @@ -395,6 +395,7 @@ export struct ImageAndTextPageComponent {
}]
}
PageRepository.getContentInteract(params).then(res => {
console.error(TAG, 'res', JSON.stringify(res))
if (res.data) {
this.interactData = res.data[0]
this.likeNum = Number(res.data[0]?.likeNum) || 0
... ...
... ... @@ -17,6 +17,7 @@ import { CommentDialogView } from './CommentDialogView';
const TAG: string = 'SpacialTopicPageComponent'
//专题详情页
@Component
export struct SpacialTopicPageComponent {
webviewControl: BridgeWebViewControl = new BridgeWebViewControl()
... ... @@ -38,6 +39,7 @@ export struct SpacialTopicPageComponent {
@State operationButtonList: string[] = ['comment', 'collect', 'share']
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State isNetConnected: boolean = true
@Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
private trySendData2H5() {
if (!this.webPrepared || !this.dataPrepared) {
... ... @@ -189,7 +191,7 @@ export struct SpacialTopicPageComponent {
}).padding({ bottom: 200 })
} else {
if (!this.isPageEnd) {
detailedSkeleton().padding({ bottom: this.bottomSafeHeight })
detailedSkeleton().padding({ top:`${this.topSafeHeight}px`,bottom: this.bottomSafeHeight })
}
}
//底部交互区
... ...
import { ContentDTO, LiveRoomDataBean } from 'wdBean';
import { ProcessUtils } from 'wdRouter';
import PageViewModel from '../../viewmodel/PageViewModel';
import { DateTimeUtils, LazyDataSource, Logger } from 'wdKit/Index';
import { DateTimeUtils, LazyDataSource, Logger, NetworkUtil } from 'wdKit/Index';
import { router } from '@kit.ArkUI';
import { ViewType } from 'wdConstant/src/main/ets/enum/ViewType';
import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh';
import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData';
import { EmptyComponent } from '../view/EmptyComponent';
import { EmptyComponent, WDViewDefaultType } from '../view/EmptyComponent';
import { ErrorComponent } from '../view/ErrorComponent';
import LoadMoreLayout from '../page/LoadMoreLayout';
import { LottieView } from '../../components/lottie/LottieView';
import dataPreferences from '@ohos.data.preferences';
import { BusinessError } from '@ohos.base';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { channelSkeleton } from '../skeleton/channelSkeleton';
const TAG: string = 'LiveMorePage';
... ... @@ -41,12 +42,13 @@ struct LiveMorePage {
@State private hasMore: boolean = true
@State private currentPage: number = 1
@State private isLoading: boolean = false
@State viewType: ViewType = ViewType.LOADING
private scroller: Scroller = new Scroller()
@State liveRoomList: LiveRoomDataBean[] = []
// 点击过的数据
@State clickDatas: Array<string> = []
@State loadImg: boolean = false;
@State viewType: ViewType = ViewType.LOADING
emptyType: WDViewDefaultType = WDViewDefaultType.WDViewDefaultType_Default
async aboutToAppear(): Promise<void> {
await this.getPreferencesFromStorage()
... ... @@ -63,15 +65,14 @@ struct LiveMorePage {
this.TabbarNormal()
if (this.viewType == ViewType.LOADING) {
this.LoadingLayout()
} else if (this.viewType == ViewType.ERROR) {
ErrorComponent()
.onTouch(() => {
if (this.viewType === ViewType.ERROR) {
this.getData()
}
})
} else if (this.viewType == ViewType.EMPTY) {
EmptyComponent()
} else if (this.viewType == ViewType.EMPTY || this.viewType == ViewType.ERROR) {
EmptyComponent({
emptyType: this.emptyType,
emptyButton: true,
retry: () => {
this.getData()
}
})
} else {
CustomPullToRefresh({
alldata: this.data,
... ... @@ -91,13 +92,15 @@ struct LiveMorePage {
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)
top: px2vp(this.topSafeHeight),
bottom: px2vp(this.bottomSafeHeight)
})
}
@Builder
LoadingLayout() {
channelSkeleton()
}
@Builder
... ... @@ -208,6 +211,7 @@ struct LiveMorePage {
/*导航栏*/
@Builder
TabbarNormal() {
RelativeContainer() {
//标题栏目
Image($r('app.media.icon_arrow_left'))
... ... @@ -223,7 +227,7 @@ struct LiveMorePage {
router.back()
})
Text(this.title)// .height('42lpx')
Text(this.title)
.maxLines(1)
.id("title")
.fontSize('18vp')
... ... @@ -298,6 +302,18 @@ struct LiveMorePage {
}
return
}
// 检测网络
let netStatus = NetworkUtil.isNetConnected()
if (!netStatus) {
this.emptyType = WDViewDefaultType.WDViewDefaultType_NoNetwork
this.viewType = ViewType.ERROR
return
}
this.isLoading = true
try {
const liveReviewDTO = await PageViewModel.getLiveMoreUrl(this.type, this.currentPage, this.pageSize)
... ... @@ -319,17 +335,12 @@ struct LiveMorePage {
this.resolveEnd(true, resolve)
if (liveReviewDTO.list.length == 0 && this.currentPage == 1) {
this.viewType = ViewType.EMPTY
this.emptyType = WDViewDefaultType.WDViewDefaultType_NoListContent
}
} catch (exception) {
this.resolveEnd(false, resolve)
}
// PageViewModel.getLiveMoreUrl(this.type, this.currentPage, this.pageSize).then(async (liveReviewDTO) => {
// // this.operDataList = []
// // this.operDataList.push(...liveReviewDTO.list)
// this.data.push(...liveReviewDTO.list)
//
// // this.getAppointmentInfo()
// })
}
private resolveEnd(isTop: boolean, resolve?: (value: string | PromiseLike<string>) => void) {
... ... @@ -341,7 +352,9 @@ struct LiveMorePage {
}
}
if (this.currentPage == 1 && !isTop) {
this.viewType = ViewType.ERROR
this.emptyType = WDViewDefaultType.WDViewDefaultType_NoListContent
} else {
this.viewType = ViewType.LOADED
}
... ...
import { EmptyComponent } from '../view/EmptyComponent'
@Entry
@Component
export struct DefaultPage {
@State type: number = 15
retry() {
console.log('daj点击了重试')
}
build() {
Row() {
EmptyComponent({
emptyType: this.type,
retry: () => {
this.retry()
}
})
// .height('612lpx')
// .width('100%')
}
}
}
\ No newline at end of file
... ... @@ -96,17 +96,11 @@ export struct EmptyComponent {
}
}
onPageShow(): void {
this.createTimer()
}
aboutToAppear(): void {
this.createTimer()
}
onPageHide(): void {
this.destroyTimer()
}
aboutToDisappear() {
this.destroyTimer()
... ...
... ... @@ -43,6 +43,7 @@ export struct DetailPlayShortVideoPage {
@Consume @Watch("showCommentListChanged") showCommentList: boolean
@Consume displayDirection: DisplayDirection
@Consume @Watch('videoStatusChange') switchVideoStatus: boolean
@State isPlay: boolean = true // 视频手动播放暂停
@Consume @Watch('pageShowChange') pageShow: number
@Consume windowWidth: number
@Consume windowHeight: number
... ... @@ -61,7 +62,7 @@ export struct DetailPlayShortVideoPage {
async pageShowChange() {
if (this.currentIndex === this.index) {
this.queryNewsInfoOfUser()
if (this.switchVideoStatus) {
if (this.switchVideoStatus && this.isPlay) {
await this.playerController.play()
this.imageVisible = false
}
... ... @@ -74,7 +75,7 @@ export struct DetailPlayShortVideoPage {
*/
async videoStatusChange() {
if (this.currentIndex === this.index) {
if (this.switchVideoStatus) {
if (this.switchVideoStatus && this.isPlay) {
await this.playerController.play()
this.imageVisible = false
} else {
... ... @@ -183,14 +184,6 @@ export struct DetailPlayShortVideoPage {
}
if (this.contentDetailData.newsType == 1) {
this.PageName = TrackConstants.PageName.VideoDetail // 点播
} else if (this.contentDetailData.newsType == 2) {
this.PageName = TrackConstants.PageName.Live_Detail // 直播
} else if (this.contentDetailData.newsType == 5) {
this.PageName = TrackConstants.PageName.Summary_Detail // 专题详情页
} else if (this.contentDetailData.newsType == 8) {
this.PageName = TrackConstants.PageName.Article_Detail // 图文详情页
} else if (this.contentDetailData.newsType == 9) {
this.PageName = TrackConstants.PageName.Atlas_Detail // 图集详情页
} else if (this.contentDetailData.newsType == 14 || this.contentDetailData.newsType == 15) {
this.PageName = TrackConstants.PageName.DynamicDetail // 动态图文/动态视频
}
... ... @@ -268,6 +261,13 @@ export struct DetailPlayShortVideoPage {
.layoutWeight(1)
.onClick(() => {
this.playerController?.switchPlayOrPause();
this.playerController.onStatusChange = (status: number) => {
if (status === PlayerConstants.STATUS_PAUSE) {
this.isPlay = false
} else if(status === PlayerConstants.STATUS_START) {
this.isPlay = true
}
}
})
// 显示评论且非全屏模式(视频频道无评论showComment=false)
... ...
... ... @@ -140,8 +140,6 @@ export struct VideoChannelDetail {
// navigationBarColor: '#000000',
// navigationBarContentColor: '#ffffff'
})
// WindowModel.shared.setWindowLayoutFullScreen(true)
// WindowModel.shared.setWindowSystemBarEnable([])
}
/**
... ... @@ -156,8 +154,6 @@ export struct VideoChannelDetail {
// navigationBarContentColor: '#0xE5FFFFFF'
})
// WindowModel.shared.setWindowLayoutFullScreen(false)
// WindowModel.shared.setWindowSystemBarEnable(['status', 'navigation'])
}
onBackPress(): boolean | void {
... ...