wx.qy.getNFCReaderState({
success: (res) => {
console.log(JSON.stringify(res), 'getNFCReaderState-success')
this.startNFCReader()
},
fail: (res) => {
console.log(JSON.stringify(res), 'getNFCReaderState-fail')
wx.showModal({
title: 'NFC-Not-Support',
content: JSON.stringify(res),
})
}
})
startNFCReader() {
wx.qy.startNFCReader({
success: (res) => {
console.log(JSON.stringify(res), 'startNFCReader-success')
wx.showModal({
title: 'NFC-Start',
content: JSON.stringify(res),
})
},
fail: (res) => {
console.log(JSON.stringify(res), 'fail')
}
})
},
onNFCReadMessage: function (e) {
console.log(JSON.stringify(e),'onNFCReadMessage')
if (1 == e.messageType) {
wx.showModal({
title: 'NFC-Id',
content: JSON.stringify(e),
})
} else if (2 == e.messageType) {
console.log('Auto-Stop')
wx.showModal({
title: 'NFC-Auto-Stop',
content: JSON.stringify(e),
})
}
},
你好,企业微信相关问题请到企业微信社区咨询:https://developer.work.weixin.qq.com/community/question