actions.js 952 Bytes
import * as Types from './types';
import { get } from 'lodash';
import Vue from 'vue';

export default {
  /*
   * @ description: 获取商品详情
   * @ author: huzhiming
   * @ date: 2019-11-22 10:15:13
   * @ version: v1.0.0
  */
  async fetchDetailById({ commit, state }, { skup = null }) {
    let { data: info } = await this.$api.post('/api/ufo/secondhand/productDetail', { skup });

    // console.log('[store/actions/fetchDetailById]:', info);

    commit(Types.UPDATE_PRODUCT_DETAIL, {info});
  },

  /*
   * @ description: 获取筛选数据
   * @ author: huzhiming
   * @ date: 2019-11-22 14:32:46
   * @ version: v1.0.0
  */
  async fetchFilterData({ commit, state }, { storage_id = 10228909 }) {
    let { data: { filter } } = await this.$api.post('/api/ufo/secondhand/filter', { storage_id });

    console.log('[store/actions/fetchFilterData]:', JSON.stringify(filter));

    commit(Types.UPDATE_PRODUCT_FILTER, { filter });
  },

};