wangliang_wd

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

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  feat: 18447 横滑卡-选择跳转右滑至卡片结尾_查看更多交互效果与安卓不一致且不跳转到配置的页面
  feat:大家聊,聊天图片未展示,见截图
  feat: 18454 小视频横滑卡-选择跳转右滑至卡片结尾_查看更多交互效果与安卓不一致且配置跳专题不该跳外链
import { commentItemModel } from './CommentModel'
/**
* 发布评论
*/
@Observed
export class publishCommentModel {
... ...
... ... @@ -61,10 +61,14 @@ export struct ZhSingleRow02 {
if (this.moreWidth > this.initMoreWidth * 2) {
if (this.compDTO?.objectType === '11') {
ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle)
} else if (this.compDTO?.objectType === '5') {
ProcessUtils._gotoSpecialTopic(this.compDTO.linkUrl)
} else if (this.compDTO?.objectType === '6') {
ProcessUtils._gotoDefaultWeb(this.compDTO.linkUrl)
} else {
const contentDTO: ContentDTO = {
objectId: this.compDTO.objectId,
objectType: this.compDTO.objectType,
linkUrl: this.compDTO.linkUrl,
pageId: this.compDTO.pageId
} as ContentDTO
ProcessUtils.processPage(contentDTO)
}
}
}
... ... @@ -181,10 +185,14 @@ export struct ZhSingleRow02 {
.onClick(() => {
if (this.compDTO?.objectType === '11') {
ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle)
} else if (this.compDTO?.objectType === '5') {
ProcessUtils._gotoSpecialTopic(this.compDTO.linkUrl)
} else if (this.compDTO?.objectType === '6') {
ProcessUtils._gotoDefaultWeb(this.compDTO.linkUrl)
} else {
const contentDTO: ContentDTO = {
objectId: this.compDTO.objectId,
objectType: this.compDTO.objectType,
linkUrl: this.compDTO.linkUrl,
pageId: this.compDTO.pageId
} as ContentDTO
ProcessUtils.processPage(contentDTO)
}
})
}
... ...
... ... @@ -53,14 +53,23 @@ export struct LiveHorizontalCardComponent {
resetEdgeAnimation() {
if (this.moreWidth > this.initMoreWidth) {
this.moreWidth = this.moreWidth - 1
this.resetEdgeAnimation();
this.moreWidth = 16
}
this.resetMoreTips()
}
toMore() {
if (this.moreWidth > this.initMoreWidth * 2) {
this.liveToMore();
}
}
liveToMore() {
if (!!this.compDTO.dataSourceType) {
if (this.compDTO.dataSourceType === 'OBJECT_POS') {
ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle)
return;
}
if (this.compDTO.linkUrl) {
let taskAction: Action = {
type: 'JUMP_H5_BY_WEB_VIEW',
... ... @@ -72,8 +81,19 @@ export struct LiveHorizontalCardComponent {
} else {
this.jumpToLiveMorePage()
}
} else {
if (this.compDTO?.objectType === '11') {
} else {
const contentDTO: ContentDTO = {
objectId: this.compDTO.objectId,
objectType: this.compDTO.objectType,
linkUrl: this.compDTO.linkUrl,
pageId: this.compDTO.pageId
} as ContentDTO
ProcessUtils.processPage(contentDTO)
}
}
}
}
async aboutToAppear(): Promise<void> {
this.loadImg = await onlyWifiLoadImg();
... ... @@ -105,17 +125,7 @@ export struct LiveHorizontalCardComponent {
.height(14)
}
.onClick(() => {
if (this.compDTO.linkUrl) {
let taskAction: Action = {
type: 'JUMP_H5_BY_WEB_VIEW',
params: {
url: this.compDTO.linkUrl
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
} else {
this.jumpToLiveMorePage()
}
this.liveToMore();
})
}
}.justifyContent(FlexAlign.SpaceBetween)
... ... @@ -201,7 +211,6 @@ export struct LiveHorizontalCardComponent {
.onTouch((event?: TouchEvent) => {
if(event) {
if (event.type === TouchType.Up) {
this.toMore();
this.resetEdgeAnimation();
}
}
... ...
... ... @@ -8,6 +8,7 @@ import { DateTimeUtils, Logger, ToastUtils } from 'wdKit/Index';
import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel';
import { PictureLoading } from '../widgets/vertical/PictureLoading';
import { TrackConstants, TrackingButton, TrackingPageBrowse } from 'wdTracking/Index';
import { LiveDetailPageLogic } from '../viewModel/LiveDetailPageLogic';
const TAG = 'DetailPlayLiveCommon'
... ... @@ -24,23 +25,39 @@ const TAG = 'DetailPlayLiveCommon'
export struct DetailPlayLiveCommon {
private liveViewModel: LiveViewModel = new LiveViewModel()
pageShowTime: number = 0;
@Provide relId: string = ''
@Provide contentId: string = ''
@Provide relType: string = ''
// 直播状态
@Provide liveState: string = ''
// 直播样式 0-正常模式,1-隐藏直播 2-隐藏大家聊
@Provide liveStyle: number = -1
// 直播地址
@Provide playUrl: string = ''
@Provide imgUrl: string = ''
// // 直播间背景图
// @Provide imgUrl: string = ''
// 全屏展示
@Provide pageShow: number = -1
// 关闭全屏
@Provide pageHide: number = -1
// 返回功能
@Provide pageBackPress: number = -1
@Provide liveDetailPageLogic :LiveDetailPageLogic = new LiveDetailPageLogic
// 直播详情内容
@Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
//发布评论 Model
@Provide publishCommentModel: publishCommentModel = new publishCommentModel()
// 埋点
@Provide pageId: string = TrackConstants.PageName.Live_Detail
@Provide pageName: string = TrackConstants.PageName.Live_Detail
// 横屏或竖屏 general-竖屏,news-横屏
@State liveLandscape: string = ''
@State isLoading: boolean = false
// 是否隐藏Loading view
@State isHideLoading: boolean = false
async aboutToAppear(): Promise<void> {
const par: Action = router.getParams() as Action;
... ... @@ -55,14 +72,14 @@ export struct DetailPlayLiveCommon {
build() {
Column() {
// 直播预约或横屏直播统一进横屏直播
if (this.liveState === 'wait' || this.liveLandscape === 'news') {
if (this.liveDetailPageLogic.isLangScapeScreenVideo()) {
// 非沉浸式直播
DetailPlayLivePage({ contentId: this.contentId, relId: this.relId, relType: this.relType })
} else if (this.liveLandscape === 'general') {
} else if (this.liveDetailPageLogic.isVerticalScreenVideo()) {
// 沉浸式直播
DetailPlayVLivePage()
} else {
PictureLoading().visibility(this.isLoading ? Visibility.None : Visibility.Visible)
PictureLoading().visibility(this.isHideLoading ? Visibility.None : Visibility.Visible)
}
}
.height('100%')
... ... @@ -93,13 +110,17 @@ export struct DetailPlayLiveCommon {
}
}
this.liveLandscape =
detailData?.liveInfo?.liveLandScape
this.liveState = detailData.liveInfo?.liveState
this.contentDetailData = data[0]
this.liveDetailPageLogic.contentDetailData = this.contentDetailData
this.liveDetailPageLogic.liveLandscape = detailData?.liveInfo?.liveLandScape
this.liveDetailPageLogic.liveState = detailData.liveInfo?.liveState
this.liveDetailPageLogic.resolvingRoomBackgroundImgUrl()
this.publishCommentModel.targetId = String(detailData?.newsId || '')
this.publishCommentModel.targetRelId = String(detailData?.reLInfo?.relId || '')
this.publishCommentModel.targetTitle = detailData?.newsTitle
... ... @@ -110,22 +131,25 @@ export struct DetailPlayLiveCommon {
this.publishCommentModel.visitorComment = String(detailData?.visitorComment || '')
this.publishCommentModel.commentContent = ''
this.liveStyle = detailData.liveInfo?.liveStyle
if (detailData.fullColumnImgUrls && detailData.fullColumnImgUrls.length > 0) {
this.imgUrl = detailData.fullColumnImgUrls[0].url
}
//
// if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.previewUrl &&
// this.contentDetailData.liveInfo.previewUrl.length > 0) {
// this.imgUrl = this.contentDetailData.liveInfo.previewUrl
// } else if (detailData.fullColumnImgUrls && detailData.fullColumnImgUrls.length > 0) {
// this.imgUrl = detailData.fullColumnImgUrls[0].url
// }
if (detailData.liveInfo.liveState == 'end') {
this.playUrl = detailData.liveInfo.vlive[0].replayUri
}
} else {
this.isLoading
this.isHideLoading = true
ToastUtils.shortToast('内容不存在')
router.back()
}
}, () => {
this.isLoading
this.isHideLoading = true
ToastUtils.shortToast('内容不存在')
router.back()
... ...
... ... @@ -8,6 +8,7 @@ import { DisplayDirection } from 'wdConstant/Index';
import { LiveEmptyComponent, WDLiveViewDefaultType } from 'wdComponent/Index';
import { PlayerEndView } from '../widgets/vertical/PlayerEndView';
import { TrackConstants, TrackingButton } from 'wdTracking/Index';
import { LiveDetailPageLogic } from '../viewModel/LiveDetailPageLogic';
const storage = LocalStorage.getShared();
const TAG = 'DetailPlayVLivePage'
... ... @@ -29,12 +30,14 @@ export struct DetailPlayVLivePage {
@Consume liveState: string
@Consume liveStyle: number
@Consume playUrl: string
@Consume imgUrl: string
// @Consume imgUrl: string
@Consume @Watch('openFullScreen') pageShow: number
@Consume @Watch('closeFullScreen') pageHide: number
@Consume contentId: string
@State swiperIndex: number = 1
@Consume liveDetailPageLogic :LiveDetailPageLogic
aboutToAppear(): void {
this.openFullScreen()
this.getLiveRoomData()
... ... @@ -61,7 +64,7 @@ export struct DetailPlayVLivePage {
Stack() {
// 直播背景图,模糊处理
Image(this.imgUrl)
Image(this.liveDetailPageLogic.imgUrl)
.height('100%')
.width('100%')
.blur(100)
... ...
import { ContentDetailDTO } from 'wdBean/Index'
/**
* 直播信息对象逻辑加工处理的工具类
*/
export class LiveDetailPageLogic {
// 直播状态
liveState: string = ''
// 横屏或竖屏 general-竖屏,news-横屏
liveLandscape: string = ''
// 直播样式 0-正常模式,1-隐藏直播 2-隐藏大家聊
liveStyle: number = -1
// 预告片图片/视频url
imgUrl: string = ''
/**
* 直播详情页面,展示的直播信息对象
*/
contentDetailData: ContentDetailDTO = new ContentDetailDTO
/**
* 横屏直播
* @returns true:横屏直播;false:竖屏直播
*/
isLangScapeScreenVideo(): boolean {
return this.liveState === 'wait' || this.liveLandscape === 'news'
}
/**
* 竖屏直播
* @returns
*/
isVerticalScreenVideo(): boolean {
return this.liveLandscape === 'general'
}
/**
* 解析背景图片资源
*/
resolvingRoomBackgroundImgUrl() {
if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.previewUrl &&
this.contentDetailData.liveInfo.previewUrl.length > 0) {
this.imgUrl = this.contentDetailData.liveInfo.previewUrl
} else if (this.contentDetailData.fullColumnImgUrls && this.contentDetailData.fullColumnImgUrls.length > 0) {
this.imgUrl = this.contentDetailData.fullColumnImgUrls[0].url
}
}
}
\ No newline at end of file
... ...
import { ContentDetailDTO, LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index'
import { ContentDetailDTO, LiveRoomItemBean } from 'wdBean/Index'
import { CustomPullToRefresh, EmptyComponent, ErrorComponent, WDViewDefaultType } from 'wdComponent/Index'
import CustomRefreshLoadLayout from 'wdComponent/src/main/ets/components/page/CustomRefreshLoadLayout'
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 { LiveViewModel } from '../../viewModel/LiveViewModel'
import { TabChatItemComponent } from './TabChatItemComponent'
import { EmitterEventId, EmitterUtils, LazyDataSource, Logger } from 'wdKit';
import { EmitterEventId, EmitterUtils, LazyDataSource, Logger } from 'wdKit'
import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel'
import { PeopleShipNoMoreData } from 'wdComponent/src/main/ets/components/reusable/PeopleShipNoMoreData'
import LoadMoreLayout from 'wdComponent/src/main/ets/components/page/LoadMoreLayout'
const TAG: string = 'TabChatComponent';
... ... @@ -23,14 +20,26 @@ export struct TabChatComponent {
@State private pageModel: PageModel = new PageModel()
liveViewModel: LiveViewModel = new LiveViewModel()
@State liveChatList: LazyDataSource<LiveRoomItemBean> = new LazyDataSource();
// @State liveList: LazyDataSource<LiveRoomItemBean> = new LazyDataSource();
@Consume contentDetailData: ContentDetailDTO
@Consume publishCommentModel: publishCommentModel
@Prop @Watch("lastInputedCommentChanged") lastInputedComment: LiveRoomItemBean
private scroller: Scroller = new Scroller()
index: number = 0
@Prop @Watch('updateData') parentComponentIndex: number
private initUI: boolean = true
/**
*
*/
updateData() {
if (this.index === this.parentComponentIndex && this.initUI) {
this.getLiveList()
}
}
aboutToAppear(): void {
this.getLiveList()
//注册通知
EmitterUtils.receiveEvent(EmitterEventId.COMMENT_PUBLISH, async (targetId?: string) => {
... ... @@ -66,7 +75,6 @@ export struct TabChatComponent {
} else if (this.pageModel.viewType == ViewType.EMPTY) {
EmptyComponent({ emptyType: WDViewDefaultType.WDViewDefaultType_NoComment1 })
} else {
// this.ListLayout()
CustomPullToRefresh({
alldata: this.liveChatList,
... ... @@ -79,6 +87,7 @@ export struct TabChatComponent {
this.pageModel.currentPage = 1
this.getLiveList(resolve)
},
})
}
}
... ... @@ -99,24 +108,11 @@ export struct TabChatComponent {
},
(item: LiveRoomItemBean, contentIndex: number) => JSON.stringify(item)
)
// 加载更多
ListItem() {
if (this.pageModel.hasMore && this.liveChatList && this.liveChatList.totalCount() > 0) {
LoadMoreLayout({ isVisible: this.pageModel.hasMore })
} else if (!this.pageModel.hasMore && !this.pageModel.isLoading) {
PeopleShipNoMoreData()
}
}
} .edgeEffect(EdgeEffect.None)
}.edgeEffect(EdgeEffect.None)
.scrollBar(BarState.Off)
.onReachEnd(() => {
Logger.debug(TAG, "触底了");
if (!this.pageModel.isLoading && this.pageModel.hasMore) {
//加载分页数据
//this.currentPage++;
this.getLiveList()
}
})
}
@Builder
... ... @@ -141,7 +137,7 @@ export struct TabChatComponent {
this.liveViewModel.getLiveChatList(
this.pageModel.currentPage,
this.contentDetailData?.liveInfo?.mlive?.mliveId,
String( this.contentDetailData.newsId),
String(this.contentDetailData.newsId),
20,)
.then(
(data) => {
... ... @@ -153,13 +149,21 @@ export struct TabChatComponent {
resolve('')
}
}
if(this.pageModel.currentPage ===1){
if (this.pageModel.currentPage === 1) {
this.liveChatList.clear()
}
Logger.debug(TAG, `${JSON.stringify(data)}`)
if (data.barrageResponses && data.barrageResponses.length > 0) {
this.pageModel.viewType = ViewType.LOADED;
this.liveChatList.push(...data.barrageResponses)
if (this.initUI) {
this.initUI = false
setTimeout(() => {
this.scroller.scrollToIndex(this.liveChatList.totalCount() - 1)
}, 300)
}
if (data.barrageResponses.length === this.pageModel.pageSize) {
this.pageModel.currentPage++;
this.pageModel.hasMore = true;
... ...
... ... @@ -16,37 +16,69 @@ export struct TabChatItemComponent {
build() {
Row() {
Image(StringUtils.isEmpty(this.item.senderUserAvatarUrl) ? $r('app.media.default_head') : this.item.senderUserAvatarUrl)
Image(StringUtils.isEmpty(this.item.senderUserAvatarUrl) ? $r('app.media.default_head') :
this.item.senderUserAvatarUrl)
.borderRadius(90)
.width(24)
.height(24)
Column() {
Row() {
Text() {
Span(this.item.senderUserName + ': ')
.fontColor('#666666')
Span(this.item.text)
.fontColor('#222222')
if (this.item.dataType == 'ZH_IMAGE_MSG') {
Row() {
Text() {
Span(this.item.senderUserName + ': ')
.fontColor('#666666')
}
.margin({ left: 8 })
.lineHeight(20)
.layoutWeight(1)
.fontSize('14fp')
.fontWeight(400)
}
.alignItems(VerticalAlign.Top)
if (this.item.pictureUrls && this.item.pictureUrls.length > 0) {
Image(this.item.pictureUrls[0])
.width(`100%`)
.objectFit(ImageFit.Contain)
.borderRadius(4)
.margin({
top: 10
})
.onClick(() => {
this.gotoMultipleListImagePage(this.item.pictureUrls[0])
})
}
} else {
Row() {
Text() {
Span(this.item.senderUserName + ': ')
.fontColor('#666666')
Span(this.item.text)
.fontColor('#222222')
}
.margin({ left: 8 })
.lineHeight(20)
.layoutWeight(1)
.fontSize('14fp')
.fontWeight(400)
}
.alignItems(VerticalAlign.Top)
if (this.item.dataType == 'ZH_TEXT_AND_IMAGE_MSG' && this.item.pictureUrls &&
this.item.pictureUrls.length > 0) {
Image(this.item.pictureUrls[0])
.width(`100%`)
.objectFit(ImageFit.Contain)
.borderRadius(4)
.margin({
top: 10
})
.onClick(() => {
this.gotoMultipleListImagePage(this.item.pictureUrls[0])
})
}
.margin({ left: 8 })
.lineHeight(20)
.layoutWeight(1)
.fontSize('14fp')
.fontWeight(400)
}
.alignItems(VerticalAlign.Top)
if (this.item.dataType == 'ZH_TEXT_AND_IMAGE_MSG' && this.item.pictureUrls && this.item.pictureUrls.length > 0) {
Image(this.item.pictureUrls[0])
.width(`100%`)
.objectFit(ImageFit.Contain)
.borderRadius(4)
.margin({
top: 10
})
.onClick(() => {
this.gotoMultipleListImagePage(this.item.pictureUrls[0])
})
}
}
.margin({
left: 8,
... ... @@ -75,8 +107,8 @@ export struct TabChatItemComponent {
height: 0,
picPath: imgUrl,
picDesc: '',
itemType:2,
id:0
itemType: 2,
id: 0
})
let taskAction: Action = {
type: 'JUMP_DETAIL_PAGE',
... ...
... ... @@ -11,7 +11,7 @@ export struct TabComponent {
@Prop @Watch('changeToChart') changeToTab: number
@State fontColor: string = '#999999'
@State selectedFontColor: string = '#222222'
@State currentIndex: number = 0
@Prop currentIndex: number = 0
// private controller: TabsController = new TabsController()
private swiperController: SwiperController = new SwiperController()
@Prop tabs: string[] = []
... ... @@ -63,7 +63,11 @@ export struct TabComponent {
} else if ('直播间' === item) {
TabLiveComponent({ lastInputedComment: this.lastInputedLiveComment }).backgroundColor('#F5F5F5')
} else if ('大家聊' === item) {
TabChatComponent({ lastInputedComment: this.lastInputedChatComment }).backgroundColor('#F5F5F5')
TabChatComponent({
lastInputedComment: this.lastInputedChatComment,
index: index,
parentComponentIndex: this.currentIndex
}).backgroundColor('#F5F5F5')
}
}, (item: string, index: number) => {
... ... @@ -74,6 +78,7 @@ export struct TabComponent {
.vertical(false)
.indicator(false)
.loop(false)
.cachedCount(-1)
.alignSelf(ItemAlign.Start)
.effectMode(EdgeEffect.None)
.onChange((index: number) => {
... ...
... ... @@ -25,7 +25,10 @@ export struct TabLiveComponent {
private scroller: Scroller = new Scroller()
@Prop @Watch("lastInputedCommentChanged") lastInputedComment: LiveRoomItemBean
aboutToAppear(): void {
this.getLiveList()
}
... ... @@ -92,7 +95,6 @@ export struct TabLiveComponent {
Logger.debug(TAG, "触底了");
if (!this.pageModel.isLoading && this.pageModel.hasMore) {
//加载分页数据
//this.currentPage++;
this.getLiveList()
}
})
... ...
... ... @@ -39,6 +39,10 @@
{
"name": "location_reason",
"value": " "
},
{
"name": "anchor_leaving",
"value": "主播暂时离开,马上回来"
}
]
}
\ No newline at end of file
... ...