guhongwei 4 년 전
부모
커밋
d671f385ad

+ 2 - 0
src/layout/live/head.vue

@@ -151,6 +151,8 @@ export default {
         } else {
           this.$router.push('/market/index');
         }
+      } else if (this.user.type == 'train') {
+        this.$router.push({ path: '/trainCenter/index', query: { num: '1' } });
       } else {
         this.$router.push({ path: '/kjpdCenter/index', query: { num: '1' } });
       }

+ 123 - 0
src/layout/trainCenter/menuInfo.vue

@@ -0,0 +1,123 @@
+<template>
+  <div id="menuInfo">
+    <el-row>
+      <el-col :span="24">
+        <el-col :span="24" class="top">
+          <el-image :src="topUrl"></el-image>
+          <span>个人中心</span>
+        </el-col>
+        <el-col :span="24">
+          <el-menu :default-active="num" @select="selectMenu" text-color="#999" active-text-color="#044b79">
+            <el-menu-item index="1">
+              <template slot="title">
+                <i class="el-icon-notebook-1"></i>
+                <span>基本信息</span>
+              </template>
+            </el-menu-item>
+            <el-menu-item index="2">
+              <template slot="title">
+                <i class="el-icon-video-camera-solid"></i>
+                <span>视频管理</span>
+              </template>
+            </el-menu-item>
+            <el-menu-item index="3">
+              <template slot="title">
+                <i class="el-icon-user"></i>
+                <span>用户管理</span>
+              </template>
+            </el-menu-item>
+            <!-- <el-menu-item index="4">
+              <template slot="title">
+                <i class="el-icon-refresh-right"></i>
+                <span>进入频道</span>
+              </template>
+            </el-menu-item> -->
+            <el-menu-item index="5">
+              <template slot="title">
+                <i class="el-icon-circle-close"></i>
+                <span>退出登录</span>
+              </template>
+            </el-menu-item>
+          </el-menu>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: login } = createNamespacedHelpers('login');
+export default {
+  name: 'menuInfo',
+  props: {},
+  components: {},
+  data: function() {
+    return {
+      topUrl: require('@/assets/live/square_big.png'),
+      num: 1,
+      haveMsg: false,
+    };
+  },
+  created() {
+    this.$set(this, `num`, this.$route.query.num);
+  },
+  mounted() {},
+  methods: {
+    ...login({ logout: 'logout', transactiondtetle: 'delete' }),
+    // 菜单跳转
+    async selectMenu(key) {
+      if (key == '4') {
+        // this.$router.push({ path: '/kjpdhall/index', query: { id: this.user.id } });
+      } else if (key == '5') {
+        this.logout();
+        this.$message({
+          message: '退出登录成功',
+          type: 'success',
+        });
+        this.$router.push({ path: '/' });
+      } else {
+        this.$router.push({ path: '/trainCenter/index', query: { num: key } });
+      }
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.top {
+  height: 50px;
+  line-height: 50px;
+  text-align: center;
+  border-bottom: 1px solid #2d64b3;
+  .el-image {
+    float: left;
+    padding: 10px 40px;
+    width: 30px;
+    height: 30px;
+  }
+  span {
+    font-size: 24px;
+    color: #92959a;
+    font-weight: 600;
+    float: left;
+    text-align: left;
+  }
+}
+/deep/.el-menu-item {
+  font-weight: bold;
+  font-size: 20px;
+  text-align: center;
+  border-bottom: 1px solid #2d64b3;
+  margin: 0 20px;
+}
+</style>

+ 13 - 0
src/router/index.js

@@ -97,6 +97,13 @@ const live = [
         name: 'live_apply',
         component: () => import('../views/hall/liveApply.vue'),
       },
+      // 培训问诊
+      {
+        path: '/hallList/trainLogin',
+        name: 'trainLogin',
+        meta: { title: '管理登录', subSite: true },
+        component: () => import('../views/hallList/trainLogin.vue'),
+      },
     ],
   },
   // 首页
@@ -263,6 +270,12 @@ const live = [
     meta: { title: '个人中心', subSite: true },
     component: () => import('../views/kjpdCenter/index.vue'),
   },
+  // 培训问诊-个人中心
+  {
+    path: '/trainCenter/index',
+    meta: { title: '个人中心', subSite: true },
+    component: () => import('../views/trainCenter/index.vue'),
+  },
   // 通知
   {
     path: '/notice/index',

+ 75 - 1
src/store/live/trainlive.js

@@ -1,16 +1,24 @@
 import Vue from 'vue';
 import Vuex from 'vuex';
 import _ from 'lodash';
+import { Notification } from 'element-ui';
+const jwt = require('jsonwebtoken');
 Vue.use(Vuex);
 const api = {
   trainliveInfo: `/api/live/trainlive`,
+  logininfo: `/api/live/trainlive/login`,
+  userloginInfo: `/api/live/trainlive/user`,
 };
 const state = () => ({});
 const mutations = {};
 
 const actions = {
   async query({ commit }, { skip = 0, limit = undefined, ...info } = {}) {
-    const res = await this.$axios.$get(api.trainliveInfo, { skip, limit, ...info });
+    const res = await this.$axios.$get(api.trainliveInfo, {
+      skip,
+      limit,
+      ...info,
+    });
     return res;
   },
   async create({ commit }, payload) {
@@ -31,6 +39,72 @@ const actions = {
     const res = await this.$axios.$delete(`${api.trainliveInfo}/${payload}`);
     return res;
   },
+  async login({ commit, dispatch }, { user, router, path = '/', needReturn = false, typeCheck = false, isWx = false, needNotice = true }) {
+    let res = await this.$axios.$post(`${api.logininfo}`, user);
+    if (res.errcode == '0') {
+      localStorage.setItem('user', JSON.stringify(res.data));
+      commit('setUser', res.data, { root: true });
+      Notification({
+        title: '登录成功',
+        type: 'success',
+        duration: 2000,
+        offset: 50,
+      });
+      return res;
+    } else {
+      Notification({
+        title: '登录失败',
+        message: `失败原因:${res.errmsg || '登陆失败'}`,
+        type: 'error',
+      });
+    }
+  },
+  // 参加用户
+  async userCreate({ commit }, { id, ...info } = {}) {
+    const res = await this.$axios.$post(`${api.trainliveInfo}/user/${id}`, {
+      ...info,
+    });
+    return res;
+  },
+  async userDelete({ commit }, { id, ...info } = {}) {
+    const res = await this.$axios.$delete(`${api.trainliveInfo}/user/${id}`, {
+      ...info,
+    });
+    return res;
+  },
+  async userUpdate({ commit }, { id, ...info } = {}) {
+    const res = await this.$axios.$post(`${api.trainliveInfo}/user/update/${id}`, {
+      ...info,
+    });
+    return res;
+  },
+  async userLogin({ commit }, { id, ...info } = {}) {
+    const res = await this.$axios.$post(`${api.userloginInfo}/login/${id}`, {
+      ...info,
+    });
+    if (res.errcode == '0') {
+      localStorage.setItem('user', JSON.stringify(res.data));
+      commit('setUser', res.data, { root: true });
+      Notification({
+        title: '登录成功',
+        type: 'success',
+        duration: 2000,
+        offset: 50,
+      });
+      return res;
+    } else {
+      Notification({
+        title: '登录失败',
+        message: `失败原因:${res.errmsg || '登陆失败'}`,
+        type: 'error',
+      });
+    }
+  },
+  async userLogout({ commit }, { id } = {}) {
+    window.localStorage.removeItem('user');
+    const res = await this.$axios.$post(`${api.userloginInfo}/logout/${id}`);
+    commit('deleteUser');
+  },
 };
 
 export default {

+ 0 - 1
src/store/user/login.js

@@ -98,7 +98,6 @@ const actions = {
     window.localStorage.removeItem('user');
     let key = localStorage.removeItem('token');
     const res = await this.$axios.$post(api.logout, { key: key });
-
     commit('deleteUser');
   },
   async update({ commit }, payload) {

+ 211 - 0
src/views/exporthall/index copy.vue

@@ -0,0 +1,211 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="main">
+        <div class="w_1200">
+          <el-col :span="24" class="one">
+            <el-col :span="24" class="top">
+              <p>培训问诊在线展会模板</p>
+              <p>主办方:吉林省计算中心</p>
+            </el-col>
+          </el-col>
+          <el-col :span="24" class="two">
+            <el-col :span="22" class="left" :offset="1">
+              <el-col :span="24" class="top">
+                <span style="color:#409eff">专家培训直播</span>
+                <span>直播</span>
+              </el-col>
+              <el-col :span="24" class="down">
+                视频播放框
+              </el-col>
+            </el-col>
+            <el-col :span="22" class="right" :offset="1">
+              <el-col :span="24" class="top">
+                公共聊天
+              </el-col>
+              <el-col :span="24" class="down">
+                <el-col :span="24" class="list">
+                  <el-col :span="24" class="chatList" v-for="(item, index) in chatList" :key="index">
+                    <el-col :span="1" class="image">
+                      <el-image :src="touxiang" style="width:30px;height:30px"></el-image>
+                    </el-col>
+                    <el-col :span="23" class="other">
+                      <el-col :span="24" class="otherone">
+                        <span>{{ item.name }}</span>
+                        <span>{{ item.date }}</span>
+                      </el-col>
+                      <el-col :span="24" class="othertwo">
+                        <p class="remark">{{ item.content }}</p>
+                      </el-col>
+                    </el-col>
+                  </el-col>
+                </el-col>
+                <el-col :span="24" class="chat">
+                  <el-col :span="21" class="input">
+                    <el-input v-model="text" placeholder="请输入聊天内容"></el-input>
+                  </el-col>
+                  <el-col :span="3" class="btn">
+                    <el-button type="primary" size="mini">发送</el-button>
+                  </el-col>
+                </el-col>
+              </el-col>
+            </el-col>
+          </el-col>
+        </div>
+        <div class="pz_down">
+          <live-foot></live-foot>
+        </div>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import liveFoot from '@/layout/live/foot.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'index',
+  props: {},
+  components: { liveFoot },
+  data: function() {
+    return {
+      // 聊天列表 超过6个就有滚动条
+      chatList: [
+        { name: '顾红伟', date: '10:00', content: '信息内容' },
+        { name: '顾红伟', date: '10:00', content: '信息内容' },
+      ],
+      touxiang: require('@/assets/emotion/touxiang.png'),
+      // 发言内容
+      text: '',
+      per: require('@/assets/personal.jpg'),
+      // 招聘信息
+    };
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .one {
+    .top {
+      text-align: center;
+      margin: 50px 0;
+      p:nth-child(1) {
+        font-size: 50px;
+        font-family: cursive;
+      }
+      p:nth-child(2) {
+        font-size: 18px;
+        padding: 15px 0;
+      }
+    }
+  }
+  .two {
+    margin: 0 0 15px 0;
+    text-align: center;
+    .left {
+      height: 600px;
+      overflow: hidden;
+      border: 5px solid #000;
+      background: #fff;
+      border-radius: 5px;
+      padding: 10px;
+      .top {
+        height: 30px;
+        line-height: 30px;
+        font-weight: bold;
+        font-size: 20px;
+        margin: 0 0 5px 0;
+      }
+      .down {
+        height: 535px;
+        background-color: #000;
+        color: #fff;
+      }
+    }
+    .right {
+      height: 560px;
+      margin-top: 30px;
+      border-top-left-radius: 5px;
+      border-bottom-left-radius: 5px;
+      overflow: hidden;
+      background: #f0ffff5f;
+      border-bottom: 1px solid #f1f1f1;
+      .top {
+        height: 40px;
+        line-height: 40px;
+        padding: 0 10px;
+        font-weight: bold;
+        font-size: 18px;
+        color: #fff;
+        background-color: #409eff;
+      }
+      .down {
+        overflow: hidden;
+        padding: 0 0 0 10px;
+        .list {
+          height: 480px;
+          overflow-y: auto;
+          .chatList {
+            padding: 10px 0;
+            border-bottom: 1px dashed #409eff;
+            .image {
+              text-align: center;
+            }
+            .other {
+              .otherone {
+                text-align: left;
+                span:nth-child(1) {
+                  color: #000;
+                  font-size: 16px;
+                  font-weight: bold;
+                }
+                span:nth-child(2) {
+                  display: inline-block;
+                  margin: 0 0 0 15px;
+                  color: #ccc;
+                }
+              }
+              .othertwo {
+                margin: 5px 0 0 0;
+                color: #000;
+                .remark {
+                  min-height: 20px;
+                  font-size: 15px;
+                  padding: 5px;
+                  border-radius: 5px;
+                  background: #cccccc5f;
+                }
+              }
+            }
+          }
+        }
+        .chat {
+          height: 40px;
+          .input {
+            /deep/.el-input__inner {
+              height: 35px;
+              line-height: 35px;
+            }
+          }
+          .btn {
+            /deep/.el-button--mini,
+            .el-button--mini.is-round {
+              padding: 10px 15px;
+              width: 100%;
+            }
+          }
+        }
+      }
+    }
+  }
+}
+</style>

+ 39 - 188
src/views/exporthall/index.vue

@@ -1,211 +1,62 @@
 <template>
   <div id="index">
     <el-row>
-      <el-col :span="24" class="main">
-        <div class="w_1200">
-          <el-col :span="24" class="one">
-            <el-col :span="24" class="top">
-              <p>培训问诊在线展会模板</p>
-              <p>主办方:吉林省计算中心</p>
-            </el-col>
-          </el-col>
-          <el-col :span="24" class="two">
-            <el-col :span="22" class="left" :offset="1">
-              <el-col :span="24" class="top">
-                <span style="color:#409eff">专家培训直播</span>
-                <span>直播</span>
-              </el-col>
-              <el-col :span="24" class="down">
-                视频播放框
-              </el-col>
-            </el-col>
-            <el-col :span="22" class="right" :offset="1">
-              <el-col :span="24" class="top">
-                公共聊天
-              </el-col>
-              <el-col :span="24" class="down">
-                <el-col :span="24" class="list">
-                  <el-col :span="24" class="chatList" v-for="(item, index) in chatList" :key="index">
-                    <el-col :span="1" class="image">
-                      <el-image :src="touxiang" style="width:30px;height:30px"></el-image>
-                    </el-col>
-                    <el-col :span="23" class="other">
-                      <el-col :span="24" class="otherone">
-                        <span>{{ item.name }}</span>
-                        <span>{{ item.date }}</span>
-                      </el-col>
-                      <el-col :span="24" class="othertwo">
-                        <p class="remark">{{ item.content }}</p>
-                      </el-col>
-                    </el-col>
-                  </el-col>
-                </el-col>
-                <el-col :span="24" class="chat">
-                  <el-col :span="21" class="input">
-                    <el-input v-model="text" placeholder="请输入聊天内容"></el-input>
-                  </el-col>
-                  <el-col :span="3" class="btn">
-                    <el-button type="primary" size="mini">发送</el-button>
-                  </el-col>
-                </el-col>
-              </el-col>
-            </el-col>
-          </el-col>
-        </div>
-        <div class="pz_down">
-          <live-foot></live-foot>
-        </div>
+      <el-col :span="24">
+        <el-col :span="24">
+          {{ liveInfo.title }}
+        </el-col>
+        <el-col :span="24">
+          <el-button type="primary" size="mini" @click="loginOut">退出</el-button>
+        </el-col>
       </el-col>
     </el-row>
   </div>
 </template>
 
 <script>
-import liveFoot from '@/layout/live/foot.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: trainlive } = createNamespacedHelpers('trainlive');
 export default {
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
   name: 'index',
   props: {},
-  components: { liveFoot },
+  components: {},
   data: function() {
     return {
-      // 聊天列表 超过6个就有滚动条
-      chatList: [
-        { name: '顾红伟', date: '10:00', content: '信息内容' },
-        { name: '顾红伟', date: '10:00', content: '信息内容' },
-      ],
-      touxiang: require('@/assets/emotion/touxiang.png'),
-      // 发言内容
-      text: '',
-      per: require('@/assets/personal.jpg'),
-      // 招聘信息
+      // 展会详情
+      liveInfo: {},
     };
   },
-  created() {},
-  methods: {},
+  async created() {
+    await this.search();
+  },
+  methods: {
+    ...trainlive(['fetch', 'userLogout']),
+    async search() {
+      if (this.id) {
+        let res = await this.fetch(this.id);
+        if (this.$checkRes(res)) {
+          this.$set(this, `liveInfo`, res.data);
+        }
+      }
+    },
+    async loginOut() {
+      let res = await this.userLogout({ id: '6006333bc54267a190981cea' });
+      if (this.$checkRes(res)) {
+        console.log(res.data);
+      }
+    },
+  },
   computed: {
     ...mapState(['user']),
+    id() {
+      return this.$route.query.id;
+    },
   },
-  metaInfo() {
-    return { title: this.$route.meta.title };
-  },
+  watch: {},
 };
 </script>
 
-<style lang="less" scoped>
-.main {
-  .one {
-    .top {
-      text-align: center;
-      margin: 50px 0;
-      p:nth-child(1) {
-        font-size: 50px;
-        font-family: cursive;
-      }
-      p:nth-child(2) {
-        font-size: 18px;
-        padding: 15px 0;
-      }
-    }
-  }
-  .two {
-    margin: 0 0 15px 0;
-    text-align: center;
-    .left {
-      height: 600px;
-      overflow: hidden;
-      border: 5px solid #000;
-      background: #fff;
-      border-radius: 5px;
-      padding: 10px;
-      .top {
-        height: 30px;
-        line-height: 30px;
-        font-weight: bold;
-        font-size: 20px;
-        margin: 0 0 5px 0;
-      }
-      .down {
-        height: 535px;
-        background-color: #000;
-        color: #fff;
-      }
-    }
-    .right {
-      height: 560px;
-      margin-top: 30px;
-      border-top-left-radius: 5px;
-      border-bottom-left-radius: 5px;
-      overflow: hidden;
-      background: #f0ffff5f;
-      border-bottom: 1px solid #f1f1f1;
-      .top {
-        height: 40px;
-        line-height: 40px;
-        padding: 0 10px;
-        font-weight: bold;
-        font-size: 18px;
-        color: #fff;
-        background-color: #409eff;
-      }
-      .down {
-        overflow: hidden;
-        padding: 0 0 0 10px;
-        .list {
-          height: 480px;
-          overflow-y: auto;
-          .chatList {
-            padding: 10px 0;
-            border-bottom: 1px dashed #409eff;
-            .image {
-              text-align: center;
-            }
-            .other {
-              .otherone {
-                text-align: left;
-                span:nth-child(1) {
-                  color: #000;
-                  font-size: 16px;
-                  font-weight: bold;
-                }
-                span:nth-child(2) {
-                  display: inline-block;
-                  margin: 0 0 0 15px;
-                  color: #ccc;
-                }
-              }
-              .othertwo {
-                margin: 5px 0 0 0;
-                color: #000;
-                .remark {
-                  min-height: 20px;
-                  font-size: 15px;
-                  padding: 5px;
-                  border-radius: 5px;
-                  background: #cccccc5f;
-                }
-              }
-            }
-          }
-        }
-        .chat {
-          height: 40px;
-          .input {
-            /deep/.el-input__inner {
-              height: 35px;
-              line-height: 35px;
-            }
-          }
-          .btn {
-            /deep/.el-button--mini,
-            .el-button--mini.is-round {
-              padding: 10px 15px;
-              width: 100%;
-            }
-          }
-        }
-      }
-    }
-  }
-}
-</style>
+<style lang="less" scoped></style>

+ 3 - 3
src/views/hallList/index.vue

@@ -11,7 +11,7 @@
               <personal :province="province" :place="place"></personal>
             </el-tab-pane>
             <el-tab-pane label="培训问诊在线">
-              <exports :province="province" :place="place"></exports>
+              <trainlive :province="province" :place="place"></trainlive>
             </el-tab-pane>
             <el-tab-pane label="科技频道在线">
               <kjpd></kjpd>
@@ -26,7 +26,7 @@
 <script>
 import product from './parts/product.vue';
 import personal from './parts/personal.vue';
-import exports from './parts/export.vue';
+import trainlive from './parts/trainlive.vue';
 // 科技频道
 import kjpd from './parts/kjpd.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
@@ -37,7 +37,7 @@ export default {
   components: {
     product,
     personal,
-    exports,
+    trainlive,
     kjpd,
   },
   data: function() {

+ 0 - 101
src/views/hallList/parts/export.vue

@@ -1,101 +0,0 @@
-<template>
-  <div id="export">
-    <el-row>
-      <el-col :span="24" class="product">
-        <!-- 是否支持多开 accordion -->
-        <el-collapse v-model="activeName" accordion>
-          <el-collapse-item title="正在直播" name="1">
-            <exportlist :list="listNow" :total="nowTotal" status="1" @query="searchList" :province="province" :place="place"></exportlist>
-          </el-collapse-item>
-          <el-collapse-item title="下期预告" name="2">
-            <exportlist :list="listPre" :total="preTotal" status="0" @query="searchList" :province="province" :place="place"></exportlist>
-          </el-collapse-item>
-          <el-collapse-item title="往期直播" name="3">
-            <exportlist :list="listPast" :total="pastTotal" status="2" @query="searchList" :province="province" :place="place"></exportlist>
-          </el-collapse-item>
-        </el-collapse>
-      </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script>
-import _ from 'lodash';
-import exportlist from './exportlist.vue';
-import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions: dock } = createNamespacedHelpers('dock');
-export default {
-  name: 'export',
-  props: {
-    // 省
-    province: { type: Array, default: () => [] },
-    // 市
-    place: { type: Array, default: () => [] },
-  },
-  components: {
-    exportlist,
-  },
-  data: function() {
-    return {
-      activeName: '1',
-      // 下期预告
-      listPre: [
-        {
-          end_time: '2020-10-23 00:00',
-          place: '220100',
-          province: '220000',
-          start_time: '2020-10-16 10:00',
-          status: '1',
-          title: '培训问诊在线模板',
-        },
-      ],
-      preTotal: 0,
-      // 正在直播
-      listNow: [
-        {
-          end_time: '2020-10-23 00:00',
-          place: '220100',
-          province: '220000',
-          start_time: '2020-10-16 10:00',
-          status: '1',
-          title: '培训问诊在线模板',
-        },
-      ],
-      nowTotal: 0,
-      // 往期直播
-      listPast: [
-        {
-          end_time: '2020-10-23 00:00',
-          place: '220100',
-          province: '220000',
-          start_time: '2020-10-16 10:00',
-          status: '1',
-          title: '培训问诊在线模板',
-        },
-      ],
-      pastTotal: 0,
-    };
-  },
-  async created() {
-    await this.searchList({ status: '0' });
-    await this.searchList({ status: '1' });
-    await this.searchList({ status: '2' });
-  },
-  methods: {
-    ...dock({ dockQuery: 'query' }),
-    async searchList({ skip = 0, limit = 10, status, ...info } = {}) {},
-  },
-  computed: {
-    ...mapState(['user']),
-  },
-  metaInfo() {
-    return { title: this.$route.meta.title };
-  },
-};
-</script>
-
-<style lang="less" scoped>
-/deep/.el-collapse-item__content {
-  padding-bottom: 0;
-}
-</style>

+ 0 - 137
src/views/hallList/parts/exportlist.vue

@@ -1,137 +0,0 @@
-<template>
-  <div id="personallist">
-    <el-row>
-      <el-col :span="24" class="productlist">
-        <el-col :span="8" class="list" v-for="(item, index) in list" :key="index">
-          <el-image :src="hall" style="width:100%;height:200px;"></el-image>
-          <el-col :span="24" class="other">
-            <p class="textOver">{{ item.title }}</p>
-            <p class="textOver">
-              <span><i class="el-icon-location-outline"></i>{{ getprovince(item.province) }}-{{ getplace(item.place) }}</span>
-              <span><i class="el-icon-time"></i>{{ item.start_time }}-{{ item.end_time }}</span>
-            </p>
-            <p>
-              <el-button type="warning" size="mini" @click="linkBtn(item)">进入对接会</el-button>
-              <!-- <el-button type="warning" size="mini" @click="dockBtn()" v-if="user.role == '3' || user.role == '7'">管理进入</el-button> -->
-              <!-- <el-button type="warning" size="mini" @click="linkBtn(item)" v-if="status == '1'">进入对接会</el-button> -->
-              <!-- <el-button type="warning" size="mini" @click="apply(item)" v-if="status == '0' && user.uid != undefined">申请对接会</el-button>
-              <el-button type="warning" size="mini" @click="check(item)" v-if="status == '2' && user.role == '3'">查看成果</el-button> -->
-            </p>
-          </el-col>
-        </el-col>
-      </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script>
-import page from '@/components/pagination.vue';
-import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions: dock } = createNamespacedHelpers('dock');
-export default {
-  name: 'personallist',
-  props: {
-    list: { type: Array, default: () => [] },
-    status: { type: String, default: '0' },
-    // 省
-    province: { type: Array, default: () => [] },
-    // 市
-    place: { type: Array, default: () => [] },
-  },
-  components: {},
-  data: () => {
-    return {
-      hall: require('@a/expert.jpg'),
-    };
-  },
-  created() {},
-  methods: {
-    ...dock({ livefetch: 'fetch', livelist: 'query', livecreate: 'create', liveupdate: 'update' }),
-    // 过滤省
-    getprovince(item) {
-      let res = this.province.find(i => i.code == item);
-      if (res) return res.name;
-    },
-    // 过滤市
-    getplace(item) {
-      let res = this.place.find(i => i.code == item);
-      if (res) return res.name;
-    },
-
-    // 管理进入
-    dockBtn() {
-      // if (this.user.uid) {
-      //   this.$router.push({ path: '/adminCenter/index', query: { num: '1' } });
-      // } else {
-      //   this.$router.push({ path: '/dockLogin' });
-      // }
-    },
-    // 进入对接会
-    async linkBtn(item) {
-      if (this.user.uid || this.user.suid) {
-        if (
-          this.user.role == '2' ||
-          this.user.role == '3' ||
-          this.user.role == '4' ||
-          this.user.role == '5' ||
-          this.user.role == '6' ||
-          this.user.role == '7' ||
-          this.user.role == '8'
-        ) {
-          this.$router.push({ path: '/exporthall/index', query: { id: item.id } });
-        } else {
-          this.$router.push({ path: '/webLogin' });
-        }
-      } else {
-        this.$router.push({ path: '/webLogin' });
-      }
-    },
-    // 申请对接会
-    apply(item) {
-      // this.$router.push({ path: '/live/liveApply', query: { id: item.id } });
-    },
-    // 查看成果
-    check(item) {
-      // this.$router.push({ path: '/hallList/zongjie', query: { id: item.id } });
-    },
-  },
-  computed: {
-    ...mapState(['user']),
-  },
-};
-</script>
-
-<style lang="less" scoped>
-.productlist {
-  .list {
-    position: relative;
-    width: 32%;
-    height: 310px;
-    border: 1px solid #ccc;
-    margin: 0 15px 10px 0;
-    .other {
-      p:nth-child(1) {
-        padding: 0 10px;
-        font-size: 16px;
-        font-weight: bold;
-      }
-      p:nth-child(2) {
-        padding: 5px;
-        span:nth-child(2) {
-          float: right;
-        }
-      }
-      p:nth-child(3) {
-        position: absolute;
-        width: 100%;
-        bottom: 5px;
-        text-align: center;
-      }
-    }
-  }
-  .list:nth-child(3n) {
-    width: 33%;
-    margin: 0 0 10px 0;
-  }
-}
-</style>

+ 157 - 0
src/views/hallList/parts/trainlive.vue

@@ -0,0 +1,157 @@
+<template>
+  <div id="trainlive">
+    <el-row>
+      <el-col :span="24" class="main">
+        <el-col :span="8" class="list" v-for="(item, index) in list" :key="index">
+          <el-image :src="url"></el-image>
+          <el-col :span="24" class="info">
+            <p class="title">
+              <span>[{{ item.room_id }}]</span>{{ item.title }}
+            </p>
+            <p class="other">开办城市:{{ getprovince(item.province) }}-{{ getplace(item.place) }}</p>
+            <p class="other">开始时间:{{ item.create_date }}</p>
+          </el-col>
+          <el-col :span="24" class="btn">
+            <el-button type="warning" size="mini" @click="adminBtn(item)">管理进入</el-button>
+            <el-button type="primary" size="mini" @click="userBtn(item)">进入频道</el-button>
+          </el-col>
+        </el-col>
+      </el-col>
+    </el-row>
+    <el-dialog title="用户登录" width="30%" :visible.sync="dialog">
+      <el-form :model="form" :rules="rules" ref="form" label-width="100px">
+        <el-form-item label="账号" prop="user_phone">
+          <el-input v-model="form.user_phone" placeholder="请输入账号"></el-input>
+        </el-form-item>
+        <el-form-item label="密码" prop="user_password">
+          <el-input v-model="form.user_password" placeholder="请输入密码" show-password></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" style="text-align:center">
+        <el-button @click="resetBtn">取消</el-button>
+        <el-button type="primary" @click="onSubmit">确认</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: trainlive } = createNamespacedHelpers('trainlive');
+export default {
+  name: 'trainlive',
+  props: {
+    // 省
+    province: { type: Array, default: () => [] },
+    // 市
+    place: { type: Array, default: () => [] },
+  },
+  components: {},
+  data: function() {
+    return {
+      list: [],
+      url: require('@a/expert.jpg'),
+      dialog: false,
+      form: {},
+      rules: {
+        user_phone: [{ required: true, message: '请输入账号', trigger: 'blur' }],
+        user_password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
+      },
+      // 展会
+      live_id: '',
+    };
+  },
+  async created() {
+    await this.search();
+  },
+  methods: {
+    ...trainlive(['query', 'userLogin']),
+    // 查询
+    async search({ skip = 0, limit = 10, ...info } = {}) {
+      let res = await this.query({ skip, ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+      }
+    },
+    // 过滤省
+    getprovince(item) {
+      let res = this.province.find(i => i.code == item);
+      if (res) return res.name;
+    },
+    // 过滤市
+    getplace(item) {
+      let res = this.place.find(i => i.code == item);
+      if (res) return res.name;
+    },
+    // 管理进入
+    adminBtn(data) {
+      if (this.user.room_id) {
+        this.$router.push({ path: '/trainCenter/index', query: { num: '1' } });
+      } else {
+        this.$router.push({ path: '/hallList/trainLogin' });
+      }
+    },
+    // 进入频道
+    userBtn(data) {
+      this.$set(this, `live_id`, data.id);
+      this.dialog = true;
+    },
+    // 确定
+    async onSubmit() {
+      let data = this.form;
+      data.id = this.live_id;
+      const res = await this.userLogin(data);
+      if (this.$checkRes(res)) {
+        this.$router.push({ path: '/exporthall/index', query: { id: data.id } });
+      }
+    },
+    // 取消
+    resetBtn() {
+      this.form = {};
+      this.dialog = false;
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  watch: {},
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .list {
+    position: relative;
+    width: 379px;
+    height: 320px;
+    margin: 0 15px 10px 0;
+    box-shadow: 0 0 5px #ccc;
+    border-radius: 10px;
+    .el-image {
+      width: 100%;
+      height: 190px;
+    }
+    .info {
+      padding: 0 10px;
+      .title {
+        padding: 6px 0;
+        font-size: 16px;
+        font-weight: bold;
+        span {
+          color: #ff0000;
+        }
+      }
+      .other {
+        font-size: 14px;
+        padding: 5px 0;
+      }
+    }
+    .btn {
+      text-align: center;
+    }
+  }
+  .list:nth-child(3n) {
+    margin: 0 0 10px 0;
+  }
+}
+</style>

+ 86 - 0
src/views/hallList/trainLogin.vue

@@ -0,0 +1,86 @@
+<template>
+  <div id="trainLogin">
+    <el-row>
+      <el-col :span="24">
+        <el-col :span="5" class="info"> </el-col>
+        <el-col :span="13" class="login">
+          <el-col :span="24" class="title">
+            管理登录
+          </el-col>
+          <el-col :span="24" class="form">
+            <el-form ref="form" :model="form" :rules="rules" label-width="140px">
+              <el-form-item label="房间号" prop="room_id">
+                <el-input v-model="form.room_id" placeholder="房间号"></el-input>
+              </el-form-item>
+              <el-form-item label="登录密码" prop="password">
+                <el-input v-model="form.password" placeholder="请输入登录密码" show-password></el-input>
+              </el-form-item>
+              <el-col :span="24" class="btn">
+                <el-button type="primary" @click="onSubmit">登录</el-button>
+              </el-col>
+            </el-form>
+          </el-col>
+        </el-col>
+        <el-col :span="5" class="info"> </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: trainlive } = createNamespacedHelpers('trainlive');
+export default {
+  name: 'trainLogin',
+  props: {},
+  components: {},
+  data: function() {
+    return {
+      form: {},
+      rules: {
+        room_id: [{ required: true, message: '请输入房间号', trigger: 'blur' }],
+        password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
+      },
+    };
+  },
+  created() {},
+  methods: {
+    ...trainlive({ toLogin: 'login' }),
+    async onSubmit() {
+      let data = this.form;
+      const res = await this.toLogin({ user: data });
+      if (this.$checkRes(res)) {
+        this.$router.push({ path: '/trainCenter/index', query: { num: '1' } });
+      }
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.info {
+  height: 800px;
+}
+.login {
+  padding: 15px 0;
+  .title {
+    text-align: center;
+    font-size: 40px;
+    padding: 40px 0;
+  }
+  .form {
+    .btn {
+      text-align: center;
+    }
+  }
+}
+</style>

+ 249 - 0
src/views/trainCenter/basicInfo/index.vue

@@ -0,0 +1,249 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24">
+        <el-col :span="24" class="leftTop">
+          <span>|</span>
+          <span>基本信息</span>
+        </el-col>
+        <el-col :span="24" class="info">
+          <el-form ref="form" :model="form" label-width="150px">
+            <el-col :span="24">
+              <el-form-item prop="name">
+                <el-col :span="21" slot="label">
+                  房间号
+                </el-col>
+                <el-col :span="24">
+                  <el-input v-model="form.room_id" placeholder="请输入房间号" disabled></el-input>
+                </el-col>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item prop=" title">
+                <el-col :span="21" slot="label">
+                  标题
+                </el-col>
+                <el-col :span="24">
+                  <el-input v-model="form.title" placeholder="请输入标题"></el-input>
+                </el-col>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item prop="create_time">
+                <el-col :span="21" slot="label">
+                  开始时间
+                </el-col>
+                <el-col :span="24">
+                  <el-col :span="24">
+                    <el-date-picker
+                      v-model="form.create_date"
+                      type="datetime"
+                      placeholder="请选择"
+                      format="yyyy-MM-dd HH:mm:ss"
+                      value-format="yyyy-MM-dd HH:mm:ss"
+                      style="width:100%"
+                    >
+                    </el-date-picker>
+                  </el-col>
+                </el-col>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item>
+                <el-col :span="21" slot="label">
+                  省份
+                </el-col>
+                <el-col :span="24">
+                  <el-col :span="24">
+                    <el-select v-model="form.province" placeholder="请选择" filterable clearable @change="changePro" style="width:100%">
+                      <el-option v-for="(i, index) in provinceList" :key="index" :label="i.name" :value="i.code"></el-option>
+                    </el-select>
+                  </el-col>
+                </el-col>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item prop="create_time">
+                <el-col :span="21" slot="label">
+                  市区
+                </el-col>
+                <el-col :span="24">
+                  <el-col :span="24">
+                    <el-select v-model="form.place" placeholder="请选择" filterable clearable style="width:100%">
+                      <el-option v-for="(i, index) in placeList" :key="index" :label="i.name" :value="i.code"></el-option>
+                    </el-select>
+                  </el-col>
+                </el-col>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item prop="sponsor">
+                <el-col :span="21" slot="label">
+                  主办方
+                </el-col>
+                <el-col :span="24">
+                  <el-input v-model="form.sponsor" placeholder="请输入主办方"></el-input>
+                </el-col>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item prop="user">
+                <el-col :span="21" slot="label">
+                  负责人
+                </el-col>
+                <el-col :span="24">
+                  <el-input v-model="form.user" placeholder="请输入负责人"></el-input>
+                </el-col>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item prop="phone">
+                <el-col :span="21" slot="label">
+                  联系电话
+                </el-col>
+                <el-col :span="24">
+                  <el-input v-model="form.phone" placeholder="请输入联系电话"></el-input>
+                </el-col>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item prop="brief" class="langInfo">
+                <el-col :span="21" slot="label">
+                  简介
+                </el-col>
+                <el-col :span="24">
+                  <el-input v-model="form.brief" type="textarea" placeholder="请输入简介"></el-input>
+                </el-col>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24" class="btn">
+              <el-button type="primary" @click="onSubmit()">提交修改</el-button>
+            </el-col>
+          </el-form>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: trainlive } = createNamespacedHelpers('trainlive');
+const { mapActions: place } = createNamespacedHelpers('place');
+export default {
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  name: 'index',
+  props: {},
+  components: {},
+  data: function() {
+    return {
+      // 类型
+      typelist: [],
+      form: {},
+      // 省市
+      provinceList: [],
+      placeList: [],
+    };
+  },
+  async created() {
+    await this.search();
+    await this.searchType();
+  },
+  methods: {
+    ...place({ palcequery: 'query', palcefetch: 'fetch' }),
+    ...trainlive(['fetch', 'update']),
+    async search() {
+      let data = this.user;
+      let res = await this.fetch(data.id);
+      if (this.$checkRes(res)) {
+        console.log(res.data);
+        this.$set(this, `form`, res.data);
+      }
+    },
+    //提交修改
+    async onSubmit() {
+      let data = this.form;
+      if (data.id) {
+        const res = await this.update(data);
+        if (this.$checkRes(res)) {
+          this.$message({
+            message: '修改成功',
+            type: 'success',
+          });
+          this.search();
+        }
+      }
+    },
+    // 查询省市
+    async searchType() {
+      let res = await this.palcequery({ level: 1 });
+      this.$set(this, `provinceList`, res.data);
+      res = await this.palcequery({ level: 2 });
+      this.$set(this, `placeList`, res.data);
+    },
+    // 选择市
+    async changePro(value) {
+      let parent = value;
+      let res = await this.palcequery({ level: 2, parent });
+      this.$set(this, `placeList`, res.data);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  watch: {},
+};
+</script>
+
+<style lang="less" scoped>
+.leftTop {
+  font-size: 18px;
+  width: 96%;
+  height: 41px;
+  line-height: 35px;
+  border-bottom: 1px solid #e5e5e5;
+  position: relative;
+  bottom: 1px;
+  margin: 10px;
+  font-weight: 600;
+  color: #22529a;
+}
+.info {
+  margin: 0 40px 15px 10px;
+  border: 1px dashed #ccc;
+  width: 96%;
+  padding: 10px;
+  .btn {
+    text-align: center;
+    margin: 10px 0;
+  }
+}
+/deep/.el-form-item {
+  margin-bottom: 0px;
+}
+/deep/.el-form-item__label {
+  border: 1px solid #dcdfe6;
+}
+/deep/.el-radio-group {
+  border: 1px solid #ccc;
+  padding: 12px 20px;
+  // width: 943px;
+}
+/deep/.el-input__inner {
+  border-radius: 0;
+  height: 42px;
+  line-height: 42px;
+}
+/deep/.el-textarea__inner {
+  border-radius: 0;
+  height: 140px !important;
+}
+/deep/.langInfo .el-form-item__label {
+  padding: 49px 0;
+}
+/deep/.langInfo .workexperience .textarea__inner {
+  height: 140px !important;
+}
+</style>

+ 98 - 0
src/views/trainCenter/index.vue

@@ -0,0 +1,98 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="info">
+        <el-col :span="24" class="top">
+          <heads></heads>
+        </el-col>
+        <el-col :span="24" class="main">
+          <div class="w_1200">
+            <el-col :span="4" class="mainMenu">
+              <menuInfo></menuInfo>
+            </el-col>
+            <el-col :span="19" class="mainMess">
+              <span v-if="num == '1'">
+                <basicInfo></basicInfo>
+              </span>
+              <span v-else-if="num == '2'">
+                <videoinfo></videoinfo>
+              </span>
+              <span v-else-if="num == '3'">
+                <userInfo></userInfo>
+              </span>
+              <span v-else>
+                退出登录
+              </span>
+            </el-col>
+          </div>
+        </el-col>
+        <el-col :span="24" class="foot">
+          <foot></foot>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import heads from '@/layout/userCenter/heads.vue';
+import menuInfo from '@/layout/trainCenter/menuInfo.vue';
+import foot from '@/layout/live/foot.vue';
+import basicInfo from './basicInfo/index.vue';
+import videoinfo from './videoinfo/index.vue';
+import userInfo from './userInfo/index.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'index',
+  props: {},
+  components: {
+    heads,
+    menuInfo,
+    foot,
+    basicInfo,
+    videoinfo,
+    userInfo,
+  },
+  data: function() {
+    return {};
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+    num() {
+      return this.$route.query.num;
+    },
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.w_1200 {
+  width: 1200px;
+  margin: 0 auto;
+}
+.info {
+  background-color: #e9edf6;
+}
+.main {
+  min-height: 600px;
+  margin: 15px 0;
+}
+.mainMenu {
+  width: 20%;
+  min-height: 600px;
+  background-color: #fff;
+}
+.mainMess {
+  float: right;
+  min-height: 600px;
+  background-color: #fff;
+}
+</style>

+ 165 - 0
src/views/trainCenter/userInfo/index.vue

@@ -0,0 +1,165 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="video">
+        <el-col :span="24" class="leftTop">
+          <span>|</span>
+          <span>用户管理</span>
+        </el-col>
+        <el-col :span="24" class="info">
+          <span v-if="display == 'list'">
+            <el-col :span="24" class="btn">
+              <el-button type="primary" size="mini" @click="add">添加</el-button>
+            </el-col>
+            <el-col :span="24" class="list">
+              <list :videoList="videoList" :total="totla" @handleEdit="handleEdit" @handleDelete="handleDelete"></list>
+            </el-col>
+          </span>
+          <span v-else>
+            <el-col :span="24" class="btn">
+              <el-button type="primary" size="mini" @click="back">返回</el-button>
+            </el-col>
+            <el-col :span="24" class="detail">
+              <detail :form="form" :rules="rules" @submitBtn="submitBtn"></detail>
+            </el-col>
+          </span>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import list from './parts/list.vue';
+import detail from './parts/detail.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: trainlive } = createNamespacedHelpers('trainlive');
+export default {
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  name: 'index',
+  props: {},
+  components: {
+    list,
+    detail,
+  },
+  data: function() {
+    return {
+      display: 'list',
+      // 展会信息
+      info: {},
+      // 视频列表
+      videoList: [],
+      totla: 0,
+      // 视频添加
+      form: {},
+      rules: {
+        user_title: [{ required: true, message: '请输入用户名', trigger: 'blur' }],
+        user_phone: [{ required: true, message: '请输入账号', trigger: 'blur' }],
+        user_password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
+      },
+    };
+  },
+  async created() {
+    await this.search();
+  },
+  methods: {
+    ...trainlive(['fetch', 'userCreate', 'userUpdate', 'userDelete']),
+    // 查询
+    async search() {
+      let data = this.user;
+      let res = await this.fetch(data.id);
+      if (this.$checkRes(res)) {
+        this.$set(this, `info`, res.data);
+        this.$set(this, `videoList`, res.data.user_data);
+        this.$set(this, `totla`, res.data.user_data.length);
+      }
+    },
+    // 添加
+    add() {
+      this.display = 'detail';
+    },
+    // 修改
+    handleEdit(data) {
+      this.$set(this, `form`, data);
+      this.display = 'detail';
+    },
+    // 提交
+    async submitBtn(form) {
+      let data = {
+        id: this.info.id,
+        users: [],
+      };
+      data.users.push(form);
+      if (form._id) {
+        let res = await this.userUpdate(data);
+        if (this.$checkRes(res)) {
+          this.$message({
+            message: '用户修改成功',
+            type: 'success',
+          });
+          this.back();
+        }
+      } else {
+        let res = await this.userCreate(data);
+        if (this.$checkRes(res)) {
+          this.$message({
+            message: '用户添加成功',
+            type: 'success',
+          });
+          this.back();
+        }
+      }
+    },
+    // 删除
+    async handleDelete(id) {
+      let data = {
+        id: this.info.id,
+        users: [id],
+      };
+      let res = await this.userDelete(data);
+      if (this.$checkRes(res)) {
+        this.$message({
+          message: '用户删除成功',
+          type: 'success',
+        });
+        this.back();
+      }
+    },
+
+    // 返回
+    back() {
+      this.form = {};
+      this.display = 'list';
+      this.search();
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  watch: {},
+};
+</script>
+
+<style lang="less" scoped>
+.leftTop {
+  font-size: 18px;
+  width: 96%;
+  height: 41px;
+  line-height: 35px;
+  border-bottom: 1px solid #e5e5e5;
+  position: relative;
+  bottom: 1px;
+  margin: 10px;
+  font-weight: 600;
+  color: #22529a;
+}
+.info {
+  padding: 0 25px 0 10px;
+  .btn {
+    text-align: right;
+    margin: 0 0 10px 0;
+  }
+}
+</style>

+ 52 - 0
src/views/trainCenter/userInfo/parts/detail.vue

@@ -0,0 +1,52 @@
+<template>
+  <div id="detail">
+    <el-row>
+      <el-col :span="24">
+        <el-form :model="form" :rules="rules" ref="form" label-width="120px">
+          <el-form-item label="用户名" prop="user_title">
+            <el-input v-model="form.user_title" placeholder="请输入用户名"></el-input>
+          </el-form-item>
+          <el-form-item label="账号" prop="user_phone">
+            <el-input v-model="form.user_phone" placeholder="请输入账号"></el-input>
+          </el-form-item>
+          <el-form-item label="密码" prop="user_password">
+            <el-input v-model="form.user_password" placeholder="请输入密码" show-password></el-input>
+          </el-form-item>
+          <el-form-item>
+            <el-button type="primary" @click="submitBtn('form')">保存</el-button>
+          </el-form-item>
+        </el-form>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  name: 'detail',
+  props: {
+    form: { type: Object },
+    rules: { type: Object },
+  },
+  components: {},
+  data: function() {
+    return {};
+  },
+  created() {},
+  methods: {
+    submitBtn() {
+      this.$emit('submitBtn', this.form);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  watch: {},
+};
+</script>
+
+<style lang="less" scoped></style>

+ 97 - 0
src/views/trainCenter/userInfo/parts/list.vue

@@ -0,0 +1,97 @@
+<template>
+  <div id="list">
+    <el-row>
+      <el-col :span="24" class="main">
+        <el-col :span="24" class="list">
+          <el-table :data="list" style="width: 100%" border>
+            <el-table-column type="index" width="60px" label="序号" align="center"> </el-table-column>
+            <el-table-column prop="user_title" label="用户名" align="center" show-overflow-tooltip> </el-table-column>
+            <el-table-column prop="user_phone" label="账号" align="center" show-overflow-tooltip> </el-table-column>
+            <el-table-column prop="user_password" label="密码" align="center" show-overflow-tooltip> </el-table-column>
+            <el-table-column fixed="right" label="操作" align="center">
+              <template slot-scope="scoped">
+                <el-button type="primary" size="mini" @click="handleEdit(scoped.row)">修改</el-button>
+                <el-button type="danger" size="mini" @click="handleDelete(scoped.row._id)">删除</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+        </el-col>
+        <el-col :span="24" class="page">
+          <el-pagination
+            @current-change="handleCurrentChange"
+            :current-page="currentPage"
+            layout="total, prev, pager, next, jumper"
+            :total="total"
+            :page-size="pageSize"
+          >
+          </el-pagination>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'list',
+  props: {
+    videoList: { type: Array },
+    total: { type: Number },
+  },
+  components: {},
+  data: function() {
+    return {
+      currentPage: 1,
+      pageSize: 10,
+      origin: [],
+      list: [],
+    };
+  },
+  created() {},
+  methods: {
+    search(page = 1) {
+      this.$set(this, `list`, this.origin[page - 1]);
+    },
+    handleCurrentChange(currentPage) {
+      this.search(currentPage);
+    },
+    handleDelete(data) {
+      this.$emit('handleDelete', data);
+    },
+    handleEdit(data) {
+      this.$emit('handleEdit', data);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  watch: {
+    videoList: {
+      immediate: true,
+      deep: true,
+      handler(val) {
+        if (val && val.length > 0) this.$set(this, `origin`, _.chunk(val, this.pageSize));
+        this.search();
+      },
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .list {
+    /deep/.el-table td {
+      padding: 5px 0;
+    }
+    /deep/.el-table th {
+      padding: 5px 0;
+    }
+  }
+  .page {
+    text-align: center;
+    padding: 10px 0;
+  }
+}
+</style>

+ 139 - 0
src/views/trainCenter/videoinfo/index.vue

@@ -0,0 +1,139 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="video">
+        <el-col :span="24" class="leftTop">
+          <span>|</span>
+          <span>视频管理</span>
+        </el-col>
+        <el-col :span="24" class="info">
+          <span v-if="display == 'list'">
+            <el-col :span="24" class="btn">
+              <el-button type="primary" size="mini" @click="add">添加</el-button>
+            </el-col>
+            <el-col :span="24" class="list">
+              <list :videoList="videoList" :total="totla" @handleDelete="handleDelete"></list>
+            </el-col>
+          </span>
+          <span v-else>
+            <el-col :span="24" class="btn">
+              <el-button type="primary" size="mini" @click="back">返回</el-button>
+            </el-col>
+            <el-col :span="24" class="detail">
+              <detail :form="form" :rules="rules" @submitBtn="submitBtn"></detail>
+            </el-col>
+          </span>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import list from './parts/list.vue';
+import detail from './parts/detail.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: trainlive } = createNamespacedHelpers('trainlive');
+export default {
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  name: 'index',
+  props: {},
+  components: {
+    list,
+    detail,
+  },
+  data: function() {
+    return {
+      display: 'list',
+      // 展会信息
+      info: {},
+      // 视频列表
+      videoList: [],
+      totla: 0,
+      // 视频添加
+      form: {},
+      rules: {},
+    };
+  },
+  async created() {
+    await this.search();
+  },
+  methods: {
+    ...trainlive(['fetch', 'update']),
+    // 查询
+    async search() {
+      let data = this.user;
+      let res = await this.fetch(data.id);
+      if (this.$checkRes(res)) {
+        this.$set(this, `info`, res.data);
+        this.$set(this, `videoList`, res.data.video_data);
+        this.$set(this, `totla`, res.data.video_data.length);
+      }
+    },
+    // 添加
+    add() {
+      this.display = 'detail';
+    },
+    // 提交
+    async submitBtn(form) {
+      let data = this.info;
+      data.video_data.push(form);
+      let res = await this.update(data);
+      if (this.$checkRes(res)) {
+        this.$message({
+          message: '视频保存成功',
+          type: 'success',
+        });
+        this.back();
+      }
+    },
+    // 删除
+    async handleDelete(index) {
+      let data = this.info;
+      data.video_data.splice(index, 1);
+      let res = await this.update(data);
+      if (this.$checkRes(res)) {
+        this.$message({
+          message: '删除视频成功',
+          type: 'success',
+        });
+        this.back();
+      }
+    },
+    // 返回
+    back() {
+      this.form = {};
+      this.display = 'list';
+      this.search();
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  watch: {},
+};
+</script>
+
+<style lang="less" scoped>
+.leftTop {
+  font-size: 18px;
+  width: 96%;
+  height: 41px;
+  line-height: 35px;
+  border-bottom: 1px solid #e5e5e5;
+  position: relative;
+  bottom: 1px;
+  margin: 10px;
+  font-weight: 600;
+  color: #22529a;
+}
+.info {
+  padding: 0 25px 0 10px;
+  .btn {
+    text-align: right;
+    margin: 0 0 10px 0;
+  }
+}
+</style>

+ 77 - 0
src/views/trainCenter/videoinfo/parts/detail.vue

@@ -0,0 +1,77 @@
+<template>
+  <div id="detail">
+    <el-row>
+      <el-col :span="24">
+        <el-form :model="form" :rules="rules" ref="form" label-width="120px">
+          <el-form-item label="视频标题" prop="video_title">
+            <el-input v-model="form.video_title"></el-input>
+          </el-form-item>
+          <el-form-item label="视频时间" prop="video_date">
+            <el-date-picker v-model="form.video_date" type="date" placeholder="请选择" format="yyyy-MM-dd" value-format="yyyy-MM-dd"> </el-date-picker>
+          </el-form-item>
+          <el-form-item label="视频" prop="video_url">
+            <upload
+              :limit="1"
+              :data="form.video_url"
+              type="video_url"
+              listType=""
+              :url="'/files/videourl/upload'"
+              @upload="uploadSuccess"
+              @delete="uploadDelete"
+            ></upload>
+          </el-form-item>
+          <el-form-item>
+            <el-button type="primary" @click="submitBtn('form')">保存</el-button>
+          </el-form-item>
+        </el-form>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import upload from '@/components/uploaddock.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  name: 'detail',
+  props: {
+    form: { type: Object },
+    rules: { type: Object },
+  },
+  components: {
+    upload,
+  },
+  data: function() {
+    return {};
+  },
+  created() {},
+  methods: {
+    submitBtn() {
+      this.$emit('submitBtn', this.form);
+    },
+    uploadSuccess({ type, data }) {
+      this.$set(this.form, `${type}`, data.uri);
+      this.$message({
+        message: '上传视频成功',
+        type: 'success',
+      });
+    },
+    uploadDelete(index) {
+      this.$set(this.form, `video_url`, null);
+      this.$message({
+        message: '删除视频成功',
+        type: 'success',
+      });
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  watch: {},
+};
+</script>
+
+<style lang="less" scoped></style>

+ 93 - 0
src/views/trainCenter/videoinfo/parts/list.vue

@@ -0,0 +1,93 @@
+<template>
+  <div id="list">
+    <el-row>
+      <el-col :span="24" class="main">
+        <el-col :span="24" class="list">
+          <el-table :data="list" style="width: 100%" border>
+            <el-table-column type="index" label="序号" width="60px" align="center"> </el-table-column>
+            <el-table-column prop="video_title" label="视频标题" align="center" show-overflow-tooltip> </el-table-column>
+            <el-table-column prop="video_date" label="视频时间" align="center" show-overflow-tooltip> </el-table-column>
+            <el-table-column prop="video_url" label="视频路径" align="center" show-overflow-tooltip> </el-table-column>
+            <el-table-column fixed="right" label="操作" align="center">
+              <template slot-scope="scoped">
+                <el-button type="text" size="small" @click="handleDelete(scoped.$index)">删除</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+        </el-col>
+        <el-col :span="24" class="page">
+          <el-pagination
+            @current-change="handleCurrentChange"
+            :current-page="currentPage"
+            layout="total, prev, pager, next, jumper"
+            :total="total"
+            :page-size="pageSize"
+          >
+          </el-pagination>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'list',
+  props: {
+    videoList: { type: Array },
+    total: { type: Number },
+  },
+  components: {},
+  data: function() {
+    return {
+      currentPage: 1,
+      pageSize: 10,
+      origin: [],
+      list: [],
+    };
+  },
+  created() {},
+  methods: {
+    search(page = 1) {
+      this.$set(this, `list`, this.origin[page - 1]);
+    },
+    handleCurrentChange(currentPage) {
+      this.search(currentPage);
+    },
+    handleDelete(data) {
+      this.$emit('handleDelete', data);
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  watch: {
+    videoList: {
+      immediate: true,
+      deep: true,
+      handler(val) {
+        if (val && val.length > 0) this.$set(this, `origin`, _.chunk(val, this.pageSize));
+        this.search();
+      },
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .list {
+    /deep/.el-table td {
+      padding: 5px 0;
+    }
+    /deep/.el-table th {
+      padding: 5px 0;
+    }
+  }
+  .page {
+    text-align: center;
+    padding: 10px 0;
+  }
+}
+</style>