wx.checkIsAddedToMyMiniProgram({
success: (res) => {
console.log('res',res)
if(!res.added){
currentPage.setData({
showNotice:true
})
setTimeout(()=>{
currentPage.setData({
showNotice:false
})
},7000)
}
},
fail:(error)=>{
console.log('error',error)
}
wx.checkIsAddedToMyMiniProgram 查看该小程序是否已经加入我的小程序、success表示查看成功,res.added的布尔值表示是否加入我的小程序
微信小程序的APP与页面的生成速度也不同,在具体使用的时候可以通过打印控制台了解先后生成的顺序。必要的话可以使用settimeout来进行延时
getcurrentpages() 获取当前页面栈,数组中第一个元素为首页,最后一个元素为当前页面
wx.downloadFile 只支持保存本地路径
wx.downloadFile({
url: