setData
- setData用法)
- 常见的setData 操作错误
- 对原生的setData进行优化
页面栈
- 页面栈不能超出十层
1
2
3
4
5if(getCurrentPages().length>9){
wx.redirectTo()
}else{
wx.navigateTo()
}
视频问题
- cdn
- custom-cache
1
<video custom-cache='{{false}}'></video>
小程序框架
- wepy
- mpvue
- taro
- 框架测评1、框架测评2
wx.authorize
- wx.authorize,使用这个api发起授权时,如果用户在第一次弹框拒绝授权后再掉这个api就无法再调出弹框,需要在api失败的回调中使用wx.openSetting去进行用户授权
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32wx.authorize({
scope: 'scope.writePhotosAlbum',
success() {
wx.saveVideoToPhotosAlbum({
filePath: res.tempFilePath,
success() {
wx.hideLoading()
wx.showToast({
title: '保存成功',
})
}
})
},
fail(err) {
console.log(err, 'error')
wx.showModal({
content: '需要授权才可以保存照片,是否授权?',
success(res) {
if (res.confirm) {
wx.openSetting({
success(res) {
console.log(res.authSetting)
}
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
wx.hideLoading()
}
})