diff --git a/app/pages/liveRoom/index.client.vue b/app/pages/liveRoom/index.client.vue
index b1b8288..8a8ce89 100644
--- a/app/pages/liveRoom/index.client.vue
+++ b/app/pages/liveRoom/index.client.vue
@@ -13,7 +13,8 @@ import {showConfirmDialog} from 'vant';
import {artworkBuy} from "@/api/goods/index.js"
import {useI18n} from 'vue-i18n'
import gsap from 'gsap'
-import { CountUp } from 'countup.js'
+import {CountUp} from 'countup.js'
+
const countUpRef = ref(null)
const nextPriceRef = ref(null)
@@ -79,6 +80,8 @@ onBeforeUnmount(() => {
player.value = null
})
const createCountUp = (element, value, options = {}) => {
+ console.log('element', element)
+ console.log('value', value)
const defaultOptions = {
duration: 1.5,
separator: ',',
@@ -86,8 +89,7 @@ const createCountUp = (element, value, options = {}) => {
decimalPlaces: 0,
enableScrollSpy: true,
}
-
- const countUp = new CountUp(element, Number(value), { ...defaultOptions, ...options })
+ const countUp = new CountUp(element, Number(value), {...defaultOptions, ...options})
if (!countUp.error) {
countUp.start()
@@ -103,14 +105,13 @@ watch(() => fullLive.value, async (newVal) => {
await getSocketData()
- nextTick(() => {
- const { nowAuctionPrice } = auctionData.value
-
- createCountUp(countUpRef.value, nowAuctionPrice.nowPrice)
- createCountUp(nextPriceRef.value, nowAuctionPrice.nextPrice)
- })
})
-
+watchEffect(() => {
+ createCountUp(countUpRef.value, auctionData.value?.nowAuctionPrice?.nowPrice)
+})
+watchEffect(() => {
+ createCountUp(nextPriceRef.value, auctionData.value?.nowAuctionPrice?.nextPrice)
+})
const goBuy = async () => {
const res = await artworkBuy({
auctionArtworkUuid: auctionData.value?.artwork?.uuid,
@@ -134,13 +135,13 @@ const tipOpen = () => {