修改webview

This commit is contained in:
tangxinyue 2026-04-30 15:26:27 +08:00
parent 1601a3e4ae
commit 3586dc4a35
5 changed files with 304 additions and 285 deletions

View File

@ -183,7 +183,9 @@ export default {
//
const devConfig = {
host: "https://flaunt.batiao8.com/",
header: { "x-token": "da884e6e-fbd7-4d8d-ab0e-cb7b07f9f6fa" },
header: {
"x-token": "ebe42caa-845a-4cb2-a324-18abe8ced7c0"
},
decrypt: "e4rOtnF8tJjtHO7ecZeJHN1rapED5ImB",
encrypt: "xn08hYoizXhZ1zHP8DVqfCm2yHxPmhil"
}

View File

@ -29,7 +29,7 @@ export function createApp() {
app.config.globalProperties.$system = plus.os.name;
// #endif
app.config.globalProperties.$systemInfo = systemInfo
uni.setStorageSync('version', '1.0.4.sp21')
uni.setStorageSync('version', '1.0.4.sp23')
app.config.globalProperties.$version = uni.getStorageSync('version')
app.use(globalMethods);
return {

View File

@ -1,7 +1,11 @@
<!-- pages/webview/webview.vue -->
<template>
<view class="webview-container">
<navBar class="nav-bar" :title="pageTitle" :bgColor="data.navBar.bgColor" isBack></navBar>
<navBar class="nav-bar" :title="pageTitle" :bgColor="data.navBar.bgColor" isBack>
<template v-if="isClose" v-slot:right>
<image style="width:22px;height: 22px;" src='/static/image/close.png' @click="onConfirm()"></image>
</template>
</navBar>
<web-view :src="url" :webview-styles="webviewStyles"></web-view>
</view>
</template>
@ -10,7 +14,9 @@
//
// import ZdyNavbar from "@/components/navbar/navbar.vue"
import navBar from '@/components/nav-bar/nav-bar.vue'
import { util } from '@/utils/common.js'
import {
util
} from '@/utils/common.js'
import {
ref,
@ -37,16 +43,21 @@ const data = reactive({
dark: "dark",
//
systemBarHeight: "0",
isClose: false
})
let {
systemBarHeight
systemBarHeight,
isClose
} = toRefs(data)
const url = ref('')
const pageTitle = ref('')
onLoad((options) => {
if (options.isClose) {
isClose.value = options.isClose
}
uni.getSystemInfo({
success: res => {
systemBarHeight.value = res.statusBarHeight; //
@ -81,6 +92,12 @@ onShow(() => {
// #endif
})
const onConfirm = () => {
uni.reLaunch({
url: '/pages/index/index'
})
}
const goBack = () => {
uni.navigateBack()
}

View File

@ -529,7 +529,7 @@ const clickNotice = () => {
console.log("点击公告", noticeInfo.value)
if (!noticeInfo.value.url) return
const url = noticeInfo.value.url + `&uni_id=${userInfo.value.user_id}`
util.goPage(`/pages/common/webview/webview?url=${encodeURIComponent(url)}&title=${noticeInfo.value.title}`)
util.goPage(`/pages/common/webview/webview?url=${encodeURIComponent(url)}&title=${noticeInfo.value.title}&isClose=${true}`)
}
/**

BIN
static/image/close.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B