xugenyuan

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

... ... @@ -9,6 +9,16 @@ import { commentInfo } from './commentInfo';
import { BaseDTO } from '../component/BaseDTO';
import { LiveRoomDataBean } from '../live/LiveRoomDataBean';
export class ContentShareInfoDTO {
shareTitle: string = ''
shareUrl: string = ''
shareSummary: string = ''
shareCoverUrl: string = ''
sharePosterCoverUrl: string = ''
shareOpen: number = 0
sharePosterOpen: number = 0
}
@Observed
export class ContentDTO implements BaseDTO {
seoTags: string = '';
... ... @@ -70,6 +80,7 @@ export class ContentDTO implements BaseDTO {
fullColumnImgUrls: FullColumnImgUrlDTO[] = [];
liveInfo: LiveInfoDTO = {} as LiveInfoDTO; // 直播新闻信息【BFF聚合】
videoInfo: VideoInfoDTO = {} as VideoInfoDTO; // 视频新闻信息【BFF聚合】,视频非原片+清晰度最高的
shareInfo: ContentShareInfoDTO = {} as ContentShareInfoDTO
newsSummary: string = ''; //appstyle:2 ,新闻详情
contentText?: string = '';
... ... @@ -154,6 +165,7 @@ export class ContentDTO implements BaseDTO {
content.fullColumnImgUrls = old.fullColumnImgUrls;
content.liveInfo = old.liveInfo;
content.videoInfo = old.videoInfo;
content.shareInfo = old.shareInfo
content.newsSummary = old.newsSummary;
content.interactData = old.interactData;
content.hasMore = old.hasMore;
... ...
... ... @@ -6,6 +6,7 @@ import { ProcessUtils, WDRouterRule } from 'wdRouter';
import { TrackConstants,
TrackingButton,
TrackingContent, TrackingPageBrowse, TrackParamConvert } from 'wdTracking/Index';
import { WDShare } from 'wdShare/Index';
const TAG: string = 'CardView';
... ... @@ -588,7 +589,7 @@ export struct PaperSingleColumn999CardView {
right: { anchor: '__container__', align: HorizontalAlign.End }
})
.onClick(() => {
ToastUtils.showToast('分享为公共方法,待开发', 1000)
WDShare.shareProgram(this.item)
})
}.width(CommonConstants.FULL_PARENT)
.justifyContent(FlexAlign.SpaceBetween)
... ...
... ... @@ -296,7 +296,6 @@ export struct LiveOperRowListView {
.aspectRatio(1)
.interpolation(ImageInterpolation.High)
.onClick((event: ClickEvent) => {
// ToastUtils.showToast('分享为公共方法,待开发', 1000);
this.share()
})
}
... ...
... ... @@ -391,7 +391,6 @@ export struct OperRowListView {
.aspectRatio(1)
.interpolation(ImageInterpolation.High)
.onClick((event: ClickEvent) => {
// ToastUtils.showToast('分享为公共方法,待开发', 1000);
this.share()
})
}
... ...
... ... @@ -13,6 +13,7 @@ import { HttpUrlUtils } from 'wdNetwork/Index';
import { WDPlayerController } from 'wdPlayer/Index';
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import { SpConstants } from 'wdConstant/Index'
import { WDShare } from 'wdShare/Index';
export interface OperationItem {
icon: Resource;
... ... @@ -282,7 +283,7 @@ export struct OperationListView {
.width(32)
.aspectRatio(1)
.onClick((event: ClickEvent) => {
ToastUtils.showToast('分享为公共方法,待开发', 1000);
WDShare.shareContent(this.contentDetailData)
})
Text(item.text)
.width('100%')// .margin({ top: 4, left: 6, right: 6 })// .backgroundColor(Color.Brown)
... ...
... ... @@ -22,7 +22,18 @@ export class WDShare {
}
static shareProgram(program: ContentDTO, pageName: string ="", pageId: string = "") {
//TODO: 处理分享弹框交互和 海报逻辑
WDShareBase.getInstance().share({
to: ShareType.System,
scene: ShareScene.System,
type: ShareContentType.Link,
obj: {
title: program.shareInfo.shareTitle,
desc: program.shareInfo.shareSummary,
link: program.shareInfo.shareUrl,
}
})
}
static shareSubject(subject: PageInfoDTO) {
... ...