<template>
	<view>
		<template v-if="navKey">
			<navbar key='navKey' ref="navbar" :config="config" backColor="#333333"></navbar>
		</template>
		<view class="content-box">
			{{remark}}
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				config: {
					back: true, //false是tolbar页面 是则不写
					title: '',
					color: '#1A1A1A',
					//背景颜色;参数一：透明度（0-1）;参数二：背景颜色（array则为线性渐变，string为单色背景）
					backgroundColor: [1, 'transparent'],
				},
				navKey:'',
				remark:''
			};
		},
		onLoad(options) {
			const eventChannel = this.getOpenerEventChannel();
			// 监听acceptDataFromOpenerPage事件，获取上一页面通过eventChannel传送到当前页面的数据
			eventChannel.on('CodeInfo', res => {
				const data = res.data;
				this.config.title = data.name;
				this.navKey = Math.random()
				this.remark = data.remark;
				this.$forceUpdate()
				 
			})
		},
	}
</script>

<style lang="scss" scoped>
.content-box{
	width: 100%;
	padding: 30rpx;
	text-indent: 2em;
	font-size: 32rpx;
	color: #585859;
}
</style>
