From 9812cd7903c7d246531fc0878a44e1c9f50b622c Mon Sep 17 00:00:00 2001 From: xingyy <64720302+Concur-max@users.noreply.github.com> Date: Tue, 11 Feb 2025 15:58:35 +0800 Subject: [PATCH] =?UTF-8?q?feat(live=E8=8E=B7=E5=8F=96=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E6=97=B6=E7=9A=84=E5=A4=84=E7=90=86=E6=9C=BA=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Room): 添加直播内容 在播放器初始化失败时,弹出对话框提示用户直播内容获取失败 - 提供刷新页面重新获取直播内容的选项 - 使用 vant 的 showDialog 组件实现对话框功能 --- app/pages/liveRoom/index.client.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/pages/liveRoom/index.client.vue b/app/pages/liveRoom/index.client.vue index 9a0288d..aea7fe5 100644 --- a/app/pages/liveRoom/index.client.vue +++ b/app/pages/liveRoom/index.client.vue @@ -9,6 +9,7 @@ import paymentResults from '@/pages/liveRoom/components/PaymentResults/index.vue import paymentInput from '@/pages/liveRoom/components/PaymentInput/index.vue' import {goodStore} from "@/stores/goods/index.js" import {message} from "~/components/x-message/useMessage.js" +import { showDialog } from 'vant'; import {artworkBuy} from "@/api/goods/index.js" const player = ref(null) const {quoteStatus, show, playerId, show1, auctionData, getSocketData, getLiveLink,fullLive} = liveStore() @@ -47,6 +48,14 @@ const initializePlayer = async () => { player.value.on('error', handlePlayerError) } catch (error) { + showDialog({ + message: '直播内容获取失败,是否刷新页面重新获取', + }).then(() => { + location.reload() + // on close + }) .catch(() => { + // on cancel + });; console.error('播放器初始化失败:', error) } }