35 lines
968 B
HTML
35 lines
968 B
HTML
<!--#
|
|
layout("/mobile/platform.html"){
|
|
#-->
|
|
|
|
<div id="app" v-cloak>
|
|
<van-nav-bar title="慰问品画册" left-arrow placeholder fixed
|
|
@click-left="history.back()"></van-nav-bar>
|
|
|
|
<iframe v-if="pdfUrl" :src="pdfUrl"
|
|
style="width: 100%; height: calc(100vh - 46px); border: 0; display: block;"></iframe>
|
|
<van-empty v-else description="暂无预览文件"></van-empty>
|
|
</div>
|
|
|
|
<script>
|
|
var vue = new Vue({
|
|
el: '#app',
|
|
mixins: [mobileMixins],
|
|
data() {
|
|
return {
|
|
pdfUrl: ''
|
|
}
|
|
},
|
|
async created() {
|
|
const file = GetQueryString('file')
|
|
if (file) {
|
|
// 预览地址通过参数传入,使用当前页面 iframe 承载 PDF.js,保留应用返回导航。
|
|
this.$set(this, 'pdfUrl', '/assets/platform/plugins/pdfJs/web/viewer.html?file=' + file)
|
|
}
|
|
}
|
|
})
|
|
</script>
|
|
<!--#
|
|
}
|
|
#-->
|