<template>
    <view style="margin: 20rpx 0 30rpx 0;">
        <van-cell-group>
            <van-cell title="医生" :value="doctor" />
            <van-cell title="就诊人" :value="patName" />
            <van-cell title="排队人数" :value="lineCount" />
            <van-cell title="状态" :value="state" />
            <van-cell title="就诊时段" :value="date" />
        </van-cell-group>
    </view>
    <view v-if="hasPower">
        <view style="margin: 20rpx 40rpx 20rpx 40rpx;">
            <van-button round type="primary" color="#7232dd" block>进入诊室</van-button>
        </view>
        <view style="margin: 20rpx 40rpx 20rpx 40rpx;" wx:if="{{ifPat}}">
            <van-button round type="primary" color="#7232dd" block @tap="nviteRelation">邀请亲属视频陪诊</van-button>
        </view>
    </view>
    <view v-if="hasPower == false">
        <!-- <template is="powerMessage"></template> -->
        <view style="margin: 0rpx 40rpx 20rpx 40rpx;">
            <van-button round type="primary" color="#7232dd" block>开启权限</van-button>
        </view>
    </view>

    <van-popup :show="show" @close="onClose" closeable close-icon-position="top-right" custom-style="width: 80%">
        <!-- <import src="../../components/tempCommon/tempCommon" /> -->
        <!-- <template is="powerMessage"></template> -->
        <view style="margin: 0rpx 40rpx 20rpx 40rpx;">
            <van-button round type="primary" color="#7232dd" block @tap="changePower">开启</van-button>
        </view>
    </van-popup>
    <van-popup show="{{ inviteRelationShow }}" bind:close="inviteRelationOnClose" closeable close-icon-position="top-right"
        custom-style="width: 80%">
        <!-- <import src="../../components/tempCommon/tempCommon" /> -->
        <!-- <template is="inviteRelatives"></template> -->
    </van-popup>
</template>

<script>
export default {
    data() {
        return {
            show: true,
            doctor: "彭颐胜 呼吸内科",
            patName: "鹏鹏",
            lineCount: "2",
            state: "候诊",
            date: "今天 08:00~08:15",
            hasPower: true,
            inviteRelationShow: false,
            ifPat: true
        }
    },
    methods: {
        onClose() {
            this.setData({
                show: false,
                hasPower: false
            });
        },

        changePower() {
            this.setData({
                show: false,
                hasPower: true
            })
        },

        inviteRelation() {
            this.setData({
                inviteRelationShow: true
            })
        },

        sendInvite() {
            this.setData({
                inviteRelationShow: false
            })
        },

        inviteRelationOnClose() {
            this.setData({
                inviteRelationShow: false
            })
        },
    }
}
</script>