liyubing

Merge remote-tracking branch 'origin/main'

... ... @@ -51,6 +51,8 @@ export class CompDTO implements BaseDTO {
// keyGenerator相关字符串,用于刷新list布局
timestamp: String = '1'
relId?: String = ''
relType?: String = ''
/**
* 创建新的compbean对象
* @param old
... ...
... ... @@ -72,7 +72,7 @@ export struct CompParser {
build() {
Column() {
//Text(JSON.stringify(this.compDTO.compStyle))
// Text(JSON.stringify(this.compDTO.compStyle))
this.componentBuilder();
}
}
... ... @@ -90,16 +90,18 @@ export struct CompParser {
}
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 &&
this.compDTO.imageScale === 2) { // && compDTO.name ==="横划卡"
// Text('LiveHorizontalCardComponent')
LiveHorizontalCardComponent({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && this.compDTO.imageScale === 3) {
if (this.compDTO.operDataList.length > 1) {
// Text('HorizontalStrokeCardThreeTwoRadioForMoreComponent')
HorizontalStrokeCardThreeTwoRadioForMoreComponent({
compDTO: this.compDTO,
pageId: this.pageId,
pageName: this.pageName
})
} else {
// Text('HorizontalStrokeCardThreeTwoRadioForOneComponent')
HorizontalStrokeCardThreeTwoRadioForOneComponent({
compDTO: this.compDTO,
pageId: this.pageId,
... ...
import { Action, H5ReceiveDetailBean, ContentDetailDTO, InteractDataDTO } from 'wdBean';
import { Action, H5ReceiveDetailBean, ContentDetailDTO, InteractDataDTO, TopicInfo } from 'wdBean';
import { WdWebComponent } from 'wdWebComponent';
import { CommonConstants } from 'wdConstant'
import { BridgeWebViewControl } from 'wdJsBridge/Index';
... ... @@ -41,6 +41,8 @@ export struct SpacialTopicPageComponent {
@State isNetConnected: boolean = true
@Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State showComment: boolean = false
@State topicInfo: TopicInfo = {} as TopicInfo
private trySendData2H5() {
if (!this.webPrepared || !this.dataPrepared) {
return
... ... @@ -140,16 +142,22 @@ export struct SpacialTopicPageComponent {
if(pageInfoMsg && pageInfoMsg.data){
this.contentDetailData.openComment = Number(pageInfoMsg.data.topicInfo?.commentFlag)
this.contentDetailData.commentDisplay = Number(pageInfoMsg.data.topicInfo?.commentShowFlag)
if(pageInfoMsg.data.topicInfo?.shareOpen === 1){
console.log('contentDetailData pageInfoMsg.data', JSON.stringify(pageInfoMsg.data))
this.topicInfo = pageInfoMsg.data.topicInfo
this.contentDetailData.newsId = Number(this.topicInfo.topicId)
this.contentDetailData.newsType = this.topicInfo.topicType
if(this.topicInfo?.shareOpen === 1){
this.contentDetailData.shareInfo.shareOpen = this.topicInfo?.shareOpen
console.log('contentDetailData this.topicInfo', JSON.stringify(this.topicInfo))
if (!this.operationButtonList.includes('share')) {
this.operationButtonList.push('share');
}
}else{
} else {
this.operationButtonList = this.operationButtonList.filter(e =>e !== 'share')
}
}
console.log('contentDetailData',this.contentDetailData)
console.log('contentDetailData', JSON.stringify(this.contentDetailData))
}
}
}
... ... @@ -199,6 +207,7 @@ export struct SpacialTopicPageComponent {
contentDetailData: this.contentDetailData,
publishCommentModel: this.publishCommentModel,
operationButtonList: this.operationButtonList,
topicInfo: this.topicInfo,
styleType: 1,
onCommentIconClick:()=>{
this.showCommentList = true
... ...
... ... @@ -55,7 +55,7 @@ export struct Card14Component {
)
}
// 左标题,右图
Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Start }) {
Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.SpaceBetween }) {
Text() {
if (this.titleMarked) {
... ...
... ... @@ -106,7 +106,10 @@ export struct CustomPullToRefresh {
lottie.destroy(this.refreshingAnimName);
this.refreshAnimation?.removeEventListener('DOMLoaded')
this.refreshAnimation?.removeEventListener('destroy')
this.refreshingAnimation?.removeEventListener('DOMLoaded')
this.refreshingAnimation?.removeEventListener('destroy')
this.refreshAnimation = null
this.refreshingAnimation = null
}
@Builder
... ...
... ... @@ -62,6 +62,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
// return;
// }
if (this.compDTO.linkUrl) {
// console.log('HorizontalStrokeCardThreeTwoRadioForMoreComponent', 'JUMP_H5_BY_WEB_VIEW')
let taskAction: Action = {
type: 'JUMP_H5_BY_WEB_VIEW',
params: {
... ... @@ -70,6 +71,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
};
WDRouterRule.jumpWithAction(taskAction)
} else {
// console.log('HorizontalStrokeCardThreeTwoRadioForMoreComponent', 'jumpToLiveMorePage')
this.jumpToLiveMorePage()
}
} else {
... ... @@ -81,6 +83,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
linkUrl: this.compDTO.linkUrl,
pageId: this.compDTO.pageId
} as ContentDTO
// console.log('HorizontalStrokeCardThreeTwoRadioForMoreComponent', 'ProcessUtils.processPage')
ProcessUtils.processPage(contentDTO)
}
}
... ...
... ... @@ -72,13 +72,26 @@ export struct LiveHorizontalCardComponent {
// }
if (this.compDTO.linkUrl) {
let taskAction: Action = {
type: 'JUMP_H5_BY_WEB_VIEW',
type: 'JUMP_INNER_NEW_PAGE',
params: {
url: this.compDTO.linkUrl
url: this.compDTO.linkUrl,
pageID: 'SPACIAL_TOPIC_PAGE',
contentID: this.compDTO.objectId,
extra: {
relId: this.compDTO.relId,
relType: this.compDTO.relType,
pageId: this.compDTO.pageId
}
} as Params,
};
this.compDTO.operDataList = []
console.log('LiveHorizontalCardComponent', JSON.stringify(this.compDTO))
console.log('LiveHorizontalCardComponent', this.compDTO.relId)
console.log('LiveHorizontalCardComponent', this.compDTO.relType)
console.log('LiveHorizontalCardComponent', JSON.stringify(taskAction))
WDRouterRule.jumpWithAction(taskAction)
} else {
// console.log('LiveHorizontalCardComponent', 'jumpToLiveMorePage')
this.jumpToLiveMorePage()
}
} else {
... ... @@ -90,6 +103,7 @@ export struct LiveHorizontalCardComponent {
linkUrl: this.compDTO.linkUrl,
pageId: this.compDTO.pageId
} as ContentDTO
// console.log('LiveHorizontalCardComponent', 'ProcessUtils.processPage')
ProcessUtils.processPage(contentDTO)
}
}
... ...
... ... @@ -6,7 +6,8 @@ import {
ContentDetailDTO,
contentListParams,
InteractDataDTO,
postExecuteCollectRecordParams
postExecuteCollectRecordParams,
TopicInfo
} from 'wdBean';
import router from '@ohos.router';
import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel';
... ... @@ -94,6 +95,7 @@ export struct OperRowListView {
@Consume pageId: string
@State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
@State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以
@Prop topicInfo?: TopicInfo = {} as TopicInfo
async aboutToAppear() {
console.info(TAG, 'this.needLike', this.needLike)
... ... @@ -416,7 +418,33 @@ export struct OperRowListView {
}
share() {
WDShare.shareContent(this.contentDetailData)
if (this.topicInfo && Object.keys(this.topicInfo).length > 0) {
console.info(TAG, 'contentDetailData this.topicInfo', JSON.stringify(this.topicInfo))
let contentDetailData: ContentDetailDTO = {
newsId: this.topicInfo?.topicId && Number.parseInt(this.topicInfo.topicId),
shareInfo:{
appCustomContentId: this.topicInfo?.topicId,
appCustomContentType: this.topicInfo?.topicType + '',
shareTitle: this.topicInfo?.shareTitle,
shareSummary: this.topicInfo?.shareSummary,
appCustomImageUrl: this.topicInfo?.shareCoverUrl,
sharePosterCoverUrl: this.topicInfo?.sharePosterCoverUrl,
shareUrl: this.topicInfo?.shareUrl,
appCustomTargetRelId: this.topicInfo?.relId,
appCustomTargetRelType: this.topicInfo?.relType,
appCustomShowReport: false,
appCustomShowLike: -1,
shareOpen: 1,
sharePosterOpen: this.topicInfo?.posterFlag,
appCustomShowPoster: this.topicInfo?.posterFlag && this.topicInfo?.posterFlag > 0 ? 1 : -1,
}
} as ContentDetailDTO
WDShare.setTopicBeanToShareBean(contentDetailData.shareInfo , this.topicInfo)
WDShare.shareContent(contentDetailData,TrackConstants.PageName.Eletronic_Paper,TrackConstants.PageName.Eletronic_Paper)
} else {
console.info(TAG, 'this.contentDetailData')
WDShare.shareContent(this.contentDetailData)
}
}
// 已登录->查询用户对作品收藏状态
... ...
... ... @@ -45,10 +45,10 @@ export class WDShare {
}
//专题分享数据转换
static setTopicBeanToShareBean(shareBean: ShareInfoDTO, topicInfoBean: TopicInfo){
shareBean.appCustomTopicType = topicInfoBean.topicType+''
static setTopicBeanToShareBean(shareBean: ShareInfoDTO, topicInfoBean?: TopicInfo){
shareBean.appCustomTopicType = topicInfoBean?.topicType+''
//21:文章专题,22:音频专题,23:直播专题,24:话题专题,25:早晚报专题,26:时间链
if(25 == topicInfoBean.topicType){
if(25 == topicInfoBean?.topicType){
shareBean.appCustomShowPosterType = 6
shareBean.appCustomTopicPattern = topicInfoBean.topicPattern
shareBean.appCustomPublishTime = topicInfoBean.topicDate
... ... @@ -76,11 +76,11 @@ export class WDShare {
//文章/直播/话题专题(H5普通文章专题,包含时间链)
shareBean.appCustomShowPosterType = 8
//海报的头图
shareBean.sharePosterCoverUrl = topicInfoBean.backgroundImgUrl
shareBean.sharePosterCoverUrl = topicInfoBean?.backgroundImgUrl || ''
shareBean.appCustomIsFrontDaily = false
shareBean.appCustomPosterTitle = topicInfoBean.title
shareBean.appCustomPosterSummary = topicInfoBean.summary
if(topicInfoBean.shareContentList != null && topicInfoBean.shareContentList.length>0){
shareBean.appCustomPosterTitle = topicInfoBean?.title || ''
shareBean.appCustomPosterSummary = topicInfoBean?.summary || ''
if(topicInfoBean?.shareContentList != null && topicInfoBean?.shareContentList && topicInfoBean.shareContentList.length > 0){
shareBean.appCustomSharePosterItemList = [] as SharePosterItemBean[]
shareBean.appCustomSharePosterItemList.length = topicInfoBean.shareContentList.length
for (let index = 0; index < topicInfoBean.shareContentList.length; index++) {
... ...