提交 b7feb489 编写于 作者: D DCloud_LXH

feat(app):

上级 247dceda
......@@ -248,7 +248,9 @@ const third = [
'unPreloadPage',
'loadSubPackage',
'sendHostEvent',
'navigateToMiniProgram'
'navigateToMiniProgram',
'getLaunchOptionsSync',
'getEnterOptionsSync'
]
const ad = [
......
......@@ -56,6 +56,7 @@ export * from './plugin/on-native-event-receive'
export * from './plugin/send-native-event'
export * from './plugin/load-sub-package'
export * from './plugin/sdk'
export * from './plugin/get-launch-options-sync'
export * from './route/navigate-back'
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 ({
extend(launchOptions, {
path,
query: query ? parseQuery(query) : {},
referrerInfo: referrerInfo || {}
referrerInfo: referrerInfo || {},
channel: plus.runtime.channel,
launcher: plus.runtime.launcher
})
extend(enterOptions, launchOptions)
return launchOptions
......@@ -62,7 +64,7 @@ export function parseRedirectInfo () {
userAction,
fromAppid
} =
weexPlus.getRedirectInfo() || {}
weexPlus.getRedirectInfo() || {}
const referrerInfo = {
appId: fromAppid,
extraData: {}
......@@ -77,4 +79,4 @@ export function parseRedirectInfo () {
userAction
}
}
}
}
......@@ -2,7 +2,7 @@ import { getDeviceBrand } from 'uni-shared'
const UUID_KEY = '__DC_STAT_UUID'
let deviceId
export function useDeviceId(result) {
export function useDeviceId (result) {
deviceId = deviceId || __GLOBAL__.getStorageSync(UUID_KEY)
if (!deviceId) {
deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7)
......@@ -14,7 +14,7 @@ export function useDeviceId(result) {
result.deviceId = deviceId
}
export function addSafeAreaInsets(result) {
export function addSafeAreaInsets (result) {
if (result.safeArea) {
const safeArea = result.safeArea
result.safeAreaInsets = {
......@@ -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
// osName osVersion
......@@ -75,11 +75,9 @@ export function populateParameters(result) {
// hostName
let _hostName = hostName // mp-jd
if (__PLATFORM__ === 'mp-weixin') _hostName = (result.host || {}).env
if (__PLATFORM__ === 'mp-baidu' || __PLATFORM__ === 'mp-kuaishou')
_hostName = result.host
if (__PLATFORM__ === 'mp-baidu' || __PLATFORM__ === 'mp-kuaishou') { _hostName = result.host }
if (__PLATFORM__ === 'mp-qq') _hostName = result.AppPlatform
if (__PLATFORM__ === 'mp-toutiao' || __PLATFORM__ === 'mp-lark')
_hostName = result.appName
if (__PLATFORM__ === 'mp-toutiao' || __PLATFORM__ === 'mp-lark') { _hostName = result.appName }
if (__PLATFORM__ === 'mp-alipay') _hostName = result.app
// wx.getAccountInfoSync
......@@ -111,4 +109,4 @@ export function populateParameters(result) {
}
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.
先完成此消息的编辑!
想要评论请 注册