<template>
    <view class="waper">
    	<u-navbar :autoBack="true" :placeholder="true" bgColor="#fff">
    		<view slot='center' class="navbar_title">{{title}}</view>
    	</u-navbar>
        <view class="waper_box" v-if="detail">
            <view class="title">{{detail.title}}</view>
            <view class="content">
                <u-parse :content="detail.content"></u-parse>
            </view>
        </view>
    </view>
</template>

<script>
export default {
    data() {
        return {
            id: '',
            detail: null,
            title: ''
        };
    },
    async onLoad (options) {
        let info = await this.$http.getBlockList({ type: options.type });
        if (info.data.length > 0) {
            this.title = info.data[0].title;
            this.detail = info.data[0];
        } else {
            uni.showToast({ mask: true, icon: 'none', title: '暂无内容' })
            setTimeout(() => {
                uni.navigateBack({ delta: 1 })
            })
        }
    }
}
</script>

<style lang="scss">
page{ background: #fff; }
.waper_box{
    width: 100%; box-sizing: border-box; padding: 0 32rpx;
    .title{ line-height: 58rpx; color: #333; font-size: 40rpx; color: #333; }
    .time{ margin-top: 24rpx; line-height: 38rpx; color: #666; font-size: 28rpx; }
    .content{ width: 100%; margin-top: 32rpx; color: #666; font-size: 28rpx; line-height: 40rpx; }
}
</style>