guhongwei 4 years ago
parent
commit
75cdb46cf4
2 changed files with 13 additions and 9 deletions
  1. 5 0
      src/store/live/dock.js
  2. 8 9
      src/views/hall/direct.vue

+ 5 - 0
src/store/live/dock.js

@@ -5,6 +5,7 @@ Vue.use(Vuex);
 const api = {
   dockInfo: `/api/live/dock`,
   myapplyInfo: `/api/live/dock/myapply`,
+  goodsInfo: `/api/live/dock/getgoodslist`,
 };
 const state = () => ({});
 const mutations = {};
@@ -14,6 +15,10 @@ const actions = {
     const res = await this.$axios.$get(api.dockInfo, { skip, limit, ...info });
     return res;
   },
+  async goodsquery({ commit }, { skip = 0, limit = undefined, ...info } = {}) {
+    const res = await this.$axios.$get(api.goodsInfo, { skip, limit, ...info });
+    return res;
+  },
   async myapply({ commit }, { skip = 0, limit = undefined, ...info } = {}) {
     const res = await this.$axios.$get(api.myapplyInfo, {
       skip,

+ 8 - 9
src/views/hall/direct.vue

@@ -579,7 +579,7 @@ export default {
   methods: {
     ...mapProduct({ mapProductQuery: 'newquery' }),
     ...market({ marketFetch: 'fetch', operaFetch: 'operaFetch' }),
-    ...dock({ dockQuery: 'query', dockFetch: 'fetch' }),
+    ...dock({ dockQuery: 'query', dockFetch: 'fetch', goodsquery: 'goodsquery' }),
     ...expertsuser({ expertQuery: 'query' }),
     ...transaction({ tquery: 'query' }),
     ...newsguidance({ danceQuery: 'query' }),
@@ -665,26 +665,25 @@ export default {
       }
     },
     // 点击查询
-    resetForm(name) {
+    async resetForm(name) {
       if (this.panduan == '找技术') {
         if (name) {
-          console.log(name);
-          // var filterdata = this.jishulist.filter(item => item.name === name);
-          // this.$set(this, `jishulist`, filterdata);
+          let jishu = await this.goodsquery({ name: name });
+          this.$set(this, `jishulist`, jishu.data);
         } else {
           this.searchdock();
         }
       } else if (this.panduan == '找产品') {
         if (name) {
-          var filterdata = this.demandList.filter(item => item.name === name);
-          this.$set(this, `demandList`, filterdata);
+          let chanpin = await this.goodsquery({ name: name });
+          this.$set(this, `demandList`, chanpin.data);
         } else {
           this.searchdock();
         }
       } else if (this.panduan == '找服务') {
         if (name) {
-          var filterdata = this.serviceList.filter(item => item.name === name);
-          this.$set(this, `serviceList`, filterdata);
+          let service = await this.goodsquery({ name: name });
+          this.$set(this, `serviceList`, service.data);
         } else {
           this.searchdock();
         }