Showing
2 changed files
with
28 additions
and
20 deletions
| @@ -35,10 +35,12 @@ export struct PlayerFullScreenView { | @@ -35,10 +35,12 @@ export struct PlayerFullScreenView { | ||
| 35 | 35 | ||
| 36 | share() { | 36 | share() { |
| 37 | this.playerController?.switchPlayOrPause() | 37 | this.playerController?.switchPlayOrPause() |
| 38 | - WDShare.shareContent(this.contentDetailData) | ||
| 39 | - // WDShare.shareContent(this.contentDetailData).then(() => { | ||
| 40 | - // this.playerController?.switchPlayOrPause() | ||
| 41 | - // }) | 38 | + WDShare.shareContent(this.contentDetailData).then((res) => { |
| 39 | + // console.log(TAG, "分享弹框关闭", res); | ||
| 40 | + if(res == 'dismiss') { | ||
| 41 | + this.playerController?.switchPlayOrPause() | ||
| 42 | + } | ||
| 43 | + }) | ||
| 42 | } | 44 | } |
| 43 | 45 | ||
| 44 | updateProgress() { | 46 | updateProgress() { |
| @@ -9,22 +9,28 @@ import { AppInnerLinkGenerator } from 'wdRouter'; | @@ -9,22 +9,28 @@ import { AppInnerLinkGenerator } from 'wdRouter'; | ||
| 9 | 9 | ||
| 10 | export class WDShare { | 10 | export class WDShare { |
| 11 | 11 | ||
| 12 | - static shareContent(content: ContentDetailDTO, pageName: string ="", pageId: string = "") { | ||
| 13 | - | ||
| 14 | - //TODO: 处理分享弹框交互和 海报逻辑 | ||
| 15 | - | ||
| 16 | - WDShareBase.getInstance().share({ | ||
| 17 | - to: ShareType.System, | ||
| 18 | - scene: ShareScene.System, | ||
| 19 | - type: ShareContentType.Link, | ||
| 20 | - obj: { | ||
| 21 | - title: content.shareInfo.shareTitle, | ||
| 22 | - desc: content.shareInfo.shareSummary, | ||
| 23 | - link: content.shareInfo.shareUrl, | ||
| 24 | - deeplink:AppInnerLinkGenerator.generateDeepLinkWithConent(content), | ||
| 25 | - posterImg:$r("app.media.test_share_poster"), | ||
| 26 | - } | ||
| 27 | - }) | 12 | + static shareContent(content: ContentDetailDTO, pageName: string = "", pageId: string = ""): Promise<string> { |
| 13 | + return new Promise((resolve, reject) => { | ||
| 14 | + // 处理分享弹框交互和海报逻辑 | ||
| 15 | + WDShareBase.getInstance().share({ | ||
| 16 | + to: ShareType.System, | ||
| 17 | + scene: ShareScene.System, | ||
| 18 | + type: ShareContentType.Link, | ||
| 19 | + obj: { | ||
| 20 | + title: content.shareInfo.shareTitle, | ||
| 21 | + desc: content.shareInfo.shareSummary, | ||
| 22 | + link: content.shareInfo.shareUrl, | ||
| 23 | + deeplink: AppInnerLinkGenerator.generateDeepLinkWithConent(content), | ||
| 24 | + posterImg: $r("app.media.test_share_poster"), | ||
| 25 | + } | ||
| 26 | + })?.then((res) => { | ||
| 27 | + // console.log("分享成功", res); | ||
| 28 | + resolve(res); | ||
| 29 | + }).catch((() => { | ||
| 30 | + // console.error("分享失败"); | ||
| 31 | + reject("error"); | ||
| 32 | + })) | ||
| 33 | + }); | ||
| 28 | } | 34 | } |
| 29 | 35 | ||
| 30 | static shareProgram(program: ContentDTO, pageName: string ="", pageId: string = "") { | 36 | static shareProgram(program: ContentDTO, pageName: string ="", pageId: string = "") { |
-
Please register or login to post a comment