小程序开发文档
分类:小程序开发文档
时间:2021-03-03
浏览:0
评论:0
指南
框架
小程序配置
- 全局配置
- 页面配置
- sitemap
场景值
https://developers.weixin.qq.com/miniprogram/dev/reference/scene-list.html
组件
视图容器
- cover-image 覆盖在原生组件之上的图片视图
- cover-view 覆盖在原生组件之上的文本视图
- match-media media query 匹配检测节点
- movable-area
- movable-view 可移动的视图容器,在页面中可以拖拽滑动
- page-container 页面容器
- scroll-view 可滚动视图区域
- share-element 共享元素
- swiper 滑块视图容器
- swiper-item
- view 视图容器
基础内容
表单组件
- button 按钮
- checkbox 多选项目
- checkbox-group 多项选择器
- editor 富文本编辑器
- form 表单
- input 输入框
- keyboard-accessory 设置 input / textarea 聚焦时键盘上方 cover-view / cover-image 工具栏视图
- label 用来改进表单组件的可用性
- picker 从底部弹起的滚动选择器
- picker-view 嵌入页面的滚动选择器
- picker-view-column 滚动选择器子项
- radio 滚动选择器子项
- radio-group
- slider 滑动选择器
- switch 开关选择器
- textarea 多行输入框
导航
- functional-page-navigator 仅在插件中有效,用于跳转到插件功能页
- navigator 页面链接
媒体组件
- audio 音频。1.6.0 版本开始,该组件不再维护。建议使用能力更强的 wx.createInnerAudioContext 接口
- camera 系统相机
- image 图片。支持 JPG、PNG、SVG、WEBP、GIF 等格式
- live-player 实时音视频播放
- live-pusher 实时音视频录制
- video 视频
- voip-room 多人音视频对话
地图
画布
开放能力
- ad Banner 广告
- ad-custom 原生模板 广告
- official-account 公众号关注组件
- open-data 用于展示微信开放的数据
- web-view 承载网页的容器
原生组件说明
无障碍访问
导航栏
页面属性配置节点
api
基础
wx.canIUse 判断小程序的API,回调,参数,组件等是否在当前版本可用。
wx.base64ToArrayBuffer 将 Base64 字符串转成 ArrayBuffer 对象
wx.arrayBufferToBase64 将 ArrayBuffer 对象转成 Base64 字符串
- wx.getSystemInfoSync
- wx.getSystemInfoAsync 异步获取系统信息
- wx.getSystemInfo 获取系统信息
wx.updateWeChatApp 更新客户端版本
wx.getUpdateManager 获取全局唯一的版本更新管理器,用于管理小程序更新
UpdateManager UpdateManager 对象,用来管理更新
- wx.getLaunchOptionsSync 获取小程序启动时的参数
- wx.getEnterOptionsSync 获取本次小程序启动时的参数
- wx.onUnhandledRejection
- wx.onThemeChange
- wx.onPageNotFound
- wx.onError 监听小程序错误事件
- wx.onAudioInterruptionEnd
- wx.onAudioInterruptionBegin
- wx.onAppShow 监听小程序切前台事件
- wx.onAppHide
- wx.offUnhandledRejection
- wx.offThemeChange
- wx.offPageNotFound
- wx.offError
- wx.offAudioInterruptionEnd
- wx.offAudioInterruptionBegin
- wx.offAppShow
- wx.offAppHide
路由
wx.switchTab 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面
wx.reLaunch 关闭所有页面,打开到应用内的某个页面
wx.redirectTo 关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面。
wx.navigateTo 保留当前页面,跳转到应用内的某个页面。
wx.navigateBack 关闭当前页面,返回上一页面或多级页面
界面
- 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
- Animation.bottom
- Animation.export
- Animation.backgroundColor
- Animation.height
- Animation.left
网络
数据缓存
wx.setStorageSync 同步版本
wx.setStorage 将数据存储在本地缓存中指定的 key 中
媒体
- MapContext.addCustomLayer
- MapContext.addGroundOverlay
- MapContext.addMarkers
- MapContext.fromScreenLocation
- MapContext.getCenterLocation
- MapContext.getRegion
- MapContext.getRotate
- MapContext.getScale
- MapContext.getSkew
- MapContext.includePoints
- MapContext.initMarkerCluster
- MapContext.moveAlong
- MapContext.moveToLocation
- MapContext.on
- MapContext.openMapApp
- MapContext.removeCustomLayer
- MapContext.removeGroundOverlay
- MapContext.removeMarkers
- MapContext.setCenterOffset
- MapContext.setLocMarkerIcon
- MapContext.toScreenLocation
- MapContext.translateMarker
- MapContext.updateGroundOverlay
- VideoContext.exitBackgroundPlayback
- VideoContext.exitFullScreen
- VideoContext.exitPictureInPicture
- VideoContext.hideStatusBar
- VideoContext.pause
- VideoContext.play
- VideoContext.playbackRate
- VideoContext.requestBackgroundPlayback
- VideoContext.requestFullScreen
- VideoContext.seek
- VideoContext.sendDanmu
- VideoContext.showStatusBar
- VideoContext.stop
- 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
- 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
- LivePusherContext.pause
- LivePusherContext.pauseBGM
- LivePusherContext.playBGM
- LivePusherContext.resume
- LivePusherContext.resumeBGM
- LivePusherContext.sendMessage
- LivePusherContext.setBGMVolume
- LivePusherContext.setMICVolume
- LivePusherContext.snapshot
- LivePusherContext.start
- LivePusherContext.startPreview
- LivePusherContext.stop
- LivePusherContext.stopBGM
- LivePusherContext.stopPreview
- LivePusherContext.switchCamera
- LivePusherContext.toggleTorch
- EditorContext.blur
- EditorContext.clear
- EditorContext.format
- EditorContext.getContents
- EditorContext.getSelectionText
- EditorContext.insertDivider
- EditorContext.insertImage
- EditorContext.insertText
- EditorContext.redo
- EditorContext.removeFormat
- EditorContext.scrollIntoView
- EditorContext.setContents
- EditorContext.undo
位置
- wx.stopLocationUpdate
- wx.startLocationUpdateBackground
- wx.startLocationUpdate
- wx.openLocation
- wx.onLocationChange
- wx.offLocationChange
- wx.getLocation
- wx.choosePoi
- wx.chooseLocation
转发
- wx.updateShareMenu
- wx.showShareMenu
- wx.showShareImageMenu
- wx.onCopyUrl
- wx.offCopyUrl
- wx.hideShareMenu
- wx.getShareInfo
- wx.authPrivateMessage
画布
- 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
文件
- 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
开放接口
设备
- BLEPeripheralServer.addService
- BLEPeripheralServer.close
- BLEPeripheralServer.offCharacteristicReadRequest
- BLEPeripheralServer.offCharacteristicSubscribed
- BLEPeripheralServer.offCharacteristicUnsubscribed
- BLEPeripheralServer.offCharacteristicWriteRequest
- BLEPeripheralServer.onCharacteristicReadRequest
- BLEPeripheralServer.onCharacteristicSubscribed
- BLEPeripheralServer.onCharacteristicUnsubscribed
- BLEPeripheralServer.onCharacteristicWriteRequest
- BLEPeripheralServer.removeService
- BLEPeripheralServer.startAdvertising
- BLEPeripheralServer.stopAdvertising
- BLEPeripheralServer.writeCharacteristicValue
- wx.setBLEMTU
- wx.readBLECharacteristicValue
- wx.onBLEConnectionStateChange
- wx.onBLECharacteristicValueChange
- wx.offBLEConnectionStateChange
- wx.offBLECharacteristicValueChange
- wx.notifyBLECharacteristicValueChange
- wx.makeBluetoothPair
- wx.getBLEDeviceServices
- wx.getBLEDeviceRSSI
- wx.getBLEDeviceCharacteristics
- wx.createBLEConnection
- wx.closeBLEConnection
- wx.writeBLECharacteristicValue
- wx.stopBluetoothDevicesDiscovery
- wx.startBluetoothDevicesDiscovery
- wx.openBluetoothAdapter
- wx.onBluetoothDeviceFound
- wx.onBluetoothAdapterStateChange
- wx.offBluetoothDeviceFound
- wx.offBluetoothAdapterStateChange
- wx.getConnectedBluetoothDevices
- wx.getBluetoothDevices
- wx.getBluetoothAdapterState
- wx.closeBluetoothAdapter
Worker
第三方平台
WXML
广告
服务端
登录
用户信息
接口调用凭证
数据分析
客服消息
模板消息(已废弃)
统一服务消息
动态消息
插件管理
附近的小程序
小程序码
URL Scheme
内容安全
直播
- goodsAdd
- addAssistant
- addGoods
- addRole
- addSubAnchor
- createRoom
- deleteRole
- deleteRoom
- deleteSubAnchor
- editRoom
- getAssistantList
- getFollowers
- getLiveInfo
- getPushUrl
- getRoleList
- getSharedCode
- getSubAnchor
- goodsAudit
- goodsDelete
- goodsInfo
- goodsList
- goodsPush
- goodsResetAudit
- goodsSale
- goodsSort
- goodsUpdate
- goodsVideo
- modifyAssistant
- modifySubAnchor
- pushMessage
- removeAssistant
- updateComment
- updateFeedPublic
- updateKF
- updateReplay
广告
云开发
- addDelayedFunctionTask
- createSendSmsTask
- describeExtensionUploadInfo
- describeSmsRecords
- getOpenData
- getStatistics
- getVoIPSign
- report
- sendSms
图像处理
即时配送
物流助手
OCR
运维中心
- getFeedback
- getFeedbackmedia
- getJsErrDetail
- getJsErrList
- getJsErrSearch
- getPerformance
- getSceneList
- getVersionList
- realtimelogSearch
安全风控
小程序搜索
服务市场
生物认证
订阅消息
- addTemplate
- deleteTemplate
- getCategory
- getPubTemplateKeyWordsById
- getPubTemplateTitleList
- getTemplateList
- send
本站文章如未注明出处则为原创,转载请注明出处,如有侵权请邮件联系站长