2024.04.17

       
学习时间 1h
代码行数 50行
博客量 2篇
学习内容

主要进行了《从小工到大工》的阅读,并且

对代码进行了优化

   
复制代码
<template>
    <view class="index">

        <index-header bgColor="bg-index-header" @headerSwitch="headerSwitch"/>

        <!-- 视频组件 -->
        <video  style="height:200px;width: 350px;"src="https://woushiwzy.oss-cn-beijing.aliyuncs.com/1c8881e9-391c-43b4-acfc-c445a5a52765.mp4"></video>
        <!-- <cu-video class="video" :video_list="videoList"/ -->>

    </view>
</template>

<script>
    import indexHeader from '@/components/index-header.vue';
    import cuVideo from '@/components/cu-video.vue';
    export default {
        components: {
            indexHeader,
            cuVideo
        },
        data() {
            return {
                title: 'Hello',
                videoList:[]
            }
        },
        onLoad() {
            this.getVideoList();
        },
        onShow() {
            console.log('界面显示')
        },
        methods: {

            getVideoList(refresh) {
                uni.request({
                    url: 'https://api.52170.xin/video',
                    dataType: 'json',
                    success: res => {
                        console.log(res.data.data.list);
                        for (let item of res.data.data.list) {
                            this.videoList.push({
                                video_id: item.video_id,
                                nickname: item.nickname,
                                video_describe: item.video_describe,
                                cover_url: item.cover_url,
                                video_url: item.video_url,
                                dianzan: item.dianzan,
                                pinglun: item.pinglun,
                                zhuanfa: item.zhuanfa,
                                is_dianzan: item.is_dianzan,
                                flag: false
                            });
                        }

                    }
                });
            },
            // 顶部切换
            headerSwitch(val){
                // console.log(val);
                this.getVideoList();
            }
            
            
            
            
        }
        
    }
</script>

<style lang="less">
    .index {
        display: flex;
        flex-direction: column;
        /* align-items: center; */
        justify-content: center;
        background-color: #333333;
        height: 100vh;
    }
    .tabbar{
        .action{
            .plus{
                image{
                    width: 100upx;
                    height: 60upx;
                }
            }
        }
    }
</style>
复制代码

 

posted @   new菜鸟  阅读(3)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
点击右上角即可分享
微信分享提示