<template>
	<!-- 用户协议 -->
	<view class="agreement">
		<loadlogo v-if="!loadlogo" />
		
		<view class="agreementPackage" v-if="loadlogo">
			<far-bottom></far-bottom>
			<view v-html="agreementMain" v-if="type == 1">{{agreementMain}}</view>
			<view v-html="privacy" v-else>{{privacy}}</view>
		</view>
	</view>
</template>

<script>
	import App from '@/common/js/app.js'
	import Loadlogo from '@/components/template/loadlogo'
	export default {
		data() {
			return {
				agreementMain: null,
				privacy:null,
				loadlogo:false,
				type:1
			};
		},
		onLoad(e) {
			if(e.type){
				this.type = e.type;
			}
			let _this = this,
				{
					agremType
				} = e,
				requestUrl = e.agremType === "user" ? '&p=member&do=getRegisterSet' :e.agremType==='store'?'&p=store&do=storeSettled':'&p=store&do=chargeList';
			App._post_form(requestUrl, {}, res => {
				_this.setData({
					agreementMain: res.data.describe,
					privacy:res.data.privacy
				})
			}, false, () => {
				_this.loadlogo = true
			})
			if(e.agremType=='user'){
				uni.setNavigationBarTitle({
				    title: '用户协议'
				});
			}else if(e.agremType=='store'){
				uni.setNavigationBarTitle({
				    title: '入驻协议'
				});
			}else{
				uni.setNavigationBarTitle({
				    title: '付费说明'
				});
			}
		},
		components:{
			Loadlogo
		}
	};
</script>

<style lang="less" scoped>
	.agreementPackage {
		padding: 30upx;
		font-size: 23upx;
		
		font-weight: bold;
		color: rgba(51, 51, 51, 1);
	}
</style>
