<template>
	<view class="u-content">
		<!-- #ifdef MP-WEIXIN -->
		<u-navbar title-color="#000000" :is-back="true" :title="title"></u-navbar>
		<!-- #endif -->
		<u-parse :html="content" ></u-parse>
		<home-btn></home-btn>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isGobal:false,
				title:"",
				downOption: {
					use: false,
					auto: false
				},
				content: '',
			}
		},
		onLoad(options) {
			this.title=options.title
			this.isGobal=options.isGobal || false
			console.log(this.title);
			// #ifdef H5
			uni.setNavigationBarTitle({
				title:this.title,
				success() {
					console.log("success");
				},
				fail(err) {
					console.log(err);
				}
			})
			// #endif
			
			this.fetchDetail()
		},
		methods: {
			fetchDetail() {
				let params = {
					title: this.title
				}
				//根据活动筛选，比如积分规则，用户隐私协议就不需要根据活动来筛选
				if (!this.isGobal) {
					params.activeId=this.vuex_active_setting.defaultActiveId
				}
				
				this.$api.notice.getDetail(params).then(res => {
					this.content = decodeURIComponent(res.data.data.content)
				})
			}
		}
	}
</script>

<style>
	page {
		background-color: #FFFFFF;
	}

	.u-content {
		padding: 30rpx;
		line-height: 50rpx;
		color: #505050;
	}
</style>
