import { getmydingdan } from "@/api/login"

const state = {
	// 我订单列表
	dingdanmessage: {}
}

const mutations = {
	MYDINGDAN(state, dingdanmessage) {
		state.dingdanmessage = dingdanmessage
	}
}

const actions = {
	async getmydingdan({ commit }, { page, limit }) {
		let result = await getmydingdan(page, limit)
		console.log(result);
		if (result.code == 200) {
			commit("MYDINGDAN", result.data)
			return "获取我的订单列表成功"
		} else {
			return Promise.reject(new Error("获取我的订单列表失败"))
		}
	}
}

const getters = {}

export default {
	state,
	mutations,
	actions,
	getters
}