JSAPI Reference
UI
NavigationBar
Component Name | Function Description |
---|---|
my.setNavigationBar | Set the navigation bar text and style. |
my.showNavigationBarLoading | Show navigation bar loading. |
my.hideNavigationBarLoading | Hide navigation bar loading. |
TabBar
Component Name | Function Description |
---|---|
my.hideTabBar | Hide the tabBar. |
Route
Component Name | Function Description |
---|---|
my.switchTab | Jump to the specified tabBar page and close all other pages that are not tabBar. |
my.navigateTo | Maintain the current page and jump to the specified page within the application. Use my.navigateBack to return to the original page. |
my.reLaunch | Close all current pages and jump to the specified page within the application. |
my.navigateBack | Close the current page and return to the previous one or more pages. |
my.redirectTo | Close the current page and jump to the specified page within the application. |
FeedBack
Component Name | Function Description |
---|---|
my.alert | Alert box |
my.confirm | Confirm box |
my.prompt | Promat box |
my.showToast | Show a weak hint, which disappears in the specified seconds. |
my.hideLoading | Hide the loading hint. |
my.hideToast | Hide the weak hint |
my.showLoading | Show the loading hint. |
Pulldown
Component Name | Function Description |
---|---|
onPullDownRefresh | On the Page, customize the onPullDownRefresh function to listen to the pull-to-refresh event of user. |
my.stopPullDownRefresh | Stop the pull-to-refresh for the current page. |
my.startPullDownRefresh | Start the pull-to-refresh function. |
Contact
Component Name | Function Description |
---|---|
my.choosePhoneContact | Choose contact from system contact. |
Animation
Component Name | Function Description |
---|---|
my.createAnimation | Create an instance of animation. |
Canvas
Component Name | Function Description |
---|---|
my.createCanvasContext | Create the context of the canvas. |
Keyboard
Component Name | Function Description |
---|---|
my.hideKeyboard | Hide keyboard. |
Scoll
Component Name | Function Description |
---|---|
my.pageScrollTo | Scroll to the destination location of the page. |
SelectorQuery
Component Name | Function Description |
---|---|
my.createSelectorQuery | Create an instance of SelectorQuery. |
Multiple Level Select
Component Name | Function Description |
---|---|
my.multiLevelSelect | Multiple level selector, used for associated select with multiple levels. |
Set Background
Component Name | Function Description |
---|---|
my.setBackgroundColor | Set background color. |
Set Page Pulldown
Component Name | Function Description |
---|---|
my.setCanPullDown | Set whether page can support pulldown. |
Media
Image
Component Name | Function Description |
---|---|
my.chooseImage | Choose image from camera or album of cellphone. |
my.previewImage | Preview image. |
my.saveImage | Save the online images to cellphone album. |
my.getImageInfo | Get the information of the image. |
Storage
Component Name | Function Description |
---|---|
my.setStorage | Store the data in the specified key in the local cache, which overlaps the original data corresponding to the key. |
my.setStorageSync | Store synchronously the data in the specified key in the local cache. |
my.getStorage | Get cached data |
my.getStorageSync | Get cached data synchronously. |
my.removeStorage | Remove cached data. |
my.removeStorageSync | Remove cached data synchronously. |
my.clearStorage | Clear local data cache. |
my.clearStorageSync | Clear local data cache synchronously. |
File
Component Name | Function Description |
---|---|
my.saveFile | Save file to the device. |
my.getFileInfo | Get the information of the file. |
my.getSavedFileInfo | Get the information of the saved file. |
my.getSavedFileList | Get the information of all the saved file. |
my.removeSavedFile | Remove the saved file. |
Location
Component Name | Function Description |
---|---|
my.getLocation | get the current geographical location of the user. |
Network
Component Name | Function Description |
---|---|
my.request | Network request |
my.uploadFile | Upload the local resource to the developer server. |
my.downloadFile | Download file resource to local location. |
Device
canIUse
Component Name | Function Description |
---|---|
my.canIUse | Judge whether the current Mini Program API, incoming parameter or return value, component, attribute, etc. are supported in the current version. |
SDKVersion
Component Name | Function Description |
---|---|
my.SDKVersion | Get the SDK version. |
System Information
Component Name | Function Description |
---|---|
my.getSystemInfo | Get system information |
Network Status
Component Name | Function Description |
---|---|
my.getNetworkType | Get the current network status. |
Clipboard
Component Name | Function Description |
---|---|
my.getClipboard | Get the clipboard data. |
my.setClipboard | Set the clipboard data. |
Vibrate
Component Name | Function Description |
---|---|
my.vibrate | Invoke the vibrate ability of device. |
Make Phone Call
Component Name | Function Description |
---|---|
my.makePhoneCall | Make a phone. |
Get Server Time
Component Name | Function Description |
---|---|
my.getServerTime | Get the server time. |
Capture Screen
Component Name | Function Description |
---|---|
my.onUserCaptureScreen | Listen to the capture screen event by users. |
my.offUserCaptureScreen | Cancel the listen to the capture screen event by users. |
Screen Brightness
Component Name | Function Description |
---|---|
my.setKeepScreenOn | Set whether screen keeps awake. |
my.getScreenBrightness | Get the screen brightness. |
my.setScreenBrightness | Set the screen brightness. |
Add Phone Contact
Component Name | Function Description |
---|---|
my.addPhoneContact | Add contact to phone contact. |
Permission Guide
Component Name | Function Description |
---|---|
my.showAuthGuide | Guide user to grant the authorization when the permission needed. |
Scan
Component Name | Function Description |
---|---|
my.scan | Call the scanning QR code function. |
web-view
Component Name | Function Description |
---|---|
my.createWebViewContext | By creating webViewContext , Mini Program can send message to web-view . This API will create a webViewContext instance |
Open Capabilities
Component Name | Function Description |
---|---|
my.getAuthCode | Get auth code. |
my.getOpenUserInfo | Get basic information about user. |
my.tradePay | Start to pay. |
my.navigateToMiniProgram | Jump to other Mini Program. |
my.navigateBackMiniProgram | Return to the previous Mini Program, only when another Mini Program jumps to the current Mini Program. |