微信

index.js 681B

1234567891011121314151617181920212223242526272829
  1. import Ajax from '../../util/ajax'
  2. import api from '../../util/api'
  3. // 请求数据
  4. export default {
  5. namespaced: true,
  6. state: {
  7. customerList: []
  8. },
  9. mutations: {
  10. setCustomerList (state, data) { // 设置页面信息
  11. state.customerList = data
  12. }
  13. },
  14. actions: {
  15. getCustomerList (context) { // 获取课程详情信息
  16. return new Promise((resolve) => {
  17. Ajax(api.card.myCustomer.url, {
  18. method: api.card.myCustomer.method
  19. }).then(res => {
  20. context.commit('setCustomerList', res)
  21. resolve(res)
  22. }).catch((err) => {
  23. reject(err)
  24. })
  25. })
  26. }
  27. }
  28. }