feat(live获取失败时的处理机制
-Room): 添加直播内容 在播放器初始化失败时,弹出对话框提示用户直播内容获取失败 - 提供刷新页面重新获取直播内容的选项 - 使用 vant 的 showDialog 组件实现对话框功能
This commit is contained in:
parent
50fe1248e3
commit
9812cd7903
@ -9,6 +9,7 @@ import paymentResults from '@/pages/liveRoom/components/PaymentResults/index.vue
|
|||||||
import paymentInput from '@/pages/liveRoom/components/PaymentInput/index.vue'
|
import paymentInput from '@/pages/liveRoom/components/PaymentInput/index.vue'
|
||||||
import {goodStore} from "@/stores/goods/index.js"
|
import {goodStore} from "@/stores/goods/index.js"
|
||||||
import {message} from "~/components/x-message/useMessage.js"
|
import {message} from "~/components/x-message/useMessage.js"
|
||||||
|
import { showDialog } from 'vant';
|
||||||
import {artworkBuy} from "@/api/goods/index.js"
|
import {artworkBuy} from "@/api/goods/index.js"
|
||||||
const player = ref(null)
|
const player = ref(null)
|
||||||
const {quoteStatus, show, playerId, show1, auctionData, getSocketData, getLiveLink,fullLive} = liveStore()
|
const {quoteStatus, show, playerId, show1, auctionData, getSocketData, getLiveLink,fullLive} = liveStore()
|
||||||
@ -47,6 +48,14 @@ const initializePlayer = async () => {
|
|||||||
|
|
||||||
player.value.on('error', handlePlayerError)
|
player.value.on('error', handlePlayerError)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
showDialog({
|
||||||
|
message: '直播内容获取失败,是否刷新页面重新获取',
|
||||||
|
}).then(() => {
|
||||||
|
location.reload()
|
||||||
|
// on close
|
||||||
|
}) .catch(() => {
|
||||||
|
// on cancel
|
||||||
|
});;
|
||||||
console.error('播放器初始化失败:', error)
|
console.error('播放器初始化失败:', error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user