<template>
	<view class="content">
		<view class="" v-html="description">
		</view>
	</view>
</template>

<script>
	import {
		getDetail,
	} from '@/api/index.js';
	export default {
		data() {
			return {
				description: ''
			}
		},
		onLoad(opt) {
			if(opt.type) {
				this.type = opt.type
				uni.setNavigationBarTitle({
					title: '用户协议'
				})
			}
		},
		onShow() {
			this.loadData()
		},
		methods: {
			loadData() {
				let obj = this;
				let id = 3;
				if(obj.type == 1) {
					id = 4
				}
				getDetail(id).then(function(e) {
					obj.list = e.data;
					if (obj.list.content != null) {
						obj.description = obj.list.content.replace(/<img/g,
							"<img style='max-width:100%;height:auto;'");
					} //小程序商品详情图超出屏幕问题
				});
			}
		}
	}
</script>

<style lang="scss">
	.content {
		padding: $page-row-spacing;
		line-height: 2;
		font-size: $font-base;
	}

	.title {
		font-size: $font-lg + 6rpx;
		font-weight: bold;
		text-align: center;
	}

	.lineSt {
		text-indent: 2em;
	}

	.strongItem {
		margin: 20rpx 0;
		font-weight: bold;
		font-size: $font-lg;
	}
</style>