Browse Source

搜索逻辑调整,购物车样式调整

yangc 7 years ago
parent
commit
eec59ca1c8

+ 6 - 2
components/common/PcSearchHeader.vue

@@ -61,6 +61,10 @@
       outerKeyword: {
         type: String,
         default: ''
+      },
+      useMatchRule: {
+        type: Boolean,
+        default: false
       }
     },
     data () {
@@ -109,8 +113,8 @@
 //        if (key === this.searchKeyword || this.keyword === this.searchKeyword) {
 //          return
 //        }
-        if (key) {
-          this.keyword = key
+        if (key || !this.useMatchRule) {
+          this.keyword = key || this.keyword
           this.$emit('searchAction', {
             keyword: this.keyword,
             type: type

+ 1 - 1
components/mobile/supplier/List.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <search-header @searchAction="search" :similarUrl="similarUrl" :type="'supplier'" :placeholder="'品牌/类目/型号/公司名'"></search-header>
+    <search-header @searchAction="search" :useMatchRule="false" :similarUrl="similarUrl" :type="'supplier'" :placeholder="'品牌/类目/型号/公司名'"></search-header>
     <div class="supplier-list mobile-content">
       <ul v-if="listData && listData.length">
         <li v-for="item in listData" @click="goSupplierDetail(item)">

+ 38 - 21
pages/mobile/center/user/cart.vue

@@ -13,30 +13,33 @@
           </div>
           <ul class="goods-list">
             <li class="goods-item" v-for="(goods, goodsIndex) in item.goods">
-              <label class="mobile-cart-check" :class="{'active': goods.$active}">
-                <input type="checkbox" @change="setActive('goods', storeIndex, goodsIndex)">
-              </label>
-              <div class="params inline-block">
-                <p class="param text-ellipse"><span class="title">品牌:</span>{{goods.goods.brandNameEn || '-'}}</p>
-                <p class="param text-ellipse"><span class="title">类目:</span>{{goods.kiName || '-'}}</p>
-                <p class="param text-ellipse"><span class="title">型号:</span>{{goods.code || '-'}}</p>
-                <p class="param text-ellipse"><span class="title">规格:</span>{{goods.spec || '-'}}</p>
-              </div>
-              <div class="inline-block params param-operate">
-                <p class="param text-ellipse"><span class="title">交期(天):</span>{{goods.goods.b2cMinDelivery + '-' + goods.goods.b2cMaxDelivery}}</p>
-                <p class="param text-ellipse"><span class="title">单价:</span>{{baseUtils.getPriceByLevel(goods.goods.prices, goods.number, goods.currencyName)}}</p>
-                <p class="param"><span class="title">数量(PCS):</span>
-                  <span class="input-line inline-block">
+              <div style="padding: .3rem .25rem">
+                <label class="mobile-cart-check" :class="{'active': goods.$active}">
+                  <input type="checkbox" @change="setActive('goods', storeIndex, goodsIndex)">
+                </label>
+                <div class="params inline-block">
+                  <p class="param text-ellipse"><span class="title">品牌:</span>{{goods.goods.brandNameEn || '-'}}</p>
+                  <p class="param text-ellipse"><span class="title">类目:</span>{{goods.kiName || '-'}}</p>
+                  <p class="param text-ellipse"><span class="title">型号:</span>{{goods.code || '-'}}</p>
+                  <p class="param text-ellipse"><span class="title">规格:</span>{{goods.spec || '-'}}</p>
+                </div>
+                <div class="inline-block params param-operate">
+                  <p class="param text-ellipse"><span class="title">交期(天):</span>{{goods.goods.b2cMinDelivery + '-' + goods.goods.b2cMaxDelivery}}</p>
+                  <p class="param text-ellipse"><span class="title">单价:</span>{{baseUtils.getPriceByLevel(goods.goods.prices, goods.number, goods.currencyName)}}</p>
+                  <p class="param text-ellipse"><span class="title">起拍:</span>{{goods.goods.minBuyQty}}</p>
+                  <p class="param"><span class="title">数量(PCS):</span>
+                    <span class="input-line inline-block">
                     <span class="inline-block" @click="setGoods('sub', goods)" :class="{disab: !goods.goods.canSub}">-</span>
                     <input type="number" v-model="goods.goods.purchaseNumber" @blur="setGoods('set', goods)">
                     <span class="inline-block" @click="setGoods('add', goods)" :class="{disab: !goods.goods.canAdd}">+</span>
                   </span>
-                </p>
-                <p class="param text-ellipse"><span class="title">小计:</span><span class="ol-price"><span>{{goods.currencyName | currencyFilter}}</span>{{goods.goods.currentPrice}}</span></p>
-                <!--<div class="price-line">
-                  <span>{{goods.currencyName | currencyFilter}}</span>{{goods.goods.currentPrice}}
-                </div>-->
+                  </p>
+                  <!--<div class="price-line">
+                    <span>{{goods.currencyName | currencyFilter}}</span>{{goods.goods.currentPrice}}
+                  </div>-->
+                </div>
               </div>
+              <div class="single-count text-ellipse"><span class="title">小计:</span><span class="ol-price"><span>{{goods.currencyName | currencyFilter}}</span>{{goods.goods.currentPrice}}</span></div>
             </li>
           </ul>
         </li>
@@ -352,12 +355,12 @@
     }
     .store-list {
       .store-item {
-        padding: 0 .25rem;
         background: #fff;
         margin: .19rem 0;
         .store-info {
           height: .9rem;
           line-height: .9rem;
+          padding: 0 .25rem;
           .store-tag {
             width: .54rem;
             height: .3rem;
@@ -377,8 +380,22 @@
         }
         .goods-list {
           .goods-item {
-            padding: .3rem 0;
             border-top: 1px solid #e4e4e4;
+            .single-count {
+              height: .61rem;
+              line-height: .61rem;
+              background: #ebebeb;
+              font-size: .28rem;
+              color: #666;
+              text-align: right;
+              padding: 0 .21rem 0 .25rem;
+              .ol-price {
+                font-size: .26rem;
+              }
+              .title {
+                float: left;
+              }
+            }
             .params {
               margin-left: .17rem;
               width: 3.03rem;

+ 1 - 1
pages/mobile/shop/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <search-header @searchAction="onSearch" :outerKeyword="keyword" :placeholder="'品牌/类目/型号/店铺名'"></search-header>
+    <search-header @searchAction="onSearch" :useMatchRule="false" :outerKeyword="keyword" :placeholder="'品牌/物料名称(类目)/型号/店铺名'"></search-header>
     <div class="shop mobile-content">
       <div class="shop-top">
         <p><i class="iconfont icon-dianpu1"></i><span>{{list.totalElements || 0}}</span>家店铺</p>