写在app.js里
onLoad: function () {
wx.setVisualEffectOnCapture({
visualEffect: 'hidden',
success: (res) => {
console.log(res)
},
fail: (err) => {
console.log(err)
},
complete: (res) => {
console.log(res)
}
})
wx.onUserCaptureScreen(function (res) {
console.log('用户截屏了')
})
},
解决了,不能写在app.js里,写在主页就生效了