diff --git a/app/pages/artDetail/index.vue b/app/pages/artDetail/index.vue index 8838e5c..8576f79 100644 --- a/app/pages/artDetail/index.vue +++ b/app/pages/artDetail/index.vue @@ -14,7 +14,7 @@ const initData = async () => { detail.value = res.data } } -const position = ref({x: window?.innerWidth - 120 || 0, y: 240}) // 设置初始位置在右侧 +const position = ref({x: window?.innerWidth - 120 || 0, y: 240}) const startPosition = ref({x: 0, y: 0}) const isDragging = ref(false) @@ -33,38 +33,30 @@ const onDrag = (e) => { const clientX = e.touches ? e.touches[0].clientX : e.clientX const clientY = e.touches ? e.touches[0].clientY : e.clientY - // 获取窗口尺寸 - const maxX = window.innerWidth - 108 // 减去元素宽度 - const maxY = window.innerHeight - 137 // 减去元素高度 + const maxX = window.innerWidth - 108 + const maxY = window.innerHeight - 137 - // 限制范围 const x = Math.min(Math.max(0, clientX - startPosition.value.x), maxX) const y = Math.min(Math.max(0, clientY - startPosition.value.y), maxY) - position.value = {x, y} } } - const stopDrag = () => { isDragging.value = false } onMounted(() => { - // 鼠标事件 document.addEventListener('mousemove', onDrag) document.addEventListener('mouseup', stopDrag) - // 触摸事件 document.addEventListener('touchmove', onDrag) document.addEventListener('touchend', stopDrag) }) - onUnmounted(() => { document.removeEventListener('mousemove', onDrag) document.removeEventListener('mouseup', stopDrag) document.removeEventListener('touchmove', onDrag) document.removeEventListener('touchend', stopDrag) }) - initData() diff --git a/app/pages/liveRoom/components/SideButton/index.vue b/app/pages/liveRoom/components/SideButton/index.vue index 77fbbba..142dc27 100644 --- a/app/pages/liveRoom/components/SideButton/index.vue +++ b/app/pages/liveRoom/components/SideButton/index.vue @@ -1,17 +1,93 @@ - + - + {{ $t('live_room.lots') }} ({{ auctionData?.artwork?.index }}/{{ pageRef.itemCount ?? 0 }}) + + - - + + { alt="锁图标" /> - + {{ quoteStatus ? $t('live_room.colse_bid') : $t('live_room.start_bid') }} + - - + + RMB 5,000 {{ $t('art_detail_page.button') }} - + + \ No newline at end of file