import { GetOrderPush } from "../../api/order";

const defaultState = () => {
  return {
    pushOrderInfo: {},
    orderWeiDu: 0,
  };
};

const state = defaultState();

const getters = {};

const mutations = {
  ORDERPUSH(state, pushOrderInfo) {
    state.pushOrderInfo = pushOrderInfo;
  },
};

const actions = {
  orderPush({ commit }, pushOrderInfo) {
    console.log("order vue x:", pushOrderInfo);

    let orderItem = pushOrderInfo.payload.orderItem;

    commit("ORDERPUSH", orderItem);
  },
};

export default {
  namespaced: true,
  state,
  getters,
  mutations,
  actions,
};
