From f7f0e44c4be8eb0e77fd310296c3b43bde21e4f9 Mon Sep 17 00:00:00 2001 From: ZZJ <10913410+zzj2100@user.noreply.gitee.com> Date: 星期四, 23 六月 2022 14:17:01 +0800 Subject: [PATCH] 新增联动场景 --- src/views/index/index.vue | 27 +++------------------------ 1 files changed, 3 insertions(+), 24 deletions(-) diff --git a/src/views/index/index.vue b/src/views/index/index.vue index 2be6e4e..abe630c 100644 --- a/src/views/index/index.vue +++ b/src/views/index/index.vue @@ -12,11 +12,11 @@ <li v-for="(item, index) in bannerList" :key="index" - @click="toggleBanner(index + 1)" + @click="toggleBanner(index)" > <button class="inner" - :class="{ active: activeBanner == index + 1 }" + :class="{ active: activeBanner == index }" ></button> </li> </ul> @@ -136,10 +136,6 @@ this.getBanner(); this.getRecommend(); this.getModule(); - window.addEventListener("scroll", this.scrollListener); - }, - destroyed() { - window.removeEventListener("scroll", this.scrollListener); }, data() { return { @@ -163,7 +159,7 @@ router: "/trialCenter", }, ], //鎺ㄨ崘鍗$墖鏁版嵁 - activeBanner: 1, //閫変腑鐨刡anner + activeBanner: 0, //閫変腑鐨刡anner activeCommend: 3, //閫変腑鐨勬帹鑽恡abs commendData: [], //鎺ㄨ崘tab鐨勬暟鎹� productData: [], @@ -365,7 +361,6 @@ timer: null, //鍚戜笂鍥炴粴鍔ㄧ敾 ConnectTimer: null, // 鎺у埗寮瑰眰鐨勫畾鏃跺櫒 bannerList: [], - showConnect: false, //鏄剧ず鑱旂郴鎴戜滑涓庡洖鍒伴《閮� }; }, methods: { @@ -401,22 +396,6 @@ selecTab(id) { this.activeCommend = id; this.getRecommend(); - }, - //娣诲姞婊氬姩鐩戝惉 - scrollListener() { - //椤甸潰婊戝姩瑙﹀彂浜嬩欢 (婊氬姩鏉$Щ鍔ㄥ垯璋冪敤鏄惁鏄剧ず杩斿洖椤堕儴鎸夐挳浜嬩欢) - var a = document.documentElement.clientHeight; // 婊氬姩瀹瑰櫒鐨勫彲瑙嗛珮 - var b = document.documentElement.scrollTop; // 婊氬姩鏉¤窛绂婚《閮ㄧ殑楂樺害 - var c = document.documentElement.scrollHeight; // 婊氬姩瀹瑰櫒鐨勬暣涓珮搴� - - if (c === a + b) { - //褰撴粴鍔ㄥ鍣ㄧ殑鍙楂�+婊氬姩瀹瑰櫒婊氬姩浜嗙殑楂樺害锛堟粴鍔ㄦ潯椤堕儴璺濈婊氬姩瀹瑰櫒椤堕儴鐨勮窛绂伙級 = 婊氬姩瀹瑰櫒鐨勬暣涓珮搴︽椂锛岃鏄庢粴鍔ㄦ潯鍒板簳浜� - this.showConnect = true; - } else { - this.showConnect = false; - } - - //妫�鏌ユ粴鍔ㄦ潯鏄惁鍦ㄩ《閮紝鎺у埗杩斿洖椤堕儴鎸夐挳鐨勯殣钘忓拰鏄剧ず }, }, beforeRouteLeave(to, from, next) { -- Gitblit v1.8.0