<template>
	<view class="container clearfix rich-text-temp">
		<rich-text-template ref="childTemplate"></rich-text-template>
	</view>
</template>

<script>
	import richTextTemplate from '@/components/module/listTemplate/richTextTemplate'
	
	export default{
		components: {
		   richTextTemplate
		},
		data() {
			return{
				serverUrl: '',
				type: ''
			}
		},
		onLoad(){
			this.serverUrl = '/home/afterSale';
			this.type = 'afterSale';
			this.initData();
		},
		methods:{
			initData(){
				let self = this;
				self.$api.get(self.serverUrl,{organizeID:self.userOrganizeID}, response => {
					if (response.code == "1") {
						let _data =response.data,
							type = self.type;
						if(type) {
							let html = self.$api.adaptRichTextImg(_data[type]);
							self.$refs.childTemplate.html = html;
						}
					} else {
						uni.showToast({icon:'none', title: response.msg, duration: 2000});
					}
				})
			}
		}
	}
</script>

<style lang="scss">

</style>