Browse Source

Merge remote-tracking branch 'origin/master'

yangc 7 years ago
parent
commit
87b4ad57b5
2 changed files with 26 additions and 10 deletions
  1. 10 2
      components/mobile/brand/ComponentDetail.vue
  2. 16 8
      components/mobile/store/StoreDetail.vue

+ 10 - 2
components/mobile/brand/ComponentDetail.vue

@@ -30,7 +30,15 @@
     </div>
     <div class="product-store" v-if="activeType == 'store'">
       <table v-if="searchLists&&searchLists.length > 0">
-        <thead id="product-head" :class="{'active': isScrollOverTab}">
+        <thead id="product-head">
+          <tr>
+            <th style="width: 1.55rem;">商家</th>
+            <th style="width: 1.59rem;">生产日期</th>
+            <th style="width: 2.58rem;">价格梯度</th>
+            <th style="width: 1.77rem;">交期(天)</th>
+          </tr>
+        </thead>
+        <thead class="active" v-show="isScrollOverTab">
           <tr>
             <th style="width: 1.55rem;">商家</th>
             <th style="width: 1.59rem;">生产日期</th>
@@ -238,7 +246,7 @@
         }
         let tbodyObj = document.getElementById('product-body')
         let theadObj = document.getElementById('product-head')
-        this.isScrollOverTab = tbodyObj.getBoundingClientRect().top <= theadObj.getBoundingClientRect().height
+        this.isScrollOverTab = tbodyObj.getBoundingClientRect().top - theadObj.getBoundingClientRect().height - 5 <= theadObj.getBoundingClientRect().height
       },
       getMoreStore: function () {
         if (!this.isSearchingMore) {

+ 16 - 8
components/mobile/store/StoreDetail.vue

@@ -17,13 +17,21 @@
     </div>
     <div class="product-store" v-if="activeType == 'product'">
       <table v-if="commodities.content&&commodities.content.length > 0">
-        <thead id="product-head" :class="{'active': isScrollOverTab}">
-        <tr>
-          <th style="width: 1.77rem;">型号/品牌</th>
-          <th style="width: 1.75rem;">包装</th>
-          <th style="width: 2.2rem;">价格梯度</th>
-          <th style="width: 1.77rem;">交期(天)</th>
-        </tr>
+        <thead id="product-head" >
+          <tr>
+            <th style="width: 1.77rem;">型号/品牌</th>
+            <th style="width: 1.75rem;">包装</th>
+            <th style="width: 2.2rem;">价格梯度</th>
+            <th style="width: 1.77rem;">交期(天)</th>
+          </tr>
+        </thead>
+        <thead class="active" v-show="isScrollOverTab">
+          <tr>
+            <th style="width: 1.77rem;">型号/品牌</th>
+            <th style="width: 1.75rem;">包装</th>
+            <th style="width: 2.2rem;">价格梯度</th>
+            <th style="width: 1.77rem;">交期(天)</th>
+          </tr>
         </thead>
         <tbody id="product-body">
         <tr v-for="commodity in searchLists" @click="goProductDetail(commodity.uuid)">
@@ -156,7 +164,7 @@
         }
         let tbodyObj = document.getElementById('product-body')
         let theadObj = document.getElementById('product-head')
-        this.isScrollOverTab = tbodyObj.getBoundingClientRect().top <= theadObj.getBoundingClientRect().height
+        this.isScrollOverTab = tbodyObj.getBoundingClientRect().top - theadObj.getBoundingClientRect().height - 5 <= theadObj.getBoundingClientRect().height
       },
       getMoreCom: function () {
         if (!this.isSearchingMore) {