Browse Source

feat: 🚀 功能开发

pull/1/head
姜鑫 9 months ago
parent
commit
18732b620b
  1. 1
      src/App.vue
  2. 27
      src/components/List/List.vue
  3. 2
      src/components/ListItem/ListItem.vue

1
src/App.vue

@ -47,7 +47,6 @@ const { checkHandleScreen, showCountDownDialog, title, toWallpaperTime } = useHa
//
function handleScreen() {
//TODO
// router.push('/transfer')
}

27
src/components/List/List.vue

@ -12,13 +12,13 @@
watch-overflow
observe-parents
:space-between="16"
:autoplay="{ delay: 30000 }"
:autoplay="{ delay: 30000, disableOnInteraction: false }"
observe-slide-children
:modules="modules"
class="h-[1776px] py-5"
@swiper="swiperInit"
>
<SwiperSlide v-for="item of customerList" :key="item.proposalCode">
<SwiperSlide v-for="item of customerList" :key="item.proposalCode" :class="noSwiping ? 'swiper-no-swiping' : ''">
<ListItem :customer="item" />
</SwiperSlide>
</Swiper>
@ -33,7 +33,7 @@
</template>
<script setup lang="ts">
import { shallowRef } from 'vue'
import { onBeforeUnmount, ref, shallowRef } from 'vue'
import ListItem from '../ListItem/ListItem.vue'
import { Autoplay } from 'swiper/modules'
import { Swiper, SwiperSlide } from 'swiper/vue'
@ -53,11 +53,32 @@ const swiper = shallowRef()
function swiperInit(_swiper: any) {
swiper.value = _swiper
}
let timer: number
const noSwiping = ref(false)
const TIMEOUT = 3000
function disable() {
noSwiping.value = true
swiper.value?.autoplay?.stop()
}
function enable() {
timer && clearTimeout(timer)
timer = setTimeout(() => {
noSwiping.value = false
swiper.value?.autoplay?.start()
}, TIMEOUT)
}
function scroll() {
swiper.value?.slideTo(0)
}
window.addEventListener('touchmove', disable)
window.addEventListener('touchend', enable)
onBeforeUnmount(() => {
window.removeEventListener('touchmove', disable)
window.removeEventListener('touchend', enable)
})
defineExpose({
scroll
})

2
src/components/ListItem/ListItem.vue

@ -17,7 +17,7 @@
{{ formatTime(customer.replyTime) }}
</div>
<ScrollView class="scroll relative h-[506px]" scrollbar observe-image :list="customer.disposeDes">
<div class="whitespace-normal pr-3.5 text-justify font-normal leading-normal text-[#333333]">
<div class="whitespace-normal pb-49 pr-3.5 text-justify font-normal leading-normal text-[#333333]">
<div v-html="customer.disposeDes"></div>
<div class="flex items-center pt-4 !text-16">
总经理:{{ customer.managerSignature }}

Loading…
Cancel
Save