<template>
    <view>
        
    </view>
</template>

<script>
import {apiReportList} from '@/api/report'
export default {
    data() {
        return {
            
        }
    },
    onLoad(opt){
        if(opt.type=='week'){
            this.getWeekList()
        }
    },
    methods: {
        // 获取最新周报跳转过去
        async getWeekList(){
            const env=uni.getAccountInfoSync().miniProgram
            let id
            if(env.envVersion==='release'){
                id=125
            }else{
                id=198
            }
            const res=await apiReportList({
                classify_id_first:id
            })
            if(res.code===200){
                const arr=res.data.list||[]
                uni.reLaunch({
                    url: '/pages-report/chapterList?reportId='+arr[0].report_id,
                    success: (result) => {},
                    fail: () => {},
                    complete: () => {}
                });
            }
        }
    },
}
</script>

<style>

</style>