Sfoglia il codice sorgente

修改商品标签---添加系统设置

YY 2 anni fa
parent
commit
deeba77478

+ 14 - 8
src/layout/data/menu.js

@@ -14,53 +14,59 @@ export const adminMenu = [
     index: '2',
     type: '0',
     children: [
+      {
+        icon: 'icon-rencai',
+        path: '/system/config',
+        name: '系统设置',
+        index: '2-1',
+      },
       {
         icon: 'icon-rencai',
         path: '/system/indexModule',
         name: '首页图标设置',
-        index: '2-1',
+        index: '2-2',
       },
       {
         icon: 'icon-rencai',
         path: '/system/banner',
         name: '广告图',
-        index: '2-2',
+        index: '2-3',
       },
       {
         icon: 'icon-rencai',
         path: '/system/goodsTags',
         name: '商品标签',
-        index: '2-3',
+        index: '2-4',
       },
       {
         icon: 'icon-rencai',
         path: '/system/actTags',
         name: '活动标签',
-        index: '2-4',
+        index: '2-5',
       },
       {
         icon: 'icon-rencai',
         path: '/system/order',
         name: '平台订单管理',
-        index: '2-5',
+        index: '2-6',
       },
       {
         icon: 'icon-rencai',
         path: '/system/coupon',
         name: '优惠券管理',
-        index: '2-6',
+        index: '2-7',
       },
       {
         icon: 'icon-rencai',
         path: '/system/service',
         name: '客服管理',
-        index: '2-7',
+        index: '2-8',
       },
       {
         icon: 'icon-rencai',
         path: '/system/statistics',
         name: '统计',
-        index: '2-6',
+        index: '2-9',
       },
     ],
   },

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

@@ -83,4 +83,10 @@ export default [
     meta: { title: '平台管理-活动标签-维护信息' },
     component: () => import(/* webpackChunkName: "system_actTags_detail" */ '@/views/system/actTags/detail.vue'),
   },
+  {
+    path: '/system/config',
+    name: 'system_config',
+    meta: { title: '平台管理-系统设置' },
+    component: () => import(/* webpackChunkName: "system_config" */ '@/views/system/config/index.vue'),
+  },
 ];

+ 2 - 0
src/store/index.js

@@ -14,6 +14,7 @@ import goodsTags from './module/system/goodsTags';
 import banner from './module/system/banner';
 import indexModule from './module/system/indexModule';
 import actTags from './module/system/actTags';
+import config from './module/system/config';
 
 import shop from './module/shop/shop';
 import selfShop from './module/shop/selfShop';
@@ -52,5 +53,6 @@ export default new Vuex.Store({
     todo,
     sellTotal,
     actTags,
+    config,
   },
 });

+ 44 - 0
src/store/module/system/config.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/config',
+};
+
+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}`);
+    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,
+};

+ 1 - 0
src/views/selfShop/sales/index.vue

@@ -62,6 +62,7 @@ export default {
             else return '暂无';
           },
         },
+        { label: '售后处理人', model: 'deal_person.name' },
         { label: '申请时间', model: 'apply_time' },
         { label: '结束时间', model: 'end_time' },
       ],

+ 57 - 0
src/views/system/config/index.vue

@@ -0,0 +1,57 @@
+<template>
+  <div id="index">
+    <data-form :span="12" :fields="fields" :rules="rules" v-model="form" labelWidth="150px" @save="toSave"> </data-form>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: config } = createNamespacedHelpers('config');
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function () {
+    return {
+      fields: [
+        { label: '系统名称', model: 'title' },
+        { label: 'logo', model: 'logo', type: 'upload', limit: 1, url: '/files/point/config/upload' },
+        { label: '购物赠送积分', model: 'buyPoint', type: 'number' },
+        { label: '积分计划', model: 'pointPlan' },
+        { label: '分享图片', model: 'share', type: 'upload', limit: 1, url: '/files/point/config/upload' },
+      ],
+      rules: {},
+      form: {},
+    };
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  created() {
+    this.search();
+  },
+  methods: {
+    ...config(['query', 'fetch', 'update']),
+    //执行查询
+    async search() {
+      const res = await this.fetch();
+      if (this.$checkRes(res)) {
+        console.log(res.data);
+        // this.$set(this, `form`, res.data);
+      }
+    },
+    async toSave({ data }) {
+      let config = { logo: data.logo, buyPoint: data.buyPoint, pointPlan: data.pointPlan, share: data.share };
+      data.config = config;
+      console.log(data);
+      const res = await this.update(data);
+      this.$checkRes(res, '操作成功', '操作失败');
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 1 - 4
src/views/system/goodsTags/index.vue

@@ -121,10 +121,7 @@ export default {
       const level = this.levelList.length + 1;
       if (pid) this.form.pid = pid;
       this.form.level = level;
-      const obj = {
-        status: '0',
-      };
-      this.$set(this, 'form', obj);
+      this.form.status = '0';
     },
     async toData(row) {
       const id = _.get(row, '_id');