<template>
	<view class="content">
		<view class="container">
			<!-- #ifdef MP-WEIXIN -->
			<headers :titles="titles"><uni-icons @click="goback()" type="arrow-left" color="#000000"
					size="22px"></uni-icons></headers>
				<!-- #endif -->

			<view class="box-">
				<u-parse :content="content"></u-parse>
			</view>
			<u-loadmore :status="status" v-if="show == true" />
		</view>

	</view>
</template>

<script>
	import headers from '../../components/header/headers.vue'
	import tabbar from '../../components/tabbar/tabbar.vue'
	import request from '@/utils/request.js'
	export default {
		data() {
			return {
				titles: "默认",
				msg: "1",
				List: [],
				content: '',
				show: false,
				status: 'loading',
				newId: null,
				current: null,
			}
		},
		onLoad: function(option) {
			this.newId = option.id

		},
		onShow() {
			// this.actList = ["1", "1", "1", "1", "1", ]
			// this.status = "nomore" 底部刷新结束
			this.findTextById(this.newId)
		},
		onPullDownRefresh() {
			console.log("刷新");
			uni.stopPullDownRefresh()
		},
		onReachBottom() {
			// this.show = true
			setTimeout(() => {
				console.log("加载执行");
			}, 2000)
		},
		// 发送好友
		onShareAppMessage(res) {
			return {
				title: this.titles,
				path: '/pages/index/index',
			}
		},
		// 分享朋友圈
		onShareTimeline(res) {
			return {
				title: this.titles,
				path: '/pages/index/index',
			}
		},
		components: {
			headers,
			tabbar
		},
		methods: {
			goback() {
				uni.navigateBack()
			},
			async findTextById(id) {
				let res = await request({
					url: "/drivingSchool/system/dynamic/" + id,
					method: 'get'
				})

				if (res) {
					this.current = res
					this.content = res.data.content
					this.titles = res.data.title
				}
				console.log("数据", res)
			}
		},
	}
</script>

<style scoped lang="scss">
	.content {
		background: #f4f5f6;
		height: 100vh;
	}

	.container {
		width: 100%;
		background: #f4f5f6;
		box-sizing: border-box;
		padding-top: 88px;
	}

	.box- {
		box-sizing: border-box;
		padding: 15px;
	}
</style>