<template>
  <zj-page-layout
  	:bgColor="'#FFFFFF'"
  	:hasFooter="false"
  	:isScroll="false">
  	<view class="content">
  		<u-parse :content="content" :tagStyle="style"></u-parse>
  	</view>
  </zj-page-layout>
</template>

<script>
	export default {
		data() {
			return {
				type: 1,
				content: '',
				style: {
					p: 'font-size: 32rpx; line-height: 52rpx;',
				}
			}
		},
		onLoad({type}) {
			this.type = type;
      if(type == 1) {
        uni.setNavigationBarTitle({
        　　title: '防骗指南'
        })
      }else if(type == 2) {
        uni.setNavigationBarTitle({
        　　title: '隐私政策'
        })
      }else if(type == 3) {
        uni.setNavigationBarTitle({
        　　title: '用户协议'
        })
      }
			
			this.getDetail();
		},
		methods: {
			getDetail() {
				this.$api.get('/app/config/detail-by-type', {
          configType: this.type
        }).then(res => {
					this.content = res.data ? res.data.content : '';
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		image {
			width: 100%;
		}
	}
</style>
