直播切换
This commit is contained in:
		
							parent
							
								
									758f85facf
								
							
						
					
					
						commit
						007cf5a9c7
					
				@ -5,10 +5,10 @@
 | 
			
		||||
            <div :class="tabindex == 1 ? 'on' : ''" @click="tabchange(1)">
 | 
			
		||||
            全部直播
 | 
			
		||||
            </div>
 | 
			
		||||
            <div :class="tabindex == 2 ? 'on' : ''" @click="tabchange(2)">
 | 
			
		||||
            <div :class="tabindex == 0 ? 'on' : ''" @click="tabchange(0)">
 | 
			
		||||
            未开始
 | 
			
		||||
            </div>
 | 
			
		||||
            <div :class="tabindex == 3 ? 'on' : ''" @click="tabchange(3)">
 | 
			
		||||
            <div :class="tabindex == 2 ? 'on' : ''" @click="tabchange(2)">
 | 
			
		||||
            已结束
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
@ -33,19 +33,35 @@
 | 
			
		||||
        ></LiveItem>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <div class="list" v-if="tabindex == 2">
 | 
			
		||||
        <LiveItem :type="3"></LiveItem>
 | 
			
		||||
        <LiveItem></LiveItem>
 | 
			
		||||
        <LiveItem></LiveItem>
 | 
			
		||||
        <LiveItem></LiveItem>
 | 
			
		||||
        <LiveItem></LiveItem>
 | 
			
		||||
        <LiveItem></LiveItem>
 | 
			
		||||
    <div class="list" v-if="tabindex == 0">
 | 
			
		||||
        <LiveItem
 | 
			
		||||
            :type="2"
 | 
			
		||||
            v-for="(i, j) in livelist.data"
 | 
			
		||||
            :key="j"
 | 
			
		||||
            :img="i.img"
 | 
			
		||||
            :title="i.title"
 | 
			
		||||
            :score="i.score"
 | 
			
		||||
            :date="i.starttime"
 | 
			
		||||
            :takehour="i.vodduration"
 | 
			
		||||
            :livenum="i.livenumber"
 | 
			
		||||
            :status="i.livestatus"
 | 
			
		||||
            :zid="i.liveid"
 | 
			
		||||
        ></LiveItem>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="list" v-if="tabindex == 3">
 | 
			
		||||
        <LiveItem :type="2"></LiveItem>
 | 
			
		||||
        <LiveItem :type="2"></LiveItem>
 | 
			
		||||
        <LiveItem :type="2"></LiveItem>
 | 
			
		||||
        <LiveItem :type="2"></LiveItem>
 | 
			
		||||
    <div class="list" v-if="tabindex == 2">
 | 
			
		||||
        <LiveItem
 | 
			
		||||
            :type="2"
 | 
			
		||||
            v-for="(i, j) in livelist.data"
 | 
			
		||||
            :key="j"
 | 
			
		||||
            :img="i.img"
 | 
			
		||||
            :title="i.title"
 | 
			
		||||
            :score="i.score"
 | 
			
		||||
            :date="i.starttime"
 | 
			
		||||
            :takehour="i.vodduration"
 | 
			
		||||
            :livenum="i.livenumber"
 | 
			
		||||
            :status="i.livestatus"
 | 
			
		||||
            :zid="i.liveid"
 | 
			
		||||
        ></LiveItem>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="pages">
 | 
			
		||||
        <a-pagination v-model:current="page" :total="livelist.total" :showLessItems="true" />
 | 
			
		||||
@ -176,11 +192,18 @@ export default defineComponent({
 | 
			
		||||
    });
 | 
			
		||||
    function tabchange(e: number): void {
 | 
			
		||||
        tabindex.value = e;
 | 
			
		||||
        livelist.value = {data:[], code: 0, msg: "",total: 0};
 | 
			
		||||
        tab();
 | 
			
		||||
    }
 | 
			
		||||
    async function sel(){
 | 
			
		||||
        console.log(input.value)
 | 
			
		||||
        console.log(input.value);
 | 
			
		||||
        livelist.value = await getlivelist({title: input.value});
 | 
			
		||||
    }
 | 
			
		||||
    async function tab(){
 | 
			
		||||
        input.value = '';
 | 
			
		||||
        livelist.value = await getlivelist({ status: tabindex.value});
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
    return {
 | 
			
		||||
        page,
 | 
			
		||||
        tabindex,
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user