common.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. export const state = () => ({
  2. counts: {
  3. fetching: false,
  4. data: []
  5. },
  6. collectSave: {
  7. fetching: false,
  8. data: []
  9. },
  10. collectList: {
  11. fetching: false,
  12. data: []
  13. },
  14. collectListMobile: {
  15. fetching: false,
  16. data: []
  17. },
  18. publishMobile: {
  19. fetching: false,
  20. data: []
  21. }
  22. })
  23. export const mutations = {
  24. REQUEST_COUNTS (state) {
  25. state.counts.fetching = true
  26. },
  27. GET_COUNTS_FAILURE (state) {
  28. state.counts.fetching = false
  29. },
  30. GET_COUNTS_SUCCESS (state, result) {
  31. state.counts.fetching = false
  32. state.counts.data = result
  33. },
  34. REQUEST_COLLECTSAVA (state) {
  35. state.collectSave.fetching = true
  36. },
  37. GET_COLLECTSAVA_FAILURE (state) {
  38. state.collectSave.fetching = false
  39. },
  40. GET_COLLECTSAVA_SUCCESS (state, result) {
  41. state.collectSave.fetching = false
  42. state.collectSave.data = result
  43. },
  44. REQUEST_COLLECTLIST (state) {
  45. state.collectList.fetching = true
  46. },
  47. GET_COLLECTLIST_FAILURE (state) {
  48. state.collectList.fetching = false
  49. },
  50. GET_COLLECTLIST_SUCCESS (state, result) {
  51. state.collectList.fetching = false
  52. state.collectList.data = result
  53. },
  54. REQUEST_COLLECT_LIST (state) {
  55. state.collectListMobile.fetching = true
  56. },
  57. GET_COLLECT_LIST_FAILURE (state) {
  58. state.collectListMobile.fetching = false
  59. },
  60. GET_COLLECT_LIST_SUCCESS (state, result) {
  61. state.collectListMobile.fetching = false
  62. state.collectListMobile.data = result
  63. },
  64. REQUEST_PUBLISH_MOBILE (state) {
  65. state.publishMobile.fetching = true
  66. },
  67. GET_PUBLISH_MOBILE_FAILURE (state) {
  68. state.publishMobile.fetching = false
  69. },
  70. GET_PUBLISH_MOBILE_SUCCESS (state, result) {
  71. state.publishMobile.fetching = false
  72. state.publishMobile.data = result
  73. }
  74. }