<template>
	<!-- 公告 -->
	<view class="page">
		<navbar title="活动" leftClick @leftClick="$utils.navigateBack" />
		<view style="padding: 20rpx;">
			<uv-parse :content="notice"></uv-parse>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				notice : {},
				id : 0,
				title : '公告',
				titles : ['公司介绍', '产品介绍', '关于我们', '其他'],
			}
		},
		onLoad({id, type}) {
			if(type){
				this.title = this.titles[type]
			}
			if(id){
				this.id = id
				this.getInfoIntroduce()
			}else{
				this.getRiceNoticeList()
			}
		},
		methods: {
			// 获取公告
			getRiceNoticeList(){
				this.$api('getRiceNoticeList', res => {
					if(res.code == 200){
						this.notice = res.result.content
					}
				})
			},
			// 获取相关介绍
			getInfoIntroduce(){
				this.$api('getRiceAdDetail', {
					id : this.id
				}, res => {
					if(res.code == 200){
						this.notice = res.result.details
					}
				})
			},
		}
	}
</script>

<style scoped lang="scss">
	.page {
	}
</style>