Files
x-forend/src/pages-sub/news-detail/index.vue
T
2025-01-03 16:44:05 +08:00

33 lines
1.0 KiB
Vue

<route lang="json5" type="page">
{
style: {
navigationBarTitleText: '新闻详情',
navigationBarBackgroundColor: '#fff',
},
}
</route>
<script setup lang="ts">
import { getIntroductionDetailAPI } from '@/service'
import { getImageUrl } from '@/utils'
import dayjs from 'dayjs'
const newsDetail = ref<any>({})
onLoad(async (options) => {
const { data } = await getIntroductionDetailAPI({ id: options.id })
newsDetail.value = data
})
</script>
<template>
<view class="min-h-screen pb-100 pt-30 px-15">
<view class="text-20 text-black font-bold">{{ newsDetail.name }}</view>
<view class="flex justify-between py-10">
<view class="text-14 text-gray-500">{{ newsDetail.source }}</view>
<view class="text-14 text-gray-500">
{{ dayjs(newsDetail.createtime * 1000).format('YYYY-MM-DD HH:mm') }}
</view>
</view>
<image class="w-full mt-15" mode="widthFix" :src="getImageUrl(newsDetail.image)" />
<view class="text-14 text-gray-600 mt-15">{{ newsDetail.content }}</view>
</view>
</template>