<template>
    <div class="recycle-order-number">
        <div class="common-text">
            <el-text>昵称：</el-text>
            <el-text
                >{{ row.userNick }}
                <el-tag type="success" size="small" v-if="platformType">
                    {{ platformType }}
                </el-tag>
            </el-text>
        </div>
        <div class="common-text">
            <el-text>收件人：</el-text>
            <el-text v-if="!row.receiveName">暂无信息</el-text>
            <el-text v-else
                >{{ formatName(row.receiveName) }}（{{
                    isScrect
                        ? formatPhone(row.receiveMobile)
                        : row.receiveMobile
                }}）</el-text
            >
        </div>
        <div class="common-text">
            <el-text>省市区：</el-text>
            <el-text>{{ row.receiveSsq || '-' }}</el-text>
        </div>
        <div class="common-text">
            <el-text>地址：</el-text>
            <el-text>{{ row.receiveAddress || '-' }}</el-text>
        </div>
    </div>
</template>

<script setup>
    import { formatName, formatPhone } from '@/utils/common';
    import { computed } from 'vue';

    const props = defineProps({
        row: {
            type: Object,
            default: () => {}
        },
        isReturn: {
            type: Boolean,
            default: false
        },
        isScrect: {
            default: true,
            type: Boolean
        }
    });

    const platformType = computed(() => {
        const value = props.row.plat;
        if (value === 1) return '微信';
        if (value === 2) return '支付宝';
        return '';
    });
</script>
