You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
fude/pages/webview/webview.vue

38 lines
700 B

<template>
<!-- <web-view :src="urlText" v-if="bool"></web-view> -->
</template>
<script>
export default {
data() {
return {
urlText: '',
bool:false
}
},
onLoad(e) {
console.log(e,"000000");
let url = e.url
// setTimeout(()=>{
// this.urlText = 'https://test-www.first315.com/uploads/20230730/e9c73e97dc412fc6b21bad4900b4d2ee.pdf';
// this.bool = true
// },500)
uni.downloadFile({
url: url,
success: function(res) {
const filePath = res.tempFilePath;
wx.openDocument({
filePath: filePath,
success: function(res) {
console.log('打开文档成功');
}
});
}
});
}
}
</script>
<style>
</style>