字节跳动小程序文档
小程序
小程序
小游戏
介绍
开发
设计
数据
运营
第三方平台
社区
开发
指南
起步
小程序简介
快速开始
小程序代码构成
目录结构
小程序配置
全局配置
页面配置
小程序框架
逻辑层
注册小程序
注册页面
页面生命周期
页面路由
模块化
API
视图层
TTML
TTSS
事件系统
数据绑定
基础组件
获取页面节点信息
小程序运行时
JavaScript支持情况
运行环境
运行机制
自定义组件
自定义组件
组件模版和样式
Component 构造器
组件间通信与事件
组件行为 behaviors
组件间关系
基础能力
网络
画布
框架
基础说明
目录结构
全局配置
基础功能
tt.env
逻辑层
启动程序
启动页面
页面路由
文件作用域
API
视图层
TTML
TTML-数据绑定
TTML-列表渲染
TTML-条件渲染
TTML-模板
TTML-事件
TTML-引用
TTSS
组件
自定义组件
自定义组件
组件模版和样式
Component 构造器
组件间通信与事件
组件行为 behaviors
组件间关系
组件扩展
场景值
分包加载
简介
普通分包
独立分包
分包预下载
流加载
流加载是什么
流加载和分包加载的区别
小程序运行时
JavaScript支持情况
小程序运行机制
SJS语法参考
SJS介绍
模块
变量
注释
运算符
语句
数据类型
基础类库
组件
基础内容
text 文本
rich-text 富文本
progress 进度条
icon 图标
介绍
基础组件
视图容器
view 视图容器
scroll-view 可滚动视图区域
swiper 滑块视图容器
swiper-item
表单
button 按钮
checkbox 多选选择器
checkbox-group 多项选择器
form 表单
input 输入框
label 表单组件标签
picker 底部弹起的滚动选择器
picker-view 嵌入页面的滚动选择器
picker-view-column
radio 单选项目
radio-group 单向选择器
slider 滑动选择器
switch 开关选择器
textarea
导航
navigator 页面链接
媒体组件
image 图片
video 视频
live-player
camera 相机
画布
canvas 画布
地图
map
开放能力
web-view
ad
获取手机号
消息推送客服
原生组件
API
基础
tt.canIUse
tt.base64ToArrayBuffer
tt.arrayBufferToBase64
生命周期
tt.getLaunchOptionsSync
tt.exitMiniProgram
tt.canIPutStuffOverComponent
更新
tt.getUpdateManager
UpdateManager
定时器
setTimeout
clearTimeout
setInterval
clearInterval
应用级事件
tt.onAppShow
tt.offAppShow
tt.onAppHide
tt.offAppHide
tt.onError
tt.offError
环境变量
tt.env
网络
HTTP
tt.downloadFile
tt.request
tt.uploadFile
RequestTask
UploadTask
DownloadTask
WebSocket
tt.connectSocket
SocketTask
媒体
图片
tt.chooseImage
tt.saveImageToPhotosAlbum
tt.previewImage
tt.getImageInfo
tt.compressImage
录音
tt.getRecorderManager
RecorderManager
音频
BackgroundAudioManager
InnerAudioContext
tt.createInnerAudioContext
InnerAudioContext
tt.getBackgroundAudioManager
BackgroundAudioManager
视频
tt.chooseVideo
tt.saveVideoToPhotosAlbum
tt.createVideoContext
VideoContext
tt.createLivePlayerContext
LivePlayerContext
相机
tt.createCameraContext
CameraContext
CameraFrameListener
地图
tt.createMapContext
MapContext
getCenterLocation
MapContext
getRegion
mapContext.getScale
moveToLocation
文件
tt.saveFile
tt.getFileInfo
tt.getSavedFileList
tt.openDocument
tt.removeSavedFile
tt.getFileSystemManager
FileSystemManager
FileSystemManager.accessSync
FileSystemManager.access
FileSystemManager.saveFileSync
FileSystemManager.saveFile
FileSystemManager.getSavedFileList
FileSystemManager.removeSavedFile
FileSystemManager.copyFileSync
FileSystemManager.copyFile
FileSystemManager.getFileInfo
FileSystemManager.mkdirSync
FileSystemManager.mkdir
FileSystemManager.readdirSync
FileSystemManager.readdir
FileSystemManager.readFileSync
FileSystemManager.readFile
FileSystemManager.renameSync
FileSystemManager.rename
FileSystemManager.rmdirSync
FileSystemManager.rmdir
FileSystemManager.statSync
FileSystemManager.stat
FileSystemManager.unlinkSync
FileSystemManager.unlink
FileSystemManager.unzip
FileSystemManager.writeFileSync
FileSystemManager.writeFile
Stat
Stats
Stats.isDirectory
Stats.isFile
开放接口
登录
tt.login
tt.checkSession
用户信息
tt.getUserInfo
敏感数据处理
支付
小程序收银台(pay)接入指南
tt.pay
广告
激励视频广告
插屏广告
小程序跳转
tt.navigateToMiniProgram
tt.navigateBackMiniProgram
分享
转发
收货地址
tt.chooseAddress
设置
tt.getSetting
tt.openSetting
AuthSetting
授权
tt.authorize
tt.showDouyinOpenAuth
数据分析
tt.reportAnalytics
视频拍摄器
调起方法
跳转视频播放页
引导关注
tt.followOfficialAccount
tt.checkFollowState
tt.openAwemeUserProfile
订阅消息
tt.requestSubscribeMessage
电商融合方案
tt.openDouyinOrderList
tt.openEcGood
tt.openEcOrderDetail
tt.openEcIm
tt.openEcCart
tt.openWebcastRoom
tt.openDouyinProfile
tt.openEcCoupon
性能
tt.performance
数据缓存
tt.getStorage
tt.getStorageSync
tt.setStorage
tt.setStorageSync
tt.removeStorage
tt.removeStorageSync
tt.clearStorage
tt.clearStorageSync
tt.getStorageInfo
tt.getStorageInfoSync
地理位置
tt.getLocation
tt.chooseLocation
tt.openLocation
设备
网络状态
tt.getNetworkType
tt.onNetworkStatusChange
tt.getWifiList
tt.onGetWifiList
tt.offGetWifiList
系统信息
tt.getSystemInfo
tt.getSystemInfoSync
Wi-Fi
tt.getConnectedWifi
加速度计
tt.startAccelerometer
tt.stopAccelerometer
tt.onAccelerometerChange
罗盘
tt.startCompass
tt.stopCompass
tt.onCompassChange
拨打电话
tt.makePhoneCall
扫码
tt.scanCode
剪贴板
tt.getClipboardData
tt.setClipboardData
屏幕
tt.setKeepScreenOn
tt.onUserCaptureScreen
tt.offUserCaptureScreen
tt.getScreenBrightness
tt.setScreenBrightness
振动
tt.vibrateShort
tt.vibrateLong
性能
tt.onMemoryWarning
界面
交互反馈
tt.showToast
tt.hideToast
tt.showLoading
tt.hideLoading
tt.showModal
tt.showActionSheet
tt.showFavoriteGuide
tt.showInteractionBar
tt.hideInteractionBar
导航栏
tt.showNavigationBarLoading
tt.hideNavigationBarLoading
tt.hideHomeButton
tt.setNavigationBarTitle
tt.setNavigationBarColor
菜单
tt.getMenuButtonBoundingClientRect
动画
tt.createAnimation
页面位置
tt.pageScrollTo
Canvas绘图
tt.createCanvasContext
CanvasContext
RenderingContext
tt.createOffscreenCanvas
Canvas
tt.canvasToTempFilePath
CanvasGradient
OffscreenCanvas
Image
下拉刷新
Page.onPullDownRefresh
tt.startPullDownRefresh
tt.stopPullDownRefresh
TabBar
tt.showTabBarRedDot
tt.showTabBar
tt.setTabBarStyle
tt.setTabBarItem
tt.setTabBarBadge
tt.removeTabBarBadge
tt.hideTabBarRedDot
tt.hideTabBar
导航
tt.navigateTo
tt.redirectTo
tt.switchTab
tt.navigateBack
tt.reLaunch
转发
转发
ShareOption
ShareParam
视频拍摄器
tt.showShareMenu
tt.hideShareMenu
tt.navigateToVideoView
第三方平台
tt.getExtConfig
tt.getExtConfigSync
TTML
tt.createSelectorQuery
SelectorQuery
SelectorQuery
SelectorQuery.in
SelectorQuery.select
SelectorQuery.selectAll
SelectorQuery.selectViewport
SelectorQuery.exec
tt.createIntersectionObserver
NodesRef
NodesRef
NodesRef.boundingClientRect
NodesRef.scrollOffset
NodesRef.fields
NodesRef.node
IntersectionObserver
IntersectionObserver
IntersectionObserver.relativeTo
IntersectionObserver.relativeToViewport
IntersectionObserver.observe
IntersectionObserver.disconnect
其它
标准对象输入
用户授权
网络请求使用说明
本地数据缓存
参数调起使用场景描述
服务端
服务端API介绍
接口调用凭证
getAccessToken
登录
code2Session
数据缓存
setUserStorage
removeUserStorage
二维码
createQRCode
内容安全
内容安全检测
图片检测
图片检测V2
其它
用户登录态签名
订阅消息
发送订阅消息
开发者工具
开发辅助
小程序开发工具
小程序vscode插件
IDE 命令行工具
代码片段
真机调试
一键搬家工具
代码检测工具
开发者工具更新及下载
基础库
更新日志
版本分布及各APP对应关系
兼容性说明
性能优化
小程序性能优化概述
小程序性能优化的意义
小程序的性能指标
小程序性能优化的原理和手段
小程序的运行流程
小程序的启动性能优化
小程序的运行时性能优化
优化手段
数据预取
性能数据分析
性能分析工具
客户端性能分析工具
性能 Trace 工具
功能接入指南
广告组件接入指南
广告组件说明
流量主开通流程
头条端信息流广告
头条端视频贴片广告
抖音端激励视频广告
抖音端/头条端banner广告
抖音端插屏广告
流量主广告规范及约束协议
小程序流量主接入规范
小程序流量主违规处罚
小程序广告收入结算
小程序广告结算指南
电子合同签署与广告结算FAQ
小程序结算账户信息修改功能-修改开户行、银行账号、开户支行名称等
小程序结算单税率修改
分享能力接入指南
客服消息能力
客服消息能力介绍
小程序官方客服
消息推送客服
引导关注头条号
获取用户手机号权限申请
获取挂载小程序的视频
订阅消息能力
引导关注抖音号
抖音开放能力介绍
canvas 画布组件申请流程
camera 相机组件申请流程
网络请求使用说明
配置域名白名单
HTTP 请求
下载文件
上传文件
WebSocket
url 协议说明
线上环境,网络请求仅支持 https 协议的 URL
点击纠错
评价此篇文档
网络请求使用说明
配置域名白名单
url 协议说明