liyubing

Merge remote-tracking branch 'origin/main'

@@ -51,6 +51,8 @@ export class CompDTO implements BaseDTO { @@ -51,6 +51,8 @@ export class CompDTO implements BaseDTO {
51 51
52 // keyGenerator相关字符串,用于刷新list布局 52 // keyGenerator相关字符串,用于刷新list布局
53 timestamp: String = '1' 53 timestamp: String = '1'
  54 + relId?: String = ''
  55 + relType?: String = ''
54 /** 56 /**
55 * 创建新的compbean对象 57 * 创建新的compbean对象
56 * @param old 58 * @param old
@@ -72,7 +72,7 @@ export struct CompParser { @@ -72,7 +72,7 @@ export struct CompParser {
72 72
73 build() { 73 build() {
74 Column() { 74 Column() {
75 - //Text(JSON.stringify(this.compDTO.compStyle)) 75 + // Text(JSON.stringify(this.compDTO.compStyle))
76 this.componentBuilder(); 76 this.componentBuilder();
77 } 77 }
78 } 78 }
@@ -90,16 +90,18 @@ export struct CompParser { @@ -90,16 +90,18 @@ export struct CompParser {
90 } 90 }
91 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && 91 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 &&
92 this.compDTO.imageScale === 2) { // && compDTO.name ==="横划卡" 92 this.compDTO.imageScale === 2) { // && compDTO.name ==="横划卡"
93 - 93 + // Text('LiveHorizontalCardComponent')
94 LiveHorizontalCardComponent({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) 94 LiveHorizontalCardComponent({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
95 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && this.compDTO.imageScale === 3) { 95 } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && this.compDTO.imageScale === 3) {
96 if (this.compDTO.operDataList.length > 1) { 96 if (this.compDTO.operDataList.length > 1) {
  97 + // Text('HorizontalStrokeCardThreeTwoRadioForMoreComponent')
97 HorizontalStrokeCardThreeTwoRadioForMoreComponent({ 98 HorizontalStrokeCardThreeTwoRadioForMoreComponent({
98 compDTO: this.compDTO, 99 compDTO: this.compDTO,
99 pageId: this.pageId, 100 pageId: this.pageId,
100 pageName: this.pageName 101 pageName: this.pageName
101 }) 102 })
102 } else { 103 } else {
  104 + // Text('HorizontalStrokeCardThreeTwoRadioForOneComponent')
103 HorizontalStrokeCardThreeTwoRadioForOneComponent({ 105 HorizontalStrokeCardThreeTwoRadioForOneComponent({
104 compDTO: this.compDTO, 106 compDTO: this.compDTO,
105 pageId: this.pageId, 107 pageId: this.pageId,
1 -import { Action, H5ReceiveDetailBean, ContentDetailDTO, InteractDataDTO } from 'wdBean'; 1 +import { Action, H5ReceiveDetailBean, ContentDetailDTO, InteractDataDTO, TopicInfo } from 'wdBean';
2 import { WdWebComponent } from 'wdWebComponent'; 2 import { WdWebComponent } from 'wdWebComponent';
3 import { CommonConstants } from 'wdConstant' 3 import { CommonConstants } from 'wdConstant'
4 import { BridgeWebViewControl } from 'wdJsBridge/Index'; 4 import { BridgeWebViewControl } from 'wdJsBridge/Index';
@@ -41,6 +41,8 @@ export struct SpacialTopicPageComponent { @@ -41,6 +41,8 @@ export struct SpacialTopicPageComponent {
41 @State isNetConnected: boolean = true 41 @State isNetConnected: boolean = true
42 @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 42 @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
43 @State showComment: boolean = false 43 @State showComment: boolean = false
  44 + @State topicInfo: TopicInfo = {} as TopicInfo
  45 +
44 private trySendData2H5() { 46 private trySendData2H5() {
45 if (!this.webPrepared || !this.dataPrepared) { 47 if (!this.webPrepared || !this.dataPrepared) {
46 return 48 return
@@ -140,16 +142,22 @@ export struct SpacialTopicPageComponent { @@ -140,16 +142,22 @@ export struct SpacialTopicPageComponent {
140 if(pageInfoMsg && pageInfoMsg.data){ 142 if(pageInfoMsg && pageInfoMsg.data){
141 this.contentDetailData.openComment = Number(pageInfoMsg.data.topicInfo?.commentFlag) 143 this.contentDetailData.openComment = Number(pageInfoMsg.data.topicInfo?.commentFlag)
142 this.contentDetailData.commentDisplay = Number(pageInfoMsg.data.topicInfo?.commentShowFlag) 144 this.contentDetailData.commentDisplay = Number(pageInfoMsg.data.topicInfo?.commentShowFlag)
143 - if(pageInfoMsg.data.topicInfo?.shareOpen === 1){ 145 + console.log('contentDetailData pageInfoMsg.data', JSON.stringify(pageInfoMsg.data))
  146 + this.topicInfo = pageInfoMsg.data.topicInfo
  147 + this.contentDetailData.newsId = Number(this.topicInfo.topicId)
  148 + this.contentDetailData.newsType = this.topicInfo.topicType
  149 + if(this.topicInfo?.shareOpen === 1){
  150 + this.contentDetailData.shareInfo.shareOpen = this.topicInfo?.shareOpen
  151 + console.log('contentDetailData this.topicInfo', JSON.stringify(this.topicInfo))
144 if (!this.operationButtonList.includes('share')) { 152 if (!this.operationButtonList.includes('share')) {
145 this.operationButtonList.push('share'); 153 this.operationButtonList.push('share');
146 } 154 }
147 - }else{ 155 + } else {
148 this.operationButtonList = this.operationButtonList.filter(e =>e !== 'share') 156 this.operationButtonList = this.operationButtonList.filter(e =>e !== 'share')
149 } 157 }
150 } 158 }
151 159
152 - console.log('contentDetailData',this.contentDetailData) 160 + console.log('contentDetailData', JSON.stringify(this.contentDetailData))
153 } 161 }
154 } 162 }
155 } 163 }
@@ -199,6 +207,7 @@ export struct SpacialTopicPageComponent { @@ -199,6 +207,7 @@ export struct SpacialTopicPageComponent {
199 contentDetailData: this.contentDetailData, 207 contentDetailData: this.contentDetailData,
200 publishCommentModel: this.publishCommentModel, 208 publishCommentModel: this.publishCommentModel,
201 operationButtonList: this.operationButtonList, 209 operationButtonList: this.operationButtonList,
  210 + topicInfo: this.topicInfo,
202 styleType: 1, 211 styleType: 1,
203 onCommentIconClick:()=>{ 212 onCommentIconClick:()=>{
204 this.showCommentList = true 213 this.showCommentList = true
@@ -55,7 +55,7 @@ export struct Card14Component { @@ -55,7 +55,7 @@ export struct Card14Component {
55 ) 55 )
56 } 56 }
57 // 左标题,右图 57 // 左标题,右图
58 - Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Start }) { 58 + Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.SpaceBetween }) {
59 59
60 Text() { 60 Text() {
61 if (this.titleMarked) { 61 if (this.titleMarked) {
@@ -106,7 +106,10 @@ export struct CustomPullToRefresh { @@ -106,7 +106,10 @@ export struct CustomPullToRefresh {
106 lottie.destroy(this.refreshingAnimName); 106 lottie.destroy(this.refreshingAnimName);
107 this.refreshAnimation?.removeEventListener('DOMLoaded') 107 this.refreshAnimation?.removeEventListener('DOMLoaded')
108 this.refreshAnimation?.removeEventListener('destroy') 108 this.refreshAnimation?.removeEventListener('destroy')
  109 + this.refreshingAnimation?.removeEventListener('DOMLoaded')
  110 + this.refreshingAnimation?.removeEventListener('destroy')
109 this.refreshAnimation = null 111 this.refreshAnimation = null
  112 + this.refreshingAnimation = null
110 } 113 }
111 114
112 @Builder 115 @Builder
@@ -62,6 +62,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { @@ -62,6 +62,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
62 // return; 62 // return;
63 // } 63 // }
64 if (this.compDTO.linkUrl) { 64 if (this.compDTO.linkUrl) {
  65 + // console.log('HorizontalStrokeCardThreeTwoRadioForMoreComponent', 'JUMP_H5_BY_WEB_VIEW')
65 let taskAction: Action = { 66 let taskAction: Action = {
66 type: 'JUMP_H5_BY_WEB_VIEW', 67 type: 'JUMP_H5_BY_WEB_VIEW',
67 params: { 68 params: {
@@ -70,6 +71,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { @@ -70,6 +71,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
70 }; 71 };
71 WDRouterRule.jumpWithAction(taskAction) 72 WDRouterRule.jumpWithAction(taskAction)
72 } else { 73 } else {
  74 + // console.log('HorizontalStrokeCardThreeTwoRadioForMoreComponent', 'jumpToLiveMorePage')
73 this.jumpToLiveMorePage() 75 this.jumpToLiveMorePage()
74 } 76 }
75 } else { 77 } else {
@@ -81,6 +83,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { @@ -81,6 +83,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
81 linkUrl: this.compDTO.linkUrl, 83 linkUrl: this.compDTO.linkUrl,
82 pageId: this.compDTO.pageId 84 pageId: this.compDTO.pageId
83 } as ContentDTO 85 } as ContentDTO
  86 + // console.log('HorizontalStrokeCardThreeTwoRadioForMoreComponent', 'ProcessUtils.processPage')
84 ProcessUtils.processPage(contentDTO) 87 ProcessUtils.processPage(contentDTO)
85 } 88 }
86 } 89 }
@@ -72,13 +72,26 @@ export struct LiveHorizontalCardComponent { @@ -72,13 +72,26 @@ export struct LiveHorizontalCardComponent {
72 // } 72 // }
73 if (this.compDTO.linkUrl) { 73 if (this.compDTO.linkUrl) {
74 let taskAction: Action = { 74 let taskAction: Action = {
75 - type: 'JUMP_H5_BY_WEB_VIEW', 75 + type: 'JUMP_INNER_NEW_PAGE',
76 params: { 76 params: {
77 - url: this.compDTO.linkUrl 77 + url: this.compDTO.linkUrl,
  78 + pageID: 'SPACIAL_TOPIC_PAGE',
  79 + contentID: this.compDTO.objectId,
  80 + extra: {
  81 + relId: this.compDTO.relId,
  82 + relType: this.compDTO.relType,
  83 + pageId: this.compDTO.pageId
  84 + }
78 } as Params, 85 } as Params,
79 }; 86 };
  87 + this.compDTO.operDataList = []
  88 + console.log('LiveHorizontalCardComponent', JSON.stringify(this.compDTO))
  89 + console.log('LiveHorizontalCardComponent', this.compDTO.relId)
  90 + console.log('LiveHorizontalCardComponent', this.compDTO.relType)
  91 + console.log('LiveHorizontalCardComponent', JSON.stringify(taskAction))
80 WDRouterRule.jumpWithAction(taskAction) 92 WDRouterRule.jumpWithAction(taskAction)
81 } else { 93 } else {
  94 + // console.log('LiveHorizontalCardComponent', 'jumpToLiveMorePage')
82 this.jumpToLiveMorePage() 95 this.jumpToLiveMorePage()
83 } 96 }
84 } else { 97 } else {
@@ -90,6 +103,7 @@ export struct LiveHorizontalCardComponent { @@ -90,6 +103,7 @@ export struct LiveHorizontalCardComponent {
90 linkUrl: this.compDTO.linkUrl, 103 linkUrl: this.compDTO.linkUrl,
91 pageId: this.compDTO.pageId 104 pageId: this.compDTO.pageId
92 } as ContentDTO 105 } as ContentDTO
  106 + // console.log('LiveHorizontalCardComponent', 'ProcessUtils.processPage')
93 ProcessUtils.processPage(contentDTO) 107 ProcessUtils.processPage(contentDTO)
94 } 108 }
95 } 109 }
@@ -6,7 +6,8 @@ import { @@ -6,7 +6,8 @@ import {
6 ContentDetailDTO, 6 ContentDetailDTO,
7 contentListParams, 7 contentListParams,
8 InteractDataDTO, 8 InteractDataDTO,
9 - postExecuteCollectRecordParams 9 + postExecuteCollectRecordParams,
  10 + TopicInfo
10 } from 'wdBean'; 11 } from 'wdBean';
11 import router from '@ohos.router'; 12 import router from '@ohos.router';
12 import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel'; 13 import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel';
@@ -94,6 +95,7 @@ export struct OperRowListView { @@ -94,6 +95,7 @@ export struct OperRowListView {
94 @Consume pageId: string 95 @Consume pageId: string
95 @State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 96 @State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
96 @State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以 97 @State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以
  98 + @Prop topicInfo?: TopicInfo = {} as TopicInfo
97 99
98 async aboutToAppear() { 100 async aboutToAppear() {
99 console.info(TAG, 'this.needLike', this.needLike) 101 console.info(TAG, 'this.needLike', this.needLike)
@@ -416,8 +418,34 @@ export struct OperRowListView { @@ -416,8 +418,34 @@ export struct OperRowListView {
416 } 418 }
417 419
418 share() { 420 share() {
  421 + if (this.topicInfo && Object.keys(this.topicInfo).length > 0) {
  422 + console.info(TAG, 'contentDetailData this.topicInfo', JSON.stringify(this.topicInfo))
  423 + let contentDetailData: ContentDetailDTO = {
  424 + newsId: this.topicInfo?.topicId && Number.parseInt(this.topicInfo.topicId),
  425 + shareInfo:{
  426 + appCustomContentId: this.topicInfo?.topicId,
  427 + appCustomContentType: this.topicInfo?.topicType + '',
  428 + shareTitle: this.topicInfo?.shareTitle,
  429 + shareSummary: this.topicInfo?.shareSummary,
  430 + appCustomImageUrl: this.topicInfo?.shareCoverUrl,
  431 + sharePosterCoverUrl: this.topicInfo?.sharePosterCoverUrl,
  432 + shareUrl: this.topicInfo?.shareUrl,
  433 + appCustomTargetRelId: this.topicInfo?.relId,
  434 + appCustomTargetRelType: this.topicInfo?.relType,
  435 + appCustomShowReport: false,
  436 + appCustomShowLike: -1,
  437 + shareOpen: 1,
  438 + sharePosterOpen: this.topicInfo?.posterFlag,
  439 + appCustomShowPoster: this.topicInfo?.posterFlag && this.topicInfo?.posterFlag > 0 ? 1 : -1,
  440 + }
  441 + } as ContentDetailDTO
  442 + WDShare.setTopicBeanToShareBean(contentDetailData.shareInfo , this.topicInfo)
  443 + WDShare.shareContent(contentDetailData,TrackConstants.PageName.Eletronic_Paper,TrackConstants.PageName.Eletronic_Paper)
  444 + } else {
  445 + console.info(TAG, 'this.contentDetailData')
419 WDShare.shareContent(this.contentDetailData) 446 WDShare.shareContent(this.contentDetailData)
420 } 447 }
  448 + }
421 449
422 // 已登录->查询用户对作品收藏状态 450 // 已登录->查询用户对作品收藏状态
423 private async getInteractDataStatus() { 451 private async getInteractDataStatus() {
@@ -45,10 +45,10 @@ export class WDShare { @@ -45,10 +45,10 @@ export class WDShare {
45 } 45 }
46 46
47 //专题分享数据转换 47 //专题分享数据转换
48 - static setTopicBeanToShareBean(shareBean: ShareInfoDTO, topicInfoBean: TopicInfo){  
49 - shareBean.appCustomTopicType = topicInfoBean.topicType+'' 48 + static setTopicBeanToShareBean(shareBean: ShareInfoDTO, topicInfoBean?: TopicInfo){
  49 + shareBean.appCustomTopicType = topicInfoBean?.topicType+''
50 //21:文章专题,22:音频专题,23:直播专题,24:话题专题,25:早晚报专题,26:时间链 50 //21:文章专题,22:音频专题,23:直播专题,24:话题专题,25:早晚报专题,26:时间链
51 - if(25 == topicInfoBean.topicType){ 51 + if(25 == topicInfoBean?.topicType){
52 shareBean.appCustomShowPosterType = 6 52 shareBean.appCustomShowPosterType = 6
53 shareBean.appCustomTopicPattern = topicInfoBean.topicPattern 53 shareBean.appCustomTopicPattern = topicInfoBean.topicPattern
54 shareBean.appCustomPublishTime = topicInfoBean.topicDate 54 shareBean.appCustomPublishTime = topicInfoBean.topicDate
@@ -76,11 +76,11 @@ export class WDShare { @@ -76,11 +76,11 @@ export class WDShare {
76 //文章/直播/话题专题(H5普通文章专题,包含时间链) 76 //文章/直播/话题专题(H5普通文章专题,包含时间链)
77 shareBean.appCustomShowPosterType = 8 77 shareBean.appCustomShowPosterType = 8
78 //海报的头图 78 //海报的头图
79 - shareBean.sharePosterCoverUrl = topicInfoBean.backgroundImgUrl 79 + shareBean.sharePosterCoverUrl = topicInfoBean?.backgroundImgUrl || ''
80 shareBean.appCustomIsFrontDaily = false 80 shareBean.appCustomIsFrontDaily = false
81 - shareBean.appCustomPosterTitle = topicInfoBean.title  
82 - shareBean.appCustomPosterSummary = topicInfoBean.summary  
83 - if(topicInfoBean.shareContentList != null && topicInfoBean.shareContentList.length>0){ 81 + shareBean.appCustomPosterTitle = topicInfoBean?.title || ''
  82 + shareBean.appCustomPosterSummary = topicInfoBean?.summary || ''
  83 + if(topicInfoBean?.shareContentList != null && topicInfoBean?.shareContentList && topicInfoBean.shareContentList.length > 0){
84 shareBean.appCustomSharePosterItemList = [] as SharePosterItemBean[] 84 shareBean.appCustomSharePosterItemList = [] as SharePosterItemBean[]
85 shareBean.appCustomSharePosterItemList.length = topicInfoBean.shareContentList.length 85 shareBean.appCustomSharePosterItemList.length = topicInfoBean.shareContentList.length
86 for (let index = 0; index < topicInfoBean.shareContentList.length; index++) { 86 for (let index = 0; index < topicInfoBean.shareContentList.length; index++) {