wenjie 1 ano atrás
pai
commit
5f121ee003

+ 2 - 4
src/permission.js

@@ -1,8 +1,8 @@
 /*
  * @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
  * @Date: 2022-08-02 18:10:30
- * @LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
- * @LastEditTime: 2024-02-22 14:31:48
+ * @LastEditors: wenjie 1454560336@qq.com
+ * @LastEditTime: 2024-02-28 15:30:43
  * @FilePath: \admin-manage\src\permission.js
  * @Description: 
  * 
@@ -32,10 +32,8 @@ router.beforeEach((to, from, next) => {
   // determine whether the user has logged in
   const hasToken = getToken()
   if (hasToken ) {
-    console.log(2222222);
     // 存储商品类型字段
     if(!sessionStorage.getItem('goodsTypeObj')){
-      console.log(11111111);
       getType().then(res=>{
         if(res.state == 'Success'){
           sessionStorage.setItem('goodsTypeObj',JSON.stringify(res.content))

+ 66 - 42
src/router/index.js

@@ -943,6 +943,50 @@ export let constantRoutes = [{
       },
     ]
     },
+
+    {
+      id: 0,
+      path: '/merchantManage/index',
+      component: Layout,
+      redirect: '/merchantManage/index',
+      meta: {
+        title: '商户管理',
+        icon: 'el-icon-s-shop'
+      },
+      children: [{
+          id: 1,
+          path: '/merchantManage/index',
+          name: '/merchantManage/index',
+          component: () => import('@/views/merchantManage/index.vue'),
+          meta: {
+            title: '商户列表',
+            icon: ''
+          },
+        },
+        {
+          id: 1,
+          path: '/merchantManage/shopDetail',
+          name: '/merchantManage/shopDetail',
+          component: () => import('@/views/merchantManage/shopDetail.vue'),
+          hidden:true,
+          meta: {
+            title: '商户详情',
+            icon: '',
+            activeMenu:'/merchantManage/index'
+          },
+        },
+        {
+          id: 1,
+          path: '/merchantManage/addUser',
+          name: '/merchantManage/addUser',
+          component: () => import('@/views/merchantManage/addUser.vue'),
+          meta: {
+            title: '添加商户',
+            icon: ''
+          },
+        },
+      ]
+    },
   // 用户管理
   {
     id: 0,
@@ -985,47 +1029,7 @@ export let constantRoutes = [{
       //     },
       //   ]
       // },
-      {
-        id: 0,
-        path: '/userManage/shopManage',
-        component: operationLayout,
-        redirect: '/userManage/shopManage',
-        meta: {
-          title: '商户管理',
-          icon: ''
-        },
-        children: [{
-            id: 1,
-            path: '/userManage/shopManage/index',
-            name: '/userManage/shopManage/index',
-            component: () => import('@/views/userManage/shopManage/index.vue'),
-            meta: {
-              title: '商户列表',
-              icon: ''
-            },
-          },
-          {
-            id: 1,
-            path: '/userManage/shopManage/shopDetail',
-            name: '/userManage/shopManage/shopDetail',
-            component: () => import('@/views/userManage/shopManage/shopDetail.vue'),
-            meta: {
-              title: '商户详情',
-              icon: ''
-            },
-          },
-          {
-            id: 1,
-            path: '/userManage/shopManage/addUser',
-            name: '/userManage/shopManage/addUser',
-            component: () => import('@/views/userManage/shopManage/addUser.vue'),
-            meta: {
-              title: '添加商户',
-              icon: ''
-            },
-          },
-        ]
-      },
+      
       {
         id: 0,
         path: '/userManage/agentManage',
@@ -1152,7 +1156,27 @@ export let constantRoutes = [{
             },
           },
         ]
-}
+      },
+      {
+        id: 0,
+        path: '/setting/setting',
+        component: operationLayout,
+        meta: {
+          title: '账号设置',
+          icon: ''
+        },
+        children: [{
+            id: 1,
+            path: '/setting/setting',
+            name: '/setting/setting',
+            component: () => import('@/views//setting/setting.vue'),
+            meta: {
+              title: '账号设置',
+              icon: ''
+            },
+          },
+        ]
+      }
     ]
   }
 

+ 0 - 0
src/views/userManage/shopManage/addUser.vue → src/views/merchantManage/addUser.vue


+ 0 - 0
src/views/userManage/shopManage/index.vue → src/views/merchantManage/index.vue


+ 0 - 0
src/views/userManage/shopManage/shopDetail.vue → src/views/merchantManage/shopDetail.vue


+ 120 - 0
src/views/setting/setting.vue

@@ -0,0 +1,120 @@
+<template>
+  <div class="setting app-container">
+    <el-form
+      :model="setQuery"
+      ref="setQuery"
+      :rules="rules"
+      label-width="130px"
+    >
+      <el-form-item label="姓名:" prop="bannerName">
+        <el-input
+          v-model="setQuery.bannerName"
+          class="item-width-300"
+        ></el-input>
+      </el-form-item>
+      <el-form-item label="手机号:" prop="bannerName">
+        <el-input
+          v-model="setQuery.bannerName"
+          class="item-width-300"
+        ></el-input>
+      </el-form-item>
+     <el-form-item label="头像:" prop="bannerImg">
+        <Upload
+          type="bannerImg"
+          id="bannerImg"
+          width="300px"
+          height="200px"
+          uploadType="SHOP_INFO"
+          :imgUrl="setQuery.bannerImg"
+          @uploadEnd="uploadEnd"
+        ></Upload>
+      </el-form-item>
+      
+    </el-form>
+
+    <div class="btn-group">
+       <el-button>取 消</el-button>
+     <el-button type="primary" :loading="loading"  @click="save">确 定</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+import Upload from '@/components/Upload'
+import {addOrUpdateBanner,getMenuName} from '@/api/appConfig'
+export default {
+    components: {
+        Upload,
+    },
+  data() {
+    return {
+        loading:false,
+        setQuery: {
+          "bannerImg": "",
+          "bannerName": "",
+          "id": 0,
+        },
+        rules:{
+            bannerName: [{ required: true, message: "请输入banner名称", trigger: "blur" }],
+            bannerImg: [{ required: true, message: "请输入banner名称", trigger: "blur" }]
+        },
+        options:[]
+    };
+  },
+  methods: {
+    uploadEnd(val){
+      this.setQuery.bannerImg = val.url
+    },
+    getMenuName(){
+      getMenuName({}).then(res=>{
+        if(res.state == 'Success'){
+          for (const key in res.content) {
+            if (res.content.hasOwnProperty.call(res.content, key)) {
+                this.options.push({
+                  label:res.content[key],
+                  value:Number(key) 
+                })              
+            }
+          }
+          
+        }
+      })
+    },
+   save() {
+      this.$refs.setQuery.validate((v) => {
+        if (v) {
+          this.loading = true
+          addOrUpdateBanner(this.setQuery).then(res=>{
+            this.loading = false
+
+            if(res.state == 'Success'){
+
+              this.$notify({
+                  title: '成功',
+                  message: '操作成功',
+                  type: 'success'
+                });
+               
+            }
+          })
+              
+        }
+      });
+    },
+  },
+  created () {
+    this.getMenuName()
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.setting {
+  padding-bottom: 40px;
+  .btn-group{
+    display: flex;
+    align-items: center;
+    justify-content: center;
+  }
+}
+</style>