launchApp
Start from API_LEVEL
2.0
. Please refer to API_LEVEL.
Open Mini Program.
Type
function launchApp(option: Option): void
Parameters
Option
Property | Type | Required | DefaultValue | Description | API_LEVEL |
---|---|---|---|---|---|
appId | number | Y | - | Mini Program ID or System App ID (API_LEVEL 3.0 support, value reference System App ID constant) | 2.0 |
url | string | Y | - | path | 2.0 |
native | boolean | Y | - | Whether to jump to the system App | 3.0 |
params | string|object | N | - | The argument passed to the app.js lifecycle onCreate supports either a string or a standard JSON object. If a standard JSON object is passed, the method internally converts it to a string | 2.0 |
Constants
System App ID constants
Constant | Description | API_LEVEL |
---|---|---|
SYSTEM_APP_STATUS | Activity | 3.0 |
SYSTEM_APP_HR | Heart Rate | 3.0 |
SYSTEM_APP_SPORT | Workout | 3.0 |
SYSTEM_APP_WEATHER | Weather | 3.0 |
SYSTEM_APP_ALARM | Alarm | 3.0 |
SYSTEM_APP_CAMERA | Camera Remote | 3.0 |
SYSTEM_APP_MUSIC | Music | 3.0 |
SYSTEM_APP_STOPWATCH | Stopwatch | 3.0 |
SYSTEM_APP_COUNTDOWN | Timer | 3.0 |
SYSTEM_APP_FINE_PHONE | Find My Phone | 3.0 |
SYSTEM_APP_CARD | Cards | 3.0 |
SYSTEM_APP_ALIPAY | Alipay | 3.0 |
SYSTEM_APP_SETTING | Settings | 3.0 |
SYSTEM_APP_SPORT_HISTORY | Workout History | 3.0 |
SYSTEM_APP_COMPASS | Compass | 3.0 |
SYSTEM_APP_PAI | PAI | 3.0 |
SYSTEM_APP_WORLD_CLOCK | World Clock | 3.0 |
SYSTEM_APP_PRESSURE | Stress | 3.0 |
SYSTEM_APP_MENSTRUAL | Cycle Tracking | 3.0 |
SYSTEM_APP_SPORT_STATUS | Workout Status | 3.0 |
SYSTEM_APP_CALENDAR | Calendar | 3.0 |
SYSTEM_APP_SLEEP | Sleep | 3.0 |
SYSTEM_APP_SPO2 | Blood Oxygen | 3.0 |
SYSTEM_APP_PHONE | Phone | 3.0 |
SYSTEM_APP_NETEASE_MUSIC | NetEase Music | 3.0 |
SYSTEM_APP_WEPAY | Weixin Pay | 3.0 |
SYSTEM_APP_BREATH | Breathe | 3.0 |
SYSTEM_APP_POMODORO | Pomodoro Timer | 3.0 |
SYSTEM_APP_ALEAX | Alexa | 3.0 |
SYSTEM_APP_THERMOMETER | Thermometer | 3.0 |
SYSTEM_APP_TODO_LIST | To Do | 3.0 |
SYSTEM_APP_ALTIMETER | Barometer | 3.0 |
SYSTEM_APP_VOICE_MEMO | Voice Memos | 3.0 |
SYSTEM_APP_SUN_AND_MOON | Sun & Moon | 3.0 |
SYSTEM_APP_MEASUREMENT | One-tap Measuring | 3.0 |
SYSTEM_APP_ZEPP_COACH | Zepp Coach | 3.0 |
SYSTEM_APP_CLUB_CARD | Membership Card | 3.0 |
SYSTEM_APP_BODY_COMPOSITION | Body Composition | 3.0 |
SYSTEM_APP_READINESS | Readiness | 3.0 |
Example
import { launchApp, SYSTEM_APP_HR } from '@zos/router'
// Jump to Mini Program
launchApp({
appId: 1000001,
url: 'pages/js_widget_sample',
params: {
type: 1,
},
})
// Jump to system App Heart Rate
launchApp({
appId: SYSTEM_APP_HR,
native: true,
})