小程序优化

This commit is contained in:
2026-01-22 11:36:26 +08:00
parent 8ab6107f25
commit 12d9294f3d
5 changed files with 173 additions and 96 deletions

View File

@@ -284,27 +284,25 @@ function handleWebViewError(e: any) {
// 复制会议链接
function copyUrl() {
if (!meetingUrl.value) {
// 获取页面参数
const pages = getCurrentPages()
const currentPage = pages[pages.length - 1] as any
// 优先检查页面参数中是否有jitsiIframeUrl
let fullMeetingUrl = ''
// 检查是否直接传递了jitsiIframeUrl参数
const jitsiIframeUrl = currentPage?.options?.jitsiIframeUrl || ''
if (jitsiIframeUrl) {
fullMeetingUrl = jitsiIframeUrl
} else if (meetingUrl.value) {
// 兼容老版本使用meetingUrl
fullMeetingUrl = meetingUrl.value
} else {
uni.showToast({ title: '会议链接为空', icon: 'none' })
return
}
// 解析iframeUrl并构建完整的会议链接
let fullMeetingUrl = meetingUrl.value
// 检查是否为微信小程序环境
// #ifdef MP-WEIXIN
// 获取页面参数中的iframeUrl
const pages = getCurrentPages()
const currentPage = pages[pages.length - 1] as any
const iframeUrl = currentPage?.options?.iframeUrl || ''
if (iframeUrl) {
// 构建正确的会议链接MEET_URL + iframeUrl
fullMeetingUrl = `${MEET_URL}${iframeUrl}`
}
// #endif
uni.setClipboardData({
data: fullMeetingUrl,
success: () => {
@@ -318,27 +316,25 @@ function copyUrl() {
// 在浏览器中打开
function openInBrowser() {
if (!meetingUrl.value) {
// 获取页面参数
const pages = getCurrentPages()
const currentPage = pages[pages.length - 1] as any
// 优先检查页面参数中是否有jitsiIframeUrl
let fullMeetingUrl = ''
// 检查是否直接传递了jitsiIframeUrl参数
const jitsiIframeUrl = currentPage?.options?.jitsiIframeUrl || ''
if (jitsiIframeUrl) {
fullMeetingUrl = jitsiIframeUrl
} else if (meetingUrl.value) {
// 兼容老版本使用meetingUrl
fullMeetingUrl = meetingUrl.value
} else {
uni.showToast({ title: '会议链接为空', icon: 'none' })
return
}
// 解析iframeUrl并构建完整的会议链接
let fullMeetingUrl = meetingUrl.value
// 检查是否为微信小程序环境且会议链接不是完整的MEET_URL格式
// #ifdef MP-WEIXIN
// 获取页面参数中的iframeUrl
const pages = getCurrentPages()
const currentPage = pages[pages.length - 1] as any
const iframeUrl = currentPage?.options?.iframeUrl || ''
if (iframeUrl) {
// 构建正确的会议链接MEET_URL + iframeUrl
fullMeetingUrl = `${MEET_URL}${iframeUrl}`
}
// #endif
// #ifdef MP-WEIXIN
// 微信小程序:先复制链接,然后提示用户通过右上角菜单在浏览器中打开
uni.setClipboardData({