storeInfo.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. collectCount: {
  38. fetching: false,
  39. data: {}
  40. }
  41. })
  42. export const mutations = {
  43. REQUEST_STORE_INFO (state) {
  44. state.store.fetching = true
  45. },
  46. GET_STORE_INFO_FAILURE (state) {
  47. state.store.fetching = false
  48. },
  49. GET_STORE_INFO_SUCCESS (state, result = {}) {
  50. state.store.fetching = false
  51. state.store.data = result
  52. },
  53. REQUEST_COMMODITY (state) {
  54. state.commodity.fetching = true
  55. },
  56. GET_COMMODITY_FAILURE (state) {
  57. state.commodity.fetching = false
  58. },
  59. GET_COMMODITY_SUCCESS (state, result = {}) {
  60. state.commodity.fetching = false
  61. state.commodity.data = result
  62. },
  63. REQUEST_COMPONENT (state) {
  64. state.component.fetching = true
  65. },
  66. GET_COMPONENT_FAILURE (state) {
  67. state.component.fetching = false
  68. },
  69. GET_COMPONENT_SUCCESS (state, result = {}) {
  70. state.component.fetching = false
  71. state.component.data = result
  72. },
  73. REQUEST_STORE_COMMODITY (state) {
  74. state.storeCommodity.fetching = true
  75. },
  76. GET_STORE_COMMODITY_FAILURE (state) {
  77. state.storeCommodity.fetching = false
  78. },
  79. GET_STORE_COMMODITY_SUCCESS (state, result = {}) {
  80. state.storeCommodity.fetching = false
  81. state.storeCommodity.data = result
  82. },
  83. REQUEST_SAVEHISOTRY (state) {
  84. state.saveHistory.fetching = true
  85. },
  86. GET_SAVEHISOTRY_FAILURE (state) {
  87. state.saveHistory.fetching = false
  88. },
  89. GET_SAVEHISOTRY_SUCCESS (state, result) {
  90. state.saveHistory.fetching = false
  91. state.saveHistory.data = result
  92. },
  93. REQUEST_FOCUS (state) {
  94. state.focus.fetching = true
  95. },
  96. GET_FOCUS_FAILURE (state) {
  97. state.focus.fetching = false
  98. },
  99. GET_FOCUS_SUCCESS (state, result) {
  100. state.focus.fetching = false
  101. state.focus.data = result
  102. },
  103. REQUEST_FOCUSLIST (state) {
  104. state.focusList.fetching = true
  105. },
  106. GET_FOCUSLIST_FAILURE (state) {
  107. state.focusList.fetching = false
  108. },
  109. GET_FOCUSLIST_SUCCESS (state, result) {
  110. state.focusList.fetching = false
  111. state.focusList.data = result
  112. },
  113. REQUEST_FOCUSPAGE (state) {
  114. state.focusPage.fetching = true
  115. },
  116. GET_FOCUSPAGE_SUCCESS (state, result) {
  117. state.focusPage.fetching = false
  118. state.focusPage.data = result
  119. },
  120. GET_FOCUSPAGE_FAILURE (state) {
  121. state.focusPage.fetching = false
  122. },
  123. REQUEST_COLLECT (state) {
  124. state.collectCount.fetching = true
  125. },
  126. REQUEST_COLLECT_SUCCESS (state, result) {
  127. state.collectCount.fetching = false
  128. state.collectCount.data = result
  129. },
  130. REQUEST_COLLECT_FAILURE (state) {
  131. state.fetching = false
  132. }
  133. }