Przeglądaj źródła

去除缩小IP、品类功能。

baolei 4 miesięcy temu
rodzic
commit
02291eb80b

+ 1 - 3
components/header/header.wxss

@@ -1,9 +1,7 @@
 /* components/header/header.wxss */
 .header {
     height: 330rpx;
-    position: fixed;
-    z-index: 1200;
-    width: 100%;
+    position: relative;
 }
   .header .header-bg {
     z-index: 1;

+ 29 - 32
pages/index/index.js

@@ -46,7 +46,12 @@ Page({
       url: '../Mall/presaleCommodity/presaleCommodity',
     })
   },
-
+  // 进入sort页
+  sortBut: function(){
+    wx.navigateTo({
+      url: '../Mall/sortCommodity/sortCommodity',
+    })
+  },
   onLoad: async function (options) {
 
     // 生命周期函数--监听页面加载
@@ -69,38 +74,30 @@ Page({
     this.setData({
       prodClassList : resCategory.prodClassList
     });
-    // this.setData({
-    //     prodClassList: [
-    //       { classUrl: 'someprod.jpg', title: '火影忍者' },
-    //       { classUrl: 'someprod.jpg', title: '初音' },
-    //       { classUrl: 'someprod.jpg', title: '原神' },
-    //       { classUrl: 'someprod.jpg', title: '柯南' },
-    //       { classUrl: 'someprod.jpg', title: '非人哉' },
-    //       { classUrl: 'someprod.jpg', title: '全部' },
-    //     ]
-    //   });
+
   },
 
-  onPageScroll: function(e) {
-    wx.createSelectorQuery()
-      .select('.container')
-      .boundingClientRect((rect) => {
-        if (rect) {
-          const shouldBrandBeMini = rect.top <= -480; // 在container上移到-480px时,品牌栏mini出现
-          if (this.data.isBrandMini !== shouldBrandBeMini) {
-            this.setData({
-              isBrandMini: shouldBrandBeMini
-            });
-          }
-          const shouldCategoryBeMini = rect.top <= -680; // 在container上移到-680px时,分类栏mini出现
-          if (this.data.isCategoryMini !== shouldCategoryBeMini) {
-            this.setData({
-              isCategoryMini: shouldCategoryBeMini
-            });
-          }
-        }
-      })
-      .exec();
-  }
+  // onPageScroll: function(e) {
+  //   wx.createSelectorQuery()
+  //     .select('.container')
+  //     .boundingClientRect((rect) => {
+  //       if (rect) {
+  //         console.log("top" + rect.top);
+  //         const shouldBrandBeMini = rect.top <= -475; // 在container上移到-480px时,品牌栏mini出现
+  //         if (this.data.isBrandMini !== shouldBrandBeMini) {
+  //           this.setData({
+  //             isBrandMini: shouldBrandBeMini
+  //           });
+  //         }
+  //         const shouldCategoryBeMini = rect.top <= -600; // 在container上移到-680px时,分类栏mini出现
+  //         if (this.data.isCategoryMini !== shouldCategoryBeMini) {
+  //           this.setData({
+  //             isCategoryMini: shouldCategoryBeMini
+  //           });
+  //         }
+  //       }
+  //     })
+  //     .exec();
+  // }
   
 })

+ 9 - 10
pages/index/index.wxml

@@ -30,31 +30,30 @@
   </view>
   <view class="brand-bar">
     <view wx:for="{{ipInfoList}}" wx:key="index" class="brand-item">
-      <image src="{{item.ipUrl}}" data-item="{{item}}" class="brand-image"></image>
-      <text class="brand-name">{{item.name}}</text>
-      <span>{{ item.className }}</span>
+      <image src="{{item.ipUrl}}" data-item="{{item}}" class="brand-image" bind:tap="sortBut"></image>
+      <!-- <text class="brand-name">{{item.name}}</text> -->
+      <!-- <span>{{ item.ipName }}</span> -->
     </view>
   </view>
-  <view class="brand-bar mini" style="{{isBrandMini ? 'opacity: 1;' : 'opacity: 0;'}}">
-    brand mini
+  <!-- <view class="brand-bar mini" style="{{isBrandMini ? 'opacity: 1;' : 'opacity: 0;'}}">
     <view wx:for="{{ipInfoList}}" wx:key="index" class="brand-item">
       <image src="{{item.ipUrl}}" data-item="{{item}}" class="brand-image"></image>
       <text class="brand-name">{{item.name}}</text>
-      <span>{{ item.className }}</span>
+      <span>{{ item.ipName }}</span>
     </view>
-  </view>
+  </view> -->
   <view class="category">
     <view wx:for="{{prodClassList}}" wx:key="index" class="category-item">
-      <image src="{{item.classUrl}}" data-item="{{item}}" class="category-image"></image>
+      <image src="{{item.classUrl}}" data-item="{{item}}" class="category-image" bind:tap="sortBut"></image>
       <span>{{ item.className }}</span>
     </view>
   </view>
-  <view class="category mini" style="{{isCategoryMini ? 'opacity: 1;' : 'opacity: 0;'}}">
+  <!-- <view class="category mini" style="{{isCategoryMini ? 'opacity: 1;' : 'opacity: 0;'}}">
     <view wx:for="{{prodClassList}}" wx:key="index" class="category-item">
       <image src="{{item.classUrl}}" data-item="{{item}}" class="category-image"></image>
       <span>{{ item.className }}</span>
     </view>
-  </view>
+  </view> -->
 
   <!-- 商品列表 -->
   <product-list position="index" bindaddCart="showAddCartModal"></product-list>

+ 2 - 4
pages/index/index.wxss

@@ -5,9 +5,6 @@ page {
   display: flex;
   flex-direction: column;
 }
-.container {
-  padding-top: 330rpx; /* 留出头部空间 */
-}
 
 .banner {
   z-index: 1200;
@@ -65,7 +62,8 @@ page {
   flex-wrap: nowrap;
   overflow-x: auto;
   top: 316rpx;
-  background: rgb(252, 84, 255);
+  border: 1px solid #097561;
+  background-color: #cdf3ec;
   border-radius: 30rpx;
 }