<template>
	<view class="common_richtext_page  padding-30 bg-ff" style="min-height: 100vh;width: 100vw;">
		<ty-text-rich-text :html="html"></ty-text-rich-text>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: '', //页面标题
				url: '', //请求URL
				param: '', //渲染参数
				html: '' //用于渲染的 html 字符串
			}
		},
		onLoad(options) {
			this.keyword = options.keyword ? decodeURIComponent(options.keyword) : '';
			this.title = options.hasOwnProperty('title') ? decodeURIComponent(options.title) : ''
			this.url = options.hasOwnProperty('url') ? decodeURIComponent(options.url) : ''
			this.param = options.hasOwnProperty('param') ? decodeURIComponent(options.param) : ''
			this.html = options.hasOwnProperty('html') ? decodeURIComponent(options.html) : ''
			if (this.title) {
				this.cn.setTitle(this.title)
			}
		},
		onReady() {
			if (this.url && this.param) {
				this.rq.getData(this.url).then(res => {
					if (res.code === 0) {
						this.html = this.url=='integral/api/Config/getLogo'?res.data.config[this.param]:res.data[this.param]
					}
				})
			}
		},
		// methods: {
		// 	preview(src, e) { //预览图片
		// 		// do something
		// 		uni.previewImage({
		// 			urls: [src],
		// 			longPressActions: true
		// 		})
		// 	},
		// 	navigate(href, e) { // 跳转地址
		// 		// #ifdef H5
		// 		Window.location.href = href;
		// 		// #endif
		// 		// #ifdef APP-PLUS
		// 		uni.navigateTo({
		// 			url: "/pages/webview?url=" + encodeURI(href)
		// 		})
		// 		// #endif
		// 	}
		// },
	}
</script>

<style scoped>

</style>
