Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
xugenyuan
2024-06-07 09:54:16 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8bdabe36865af1ab16657c54a53a716c9199755d
8bdabe36
1 parent
9b0e2c49
ref |> 早晚报桌面组件跳转App页面处理
Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
8 deletions
sight_harmony/features/wdShare/src/main/ets/utils/DeepLinkUtil.ets
sight_harmony/products/phone/src/main/ets/dailynewspaperwidget/pages/DailyNewspaperWidgetCard.ets
sight_harmony/products/phone/src/main/ets/startupmanager/StartupManager.ets
sight_harmony/features/wdShare/src/main/ets/utils/DeepLinkUtil.ets
View file @
8bdabe3
...
...
@@ -4,7 +4,7 @@ import { ContentType } from 'wdRouter/Index';
export class DeepLinkUtil {
private static DEEP_LINK_PREFIX = "rmrbapp:rmrb.app/openwith"
private static DEEP_LINK_PREFIX = "rmrbapp:
//
rmrb.app/openwith"
static generateDeepLinkWithConent(content: ContentDetailDTO): string {
...
...
@@ -23,7 +23,7 @@ export class DeepLinkUtil {
private static generate(contentType: number, contentId?: string, relId?: string, link?: string): string {
let deeplink = DeepLinkUtil.DEEP_LINK_PREFIX
let pubParam = `&contentId=${contentId}
}
&relId=${relId}&skipType=1`
let pubParam = `&contentId=${contentId}&relId=${relId}&skipType=1`
let type: ContentType = Number(contentType)
switch (type) {
...
...
@@ -38,7 +38,7 @@ export class DeepLinkUtil {
deeplink += "?type=article&subType=h5"
deeplink += "&url=" + encodeURIComponent(link)
} else {
deeplink += "type=article&subType=h5_template_article"
deeplink += "
?
type=article&subType=h5_template_article"
}
break
case ContentType.DynamicImageText:
...
...
sight_harmony/products/phone/src/main/ets/dailynewspaperwidget/pages/DailyNewspaperWidgetCard.ets
View file @
8bdabe3
...
...
@@ -151,14 +151,12 @@ function jumpWithDeepLink(deepLink: string, component: Object) {
if (deepLink.length == 0) {
return
}
const deepLinkKey: string = NewspaperWidgetCommon.JumpParam.DeepLinkKey
const fromDailyNewspaperKey: string = NewspaperWidgetCommon.JumpParam.FromNewspaperWidgetKey
postCardAction(component, {
action: NewspaperWidgetCommon.PosterCardAction.ActionRouter,
abilityName: NewspaperWidgetCommon.PosterCardAction.MainAbilityName,
params: {
deepLinkKey: deepLink,
fromDailyNewspaperKey: true
"newspaper.widget.jump.deeplink": deepLink,
"newspaper.widget.jump.fromNewspaperWidget": 1
}
});
}
\ No newline at end of file
...
...
sight_harmony/products/phone/src/main/ets/startupmanager/StartupManager.ets
View file @
8bdabe3
...
...
@@ -12,13 +12,14 @@ import { DeviceUtil,
UmengStats } from 'wdKit/Index'
import { LoginModule } from 'wdLogin/Index'
import { HostEnum, HostManager, WDHttp } from 'wdNetwork/Index'
import { registerRouter } from 'wdRouter/Index'
import {
AppInnerLink,
registerRouter } from 'wdRouter/Index'
import { TrackingModule } from 'wdTracking/Index'
import { JSON } from '@kit.ArkTS'
import app from '@system.app'
import { GetuiPush, HWLocationUtils } from 'wdHwAbility/Index'
import { ImageKnife, ImageKnifeGlobal } from '@ohos/imageknife'
import { webview } from '@kit.ArkWeb'
import { NewspaperWidgetCommon } from '../dailynewspaperwidget/common/NewspaperWidgetCommon'
const TAG = "[StartupManager]"
...
...
@@ -26,6 +27,7 @@ const TAG = "[StartupManager]"
export class StartupManager {
private context?: common.UIAbilityContext
private lastStartupWant?: Want
private constructor() {
}
...
...
@@ -74,10 +76,14 @@ export class StartupManager {
// 通知栏点击后启动
GetuiPush.sharedInstance().onWant(want)
Logger.debug(TAG, "App onCreate: finised")
this.lastStartupWant = want
}
appOnNewWant(want: Want, launchParam: AbilityConstant.LaunchParam) {
GetuiPush.sharedInstance().onNewWant(want)
this.dealWithDeepLink(want)
}
appOnDestory() {
...
...
@@ -124,6 +130,10 @@ export class StartupManager {
//TODO:
// 提前初始化webview
webview.WebviewController.initializeWebEngine()
if (this.lastStartupWant && this.dealWithDeepLink(this.lastStartupWant)) {
this.lastStartupWant = undefined
}
resolve()
})
}
...
...
@@ -195,4 +205,20 @@ export class StartupManager {
private initOthers() {
}
private dealWithDeepLink(want: Want): boolean {
if (!want.parameters) {
return false
}
let deepLink = want.parameters[NewspaperWidgetCommon.JumpParam.DeepLinkKey] as string
if (deepLink && deepLink.length) {
AppInnerLink.jumpWithLink(deepLink)
return true
}
return false
}
}
...
...
Please
register
or
login
to post a comment