<template>
    <el-dialog :title="typeTitle" :visible.sync="dialogCarVisible" width="500px" class="dialog-info">
        <div class="info-wrp">
            <div class="title"></div>
            <div class="info-item">
                <span>姓名：</span>
                <span v-show="actionType=='check'">{{ info.truename }}</span>
            </div>
            <div class="info-item">
                <span>手机号：</span>
                <span v-show="actionType=='check'">{{ info.mobile }}</span>
            </div>
            <div class="info-item">
                <span>充值时间：</span>
                <span v-show="actionType=='check'">{{ info.create_time }}</span>
            </div>
            <div class="info-item"> 
                <span>充值金额：</span>
                <span v-show="actionType=='check'">{{ info.recharge_money }}</span>
            </div>
            <div class="info-item">
                <span>赠送金额：</span>
                <span v-show="actionType=='check'">{{info.gift_money}}</span>
            </div>
        </div>
    </el-dialog>
</template>

<script>
    import SelectPlace from '@/components/SelectPlace'
    import api from '@/api/recharge'
    export default {
        name: "user-details",
        components: {
            SelectPlace
        },
        filters: {
            // troubleFilter(status) {
            //     let troubleMap = ['无故障', '有故障']
            //     return troubleMap[status]
            // }
        },
        data() {
            return {
                dialogCarVisible: false,
                info: {
                    money: "",
                    giftMoney: "",
                    manageAreaId: "",
                    startDate: "",
                    endDate: "",
                    id: "",
                    status:""
                },
                actionType: 'check',
                typeTitle: '修改配置',
                show:true
            }
        },
        methods: {
            open(actionType, data) {
                console.log('open')
                console.log(data)
                this.dialogCarVisible = true
                this.actionType = actionType
                console.log(this.actionType)
                if(data) {
                    console.log(data)
                    this.info = data
                    this.info.manageAreaId = data.manage_area_id
                    // this.info.status = String(data.status)
                    console.log(this.info)
                } else {
                    this.info = {
                    money: "",
                    giftMoney: "",
                    manageAreaId: "",
                    startDate: "",
                    endDate: "",
                    id: "",
                    status:""
                }
                this.show = false
                }
            },
        },
        created() {
            // console.log(this.type)
        }
    }
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
    .dialog-info {
        top: -5vh;
    }
    .info-wrp {
        margin-top: -50px;
        .info-item {
            margin-left: 20px;
            margin-bottom: 10px;
            span:first-child {
                display: inline-block;
                width: 85px;
                text-align: right;
            }
        }
        .title {
            font-size: 16px;
            margin: 20px 0 10px;
            padding-top: 20px;
            border-top: 1px solid #ccc;
        }
        .btn-group {
            text-align: center;
            margin-top: 20px;
        }
    }
</style>
