<template>
	<layout>
		<!-- #ifdef MP-WEIXIN -->
		<uv-navbar
		  :fixed="false"
		  :title="title"
		  left-arrow
		  @leftClick="$onClickLeft"
		/>
		<!-- #endif -->
		<view style="background-color: #ffffff; padding: 30rpx;">
			<view class="mb-3">{{ news.title }}</view>
			<view class="font-small text-light-black mb-3">发布时间：{{ formatDateTime(news.createTime) }}</view>
			<view><rich-text :nodes="news.content"></rich-text></view>
		</view>
	</layout>
</template>

<script setup>
import {
  ref
} from 'vue'
import { onLoad,onShow} from '@dcloudio/uni-app'
import {
  getNewsDetail
} from '@/api/market'
import { formatDateTime } from '@/utils/util'


const title = ref('新闻详情')
const news = ref('')

onLoad((option) => {
	if (option.id) {
		getContent(option.id);
	}
})	
const getContent = async(id) => {
	let data = await getNewsDetail({id:id});
	if (data) {
		news.value = data;
	}
}


</script>

<style lang="scss" scoped>
	
</style>
