userCenter.js 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. import axios from '~plugins/axios'
  2. export const actions = {
  3. // app获取购物车列表
  4. loadCartList ({ commit }, params = {}) {
  5. commit('list/REQUEST_CART')
  6. return axios.get('/trade/cart/pageInfo', {params: params})
  7. .then(response => {
  8. commit('list/GET_CART_SUCCESS', response.data)
  9. }, err => {
  10. commit('list/GET_CART_FAILURE', err)
  11. })
  12. },
  13. // app获取结算页订单信息
  14. loadPayInfo ({ commit }, params = {}) {
  15. commit('list/REQUEST_PAY')
  16. return axios.get('/trade/order/orderContainGoods', {params: params})
  17. .then(response => {
  18. commit('list/GET_PAY_SUCCESS', response.data)
  19. }, err => {
  20. commit('list/GET_PAY_FAILURE', err)
  21. })
  22. },
  23. // app获取结算页收货地址
  24. loadAcceptAddress ({ commit }, params = {}) {
  25. commit('list/REQUEST_ADDRESS')
  26. return axios.get('/trade/address/shipping', {params: params})
  27. .then(response => {
  28. commit('list/GET_ADDRESS_SUCCESS', response.data)
  29. }, err => {
  30. commit('list/GET_ADDRESS_FAILURE', err)
  31. })
  32. },
  33. // app获取结算页发票信息
  34. loadPayInvoice ({ commit }, params = {}) {
  35. commit('list/REQUEST_INVOICE')
  36. return axios.get('/trade/bill/list', {params: params})
  37. .then(response => {
  38. commit('list/GET_INVOICE_SUCCESS', response.data)
  39. }, err => {
  40. commit('list/GET_INVOICE_FAILURE', err)
  41. })
  42. },
  43. // 根据订单号获取订单信息
  44. loadOrderData ({ commit }, params = {}) {
  45. commit('list/REQUEST_ORDER')
  46. return axios.get(`/trade/order/${params.ids}`)
  47. .then(response => {
  48. commit('list/GET_ORDER_SUCCESS', response.data)
  49. }, err => {
  50. commit('list/GET_ORDER_FAILURE', err)
  51. })
  52. },
  53. // 获取企业收款账户
  54. loadAccount ({ commit }, params = {}) {
  55. commit('list/REQUEST_ACCOUNT')
  56. return axios.get(`/trade/bankInfo/b2c/enterprise`, {params: params})
  57. .then(response => {
  58. commit('list/GET_ACCOUNT_SUCCESS', response.data)
  59. }, err => {
  60. commit('list/GET_ACCOUNT_FAILURE', err)
  61. })
  62. }
  63. // // app获取结算页配送规则
  64. // loadPayFareRule ({ commit }, params = {}) {
  65. // commit('list/REQUEST_FARE_RULE')
  66. // return axios.post(`/trade/bill/list?area=${params.area}`, params.storeArr)
  67. // .then(response => {
  68. // commit('list/GET_FARE_RULE_SUCCESS', response.data)
  69. // }, err => {
  70. // commit('list/GET_FARE_RULE_FAILURE', err)
  71. // })
  72. // }
  73. }