[图片]
微信公众号我开始选择个人,后面可以升级企业吗?微信公众号我开始选择个人,后面可以升级企业吗
2023-12-02function download (url, fileName) { const x = new XMLHttpRequest() x.responseType = 'blob' x.open('GET', url, true) x.send() x.onload = () => { const downloadElement = document.createElement('a') const href = window.URL.createObjectURL(x.response) // create download url downloadElement.href = href downloadElement.download = fileName // set filename (include suffix) document.body.appendChild(downloadElement) // append <a> downloadElement.click() // click download document.body.removeChild(downloadElement) // remove <a> window.URL.revokeObjectURL(href) // revoke blob } } export { download }
微信内置浏览器下载pdf的时候标题为null?[图片][图片]
2023-05-19[代码]// 多图上传[代码][代码]choosePhoto(e){[代码][代码] [代码][代码]var[代码] [代码]that = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]wx.chooseImage({[代码][代码] [代码][代码]count: 6, [代码][代码]// 默认9[代码][代码] [代码][代码]sizeType: [[代码][代码]'original'[代码][代码], [代码][代码]'compressed'[代码][代码]], [代码][代码]// 可以指定是原图还是压缩图,默认二者都有[代码][代码] [代码][代码]sourceType: [[代码][代码]'album'[代码][代码], [代码][代码]'camera'[代码][代码]], [代码][代码]// 可以指定来源是相册还是相机,默认二者都有[代码][代码] [代码][代码]success: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]// 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片[代码][代码] [代码][代码]var[代码] [代码]len = res.tempFilePaths.length;[代码][代码] [代码][代码]for[代码][代码]([代码][代码]var[代码] [代码]i=0;i<len;i++){[代码][代码] [代码][代码]that.data.picLists.push(res.tempFilePaths[i])[代码][代码] [代码][代码]}[代码][代码] [代码][代码]var[代码] [代码]imgs = that.data.picLists.length;[代码][代码] [代码][代码]console.log(imgs)[代码][代码] [代码][代码]if[代码] [代码](imgs >= 6) {[代码][代码] [代码][代码]that.data.aShow = [代码][代码]true[代码][代码];[代码][代码] [代码][代码]that.data.picLists.length = 6[代码][代码] [代码][代码]}[代码][代码]else[代码][代码]{[代码][代码] [代码][代码]that.data.aShow = [代码][代码]false[代码][代码];[代码][代码] [代码][代码]}[代码][代码] [代码][代码]that.setData({[代码][代码] [代码][代码]picLists: that.data.picLists,[代码][代码] [代码][代码]tShow: [代码][代码]true[代码][代码],[代码][代码] [代码][代码]aShow: that.data.aShow[代码][代码] [代码][代码]})[代码][代码] [代码][代码]console.log(that.data.picLists)[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码]},[代码]
wx.uploadFile一次性上传多图怎么弄啊?[代码][代码][代码]wx.chooseImage({[代码][代码] [代码][代码]success: [代码][代码]function[代码][代码](res) {[代码][代码] [代码][代码]var[代码] [代码]tempFilePaths = res.tempFilePaths//确定是一个多图的数组[代码][代码] [代码][代码]wx.uploadFile({[代码][代码] [代码][代码]url: [代码][代码]'http://192.168.11.168/kljjd/home/report/add/'[代码][代码],[代码][代码] [代码][代码]filePath: tempFilePaths,[代码][代码]//这里是多个不行, tempFilePaths[0]这样可以[代码][代码] [代码][代码]name: [代码][代码]'file[]'[代码][代码],[代码][代码]//我尝试这样写也不行[代码][代码] [代码][代码]formData:{[代码][代码] [代码][代码]'user'[代码][代码]: [代码][代码]'test'[代码][代码] [代码][代码]},[代码][代码] [代码][代码]success: [代码][代码]function[代码][代码](res){[代码][代码] [代码][代码]util.debug(res);[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码]})[代码] [代码]//控制台提示 WAService.js:1 uploadFile:fail parameter error: parameter.filePath should be String instead of Array;[代码]别告诉我要循环多次一张张的上传啊?
2018-07-27