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