Files
lucky_shop/pages_tool/webview/webview.vue
ZF sun 1b2a8f83c2 refactor: 优化webview页面和util.js中链接处理逻辑
将链接参数拼接逻辑移至util.js中处理,统一各端链接处理方式
2026-05-30 17:12:36 +08:00

48 lines
872 B
Vue

<template>
<view :style="themeColor">
<view class="iconfont iconshang navigate-back" @click="navigateBack"></view>
<web-view :src="src"></web-view>
<!-- 隐私弹窗 -->
<privacy-popup ref="privacyPopup"></privacy-popup>
</view>
</template>
<script>
import { decodeEntity } from '@/common/js/util.js';
export default {
data() {
return {
src: ''
};
},
onLoad(option) {
// #ifdef H5
this.src = decodeEntity(decodeURIComponent(option.src));
// #endif
// #ifndef H5
this.src = decodeEntity(decodeURIComponent(`${option.src}&from=mp-webview`));
// #endif
},
methods: {
navigateBack() {
uni.navigateBack({
delta: 1
});
}
}
};
</script>
<style lang="scss">
.navigate-back {
position: absolute;
top: 34rpx;
left: 34rpx;
z-index: 5;
font-size: $font-size-toolbar;
}
</style>