<template>
    <div class="add-edit-dialog-container">
        <el-dialog
            :title="title"
            :visible.sync="visible"
            width="650px"
            :before-close="close"
            :close-on-click-modal="false"
        >
            <el-form :model="formData" ref="formData" label-width="130px">
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="用户昵称:">
                            <span>{{ formData.name }}</span>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="用户手机号:">
                            <span>{{ formData.mobile }}</span>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="性别:">
                            <span v-if="formData.gender ===1">男</span>
                            <span v-if="formData.gender ===2">女</span>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="年龄:">
                            <span>{{ formData.age }}</span>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="账户:">
                            <span>{{ formData.acount }}</span>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="头像:">
                            <el-image
                                style="width: 34px; height: 34px"
                                :src="formData.avatarUrl"
                                :fit="'cover'"
                            ></el-image>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="备注:">
                            <span>{{ formData.remarks }}</span>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="个性签名:">
                            <span>{{ formData.signature }}</span>
                        </el-form-item>
                    </el-col>
                </el-row>

                <!-- <el-row>
                    <el-col :span="12">
                        <el-form-item label="service_total:">
                            <span>{{ formData.serviceTotal }}</span>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="satisfaction_total:">
                            <span>{{ formData.satisfactionTotal }}</span>
                        </el-form-item>
                    </el-col>
                </el-row>-->

                <!-- <el-row>
                    <el-col :span="12">
                        <el-form-item label="level:">
                            <span>{{ formData.level }}</span>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="maintenance_total:">
                            <span>{{ formData.maintenanceTotal }}</span>
                        </el-form-item>
                    </el-col>
                </el-row>-->

                <!-- <el-row>
                    <el-col :span="12">
                        <el-form-item label="emergency_total:">
                            <span>{{ formData.emergencyTotal }}</span>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="lift_total:">
                            <span>{{ formData.liftTotal }}</span>
                        </el-form-item>
                    </el-col>
                </el-row>-->

                <el-row>
                    <el-col :span="12">
                        <el-form-item label="用户余额:">
                            <span>{{ formData.balance }}</span>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="web角色类型:">
                            <span v-if="formData.type ==='00'">超级管理员</span>
                            <span v-if="formData.type ==='0'">企业管理员</span>
                            <span v-if="formData.type ==='1'">普通用户</span>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row>
                    <el-col :span="12">
                        <el-form-item label="支付宝账号:">
                            <span>{{ formData.alipayAccount }}</span>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="冻结的余额:">
                            <span>{{ formData.freezeBalance }}</span>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row>
                    <el-col :span="12">
                        <el-form-item label="app角色类型:">
                            <span>{{ formData.roleName }}</span>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="真实姓名:">
                            <span>{{ formData.realName }}</span>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row>
                    <el-col :span="12">
                        <el-form-item label="专家总积分:">
                            <span>{{ formData.levelTotalScore }}</span>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="专家等级:">
                            <span>{{ formData.expertLevel }}</span>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row>
                    <el-col :span="12">
                        <el-form-item label="会员标志:">
                            <span v-if="formData.vipFlag =='1'">非会员</span>
                            <span v-if="formData.vipFlag =='2'">会员</span>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="平台认证专家:">
                            <span v-if="formData.platformInvitedFlag ==0">特邀专家</span>
                            <span v-if="formData.platformInvitedFlag ==0">普通专家</span>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row>
                    <el-col :span="12">
                        <el-form-item label="擅长品牌:">
                            <span>{{ formData.proficiencyBrandName }}</span>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="擅长:">
                            <span>{{ formData.proficiency }}</span>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="附近的人是否显示:">
                            <span v-if="formData.nearbyFlag==0">展示</span>
                            <span v-if="formData.nearbyFlag==1">不展示</span>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="开通vip月份:">
                            <span>{{ formData.vipValidity }}</span>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row>
                    <el-col :span="12">
                        <el-form-item label="状态:">
                            <span v-if="formData.statuz == 1">可以接任务</span>
                            <span v-if="formData.statuz == 0">不接任务</span>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="服务费:">
                            <span>{{ formData.serviceFee }}</span>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row>
                    <el-col :span="12">
                        <el-form-item label="维保公司:">
                            <span>{{ formData.companyName }}</span>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="显示姓名昵称:">
                            <span v-if="formData.showWhichName ===1">显示昵称</span>
                            <span v-if="formData.showWhichName ===2">显示真实姓名</span>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row>
                    <el-col :span="12">
                        <el-form-item label="成为会员时间:">
                            <span>{{ formData.vipStartTime | formatTimePipe('yyyy-MM-dd') }}</span>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="会员结束时间:">
                            <span>{{ formData.vipEndTime | formatTimePipe('yyyy-MM-dd') }}</span>
                        </el-form-item>
                    </el-col>
                </el-row>

            </el-form>
        </el-dialog>
    </div>
</template>
<script>
import { queryUserInfo } from '@/apps/mobile/api/operation/user/index';
export default {
    data() {
        return {
            type: null,
            title: '详情',
            submitBtndisabled: false,
            formData: {},
            visible: false,
        };
    },
    methods: {
        open(data) {
            this.getUserInfo(data.userId);
            this.visible = true;
        },
        close() {
            this.formData = {};
            this.visible = false;
        },
        getUserInfo(id) {
            queryUserInfo(id)
                .then(res => {
                    this.formData = res.data;
                })
                .catch();
        },
    },
};
</script>
<style lang="stylus" scoped>
.add-edit-dialog-container {
    ::v-deep .el-form-item {
        margin-bottom: 0;
    }

    .images {
        margin-right: 5px;
    }
}
</style>
