1231
This commit is contained in:
parent
9051088091
commit
4e6829af0b
@ -2,33 +2,63 @@ import { createApp } from 'vue'
|
|||||||
import MinWindow from '@/components/floatingBubble/index.vue'
|
import MinWindow from '@/components/floatingBubble/index.vue'
|
||||||
|
|
||||||
let minWindowInstance = null
|
let minWindowInstance = null
|
||||||
let minWindowApp = null // 新增:保存应用实例
|
let minWindowApp = null
|
||||||
|
let container = null
|
||||||
|
|
||||||
// 创建悬浮窗
|
// 创建悬浮窗
|
||||||
export const showMinWindow1 = (props = {}) => {
|
export const showMinWindow1 = (props = {}) => {
|
||||||
if (process.client){
|
if (!process.client) return
|
||||||
const container = document.createElement('div')
|
|
||||||
container.className = 'floating-bubble-container' // 添加类名
|
// 如果在首页,不创建实例并销毁现有实例
|
||||||
|
if (window?.$nuxt?.$route?.path === '/') {
|
||||||
|
hideMinWindow1()
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果已经存在实例,直接返回该实例
|
||||||
|
if (minWindowInstance) {
|
||||||
|
return minWindowInstance
|
||||||
|
}
|
||||||
|
|
||||||
|
// 确保清理旧的容器
|
||||||
|
const existingContainer = document.querySelector('.floating-bubble-container')
|
||||||
|
if (existingContainer) {
|
||||||
|
document.body.removeChild(existingContainer)
|
||||||
|
}
|
||||||
|
|
||||||
|
container = document.createElement('div')
|
||||||
|
container.className = 'floating-bubble-container'
|
||||||
document.body.appendChild(container)
|
document.body.appendChild(container)
|
||||||
|
|
||||||
const app = createApp(MinWindow, {
|
const app = createApp(MinWindow, {
|
||||||
...props
|
...props
|
||||||
})
|
})
|
||||||
|
|
||||||
minWindowApp = app // 保存应用实例
|
minWindowApp = app
|
||||||
minWindowInstance = app.mount(container)
|
minWindowInstance = app.mount(container)
|
||||||
return minWindowInstance
|
return minWindowInstance
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
export const hideMinWindow1 = () => {
|
export const hideMinWindow1 = () => {
|
||||||
if (!minWindowApp) return
|
if (!minWindowApp) return
|
||||||
const cleanup = () => {
|
|
||||||
minWindowApp.unmount() // 使用应用实例的unmount方法
|
try {
|
||||||
const container = document.querySelector('.floating-bubble-container') // 假设您的容器有这个类名
|
minWindowApp.unmount()
|
||||||
container && document.body.removeChild(container)
|
if (container && document.body.contains(container)) {
|
||||||
|
document.body.removeChild(container)
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error('清理浮动气泡时出错:', e)
|
||||||
|
} finally {
|
||||||
|
// 确保状态被重置
|
||||||
minWindowApp = null
|
minWindowApp = null
|
||||||
minWindowInstance = null
|
minWindowInstance = null
|
||||||
}
|
container = null
|
||||||
|
|
||||||
cleanup()
|
// 额外清理可能残留的容器
|
||||||
|
const existingContainer = document.querySelector('.floating-bubble-container')
|
||||||
|
if (existingContainer) {
|
||||||
|
document.body.removeChild(existingContainer)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -1,11 +1,26 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
|
import { watch, onUnmounted } from 'vue'
|
||||||
|
import { hideMinWindow1 } from './floating'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
onClick: {
|
onClick: {
|
||||||
type: Function,
|
type: Function,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
||||||
|
// 监听路由变化,当进入首页时销毁气泡
|
||||||
|
watch(() => route.path, (newPath) => {
|
||||||
|
if (newPath === '/') {
|
||||||
|
hideMinWindow1()
|
||||||
|
}
|
||||||
|
}, { immediate: true })
|
||||||
|
|
||||||
|
// 组件卸载时确保清理
|
||||||
|
onUnmounted(() => {
|
||||||
|
hideMinWindow1()
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import {authStore} from "@/stores/auth/index.js";
|
import {authStore} from "@/stores/auth/index.js";
|
||||||
|
import {useI18n} from 'vue-i18n'
|
||||||
|
const {$t} = useI18n()
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
type: {
|
type: {
|
||||||
type: Number,
|
type: Number,
|
||||||
|
@ -4,7 +4,9 @@ import {onMounted, onUnmounted, ref} from 'vue';
|
|||||||
import {signOffline, signOnline} from "~/api/goods/index.js";
|
import {signOffline, signOnline} from "~/api/goods/index.js";
|
||||||
import {VueSignaturePad} from "vue-signature-pad";
|
import {VueSignaturePad} from "vue-signature-pad";
|
||||||
import {authStore} from "~/stores/auth/index.js";
|
import {authStore} from "~/stores/auth/index.js";
|
||||||
|
import {useI18n} from "vue-i18n";
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const {$t} = useI18n()
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
layout: ''
|
layout: ''
|
||||||
})
|
})
|
||||||
|
@ -6,6 +6,7 @@ definePageMeta({
|
|||||||
name: 'personal-info',
|
name: 'personal-info',
|
||||||
})
|
})
|
||||||
const {t} = useI18n()
|
const {t} = useI18n()
|
||||||
|
const {$t} = useI18n()
|
||||||
const showPicker = ref(false)
|
const showPicker = ref(false)
|
||||||
const showPicker1 = ref(false)
|
const showPicker1 = ref(false)
|
||||||
const onConfirm = () => {
|
const onConfirm = () => {
|
||||||
|
@ -2,13 +2,15 @@
|
|||||||
import pdfView from './pdfView'
|
import pdfView from './pdfView'
|
||||||
import { contractView } from "~/api/goods/index.js"
|
import { contractView } from "~/api/goods/index.js"
|
||||||
import { authStore } from "~/stores/auth/index.js"
|
import { authStore } from "~/stores/auth/index.js"
|
||||||
|
import {useI18n} from "vue-i18n";
|
||||||
|
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
layout: 'default',
|
layout: 'default',
|
||||||
i18n: 'signature.title'
|
i18n: 'signature.protocol.title'
|
||||||
})
|
})
|
||||||
|
|
||||||
const { userInfo, payment } = authStore()
|
const { userInfo, payment } = authStore()
|
||||||
|
const $t=useI18n().t
|
||||||
const activeNames = ref([])
|
const activeNames = ref([])
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const pmblUrl = ref('') // 存储拍卖笔录的URL
|
const pmblUrl = ref('') // 存储拍卖笔录的URL
|
||||||
|
@ -167,16 +167,20 @@ export const liveStore = createGlobalState(() => {
|
|||||||
[TIP_TYPES.OTHERS_BID]: () =>
|
[TIP_TYPES.OTHERS_BID]: () =>
|
||||||
message.error(createMessageConfig(t('live_room.text2'), '#CF3050', t('live_room.text3'))),
|
message.error(createMessageConfig(t('live_room.text2'), '#CF3050', t('live_room.text3'))),
|
||||||
|
|
||||||
[TIP_TYPES.SUCCESS_BID]: () =>
|
[TIP_TYPES.SUCCESS_BID]: ()=>{
|
||||||
message.success(createMessageConfig(t('live_room.text4'), '#18A058', t('live_room.text5'))),
|
quoteStatus.value=false
|
||||||
|
message.success(createMessageConfig(t('live_room.text4'), '#18A058', t('live_room.text5')))
|
||||||
[TIP_TYPES.ARTWORK_OVER]: () =>
|
},
|
||||||
|
[TIP_TYPES.ARTWORK_OVER]: () =>{
|
||||||
|
quoteStatus.value=false
|
||||||
message.success(createMessageConfig(
|
message.success(createMessageConfig(
|
||||||
t('live_room.text6'),
|
t('live_room.text6'),
|
||||||
'#575757',
|
'#575757',
|
||||||
t('live_room.text7'),
|
t('live_room.text7'),
|
||||||
{ backgroundColor: '#fff', borderColor: '#fff' }
|
{ backgroundColor: '#fff', borderColor: '#fff' }
|
||||||
)),
|
))
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
[TIP_TYPES.FAIL_BID]: () =>
|
[TIP_TYPES.FAIL_BID]: () =>
|
||||||
message.error(createMessageConfig(
|
message.error(createMessageConfig(
|
||||||
|
@ -274,6 +274,9 @@
|
|||||||
"fail": "签署失败",
|
"fail": "签署失败",
|
||||||
"back": "返回"
|
"back": "返回"
|
||||||
},
|
},
|
||||||
|
"button": {
|
||||||
|
"agreeAndSign": "同意并签署"
|
||||||
|
},
|
||||||
"loading": "加载中...",
|
"loading": "加载中...",
|
||||||
"agreement": {
|
"agreement": {
|
||||||
"notice": "《拍卖公告》",
|
"notice": "《拍卖公告》",
|
||||||
|
Loading…
Reference in New Issue
Block a user