<template>
    <view>
		<u-navbar  back-text="Back" :back-text-style="backStyle"
			back-icon-color="#fff" title-color="#fff" 
			title="Privacy Policy" 
			:background="background">
		</u-navbar>
		<view class="" style="color: #000;background-color: #fff;padding: 50px 20px;" 
		v-html="contentHtml?contentHtml:noData">
			
		</view>
    </view>
</template>
<script>
	export default {
		data() {
			return {
				initDataDetails:[],
				initID:null,
				initData:[],
				noData:'<p>No Data</p>',
				contentHtml:'',
				background:{
					backgroundImage: 'linear-gradient(270deg, #4BC0E2 0%, #538BE7 100%)',
				},
				backStyle:{
					color:'#fff'
				},
				scrollTop: 0,
			}
		},
		async onShow(){
			 const res = await this.$myRequest({
			 	url: '/op/helpCenterEntitys/getColumnTree',
			 	data: {
			 		language:'EN'
			 	}
			 });
			 const that = this;
			 if(res.data){
				res.data.forEach(item=>{
					if(item.name=='About Us' && item.children){
						item.children.forEach(i=>{
							if(i.name == 'Privacy Policy') {
								that.initID = i.id;
							}
						})
					}
				})
			 	that.initData = res.data;
				that.getInitIdDetail();
			 }
		},
		onPageScroll(e) {
			this.scrollTop = e.scrollTop;
			
		},
		
		methods:{
			i18n (data) {
			    return this.$t('common.'+data);
			},
			async getInitIdDetail(){
				const that = this;
				const res = await this.$myRequest({
					url: '/cms/cmsInformationViews/',
					data: {
						pageSize:6,
						pageNo:1,
						businessType:'help_center',
						businessId:that.initID,
						language:'EN',	
					}
				});
				if(res.data){
					
					this.initDataDetails = res.data.cmsInformationViews || [];
					if(this.initDataDetails){
						this.initDataDetails.forEach(item=>{
							if(item.businessId == that.initID){
								return that.contentHtml = item.contentHtml;
							}
						})
					}
				}
			}
		}
	}
	
</script>
<style>
	page {
		background-color: #fff;
	}
.center {
    width: 100%;
    text-align: center;
}
.weight7 {
    font-weight: 700;
}
</style>