diff --git a/v4/views/attract/projectList.vue b/v4/views/attract/projectList.vue index ebcf627..208fe73 100644 --- a/v4/views/attract/projectList.vue +++ b/v4/views/attract/projectList.vue @@ -34,6 +34,7 @@ export default { pages: 0, // 总页数 list: [], os: '', + isClick: false, // 防止连续点击重复请求/跳转 pageKeyId: Object.freeze('investmentList') } }, @@ -41,6 +42,10 @@ export default { this.getOS() this.getData() }, + onShow() { + // 从文件阅读页返回时解锁,允许再次点击 + this.isClick = false + }, onReachBottom() { if (this.pages >= this.page) this.getData() }, @@ -67,6 +72,8 @@ export default { }) }, getDetail(id) { + if (this.isClick) return + this.isClick = true investmentInfo(id).then(({data}) => { const file = data.contents[0]; if (file.suffix === 'pdf' && this.os === 'android') { @@ -77,6 +84,8 @@ export default { url: '/pkg_common/views/pdf?path=' + encodeURI(path) + '&id=' + id }) } + }).catch(() => { + this.isClick = false }) }, viewPdf(url) { @@ -89,8 +98,10 @@ export default { fileType: 'pdf', success: result => { //成功 + this.isClick = false }, fail: err => { + this.isClick = false uni.showModal({ title: 'openDocument fail', content: JSON.stringify(err) @@ -99,6 +110,7 @@ export default { }) }, fail: err => { + this.isClick = false uni.showModal({ title: 'downloadFile fail', content: JSON.stringify(err)