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

<script>
	import richTextTemplate from '@/components/cm-module/listTemplate/richTextTemplate'
	import { queryAfterSale } from "@/api/other.js"
	export default{
		components: {
		   richTextTemplate
		},
		data() {
			return{
				serverUrl: '',
				type: ''
			}
		},
		onLoad(){
			this.serverUrl = '/home/afterSale';
			this.type = 'shoppingNotes';
			this.initData();
		},
		methods:{
			initData(){
				let self = this;
				queryAfterSale().then(response =>{
					let _data =response.data,
						type = self.type;
					if(type) {
						let html = self.$api.adaptRichTextImg(_data[type]);
						self.$refs.childTemplate.html = html;
					}
				}).catch(response =>{
					this.$util.msg(response.msg,2000);
				})
			}
		}
	}
</script>

<style lang="scss">

</style>