diff --git a/src/views/Solutions.vue b/src/views/Solutions.vue index cb9fb35..c7e32db 100644 --- a/src/views/Solutions.vue +++ b/src/views/Solutions.vue @@ -132,16 +132,21 @@ const scrollCases = computed(() => { // 滚动位置状态 const scrollPosition = ref(0) +// 暂停状态 +const isPaused = ref(false) + // 自动滚动逻辑 let scrollInterval: number | null = null onMounted(() => { - const scrollSpeed = 0.3 // 滚动速度 + const scrollSpeed = 0.3 scrollInterval = window.setInterval(() => { - const totalCases = successCases.length - const itemWidth = 100 / 3 // 每次显示3个,每个占33.33% - const maxScroll = (totalCases / 3) * 100 // 滚动到所有案例都展示完 - scrollPosition.value = (scrollPosition.value + scrollSpeed) % maxScroll + if (!isPaused.value) { + const totalCases = successCases.length + const itemWidth = 100 / 3 + const maxScroll = (totalCases / 3) * 100 + scrollPosition.value = (scrollPosition.value + scrollSpeed) % maxScroll + } }, 50) }) @@ -286,7 +291,7 @@ const closeCaseDetail = () => {

成功案例

我们在各行业的成功实践

-
+