<template>
	<view class="page">
		<u-navbar :title="tit" :border-bottom="false" :background="bgc" back-icon-color="#262B37" title-color='#262B37'
			title-size='36' height='36' id="navbar">
		</u-navbar>
		<view class="" v-if="obj == ''">
			
		</view>
        <u-parse v-else :html="obj" style="width: 100%;height: 100%;padding: 10rpx;box-sizing: border-box;"></u-parse>

	</view>
</template>

<script>
	export default {
		data() {
			return {
                bgc: {
                	backgroundColor: "#fff",
                },
				type:'',
				obj:'',
				tit:'',
				code:''
			}
		},
		onLoad(option) {
            this.type = option.type
			if(option.type == 0){
				this.tit = '租车指南'
				this.code = 'RENT_GUIDE'
			}else if(option.type == 2){
				this.tit = '查看教程'
                this.$u.get(`/app/article/bluetooth`).then(res =>{
                	if(res.code == 200){
                		this.obj = res.data.content
                	}
                })
			} else{
				this.tit = '用车指南'
				this.code = 'USE_GUIDE'
			}
			this.getqingqiu()
		},
		methods: {
			getqingqiu(){
				this.$u.get(`/app/article/first?code=${this.code}&appId=${this.$store.state.appid}`).then(res =>{
					if(res.code == 200){
						this.obj = res.data.content
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background: #fff;
	}

</style>