Bladeren bron

feat:随心装

xuzhihao 4 jaren geleden
bovenliggende
commit
709ac13361
3 gewijzigde bestanden met toevoegingen van 35 en 4 verwijderingen
  1. 33 2
      pc/src/components/common/comparePic.vue
  2. 1 1
      pc/src/page/coreProducts/sxz.vue
  3. 1 1
      pc/src/page/layout/header/index.vue

+ 33 - 2
pc/src/components/common/comparePic.vue

@@ -18,11 +18,42 @@ export default {
   },
   data () {
     return {
-      newPosition: 50,
-      maxWidth: 0,
+      newPosition: 70,
+      maxWidth: 0
     }
   },
+  mounted () {
+    let fn = e => {
+      // if (window.scrill)
+      if (window.scrollY >= 1953) {
+        document.removeEventListener('scroll', fn)
+          let newPostion = 70
+          let isFirst = true
+          let initAnimation = () => {
+            if (newPostion > 70) {
+              return
+            } else if (newPostion > 30 && newPostion <= 70) {
+              isFirst ? newPostion-- : newPostion++
+            } else if (newPostion == 30) {
+              isFirst = false
+              newPostion++
+            }
+            this.setPosition(newPostion)
+            requestAnimationFrame(initAnimation)
+          }
+          initAnimation()
+      }
+    }
+    
+    document.addEventListener('scroll', fn)
+    fn()
+    this.$once('hook:beforeDestroy', () => {
+      document.removeEventListener('scroll', fn)
+    })
+  },
+  
   methods: {
+
     handleMousedown (event) {
       this.onDragStart(event)
       window.addEventListener('mousemove', this.onDragging)

+ 1 - 1
pc/src/page/coreProducts/sxz.vue

@@ -159,7 +159,7 @@ export default {
   .common-title {
     margin-top: 0;
     margin-bottom: 50px;
-    font-size: 30px;
+    font-size: 40px;
   }
   .img-item-w {
     position: relative;

+ 1 - 1
pc/src/page/layout/header/index.vue

@@ -223,7 +223,7 @@ export default {
       this.count = count
     }
     if (this.language === 'en') {
-      this.$set(this, 'navs', {
+      this.$set(this.navs, '0', {
         text: this.$t('header.core_product'),
         link: '/coreProducts'
       })