lrf402788946 5 лет назад
Родитель
Сommit
cf45c39596

+ 2 - 2
src/components/pagination.vue

@@ -4,7 +4,7 @@
       <el-col :span="24" :style="`text-align:${position};`">
         <el-pagination
           background
-          layout="sizes, total, prev, pager, next"
+          layout=" total, prev, pager, next"
           :total="total"
           :page-size="limit"
           :current-page.sync="currentPage"
@@ -32,7 +32,7 @@ export default {
   data: () => {
     return {
       currentPage: 1,
-      limit: _.get(this, `$limit`, undefined) !== undefined ? this.$limit : process.env.VUE_APP_LIMIT * 1,
+      limit: 10,
     };
   },
   created() {},

+ 1 - 1
src/layout/live/head.vue

@@ -18,7 +18,7 @@
       </div>
       <div class="superlogo">
         <div class="w_1200">
-          <a href="/">
+          <a href="/platlive">
             <img :src="logo" />
             <span>
               吉林省计算中心科技平台

+ 0 - 1
src/router/index.js

@@ -37,7 +37,6 @@ const live = [
         meta: { title: '专家列表', subSite: true },
         component: () => import('../views/personnel/list.vue'),
       },
-
       //科技超市列表
       {
         path: '/supermaket/supermarketlist',

+ 35 - 165
src/views/hallList/index.vue

@@ -1,35 +1,18 @@
 <template>
   <div id="index">
     <el-col :span="24" class="main">
-      <el-col :span="24" class="info">
-        <el-col>
-          <el-col :span="24" class="leftTop">
-            <span>|</span> <span>{{ menuName }}</span>
-          </el-col>
-          <el-col class="infoRightList" :span="24" v-for="(item, index) in hangyeList" :key="index">
-            <p>
-              <span class="textOver" @click="turnTo(item)">{{ item.title }}</span
-              ><span class="textOver">
-                <el-link :underline="false" :href="`${liveIndex}?id=${item.id}`" target="_blank" class="duijie" v-if="canIn(item)">
-                  进入对接会
-                </el-link>
-                <el-link :underline="false" @click="apply(item.id)" class="duijie" v-if="canJoin(item)"> 申请对接会 </el-link></span
-              >
-            </p>
-          </el-col>
-        </el-col>
-
-        <el-col class="page">
-          <el-pagination
-            background
-            @current-change="handleCurrentChange"
-            :current-page.sync="currentPage"
-            :page-size="pageSize"
-            layout="total,prev, pager, next, jumper"
-            :total="pageTotal"
-          >
-          </el-pagination>
-        </el-col>
+      <el-col :span="24" class="info" style="padding:10px">
+        <el-tabs>
+          <el-tab-pane label="进行中的对接会" name="0">
+            <list :list="listNow" :total="nowTotal" status="1" @query="searchList"></list>
+          </el-tab-pane>
+          <el-tab-pane label="近期对接会" name="1">
+            <list :list="listPre" :total="nowTotal" status="0" @query="searchList"></list>
+          </el-tab-pane>
+          <el-tab-pane label="过往对接会" name="2">
+            <list :list="listNow" :total="nowTotal" status="2" @query="searchList"></list>
+          </el-tab-pane>
+        </el-tabs>
       </el-col>
     </el-col>
   </div>
@@ -37,27 +20,33 @@
 
 <script>
 import _ from 'lodash';
+import list from './parts/list.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: dock } = createNamespacedHelpers('dock');
 export default {
   name: 'index',
   props: {},
-  components: {},
+  components: { list },
   data: () => ({
     squareImage: require('@/assets/live/square_big.png'),
     menuIndex: '0',
     menuName: '直播列表',
     menuColor: 'rgb(254, 149, 14)',
-    currentPage: 1,
-    pageTotal: 0,
     pageSize: 10,
     limit: 10,
     hangyeList: [],
+    listPre: [],
+    preTotal: 0,
+    listNow: [],
+    nowTotal: 0,
+    listPast: [],
+    pastTotal: 0,
     liveIndex: '',
   }),
   created() {
-    this.searchList();
-    this.setIndex();
+    this.searchList({ status: '0' });
+    this.searchList({ status: '1' });
+    this.searchList({ status: '2' });
   },
   computed: {
     pageTitle() {
@@ -70,22 +59,25 @@ export default {
 
   methods: {
     ...dock({ dockQuery: 'query' }),
-    async searchList({ skip = 0, limit = 10, ...info } = {}) {
-      let res = await this.dockQuery({ is_allowed: 1 });
-      this.$set(this, `pageTotal`, res.total);
-      console.log(res.data);
+    async searchList({ skip = 0, limit = 10, status, ...info } = {}) {
+      let res = await this.dockQuery({ is_allowed: 1, skip, limit, status, ...info });
       if (res.errcode === 0) {
-        this.$set(this, `hangyeList`, res.data);
+        if (status == '0') {
+          this.$set(this, `preTotal`, res.total);
+          this.$set(this, `listPre`, res.data);
+        } else if (status == '1') {
+          this.$set(this, `nowTotal`, res.total);
+          this.$set(this, `listNow`, res.data);
+        } else {
+          this.$set(this, `pastTotal`, res.total);
+          this.$set(this, `listPast`, res.data);
+        }
       }
     },
 
     async initList({ name, skip = 0, limit = 10, ...info } = {}) {
       this.$set(this, `pageTotal`, res.total);
     },
-    apply(id) {
-      this.$router.push({ path: '/live/liveApply', query: { id: id } });
-    },
-
     handleCurrentChange(val) {
       this.limit = 5;
       this.initList({ skip: (val - 1) * this.limit, limit: this.limit });
@@ -94,20 +86,6 @@ export default {
     turnTo(item) {
       this.$router.push({ path: '/live/hallDetail', query: { id: item.id } });
     },
-    canIn(data) {
-      let nowTime = new Date().getTime();
-      let start_time = new Date(data.start_time).getTime();
-      return !(start_time >= nowTime && data.status != 2);
-    },
-    canJoin(data) {
-      let nowTime = new Date().getTime();
-      let join_end = new Date(data.join_end).getTime();
-      return join_end < nowTime && data.status != 2;
-    },
-    setIndex() {
-      let index = (process.env.NODE_ENV === 'development' ? '' : process.env.VUE_APP_ROUTER) + '/static/liveIndex.html';
-      this.$set(this, `liveIndex`, index);
-    },
   },
 };
 </script>
@@ -176,116 +154,8 @@ export default {
   font-weight: 600;
   color: #22529a;
 }
-.infoLeftList {
-  float: left;
-  width: 95%;
-  border-bottom: 1px dashed #ccc;
-  padding: 10px 0 10px 10px;
-  height: 87px;
-  margin: 0 0 0 5px;
-}
-
-.infoLeftList:hover p:last-child span:first-child {
-  -webkit-transform: translateY(-3px);
-  -ms-transform: translateY(-3px);
-  transform: translateY(-3px);
-  -webkit-box-shadow: 0 0 6px #999;
-  box-shadow: 0 0 6px #999;
-  -webkit-transition: all 0.5s ease-out;
-  transition: all 0.5s ease-out;
-  color: #005293;
-  cursor: pointer;
-}
-/deep/.infoRightList p span[data-v-64e7ce6c]:first-child {
-  display: inline-block;
-  width: 78%;
-  margin: 0 20px 0 10px;
-}
-
-/deep/.infoRightList p span[data-v-64e7ce6c]:last-child {
-  display: inline-block;
-  width: 19%;
-  text-align: center;
-  font-size: 16px;
-}
-
-.infoLeftList p:first-child {
-  float: left;
-  width: 20%;
-  font-size: 15px;
-  background: #044b79;
-  text-align: center;
-  color: #fff;
-  font-weight: bold;
-  padding: 4px 0px;
-  margin: 0 0 0 5px;
-}
-.infoLeftList p:last-child {
-  float: right;
-  width: 70%;
-  padding: 0 0 0 10px;
-}
-.infoLeftList p:last-child span:first-child {
-  float: left;
-  width: 90%;
-  font-size: 18px;
-}
-.infoLeftList p:last-child span:last-child {
-  float: left;
-  width: 90%;
-  font-size: 16px;
-  overflow: hidden;
-  text-overflow: ellipsis;
-  -webkit-line-clamp: 2;
-  word-break: break-all;
-  display: -webkit-box;
-  -webkit-box-orient: vertical;
-  margin: 5px 0 0 0;
-  color: #666;
-}
 .page {
   text-align: center;
   margin: 10px 0;
 }
-.infoRightList {
-  float: left;
-  width: 95%;
-  padding: 7px 0;
-  margin: 0 0 0 5px;
-}
-
-.infoRightList:hover p span:first-child {
-  -webkit-transform: translateY(-3px);
-  -ms-transform: translateY(-3px);
-  transform: translateY(-3px);
-  -webkit-box-shadow: 0 0 6px #999;
-  box-shadow: 0 0 6px #999;
-  -webkit-transition: all 0.5s ease-out;
-  transition: all 0.5s ease-out;
-  color: #005293;
-  cursor: pointer;
-}
-.infoRightList p {
-  font-size: 18px;
-}
-.infoRightList p span:first-child {
-  display: inline-block;
-  width: 60%;
-  margin: 0 20px 0 10px;
-}
-.infoRightList p span:last-child {
-  display: inline-block;
-  padding: 0 0 0 149px;
-  text-align: center;
-  font-size: 16px;
-}
-.duijie {
-  padding: 10px 15px 10px 15px;
-  margin: 10px 0 0 10px;
-  color: #ff8500;
-}
-
-.duijie:hover {
-  color: #0279d5;
-}
 </style>

+ 122 - 0
src/views/hallList/parts/list.vue

@@ -0,0 +1,122 @@
+<template>
+  <div id="list">
+    <el-col class="infoRightList" :span="24" v-for="(item, index) in list" :key="index">
+      <p>
+        <span class="textOver" @click="turnTo(item)">{{ item.title }}</span>
+        <span class="textOver">
+          <el-link :underline="false" :href="`${liveIndex}?id=${item.id}`" target="_blank" class="duijie" v-if="status == '1'">
+            <!--  v-if="canIn(item)" -->
+            进入对接会
+          </el-link>
+          <el-link :underline="false" @click="apply(item.id)" class="duijie" v-if="status == '0'"> 申请对接会 </el-link>
+          <el-link :underline="false" @click="check(item.id)" class="duijie" v-if="status == '2'"> 查看成果 </el-link>
+          <!-- v-if="canJoin(item)" -->
+        </span>
+      </p>
+    </el-col>
+    <el-col :span="24">
+      <page v-bind="$attrs" position="center" @query="toQuery"></page>
+    </el-col>
+  </div>
+</template>
+
+<script>
+import page from '@/components/pagination.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'list',
+  props: { list: { type: Array, default: () => [] }, status: { type: String, default: '0' } },
+  components: { page },
+  data: () => {
+    return {
+      liveIndex: '',
+    };
+  },
+  created() {},
+  methods: {
+    toQuery(options) {
+      this.$emit('query', { ...options, status: this.status });
+    },
+    setIndex() {
+      let index = (process.env.NODE_ENV === 'development' ? '' : process.env.VUE_APP_ROUTER) + '/static/liveIndex.html';
+      this.$set(this, `liveIndex`, index);
+    },
+    canIn(data) {
+      let nowTime = new Date().getTime();
+      let start_time = new Date(data.start_time).getTime();
+      return !(start_time >= nowTime && data.status != 2);
+    },
+    canJoin(data) {
+      let nowTime = new Date().getTime();
+      let join_end = new Date(data.join_end).getTime();
+      return join_end < nowTime && data.status != 2;
+    },
+    apply(id) {
+      this.$router.push({ path: '/live/liveApply', query: { id: id } });
+    },
+    check(id) {
+      //TODO 查看成果
+      // 做个查看成果页
+      // this.$router.push({ path: '/live/liveApply', query: { id: id } });
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+};
+</script>
+
+<style lang="less" scoped>
+/deep/.infoRightList p span[data-v-64e7ce6c]:first-child {
+  display: inline-block;
+  width: 78%;
+  margin: 0 20px 0 10px;
+}
+
+/deep/.infoRightList p span[data-v-64e7ce6c]:last-child {
+  display: inline-block;
+  width: 19%;
+  text-align: center;
+  font-size: 16px;
+}
+.infoRightList {
+  float: left;
+  width: 95%;
+  padding: 7px 0;
+  margin: 0 0 0 5px;
+}
+.infoRightList:hover p span:first-child {
+  -webkit-transform: translateY(-3px);
+  -ms-transform: translateY(-3px);
+  transform: translateY(-3px);
+  -webkit-box-shadow: 0 0 6px #999;
+  box-shadow: 0 0 6px #999;
+  -webkit-transition: all 0.5s ease-out;
+  transition: all 0.5s ease-out;
+  color: #005293;
+  cursor: pointer;
+}
+.infoRightList p {
+  font-size: 18px;
+}
+.infoRightList p span:first-child {
+  display: inline-block;
+  width: 60%;
+  margin: 0 20px 0 10px;
+}
+.infoRightList p span:last-child {
+  display: inline-block;
+  padding: 0 0 0 149px;
+  text-align: center;
+  font-size: 16px;
+}
+.duijie {
+  padding: 10px 15px 10px 15px;
+  margin: 10px 0 0 10px;
+  color: #ff8500;
+}
+
+.duijie:hover {
+  color: #0279d5;
+}
+</style>

+ 4 - 2
src/views/login.vue

@@ -26,9 +26,11 @@ export default {
     ...mapMarket({ userFetch: 'fetch', userCreate: 'create', userUpdate: 'update' }),
     ...login({ toLogin: 'login' }),
     async submitLogin(form) {
-      const res = await this.toLogin({ user: form });
+      let res = await this.toLogin({ user: form });
+      console.log(res);
       if (res.uid) {
-        if (res.role == 1 || res.role == 4) this.$router.push('/');
+        if (res.role == 2 || res.role == 3) this.$router.push('/');
+        else this.$router.push('/enterprise/enterprisejb');
         // else window.location.href = 'http://free.liaoningdoupo.com/platlive/home.html';
       }
     },