Browse Source

bottom

master
maochaoying 2 years ago
parent
commit
4b26604867
  1. 25
      src/components/Bottom.vue
  2. 9
      src/components/Swiper.vue
  3. 21
      src/pages/Hardware.vue

25
src/components/Bottom.vue

@ -1,5 +1,15 @@
<template> <template>
<div :class="isDrag ? 'bottom_container drag' : 'bottom_container'">
<div
:class="
isDrag
? isHard
? 'bottom_container drag h_bottom'
: 'bottom_container drag'
: isHard
? 'bottom_container h_bottom'
: 'bottom_container'
"
>
<div class="online"> <div class="online">
<img class="img1" :src="A1" alt="" /> <img class="img1" :src="A1" alt="" />
<span class="text1">在线咨询</span> <span class="text1">在线咨询</span>
@ -20,11 +30,21 @@
import A1 from '@/static/img/bottom/kefu.png' import A1 from '@/static/img/bottom/kefu.png'
import A2 from '@/static/img/bottom/phone.png' import A2 from '@/static/img/bottom/phone.png'
import A3 from '@/static/img/bottom/wechat.png' import A3 from '@/static/img/bottom/wechat.png'
import { useRoute } from 'vue-router'
import { ref, onMounted } from 'vue'
const route = useRoute()
const props = defineProps({ const props = defineProps({
isDrag: { isDrag: {
type: Boolean, type: Boolean,
}, },
}) })
const isHard = ref(false)
onMounted(() => {
if (route.path.indexOf('/hardware') != -1) {
isHard.value = true
}
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -96,4 +116,7 @@ const props = defineProps({
transition-duration: 0.7s; transition-duration: 0.7s;
animation-fill-mode: forwards; animation-fill-mode: forwards;
} }
.h_bottom {
background: $hardware-theme;
}
</style> </style>

9
src/components/Swiper.vue

@ -36,16 +36,21 @@ import 'swiper/css'
import 'swiper/css/pagination' import 'swiper/css/pagination'
import 'swiper/css/navigation' import 'swiper/css/navigation'
import { Pagination, Navigation } from 'swiper' import { Pagination, Navigation } from 'swiper'
const modules = [Pagination, Navigation]
import { useRoute } from 'vue-router'
import { ref } from 'vue' import { ref } from 'vue'
const modules = [Pagination, Navigation]
const sw = ref(null) const sw = ref(null)
const isFirstSwiper = ref(true) const isFirstSwiper = ref(true)
const route = useRoute()
const onSwiper = swiper => { const onSwiper = swiper => {
sw.value = swiper sw.value = swiper
if (route.path.indexOf('/hardware') != -1) {
//
swiper.slideTo(1, 500, true)
}
} }
const onSlideChange = swiper => { const onSlideChange = swiper => {
const { isBeginning } = swiper const { isBeginning } = swiper
console.log(isBeginning)
if (isBeginning) { if (isBeginning) {
isFirstSwiper.value = true isFirstSwiper.value = true
} else { } else {

21
src/pages/Hardware.vue

@ -1,5 +1,9 @@
<template> <template>
<div class="hardware_home_container">
<div
class="hardware_home_container"
v-touch:press="handlePress"
v-touch:release="handleRelease"
>
<Swiper page="hardware" /> <Swiper page="hardware" />
<CaseShow /> <CaseShow />
<div class="img_wrap"> <div class="img_wrap">
@ -25,6 +29,7 @@
</div> </div>
<AboutUs /> <AboutUs />
<Cooperation /> <Cooperation />
<Bottom :isDrag="isDrag" />
</div> </div>
</template> </template>
@ -40,11 +45,25 @@ import Wu from '@/static/img/hardware/wulianwang.png'
import Dian from '@/static/img/hardware/dianji.png' import Dian from '@/static/img/hardware/dianji.png'
import AboutUs from 'cpns/AboutUs.vue' import AboutUs from 'cpns/AboutUs.vue'
import Cooperation from 'cpns/Cooperation' import Cooperation from 'cpns/Cooperation'
import Bottom from 'cpns/Bottom'
import { ref } from 'vue'
const isDrag = ref(false)
const handlePress = e => {
//
isDrag.value = true
}
const handleRelease = e => {
//
isDrag.value = false
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.hardware_home_container { .hardware_home_container {
background: #f5f5f5; background: #f5f5f5;
padding-bottom: $bottom-height;
.img_wrap { .img_wrap {
padding: 0 7px; padding: 0 7px;
} }

Loading…
Cancel
Save