diff --git a/pages/checkList/checkList.vue b/pages/checkList/checkList.vue index fae5f8e..f2491b3 100644 --- a/pages/checkList/checkList.vue +++ b/pages/checkList/checkList.vue @@ -162,11 +162,7 @@ }, downLoad(item) { console.log(item) - if (item.file_suffix == 'png') { - uni.previewImage({ - urls: [item.path] - }) - } else { + if (item.file_suffix == 'pdf') { uni.downloadFile({ url: item.path, success: (data) => { @@ -200,6 +196,11 @@ }) } }); + + } else { + uni.previewImage({ + urls: [item.path] + }) } }, goProgress(item){ diff --git a/pages/taskDetail/taskDetail.vue b/pages/taskDetail/taskDetail.vue index 9443f1c..b67fda5 100644 --- a/pages/taskDetail/taskDetail.vue +++ b/pages/taskDetail/taskDetail.vue @@ -208,11 +208,7 @@ }, downLoad(item) { - if (this.contentInfo.file_suffix == 'png') { - uni.previewImage({ - urls: [item] - }) - } else { + if (this.contentInfo.file_suffix == 'pdf') { uni.downloadFile({ url: item, success: (data) => { @@ -246,6 +242,11 @@ }) } }); + + } else { + uni.previewImage({ + urls: [item] + }) } }, async afterRead(event) {