提交 b7feb489 编写于 作者: D DCloud_LXH

feat(app):

上级 247dceda
...@@ -248,7 +248,9 @@ const third = [ ...@@ -248,7 +248,9 @@ const third = [
'unPreloadPage', 'unPreloadPage',
'loadSubPackage', 'loadSubPackage',
'sendHostEvent', 'sendHostEvent',
'navigateToMiniProgram' 'navigateToMiniProgram',
'getLaunchOptionsSync',
'getEnterOptionsSync'
] ]
const ad = [ const ad = [
......
...@@ -56,6 +56,7 @@ export * from './plugin/on-native-event-receive' ...@@ -56,6 +56,7 @@ export * from './plugin/on-native-event-receive'
export * from './plugin/send-native-event' export * from './plugin/send-native-event'
export * from './plugin/load-sub-package' export * from './plugin/load-sub-package'
export * from './plugin/sdk' export * from './plugin/sdk'
export * from './plugin/get-launch-options-sync'
export * from './route/navigate-back' export * from './route/navigate-back'
export * from './route/navigate-to' export * from './route/navigate-to'
......
import {
getEnterOptions,
getLaunchOptions
} from '../../framework/utils'
export function getLaunchOptionsSync () {
return getLaunchOptions()
}
export function getEnterOptionsSync () {
return getEnterOptions()
}
...@@ -46,7 +46,9 @@ export function initLaunchOptions ({ ...@@ -46,7 +46,9 @@ export function initLaunchOptions ({
extend(launchOptions, { extend(launchOptions, {
path, path,
query: query ? parseQuery(query) : {}, query: query ? parseQuery(query) : {},
referrerInfo: referrerInfo || {} referrerInfo: referrerInfo || {},
channel: plus.runtime.channel,
launcher: plus.runtime.launcher
}) })
extend(enterOptions, launchOptions) extend(enterOptions, launchOptions)
return launchOptions return launchOptions
...@@ -62,7 +64,7 @@ export function parseRedirectInfo () { ...@@ -62,7 +64,7 @@ export function parseRedirectInfo () {
userAction, userAction,
fromAppid fromAppid
} = } =
weexPlus.getRedirectInfo() || {} weexPlus.getRedirectInfo() || {}
const referrerInfo = { const referrerInfo = {
appId: fromAppid, appId: fromAppid,
extraData: {} extraData: {}
...@@ -77,4 +79,4 @@ export function parseRedirectInfo () { ...@@ -77,4 +79,4 @@ export function parseRedirectInfo () {
userAction userAction
} }
} }
} }
...@@ -2,7 +2,7 @@ import { getDeviceBrand } from 'uni-shared' ...@@ -2,7 +2,7 @@ import { getDeviceBrand } from 'uni-shared'
const UUID_KEY = '__DC_STAT_UUID' const UUID_KEY = '__DC_STAT_UUID'
let deviceId let deviceId
export function useDeviceId(result) { export function useDeviceId (result) {
deviceId = deviceId || __GLOBAL__.getStorageSync(UUID_KEY) deviceId = deviceId || __GLOBAL__.getStorageSync(UUID_KEY)
if (!deviceId) { if (!deviceId) {
deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7) deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7)
...@@ -14,7 +14,7 @@ export function useDeviceId(result) { ...@@ -14,7 +14,7 @@ export function useDeviceId(result) {
result.deviceId = deviceId result.deviceId = deviceId
} }
export function addSafeAreaInsets(result) { export function addSafeAreaInsets (result) {
if (result.safeArea) { if (result.safeArea) {
const safeArea = result.safeArea const safeArea = result.safeArea
result.safeAreaInsets = { result.safeAreaInsets = {
...@@ -26,7 +26,7 @@ export function addSafeAreaInsets(result) { ...@@ -26,7 +26,7 @@ export function addSafeAreaInsets(result) {
} }
} }
export function populateParameters(result) { export function populateParameters (result) {
const { brand, model, system, language, theme, version, hostName, platform } = result const { brand, model, system, language, theme, version, hostName, platform } = result
// osName osVersion // osName osVersion
...@@ -75,11 +75,9 @@ export function populateParameters(result) { ...@@ -75,11 +75,9 @@ export function populateParameters(result) {
// hostName // hostName
let _hostName = hostName // mp-jd let _hostName = hostName // mp-jd
if (__PLATFORM__ === 'mp-weixin') _hostName = (result.host || {}).env if (__PLATFORM__ === 'mp-weixin') _hostName = (result.host || {}).env
if (__PLATFORM__ === 'mp-baidu' || __PLATFORM__ === 'mp-kuaishou') if (__PLATFORM__ === 'mp-baidu' || __PLATFORM__ === 'mp-kuaishou') { _hostName = result.host }
_hostName = result.host
if (__PLATFORM__ === 'mp-qq') _hostName = result.AppPlatform if (__PLATFORM__ === 'mp-qq') _hostName = result.AppPlatform
if (__PLATFORM__ === 'mp-toutiao' || __PLATFORM__ === 'mp-lark') if (__PLATFORM__ === 'mp-toutiao' || __PLATFORM__ === 'mp-lark') { _hostName = result.appName }
_hostName = result.appName
if (__PLATFORM__ === 'mp-alipay') _hostName = result.app if (__PLATFORM__ === 'mp-alipay') _hostName = result.app
// wx.getAccountInfoSync // wx.getAccountInfoSync
...@@ -111,4 +109,4 @@ export function populateParameters(result) { ...@@ -111,4 +109,4 @@ export function populateParameters(result) {
} }
Object.assign(result, parameters) Object.assign(result, parameters)
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册