<template>
    <nav-bar :navbar-data="navbarData"></nav-bar>
    <view :style="{marginTop: height +'px'}">
        <writeDeseCon ref="writeDeseCon" :path="path" />
    </view>
</template>

<script>
    import Util from '@/utils/utils'
    import navBar from '@/components/navBar/index'
    import writeDeseCon from '../../components/writeDeseCon/writeDeseCon'
    const app = getApp();
    export default {
        components: {
            'nav-bar': navBar,
            'writeDeseCon': writeDeseCon
        },
        data() {
            return {
                height: app.globalData.height,
                navbarData: {
                    isGoHome: true,
                    isGoBack: true,
                    homePath: "../../../tabBar/index/index",
                    title: "预约挂号"
                },
                path: '../../videoConsultation/videoConsulChoosePatient/videoConsulChoosePatient'
            }
        },
        onLoad: function() {
            let entrance = app.globalData.reservationEntrance;
            this.setData({
                navbarData: {
                    ...this.navbarData,
                    title: entrance === '3' ? '线上问诊' : '线下门诊'
                }
            })
        },
        onShow: function() {
            console.log('videoConsulWriteContent onShow')
            const self = this
            this.setData({
                patObj: app.globalData.patObj,
                path: app.globalData.patObj.patID ? '../../videoConsultation/videoConsulPay/videoConsulPay' : '../../videoConsultation/videoConsulChoosePatient/videoConsulChoosePatient'
            }, () => {
                app.globalData.backPage = app.globalData.patObj.patID ? 1 : 2
                setTimeout(() => {
                    console.log(self.$refs)
                    self.$refs.writeDeseCon.onShow()
                }, 1500)
            })
        },
        onHide() {
            this.$refs.writeDeseCon.onHide()
        },
        methods: {
        }
    }
</script>

<style>
</style>