<template>
  	<section class="font-style">
        <section class="home-header">
            <mt-header>
                <router-link to="/" slot="left">
                    <mt-button icon="back"></mt-button>
                </router-link>
                <mt-button icon="more" slot="right"></mt-button>
            </mt-header>
            <article style="width: 100%;text-align:center;">
                <YqyHeaderTop :resourceData="header"/>
            </article>
        </section>
        <section class="home-body">
            <YqyHomeBanner :resourceData="resourceData"/>
            <YqyHotLabel :allTags="allTags"/>
            <YqyNewClass/>
            <YqyTeacherList :teacherData="teacherData" :courceData="courceData"/>
            <YqyTeacherList :teacherData="needData" :courceData="needcourceData"/>
        </section>
        <section class="home-bottom">
        </section>
    </section>
</template>

<script>
import { Header } from 'mint-ui';
// import yqyTest from '@/components/common/yqy/yqyTest'
import YqyHotLabel from '../../components/business/yqy-hot-label';
import YqyHotTeacher from '../../components/business/yqy-hot-teacher';
import YqyTeacherList from '../../components/business/yqy-teacher-list';
import YqyTeacherInfo from '../../components/business/yqy-teacher-info';
import YqyHomeHeader from '../../components/business/yqy-home-header';
import YqyHomeAdv from '../../components/business/yqy-home-adv';
import YqyFiveMinutes from '../../components/business/yqy-five-minutes';
import YqyCategoryThree1 from '../../components/business/yqy-category-three-1';
import YqyHomeBanner from '../../components/business/yqy-home-banner';
import YqyHomeKeepon from '../../components/business/yqy-home-keepon';
import YqyHomePorter from '../../components/business/yqy-home-porter';
import YqyHeaderTop from '../../components/business/yqy-header-top';
import YqyNewClass from '../../components/business/yqy-new-class';
export default {
    components:{
        Header,
        // yqyTest
        YqyHotLabel,
        YqyHotTeacher,
        YqyTeacherList,
        YqyTeacherInfo,
        YqyHomeHeader,
        YqyHomeAdv,
        YqyFiveMinutes,
        YqyCategoryThree1,
        YqyHomeBanner,
        YqyHomeKeepon,
        YqyHomePorter,
        YqyHeaderTop,
        YqyNewClass
    },
    data(){
        return {
            header: {
                title: '糖尿12221病',
                studyCount: 2700000,
                follower: 10000
            },
            resourceData: [
                {img: '../../images/Shape@2x.png',
                name: '检查'},
                {img: '../../images/Shape@2x.png',
                name: '诊断'},
                {img: '../../images/Shape@2x.png',
                name: '治疗'},
                {img: '../../images/Shape@2x.png',
                name: '随访'},
                {img: '../../images/Shape@2x.png',
                name: '研究'}
            ],
            allTags: ['老年性高血压','早期症状','饮食禁忌','讲师集'],
            teacherData: {
                title: '课程教学',
                hasSelect: true,
                showMoreBtn: false,
                firstOption: '综111合',
                selectOptions: [
                    { text: 'One', value: 'A' },
                    { text: 'Two', value: 'B' },
                    { text: 'Three', value: 'C' }
                ],
                options: [
                    {
                        isCheck: false,
                        title: '在学人数'
                    }, 
                    {
                        isCheck: false,
                        title: '最新发布'
                    }
                ]
            },
            courceData: {
                selected: '综合1',
                hasHospital: false,
                hasType: false,
                data: [
                    {
                        img: '../../images/Shape@2x.png',
                        name: '全科医学中医患关系全科医学中医患关系',
                        isLeft: true,
                        hospital: '阜外医院',
                        color: 'blue',
                        teacher: '肖丹',
                        count: 477
                    },
                    {
                        img: '../../images/Shape@2x.png',
                        name: '患者顺从度改善经验谈',
                        isLeft: true,
                        hospital: '阜外医院',
                        color: 'green',
                        teacher: '肖丹',
                        count: 477
                    },
                    {
                        img: '../../images/Shape@2x.png',
                        name: '基层医疗患者管理',
                        isLeft: true,
                        hospital: '阜外医院',
                        color: 'yellow',
                        teacher: '肖丹',
                        count: 477
                    },
                    {
                        img: '../../images/Shape@2x.png',
                        name: '患者心理学入门患者心理学入门',
                        isLeft: true,
                        hospital: '阜外医院',
                        color: 'pink',
                        teacher: '肖丹',
                        count: 477
                    },
                    {
                        img: '../../images/Shape@2x.png',
                        name: '基层医疗患者管理',
                        isLeft: true,
                        hospital: '阜外医院',
                        color: 'yellow',
                        teacher: '肖丹',
                        count: 477
                    },
                    {
                        img: '../../images/Shape@2x.png',
                        name: '患者心理学入门患者心理学入门',
                        isLeft: true,
                        hospital: '阜外医院',
                        color: 'blue',
                        teacher: '肖丹',
                        count: 477
                    }
                ]
            },
            needData: {
                title: '您可能需要',
                hasSelect: false,
                showMoreBtn: false,
                selectOptions: [
                    { text: 'One', value: 'A' },
                    { text: 'Two', value: 'B' },
                    { text: 'Three', value: 'C' }
                ],
                options: ['学习人数', '发布时间']
            },
            needcourceData: {
                selected: '综合1',
                hasHospital: false,
                hasType: true,
                data: [
                    {
                        img: '../../images/Shape@2x.png',
                        name: '口服降糖药物的药理作用及临床用法',
                        isLeft: true,
                        hospital: '阜外医院',
                        color: 'RGBA(74, 135, 212, 1)',
                        teacher: '肖丹',
                        count: 477,
                        type: '治疗'
                    },
                    {
                        img: '../../images/Shape@2x.png',
                        name: '高血压伴糖尿病的治疗',
                        isLeft: true,
                        hospital: '阜外医院',
                        color: 'RGBA(74, 135, 212, 1)',
                        teacher: '肖丹',
                        count: 477,
                        type: '诊断'
                    },
                    {
                        img: '../../images/Shape@2x.png',
                        name: '口服降糖药物的药理作用及临床用法',
                        isLeft: true,
                        hospital: '阜外医院',
                        color: 'RGBA(74, 135, 212, 1)',
                        teacher: '肖丹',
                        count: 477,
                        type: '检查'
                    },
                    {
                        img: '../../images/Shape@2x.png',
                        name: '高血压伴糖尿病的规范化治疗',
                        isLeft: true,
                        hospital: '阜外医院',
                        color: 'RGBA(74, 135, 212, 1)',
                        teacher: '肖丹',
                        count: 477,
                        type: '随访'
                    }
                ]
            }
        }
    },
	mounted(){
        this.init()
    },

    computed:{
    },

    methods:{
        init() {

            this.API_GET('contents/homeButton/msg', {}).then( res => {
                logger.debug(res)
                this.$log.debug(res)
            })

            let para = {
                sysCode: 27, 
                token: this.token,
                setEntry: 'headers'
            }
            this.GET('analysis/activityDetail', para).then( res => {
                logger.debug(res)
            })
            para = {
                sysCode: 27, 
                rankingType: 27,
                flag: 1,
                token: this.token,
                setEntry: 'headers'
            }
            this.GET('exams/rankings', para).then( res => {
                logger.debug(res)
            })
         
        },
        pushView : function(page){
            console.log('pushView');
            rocNative.pushView({
                url : page
            }).then(function(res) {
                console.log('pushView then' + JSON.stringify(res));
            }).catch(function(res){
                console.log('pushView catch' + JSON.stringify(res));
            });
        },
        goBack: function (msg) {
            console.log('goBack');
            rocNative.goBack()
            .then(function(res) {
                console.log('goBack then' + JSON.stringify(res));
            }).catch(function(res){
                console.log('goBack catch' + JSON.stringify(res));
            });
        },
        toast : function(msg){
            console.log('toast');
            rocNative.toast({
                msg: msg
            }).then(function(res) {
                console.log('toast then' + JSON.stringify(res));
            }).catch(function(res){
                console.log('toast catch' + JSON.stringify(res));
            });
        },
    },
}

</script>

<style lang="scss" scoped>
    @import '../../style/mixin';
    .mint-header {
        background-color: rgba($color: #000000, $alpha: 0)
    }
    .font-style {
        @include sc(0.6rem, #666);
    }

    .home-header {
        height: px2rem(202px);
        @include bis('../../images/552064153@2x.png');

        .logo_img{
            height: px2rem(85px);
            width: px2rem(345px);
            text-align: center;
        }
    }
</style>
