lrf hace 2 años
padre
commit
a536bd719d

+ 125 - 0
src/components/s-upload.vue

@@ -0,0 +1,125 @@
+<template>
+  <div id="upload">
+    <el-upload
+      v-if="url"
+      ref="upload"
+      :action="url"
+      :limit="limit"
+      :show-file-list="showList"
+      :accept="accept"
+      :list-type="listType"
+      :file-list="fileList"
+      :on-exceed="outLimit"
+      :on-preview="filePreview"
+      :before-upload="beforeUpload"
+      :on-success="onSuccess"
+      :before-remove="onRemove"
+    >
+      <el-button type="primary" size="mini">选择文件</el-button>
+      <template #tip v-if="tip">
+        <p style="color:#ff0000">{{ tip }}</p>
+      </template>
+    </el-upload>
+    <el-dialog :visible.sync="dialog.show" append-to-body>
+      <img width="100%" :src="dialog.url" alt="" />
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import _ from 'lodash';
+export default {
+  name: 'upload',
+  props: {
+    // 图片上传地址
+    url: { type: null },
+    // 可上传文件数目
+    limit: { type: Number },
+    // 存储图片字段
+    type: { type: String },
+    // 是否显示已上传的文件列表
+    showList: { type: Boolean, default: true },
+    // 接收上传的文件类型
+    accept: { type: String, default: 'image/png, image/jpeg' },
+    // 文件列表的类型--picture-card---picture
+    listType: { type: String, default: 'picture-card' },
+    // 文件提醒
+    tip: { type: String, default: undefined },
+    // 已有数据,赋值,预览
+    data: { type: null },
+  },
+  components: {},
+  data: () => ({
+    // 图片预览
+    dialog: { show: false, url: '' },
+    // 图片列表
+    fileList: [],
+  }),
+  created() {
+    // 已有数据,判断数据格式,array,object,String
+    if (this.data) this.defalutProcess(this.data);
+  },
+  watch: {
+    data: {
+      deep: true,
+      immediate: true,
+      handler(val) {
+        if (val) this.defalutProcess(this.data);
+      },
+    },
+  },
+  computed: {},
+  methods: {
+    // 图片预览
+    filePreview(file) {
+      // this.dialog = { show: true, url: file.url };
+      window.open(file.url);
+    },
+    // 上传前
+    beforeUpload(file) {
+      // // 文件大小改为10Mb
+      // const isLt10M = file.size / 1024 / 1024 < 10;
+      // if (!isLt10M) this.$message.error('文件超出10M');
+      // return isLt10M;
+    },
+    // 只允许上传多少个文件
+    outLimit() {
+      this.$message.error(`只允许上传${this.limit}个文件`);
+    },
+    // 上传成功,response:成功信息,file:图片信息,fileList:图片列表
+    onSuccess(response, file, fileList) {
+      if (response.errcode === 0) {
+        this.$emit('upload', { type: this.type, data: { ...response, name: file.name } });
+      } else {
+        this.$message({ message: `上传失败`, type: 'error' });
+      }
+    },
+    // 删除图片
+    onRemove(file, fileList) {
+      this.$set(this, `fileList`, fileList);
+      this.$emit('delete', { type: this.type, data: file, list: fileList });
+      return true;
+    },
+    // 已有数据,判断数据格式,array,object,String
+    defalutProcess(val) {
+      if (_.isArray(val)) {
+        let newArr = val.map(item => {
+          return { name: item.name, url: item.url };
+        });
+        this.$set(this, `fileList`, newArr);
+      } else if (_.isObject(val)) {
+        let newArr = {};
+        if (_.get(val, `url`)) {
+          newArr.name = val.name || '附件';
+          newArr.url = val.url;
+          this.$set(this, `fileList`, [newArr]);
+        }
+      } else if (typeof val === 'string') {
+        this.$set(this, `fileList`, [{ name: '附件', url: val }]);
+      }
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 35 - 0
src/components/usual/c-btnbar.vue

@@ -0,0 +1,35 @@
+<template>
+  <div id="c-btnbar">
+    <el-row class="rows">
+      <el-col :span="24" class="main">
+        <el-col :span="24" class="one">
+          <el-button v-for="i in list" :key="i.method" :type="i.type ? i.type : 'primary'" plain size="mini" @click="toOpera(i)">{{ i.label }}</el-button>
+          <slot></slot>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'c-btnbar',
+  props: {
+    list: { type: Array, default: () => [] },
+  },
+  data: function () {
+    return {};
+  },
+  methods: {
+    toOpera(item) {
+      this.$emit(item.method);
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.rows {
+  margin: 20px 0;
+}
+</style>

+ 3 - 0
src/components/usual/c-form.vue

@@ -64,6 +64,9 @@
             </template>
             <template v-else-if="item.type === 'textarea'">
               <el-input clearable v-model="form[item.model]" type="textarea" :autosize="{ minRows: 3, maxRows: 5 }" @change="dataChange(item.model)"></el-input>
+            </template>
+            <template v-else-if="item.type === 'upload'">
+            
             </template>
             <template v-else>
               <el-input

+ 36 - 4
src/components/usual/c-search.vue

@@ -1,18 +1,50 @@
 <template>
   <div id="c-search">
-    <p>c-search</p>
+    <el-form :inline="true" v-if="fields.length > 0">
+      <el-row>
+        <el-col :span="6" v-for="i in fields" :key="i.model">
+          <el-form-item :label="i.label">
+            <template v-if="i.type === 'select'">
+              <slot :name="i.model"></slot>
+            </template>
+            <template v-else>
+              <el-input v-model="form[i.model]" :placeholder="`输入${i.label}`"></el-input>
+            </template>
+          </el-form-item>
+        </el-col>
+        <el-col :span="24" style="text-align: right">
+          <el-button size="mini" type="primary" @click="toSearch">查询</el-button>
+          <el-button size="mini" @click="toReset">重置</el-button>
+        </el-col>
+      </el-row>
+    </el-form>
   </div>
 </template>
 
 <script>
+const _ = require('lodash');
 export default {
   name: 'c-search',
-  props: {},
-  components: {},
+  props: {
+    form: { type: Object, default: () => ({}) },
+    fields: { type: Array, default: () => [] },
+  },
+  model: {
+    prop: 'form',
+    event: 'change',
+  },
   data: function () {
     return {};
   },
-  methods: {},
+  methods: {
+    toSearch() {
+      this.$emit('query');
+    },
+    toReset() {
+      this.form = {};
+      this.$emit(query);
+    },
+  },
 };
 </script>
 

+ 3 - 3
src/components/usual/c-table.vue

@@ -111,7 +111,7 @@ export default {
     limit: { type: Number, default: 10 },
     height: null,
     operaWidth: { type: Number, default: 200 },
-    vOpera: { type: Boolean, default: true },
+    vOpera: { type: Boolean, default: false },
   },
   components: {},
   data: function () {
@@ -157,11 +157,11 @@ export default {
           type: 'warning',
         })
           .then(() => {
-            this.$emit('opera', { data, index, method });
+            this.$emit(method, { data, index });
           })
           .catch(() => {});
       } else {
-        this.$emit('opera', { data, index, method });
+        this.$emit(method, { data, index });
       }
     },
     handleSelectionChange(selection, row) {

+ 4 - 0
src/layout/Header.vue

@@ -12,6 +12,7 @@
           </el-col>
           <el-col :span="16" class="right">
             <!-- <notice v-if="user.lab_id"></notice> -->
+            <i class="el-icon-refresh" v-if="$dev_env" @click="toRefresh()"></i>
             <i class="el-icon-user-solid"></i>
             <span>{{ user.name || '游客' }}</span>
             <!-- <span>游客</span> -->
@@ -54,6 +55,9 @@ export default {
       window.location.replace(`/${base}/login`);
       // this.$router.push('/login');
     },
+    toRefresh() {
+      this.$emit('refresh');
+    },
   },
   computed: {
     ...mapState(['user']),

+ 8 - 3
src/layout/Home.vue

@@ -1,7 +1,7 @@
 <template>
   <div id="Home">
     <el-container>
-      <el-header style="padding: 0"><v-head></v-head></el-header>
+      <el-header style="padding: 0"><v-head @refresh="toRefresh"></v-head></el-header>
       <el-container>
         <el-aside width="200px"><v-sidebar></v-sidebar></el-aside>
         <el-main>
@@ -13,7 +13,7 @@
                   <breadcrumb :breadcrumbTitle="this.$route.meta.title"></breadcrumb>
                   <el-col :span="24" class="container" style="padding: 15px">
                     <el-scrollbar style="height: 81vh">
-                      <router-view style="height: 80vh"></router-view>
+                      <router-view style="height: 70vh" :key="viewKey"></router-view>
                     </el-scrollbar>
                   </el-col>
                 </el-row>
@@ -42,6 +42,7 @@ export default {
     return {
       collapse: false,
       tagsList: [],
+      viewKey: new Date().getTime(),
     };
   },
   created() {
@@ -57,7 +58,11 @@ export default {
       this.tagsList = arr;
     });
   },
-  methods: {},
+  methods: {
+    toRefresh() {
+      this.viewKey = new Date().getTime();
+    },
+  },
   computed: {
     ...mapState(['user']),
   },

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

@@ -22,141 +22,36 @@ export const adminMenu = [
       },
     ],
   },
-];
-// 科研项目
-export const projectMenu = [
   {
-    icon: 'icon-dangjian_duiwujianshe',
-    _id: 'projectmenu1',
-    name: '系统设置',
-    order_num: 1,
-    status: '0',
+    icon: 'icon-shouye',
+    name: '自营店铺',
+    index: '3',
     type: '0',
     children: [
       {
         icon: 'icon-rencai',
-        path: '/system/dict',
-        name: '字典设置',
-        index: '1-1',
-      },
-      {
-        icon: 'icon-rencai',
-        path: '/system/menus',
-        name: '菜单设置',
-        index: '1-2',
-      },
-
-      {
-        icon: 'icon-rencai',
-        path: '/system/role',
-        name: '角色设置',
-        index: '1-3',
-      },
-    ],
-  },
-  {
-    icon: 'icon-keyan',
-    _id: 'projectmenu2',
-    name: '项目管理',
-    order_num: 2,
-    status: '0',
-    type: '0',
-    children: [
-      {
-        icon: 'icon-xiangmuxinxi',
-        path: '/platform/project',
-        name: '科研项目',
-        index: '2-1',
-      },
-      {
-        icon: 'icon-lunwen',
-        path: '/platform/paper',
-        name: '发表学术论文',
-        index: '2-2',
-      },
-      {
-        icon: 'icon-qita',
-        path: '/platform/other',
-        name: '其他成果',
-        index: '2-3',
-      },
-      {
-        icon: 'icon-huojiangqingkuang',
-        path: '/platform/award',
-        name: '获奖情况',
-        index: '2-4',
-      },
-      {
-        icon: 'icon-xiangmuxinxi',
-        path: '/platform/achieve',
-        name: '成果转化',
-        index: '2-5',
-      },
-    ],
-  },
-  {
-    icon: 'icon-xueshuguanli',
-    _id: 'projectmenu3',
-    name: '学术交流',
-    order_num: 3,
-    status: '0',
-    type: '0',
-    children: [
-      {
-        icon: 'icon-huodong',
-        path: '/xueshu/socialservices',
-        name: '省部级及以上活动',
+        path: '/selfShop/info',
+        name: '店铺信息',
         index: '3-1',
       },
       {
-        icon: 'icon-kepu',
-        path: '/xueshu/scienceactivities',
-        name: '科普活动',
+        icon: 'icon-rencai',
+        path: '/selfShop/goods',
+        name: '商品管理',
         index: '3-2',
       },
       {
-        icon: 'icon-fabiao',
-        path: '/xueshu/report',
-        name: '发表/提交报告',
+        icon: 'icon-rencai',
+        path: '/selfShop/order',
+        name: '订单管理',
         index: '3-3',
       },
-    ],
-  },
-  {
-    icon: 'icon-dangjian_duiwujianshe',
-    _id: 'projectmenu4',
-    name: '队伍建设与人才培养',
-    order_num: 4,
-    status: '0',
-    type: '0',
-    children: [
       {
         icon: 'icon-rencai',
-        path: '/jianshe/personnelname',
-        name: '省部级以上人才称号',
-        index: '4-1',
-      },
-      {
-        icon: 'icon-zhicheng',
-        path: '/jianshe/title',
-        name: '职称晋升',
-        index: '4-2',
-      },
-      {
-        icon: 'icon-peiyang',
-        path: '/jianshe/doctor',
-        name: '博硕培养',
-        index: '4-3',
+        path: '/selfShop/coupon',
+        name: '优惠券管理',
+        index: '3-4',
       },
     ],
   },
-  {
-    icon: 'icon-chengguozhanshi',
-    path: '/outcome',
-    _id: 'projectmenu5',
-    name: '重要进展及重大报告',
-    order_num: 5,
-    status: '0',
-    type: '1',
-  },
 ];

+ 1 - 3
src/main.js

@@ -9,11 +9,9 @@ import '@/plugins/meta';
 
 import '@/assets/icon/iconfont.css';
 import '@/assets/css/main.css';
-// 默认样式
-import '@/assets/css/theme-ele/index.css';
-import '@/assets/css/theme-ele/color-ele.css';
 
 Vue.config.productionTip = false;
+Vue.prototype.$dev_env = process.env.NODE_ENV === 'development';
 
 new Vue({
   router,

+ 3 - 1
src/plugins/element.js

@@ -1,5 +1,7 @@
 import Vue from 'vue';
 import Element from 'element-ui';
 import 'element-ui/lib/theme-chalk/index.css';
-
+// 默认样式
+import '@/assets/css/theme-ele/index.css';
+import '@/assets/css/theme-ele/color-ele.css';
 Vue.use(Element, { size: 'small' });

+ 0 - 2
src/router/guard.js

@@ -3,7 +3,6 @@ const _ = require('lodash');
 const jwt = require('jsonwebtoken');
 export default (router) => {
   router.beforeEach((to, from, next) => {
-    console.log('line 4 in function:');
     // 检查是不是登陆,登陆页面放过
     if (to.path === '/login') {
       next();
@@ -12,7 +11,6 @@ export default (router) => {
     const user = store.state.user;
     if (!_.get(user, '_id')) {
       const str = sessionStorage.getItem('user');
-      console.log(str);
       if (!str) next('/login');
       const obj = jwt.decode(str);
       store.commit('setUser', obj, { root: true });

+ 3 - 2
src/router/index.js

@@ -1,6 +1,7 @@
 import Vue from 'vue';
 import VueRouter from 'vue-router';
 import gurad from './guard';
+import selfShop from './module/selfShop';
 Vue.use(VueRouter);
 
 const routes = [
@@ -12,7 +13,6 @@ const routes = [
   },
   {
     path: '/',
-    name: 'frame',
     // route level code-splitting
     // this generates a separate chunk (about.[hash].js) for this route
     // which is lazy-loaded when the route is visited.
@@ -22,8 +22,9 @@ const routes = [
         path: '/',
         name: 'index',
         meta: { title: '首页' },
-        component: () => import(/* webpackChunkName: "frame" */ '@/views/index.vue'),
+        component: () => import(/* webpackChunkName: "home" */ '@/views/index.vue'),
       },
+      ...selfShop,
     ],
   },
 ];

+ 26 - 0
src/router/module/selfShop.js

@@ -0,0 +1,26 @@
+export default [
+  {
+    path: '/selfShop/info',
+    name: 'selfShop_info',
+    meta: { title: '自营店铺-信息' },
+    component: () => import(/* webpackChunkName: "selfShop_info" */ '@/views/selfShop/info/index.vue'),
+  },
+  {
+    path: '/selfShop/goods',
+    name: 'selfShop_goods',
+    meta: { title: '自营店铺-商品管理' },
+    component: () => import(/* webpackChunkName: "selfShop_goods" */ '@/views/selfShop/goods/index.vue'),
+  },
+  {
+    path: '/selfShop/order',
+    name: 'selfShop_order',
+    meta: { title: '自营店铺-订单管理' },
+    component: () => import(/* webpackChunkName: "selfShop_order" */ '@/views/selfShop/order/index.vue'),
+  },
+  {
+    path: '/selfShop/coupon',
+    name: 'selfShop_coupon',
+    meta: { title: '自营店铺-优惠券管理' },
+    component: () => import(/* webpackChunkName: "selfShop_coupon" */ '@/views/selfShop/coupon/index.vue'),
+  },
+];

+ 3 - 1
src/store/index.js

@@ -3,6 +3,8 @@ import Vuex from 'vuex';
 import * as ustate from './module/user/state';
 import * as umutations from './module/user/mutations';
 import admin from './module/user/action';
+import selfShop from './module/shop/selfShop';
+import goods from './module/shop/goods';
 
 Vue.use(Vuex);
 
@@ -10,5 +12,5 @@ export default new Vuex.Store({
   state: { ...ustate },
   mutations: { ...umutations },
   actions: {},
-  modules: { admin },
+  modules: { admin, selfShop, goods },
 });

+ 38 - 0
src/store/module/shop/goods.js

@@ -0,0 +1,38 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+Vue.use(Vuex);
+const api = {
+  url: '/point/v1/api/goods',
+};
+
+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 fetch({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.url}/${payload}`);
+    return res;
+  },
+  async update({ commit }, { _id, ...info } = {}) {
+    const res = await this.$axios.$post(`${api.url}/${_id}`, { ...info });
+    return res;
+  },
+  async delete({ commit }, payload) {
+    const res = await this.$axios.$delete(`${api.url}/${payload}`);
+    return res;
+  },
+};
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};

+ 38 - 0
src/store/module/shop/selfShop.js

@@ -0,0 +1,38 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+Vue.use(Vuex);
+const api = {
+  url: '/point/v1/api/selfShop',
+};
+
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async getGoods({ commit }, { skip = 0, limit, ...info } = {}) {
+    const res = await this.$axios.$get(`${api.url}/goods`, {
+      skip,
+      limit,
+      ...info,
+    });
+    return res;
+  },
+  async getInfo({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.url}`);
+    return res;
+  },
+  async update({ commit }, { _id, ...info } = {}) {
+    const res = await this.$axios.$post(`${api.url}/${_id}`, { ...info });
+    return res;
+  },
+  async delete({ commit }, payload) {
+    const res = await this.$axios.$delete(`${api.url}/${payload}`);
+    return res;
+  },
+};
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};

+ 16 - 1
src/template/list.vue

@@ -1,5 +1,6 @@
 <template>
   <div id="list">
+    <cbtn :list="btnList" @btnBarOpera="btnOpera"></cbtn>
     <ctable
       :fields="fields"
       :opera="opera"
@@ -16,16 +17,19 @@
 </template>
 
 <script>
+const _ = require('lodash');
+import cbtn from '@/components/usual/c-btnbar.vue';
 import ctable from '@/components/usual/c-table.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
 export default {
   name: 'list',
   props: {},
-  components: { ctable },
+  components: { ctable, cbtn },
   data: function () {
     return {
       fields: [],
       opera: [],
+      btnList: [],
       list: [],
       total: 0,
       limit: 10,
@@ -39,6 +43,17 @@ export default {
   created() {},
   methods: {
     async search() {},
+    async rowClick(row) {},
+    toOpera({ method, ...others }) {
+      method = _.capitalize(method);
+      if (this[`to${method}`]) this[`to${method}`](others);
+      else console.warn('没有响应的函数,无法执行');
+    },
+    btnOpera(method) {
+      method = _.capitalize(method);
+      if (this[`to${method}`]) this[`to${method}`](others);
+      else console.warn('没有响应的函数,无法执行');
+    },
   },
   metaInfo() {
     return { title: this.$route.meta.title };

+ 27 - 0
src/views/selfShop/coupon/index.vue

@@ -0,0 +1,27 @@
+<template>
+  <div id="index">
+    <p>coupon</p>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function () {
+    return {};
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  created() {},
+  methods: {},
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 89 - 0
src/views/selfShop/goods/index.vue

@@ -0,0 +1,89 @@
+<template>
+  <div id="goods">
+    <template v-if="view === 'list'">
+      <csearch :fields="searchFields" v-model="searchInfo" @query="search"></csearch>
+      <cbtn :list="btnList" @add="toAdd"></cbtn>
+      <ctable ref="ctable" :fields="fields" :opera="opera" :data="list" :total="total" :limit="limit" @query="search"></ctable>
+    </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">
+          <cform :fields="infoFields" :rules="rules" v-model="form" labelWidth="150px"></cform>
+        </el-col>
+      </el-row>
+    </template>
+  </div>
+</template>
+
+<script>
+import csearch from '@/components/usual/c-search.vue';
+import cbtn from '@/components/usual/c-btnbar.vue';
+import ctable from '@/components/usual/c-table.vue';
+import cform from '@/components/usual/c-form.vue';
+import methodsUtil from './opera';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: selfShop } = createNamespacedHelpers('selfShop');
+const { mapActions: goods } = createNamespacedHelpers('goods');
+export default {
+  name: 'index',
+  props: {},
+  components: { cbtn, ctable, csearch, cform },
+  data: function () {
+    return {
+      view: 'list',
+      fields: [
+        { label: '商品名称', model: 'name' },
+        { label: '店铺名称', model: 'shop.name' },
+        { label: '商品状态', model: 'status_label' },
+      ],
+      opera: [
+        { label: '修改', method: 'edit' },
+        { label: '删除', method: 'delete', confirm: true, type: 'danger' },
+      ],
+      btnList: [{ label: '添加', method: 'add' }],
+      searchFields: [
+        { label: '商品名称', model: 'name' },
+        { label: '商品状态', model: 'status' },
+      ],
+      searchInfo: {},
+      list: [],
+      total: 0,
+      limit: 10,
+      // info部分
+      infoFields: [
+        { label: '商品名称', model: 'name' },
+        { label: '简短简介', model: 'shot_brief', maxLength: 50 },
+        { label: '规格', model: 'specs', custom: true },
+        { label: '预计发货时间', model: 'send_time' },
+        { label: '商品图片', model: 'file', custom: true },
+        { label: '商品介绍', model: 'brief' },
+        { label: '商品状态', model: 'status', type: 'select' },
+      ],
+      rules: {},
+      form: {},
+    };
+  },
+  created() {
+    this.search();
+  },
+  methods: {
+    ...selfShop(['getInfo', 'getGoods', 'goodsCreate']),
+    ...goods(['delete', 'fetch', 'update']),
+    async search({ skip = 0, limit = this.limit, ...others } = {}) {
+      let query = { skip, limit, ...others };
+      if (Object.keys(this.searchInfo).length > 0) query = { ...query, ...this.searchInfo };
+      const res = await this.getGoods(query);
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
+      }
+    },
+    ...methodsUtil,
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 24 - 0
src/views/selfShop/goods/opera.js

@@ -0,0 +1,24 @@
+export default {
+  async toAdd() {
+    this.view = 'info';
+  },
+  async toEdit({ data }) {
+    const res = await this.fetch(data._id);
+    if (this.$checkRes(res)) {
+      this.$set(this, `form`, res.data);
+      this.view = 'info';
+    } else {
+      this.$message.error('未找到指定数据');
+    }
+  },
+  async toDelete({ data }) {
+    const res = await this.delete(data._id);
+    if (this.$checkRes(res, '操作成功', '操作失败')) {
+      this.$refs.ctable.changePage();
+    }
+  },
+  toBack() {
+    this.form = {};
+    this.view = 'list';
+  },
+};

+ 27 - 0
src/views/selfShop/info/index.vue

@@ -0,0 +1,27 @@
+<template>
+  <div id="index">
+    <p>info</p>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function () {
+    return {};
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  created() {},
+  methods: {},
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 27 - 0
src/views/selfShop/order/index.vue

@@ -0,0 +1,27 @@
+<template>
+  <div id="index">
+    <p>order</p>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function () {
+    return {};
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  created() {},
+  methods: {},
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 1 - 1
vue.config.js

@@ -21,7 +21,7 @@ module.exports = {
         target: 'http://broadcast.waityou24.cn',
       },
       '/point/v1': {
-        target: 'http://127.0.0.1:14001', // 127.0.0.1:13003
+        target: 'http://127.0.0.1:12111', // 127.0.0.1:13003
         changeOrigin: true,
         ws: false,
       },