<template>
    <view class="leave">
        <template
            v-if="leaveDialog.type === 'wzInfoDialog' || leaveDialog.type === 'wzPhoneDialog' || leaveDialog.type === 'wzFillinDialog' || leaveDialog.type === 'wzChatBackDialog'"
        >
            <view v-if="leaveDialog.img"><image :src="leaveDialog.img" class="leave__info__img c-gap-bottom-small"/></view>
            <view
                v-for="(text, index) in leaveDialog.texts"
                :key="index"
                class="c-color c-font-15 leave__info__txt"
            >{{ text }}</view>
        </template>
        <template v-else-if="leaveDialog.type === 'wzCouponDialog'">
            <view class="leave__coupon">
                <view class="leave__coupon__pop">
                    <view class="leave__coupon__pop__top">
                        <view class="leave__coupon__pop__top__desc">{{ leaveDialog.header }}</view>
                    </view>
                    <view class="leave__coupon__pop__img-box">
                        <view>
                            <view class="leave__coupon__pop__img-box__title">{{ leaveDialog.title }}</view>
                            <view class="leave__coupon__pop__img-box__desc">{{ leaveDialog.subTitle }}</view>
                        </view>
                    </view>
                </view>
            </view>
            <view style="height: 39.2vw"/>
        </template>
    </view>
</template>

<script>
/**
 * @file 问诊挽留对话框内容
 * @author mayifan02
 * @categories 业务组件
 * @tags [component]
 */
export default {
    config: {
        component: true
    },
    props: {
        /**
         * 内容
         */
        leaveDialog: {
            type: Object,
            default: () => ({})
        }
    },
    data() {
        return {
            value: '',
            iptfocus: false
        };
    },
    methods: {}
};
</script>
<style lang="less" scoped>
.leave {
    &__info {
        &__img {
            width: 100px;
            height: 100px;
            margin: 5px auto;
            margin-bottom: 10px;
            display: block;
        }
        &__txt {
            text-align: center;
        }
    }

    &__coupon {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        &__pop {
            width: 100%;
            background: #fff;
            border-radius: 13px;
            background: #ffffff;
            border-radius: 10px;
            box-sizing: border-box;
            position: relative;
            &__img-box {
                width: 62.72vw;
                height: 24.20vw;
                background-image: url('https://med-fe.cdn.bcebos.com/wz%2Fno-pay-modal.png');
                position: absolute;
                top: 17vw;
                left: 50%;
                transform: translateX(-50%);
                text-align: center;
                display: flex;
                justify-content: center;
                align-items: center;
                background-size: 100% auto;
                background-repeat: no-repeat;
                &__title {
                    font-size: 24px;
                    font-weight: bold;
                    color: #00c8c8;
                }
                &__desc {
                    font-size: 14px;
                    color: #c19d7e;
                    margin-top: 5px;
                }
            }
            &__top {
                width: 100%;
                height: 29vw;
                background-image: linear-gradient(-134deg, #00d3ea 0%, #05cfcd 61%, #00cfa3 100%);
                font-size: 17px;
                color: #ffffff;
                text-align: center;
                padding-top: 26.6px;
                border-top-left-radius: 10px;
                border-top-right-radius: 10px;
                box-sizing: border-box;
            }
        }
    }
}
</style>
