<template>
	<!-- <view class=""> -->

	<!-- </view> -->
	<view class="page">
		<navBar :backType="navBarTitle" :title="navBarTitle?navBarTitle:'小程序使用指南'" :back="true" color="black"
			background="white" />

		<view class="content">
			<view class="title">
				{{content.title}}
			</view>
			<view class="p">
				<u-parse :content="content.content"></u-parse>
			</view>
			<image :src="picBase+content.image" mode=""></image>
		</view>

		<view class="btnBox" v-if="showBtn">
			<button open-type="share" class="rBtn">
				一键分享
			</button>
		</view>
		<u-loading-page :loading="loading" image="/static/index/logo.png" loading-text="页面加载中..."></u-loading-page>
	</view>
</template>

<script>
	import {
		getUserGuideReq,
	} from '@/api/my/index.js'

	export default {
		components: {

		},
		data() {
			return {
				picBase: this.$picBase,
				content: {
					title: ''
				},
				navBarTitle: '',
				showBtn: true,

				loading: true
			}
		},
		async onLoad(o) {
			// o.id = 16
			if (o.id) {
				this.showBtn = false
				this.navBarTitle = '首页'
				let res = await getUserGuideReq()
				if (res.code == 0) {
					this.content = res.data
					this.loading = false
				} else {
					uni.showToast({
						title: res.message,
						icon: 'none'
					})
				}
			} else {
				let res = await getUserGuideReq()
				if (res.code == 0) {
					this.content = res.data
					this.loading = false
				} else {
					uni.showToast({
						title: res.message,
						icon: 'none'
					})
				}
			}
		},
		onShareAppMessage(params) {
			if (params.from === 'button' || params.from === 'menu') {
				return {
					title: this.content.title,
					imageUrl: this.$picBase + this.content.image,
					path: '/pages/my/useLead/index?id=' + this.content.id,
					mpId: this.$appId,
					type: this.$shareType,
				}
			}
		},
		methods: {

		}
	}
</script>

<style lang="scss" scoped>
	@import "./index.scss";
</style>