123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165 |
- <template>
- <div id="index">
- <el-col :span="24" class="main">
- <el-col :span="24" class="info" style="padding:30px">
- <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="preTotal" status="0" @query="searchList"></list>
- </el-tab-pane>
- <el-tab-pane label="已往直播" name="2">
- <list :list="listPast" :total="pastTotal" status="2" @query="searchList"></list>
- </el-tab-pane>
- </el-tabs>
- </el-col>
- </el-col>
- </div>
- </template>
- <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: { list },
- data: () => ({
- squareImage: require('@/assets/live/square_big.png'),
- menuIndex: '0',
- menuName: '直播列表',
- menuColor: 'rgb(254, 149, 14)',
- pageSize: 10,
- limit: 10,
- hangyeList: [],
- listPre: [],
- preTotal: 0,
- listNow: [],
- nowTotal: 0,
- listPast: [],
- pastTotal: 0,
- liveIndex: '',
- }),
- created() {
- this.searchList({ status: '0' });
- this.searchList({ status: '1' });
- this.searchList({ status: '2' });
- },
- computed: {
- pageTitle() {
- return `${this.$route.meta.title}`;
- },
- },
- metaInfo() {
- return { title: this.$route.meta.title };
- },
- methods: {
- ...dock({ dockQuery: 'query' }),
- async searchList({ skip = 0, limit = 10, status, ...info } = {}) {
- let res = await this.dockQuery({ is_allowed: 1, skip, limit, status, ...info });
- if (res.errcode === 0) {
- if (status == '0') {
- console.log(res.total);
- 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 {
- console.log(res.data);
- 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);
- },
- handleCurrentChange(val) {
- this.limit = 5;
- this.initList({ skip: (val - 1) * this.limit, limit: this.limit });
- },
- turnTo(item) {
- this.$router.push({ path: '/live/hallDetail', query: { id: item.id } });
- },
- },
- };
- </script>
- <style lang="less" scoped>
- .main {
- // width: 80%;
- width: 1200px;
- margin: 0 auto;
- float: none;
- }
- .menu {
- float: left;
- height: 450px;
- width: 20%;
- background: no-repeat bottom right;
- background-image: url(../../assets/live/menu_back.jpg);
- margin: 30px 0;
- padding: 10px 0 0 10px;
- box-sizing: border-box;
- box-shadow: 0 0 10px #bbbaba;
- }
- .menu .el-image {
- width: 30px;
- display: inline-table;
- margin: 10px 5px;
- }
- .menu span {
- font-size: 24px;
- color: #92959a;
- font-weight: 600;
- margin-left: 3px;
- position: relative;
- top: 10px;
- }
- .menuList p {
- line-height: 60px;
- font-size: 18px;
- cursor: pointer;
- border-bottom: 1px solid #2d64b3;
- color: #044b79;
- font-weight: 600;
- }
- .info {
- width: 100%;
- float: right;
- margin: 30px 0 30px 2px;
- height: 585px;
- box-shadow: 0 0 10px #2d64b3;
- overflow: hidden;
- right: 0px;
- background: #ffffff;
- }
- .leftInfo {
- height: 500px;
- overflow: hidden;
- }
- .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;
- }
- .page {
- text-align: center;
- margin: 10px 0;
- }
- </style>
|