<script setup name="ReportPreview">
import { ref,computed, nextTick, reactive,toRefs } from 'vue'
import { useRoute, useRouter } from "vue-router";
import apiReport from '@/api/report'
import AudioBox from '../components/AudioBox.vue'
import {showToast} from 'vant'
import {reportManageBtn,useAuthBtn} from '@/hooks/useAuthBtn'


const {checkAuthBtn} = useAuthBtn()

const route=useRoute()
const router=useRouter()


// 获取报告详情
let reportInfo=ref(null)
async function getChapterDetail(){
    const res=await apiReport.getChapterDetail({ReportChapterId:Number(route.query.id)})
    if(res.Ret===200){
        reportInfo.value=res.Data
        document.title=res.Data.Title
    }
}
getChapterDetail()
</script>
<template>
    <div class="report-detail-page" v-if="reportInfo">
        <h1 class="report-title">{{reportInfo.Title}}</h1>
        <div class="auth-box">
            <span>{{reportInfo.Author}}</span>
            <span v-if="[2,6].includes(reportInfo.PublishState)">{{reportInfo.PublishTime}}</span>
        </div>
        <!-- 音频 -->
        <!-- <AudioBox :url="reportInfo.VideoUrl" v-if="reportInfo.VideoUrl"/> -->
        <div class="report-abstract" v-if="reportInfo.Abstract">摘要：{{reportInfo.Abstract}}</div>
        
        <div class="report-html-wrap" v-html="reportInfo.Content"></div>

    </div>
</template>

<style lang="scss" scoped>
  .report-drag-item-wrap{
        padding: 6px;
        margin-bottom: 3px;
    }
.report-detail-page{
    padding: 30px 34px;
    margin-bottom: 112px;
    .report-title{
        margin: 30px 0;
        font-weight: 600;
        font-size: 42px;
        line-height: 56px;
    }
    .auth-box{
        display: flex;
        justify-content: space-between;
        font-size: $font-grey;
        font-size: 36px;
        margin-bottom: 40px;
    }
    .report-abstract{
        font-size: 34px;
        line-height: 54px;
        margin: 40px 0;
    }
    .audio-box{
        margin: 40px 0;
    }

  
}
.top-stage-box{
    .stage{
        display: inline-block;
        background-color: #F2F3FF;
        border-radius: 8px;
        height: 72px;
        line-height: 72px;
        padding: 0 20px;
        font-size: 28px;
    }
    .edit-icon{
        float: right;
        width: 70px;
        height: 70px;
    }
}

@media screen and (min-width:$media-width){
    .report-detail-page{
        max-width: 800px;
        margin: 0 auto 110px;
        padding: 30px;
        .report-title{
            margin: 15px 0;
            font-size: 21px;
            line-height: 28px;
        }
        .auth-box{
            font-size: 18px;
            padding-bottom: 20px;
            margin-bottom: 20px;
        }
        .report-abstract{
            font-size: 17px;
            line-height: 27px;
            margin: 20px 0;
        }
    }
    .top-stage-box{
        .stage{
            border-radius: 4px;
            height: 36px;
            line-height: 36px;
            padding: 0 10px;
            font-size: 14px;
        }
        .edit-icon{
            width: 35px;
            height: 35px;
        }
    }
}
</style>