import Vue from 'vue';
import Vuex from 'vuex';
import _ from 'lodash';
Vue.use(Vuex);
const api = {
  intelligentFollow: `/api/financial/intelligentFollow`,
};
const state = () => ({});
const mutations = {};

const actions = {
  // 关注前请求的接口
  async beforFollow({ commit }, payload) {
    const res = await this.$axios.$post(`${api.intelligentFollow}/beforFollow`, payload);
    return res;
  },
  // 授信
  async credit({ commit }, payload) {
    const res = await this.$axios.$post(`${api.intelligentFollow}/credit`, payload);
    return res;
  },
  // 删除
  async delete({ commit }, payload) {
    const res = await this.$axios.$delete(`${api.intelligentFollow}/${payload}`);
    return res;
  },
  // 列表
  async followIntelligent({ commit }, payload) {
    const res = await this.$axios.$post(`${api.intelligentFollow}/followIntelligent`, payload);
    return res;
  },
  // 已关注列表
  async getFollowList({ commit }, payload) {
    const res = await this.$axios.$post(`${api.intelligentFollow}/getFollowList`, payload);
    return res;
  },
  // 已完成列表
  async getFinishList({ commit }, payload) {
    const res = await this.$axios.$post(`${api.intelligentFollow}/getFinishList`, payload);
    return res;
  },
};
export default {
  namespaced: true,
  state,
  mutations,
  actions,
};
