直播一部分

This commit is contained in:
2020-10-16 09:34:55 +08:00
parent ad1c54fdc9
commit bfcf22b479
4 changed files with 30 additions and 10 deletions

View File

@@ -41,7 +41,7 @@
:width="80"
v-else
/>
<video style="display: none" :src="videofile"></video>
<!-- <video style="display: none" :src="videofile"></video> -->
</div>
<div
class="upload-image upload"

View File

@@ -14,13 +14,13 @@
</div>
<div class="sel">
<img src="@/static/images/sousuo.png" alt="" class="icon" />
<input type="text" />
<input placeholder="请输入想要搜索的直播标题" type="text" @keyup.enter="sel()" v-model="input" />
</div>
</div>
<div class="list" v-if="tabindex == 1">
<LiveItem
:type="2"
v-for="(i, j) in livelist"
v-for="(i, j) in livelist.data"
:key="j"
:img="i.img"
:title="i.title"
@@ -48,7 +48,7 @@
<LiveItem :type="2"></LiveItem>
</div>
<div class="pages">
<a-pagination v-model:current="page" :total="500" :showLessItems="true" />
<a-pagination v-model:current="page" :total="livelist.total" :showLessItems="true" />
</div>
</div>
</template>
@@ -156,7 +156,7 @@
import { defineComponent, onMounted, ref } from "vue";
import LiveItem from "@/components/LiveItem.vue";
import { getlivelist } from "@/api";
import { LiveList } from "@/types";
import { LivelistInfo } from "@/types";
export default defineComponent({
components: {
LiveItem,
@@ -164,18 +164,30 @@ export default defineComponent({
setup() {
const page = ref(1);
const tabindex = ref(1);
const livelist = ref<LiveList[]>();
const livelist = ref<LivelistInfo>({
code: 0,
total: 0,
msg: "",
data: []
});
const input = ref("")
onMounted(async () => {
livelist.value = await getlivelist();
});
function tabchange(e: number): void {
tabindex.value = e;
}
async function sel(){
console.log(input.value)
livelist.value = await getlivelist({title: input.value});
}
return {
page,
tabindex,
tabchange,
livelist,
input,
sel
};
},
});