<template>
    <div class="page">
        <div class="top">
            <video :src="evn.APP_IMAGE_BASE_API + data.videoPath" v-if="data.infoType === 2"></video>
            <div class="title">{{ data.title }}</div>
            <div class="flex-between">
                <div class="publisher">{{ data.publisher }}</div>
                <div class="date">{{ dayjs(data.publishDate).format("YYYY/MM/DD hh:mm") }}</div>
            </div>
            <div class="watch flex-align-center">
                <img src="@/static/image/icon/eye.png" alt="" />
                {{ data.views }}
            </div>
        </div>
        <div class="content" v-html="data.content"></div>
    </div>
</template>

<script setup>
import { getArticleDetailApi } from "@/api/article.js";
import evn from "@/utils/config.js";
import { ref } from "vue";
import dayjs from "dayjs";
const data = ref({});
onLoad(({ id }) => {
    getArticleDetailApi(id).then(res => {
        console.log(res);
        data.value = res.data;
    });
});
</script>

<style lang="scss" scoped>
.page {
    padding: 32rpx;
    .top {
        padding-bottom: 32rpx;
        margin-bottom: 32rpx;
        border-bottom: 2rpx solid #f3f4f8;
        video {
            width: 100%;
        }
        .title {
            font-size: 32rpx;
            font-weight: 600;
            line-height: 48rpx;
            color: #1b2026;
        }
        .flex-between {
            margin: 16rpx 0;
            font-size: 24rpx;
            font-weight: 500;
            line-height: 28rpx;
            color: #77818f;
            letter-spacing: 0rpx;
        }
        .watch {
            font-size: 24rpx;
            font-weight: 500;
            line-height: 28rpx;
            color: #77818f;
            img {
                width: 25.34rpx;
                height: 16rpx;
                margin-right: 8rpx;
            }
        }
    }
}
</style>
