Browse Source

器件收藏增加搜索功能

Administrator 7 years ago
parent
commit
f4374dd46e

+ 0 - 1
components/mobile/brand/ComponentDetail.vue

@@ -203,7 +203,6 @@
       isCollect () {
         let id = this.component.id
         let store = this.colList
-        console.log(store, '1')
         if (store) {
           for (let i = 0; i < store.length; i++) {
             if (store[i].componentid === id) {

+ 3 - 10
pages/mobile/center/user/collect/component/_key.vue

@@ -73,7 +73,6 @@
     watch: {
       'compCollectList.data': {
         handler: function (val) {
-          console.log('1' + val)
           if (val.content) {
             if (this.isChange) {
               this.compList = val.content
@@ -82,16 +81,13 @@
               this.compList = [...this.compList, ...val.content]
             }
           }
-          console.log(this.compList, '22')
         },
         immediate: true
       }
     },
-    fetch ({ store, params }) {
-      console.log(111)
-      return Promise.all([
-        store.dispatch('searchData/searchForListInMobile', { page: 1, count: 10, type: 'component', keyword: params.key })
-      ])
+    created () {
+      this.keyword = this.$route.params.key
+      this.$store.dispatch('searchData/searchForListInMobile', { page: 1, count: 10, type: 'component', keyword: this.$route.params.key })
     },
     computed: {
       compCollectList () {
@@ -107,9 +103,6 @@
         return this.$store.state.product.common.collectList.data
       }
     },
-    mounted () {
-      this.keyword = this.$route.params.key
-    },
     components: {
       RemindBox,
       PullUp,

+ 0 - 1
pages/mobile/center/user/collect/component/index.vue

@@ -68,7 +68,6 @@
     watch: {
       'compCollectList.data': {
         handler: function (val) {
-          console.log(val, '2')
           if (this.isChange) {
             this.compList = val.content
             this.isChange = false

+ 0 - 2
store/searchData.js

@@ -13,7 +13,6 @@ function reloadListData ({ commit }, listData) {
         }
       }
     }
-    console.log('4', productList)
     commit('searchList/GET_LIST_SUCCESS', productList)
   }, err => {
     console.log(err)
@@ -75,7 +74,6 @@ export const actions = {
     commit('searchList/REQUEST_LIST', params)
     return axios.get(`/search/201819`, {params})
       .then(response => {
-        console.log('req')
         reloadListData({ commit }, response.data)
       }, err => {
         commit('searchList/GET_LIST_FAILURE', err)