소스 검색

供应商搜索功能

Administrator 7 년 전
부모
커밋
a015071ee7

+ 1 - 1
components/applyPurchase/ApplyInfo.vue

@@ -609,7 +609,7 @@ export default {
                     width: 260px;
                     margin-right: 10px;
                     .content {
-                      width: 86px;
+                      width: 155px;
                     }
                   }
                 }

+ 3 - 5
components/common/PcSearchHeader.vue

@@ -4,7 +4,7 @@
     <div class="input-group" style="display: table;">
       <input :placeholder="placeholder" class="form-control" type="text" v-model="keyword" @input="onKeywordInput()"  @keyup.13="onSearch()" />
       <span class="input-group-btn">
-        <button type="button" class="btn btn-default" @click="onSearch()"><i class="iconfont">&#xe6fc;</i></button>
+        <button type="button" class="btn btn-default" @click="onSearch()">搜索</button>
       </span>
     </div>
     <!--<input type="text" v-model="keyword" @input="onKeywordInput()" :placeholder="placeholder" @keyup.13="onSearch()">-->
@@ -15,7 +15,7 @@
         <li class="text-ellipse" v-for="brand in similarList.pBrandEn.slice(0, 4)" @click="onSearch(brand.nameEn, 'pBrandEn', $event)">{{brand.nameEn}}</li>
       </template>
       <template v-if="similarList.kind && similarList.kind.length">
-        <li class="title text-ellipse">类目</li>
+        <li class="title text-ellipse">类目(产品名称)</li>
         <li class="text-ellipse" v-for="kind in similarList.kind.slice(0, 4)" @click="onSearch(kind.kind, 'kind', $event)">{{kind.kind}}</li>
       </template>
       <template v-if="similarList.pCmpCode && similarList.pCmpCode.length">
@@ -29,7 +29,7 @@
         <li class="text-ellipse" v-for="brand in similarList.brand.slice(0, 4)" @click="onSearch(brand.nameEn, 'brand', $event)">{{brand.nameEn}}</li>
       </template>
       <template v-if="similarList.kind && similarList.kind.length">
-        <li class="title text-ellipse">类目</li>
+        <li class="title text-ellipse">类目(产品名称)</li>
         <li class="text-ellipse" v-for="kind in similarList.kind.slice(0, 4)" @click="onSearch(kind.nameCn, 'kind', $event)">{{kind.nameCn}}</li>
       </template>
       <template v-if="similarList.component && similarList.component.length">
@@ -40,7 +40,6 @@
   </div>
 </template>
 <script>
-  import {scrollTo} from '~utils/scroll'
   export default {
     props: {
       placeholder: {
@@ -169,7 +168,6 @@
           })
         }
         this.searchKeyword = this.keyword
-        scrollTo('body', 10)
         this.showSimilarWord = false
       },
       onKeywordInput: function () {

+ 2 - 2
components/mobile/base/SearchHeader.vue

@@ -9,7 +9,7 @@
         <li class="text-ellipse" v-for="brand in similarList.pBrandEn.slice(0, 4)" @click="onSearch(brand.nameEn, 'pBrandEn', $event)">{{brand.nameEn}}</li>
       </template>
       <template v-if="similarList.kind && similarList.kind.length">
-        <li class="title text-ellipse">类目</li>
+        <li class="title text-ellipse">类目(产品名称)</li>
         <li class="text-ellipse" v-for="kind in similarList.kind.slice(0, 4)" @click="onSearch(kind.kind, 'kind', $event)">{{kind.kind}}</li>
       </template>
       <template v-if="similarList.pCmpCode && similarList.pCmpCode.length">
@@ -23,7 +23,7 @@
         <li class="text-ellipse" v-for="brand in similarList.brand.slice(0, 4)" @click="onSearch(brand.nameEn, 'brand', $event)">{{brand.nameEn}}</li>
       </template>
       <template v-if="similarList.kind && similarList.kind.length">
-        <li class="title text-ellipse">类目</li>
+        <li class="title text-ellipse">类目(产品名称)</li>
         <li class="text-ellipse" v-for="kind in similarList.kind.slice(0, 4)" @click="onSearch(kind.nameCn, 'kind', $event)">{{kind.nameCn}}</li>
       </template>
       <template v-if="similarList.component && similarList.component.length">

+ 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" :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)">

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

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <search-header2 @searchAction="search" :similarUrl="similarUrl" :type="'supplier'" :placeholder="'可通过品牌/类目/型号/名称查找供应商'"></search-header2>
+    <search-header2 @searchAction="search" :similarUrl="similarUrl" :type="'supplier'" :placeholder="'品牌/类目(产品名称)/型号/公司名'"></search-header2>
     <div class="supplier-list mobile-content">
       <ul v-if="listData && listData.length">
         <li v-for="item in listData" @click="goSupplierDetail(item)">

+ 2 - 2
components/provider/Suppliers.vue

@@ -5,8 +5,8 @@
       <tr>
         <td width="175"></td>
         <td width="auto"></td>
-        <td width="280">
-          <search-header :outerKeyword="keyword" @searchAction="search" :placeholder="'品牌/类目/型号/名称查找店铺'"></search-header>
+        <td width="400">
+          <search-header :outerKeyword="keyword" @searchAction="search" :placeholder="'品牌/类目(产品名称)/型号/店铺'"></search-header>
           <!--<div class="input-group" style="display: table;">-->
             <!--<input class="form-control" type="search" v-model="keyword" placeholder="品牌/类目/型号/店铺名" @search="search()" />-->
             <!--<span class="input-group-btn">-->

+ 20 - 15
components/supplier/merchant.vue

@@ -13,16 +13,9 @@
         </div>
       </div>
       <div class="search">
-        <div class="input-group">
-          <input type="search" class="form-control" title="code" placeholder="名称/地址/行业"
-                 v-model="searchCode" @keyup.13="goodsSearch(searchCode)" @search="goodsSearch(searchCode)"/>
-          <span class="input-group-btn">
-            <button type="button" class="btn" @click="goodsSearch(searchCode)">&nbsp;查 询</button>
-          </span>
-        </div>
+        <search-header :outerKeyword="searchCode" :similarUrl="similarUrl" :type="'supplier'" @searchAction="search" :placeholder="'品牌/类目(产品名称)/型号/公司名'"></search-header>
       </div>
     </div>
-
     <div class="list_info">
       <div class="empty" v-if="!list.content || list.content.length === 0">
         <img src="/images/supplier/icon/empty.png">
@@ -66,6 +59,7 @@
 </template>
 
 <script>
+  import SearchHeader from '~components/common/PcSearchHeader.vue'
   import Page from '~components/common/page/pageComponent.vue'
   export default {
     name: 'MerchantView',
@@ -77,11 +71,13 @@
         pageParams: {
           count: 20,
           page: 1
-        }
+        },
+        similarUrl: '/search/product/similarKeywords'
       }
     },
     components: {
-      Page
+      Page,
+      SearchHeader
     },
     computed: {
       list () {
@@ -136,13 +132,18 @@
             console.log(err)
           })
       },
-      goodsSearch (type) {
+      search (type) {
         this.pageParams.page = 1
-        this.$store.dispatch('supplier/loadVendorList', {page: this.pageParams.page, size: this.pageParams.count, keyword: type})
+        this.searchCode = type.keyword
+        this.handleCurrentChange(1)
+      },
+      goodsSearch (type) {
+        this.searchCode = type
+        this.handleCurrentChange(1)
       },
       handleCurrentChange (type) {
         this.pageParams.page = type
-        this.$store.dispatch('supplier/loadVendorList', {page: type, size: this.pageParams.count, keyword: this.searchCode})
+        this.$store.dispatch('supplier/loadVendorList', {page: this.pageParams.page, size: this.pageParams.count, keyword: this.searchCode})
       }
     }
   }
@@ -252,14 +253,18 @@
     }
     .search{
       float:right;
-      width:310px;
-      text-align: right;
+      width:370px;
+      padding-top:50px;
       margin-right:10px;
       .btn{
         width:68px;
         background: #ffa200;
         color:#fff;
       }
+      .title{
+        width:100%;
+        text-align: left;
+      }
     }
   }
   .list_info{

+ 1 - 1
nuxt.config.js

@@ -1,7 +1,7 @@
 const path = require('path')
 const isProdMode = Object.is(process.env.NODE_ENV, 'production')
 // b2c后台
-const baseUrl = process.env.BASE_URL || (isProdMode ? 'http://api.usoftmall.com/' : 'http://10.1.51.124:8080/platform-b2c')
+const baseUrl = process.env.BASE_URL || (isProdMode ? 'http://api.usoftmall.com/' : 'http://192.168.253.121:9090/platform-b2c')
 // 公共询价
 const commonUrl = process.env.COMMON_URL || (isProdMode ? 'https://api-inquiry.usoftmall.com/' : 'http://218.17.158.219:24000/')
 // 公共物料

+ 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" :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>