46 lines
970 B
Vue
46 lines
970 B
Vue
<template>
|
|
<view class="join-page">
|
|
<!-- 使用 web-view 嵌入外部网页 -->
|
|
<web-view :src="webUrl" @message="handleMessage" @error="handleError"></web-view>
|
|
</view>
|
|
</template>
|
|
|
|
<script setup>
|
|
import {
|
|
ref,
|
|
onMounted
|
|
} from 'vue'
|
|
|
|
// 外部网页地址
|
|
const webUrl = ref('https://joininvestment.gxfs123.com/')
|
|
|
|
// 处理来自 web-view 的消息(如果外部网页有通过 postMessage 发送消息)
|
|
const handleMessage = (e) => {
|
|
console.log('收到来自 web-view 的消息:', e)
|
|
// 可以根据消息内容进行相应处理
|
|
}
|
|
|
|
// 处理 web-view 加载错误
|
|
const handleError = (e) => {
|
|
console.error('web-view 加载错误:', e)
|
|
uni.showToast({
|
|
title: '页面加载失败',
|
|
icon: 'none',
|
|
duration: 2000
|
|
})
|
|
}
|
|
|
|
onMounted(() => {
|
|
console.log('招商页面加载,外部网址:', webUrl.value)
|
|
})
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.join-page {
|
|
width: 100%;
|
|
height: 100vh;
|
|
overflow: hidden;
|
|
}
|
|
</style>
|
|
|