<template>
    <view class="p-30">
        <!-- 头部 -->
        <view class="header flex">
            <view class="cate-title">{{ item.title }}</view>
        </view>
        <!-- 基本信息 -->
        <view class="talents-item m-t-30">
            <view class="flex">
                <view class="">{{ item.author }}</view>
                <view class="m-l-20">{{timeFormat(item.created_at)}}</view>
            </view>

        </view>
        <!-- 简介信息 -->
        <view class="talents-item m-t-30 m-b-30">

            <view class="m-t-16 item-info">
                <rich-text :nodes="item.content"></rich-text>
            </view>
        </view>




    </view>
</template>

<script>
    import {
        mapActions,
        mapGetters
    } from 'vuex'
    import {
        policyDetail
    } from '@/api/app';
    import {
        timeFormat
    } from '@/utils/date';
    export default {
        data() {
            return {
                statusBarHeight: 0,
                id: 0, //分类id
                item: {},
                // item: {
                // 	title: '晋江市重点产业紧缺人才计划实施办法',
                //                 author: '晋江市发展改革委',
                //                 time: '2023-04-15 11:02',
                //                 content: '为深入实施创新驱动发展战略，营造有利于创新创业创造的良好发展环境，集聚重点产业高层次紧缺人才，促进主导产业和战略性新兴产业发展，根据《厦门市国民经济和社会发展第十四个五年规划和二〇三五年远景目标纲要》、《关于深化人才发展体制机制改革加快推进人才强市战略的意见》（厦委发〔2017〕16号）及有关政策法规，按照厦门市相关人才计划部署，制定本办法。'
                // }
            };
        },
        created() {
            uni.getSystemInfo({
                success: (res) => {
                    this.statusBarHeight = res.statusBarHeight;
                }
            });
        },
        onLoad() {
            // this.id = 11
            this.item = uni.getStorageSync('policyDetail');
            uni.removeStorageSync('policyDetail')
            if (!this.item) {
                this.id = this.$Route.query.id;
                this.getCategoryFun()
            }

        },
        onShow() {
            // this.getUser();
        },
        methods: {
            // ...mapActions(['getUser']),
            makePhoneCall(tel) {
                if (tel) {
                    uni.makePhoneCall({
                        phoneNumber: tel
                    });
                }
            },
            async getCategoryFun() {
                const {
                    status,
                    data
                } = await policyDetail({
                    id: this.id
                });
                if (status == 1) {
                    this.item = data
                }
            },
            timeFormat(time) {
                return timeFormat(time)
            },
        },
        computed: {
            ...mapGetters(['appConfig']),
        }
    };
</script>
<style lang="scss">
    page {
        background-color: #FFFFFF;
    }

    .header {
        .cate-title {
            font-size: 40rpx;
            font-family: PingFang SC-Medium, PingFang SC;
            font-weight: bold;
            color: #282C37;
        }
    }

    .talents-item {
        background: #FFFFFF;
        font-size: 28rpx;
    }
</style>