diff --git a/app/components/x-message/images/info.png b/app/components/x-message/images/info.png new file mode 100644 index 0000000..96a9053 Binary files /dev/null and b/app/components/x-message/images/info.png differ diff --git a/app/components/x-message/message/index.vue b/app/components/x-message/message/index.vue index ed8086a..3b75985 100644 --- a/app/components/x-message/message/index.vue +++ b/app/components/x-message/message/index.vue @@ -3,6 +3,7 @@ import error from '../images/error.png' import success from '../images/success.png' import warning from '../images/warning.png' +import info from '../images/info.png' const props = defineProps({ type: { @@ -40,6 +41,11 @@ const props = defineProps({ }) const typeConfig = { + info: { + imgSrc: info, + borderColor: '#C6DFFB', + bgColor: '#ECF5FE', + }, success: { imgSrc: success, borderColor: '#C5E7D5', diff --git a/app/components/x-message/useMessage.js b/app/components/x-message/useMessage.js index e55783a..491afcb 100644 --- a/app/components/x-message/useMessage.js +++ b/app/components/x-message/useMessage.js @@ -28,12 +28,25 @@ const message = { } } }, + info(options, duration = 2000) { + if (process.client) { + if (typeof options === 'string') { + this.show({ type: 'info', message: options, duration }) + } else { + this.show({ + type: 'error', + ...options, + duration + }) + } + } + }, warning(options, duration = 2000) { if (process.client) { if (typeof options === 'string') { this.show({ type: 'warning', message: options, duration }) } else { - console.log('options',options) + this.show({ type: 'warning', ...options, diff --git a/app/pages/artDetail/index.vue b/app/pages/artDetail/index.vue index 35c42ac..d63c1ee 100644 --- a/app/pages/artDetail/index.vue +++ b/app/pages/artDetail/index.vue @@ -8,7 +8,7 @@ const initData=async ()=>{ const res=await userArtwork({uuid}) if (res.status===0){ detail.value=res.data - console.log('detail.value',detail.value) + } } initData() diff --git a/app/pages/liveRoom/components/SideButton/tangPopup.vue b/app/pages/liveRoom/components/SideButton/tangPopup.vue index cc5ef34..03962b8 100644 --- a/app/pages/liveRoom/components/SideButton/tangPopup.vue +++ b/app/pages/liveRoom/components/SideButton/tangPopup.vue @@ -37,7 +37,6 @@ const close = () => emit('update:show', false); const openShow=(item)=>{ showDetailInfo.value=item showDetail.value=true - } const loadMore = async () => { pageRef.value.page++ diff --git a/app/pages/liveRoom/index.client.vue b/app/pages/liveRoom/index.client.vue index 21c59a6..9d0aa86 100644 --- a/app/pages/liveRoom/index.client.vue +++ b/app/pages/liveRoom/index.client.vue @@ -85,7 +85,7 @@ watch(()=>{ } }) const goBuy=async ()=>{ - console.log('auctionData',auctionData.value) + const res= await artworkBuy({ auctionArtworkUuid:auctionData.value?.artwork?.uuid, buyMoney:String(auctionData.value?.nowAuctionPrice?.nextPrice??0) diff --git a/app/stores-collect-code/live/index.js b/app/stores-collect-code/live/index.js index 49c0884..55000cb 100644 --- a/app/stores-collect-code/live/index.js +++ b/app/stores-collect-code/live/index.js @@ -24,7 +24,7 @@ export const liveStore = createGlobalState(() => { ws.send({ type: 'chat', content: 'Hello!' })*/ // 监听消息 onMessage((data) => { - console.log('收到消息:', data) + auctionData.value = data }) } diff --git a/app/utils/websocket.ts b/app/utils/websocket.ts index 684c043..f6be471 100644 --- a/app/utils/websocket.ts +++ b/app/utils/websocket.ts @@ -33,10 +33,10 @@ export class WebSocketClient { }, onMessage: (callback: (data: any) => void) => { this.socket!.onmessage = (event) => { - console.log('event',event) + try { const data = JSON.parse(event.data) - console.log('data',data) + callback(data) } catch (error) { console.error('解析消息失败:', error)