YY 2 роки тому
батько
коміт
db077755ce

+ 6 - 0
src/layout/data/menu.js

@@ -44,6 +44,12 @@ export const adminMenu = [
         name: '优惠券管理',
         index: '2-5',
       },
+      {
+        icon: 'icon-rencai',
+        path: '/system/service',
+        name: '客服管理',
+        index: '2-6',
+      },
     ],
   },
   {

+ 6 - 0
src/router/module/system.js

@@ -59,4 +59,10 @@ export default [
     meta: { title: '平台管理-优惠券管理-维护信息' },
     component: () => import(/* webpackChunkName: "system_coupon_detail" */ '@/views/system/coupon/detail.vue'),
   },
+  {
+    path: '/system/service',
+    name: 'system_service',
+    meta: { title: '平台管理-客服管理' },
+    component: () => import(/* webpackChunkName: "system_service" */ '@/views/system/service/index.vue'),
+  },
 ];

+ 2 - 0
src/store/index.js

@@ -14,6 +14,7 @@ import indexModule from './module/system/indexModule';
 import shop from './module/shop/shop';
 import selfShop from './module/shop/selfShop';
 import goods from './module/shop/goods';
+import serviceContact from './module/shop/serviceContact';
 import goodsSpec from './module/shop/goodsSpec';
 import afterSale from './module/shop/afterSale';
 import order from './module/trade/order';
@@ -40,5 +41,6 @@ export default new Vuex.Store({
     orderDetail,
     coupon,
     afterSale,
+    serviceContact,
   },
 });

+ 44 - 0
src/store/module/shop/serviceContact.js

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

+ 72 - 0
src/views/system/service/index.vue

@@ -0,0 +1,72 @@
+<template>
+  <div id="goods">
+    <template v-if="view === 'list'">
+      <data-table ref="dataTable" :fields="fields" :opera="opera" :data="list" :total="total" :limit="limit" @query="search" @edit="toEdit"></data-table>
+    </template>
+    <template v-else>
+      <el-row>
+        <el-col :span="24">
+          <el-button icon="el-icon-back" size="mini" @click="toBack()">返回</el-button>
+        </el-col>
+        <el-col :span="24">
+          <data-form :fields="infoFields" :rules="rules" v-model="form" labelWidth="150px" @save="toSave"> </data-form>
+        </el-col>
+      </el-row>
+    </template>
+  </div>
+</template>
+
+<script>
+const _ = require('lodash');
+import methodsUtil from '@/util/opera';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('serviceContact');
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function () {
+    return {
+      view: 'list',
+      fields: [
+        { label: '联系电话', model: 'phone' },
+        { label: '微信', model: 'wx' },
+        { label: 'QQ', model: 'qq' },
+        { label: '邮箱', model: 'email' },
+      ],
+      opera: [{ label: '修改', method: 'edit' }],
+      list: [],
+      total: 0,
+      limit: 10,
+      // info部分
+      infoFields: [
+        { label: '联系电话', model: 'phone' },
+        { label: '微信', model: 'wx' },
+        { label: 'QQ', model: 'qq' },
+        { label: '邮箱', model: 'email' },
+      ],
+      rules: {},
+      form: {},
+    };
+  },
+  created() {
+    this.searchOthers();
+    this.search();
+  },
+  methods: {
+    ...mapActions(['query', 'delete', 'fetch', 'update', 'create']),
+    ...methodsUtil,
+    async search({ skip = 0, limit = this.limit, ...info } = {}) {
+      const res = await this.query({ skip, limit, ...info });
+      if (this.$checkRes(res)) {
+        console.log(res);
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
+      }
+    },
+    async searchOthers() {},
+  },
+};
+</script>
+
+<style lang="less" scoped></style>