| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <template>
- <div>
- <el-row>
- <el-col :md="18">
- <text-card />
- </el-col>
- <el-col :md="6">
- <hot-list />
- </el-col>
- </el-row>
- <el-row id="movie-list">
- <el-col :md="18">
- <el-row v-for="(video, index) in videoList" :key="index" :md="16" :sm="12" :xs="12">
- <status-card :video="video" />
- </el-row>
- </el-col>
- </el-row>
- </div>
- </template>
- <script>
- import TextCard from '@/components/card/TextCard'
- import StatusCard from '@/components/card/StatusCard'
- import HotList from '@/components/hotlist/HotList'
- import { statusRecommend } from '@/api/status'
- export default {
- name: 'Status',
- components: { TextCard, StatusCard, HotList },
- data() {
- return {
- // 屏幕宽度, 为了控制分页条的大小
- screenWidth: document.body.clientWidth,
- currentPage: 1,
- videoInfo: null,
- videoList: []
- }
- },
- created() {
- this.currentPage = 1
- statusRecommend(this.currentPage).then(res => {
- if (res.code === 0) {
- const resData = res.data
- this.videoList = resData.list
- }
- })
- },
- mounted() {
- // 当窗口宽度改变时获取屏幕宽度
- window.onresize = () => {
- return () => {
- window.screenWidth = document.body.clientWidth
- this.screenWidth = window.screenWidth
- }
- }
- },
- methods: {
- handleCurrentChange(currentPage) {
- this.currentPage = currentPage
- this.$store.commit('updatePage', currentPage)
- this.$store.dispatch('getPageBean')
- // 回到顶部
- scrollTo(0, 0)
- }
- }
- }
- </script>
- <style scoped>
- #movie-list {
- padding-top: 15px;
- padding-left: 3%;
- padding-right: 3%;
- }
- /*处于手机屏幕时*/
- @media screen and (max-width: 768px){
- #movie-list {
- padding-top: 8px;
- padding-left: 0.5%;
- padding-right: 0.5%;
- }
- }
- </style>
|