Browse Source

验收修改

yangc 8 years ago
parent
commit
de05d13d2c

+ 1 - 1
app.html

@@ -4,8 +4,8 @@
   <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css"/>
   <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css"/>
   <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/element-ui/1.3.7/theme-default/index.css"/>
-  <link rel="stylesheet" type="text/css" href="https://at.alicdn.com/t/font_452262_tnqskb835gs98uxr.css">
   <link rel="stylesheet" type="text/css" href="https://at.alicdn.com/t/font_0d1jjt5tukcblnmi.css"/>
+  <link rel="stylesheet" type="text/css" href="https://at.alicdn.com/t/font_452262_tnqskb835gs98uxr.css">
   <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/Swiper/3.4.2/css/swiper.css"/>
   {{ HEAD }}
   <script>

+ 2 - 1
components/mobile/brand/BrandCenter.vue

@@ -86,6 +86,7 @@
     },
     methods: {
       onScroll () {
+        console.log(112)
         if (this.$route.path.startsWith('/mobile/brand/brandCenter')) {
           let scrolled = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop
           this.isScrolled = scrolled > 0
@@ -137,7 +138,7 @@
             top: 0;
             width: 100%;
             background: #fff;
-            box-shadow: .01rem .01rem .01rem #ccc;
+            border-bottom: .01rem solid #ccc;
             left: 0;
             padding-left: .58rem;
             margin-top: 0;

+ 3 - 3
components/mobile/brand/BrandDetail.vue

@@ -56,7 +56,7 @@
         </li>
       </ul>
       <div class="no-product" v-if="!productList.content || productList.content.length == 0">
-        <img src="/images/mobile/@2x/car@2x.png" alt="">
+        <img :src="!isSearch?'/images/mobile/@2x/car@2x.png':'/images/mobile/@2x/search-empty.png'" alt="">
         <div>抱歉,暂无产品信息</div>
       </div>
     </div>
@@ -463,8 +463,8 @@
           text-align: center;
           margin: 0 auto;
           margin-bottom: .45rem;
-          width: 3.31rem;
-          height: 2.13rem;
+          width: 4.11rem;
+          height: 2.5rem;
         }
         div {
           width: 5.27rem;

+ 39 - 7
components/mobile/brand/ComponentDetail.vue

@@ -32,8 +32,8 @@
         <thead>
           <tr>
             <th>商家</th>
-            <th>包装</th>
-            <th>数量</th>
+            <th>生产日期</th>
+            <th>数量<span>(PCS)</span></th>
             <th>单价</th>
             <th>交期(天)</th>
           </tr>
@@ -43,15 +43,15 @@
             <td class="store-name">
               <div>
                 <nuxt-link :to="'/mobile/shop/' + store.storeid">
-                  {{store.storeName || '-'}}
+                  {{store.storeName || '-' | storeNameFilter}}
                 </nuxt-link>
               </div>
             </td>
             <td>
               <div v-if="!store.packaging && !store.breakUp && !store.produceDate">-</div>
+              <div>{{store.produceDate}}</div>
               <div>{{store.packaging}}</div>
               <div>{{store.breakUp?'可拆卖':'不可拆卖'}}</div>
-              <div>{{store.produceDate}}</div>
             </td>
             <td>
               <div v-if="!store.prices || store.prices.length == 0">-</div>
@@ -66,7 +66,7 @@
                 <span v-if="store.currencyName.indexOf('USD')!==-1">${{price.uSDPrice | currency}}</span>
               </div>
             </td>
-            <td>
+            <td class="push-date">
               <div v-if="store.b2cMinDelivery">
                 <span>{{store.b2cMinDelivery}}</span>
                 <span v-if="store.b2cMaxDelivery && store.b2cMaxDelivery !== store.b2cMinDelivery">-</span>
@@ -183,6 +183,29 @@
           }
         }
         return num
+      },
+      storeNameFilter: function (str) {
+        if (str === '') {
+          return str
+        }
+        let len = 0
+        let index = 0
+        for (let i = 0; i < str.length; i++) {
+          if (index === 0 && str.charAt(i).charCodeAt(0) > 255) {
+            len = len + 2
+          } else {
+            len++
+          }
+          if (len > 22) {
+            index = i
+            break
+          }
+        }
+        if (index > 0) {
+          return str.substring(0, index) + '...'
+        } else {
+          return str
+        }
       }
     },
     methods: {
@@ -339,6 +362,9 @@
               text-align: center;
               height: .78rem;
               line-height: .78rem;
+              >span {
+               font-size: .22rem;
+              }
             }
           }
         }
@@ -355,17 +381,23 @@
                 color: #418bf6;
                 div {
                   padding: 0;
-                  width: 1rem;
+                  width: 1.2rem;
                   overflow: hidden;
                 }
               }
               div {
-                padding-left: .4rem;
                 margin-bottom: .2rem;
+                text-align: left;
                 &:last-child {
                   margin-bottom: 0;
                 }
               }
+              &.push-date {
+              text-align: center;
+                div {
+                  text-align: center;
+                }
+            }
               .price-level:last-child {
                 color: #fc5708;
               }

+ 2 - 1
components/mobile/store/StoreDetail.vue

@@ -216,8 +216,9 @@
       background: #f7f7f7;
       p {
         background: #fff;
-        margin: .2rem .5rem;
+        margin: .2rem auto 0;
         padding: .4rem .2rem;
+        width: 6.96rem;
         font-size: .28rem;
         color: #666;
         text-align: left;

+ 39 - 13
pages/mobile/search/_keycode.vue

@@ -30,7 +30,7 @@
       </div>
     </div>
 
-    <div class="detail-brand" v-for="(item, index) in productList.components" v-if="productList.components">
+    <div class="detail-brand" v-for="(item, index) in searchLists" v-if="searchLists.length > 0">
       <div class="brand-item" @click="goComponent(item.uuid)">
         <p>型号:<span>{{item.code}}</span></p>
         <p>品牌:<span>{{item.brand.nameCn}}</span></p>
@@ -44,6 +44,9 @@
       <a @click="goLastPage">返回上一页</a>
     </div>
     <remind-box :title="collectResult" :timeoutCount="timeoutCount"></remind-box>
+    <div class="loading" v-show="isSearchingMore">
+      <img src="/images/all/loading.gif" alt="">
+    </div>
   </div>
 </template>
 
@@ -56,22 +59,27 @@
         activeType: 'store',
         count: '',
         filter: {},
-        page: '',
+        page: 1,
         sorting: {},
         isShow: true,
         isMove: '',
         isFocus: false,
         isClickCollect: false,
         collectResult: '收藏成功',
-        timeoutCount: 0
+        timeoutCount: 0,
+        searchLists: [],
+        isSearchingMore: false
       }
     },
     components: {
       RemindBox
     },
-    mounted () {
-      this.$nextTick(function () {
-        window.addEventListener('scroll', this.onScroll(event))
+    mounted: function () {
+      let _this = this
+      _this.$nextTick(function () {
+        window.addEventListener('scroll', function () {
+          _this.scroll()
+        }, false)
       })
     },
     fetch ({store, route}) {
@@ -87,7 +95,13 @@
     },
     computed: {
       productList () {
-        return this.$store.state.searchData.searchList.lists.data
+        let list = this.$store.state.searchData.searchList.lists.data
+        this.searchLists = this.searchLists.concat(list.components)
+        this.isSearchingMore = false
+        return list
+      },
+      allPage () {
+        return Math.floor(this.productList.total / this.productList.size) + Math.floor(this.productList.total % this.productList.size > 0 ? 1 : 0)
       },
       brandList () {
         return this.$store.state.searchData.searchBrands.brands.data
@@ -147,12 +161,16 @@
       goLastPage: function () {
         window.history.back(-1)
       },
-      onScroll: function (e) {
-//        let width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth
-//        let height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
-//        let x = Math.min(width - 20, e.touches[0].clientX)
-//        let y = Math.min(height - 20, e.touches[0].clientY)
-        console.log(e.touches[0].clientY)
+      getMoreSearch: function () {
+        this.page++
+        this.isSearchingMore = true
+        this.$store.dispatch('searchData/searchForListInMobile', {count: 15, filter: {}, keyword: this.$route.query.w, page: this.page, sorting: {'GO_RESERVE': 'DESC', 'GO_SEARCH': 'DESC'}})
+      },
+      scroll: function () {
+        let scrolled = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop
+        if (Math.ceil(scrolled + window.screen.availHeight) >= document.body.scrollHeight && !this.isSearchingMore && this.page < this.allPage) {
+          this.getMoreSearch()
+        }
       }
     }
   }
@@ -333,6 +351,14 @@
         background: #d4d;
       }
     }
+    .loading {
+      text-align: center;
+      >img {
+        width: .64rem;
+        height: .64rem;
+        margin: .2rem 0;
+      }
+    }
   }
 
 </style>

BIN
static/images/all/loading.gif


BIN
static/images/mobile/@2x/search-empty.png