Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the knowledge points of WeChat Mini Programs api?

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "what are the knowledge points of WeChat Mini Programs api". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "what are the knowledge points of WeChat Mini Programs api?"

API

The framework provides rich native API of Wechat, which can easily call up the capabilities provided by Wechat, such as access to user information, local storage, payment functions and so on.

Description:

The API at the beginning of wx.on is the API interface that listens for the occurrence of an event and accepts a CALLBACK function as an argument. When this event is triggered, the CALLBACK function is called.

If there is no special convention, other API interfaces accept an OBJECT as a parameter.

Success,fail,complete can be specified in OBJECT to receive the results of interface calls.

The parameter name type is required to indicate whether successFunction API calls successful callback function failFunction No API call failed callback function completeFunction No API call ends callback function (both successful and failed calls will be executed)

API list:

Network API list:

API description wx.request initiates network request wx.uploadFile upload file wx.downloadFile download file wx.connectSocket creates WebSocket connection wx.onSocketOpen monitoring WebSocket turns on wx.onSocketError monitoring WebSocket error wx.sendSocketMessage sends WebSocket message wx.onSocketMessage accepts WebSocket message wx.closeSocket closes WebSocket connection wx.onSocketClose monitoring WebSocket off

Media API list:

API instructs wx.chooseImage to select a picture from the album Or take wx.previewImage preview picture wx.startRecord start recording wx.stopRecord end recording wx.playVoice play voice wx.pauseVoice stop play voice wx.stopVoice end play voice wx.getBackgroundAudioPlayerState get music play state wx.playBackgroundAudio play music wx.pauseBackgroundAudio stop play music wx.seekBackgroundAudio control music play progress wx.stopBackgroundAudio stop play music wx.onBackgroundAudioPlay monitor music start play wx.onBackgroundAudioPause monitor music pause wx.onBackgroundAudioStop Monitoring music ends wx.chooseVideo selects a video from the album Or shoot.

List of files API:

API description wx.saveFile save file wx.getSavedFileList get saved file list wx.getSavedFileInfo get saved file information wx.removeSavedFile delete saved file information wx.openDocument open file

Data API list:

API description wx.getStorage get local data cache wx.getStorageSync get local data cache wx.setStorage settings local data cache wx.setStorageSync settings local data cache wx.getStorageInfo get relevant information about local cache wx.getStorageInfoSync get relevant information about local cache wx.removeStorage delete local cache content wx.removeStorageSync delete local cache content wx.clearStorage clean up local data cache wx.clearStorageSync clean up local data cache

Location API list:

API description wx.getLocation get current location wx.chooseLocation Open Map Select location wx.openLocation Open built-in Map wx.createMapContext Map component Control

Device API list:

API description wx.getNetworkType acquisition network type wx.onNetworkStatusChange monitoring network state change wx.getSystemInfo acquisition system information wx.getSystemInfoSync acquisition system information wx.onAccelerometerChange monitoring acceleration data wx.startAccelerometer start monitoring acceleration data wx.stopAccelerometer stop monitoring acceleration data wx.onCompassChange monitoring compass data wx.startCompass start monitoring compass data wx.stopCompass stop monitoring compass data wx.setClipboardData settings clipboard content wx.getClipboardData Pick up the clipboard contents wx.makePhoneCall call wx.scanCode scan code

Interface API list:

API description wx.showToast display prompt box wx.showLoading display load prompt box wx.hideToast hidden prompt box wx.hideLoading hidden prompt box wx.showModal display modal pop-up window wx.showActionSheet display menu list wx.setNavigationBarTitle setting current page title wx.showNavigationBarLoading display navigation bar load animation wx.hideNavigationBarLoading hidden navigation bar load animation wx.navigateTo new window open page wx.redirectTo original window open page wx.switchTab switch to tabbar page wx .navigateBack returns the previous page wx.createAnimation animation wx.createCanvasContext creates drawing context wx.drawCanvas drawing wx.stopPullDownRefresh stops the drop-down to refresh the animation

WXML Node Information API list:

API description wx.createSelectorQuery create query request selectorQuery.select select a single node according to selector selectorQuery.selectAll select all nodes according to selector selectorQuery.selectViewport select display area nodesRef.boundingClientRect get layout position and size nodesRef.scrollOffset get scrolling position nodesRef.fields get any field selectorQuery.exec execute query request

Open interface:

API explains that wx.login logs in to wx.getUserInfo to obtain user information, wx.chooseAddress to obtain user shipping address wx.requestPayment to initiate WeChat Pay wx.addCard to add card coupons wx.openCard to open card coupons here, I believe you have a deeper understanding of "what are the knowledge points of WeChat Mini Programs api", you might as well do it in practice! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report