- scroll-view下拉刷新暴力使用后无法复位?
官方scroll-view的例子,只是把列表的数据减少到不足一屏的数据就会产生这个问题 如图:下拉是可以复位的,只是快速拉暴力使用就会导致卡帧,loading卡在那复位不了 [图片] wxml <scroll-view scroll-y style="width: 100%; height: 100vh;" refresher-enabled="{{true}}" refresher-threshold="{{100}}" refresher-triggered="{{triggered}}" bindrefresherpulling="onPulling" bindrefresherrefresh="onRefresh" bindrefresherrestore="onRestore" bindrefresherabort="onAbort"> <view wx:for="{{arr}}" style="display: flex; height: 100px; background-color: #eee;"> </view> </scroll-view> js Page({ data: { arr: [], triggered: false, }, onReady: function () { const arr = [] for (let i = 0; i < 2; i++) arr.push(i) this.setData({ arr }) setTimeout(() => { this.setData({ triggered: true, }) }, 1000) }, onPulling(e) { console.log(this.data.triggered); }, onRefresh() { if (this._freshing) return this._freshing = true setTimeout(() => { this.setData({ triggered: false, }) this._freshing = false }, 300) }, onRestore(e) { console.log(this.data.triggered); }, onAbort(e) { console.log(this.data.triggered); }, })
2023-08-29 - downloadFile通过流下来的xls提示文件格式和扩展名不匹配,求大神指导下?
const filePath = `${ wx.env.USER_DATA_PATH}/${projectName}.xls`; wx.downloadFile({ url: "http://192.168.100.33:8096/devled" + "/api/project/exportAioResult?myNo=" + id, header: { "Authorization": userInfo ? JSON.parse(userInfo).token : "eyJhbGciOiJIUzUxVs_C0x1_r_u1nTY6gQPJYPclBh-Mg" }, filePath: filePath, responseType: "arraybuffer", //注意这里的responseType success: function (res) { console.log(res) wx.openDocument({ filePath: res.filePath, fileType: 'xls', success: function () { console.log('打开文档成功') }, fail: function () { console.log('打开失败'); } }) } }) 结果 [图片] [图片] 点是可以在PC上打开,手机打不开
2022-05-20