<template>
	<view class="app-page">
		<u-parse :content="content"></u-parse>
	</view>
</template>

<script>
	import {
		getData
	} from "@/common/api/common.js";

	export default {
		data() {
			return {
				name: null,
				content: undefined
			}
		},
		onLoad(options) {
			uni.hideShareMenu({

			})
			if (options.name) {
				this.name = options.name;
				this.getData()
			}
		},
		methods: {
			getData() {
				uni.showLoading({

				})
				const data = {
					id: this.name,
				}
				getData(data)
					.then((res) => {
						uni.hideLoading();
						console.log("getData==>", res.data)
						if (res.data) {
							uni.setNavigationBarTitle({
								title: res.data.page_title
							})
							this.content = res.data.content
						}
					})
					.catch(() => {
						uni.hideLoading();
					});
			},
		}
	}
</script>

<style lang="scss" scoped>
	.app-page {
		width: 100%;
		display: flex;
		align-items: center;
		flex-direction: column;
	}
</style>
