瀏覽代碼

供应商搜索组件

yangc 7 年之前
父節點
當前提交
717fce8710
共有 4 個文件被更改,包括 124 次插入114 次删除
  1. 1 1
      components/search/GoodList.vue
  2. 8 0
      components/search/SupplierList.vue
  3. 2 1
      components/search/index.js
  4. 113 112
      pages/search/_keyword.vue

+ 1 - 1
components/search/GoodList.vue

@@ -147,7 +147,7 @@
               </div>
             </td>
           </tr>
-          <tr v-if="good_list.components.length == 'undefined' ||good_list.components.length == 0">
+          <tr v-if="!good_list.components || !good_list.components.length">
             <td colspan="12">
               <div class="empty">
                 <p class="empty-img">

+ 8 - 0
components/search/SupplierList.vue

@@ -0,0 +1,8 @@
+<template>
+  <div>111</div>
+</template>
+<script>
+  export default {}
+</script>
+<style lang="scss" scoped>
+</style>

+ 2 - 1
components/search/index.js

@@ -2,5 +2,6 @@ import GoodList from './GoodList.vue'
 import Kind from './Kind.vue'
 import ResultTitle from './ResultTitle.vue'
 import ForwardGoodsList from './ForwardGoodsList.vue'
+import SupplierList from './SupplierList.vue'
 
-export { GoodList, Kind, ResultTitle, ForwardGoodsList }
+export { GoodList, Kind, ResultTitle, ForwardGoodsList, SupplierList }

+ 113 - 112
pages/search/_keyword.vue

@@ -22,12 +22,12 @@
     <forward-goods-list v-else></forward-goods-list>
   </template>
   <template v-if="searchType == 'product'">
-    123
+    <supplier-list></supplier-list>
   </template>
 </div>
 </template>
 <script>
-  import { GoodList, ResultTitle, ForwardGoodsList } from '~components/search'
+  import { GoodList, ResultTitle, ForwardGoodsList, SupplierList } from '~components/search'
 //  import DetailBrand from '~components/search/DetailBrand.vue'
   export default{
     layout: 'main',
@@ -55,13 +55,14 @@
     components: {
       ResultTitle,
       GoodList,
-      ForwardGoodsList
+      ForwardGoodsList,
+      SupplierList
 //      DetailBrand
     },
     watch: {
-      '$route.query.w': {
+      '$route.query': {
         handler: function (val) {
-          this.key = val
+          this.key = val.w
           this.reloadAll()
         },
         immediate: false
@@ -90,10 +91,10 @@
         this.sorting = {}
         this.paramJSON = {}
         this.reloadList()
-        this.reloadKind()
-        this.reloadBrand()
-        this.reloadStoreType()
-        this.reloadCrname()
+//        this.reloadKind()
+//        this.reloadBrand()
+//        this.reloadStoreType()
+//        this.reloadCrname()
       },
       reloadList: function () {
         if (this.sorting === {}) {
@@ -101,26 +102,26 @@
         }
         this.$store.dispatch('searchData/searchForListNew', {count: this.pageSize, filter: this.filter, keyword: this.$route.query.w, page: this.nowPage, sorting: this.sorting, type: this.searchType})
       },
-      reloadKind: function () {
-        if (!this.filter.goods_kindId) {
-          this.$store.dispatch('searchData/searchForKinds', {collectList: 'goods_kind', keyword: this.$route.query.w, paramJSON: this.paramJSON})
-        }
-      },
-      reloadBrand: function () {
-        if (!this.filter.goods_brandId) {
-          this.$store.dispatch('searchData/searchForBrands', {collectList: 'goods_brand', keyword: this.$route.query.w, paramJSON: this.paramJSON})
-        }
-      },
-      reloadStoreType: function () {
-        if (!this.filter.goods_store_type) {
-          this.$store.dispatch('searchData/searchForStoreType', {collectList: 'goods_store_type', keyword: this.$route.query.w, paramJSON: this.paramJSON})
-        }
-      },
-      reloadCrname: function () {
-        if (!this.filter.goods_crname) {
-          this.$store.dispatch('searchData/searchForCrname', {collectList: 'goods_crname', keyword: this.$route.query.w, paramJSON: this.paramJSON})
-        }
-      },
+//      reloadKind: function () {
+//        if (!this.filter.goods_kindId) {
+//          this.$store.dispatch('searchData/searchForKinds', {collectList: 'goods_kind', keyword: this.$route.query.w, paramJSON: this.paramJSON})
+//        }
+//      },
+//      reloadBrand: function () {
+//        if (!this.filter.goods_brandId) {
+//          this.$store.dispatch('searchData/searchForBrands', {collectList: 'goods_brand', keyword: this.$route.query.w, paramJSON: this.paramJSON})
+//        }
+//      },
+//      reloadStoreType: function () {
+//        if (!this.filter.goods_store_type) {
+//          this.$store.dispatch('searchData/searchForStoreType', {collectList: 'goods_store_type', keyword: this.$route.query.w, paramJSON: this.paramJSON})
+//        }
+//      },
+//      reloadCrname: function () {
+//        if (!this.filter.goods_crname) {
+//          this.$store.dispatch('searchData/searchForCrname', {collectList: 'goods_crname', keyword: this.$route.query.w, paramJSON: this.paramJSON})
+//        }
+//      },
       listenPage: function (nPage) {
         this.nowPage = nPage
         this.reloadList()
@@ -142,89 +143,89 @@
         }
         this.reloadList()
       },
-      listenKindFilter: function (kindarr) {
-        this.nowPage = 1
-        if (kindarr.length === 0) {
-          delete this.filter.goods_kindId
-          delete this.paramJSON.goods_kindid
-          this.reloadKind()
-          this.reloadBrand()
-          this.reloadList()
-          this.reloadStoreType()
-          this.reloadCrname()
-        } else {
-          this.filter.goods_kindId = kindarr
-          this.paramJSON.goods_kindid = kindarr
-          this.reloadBrand()
-          this.reloadList()
-          this.reloadStoreType()
-          this.reloadCrname()
-        }
-      },
-      listenBrandFilter: function (brandarr) {
-        this.nowPage = 1
-        if (brandarr.length === 0) {
-          delete this.filter.goods_brandId
-          delete this.paramJSON.goods_brandid
-          this.reloadKind()
-          this.reloadBrand()
-          this.reloadList()
-          this.reloadStoreType()
-          this.reloadCrname()
-        } else {
-          this.filter.goods_brandId = brandarr
-          this.paramJSON.goods_brandid = brandarr
-          this.reloadKind()
-          this.reloadList()
-          this.reloadStoreType()
-          this.reloadCrname()
-        }
-      },
-      listenTypeFilter: function (typearr) {
-        this.nowPage = 1
-        if (typearr.length === 0) {
-          delete this.filter.goods_store_type
-          delete this.paramJSON.goods_store_type
-          this.reloadKind()
-          this.reloadBrand()
-          this.reloadList()
-          this.reloadCrname()
-        } else {
-          this.filter.goods_store_type = typearr
-          this.paramJSON.goods_store_type = typearr
-          this.reloadKind()
-          this.reloadBrand()
-          this.reloadList()
-          this.reloadCrname()
-        }
-      },
-      listenCrnameFilter: function (crnamearr) {
-        this.nowPage = 1
-        if (crnamearr.length === 0) {
-          delete this.filter.goods_crname
-          delete this.paramJSON.goods_crname
-          this.reloadKind()
-          this.reloadBrand()
-          this.reloadList()
-          this.reloadStoreType()
-        } else {
-          this.filter.goods_crname = crnamearr
-          this.paramJSON.goods_crname = crnamearr
-          this.reloadKind()
-          this.reloadBrand()
-          this.reloadList()
-          this.reloadStoreType()
-        }
-      },
-      listenCrnameFlag: function (obj) {
-        if (obj.rmb_click_flag && obj.usd_click_flag) {
-          this.crname_click_flag.rmb_click_flag = false
-          this.crname_click_flag.usd_click_flag = false
-        } else {
-          this.crname_click_flag.rmb_click_flag = obj.rmb_click_flag
-          this.crname_click_flag.usd_click_flag = obj.usd_click_flag
-        }
-      },
+//      listenKindFilter: function (kindarr) {
+//        this.nowPage = 1
+//        if (kindarr.length === 0) {
+//          delete this.filter.goods_kindId
+//          delete this.paramJSON.goods_kindid
+//          this.reloadKind()
+//          this.reloadBrand()
+//          this.reloadList()
+//          this.reloadStoreType()
+//          this.reloadCrname()
+//        } else {
+//          this.filter.goods_kindId = kindarr
+//          this.paramJSON.goods_kindid = kindarr
+//          this.reloadBrand()
+//          this.reloadList()
+//          this.reloadStoreType()
+//          this.reloadCrname()
+//        }
+//      },
+//      listenBrandFilter: function (brandarr) {
+//        this.nowPage = 1
+//        if (brandarr.length === 0) {
+//          delete this.filter.goods_brandId
+//          delete this.paramJSON.goods_brandid
+//          this.reloadKind()
+//          this.reloadBrand()
+//          this.reloadList()
+//          this.reloadStoreType()
+//          this.reloadCrname()
+//        } else {
+//          this.filter.goods_brandId = brandarr
+//          this.paramJSON.goods_brandid = brandarr
+//          this.reloadKind()
+//          this.reloadList()
+//          this.reloadStoreType()
+//          this.reloadCrname()
+//        }
+//      },
+//      listenTypeFilter: function (typearr) {
+//        this.nowPage = 1
+//        if (typearr.length === 0) {
+//          delete this.filter.goods_store_type
+//          delete this.paramJSON.goods_store_type
+//          this.reloadKind()
+//          this.reloadBrand()
+//          this.reloadList()
+//          this.reloadCrname()
+//        } else {
+//          this.filter.goods_store_type = typearr
+//          this.paramJSON.goods_store_type = typearr
+//          this.reloadKind()
+//          this.reloadBrand()
+//          this.reloadList()
+//          this.reloadCrname()
+//        }
+//      },
+//      listenCrnameFilter: function (crnamearr) {
+//        this.nowPage = 1
+//        if (crnamearr.length === 0) {
+//          delete this.filter.goods_crname
+//          delete this.paramJSON.goods_crname
+//          this.reloadKind()
+//          this.reloadBrand()
+//          this.reloadList()
+//          this.reloadStoreType()
+//        } else {
+//          this.filter.goods_crname = crnamearr
+//          this.paramJSON.goods_crname = crnamearr
+//          this.reloadKind()
+//          this.reloadBrand()
+//          this.reloadList()
+//          this.reloadStoreType()
+//        }
+//      },
+//      listenCrnameFlag: function (obj) {
+//        if (obj.rmb_click_flag && obj.usd_click_flag) {
+//          this.crname_click_flag.rmb_click_flag = false
+//          this.crname_click_flag.usd_click_flag = false
+//        } else {
+//          this.crname_click_flag.rmb_click_flag = obj.rmb_click_flag
+//          this.crname_click_flag.usd_click_flag = obj.usd_click_flag
+//        }
+//      },
       setResultType: function (resultType) {
         this.resultType = resultType
       }