<template>
	<view>
		<view class="align-items" style="margin-top: 80rpx;">
			<back></back>
			<view class="title-text" style="margin-left: 20rpx;">
				公告列表
			</view>
		</view>
		<view class="notice" v-for="(item,index) in list" :key="index" >
			<view>
				<view class="justify-content">
					<view class="font-forty">
						{{item.title}}
					</view>
					<view class="font-twenty-eight gray">
						{{item.time}}
					</view>
				</view>
				<view class="font-thirty-two black" style="margin: 30rpx 0;">
					 <rich-text :nodes="item.text"></rich-text> 
				</view>
			</view>
			
		</view>
	</view>
</template>

<script>
	import service from '@/api/index.js'
	export default {
		data() {
			return {
				list: []
			}
		},
		onLoad() {
			this.lists()
		},
		methods: {
			toDetail(url){
				console.log(url)
				uni.navigateTo({
					url 
				})
			},
			lists(){
				service.getNoticeList().then(res=>{
					// console.log('getNoticeList',res)
					this.list = res
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.notice {
		margin: 20rpx;
		padding: 20rpx;
		background: #FFFFFF;
		box-shadow: 0rpx 8rpx 17rpx 0rpx rgba(0, 0, 0, 0.04);
		border-radius: 10rpx;
	}

	.text {
		border-left: 15rpx solid #3857F3;
		padding-left: 20rpx;
	}
</style>
