Files
Hfive/pages/webview/webview.vue
魏啾 56863dd624 H5
2024-04-30 18:07:59 +08:00

35 lines
647 B
Vue

<template>
<web-view :src="url"></web-view>
</template>
<script>
export default {
data() {
return {
url: '', //PDF路径
};
},
onLoad(options) {
console.log(options)
if (options.tape == 1) {
this.url = options.url;
} else {
uni.request({
url: uni.conf.baseUrl + 'szzpy/downloadurl',
data: {
//参数
id: options.id
},
method: 'POST', //请求方式,必须为大写
success: res => {
let fileUrl = options.url
this.url = 'http://www.pfile.com.cn/api/profile/onlinePreview?url=' +
encodeURIComponent(res.data.data);
}
});
}
}
};
</script>