H5
This commit is contained in:
35
pages/webview/webview.vue
Normal file
35
pages/webview/webview.vue
Normal file
@@ -0,0 +1,35 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user