Browse Source

帮助中心图标及图片

ouxq 8 years ago
parent
commit
0a7394fe2f
2 changed files with 37 additions and 0 deletions
  1. 14 0
      store/help/help.js
  2. 23 0
      store/help/option.js

+ 14 - 0
store/help/help.js

@@ -0,0 +1,14 @@
+import axios from '~plugins/axios'
+
+export const actions = {
+  // 获取帮助中心信息
+  loadHelpSnapsho ({ commit }, params = {}) {
+    commit('help/option/REQUEST_SNAPSHO')
+    return axios.get('api/help-service/helps', {params})
+      .then(response => {
+        commit('help/option/GET_SNAPSHO_SUCCESS', response.data)
+      }, err => {
+        commit('help/option/GET_SNAPSHO_FAILURE', err)
+      })
+  }
+}

+ 23 - 0
store/help/option.js

@@ -0,0 +1,23 @@
+export const state = () => ({
+  snapshot: {
+    fetching: false,
+    data: []
+  },
+  detail: {
+    fetching: false,
+    data: []
+  }
+})
+
+export const mutations = {
+  REQUEST_SNAPSHO (state) {
+    state.snapsho.fetching = true
+  },
+  GET_SNAPSHO_FAILURE (state) {
+    state.snapsho.fetching = false
+  },
+  GET_SNAPSHO_SUCCESS (state, result) {
+    state.snapsho.fetching = false
+    state.snapsho.data = result
+  }
+}