碰到一样的问题,有没有人帮忙回答下哈
MifareClassic.transceive读数据返回data为什么为空?//和卡建立连接 mc.connect({ success: function(res) { console.log("连接卡成功: " + JSON.stringify(res)) //验证密码A指令 var keyaBs = [0x60, 0x04, 0xAE, 0x38, 0x40, 0x39, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF]; //把字节数组转成ArrayBuffer var keyaArray = new Uint8Array(keyaBs.map(function (bs) { return bs; })); var keyaBuffer = keyaArray.buffer; //验证密码A mc.transceive({ data:keyaBuffer, success:function(res){ console.error("验证密码A" + "成功" + res.errMsg); var arr = [0x30, 1] var arrayBuffer = new Int8Array(arr).buffer var u8 = new Uint8Array(arrayBuffer) for(var i = 0; i < u8.length; i ++) { console.log(u8[i]) } //发送指令 mc.transceive({ data: arrayBuffer, success: function(res) { console.log("transceive返回: " + JSON.stringify(res)) }, fail: function(e) { console.log("transceive异常: " + JSON.stringify(e)) } }); }, fail:function(res){ console.error("验证密码A" + "失败" + res.errMsg); }, complete:function(res){ console.error("验证密码A" + "状态" + res.errMsg); } }); }, fail: function(e) { console.log("和卡连接异常: " + JSON.stringify(e)) } }) 结果:transceive返回: {"errMsg":"transceive:ok","data":{}}
2023-01-12所以“<ArrayBuffer:byteLength=16>” 这个是字符串的问题好像并没有被解决呢
nfcA.transceive获取的结果ArrayBuffer解析成字符串乱码?目标:手机nfc识别ic卡获取ic卡的信息; 问题:nfcA.transceive获取的结果ArrayBuffer解析成字符串乱码,用decodeURIComponent报错:url malformed 手机:华为p30,EMUI:11.0.0,安卓10 ps:使用名叫“nfc读写”的小程序识别卡片可以得到一个类似id的的信息,如AD2A04AF 代码如下: const app = getApp(); var NFCAdapter = wx.getNFCAdapter(); Page({ data: { id: "" }, onShow() { NFCAdapter.startDiscovery({ success: res => { this.init(); }, fail: error => { console.log(error) } }) }, str2ab(str) { var buf = new ArrayBuffer(str.length * 2); var bufView = new Uint16Array(buf); for (var i = 0, strLen = str.length; i < strLen; i++) { bufView[i] = str.charCodeAt(i); } return buf; }, init() { NFCAdapter.onDiscovered(callback => { if (callback.techs.includes(NFCAdapter.tech.nfcA)) { const nfcA = NFCAdapter.getNfcA(); app.nfcA = nfcA; nfcA.connect({ success: res => { nfcA.transceive({ data: this.str2ab('GET DATA'), success: res => { console.log(res.data) //打印结果 <ArrayBuffer:byteLength=16> let k = String.fromCharCode.apply(null, new Uint16Array(res.data)); console.log(k) // k为乱码 console.log(decodeURIComponent(escape(k))) // 这里报错:url malformed }, fail: error => { console.log(error) } }) } }) } }) }, })
2023-01-12我也碰到这个问题了,请问解决了么
使用Canvas 旧接口部分图片多次旋转后在iphone设备上被截,有遇到相同情况么?system: "iOS 14.5.1" version: "8.0.7" SDKVersion: "2.17.3 model: "iPhone 12<iPhone13,2>" [图片]
2022-02-17请问楼主解决了么,求把解决方案丢出来学习一下呗
新的canvas的drawImage不支持本地tmp路径的临时文件吗?【貌似官方修复了这个问题。现在可以了。】 https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.drawImage.html drawImage( )不支持本地tmp路径的临时文件,谨慎使用,太坑了。 写法1. ``` path = 'tmp/wxf65e9ae5f68283d2.o6zAJs5h4IkyHaGS7_j6gUPGTR9c.arwyj04Eq2ok341457e272957e237fa21d743912f60b.jpg' ctx.drawImage(path, 0, 0, width, height, 0, 0, canvasWidth, canvasHeight) ``` 提示:Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The provided value is not of type '(CSSImageValue or HTMLImageElement or SVGImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap or OffscreenCanvas)';at SelectorQuery callback function 写法2. ``` const img = canvas.createImage() img.src = path img.onload = () =>{ ctx.drawImage(img, 0, 0, width, height, 0, 0, canvasWidth, canvasHeight) } ``` 提示:tmp/wxf65e9ae5f68283d2.o6zAJs5h4IkyHaGS7_j6gUPGTR9c.arwyj04Eq2ok341457e272957e237fa21d743912f60b.jpg:1 GET http://tmp/wxf65e9ae5f68283d2.o6zAJs5h4IkyHaGS7_j6gUPGTR9c.arwyj04Eq2ok341457e272957e237fa21d743912f60b.jpg net::ERR_PROXY_CONNECTION_FAILED
2020-08-21我也碰到了 好尴尬的问题
input和textarea的placeholder问题1、在input中设置: text-align: right 在iOS中没有问题,在安卓中获取焦点时光标在提示文字左边,输入文字后正常;[图片] 2、在textarea中设置: text-align: right 安卓正常,iOS提示文字还是靠左显示; [图片]
2018-06-30