优化预览路径

pull/2/head
jwg 6 months ago
parent 121b97b5ce
commit e57a20cca6

@ -14,4 +14,7 @@ VUE_APP_API= '/'
# 方楠 # 方楠
# VUE_APP_BASE_API = 'https://2537287x0n.imdo.co' # VUE_APP_BASE_API = 'https://2537287x0n.imdo.co'
VUE_APP_BASE_API = '/proxy-api' VUE_APP_BASE_API = '/proxy-api'
#线上预览
VUE_APP_ONLINE_API = 'http://139.224.253.31:48012'

@ -13,5 +13,10 @@ VUE_APP_API= '/'
# 请求环境 # 请求环境
# 方楠 # 方楠
VUE_APP_BASE_API = 'http://one-h5.lyrfp.com' # VUE_APP_BASE_API = 'http://one-h5.lyrfp.com'
# 开发环境 不要删
VUE_APP_BASE_API = 'http://192.168.3.128:58088'
# VUE_APP_BASE_API = 'http://60.204.223.58:8080' # VUE_APP_BASE_API = 'http://60.204.223.58:8080'
#线上预览
VUE_APP_ONLINE_API = 'http://139.224.253.31:48012'

@ -1,13 +1,27 @@
<!-- --> <!-- -->
<template> <template>
<div> <div>
<iframe v-if="showFdf" :src="url" frameborder="0" :class="fullscreen?'ifarmefullscreen':'ifarme'"></iframe> <iframe
<iframe :src="previewUrl + encodeURIComponent(base64Encode(url))" frameborder="0" style="width:100%;height:80vh;"></iframe> v-if="showFdf"
:src="url"
frameborder="0"
:class="fullscreen ? 'ifarmefullscreen' : 'ifarme'"
></iframe>
<iframe
:src="previewUrl + encodeURIComponent(base64Encode(url))"
frameborder="0"
style="width: 100%; height: 80vh"
></iframe>
<div class="sumbit-box"> <div class="sumbit-box">
<div class="item-box" v-for="(item,index) in btnList" :key="index" @click="handleBack(item.key)"> <div
class="item-box"
v-for="(item, index) in btnList"
:key="index"
@click="handleBack(item.key)"
>
<van-icon :name="item.icon" :color="item.color" size="25" /> <van-icon :name="item.icon" :color="item.color" size="25" />
<div class="box-tt"> <div class="box-tt">
<span :style="`color:${item.color}`"> {{item.title}}</span> <span :style="`color:${item.color}`"> {{ item.title }}</span>
</div> </div>
</div> </div>
</div> </div>
@ -16,44 +30,40 @@
<script> <script>
export default { export default {
name: '', name: "",
created() { created() {
this.handleSetFile() this.handleSetFile();
}, },
data() { data() {
return { return {
showFdf: false, showFdf: false,
// previewUrl: 'http://60.204.223.58:8086/onlinePreview?url=', // previewUrl: 'http://60.204.223.58:8086/onlinePreview?url=',
// KKFileView // KKFileView
previewUrl: 'http://139.224.253.31:48012/onlinePreview?url=', // previewUrl: 'http://139.224.253.31:48012/onlinePreview?url=',
url: '', previewUrl: process.env.VUE_APP_ONLINE_API + "/onlinePreview?url=",
btnList: [ url: "",
{ title: '返回', icon: 'revoke', color: "#909399", key: 0 }, btnList: [{ title: "返回", icon: "revoke", color: "#909399", key: 0 }],
] };
}
}, },
methods: { methods: {
base64Encode(url) { base64Encode(url) {
if (url) { if (url) {
return this.$Base64.encode(url) return this.$Base64.encode(url);
} }
}, },
handleBack() { handleBack() {
history.back() history.back();
}, },
handleSetFile() { handleSetFile() {
this.url = this.$route.query.url this.url = this.$route.query.url;
} },
}, },
components: {}, components: {},
computed: {}, computed: {},
};
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import '~@/assets/style/common/form.scss'; @import "~@/assets/style/common/form.scss";
</style> </style>

Loading…
Cancel
Save