xugenyuan

ref |> 处理稿件分享功能暂时调用华为分享组件

@@ -9,6 +9,16 @@ import { commentInfo } from './commentInfo'; @@ -9,6 +9,16 @@ import { commentInfo } from './commentInfo';
9 import { BaseDTO } from '../component/BaseDTO'; 9 import { BaseDTO } from '../component/BaseDTO';
10 import { LiveRoomDataBean } from '../live/LiveRoomDataBean'; 10 import { LiveRoomDataBean } from '../live/LiveRoomDataBean';
11 11
  12 +export class ContentShareInfoDTO {
  13 + shareTitle: string = ''
  14 + shareUrl: string = ''
  15 + shareSummary: string = ''
  16 + shareCoverUrl: string = ''
  17 + sharePosterCoverUrl: string = ''
  18 + shareOpen: number = 0
  19 + sharePosterOpen: number = 0
  20 +}
  21 +
12 @Observed 22 @Observed
13 export class ContentDTO implements BaseDTO { 23 export class ContentDTO implements BaseDTO {
14 seoTags: string = ''; 24 seoTags: string = '';
@@ -70,6 +80,7 @@ export class ContentDTO implements BaseDTO { @@ -70,6 +80,7 @@ export class ContentDTO implements BaseDTO {
70 fullColumnImgUrls: FullColumnImgUrlDTO[] = []; 80 fullColumnImgUrls: FullColumnImgUrlDTO[] = [];
71 liveInfo: LiveInfoDTO = {} as LiveInfoDTO; // 直播新闻信息【BFF聚合】 81 liveInfo: LiveInfoDTO = {} as LiveInfoDTO; // 直播新闻信息【BFF聚合】
72 videoInfo: VideoInfoDTO = {} as VideoInfoDTO; // 视频新闻信息【BFF聚合】,视频非原片+清晰度最高的 82 videoInfo: VideoInfoDTO = {} as VideoInfoDTO; // 视频新闻信息【BFF聚合】,视频非原片+清晰度最高的
  83 + shareInfo: ContentShareInfoDTO = {} as ContentShareInfoDTO
73 84
74 newsSummary: string = ''; //appstyle:2 ,新闻详情 85 newsSummary: string = ''; //appstyle:2 ,新闻详情
75 contentText?: string = ''; 86 contentText?: string = '';
@@ -154,6 +165,7 @@ export class ContentDTO implements BaseDTO { @@ -154,6 +165,7 @@ export class ContentDTO implements BaseDTO {
154 content.fullColumnImgUrls = old.fullColumnImgUrls; 165 content.fullColumnImgUrls = old.fullColumnImgUrls;
155 content.liveInfo = old.liveInfo; 166 content.liveInfo = old.liveInfo;
156 content.videoInfo = old.videoInfo; 167 content.videoInfo = old.videoInfo;
  168 + content.shareInfo = old.shareInfo
157 content.newsSummary = old.newsSummary; 169 content.newsSummary = old.newsSummary;
158 content.interactData = old.interactData; 170 content.interactData = old.interactData;
159 content.hasMore = old.hasMore; 171 content.hasMore = old.hasMore;
@@ -6,6 +6,7 @@ import { ProcessUtils, WDRouterRule } from 'wdRouter'; @@ -6,6 +6,7 @@ import { ProcessUtils, WDRouterRule } from 'wdRouter';
6 import { TrackConstants, 6 import { TrackConstants,
7 TrackingButton, 7 TrackingButton,
8 TrackingContent, TrackingPageBrowse, TrackParamConvert } from 'wdTracking/Index'; 8 TrackingContent, TrackingPageBrowse, TrackParamConvert } from 'wdTracking/Index';
  9 +import { WDShare } from 'wdShare/Index';
9 10
10 const TAG: string = 'CardView'; 11 const TAG: string = 'CardView';
11 12
@@ -588,7 +589,7 @@ export struct PaperSingleColumn999CardView { @@ -588,7 +589,7 @@ export struct PaperSingleColumn999CardView {
588 right: { anchor: '__container__', align: HorizontalAlign.End } 589 right: { anchor: '__container__', align: HorizontalAlign.End }
589 }) 590 })
590 .onClick(() => { 591 .onClick(() => {
591 - ToastUtils.showToast('分享为公共方法,待开发', 1000) 592 + WDShare.shareProgram(this.item)
592 }) 593 })
593 }.width(CommonConstants.FULL_PARENT) 594 }.width(CommonConstants.FULL_PARENT)
594 .justifyContent(FlexAlign.SpaceBetween) 595 .justifyContent(FlexAlign.SpaceBetween)
@@ -296,7 +296,6 @@ export struct LiveOperRowListView { @@ -296,7 +296,6 @@ export struct LiveOperRowListView {
296 .aspectRatio(1) 296 .aspectRatio(1)
297 .interpolation(ImageInterpolation.High) 297 .interpolation(ImageInterpolation.High)
298 .onClick((event: ClickEvent) => { 298 .onClick((event: ClickEvent) => {
299 - // ToastUtils.showToast('分享为公共方法,待开发', 1000);  
300 this.share() 299 this.share()
301 }) 300 })
302 } 301 }
@@ -391,7 +391,6 @@ export struct OperRowListView { @@ -391,7 +391,6 @@ export struct OperRowListView {
391 .aspectRatio(1) 391 .aspectRatio(1)
392 .interpolation(ImageInterpolation.High) 392 .interpolation(ImageInterpolation.High)
393 .onClick((event: ClickEvent) => { 393 .onClick((event: ClickEvent) => {
394 - // ToastUtils.showToast('分享为公共方法,待开发', 1000);  
395 this.share() 394 this.share()
396 }) 395 })
397 } 396 }
@@ -13,6 +13,7 @@ import { HttpUrlUtils } from 'wdNetwork/Index'; @@ -13,6 +13,7 @@ import { HttpUrlUtils } from 'wdNetwork/Index';
13 import { WDPlayerController } from 'wdPlayer/Index'; 13 import { WDPlayerController } from 'wdPlayer/Index';
14 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; 14 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
15 import { SpConstants } from 'wdConstant/Index' 15 import { SpConstants } from 'wdConstant/Index'
  16 +import { WDShare } from 'wdShare/Index';
16 17
17 export interface OperationItem { 18 export interface OperationItem {
18 icon: Resource; 19 icon: Resource;
@@ -282,7 +283,7 @@ export struct OperationListView { @@ -282,7 +283,7 @@ export struct OperationListView {
282 .width(32) 283 .width(32)
283 .aspectRatio(1) 284 .aspectRatio(1)
284 .onClick((event: ClickEvent) => { 285 .onClick((event: ClickEvent) => {
285 - ToastUtils.showToast('分享为公共方法,待开发', 1000); 286 + WDShare.shareContent(this.contentDetailData)
286 }) 287 })
287 Text(item.text) 288 Text(item.text)
288 .width('100%')// .margin({ top: 4, left: 6, right: 6 })// .backgroundColor(Color.Brown) 289 .width('100%')// .margin({ top: 4, left: 6, right: 6 })// .backgroundColor(Color.Brown)
@@ -22,7 +22,18 @@ export class WDShare { @@ -22,7 +22,18 @@ export class WDShare {
22 } 22 }
23 23
24 static shareProgram(program: ContentDTO, pageName: string ="", pageId: string = "") { 24 static shareProgram(program: ContentDTO, pageName: string ="", pageId: string = "") {
  25 + //TODO: 处理分享弹框交互和 海报逻辑
25 26
  27 + WDShareBase.getInstance().share({
  28 + to: ShareType.System,
  29 + scene: ShareScene.System,
  30 + type: ShareContentType.Link,
  31 + obj: {
  32 + title: program.shareInfo.shareTitle,
  33 + desc: program.shareInfo.shareSummary,
  34 + link: program.shareInfo.shareUrl,
  35 + }
  36 + })
26 } 37 }
27 38
28 static shareSubject(subject: PageInfoDTO) { 39 static shareSubject(subject: PageInfoDTO) {