2021-05-18 16:29:34 +08:00
|
|
|
<template>
|
|
|
|
<view class="web-view">
|
|
|
|
<web-view :webview-styles="webviewStyles" :src="src"></web-view>
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2022-04-02 18:32:01 +08:00
|
|
|
import configs from "@/config/config";
|
|
|
|
import storage from "@/utils/storage";
|
2021-05-18 16:29:34 +08:00
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
2022-04-02 18:32:01 +08:00
|
|
|
configs,
|
|
|
|
storage,
|
2021-05-18 16:29:34 +08:00
|
|
|
webviewStyles: {
|
|
|
|
progress: {
|
|
|
|
color: this.$lightColor,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
src: "",
|
|
|
|
};
|
|
|
|
},
|
|
|
|
onLoad(params) {
|
2022-09-23 08:44:44 +08:00
|
|
|
// params.IM ? (this.src = `${configs.imWebSrc}?token=${storage.getAccessToken()}&id=${params.IM}`): (this.src = decodeURIComponent(params.src));
|
|
|
|
if(params.IM)
|
|
|
|
{
|
|
|
|
if(params.IM==0)
|
|
|
|
{
|
|
|
|
this.src = `${configs.imWebSrc}?token=${storage.getAccessToken()}`;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
this.src = `${configs.imWebSrc}?token=${storage.getAccessToken()}&id=${params.IM}`;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
this.src = decodeURIComponent(params.src);
|
|
|
|
console.log(this.src);
|
|
|
|
}
|
|
|
|
|
2021-05-18 16:29:34 +08:00
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.web-view {
|
|
|
|
/deep/ .web-view {
|
|
|
|
padding: 0;
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
}
|
2022-04-02 18:32:01 +08:00
|
|
|
</style>
|