94 lines
4.0 KiB
Vue
94 lines
4.0 KiB
Vue
<!--
|
|
Ported from legacy henza_pwa/src/views/user/src/components/profile.vue,
|
|
heavily simplified — legacy's original (971 lines, the largest view in the
|
|
app) is a full edit form (bank info, KYC document uploads, sub-user
|
|
management for banker accounts). None of that has a backend to back it:
|
|
there's no update-customer endpoint, no document-upload endpoint, and (as
|
|
in DashboardView) no banker/sub-account concept in the new Customer model
|
|
at all. Kept, faithfully styled: the avatar circle and the real read-only
|
|
info card (name/mobile/national code/verification status/city), all backed
|
|
by real fields the API already returns.
|
|
|
|
DROPPED: "تکمیل پروفایل" (complete profile) button, "افزودن کاربر" (add
|
|
sub-user) FAB, the "کارشناس فروش" (sales agent) contact card — that last
|
|
one needs the referring AdminUser's name/mobile, which the current
|
|
GET /customers/:id response doesn't expose (only referredByAgentId, a bare
|
|
id) — not resolved here to keep apps/api untouched this batch.
|
|
-->
|
|
<template>
|
|
<div class="fixed top-0 z-10 w-full">
|
|
<AppHeader class="bg-white shadowHeader">
|
|
<div class="flex justify-between items-center">
|
|
<Icon icon="vuesax-linear:arrow-right-1" class="cursor-pointer" size="25" @click="router.push({ name: 'userPage::hasSubRoute' })" />
|
|
<h3 class="t bold mb-0">اطلاعات کاربری</h3>
|
|
<div></div>
|
|
</div>
|
|
</AppHeader>
|
|
</div>
|
|
<div class="h-20"></div>
|
|
|
|
<container>
|
|
<div class="flex justify-center mb-8">
|
|
<div class="h-[150px] w-[150px] bg-[#F8F7F6] rounded-full flex justify-center items-center bg-opacity-50">
|
|
<div class="bg-[#F9F5F0] h-[120px] w-[120px] flex justify-center items-center rounded-full">
|
|
<div class="rounded-full w-[90px] h-[90px] flex justify-center bg-[#F1E8DE]">
|
|
<img :src="editImg" class="p-6" alt="henza" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div v-if="customer" class="border-solid border-[1px] border-[#F3F4F6] rounded-[6px] p-8 mt-2 bg-[#FEFEFE]">
|
|
<div class="flex justify-between">
|
|
<div class="text-[#9CA3AF] font-medium">نام و نام خانوادگی :</div>
|
|
<div class="text-[#374151] text-[16px] font-bold text-left">{{ customer.fullName }}</div>
|
|
</div>
|
|
<div class="flex justify-between mt-8">
|
|
<div class="text-[#9CA3AF] font-medium">تلفن همراه :</div>
|
|
<div class="text-[#374151] text-[16px] font-bold text-left">{{ customer.mobile }}</div>
|
|
</div>
|
|
<div class="flex justify-between mt-8">
|
|
<div class="text-[#9CA3AF] font-medium">کد ملی :</div>
|
|
<div class="text-[#374151] text-[16px] font-bold text-left">{{ customer.nationalCode }}</div>
|
|
</div>
|
|
<div class="flex justify-between mt-8">
|
|
<div class="text-[#9CA3AF] font-medium">وضعیت احراز هویت :</div>
|
|
<div class="text-[#374151] text-[16px] font-bold text-left">{{ VERIFICATION_LABELS[customer.verificationStep] }}</div>
|
|
</div>
|
|
</div>
|
|
</container>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { onMounted, ref } from 'vue'
|
|
import { useRouter } from 'vue-router'
|
|
import editImg from '../../assets/img/henza.svg'
|
|
import Icon from '../../components/icon/Icon.vue'
|
|
import AppHeader from '../../components/AppHeader.vue'
|
|
import { useSessionStore } from '../../stores/session'
|
|
import { api, type CustomerDetail } from '../../api/client'
|
|
|
|
const VERIFICATION_LABELS: Record<string, string> = {
|
|
UNVERIFIED: 'احراز نشده',
|
|
STEP_ONE_SUBMITTED: 'مرحله اول ثبت شده',
|
|
STEP_TWO_SUBMITTED: 'مرحله دوم ثبت شده',
|
|
VERIFIED: 'تایید شده',
|
|
}
|
|
|
|
const router = useRouter()
|
|
const session = useSessionStore()
|
|
const customer = ref<CustomerDetail | null>(null)
|
|
|
|
onMounted(async () => {
|
|
if (session.customerId) {
|
|
customer.value = await api.getCustomer(session.customerId)
|
|
}
|
|
})
|
|
</script>
|
|
|
|
<style scoped>
|
|
.shadowHeader {
|
|
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
|
|
}
|
|
</style>
|