瀏覽代碼

跳转分类页分类+商品模板样式

萤火科技 2 年之前
父節點
當前提交
e16f506236
共有 3 個文件被更改,包括 19 次插入 和 9 次删除
  1. 2 1
      components/search/index.vue
  2. 8 2
      core/mixins/app.js
  3. 9 6
      pages/category/components/commodity.vue

+ 2 - 1
components/search/index.vue

@@ -33,7 +33,8 @@
 <style lang="scss" scoped>
   .search-wrapper {
     background: #fff;
-    padding: 13rpx;
+    padding: 14rpx;
+    height: 90rpx;
   }
 
   .index-search {

+ 8 - 2
core/mixins/app.js

@@ -29,12 +29,17 @@ export default {
     appThemeStyle: () => appTheme2Str(store.getters.appTheme)
   },
   mounted() {
+    // #ifdef H5
+    // 微信公众号端隐藏 navigationBar  (解决双标题栏问题)
     if (this.platform === 'WXOFFICIAL') {
-      // this.navTitle()
+      this.hideNavigationBar()
     }
+    // #endif
   },
   methods: {
-    navTitle() {
+    // #ifdef H5
+    // 隐藏 navigationBar
+    hideNavigationBar() {
       this.$nextTick(() => {
         const navTitleDom = document.getElementsByTagName('uni-page-head')
         if (navTitleDom.length) {
@@ -43,5 +48,6 @@ export default {
         }
       })
     }
+    // #endif
   }
 }

+ 9 - 6
pages/category/components/commodity.vue

@@ -3,10 +3,12 @@
     <!-- 一级分类 -->
     <scroll-view class="cate-left" :scroll-y="true" @touchmove.stop.prevent>
       <text class="type-nav" :class="{ selected: curIndex == -1 }" @click="handleSelectNav(-1)">全部</text>
-      <text class="type-nav" :class="{ selected: curIndex == index }" v-for="(item, index) in list" :key="index" @click="handleSelectNav(index)">{{ item.name }}</text>
+      <text class="type-nav" :class="{ selected: curIndex == index }" v-for="(item, index) in list" :key="index"
+        @click="handleSelectNav(index)">{{ item.name }}</text>
     </scroll-view>
 
-    <mescroll-body ref="mescrollRef" :sticky="true" @init="mescrollInit" :down="{ use: false }" :up="upOption" :bottombar="false" @up="upCallback">
+    <mescroll-body ref="mescrollRef" :sticky="true" @init="mescrollInit" :down="{ use: false }" :up="upOption" :bottombar="false"
+      @up="upCallback">
 
       <view class="cate-content">
 
@@ -18,7 +20,8 @@
           <view class="sub-cate-item" :class="{ selected: curIndex2 == -1 }" @click="handleSelectSubCate(-1)">
             <text>全部</text>
           </view>
-          <view class="sub-cate-item" v-for="(item, index) in subCateList" :key="index" :class="{ selected: curIndex2 == index }" @click="handleSelectSubCate(index)">
+          <view class="sub-cate-item" v-for="(item, index) in subCateList" :key="index" :class="{ selected: curIndex2 == index }"
+            @click="handleSelectSubCate(index)">
             <text>{{ item.name }}</text>
           </view>
         </view>
@@ -225,7 +228,7 @@
   .cate-content {
     z-index: 1;
     background: #fff;
-    padding-top: 88rpx;
+    padding-top: 90rpx;
     min-height: 300rpx;
   }
 
@@ -236,7 +239,7 @@
     left: var(--window-left);
     bottom: var(--window-bottom);
     width: 173rpx;
-    height: calc(100% - var(--window-bottom) - 88rpx); 
+    height: calc(100% - var(--window-top) - var(--window-bottom) - 90rpx) !important; 
     background: #f8f8f8;
     color: #444;
   }
@@ -383,4 +386,4 @@
     background-color: rgba(0, 0, 0, 0.4);
     transition: all 0.3s ease-in-out 0s;
   }
-</style>
+</style>