order.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import axios from '~/plugins/axios'
  2. export const actions = {
  3. // 获取卖家中心订单列表
  4. getSellOrderList ({ commit }, params = {}) {
  5. commit('order/REQUEST_ORDERLIST')
  6. return axios.get('/trade/purchase/status/createtime', {params})
  7. .then(response => {
  8. commit('order/GET_ORDERLIST_SUCCESS', response.data)
  9. }, err => {
  10. commit('order/GET_ORDERLIST_FAILURE', err)
  11. })
  12. },
  13. // 获取买家中心订单列表
  14. getBuyerOrderList ({ commit }, params = {}) {
  15. commit('order/REQUEST_ORDERLIST')
  16. return axios.get('/trade/order/individual', {params})
  17. .then(response => {
  18. commit('order/GET_ORDERLIST_SUCCESS', response.data)
  19. }, err => {
  20. commit('order/GET_ORDERLIST_FAILURE', err)
  21. })
  22. },
  23. // 获取买家中心订单列表
  24. getLogisticsInfo ({ commit }, params = {}) {
  25. let id = params.id
  26. commit('order/REQUEST_LOGISTICS')
  27. return axios.get(`/trade/logistics/${id}`)
  28. .then(response => {
  29. axios.get(`/kdn/logistics/query?companyName=${response.data.companyName}&logisticsCode=${response.data.number}`).then(res => {
  30. commit('order/GET_LOGISTICS_SUCCESS', res.data)
  31. }, err => {
  32. commit('order/GET_LOGISTICS_FAILURE', err)
  33. })
  34. }, err => {
  35. commit('order/GET_LOGISTICS_FAILURE', err)
  36. })
  37. }
  38. }