<template>
	<view class="guide">
		<view class="con" v-html="data">
		</view>
		<tabBar :pagePath="'/pages/index/guide'"></tabBar>
	</view>
</template>

<script>
	export default {
		data() {
			return {
			data:{},
			}
		},
		onLoad(option) {
			this.configInfo()
			this.getUserInfo()
		},
		methods: {
			configInfo(){
				this.$http.configInfo()
				.then(res=>{
					if(res.data.code==200){
						console.log(res)
						let str = res.data.result.czzn
						this.data=str.replace(/\<img/gi, '<img style="max-width:100%;height:auto" ').replace(/\<p>/gi, '<p style="word-break:break-all;">');
					}
				})
			},
			getUserInfo(){
				this.$http.getUserInfo()
				.then(res=>{
					if(res.data.code==200){
						// 是否信息完整
						if(res.data.result.completeInformation != 2){
							uni.navigateTo({
							  url: '/pages/login/perfect',
							})
						}
					}
				})
			},
		}
	}
</script>

<style lang="scss">
	.guide{
		padding-bottom: 120rpx;
		.headImg{
			width: 100%;
			height: 350rpx;
		}
		.con{
			width:680rpx;
			margin: 24rpx auto;
			padding:32rpx;
			background-color: #fff;
			border-radius: 24rpx;
		}
	}
</style>
