storeInfo.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /**
  2. * 店铺状态信息
  3. */
  4. export const state = () => ({
  5. store: {
  6. fetching: false,
  7. data: {}
  8. },
  9. commodity: {
  10. fetching: false,
  11. data: {}
  12. },
  13. component: {
  14. fetching: false,
  15. data: {}
  16. },
  17. storeCommodity: {
  18. fetching: false,
  19. data: {}
  20. },
  21. saveHistory: {
  22. fetching: false,
  23. data: {}
  24. },
  25. focus: {
  26. fetching: false,
  27. data: {}
  28. },
  29. focusList: {
  30. fetching: false,
  31. data: {}
  32. },
  33. focusPage: {
  34. fetching: false,
  35. data: {}
  36. }
  37. })
  38. export const mutations = {
  39. REQUEST_STORE_INFO (state) {
  40. state.store.fetching = true
  41. },
  42. GET_STORE_INFO_FAILURE (state) {
  43. state.store.fetching = false
  44. },
  45. GET_STORE_INFO_SUCCESS (state, result = {}) {
  46. state.store.fetching = false
  47. state.store.data = result
  48. },
  49. REQUEST_COMMODITY (state) {
  50. state.commodity.fetching = true
  51. },
  52. GET_COMMODITY_FAILURE (state) {
  53. state.commodity.fetching = false
  54. },
  55. GET_COMMODITY_SUCCESS (state, result = {}) {
  56. state.commodity.fetching = false
  57. state.commodity.data = result
  58. },
  59. REQUEST_COMPONENT (state) {
  60. state.component.fetching = true
  61. },
  62. GET_COMPONENT_FAILURE (state) {
  63. state.component.fetching = false
  64. },
  65. GET_COMPONENT_SUCCESS (state, result = {}) {
  66. state.component.fetching = false
  67. state.component.data = result
  68. },
  69. REQUEST_STORE_COMMODITY (state) {
  70. state.storeCommodity.fetching = true
  71. },
  72. GET_STORE_COMMODITY_FAILURE (state) {
  73. state.storeCommodity.fetching = false
  74. },
  75. GET_STORE_COMMODITY_SUCCESS (state, result = {}) {
  76. state.storeCommodity.fetching = false
  77. state.storeCommodity.data = result
  78. },
  79. REQUEST_SAVEHISOTRY (state) {
  80. state.saveHistory.fetching = true
  81. },
  82. GET_SAVEHISOTRY_FAILURE (state) {
  83. state.saveHistory.fetching = false
  84. },
  85. GET_SAVEHISOTRY_SUCCESS (state, result) {
  86. state.saveHistory.fetching = false
  87. state.saveHistory.data = result
  88. },
  89. REQUEST_FOCUS (state) {
  90. state.focus.fetching = true
  91. },
  92. GET_FOCUS_FAILURE (state) {
  93. state.focus.fetching = false
  94. },
  95. GET_FOCUS_SUCCESS (state, result) {
  96. state.focus.fetching = false
  97. state.focus.data = result
  98. },
  99. REQUEST_FOCUSLIST (state) {
  100. state.focusList.fetching = true
  101. },
  102. GET_FOCUSLIST_FAILURE (state) {
  103. state.focusList.fetching = false
  104. },
  105. GET_FOCUSLIST_SUCCESS (state, result) {
  106. state.focusList.fetching = false
  107. state.focusList.data = result
  108. },
  109. REQUEST_FOCUSPAGE (state) {
  110. state.focusPage.fetching = true
  111. },
  112. GET_FOCUSPAGE_SUCCESS (state, result) {
  113. state.focusPage.fetching = false
  114. state.focusPage.data = result
  115. },
  116. GET_FOCUSPAGE_FAILURE (state) {
  117. state.focusPage.fetching = false
  118. }
  119. }