<!--
 * @Description: 
 * @Author: gcz
 * @Date: 2022-08-24 10:02:16
 * @LastEditors: gcz
 * @LastEditTime: 2022-08-24 10:31:12
 * @FilePath: \veterans_client_web\src\components\TipPopup\index.vue
 * @Copyright: Copyright (c) 2016~2022 by gcz, All Rights Reserved. 
-->
<template>
    <div class='tipPopup u-flex u-row-center'>
        <div class="tip-content">
            <img class="icon" v-if="type=='success'" src="@/assets/images/success-icon.png" alt="">
            <div class="text">{{text}}</div>
            <span class="btn" @click="confirm">确定</span>
        </div>
    </div>
</template>

<script>
    export default {
        name: 'TipPopup',
        components: {},
        props:{
            text: {
                type: String,
                default: "",
            },
            type: {
                type: String,
                default: "success",
            },
            urlPath: {
                type: String,
                default: null,
            },
        },
        data () {
            return {
                
            };
        },
        created(){},
        methods: {
            confirm(){
                if(this.urlPath){
                    this.$router.push({path:this.urlPath});
                }else{
                    this.$router.go(-1)
                }
            }
        },
    }
</script>

<style lang='scss' scoped>
.tipPopup{
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 99999999;
    background: rgba(0,0,0,.5);
    .tip-content{
        width: 400px;
        background: #fff;
        padding: 24px;
        border-radius: 8px;
        text-align: center;
        .icon{
            margin-top: 24px;
            width: 134px;
            margin-bottom: 24px;
        }
        .text{
            font-size: 20px;
            margin-bottom: 100px;
        }
        .btn{
            display: inline-block;
            text-align: center;
            width: 281px;
            height: 48px;
            line-height: 48px;
            background: #709078;
            border-radius: 7px;
            letter-spacing: 1px;
            color: #fff;
            font-size: 20px;
            cursor: pointer;
        }
    }
}
</style>