标签:mon fun load ber car XML char rom number
var xmlhttp;
xmlhttp=new XMLHttpRequest();
xmlhttp.open("GET",userUrl2 + ‘user/getQrCode‘+accessToken+"&name="+item.name+"&phone="+item.phoneNumber+"&company="+item.companyName,true);
xmlhttp.responseType = "arraybuffer";
xmlhttp.onload = function(){
// console.log(this);
var res=this.response;
if (this.status == 200) {
var code = ‘data:image/png;base64,‘ + btoa(new Uint8Array(res).reduce((data, byte) => data + String.fromCharCode(byte), ‘‘))
editMode.find(‘#edit-BelongCard‘).attr(‘src‘, code)
}
}
xmlhttp.send();
稍微改动过:
var xmlhttp;
xmlhttp=new XMLHttpRequest();
xmlhttp.open("GET",userUrl2 + ‘user/getQrCode‘+accessToken+"&name="+item.name+"&phone="+item.phoneNumber+"&company="+item.companyName,true);
xmlhttp.responseType = "arraybuffer";
xmlhttp.onload = function(){
// console.log(this);
var res=this.response;
if (this.status == 200) {
// var code = ‘data:image/png;base64,‘ + btoa(new Uint8Array(res).reduce((data, byte) => data + String.fromCharCode(byte), ‘‘))
var bytes = new Uint8Array(res);
var storeData = "";
var len = bytes.byteLength;
for (var i = 0; i < len; i++) {
storeData += String.fromCharCode(bytes[i]);
}
var code=‘data:image/png;base64,‘+ window.btoa(storeData);
common.find(‘#detail-businessCardFront‘).attr(‘src‘, code);//专属凭证
}
}
xmlhttp.send();
标签:mon fun load ber car XML char rom number
原文地址:https://www.cnblogs.com/dada521jj/p/12625264.html