微信小程序 API

这是一个用来罗列小程序的 API 文档索引的一个列表,需要通过联网才能看到具体的内容信息。

网络

★ 下载

wx.downloadFile

DownloadTask

DownloadTask.abort

DownloadTask.offHeadersReceived

DownloadTask.offProgressUpdate

DownloadTask.onHeadersReceived

DownloadTask.onProgressUpdate

wx.offLocalServiceDiscoveryStop

wx.offLocalServiceDiscoveryStop

wx.offLocalServiceFound

wx.offLocalServiceLost

wx.offLocalServiceResolveFail

wx.onLocalServiceDiscoveryStop

wx.onLocalServiceFound

wx.onLocalServiceLost

wx.onLocalServiceResolveFail

wx.startLocalServiceDiscovery

wx.stopLocalServiceDiscovery

★ 发起请求

wx.request

RequestTask

RequestTask.abort

RequestTask.offHeadersReceived

RequestTask.onHeadersReceived

★ 上传

wx.uploadFile

UploadTask

UploadTask.abort

UploadTask.offHeadersReceived

UploadTask.offProgressUpdate

UploadTask.onHeadersReceived

UploadTask.onProgressUpdate

wx.closeSocket

wx.closeSocket

wx.connectSocket

wx.onSocketClose

wx.onSocketError

wx.onSocketMessage

wx.onSocketOpen

wx.sendSocketMessage

SocketTask

SocketTask.close

SocketTask.onClose

SocketTask.onError

SocketTask.onMessage

SocketTask.onOpen

SocketTask.send

媒体

★ 音频

wx.createAudioContext

wx.createInnerAudioContext

wx.getAvailableAudioSources

wx.pauseVoice

wx.playVoice

wx.setInnerAudioOption

wx.stopVoice

AudioContext

AudioContext.pause

AudioContext.play

AudioContext.seek

AudioContext.setSrc

InnerAudioContext

InnerAudioContext.destroy

InnerAudioContext.offCanplay

InnerAudioContext.offEnded

InnerAudioContext.offError

InnerAudioContext.offPause

InnerAudioContext.offPlay

InnerAudioContext.offSeeked

InnerAudioContext.offSeeking

InnerAudioContext.offStop

InnerAudioContext.offTimeUpdate

InnerAudioContext.offWaiting

InnerAudioContext.onCanplay

InnerAudioContext.onEnded

InnerAudioContext.onError

InnerAudioContext.onPause

InnerAudioContext.onPlay

InnerAudioContext.onSeeked

InnerAudioContext.onSeeking

InnerAudioContext.onStop

InnerAudioContext.onTimeUpdate

InnerAudioContext.onWaiting

InnerAudioContext.pause

InnerAudioContext.play

InnerAudioContext.seek

InnerAudioContext.stop

★ 背景音频

wx.getBackgroundAudioManager

wx.getBackgroundAudioPlayerState

wx.onBackgroundAudioPause

wx.onBackgroundAudioPlay

wx.onBackgroundAudioStop

wx.pauseBackgroundAudio

wx.playBackgroundAudio

wx.seekBackgroundAudio

wx.stopBackgroundAudio

BackgroundAudioManager

BackgroundAudioManager.onCanplay

BackgroundAudioManager.onEnded

BackgroundAudioManager.onError

BackgroundAudioManager.onNext

BackgroundAudioManager.onPause

BackgroundAudioManager.onPlay

BackgroundAudioManager.onPrev

BackgroundAudioManager.onSeeked

BackgroundAudioManager.onSeeking

BackgroundAudioManager.onStop

BackgroundAudioManager.onTimeUpdate

BackgroundAudioManager.onWaiting

BackgroundAudioManager.pause

BackgroundAudioManager.play

BackgroundAudioManager.seek

BackgroundAudioManager.stop

★ 相机

wx.createCameraContext

CameraContext

CameraContext.startRecord

CameraContext.stopRecord

CameraContext.takePhoto

★ 字体

wx.loadFontFace

★ 图片

wx.chooseImage

wx.compressImage

wx.getImageInfo

wx.previewImage

wx.saveImageToPhotosAlbum

★ 实时音视频

wx.createLivePlayerContext

wx.createLivePusherContext

LivePlayerContext

LivePlayerContext.exitFullScreen

LivePlayerContext.mute

LivePlayerContext.pause

LivePlayerContext.play

LivePlayerContext.requestFullScreen

LivePlayerContext.resume

LivePlayerContext.stop

LivePusherContext

LivePusherContext.pause

LivePusherContext.pauseBGM

LivePusherContext.playBGM

LivePusherContext.resume

LivePusherContext.resumeBGM

LivePusherContext.setBGMVolume

LivePusherContext.snapshot

LivePusherContext.start

LivePusherContext.stop

LivePusherContext.stopBGM

LivePusherContext.switchCamera

LivePusherContext.toggleTorch

★ 录音

wx.getRecorderManager

wx.startRecord

wx.stopRecord

RecorderManager

RecorderManager.onError

RecorderManager.onFrameRecorded

RecorderManager.onInterruptionBegin

RecorderManager.onInterruptionEnd

RecorderManager.onPause

RecorderManager.onResume

RecorderManager.onStart

RecorderManager.onStop

RecorderManager.pause

RecorderManager.resume

RecorderManager.start

RecorderManager.stop

★ 视频

wx.chooseVideo

wx.createVideoContext

wx.saveVideoToPhotosAlbum

VideoContext

VideoContext.exitFullScreen

VideoContext.hideStatusBar

VideoContext.pause

VideoContext.play

VideoContext.playbackRate

VideoContext.requestFullScreen

VideoContext.seek

VideoContext.sendDanmu

VideoContext.showStatusBar

VideoContext.stop

文件

wx.getFileInfo

wx.getFileSystemManager

wx.getSavedFileInfo

wx.getSavedFileList

wx.openDocument

wx.removeSavedFile

wx.saveFile

FileSystemManager

FileSystemManager.access

FileSystemManager.accessSync

FileSystemManager.appendFile

FileSystemManager.appendFileSync

FileSystemManager.copyFile

FileSystemManager.copyFileSync

FileSystemManager.getFileInfo

FileSystemManager.getSavedFileList

FileSystemManager.mkdir

FileSystemManager.mkdirSync

FileSystemManager.readdir

FileSystemManager.readdirSync

FileSystemManager.readFile

FileSystemManager.readFileSync

FileSystemManager.removeSavedFile

FileSystemManager.rename

FileSystemManager.renameSync

FileSystemManager.rmdir

FileSystemManager.rmdirSync

FileSystemManager.saveFile

FileSystemManager.saveFileSync

FileSystemManager.stat

FileSystemManager.statSync

FileSystemManager.unlink

FileSystemManager.unlinkSync

FileSystemManager.unzip

FileSystemManager.writeFile

FileSystemManager.writeFileSync

Stats

Stats.isDirectory

Stats.isFile

数据缓存

位置

设备

★ 加速计

wx.onAccelerometerChange

wx.startAccelerometer

wx.stopAccelerometer

★ 电量

wx.getBatteryInfo

wx.getBatteryInfoSync

★ 蓝牙

wx.closeBluetoothAdapter

wx.getBluetoothAdapterState

wx.getBluetoothDevices

wx.getConnectedBluetoothDevices

wx.onBluetoothAdapterStateChange

wx.onBluetoothDeviceFound

wx.openBluetoothAdapter

wx.startBluetoothDevicesDiscovery

wx.stopBluetoothDevicesDiscovery

★ 低功耗蓝牙

wx.closeBLEConnection

wx.createBLEConnection

wx.getBLEDeviceCharacteristics

wx.getBLEDeviceServices

wx.notifyBLECharacteristicValueChange

wx.onBLECharacteristicValueChange

wx.onBLEConnectionStateChange

wx.readBLECharacteristicValue

wx.writeBLECharacteristicValue

★ 剪贴板

wx.getClipboardData

wx.setClipboardData

★ 罗盘

wx.onCompassChange

wx.startCompass

wx.stopCompass

★ 联系人

wx.addPhoneContact

★ 陀螺仪

wx.onGyroscopeChange

wx.startGyroscope

wx.stopGyroscope

wx.getBeacons

wx.getBeacons

wx.onBeaconServiceChange

wx.onBeaconUpdate

wx.startBeaconDiscovery

wx.stopBeaconDiscovery

IBeaconInfo

★ 设备方向

wx.onDeviceMotionChange

wx.startDeviceMotionListening

wx.stopDeviceMotionListening

★ 网络

wx.getNetworkType

wx.onNetworkStatusChange

wx.getHCEState

wx.getHCEState

wx.onHCEMessage

wx.sendHCEMessage

wx.startHCE

wx.stopHCE

★ 性能

wx.onMemoryWarning

★ 电话

wx.makePhoneCall

★ 扫码

wx.scanCode

★ 屏幕

wx.getScreenBrightness

wx.onUserCaptureScreen

wx.setKeepScreenOn

wx.setScreenBrightness

★ 振动

wx.vibrateLong

wx.vibrateShort

wx.connectWifi

wx.connectWifi

wx.getConnectedWifi

wx.getWifiList

wx.onGetWifiList

wx.onWifiConnected

wx.setWifiList

wx.startWifi

wx.stopWifi

WifiInfo

界面

★ 动画

wx.createAnimation

Animation

Animation.backgroundColor

Animation.bottom

Animation.export

Animation.height

Animation.left

Animation.matrix

Animation.matrix3d

Animation.opacity

Animation.right

Animation.rotate

Animation.rotate3d

Animation.rotateX

Animation.rotateY

Animation.rotateZ

Animation.scale

Animation.scale3d

Animation.scaleX

Animation.scaleY

Animation.scaleZ

Animation.skew

Animation.skewX

Animation.skewY

Animation.step

Animation.top

Animation.translate

Animation.translate3d

Animation.translateX

Animation.translateY

Animation.translateZ

Animation.width

★ 背景

wx.setBackgroundColor

wx.setBackgroundTextStyle

★ 自定义组件

wx.nextTick

★ 交互

wx.hideLoading

wx.hideToast

wx.showActionSheet

wx.showLoading

wx.showModal

wx.showToast

★ 菜单

wx.getMenuButtonBoundingClientRect

★ 导航栏

wx.hideNavigationBarLoading

wx.setNavigationBarColor

wx.setNavigationBarTitle

wx.showNavigationBarLoading

★ 下拉刷新

wx.startPullDownRefresh

wx.stopPullDownRefresh

★ 滚动

wx.pageScrollTo

★ 置顶

wx.setTopBarText

wx.hideTabBar

wx.hideTabBar

wx.hideTabBarRedDot

wx.removeTabBarBadge

wx.setTabBarBadge

wx.setTabBarItem

wx.setTabBarStyle

wx.showTabBar

wx.showTabBarRedDot

★ 窗口

wx.offWindowResize

wx.onWindowResize

开放接口

★ 接口调用凭证

getAccessToken

★ 帐号信息

wx.getAccountInfoSync

★ 收货地址

wx.chooseAddress

★ 授权

wx.authorize

★ 卡券

wx.addCard

wx.openCard

★ 客服消息

customerTyping

getTempMedia

sendCustomerMessage

uploadTempMedia

★ 数据分析

wx.reportAnalytics

getAnalysisDailyRetain

getAnalysisDailyRetain

getAnalysisMonthlyRetain

getAnalysisWeeklyRetain

getAnalysisDailySummary

getAnalysisDailyVisitTrend

getAnalysisDailyVisitTrend

getAnalysisMonthlyVisitTrend

getAnalysisWeeklyVisitTrend

getAnalysisUserPortrait

getAnalysisVisitDistribution

getAnalysisVisitPage

★ 发票

wx.chooseInvoice

wx.chooseInvoiceTitle

★ 登录

wx.checkSession

wx.login

code2Session

★ 小程序跳转

wx.navigateBackMiniProgram

wx.navigateToMiniProgram

★ 附近的小程序

addNearbyPoi

deleteNearbyPoi

getNearbyPoiList

setNearbyPoiShowStatus

★ 支付

wx.requestPayment

★ 插件管理

applyPlugin

getPluginDevApplyList

getPluginList

setDevPluginApplyStatus

unbindPlugin

★ 二维码

createWXAQRCode

getWXACode

getWXACodeUnlimit

★ 内容安全

imgSecCheck

msgSecCheck

★ 设置

wx.getSetting

wx.openSetting

AuthSetting

★ 生物认证

wx.checkIsSoterEnrolledInDevice

wx.checkIsSupportSoterAuthentication

wx.startSoterAuthentication

★ 模板消息

addTemplate

deleteTemplate

getTemplateLibraryById

getTemplateLibraryList

getTemplateList

sendTemplateMessage

★ 统一服务消息

sendUniformMessage

★ 动态消息

createActivityId

setUpdatableMsg

★ 用户信息

wx.getUserInfo

UserInfo

★ 微信运动

wx.getWeRunData

更新

Worker

数据上报

小程序

基础

画布

wx.canvasGetImageData

wx.canvasPutImageData

wx.canvasToTempFilePath

wx.createCanvasContext

CanvasContext

CanvasContext.arc

CanvasContext.arcTo

CanvasContext.beginPath

CanvasContext.bezierCurveTo

CanvasContext.clearRect

CanvasContext.clip

CanvasContext.closePath

CanvasContext.createCircularGradient

CanvasContext.createLinearGradient

CanvasContext.createPattern

CanvasContext.draw

CanvasContext.drawImage

CanvasContext.fill

CanvasContext.fillRect

CanvasContext.fillText

CanvasContext.lineTo

CanvasContext.measureText

CanvasContext.moveTo

CanvasContext.quadraticCurveTo

CanvasContext.rect

CanvasContext.restore

CanvasContext.rotate

CanvasContext.save

CanvasContext.scale

CanvasContext.setFillStyle

CanvasContext.setFontSize

CanvasContext.setGlobalAlpha

CanvasContext.setLineCap

CanvasContext.setLineDash

CanvasContext.setLineJoin

CanvasContext.setLineWidth

CanvasContext.setMiterLimit

CanvasContext.setShadow

CanvasContext.setStrokeStyle

CanvasContext.setTextAlign

CanvasContext.setTextBaseline

CanvasContext.setTransform

CanvasContext.stroke

CanvasContext.strokeRect

CanvasContext.strokeText

CanvasContext.transform

CanvasContext.translate

CanvasGradient

CanvasGradient.addColorStop

Color

调试

第三方平台

地图

路由

转发

系统

定时器

WXML

wx.createIntersectionObserver

wx.createSelectorQuery

IntersectionObserver

IntersectionObserver.disconnect

IntersectionObserver.observe

IntersectionObserver.relativeTo

IntersectionObserver.relativeToViewport

NodesRef

NodesRef.boundingClientRect

NodesRef.context

NodesRef.fields

NodesRef.scrollOffset

SelectorQuery

SelectorQuery.exec

SelectorQuery.in

SelectorQuery.select

SelectorQuery.selectAll

SelectorQuery.selectViewport

Notes

以上内容是 linxz 根据 “微信公众号平台 | 小程序” 官方网站的文档 整理,仅作为索引使用。