- 你们确定这玩意好用?
onLoad: function () { const nfc = wx.getNFCAdapter() this.nfc = nfc console.log(nfc) function discoverHandler(res) { if (res.techs.includes(nfc.tech.ndef)) { console.log(res.messages) const ndef = nfc.getNdef() ndef.writeNdefMessage({ uris: [''], complete(res) { console.log('res:', res) } }) return } console.log('res.techs',res.techs) try { if (res.techs.includes(nfc.tech.nfcA)) { const nfcA = nfc.getNFCA() nfcA.transceive({ data: new ArrayBuffer(0), complete(res) { console.log('res:', res) } }) return } } catch (error) { console.error(error) } try { if (res.techs.includes(nfc.tech.mifareClassic)) { const nfcA = nfc.getMifareClassic() nfcA.transceive({ data: new ArrayBuffer(0), complete(res) { console.log('res:', res) } }) return } } catch (error) { } } nfc.onDiscovered(discoverHandler) nfc.startDiscovery({ success(e){ console.log('success to discover:',e) }, complete(e){ console.log('complete to discover:',e) }, fail(err) { console.log('failed to discover:', err) } }) }, [图片]
08-08 - wxparser使用中出现问题.有解决方案么?
//我引用在服务详细order 文件夹下的 是可以用的,求讲解 基础库最新版本 2.17.0 2.13.2 都试过了 //配置信息 "plugins":{ "wxparserPlugin": { "version": "0.4.0", "provider": "wx9d4d4ffa781ff3ac" } } /页面引用 "usingComponents": { "wxparser" : "plugin://wxparserPlugin/wxparser" //引用路径:plugin://wxparserPlugin/wxparser } 引用在 pages文件夹路径下: 错误信息: VM Service.js:2 Error: Component is not found in path "plugin://wx9d4d4ffa781ff3ac/wxparser" (using by "pages/*****/index") //我引用在服务详细order 文件夹下的 是可以用的,求讲解
2021-06-03