jeecgBootUniapp/src/pages/onlinePreview/onlinePreview.vue
yangzhq68909 3424a06b36 11
2025-05-13 17:17:47 +08:00

54 lines
1.2 KiB
Vue

<route lang="json5" type="page">
{
layout: 'default',
style: {
navigationStyle: 'custom',
navigationBarTitleText: '在线预览',
},
}
</route>
<template>
<view :class="{ 'gray': appStore.isGray == 1 }">
<wd-navbar left-text="返回" left-arrow
custom-style="padding-top: var(--status-bar-height, 0); background-image: linear-gradient(to right, #1890ff, #096dd9); color: #fff;"
@click-left="handleClickLeft">
</wd-navbar>
<iframe id="bdIframe" :src="fileUrl" ref="bdIframe" style="border: none;" class="iframe" />
</view>
</template>
<script setup>
import {
useAppStore
} from '@/store'
import {
onLoad
} from '@dcloudio/uni-app';
import Base64 from '@/utils/code';
import {
getEnvBaseUrl
} from '@/utils/index'
const appStore = useAppStore();
var fileUrl = "";
const handleClickLeft = () => {
uni.navigateBack()
}
onLoad((options) => {
let base64 = new Base64();
var url = getEnvBaseUrl() + '/sys/common/static/' + options.data;
console.log('-----111',url)
fileUrl = 'https://36.112.48.190/preview/onlinePreview?url=' + encodeURIComponent(base64.encode(url))
console.log('-----222',fileUrl)
})
</script>
<style>
#bdIframe {
position: absolute;
top: 10;
left: 0;
width: 100%;
height: 100%;
}
</style>