component.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. export const state = () => ({
  2. componentGoods: {
  3. fetching: false,
  4. data: []
  5. },
  6. collectCount: {
  7. fetching: false,
  8. data: []
  9. },
  10. collectCode: {
  11. // 类目关注
  12. fetching: false,
  13. data: []
  14. }
  15. })
  16. export const mutations = {
  17. REQUEST_CMPGOODS (state) {
  18. state.componentGoods.fetching = true
  19. },
  20. GET_CMPGOODS_SUCCESS (state, result) {
  21. state.componentGoods.fetching = false
  22. state.componentGoods.data = result
  23. },
  24. GET_CMPGOODS_FAILURE (state) {
  25. state.fetching = false
  26. },
  27. REQUEST_COLLECT (state) {
  28. state.collectCount.fetching = true
  29. },
  30. REQUEST_COLLECT_SUCCESS (state, result) {
  31. state.collectCount.fetching = false
  32. state.collectCount.data = result
  33. },
  34. REQUEST_COLLECT_FAILURE (state) {
  35. state.fetching = false
  36. },
  37. REQUEST_COLLECTCODE (state) {
  38. state.collectCode.fetching = true
  39. },
  40. REQUEST_COLLECTCODE_SUCCESS (state, result) {
  41. state.collectCode.fetching = false
  42. state.collectCode.data = result
  43. },
  44. REQUEST_COLLECTCODE_FAILURE (state) {
  45. state.collectCode = false
  46. }
  47. }