lrf402788946 5 years ago
parent
commit
f9244a5269
2 changed files with 43 additions and 0 deletions
  1. 5 0
      store/live/personalchat.js
  2. 38 0
      store/market/transaction.js

+ 5 - 0
store/live/personalchat.js

@@ -4,6 +4,7 @@ import _ from 'lodash';
 Vue.use(Vuex);
 const api = {
   interface: `/api/live/personchat`,
+  isRead: `/api/live/personchat/received`,
 };
 const state = () => ({});
 const mutations = {};
@@ -29,6 +30,10 @@ const actions = {
     const res = await this.$axios.$delete(`${api.interface}/${payload}`);
     return res;
   },
+  async isRead({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.isRead}`, payload);
+    return res;
+  },
 };
 
 export default {

+ 38 - 0
store/market/transaction.js

@@ -0,0 +1,38 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  transactionInfo: `/api/market/transaction`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, limit, ...info } = {}) {
+    const res = await this.$axios.$get(`${api.transactionInfo}`, { skip, limit, ...info });
+    return res;
+  },
+  async create({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.transactionInfo}`, payload);
+    return res;
+  },
+  async fetch({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.transactionInfo}/${payload}`);
+    return res;
+  },
+  async update({ commit }, { id, ...data }) {
+    const res = await this.$axios.$post(`${api.transactionInfo}/update/${id}`, data);
+    return res;
+  },
+  async delete({ commit }, payload) {
+    const res = await this.$axios.$delete(`${api.transactionInfo}/${payload}`);
+    return res;
+  },
+};
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};