<template>
	<view class="content">
		<u-parse :content="content"></u-parse>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				content:''
			}
		},
		onLoad() {
			this.init()
		},
		onShow() {
			this.initvist()
		},
		methods:{
			initvist(){
				let curPage = getCurrentPages();
				let route = curPage[curPage.length - 1].route; //获取当前页面的路由
				let code=uni.getStorageSync("code")
				let obj={
					page:route,
					code:code
				}
				if(code){
					uni.$u.http.post('/api/visit/add',obj,{
						custom: {
							auth: true
						}
					}).then((res) => {
					}).catch((err) => {
					})
				}
				
			},
			init(){
				let data=uni.getStorageSync("data")
				this.content=data[4].value
			}
		}
	}
</script>

<style lang="less">
	page{
		background-color: #FFFFFF;
	}
	.content{
		background-color: #fff;
		padding: 20rpx;
		margin:0 20rpx;
		height: 100%vh;
		.title{
			text-align: center;
		}
	}
</style>
