123
This commit is contained in:
parent
779dc84356
commit
a0d3b2b329
@ -31,7 +31,7 @@ const subTitle = computed(() => {
|
|||||||
return route.meta.subTitle ? t(route.meta.subTitle) : ''
|
return route.meta.subTitle ? t(route.meta.subTitle) : ''
|
||||||
})
|
})
|
||||||
const showLeftArrow = computed(() => route.name && routeWhiteList.includes(route.name))
|
const showLeftArrow = computed(() => route.name && routeWhiteList.includes(route.name))
|
||||||
console.log('route.name',route.name)
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -29,7 +29,6 @@ onMounted(async () => {
|
|||||||
stripe.value = window.Stripe("pk_test_51QfbSAAB1Vm8VfJq3AWsR4k2mZjnlF7XFrmlbc6XVXrtwXquAUfwzZmOFDbxMIAwqJBgqao8KLt2wmPc4vNOCTeo00WB78KtfV")
|
stripe.value = window.Stripe("pk_test_51QfbSAAB1Vm8VfJq3AWsR4k2mZjnlF7XFrmlbc6XVXrtwXquAUfwzZmOFDbxMIAwqJBgqao8KLt2wmPc4vNOCTeo00WB78KtfV")
|
||||||
await initialize()
|
await initialize()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Stripe initialization error:', error)
|
|
||||||
showMessage("Failed to initialize payment system")
|
showMessage("Failed to initialize payment system")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -67,14 +66,12 @@ const initialize = async () => {
|
|||||||
throw new Error("Payment element mount point not found")
|
throw new Error("Payment element mount point not found")
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Payment Element initialization error:', error)
|
|
||||||
showMessage("Failed to load payment form")
|
showMessage("Failed to load payment form")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleSubmit = async () => {
|
const handleSubmit = async () => {
|
||||||
if (!stripe.value || !elements.value) {
|
if (!stripe.value || !elements.value) {
|
||||||
console.error('Stripe or Elements not initialized')
|
|
||||||
showMessage("Payment system not initialized")
|
showMessage("Payment system not initialized")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -97,7 +94,6 @@ const handleSubmit = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('Payment confirmation error:', e)
|
|
||||||
showMessage("Payment processing failed")
|
showMessage("Payment processing failed")
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
|
@ -18,7 +18,6 @@ let container = null // DOM容器元素
|
|||||||
*/
|
*/
|
||||||
export const showMinWindow1 = (props = {}) => {
|
export const showMinWindow1 = (props = {}) => {
|
||||||
// 服务端渲染时直接返回
|
// 服务端渲染时直接返回
|
||||||
console.log('!process.client',!process.client)
|
|
||||||
if (!process.client) return null
|
if (!process.client) return null
|
||||||
|
|
||||||
// 如果实例已存在,避免重复创建
|
// 如果实例已存在,避免重复创建
|
||||||
@ -60,7 +59,6 @@ export const showMinWindow1 = (props = {}) => {
|
|||||||
|
|
||||||
return minWindowInstance
|
return minWindowInstance
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('创建浮动气泡时发生错误:', error)
|
|
||||||
// 发生错误时确保清理资源
|
// 发生错误时确保清理资源
|
||||||
hideMinWindow1()
|
hideMinWindow1()
|
||||||
return null
|
return null
|
||||||
@ -72,7 +70,7 @@ export const showMinWindow1 = (props = {}) => {
|
|||||||
* 清理所有相关资源和DOM元素
|
* 清理所有相关资源和DOM元素
|
||||||
*/
|
*/
|
||||||
export const hideMinWindow1 = () => {
|
export const hideMinWindow1 = () => {
|
||||||
console.log('!minWindowApp && !container', !minWindowApp && !container);
|
|
||||||
|
|
||||||
if (!minWindowApp && !container) return
|
if (!minWindowApp && !container) return
|
||||||
|
|
||||||
@ -93,8 +91,7 @@ export const hideMinWindow1 = () => {
|
|||||||
document.body.removeChild(existingContainer)
|
document.body.removeChild(existingContainer)
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('清理浮动气泡时发生错误:', error)
|
} finally {
|
||||||
} finally {
|
|
||||||
// 重置所有状态
|
// 重置所有状态
|
||||||
minWindowApp = null
|
minWindowApp = null
|
||||||
minWindowInstance = null
|
minWindowInstance = null
|
||||||
|
@ -28,7 +28,6 @@ export const showMinWindow = (snapshot, props = {}) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
app.config.errorHandler = (err) => {
|
app.config.errorHandler = (err) => {
|
||||||
console.error('MinWindow Error:', err)
|
|
||||||
hideMinWindow()
|
hideMinWindow()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,8 +15,7 @@ const initData = async () => {
|
|||||||
const res = await userArtwork({uuid})
|
const res = await userArtwork({uuid})
|
||||||
if (res.status === 0) {
|
if (res.status === 0) {
|
||||||
detail.value = res.data
|
detail.value = res.data
|
||||||
console.log('detail',detail.value)
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const position = ref({x: window?.innerWidth - 120 || 0, y: 240})
|
const position = ref({x: window?.innerWidth - 120 || 0, y: 240})
|
||||||
@ -59,8 +58,7 @@ const goPay=()=>{
|
|||||||
}else if (detail.value.status===4){
|
}else if (detail.value.status===4){
|
||||||
router.push('/payment')
|
router.push('/payment')
|
||||||
}
|
}
|
||||||
console.log('detail',detail.value)
|
//router.push('/payment')
|
||||||
//router.push('/payment')
|
|
||||||
}
|
}
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
document.addEventListener('mousemove', onDrag)
|
document.addEventListener('mousemove', onDrag)
|
||||||
|
@ -9,7 +9,7 @@ definePageMeta({
|
|||||||
layout: 'default',
|
layout: 'default',
|
||||||
title: 'Stripe支付'
|
title: 'Stripe支付'
|
||||||
})
|
})
|
||||||
console.log('config.public.NUXT_PUBLIC_PKEY',config.public.NUXT_PUBLIC_PKEY);
|
|
||||||
const stripe = Stripe(config.public.NUXT_PUBLIC_PKEY)
|
const stripe = Stripe(config.public.NUXT_PUBLIC_PKEY)
|
||||||
|
|
||||||
const baseURL = config.public.NUXT_PUBLIC_API_BASE
|
const baseURL = config.public.NUXT_PUBLIC_API_BASE
|
||||||
@ -54,10 +54,8 @@ const watchWebSocket = () => {
|
|||||||
PayUid: payUid.value,
|
PayUid: payUid.value,
|
||||||
})
|
})
|
||||||
ws.onOpen(() => {
|
ws.onOpen(() => {
|
||||||
console.log('支付页面的websocket连接成功')
|
})
|
||||||
})
|
|
||||||
ws.onMessage((event) => {
|
ws.onMessage((event) => {
|
||||||
console.log('支付页面的websocket收到消息', event.data)
|
|
||||||
router.replace({
|
router.replace({
|
||||||
path: '/payment/result',
|
path: '/payment/result',
|
||||||
query: {
|
query: {
|
||||||
@ -66,12 +64,11 @@ const watchWebSocket = () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
ws.onClose(() => {
|
ws.onClose(() => {
|
||||||
console.log('支付页面的websocket连接关闭')
|
})
|
||||||
})
|
|
||||||
}
|
}
|
||||||
async function initialize() {
|
async function initialize() {
|
||||||
const clientSecret = checkoutSessionUrl.value
|
const clientSecret = checkoutSessionUrl.value
|
||||||
console.log('clientSecret',clientSecret);
|
|
||||||
|
|
||||||
const appearance = {
|
const appearance = {
|
||||||
theme: 'stripe',
|
theme: 'stripe',
|
||||||
|
@ -33,7 +33,6 @@ const getQRBase64 = async () => {
|
|||||||
errorCorrectionLevel: 'H'
|
errorCorrectionLevel: 'H'
|
||||||
})
|
})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('生成二维码失败:', err)
|
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,6 @@ const initData = async () => {
|
|||||||
}
|
}
|
||||||
const show=ref(false)
|
const show=ref(false)
|
||||||
const close=()=>{
|
const close=()=>{
|
||||||
console.log('show',show.value)
|
|
||||||
show.value=false
|
show.value=false
|
||||||
}
|
}
|
||||||
const logOut=()=>{
|
const logOut=()=>{
|
||||||
|
@ -10,7 +10,7 @@ definePageMeta({
|
|||||||
layout: 'default',
|
layout: 'default',
|
||||||
title: 'Stripe支付'
|
title: 'Stripe支付'
|
||||||
})
|
})
|
||||||
console.log('config.public.NUXT_PUBLIC_PKEY',config.public.NUXT_PUBLIC_PKEY);
|
|
||||||
const stripe = Stripe(config.public.NUXT_PUBLIC_PKEY)
|
const stripe = Stripe(config.public.NUXT_PUBLIC_PKEY)
|
||||||
|
|
||||||
const baseURL = config.public.NUXT_PUBLIC_API_BASE
|
const baseURL = config.public.NUXT_PUBLIC_API_BASE
|
||||||
@ -22,7 +22,7 @@ const showSpinner = ref(false)
|
|||||||
|
|
||||||
async function initialize() {
|
async function initialize() {
|
||||||
const clientSecret = codePKey.value
|
const clientSecret = codePKey.value
|
||||||
console.log('clientSecret',clientSecret);
|
|
||||||
|
|
||||||
const appearance = {
|
const appearance = {
|
||||||
theme: 'stripe',
|
theme: 'stripe',
|
||||||
|
@ -45,7 +45,7 @@ const confirmPay = async () => {
|
|||||||
codePayUid.value=res.data.payUid
|
codePayUid.value=res.data.payUid
|
||||||
router.push('/collectCode/payment/checkoutPage')
|
router.push('/collectCode/payment/checkoutPage')
|
||||||
// window.location.href = res.data.checkoutSessionUrl
|
// window.location.href = res.data.checkoutSessionUrl
|
||||||
console.log('res',res);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,8 +39,7 @@ const fetchPmblPdf = async () => {
|
|||||||
})
|
})
|
||||||
pmblUrl.value = res.data?.viewUrl // 假设接口返回的PDF URL在data字段中
|
pmblUrl.value = res.data?.viewUrl // 假设接口返回的PDF URL在data字段中
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取拍卖笔录失败:', error)
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 监听折叠面板变化
|
// 监听折叠面板变化
|
||||||
|
@ -8,7 +8,6 @@ definePageMeta({
|
|||||||
i18n: 'countryRegion.title',
|
i18n: 'countryRegion.title',
|
||||||
})
|
})
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
console.log('router',router)
|
|
||||||
const { t, locale } = useI18n()
|
const { t, locale } = useI18n()
|
||||||
const value = ref('');
|
const value = ref('');
|
||||||
const alphabet = computed(() => {
|
const alphabet = computed(() => {
|
||||||
@ -144,7 +143,6 @@ const handleCountrySelect = (country) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
initData()
|
initData()
|
||||||
console.log('searchCountry',searchCountry.value)
|
|
||||||
// 监听语言变化,重新初始化数据
|
// 监听语言变化,重新初始化数据
|
||||||
watch(locale, () => {
|
watch(locale, () => {
|
||||||
initData()
|
initData()
|
||||||
|
@ -30,7 +30,6 @@ const captureVideoFrame = () => {
|
|||||||
try {
|
try {
|
||||||
const video = document.querySelector('#J_prismPlayer video')
|
const video = document.querySelector('#J_prismPlayer video')
|
||||||
if (!video) {
|
if (!video) {
|
||||||
console.error('未找到视频元素')
|
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,7 +41,6 @@ const captureVideoFrame = () => {
|
|||||||
ctx.drawImage(video, 0, 0, canvas.width, canvas.height)
|
ctx.drawImage(video, 0, 0, canvas.width, canvas.height)
|
||||||
return canvas.toDataURL('image/jpeg', 0.9)
|
return canvas.toDataURL('image/jpeg', 0.9)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取视频截图失败:', error)
|
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -118,7 +118,6 @@ const captureVideoFrame = () => {
|
|||||||
try {
|
try {
|
||||||
const video = document.querySelector('#J_prismPlayer video')
|
const video = document.querySelector('#J_prismPlayer video')
|
||||||
if (!video) {
|
if (!video) {
|
||||||
console.error('未找到视频元素')
|
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,7 +129,6 @@ const captureVideoFrame = () => {
|
|||||||
ctx.drawImage(video, 0, 0, canvas.width, canvas.height)
|
ctx.drawImage(video, 0, 0, canvas.width, canvas.height)
|
||||||
return canvas.toDataURL('image/jpeg', 0.9)
|
return canvas.toDataURL('image/jpeg', 0.9)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取视频截图失败:', error)
|
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -144,8 +142,7 @@ const handleCapture = () => {
|
|||||||
onClick:()=>{
|
onClick:()=>{
|
||||||
router.replace('/')
|
router.replace('/')
|
||||||
fullLive.value=true
|
fullLive.value=true
|
||||||
console.log('执行')
|
}
|
||||||
}
|
|
||||||
})*!/
|
})*!/
|
||||||
}*/
|
}*/
|
||||||
showMinWindow1({
|
showMinWindow1({
|
||||||
|
@ -66,8 +66,7 @@ const loadMore = async () => {
|
|||||||
watch(()=>{
|
watch(()=>{
|
||||||
return auctionData.value?.artwork?.index
|
return auctionData.value?.artwork?.index
|
||||||
},(newValue)=>{
|
},(newValue)=>{
|
||||||
console.log('newValue',newValue)
|
})
|
||||||
})
|
|
||||||
watch(()=>props.show,(newValue)=>{
|
watch(()=>props.show,(newValue)=>{
|
||||||
if (newValue){
|
if (newValue){
|
||||||
nextTick(()=>{
|
nextTick(()=>{
|
||||||
|
@ -19,7 +19,6 @@ const player = ref(null)
|
|||||||
const {quoteStatus, show, playerId, show1, auctionData, getSocketData, getLiveLink, fullLive} = liveStore()
|
const {quoteStatus, show, playerId, show1, auctionData, getSocketData, getLiveLink, fullLive} = liveStore()
|
||||||
const pullLink = ref('')
|
const pullLink = ref('')
|
||||||
const handlePlayerError = (error) => {
|
const handlePlayerError = (error) => {
|
||||||
console.error('播放器错误:', error)
|
|
||||||
showConfirmDialog({
|
showConfirmDialog({
|
||||||
message: t('live_room.error_mess'),
|
message: t('live_room.error_mess'),
|
||||||
showCancelButton: true
|
showCancelButton: true
|
||||||
@ -81,8 +80,7 @@ const initializePlayer = async () => {
|
|||||||
|
|
||||||
})
|
})
|
||||||
player.value.on('loading', () => {
|
player.value.on('loading', () => {
|
||||||
console.log('loading')
|
})
|
||||||
})
|
|
||||||
player.value.on('error', handlePlayerError)
|
player.value.on('error', handlePlayerError)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showConfirmDialog({
|
showConfirmDialog({
|
||||||
@ -92,8 +90,7 @@ const initializePlayer = async () => {
|
|||||||
initializePlayer()
|
initializePlayer()
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
})
|
})
|
||||||
console.error('播放器初始化失败:', error)
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,7 +44,6 @@ const showKeyboard = ref(false);
|
|||||||
// 根据语言获取默认国家
|
// 根据语言获取默认国家
|
||||||
const getDefaultCountry = () => {
|
const getDefaultCountry = () => {
|
||||||
let defaultCode = 'CN' // 默认中国大陆
|
let defaultCode = 'CN' // 默认中国大陆
|
||||||
console.log('locale.value',locale.value)
|
|
||||||
switch (locale.value) {
|
switch (locale.value) {
|
||||||
case 'zh-CN':
|
case 'zh-CN':
|
||||||
defaultCode = 'CN'
|
defaultCode = 'CN'
|
||||||
@ -74,7 +73,6 @@ const defaultCountry = getDefaultCountry()
|
|||||||
|
|
||||||
|
|
||||||
const selectedCountry = ref(route.query.countryName || defaultCountry.name)
|
const selectedCountry = ref(route.query.countryName || defaultCountry.name)
|
||||||
console.log('selectedCountry',selectedCountry.value)
|
|
||||||
onMounted(()=>{
|
onMounted(()=>{
|
||||||
selectedZone.value=route.query.zone || defaultCountry.zone
|
selectedZone.value=route.query.zone || defaultCountry.zone
|
||||||
})
|
})
|
||||||
@ -136,8 +134,7 @@ const goLogin =async () => {
|
|||||||
if (res1.status===0){
|
if (res1.status===0){
|
||||||
window.location.href=res1.data.h5Url
|
window.location.href=res1.data.h5Url
|
||||||
}
|
}
|
||||||
console.log('123')
|
}else {
|
||||||
}else {
|
|
||||||
await router.push('/');
|
await router.push('/');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ definePageMeta({
|
|||||||
layout: 'default',
|
layout: 'default',
|
||||||
title: 'Stripe支付'
|
title: 'Stripe支付'
|
||||||
})
|
})
|
||||||
console.log('config.public.NUXT_PUBLIC_PKEY',config.public.NUXT_PUBLIC_PKEY);
|
|
||||||
const stripe = Stripe(config.public.NUXT_PUBLIC_PKEY)
|
const stripe = Stripe(config.public.NUXT_PUBLIC_PKEY)
|
||||||
|
|
||||||
const baseURL = config.public.NUXT_PUBLIC_API_BASE
|
const baseURL = config.public.NUXT_PUBLIC_API_BASE
|
||||||
@ -21,7 +21,7 @@ const showSpinner = ref(false)
|
|||||||
|
|
||||||
async function initialize() {
|
async function initialize() {
|
||||||
const clientSecret = checkoutSessionUrl.value
|
const clientSecret = checkoutSessionUrl.value
|
||||||
console.log('clientSecret',clientSecret);
|
|
||||||
|
|
||||||
const appearance = {
|
const appearance = {
|
||||||
theme: 'stripe',
|
theme: 'stripe',
|
||||||
|
@ -39,7 +39,7 @@ const confirmPay=async ()=>{
|
|||||||
testReturnHost:window.location.origin,
|
testReturnHost:window.location.origin,
|
||||||
testReturnEndPoint:'/payment/result'
|
testReturnEndPoint:'/payment/result'
|
||||||
})
|
})
|
||||||
console.log('res',res);
|
|
||||||
if (res.status===0){
|
if (res.status===0){
|
||||||
|
|
||||||
// if (res.status===0){
|
// if (res.status===0){
|
||||||
|
@ -37,8 +37,7 @@ const fetchData = async () => {
|
|||||||
showMyList.value = groupByDate(res.data.data)
|
showMyList.value = groupByDate(res.data.data)
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取数据失败:', error)
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const onRefresh = async () => {
|
const onRefresh = async () => {
|
||||||
|
@ -33,8 +33,7 @@ const fetchPmblPdf = async () => {
|
|||||||
})
|
})
|
||||||
pmblUrl.value = res.data?.viewUrl // 假设接口返回的PDF URL在data字段中
|
pmblUrl.value = res.data?.viewUrl // 假设接口返回的PDF URL在data字段中
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取拍卖笔录失败:', error)
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 监听折叠面板变化
|
// 监听折叠面板变化
|
||||||
|
@ -34,8 +34,7 @@ export const goodStore = createGlobalState(() => {
|
|||||||
auctionDetail.value = res.data
|
auctionDetail.value = res.data
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('获取拍卖详情错误:', err)
|
} finally {
|
||||||
} finally {
|
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -69,7 +68,6 @@ export const goodStore = createGlobalState(() => {
|
|||||||
}
|
}
|
||||||
return { finished: true, items: [] }
|
return { finished: true, items: [] }
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('获取艺术品列表错误:', err)
|
|
||||||
return { finished: true, items: [] }
|
return { finished: true, items: [] }
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
@ -85,8 +83,7 @@ export const goodStore = createGlobalState(() => {
|
|||||||
artWorkDetail.value = res.data
|
artWorkDetail.value = res.data
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('获取艺术品详情错误:', err)
|
} finally {
|
||||||
} finally {
|
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -197,12 +197,10 @@ export const liveStore = createGlobalState(() => {
|
|||||||
|
|
||||||
// WebSocket 事件处理
|
// WebSocket 事件处理
|
||||||
ws.onOpen(() => {
|
ws.onOpen(() => {
|
||||||
console.log('WebSocket connected')
|
})
|
||||||
})
|
|
||||||
|
|
||||||
ws.onMessage((data) => {
|
ws.onMessage((data) => {
|
||||||
auctionData.value = data.data
|
auctionData.value = data.data
|
||||||
console.log(' auctionData.value', auctionData.value)
|
|
||||||
const { wsType, tip } = data.data || {}
|
const { wsType, tip } = data.data || {}
|
||||||
|
|
||||||
switch (wsType) {
|
switch (wsType) {
|
||||||
@ -210,13 +208,11 @@ export const liveStore = createGlobalState(() => {
|
|||||||
handleTipMessage(tip?.tipType)
|
handleTipMessage(tip?.tipType)
|
||||||
break
|
break
|
||||||
case WS_TYPES.STOP_ARTWORK:
|
case WS_TYPES.STOP_ARTWORK:
|
||||||
console.log('changeQuote',quoteStatus.value)
|
|
||||||
//quoteStatus.value = false
|
//quoteStatus.value = false
|
||||||
break
|
break
|
||||||
case WS_TYPES.OVER:
|
case WS_TYPES.OVER:
|
||||||
|
|
||||||
quoteStatus.value = false
|
quoteStatus.value = false
|
||||||
console.log('changeQuote',quoteStatus.value)
|
|
||||||
message.success(createMessageConfig(
|
message.success(createMessageConfig(
|
||||||
t('live_room.text10'),
|
t('live_room.text10'),
|
||||||
'#575757',
|
'#575757',
|
||||||
@ -230,16 +226,13 @@ export const liveStore = createGlobalState(() => {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('onmessage', data)
|
})
|
||||||
})
|
|
||||||
|
|
||||||
ws.onClose(() => {
|
ws.onClose(() => {
|
||||||
console.log('WebSocket disconnected')
|
})
|
||||||
})
|
|
||||||
|
|
||||||
ws.onError((error) => {
|
ws.onError((error) => {
|
||||||
console.error('WebSocket error:', error)
|
})
|
||||||
})
|
|
||||||
}
|
}
|
||||||
const changeStatus = () => {
|
const changeStatus = () => {
|
||||||
if (auctionData.value.artwork?.isSelling&&!auctionData.value.artwork.isSoled){
|
if (auctionData.value.artwork?.isSelling&&!auctionData.value.artwork.isSoled){
|
||||||
@ -249,8 +242,7 @@ export const liveStore = createGlobalState(() => {
|
|||||||
quoteStatus.value = false
|
quoteStatus.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log('changeQuote',quoteStatus.value)
|
}
|
||||||
}
|
|
||||||
return{
|
return{
|
||||||
fullLive,
|
fullLive,
|
||||||
isMinWindow,
|
isMinWindow,
|
||||||
|
@ -30,14 +30,12 @@ export class WebSocketClient {
|
|||||||
},
|
},
|
||||||
onMessage: (callback: (data: any) => void) => {
|
onMessage: (callback: (data: any) => void) => {
|
||||||
this.socket!.onmessage = (event) => {
|
this.socket!.onmessage = (event) => {
|
||||||
console.log('websocket收到消息', event)
|
|
||||||
try {
|
try {
|
||||||
const data = JSON.parse(event.data)
|
const data = JSON.parse(event.data)
|
||||||
|
|
||||||
callback(data)
|
callback(data)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('解析消息失败:', error)
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onClose: (callback: () => void) => {
|
onClose: (callback: () => void) => {
|
||||||
|
@ -20,9 +20,7 @@ try {
|
|||||||
const cert = fs.readFileSync(path.resolve(__dirname, 'ssl/localhost.pem'), 'utf-8')
|
const cert = fs.readFileSync(path.resolve(__dirname, 'ssl/localhost.pem'), 'utf-8')
|
||||||
|
|
||||||
httpsOptions = { key, cert }
|
httpsOptions = { key, cert }
|
||||||
console.log('SSL证书加载成功')
|
} catch (error) {
|
||||||
} catch (error) {
|
|
||||||
console.error('SSL证书加载失败:', error)
|
|
||||||
// 失败时使用HTTP
|
// 失败时使用HTTP
|
||||||
httpsOptions = false
|
httpsOptions = false
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,6 @@ export default defineEventHandler(async (event) => {
|
|||||||
clientSecret: `pi_${Math.random().toString(36).substring(2)}_secret_${Math.random().toString(36).substring(2)}`
|
clientSecret: `pi_${Math.random().toString(36).substring(2)}_secret_${Math.random().toString(36).substring(2)}`
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Create payment intent error:', error)
|
|
||||||
throw createError({
|
throw createError({
|
||||||
statusCode: 500,
|
statusCode: 500,
|
||||||
message: '创建支付意向失败'
|
message: '创建支付意向失败'
|
||||||
|
Loading…
Reference in New Issue
Block a user