English
Get the parameters at startup.
Note: There are differences in parameter acquisition when each platform is started. The details are as follows:
vue3
project: uni-app 3.2.13+ support;vue2
project: uni-app 3.5.1+ support.Platform Compatibility Notes
App | web | 微信小程序 | 支付宝小程序 | 抖音小程序 | 快手小程序 | QQ小程序 | 百度小程序 | 京东小程序 | 钉钉小程序 | 飞书小程序 |
---|---|---|---|---|---|---|---|---|---|---|
√ (3.4.10+) | √ (3.5.1+) | √ | √ | √ | √ | x | x | x | x | x |
Return parameter description
Parameter Name | Type | Description | Platform Difference Description |
---|---|---|---|
path | String | 启动的路径(代码包路径) | |
scene | Number | 启动时的场景值,具体值含义请查看各平台文档说明。App、web端恒为 1001。 | |
query | Object | 启动时的 query 参数 | |
referrerInfo | Object | 来源信息。如果没有则返回 {} | |
channel | String | Returns an empty string if the app does not set a channel ID. The values are as follows | Only App supports |
launcher | String | Application launcher source. The values are as follows | Only App supports |
forwardMaterials | Array<Object> | The opened file information array, this parameter will only be carried when opened from the chat material scene (scene is 1173) | WeChat applet |
chatType | number | The opened file information array, this parameter is only carried when opened from the chat material scene (scene is 1173) | Only WeChat applet |
apiCategory | string | API 类别 | 仅微信小程序(2.20.0+) |
showFrom | number | 唤起小程序的方式,目前取值固定为 10,表示通过 schema 唤起 | 仅抖音小程序(1.90.0+) |
mode | 'default' | 'halfPage' | Mode to start the applet | Only Kuaishou applet |
Object referrerInfo
Properties | Type | Description | Platform Difference Description |
---|---|---|---|
appId | String | 来源小程序 appId | 其他平台均支持,抖音小程序(1.15.0+) |
extraData | Object | 来源小程序传过来的数据。 | 其他平台均支持,抖音小程序(1.15.0+) |
channel value
Provides
7
channels by default (360
,Xiaomi
,Huawei
,Apppo
,vivo
,oppo
), more can be found in themanifest.json
file [Source view] to configure, details
Default Channel | Channel ID |
---|---|
GooglePlay | |
App Store | yyb |
360 App Market | 360 |
Huawei App Store | huawei |
Xiaomi App Store | xiaomi |
vivo App Store | vivo |
oppo app store | oppo |
launcher value
value | description |
---|---|
default | The default startup mode, usually means the application list startup (search startup in 360 Assistant) |
scheme | Trigger startup by urlscheme |
push | Trigger startup by clicking on the system notification |
uniLink | Launch app via universal link |
miniProgram | Launch the app via WeChat Mini Program |
shortcut | 通过快捷方式启动,iOS平台表示通过3D Touch快捷方式,Android平台表示通过桌面快捷方式启动 |
barcode | 通过二维码扫描启动 |