Alipay+ DocsAlipay+ Docs

Universal JSAPIs for mini programs

The following JSAPIs are provided for the Alipay+ Cross-border Transport mini program.

JSAPI

Description

getAppIdSync

Synchronously obtains the mini program app ID.

getSystemInfoSync

Synchronously obtains the mobile phone system information.

createCanvasContext

Creates a canvas drawing context. The drawing context applies only to the canvas component of the corresponding canvasId.

createSelectorQuery

Returns a SelectorQuery object instance for selecting page nodes or obtaining node information.

navigateTo

Retains the current page and navigates to a specific page within the app.

navigateBack

Closes the current page and returns to the previous page or multiple-level page.

redirectTo

Closes the current page and opens the specified page.

navigateToMiniProgram

Jumps to other mini programs.

getLocation

Obtains the user's geographical location.

getAuthCode

Obtains the user information authorization and acquires the authorization code (authCode).

Note: First, Alipay+ obtains authCode through this API by specifying scope as uth_user. Then, Alipay+ obtains the user's mobile phone number through the /v2/users/inquiryUserInfo API.

setStorageSync

Synchronously saves data to the local cache.

getStorageSync

Synchronously retrieves contents of the specified key from the local cache.

removeStorageSync

Synchronously deletes the specified key from the local cache.

showToast

Displays weak hints.

hideToast

Hides weak hints.

showLoading

Displays a loading prompt box.

hideLoading

Hides the loading prompt box.

request

Initiates an HTTPS network request.

onUserCaptureScreen

Listens for user-initiated screenshot events.

offUserCaptureScreen

Removes the listener function for user screenshot events.

getScreenBrightness

Gets the screen brightness.

setScreenBrightness

Sets the screen brightness.

hideBackHome

Hides the button on the title bar that returns to the mini program home page.

setNavigationBar

Sets the navigation bar title and style (foreground color, background color, bottom border color, upper left corner logo image).

canIUse

Determines whether mini programs, input parameters, return values, components, properties, and so on, are available in the current version.