Browse Source

Merge branch 'master' of http://git.cc-lotus.info/service-platform/mobile-official into master

wxy 4 năm trước cách đây
mục cha
commit
87ddda944a

+ 8 - 0
src/router/index.js

@@ -99,6 +99,13 @@ const routes = [
     meta: { title: '个人中心', isleftarrow: true },
     component: () => import('../views/userCenter/out/index.vue'),
   },
+  // 管理用户菜单
+  {
+    path: '/adminCenter/user/index',
+    name: 'adminCenter_user_index',
+    meta: { title: '用户管理', isleftarrow: true },
+    component: () => import('../views/adminCenter/user/index.vue'),
+  },
   // 登录
   {
     path: '/login',
@@ -123,6 +130,7 @@ router.beforeEach(async (to, form, next) => {
       next({ name: 'login' });
     }
   } else {
+    let res = await store.dispatch('login/toGetUser');
     next();
   }
 });

+ 4 - 0
src/store/index.js

@@ -8,6 +8,8 @@ import product from './market/product';
 import exportuser from './market/exportuser';
 // 登录
 import login from './user/login';
+// 个人中心
+import marketuser from './market/user';
 // 公共
 import * as ustate from '@/store/common/state';
 import * as umutations from '@/store/common/mutations';
@@ -29,5 +31,7 @@ export default new Vuex.Store({
     exportuser,
     // 登录
     login,
+    // 个人中心
+    marketuser,
   },
 });

+ 49 - 0
src/store/market/user.js

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

+ 36 - 36
src/views/adminCenter/user/index.vue

@@ -6,9 +6,17 @@
           <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
         </el-col>
         <el-col :span="24" class="main">
-          <el-col :span="24" class="one">
-            <userlist></userlist>
-          </el-col>
+          <van-tabs v-model="active">
+            <van-tab title="待审核">
+              <userlist :list="oneList"></userlist>
+            </van-tab>
+            <van-tab title="审核通过">
+              <userlist></userlist>
+            </van-tab>
+            <van-tab title="审核拒绝">
+              <userlist></userlist>
+            </van-tab>
+          </van-tabs>
         </el-col>
       </el-col>
     </el-row>
@@ -16,9 +24,10 @@
 </template>
 
 <script>
-import { mapState, createNamespacedHelpers } from 'vuex';
+import { mapState, mapMutations, createNamespacedHelpers } from 'vuex';
 import NavBar from '@/layout/common/topInfo.vue';
 import userlist from './parts/userlist.vue';
+const { mapActions: marketuser } = createNamespacedHelpers('marketuser');
 export default {
   name: 'index',
   props: {},
@@ -30,14 +39,31 @@ export default {
     isleftarrow: '',
     // 返回
     navShow: true,
-    img_path: require('@/assets/logo.png'),
-    active: 0,
     show: false,
-    newform: {},
+    // 用户列表
+    active: '1',
+    // 待审核
+    oneList: [],
   }),
-  created() {},
-  computed: {},
-  methods: {},
+  async created() {
+    await this.search();
+  },
+  methods: {
+    ...marketuser(['userquery']),
+    async search({ ...info } = {}) {
+      console.log(this.user);
+      let user = this.user;
+      if (this.user.code == 'JLCJGLY') {
+        const res = await this.userquery({ ...info });
+        console.log(res);
+      } else {
+        console.log('机构');
+      }
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
   mounted() {
     this.title = this.$route.meta.title;
     this.isleftarrow = this.$route.meta.isleftarrow;
@@ -60,31 +86,5 @@ export default {
 }
 .main {
   min-height: 570px;
-  .two {
-    position: fixed;
-    top: 80%;
-
-    left: 10px;
-    z-index: 999;
-  }
-}
-/deep/.van-tab {
-  text-align: center;
-}
-/deep/.van-tabs--line .van-tabs__wrap {
-  height: 70px;
-  margin: 0 0 10px 0;
-}
-/deep/.van-tab--active {
-  color: red;
-}
-.van-icon {
-  font-size: 20px;
-}
-/deep/.van-popup--bottom {
-  bottom: 0;
-  left: 0;
-  width: 100%;
-  height: 300px;
 }
 </style>

+ 12 - 116
src/views/adminCenter/user/parts/userlist.vue

@@ -1,27 +1,9 @@
 <template>
-  <div id="auditList">
+  <div id="userlist">
     <el-row>
-      <el-col :span="24" class="info">
-        <!-- <el-col :span="24" class="newuser"><van-button type="info" size="small" @click="usersubmit()">新建用户</van-button> </el-col> -->
-        <el-col :span="24" class="list" v-for="(item, index) in list" :key="index">
-          <p class="textOver">
-            <span class="textOver">{{ item.name }}</span>
-            <span style="float:right"> <van-button type="danger" size="small" @click="toDelete(item)">删除</van-button></span>
-            <span style="float:right"
-              ><van-button type="info" size="small" @click="submit(item)">{{
-                item.status == '0' ? '审核' : item.status == '1' ? '查看' : '未识别'
-              }}</van-button>
-            </span>
-          </p>
-          <p>
-            <span class="ptwo"><span>电话:</span>{{ item.phone || '暂无' }}</span>
-            <span class="ptwo">
-              <span>用户类型:</span>{{ item.role == '2' ? '个人用户' : item.role == '3' ? '企业用户' : item.role == '6' ? '专家用户' : '临时用户' }}</span
-            >
-          </p>
-          <p class="newptwo">
-            <span>状态:</span>{{ item.status == '0' ? '待审核' : item.status == '1' ? '审核成功' : item.status == '2' ? '审核拒绝' : '待认证' }}
-          </p>
+      <el-col :span="24">
+        <el-col :span="24" v-for="(item, index) in list" :key="index">
+          <p>{{ item.name }}</p>
         </el-col>
       </el-col>
     </el-row>
@@ -30,53 +12,17 @@
 
 <script>
 import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions: exportuser } = createNamespacedHelpers('exportuser');
-const { mapActions: user } = createNamespacedHelpers('user');
 export default {
-  name: 'auditList',
-  props: {},
+  name: 'userlist',
+  props: {
+    list: { type: Array },
+  },
   components: {},
   data: function() {
-    return {
-      list: [],
-    };
-  },
-  created() {
-    this.search();
-  },
-  methods: {
-    ...user(['query', 'delete', 'update']),
-    ...exportuser({ exportuserQuery: 'query' }),
-    async search() {
-      if (this.user.code == 'JLCJGLY') {
-        const res = await this.query({ limit: '1000' });
-        const resTwo = await this.exportuserQuery({ limit: '1000' });
-        var newData = res.data.concat(resTwo.data);
-        if (this.$checkRes(newData)) {
-          var arr = newData.filter(item => item.pid == undefined && item.status != '3');
-          this.$set(this, `list`, arr);
-        }
-      } else {
-        const res = await this.query({ limit: '1000', code: this.user.code });
-        const resTwo = await this.exportuserQuery({ limit: '1000', code: this.user.code });
-        var newData = res.data.concat(resTwo.data);
-        if (this.$checkRes(newData)) {
-          var arr = newData.filter(item => item.pid == undefined && item.status != '3');
-          this.$set(this, `list`, arr);
-        }
-      }
-    },
-    async submit(item) {
-      this.$router.push({ path: './detail', query: { id: item.id, role: item.role } });
-    },
-    usersubmit() {
-      this.$router.push({ path: './detail' });
-    },
-    async toDelete(item) {
-      const res = await this.delete(item.id);
-      if (this.$checkRes(res, '删除成功', res.errmsg || '删除失败')) this.search();
-    },
+    return {};
   },
+  created() {},
+  methods: {},
   computed: {
     ...mapState(['user']),
     pageTitle() {
@@ -89,54 +35,4 @@ export default {
 };
 </script>
 
-<style lang="less" scoped>
-.newuser {
-  text-align: center;
-  padding: 10px 0 10px 10px;
-}
-.info {
-  border-top: 1px solid #f5f5f5;
-  .list {
-    background: #fff;
-    padding: 0 10px;
-    border-bottom: 1px solid #ccc;
-    p {
-      font-size: 14px;
-      color: #000;
-      padding: 5px 0;
-    }
-    p:first-child {
-      font-size: 16px;
-      span:first-child {
-        width: 60%;
-        display: inline-block;
-      }
-    }
-    p:nth-child(2) .ptwo {
-      display: inline-block;
-      width: 50%;
-    }
-    p:nth-child(2) .ptwo span:first-child {
-      color: #ccc;
-    }
-    p:last-child span {
-      color: #ccc;
-    }
-  }
-}
-.content {
-  padding: 16px 16px 160px;
-  height: 160px;
-  background-color: aqua;
-}
-.newptwo {
-  color: #ccc !important;
-}
-/deep/.van-button--small {
-  min-width: 60px;
-  height: 30px;
-  padding: 0 8px;
-  font-size: 12px;
-  margin: 0 5px 0 0;
-}
-</style>
+<style lang="less" scoped></style>

+ 0 - 99
src/views/user/index copy.vue

@@ -1,99 +0,0 @@
-<template>
-  <div id="index">
-    <el-row>
-      <el-col :span="24" class="style">
-        <el-col :span="24" class="top">
-          <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
-        </el-col>
-        <el-col :span="24" class="main">
-          <el-col :span="24" class="one">
-            <el-image :src="imgUrl"></el-image>
-            <p>{{ user.name }}</p>
-          </el-col>
-          <el-col :span="24" class="two">
-            <clickBtn></clickBtn>
-          </el-col>
-        </el-col>
-        <el-col :span="24" class="foot">
-          <footInfo></footInfo>
-        </el-col>
-      </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script>
-import { mapState, createNamespacedHelpers } from 'vuex';
-import NavBar from '@/layout/common/topInfo.vue';
-import footInfo from '@/layout/common/footInfo.vue';
-import clickBtn from './parts/clickBtn.vue';
-
-export default {
-  name: 'index',
-  props: {},
-  components: {
-    NavBar,
-    footInfo,
-    clickBtn,
-  },
-  data: function() {
-    return {
-      // 头部标题
-      title: '',
-      // meta为true
-      isleftarrow: '',
-      // 返回
-      navShow: true,
-      imgUrl: require('@/assets/test.jpg'),
-    };
-  },
-  created() {
-    console.log(this.user.uid);
-  },
-  methods: {},
-  computed: {
-    ...mapState(['user']),
-  },
-  mounted() {
-    this.title = this.$route.meta.title;
-    this.isleftarrow = this.$route.meta.isleftarrow;
-  },
-};
-</script>
-
-<style lang="less" scoped>
-.style {
-  width: 100%;
-  min-height: 667px;
-  position: relative;
-  background-color: #f9fafc;
-}
-.top {
-  height: 46px;
-  overflow: hidden;
-  position: relative;
-  z-index: 999;
-}
-.main {
-  min-height: 570px;
-  .one {
-    text-align: center;
-    background-color: #fff;
-    padding: 15px 0;
-    margin: 0 0 1px 0;
-    .el-image {
-      width: 80px;
-      height: 80px;
-      border-radius: 90px;
-    }
-    p {
-      font-size: 18px;
-      padding: 15px 0;
-    }
-  }
-}
-.foot {
-  position: absolute;
-  bottom: 0;
-}
-</style>

+ 17 - 0
src/views/user/parts/clickBtn.vue

@@ -9,6 +9,23 @@
           <van-cell is-link title="展会管理" @click="$router.push({ path: '/userCenter/dock/index' })" />
           <van-cell is-link title="退出登录" @click="$router.push({ path: '/userCenter/out/index' })" /> -->
         </span>
+        <span v-else>
+          <span v-if="user.role == '0'">
+            <van-cell is-link title="用户管理" @click="$router.push({ path: '/adminCenter/user/index' })" />
+            <van-cell is-link title="展会管理" @click="$router.push({ path: '' })" />
+            <van-cell is-link title="审核管理" @click="$router.push({ path: '' })" />
+            <van-cell is-link title="交易审核" @click="$router.push({ path: '' })" />
+          </span>
+          <span v-else-if="user.role == '1'">
+            机构
+          </span>
+          <span v-else-if="user.role == '3'">
+            展会负责人
+          </span>
+          <span v-else-if="user.role == '8'">
+            展会vip用户
+          </span>
+        </span>
         <!-- <span v-else>
           <span v-if="user.role == '0'">
             <van-cell is-link title="用户管理" @click="$router.push({ path: '/adminCenter/user/index' })" />

+ 0 - 99
src/views/user/parts/index.vue

@@ -1,99 +0,0 @@
-<template>
-  <div id="index">
-    <el-row>
-      <el-col :span="24" class="style">
-        <el-col :span="24" class="top">
-          <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
-        </el-col>
-        <el-col :span="24" class="main">
-          <el-col :span="24" class="one">
-            <el-image :src="imgUrl"></el-image>
-            <p>{{ user.name }}</p>
-          </el-col>
-          <el-col :span="24" class="two">
-            <clickBtn></clickBtn>
-          </el-col>
-        </el-col>
-        <el-col :span="24" class="foot">
-          <footInfo></footInfo>
-        </el-col>
-      </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script>
-import { mapState, createNamespacedHelpers } from 'vuex';
-import NavBar from '@/layout/common/topInfo.vue';
-import footInfo from '@/layout/common/footInfo.vue';
-import clickBtn from './parts/clickBtn.vue';
-
-export default {
-  name: 'index',
-  props: {},
-  components: {
-    NavBar,
-    footInfo,
-    clickBtn,
-  },
-  data: function() {
-    return {
-      // 头部标题
-      title: '',
-      // meta为true
-      isleftarrow: '',
-      // 返回
-      navShow: true,
-      imgUrl: require('@/assets/test.jpg'),
-    };
-  },
-  created() {
-    console.log(this.user.uid);
-  },
-  methods: {},
-  computed: {
-    ...mapState(['user']),
-  },
-  mounted() {
-    this.title = this.$route.meta.title;
-    this.isleftarrow = this.$route.meta.isleftarrow;
-  },
-};
-</script>
-
-<style lang="less" scoped>
-.style {
-  width: 100%;
-  min-height: 667px;
-  position: relative;
-  background-color: #f9fafc;
-}
-.top {
-  height: 46px;
-  overflow: hidden;
-  position: relative;
-  z-index: 999;
-}
-.main {
-  min-height: 570px;
-  .one {
-    text-align: center;
-    background-color: #fff;
-    padding: 15px 0;
-    margin: 0 0 1px 0;
-    .el-image {
-      width: 80px;
-      height: 80px;
-      border-radius: 90px;
-    }
-    p {
-      font-size: 18px;
-      padding: 15px 0;
-    }
-  }
-}
-.foot {
-  position: absolute;
-  bottom: 0;
-}
-</style>