parity(apps+api): complete_profile in both apps [ref: henza_server Major/CustomerController::complete]
Ports "تکمیل پروفایل" end to end (D22). API - POST customer/me/complete-profile — three required document ids, the customer taken from the token, verification step set to the reference's LIVE value (approved outright; its `= 1` line is commented out at :83 in favour of `= 2` at :85). Both SMS messages byte-identical and non-blocking per D20. - POST customer/me/documents — the reference let the app upload through the same file/create the admin used, inside its auth:api-customer group (routes/api.php:95); the target's copy is admin-guarded, so the page could not have uploaded at all. Reuses AdminUploadsService unchanged, so both paths share one size limit, MIME whitelist and naming scheme (UPL-01). - PROFILE_ADMIN_MOBILES replaces the reference's four hardcoded personal numbers; blank means nobody is notified and the upload still succeeds. Three reference behaviours deliberately NOT ported, all in ISSUES.md: - SEC-14: `$customer->update($request->all())` mass-assigned the whole request body, letting the app write its own credit limit, making charge, gold debt, active flag or mobile. Replaced with a three-field whitelist. - SEC-15: four real personal mobiles hardcoded in the source. - APP-03: refresh()'s unterminated setInterval page reload. Apps (both, template+script byte-identical, per-app styling only) - CompleteProfileView + SingleImageUploader - route /complete_profile, redirecting home once the documents are in, as the reference's guard did (router/index.ts:266) - the entry point on the profile screen, shown only while they are missing (profile.vue:96-102) Also (D23): JWT_CUSTOMER_SECRET now warns loudly at boot when unset. It falls back to JWT_SECRET, which signs app and admin tokens with the same key and leaves the `typ` check as the only barrier — and an expert's app token carries their AdminUser id in `sub`. Warn rather than refuse to boot (D19, lowest risk); DELIVERY.md lists it as the first pre-release step (REL-03). Verified: build 5/5 · jest 45/45 · complete-profile 38/38 (new) · expert login 36/36 · apps smoke 43/43 · admin smoke 43/43 · B2B scan 34 ok/0 broken · typecheck clean on all four apps. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
f71fd5bfe1
commit
5ad1083aee
@@ -67,3 +67,13 @@ SMS_TREZ_SENDER_LINE=
|
||||
# ---------------------------------------------------------------------------
|
||||
# Absolute path for uploaded files; defaults to <api>/storage/uploads.
|
||||
UPLOAD_DIR=
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Profile completion ("تکمیل پروفایل")
|
||||
# ---------------------------------------------------------------------------
|
||||
# Comma-separated admin mobiles told when a customer uploads their documents.
|
||||
# The reference hardcoded four numbers in its source
|
||||
# (henza_server Major/CustomerController::sendSmsToAdmin); they live here
|
||||
# instead so no personal number is committed. Blank means nobody is notified —
|
||||
# the upload and the customer's own SMS still go through (D20).
|
||||
PROFILE_ADMIN_MOBILES=
|
||||
|
||||
+17
-5
@@ -8,14 +8,23 @@ Both merged with **no conflicts** (`phase-1-admin` already contained
|
||||
|
||||
---
|
||||
|
||||
## ⚠ Before the real release — do these two things
|
||||
## ⚠ Before the real release — do these three things
|
||||
|
||||
1. **Remove `OTP_MASTER_CODE` from the environment.** While it is set, **any
|
||||
1. **Set `JWT_CUSTOMER_SECRET` to its own random value.** This one is a real
|
||||
security boundary, not a default. If it is unset, the API signs customer and
|
||||
sales-expert **app** tokens with `JWT_SECRET` — *the same key admin tokens
|
||||
use* — so the two token realms stop being cryptographically separate. The
|
||||
only thing still keeping an app token off the admin routes is the `typ`
|
||||
check in `jwt.strategy.ts`, and a sales expert's app token carries their
|
||||
**AdminUser id** in `sub`. Two independent defences become one. The API
|
||||
prints a loud banner at boot while it is missing. Tracked as **REL-03
|
||||
(Critical)**.
|
||||
2. **Remove `OTP_MASTER_CODE` from the environment.** While it is set, **any
|
||||
active customer can sign in with that one fixed code**. Unset or empty
|
||||
disables it completely, and the API prints a warning banner at boot for as
|
||||
long as it is armed. Tracked as **REL-01 (Critical)** in
|
||||
`docs/parity/ISSUES.md`.
|
||||
2. **Configure the SMS credentials** (`SMS_TREZ_*`). Until then no customer can
|
||||
3. **Configure the SMS credentials** (`SMS_TREZ_*`). Until then no customer can
|
||||
receive a real login code — messages are written to the log instead of sent.
|
||||
Tracked as **REL-02**.
|
||||
|
||||
@@ -34,7 +43,7 @@ container.
|
||||
| `DATABASE_URL` | PostgreSQL connection string. Inside Docker the host is `db`. |
|
||||
| `POSTGRES_USER`, `POSTGRES_PASSWORD`, `POSTGRES_DB` | Credentials for the bundled `db` service. |
|
||||
| `JWT_SECRET` | Signs **admin** tokens. Without it the API falls back to a well-known development string — set it. |
|
||||
| `JWT_CUSTOMER_SECRET` | Signs **customer** tokens. Deliberately separate from `JWT_SECRET` so an admin token can never validate as a customer token. |
|
||||
| `JWT_CUSTOMER_SECRET` | Signs **customer and sales-expert app** tokens. Must be its own value — see the warning at the top of this file. Unset, it falls back to `JWT_SECRET` and the two token realms merge. |
|
||||
|
||||
### Optional
|
||||
|
||||
@@ -47,6 +56,7 @@ container.
|
||||
| `ADMIN_PANEL_PORT`, `USER_APP_PORT`, `USER_APP_V2_PORT` | 5180–5182 | Dev servers only. |
|
||||
| `RUN_MIGRATIONS` | `true` | Set `false` to skip the boot-time migration run. |
|
||||
| `RUN_SEED` | `true` | Set `false` to skip seeding. |
|
||||
| `PROFILE_ADMIN_MOBILES` | *(blank)* | Comma-separated admin mobiles told when a customer completes their profile. The reference hardcoded four numbers; blank means nobody is notified and the upload still succeeds. |
|
||||
|
||||
### SMS — all optional; blank means "log, do not send"
|
||||
|
||||
@@ -141,6 +151,8 @@ All green on `release/delivery`:
|
||||
| `smoke-admin-b2b-writes.cjs` — order + document writes | **25/25** |
|
||||
| `auth-smoke.sh` — permissions/401/403 | **32/32** |
|
||||
| `test-sales-expert-roundtrip.cjs` | **33/33** |
|
||||
| `test-sales-expert-app-login.cjs` — expert app login (D21) | **36/36** |
|
||||
| `test-complete-profile.cjs` — «تکمیل پروفایل» | **38/38** |
|
||||
| `test-name-trigger.cjs` | **9/9** |
|
||||
| typecheck (api, admin-panel, user-app, user-app-v2) | ✅ clean |
|
||||
|
||||
@@ -173,7 +185,6 @@ priority order:
|
||||
| Page | Reference | Notes |
|
||||
|---|---|---|
|
||||
| `report` + `report/detail` | `henza_pwa/src/views/report/` | The accounting statement — a store plus two components (`Accounting.vue`, `AccountingDetail.vue`). The largest of the four. |
|
||||
| `completeProfile` | `.../completeProfile.vue` | No trace in the target — no page and no route. |
|
||||
|
||||
### Delivered tonight
|
||||
|
||||
@@ -183,6 +194,7 @@ priority order:
|
||||
| **«سفارش مشتریان» (ChildOrder)** | ✅ Done in both apps. Their referred customers' orders at «تحویل مسئول فروش», searchable, infinite-scrolled. |
|
||||
| **«مشتریان من» (customerChoice)** | ✅ Done in both apps. Their referred customers, searchable, with a read-only detail sheet. |
|
||||
| **APP-02 — admin home slider in v2** | ✅ Fixed. v2 now prefers admin-configured slides and keeps its category-derived hero as the fallback. |
|
||||
| **«تکمیل پروفایل» (complete_profile)** | ✅ Done in both apps. Three document uploads (جواز کسب، سردر مغازه، کارت ملی), then the profile is marked verified. Reached from the profile screen, and only while the documents are missing — exactly the reference's condition. |
|
||||
|
||||
An expert's own order lands on their **own trading account**, with the making
|
||||
charge from `AdminUser.wagePercent` and the credit limit from
|
||||
|
||||
@@ -0,0 +1,308 @@
|
||||
/**
|
||||
* "تکمیل پروفایل" — POST customer/me/complete-profile and its uploads.
|
||||
*
|
||||
* Ports henza_server Major/CustomerController::complete
|
||||
* (app/Http/Controllers/Major/CustomerController.php:73-108).
|
||||
*
|
||||
* Covers what the owner asked for per page — opening, the empty state, the
|
||||
* error state and the main flow — plus the boundaries that matter here:
|
||||
*
|
||||
* 1. the main flow: three uploads, then complete, then VERIFIED
|
||||
* 2. empty/validation: each id missing in turn is a 400/422
|
||||
* 3. error: an id that names no file is refused, and nothing is written
|
||||
* 4. the customer comes from the TOKEN — no id is accepted from the body
|
||||
* 5. no token at all is a 401 on both routes
|
||||
* 6. an expert can complete their own profile too (D21: every customer
|
||||
* route works for an expert unchanged)
|
||||
* 7. SEC-14: extra body fields are IGNORED, not mass-assigned. The
|
||||
* reference did `$customer->update($request->all())`, which let the app
|
||||
* write gram_level/percent/active onto itself.
|
||||
*
|
||||
* Every Persian string is a literal here and travels as UTF-8 JSON (D15).
|
||||
*
|
||||
* Requires the API running WITH OTP_MASTER_CODE set.
|
||||
* Usage: node scripts/test-complete-profile.cjs [apiBaseUrl] [masterCode]
|
||||
*/
|
||||
const { PrismaClient } = require('@prisma/client');
|
||||
const prisma = new PrismaClient();
|
||||
const API = (process.argv[2] || 'http://localhost:3000/api').replace(/\/$/, '');
|
||||
const MASTER = process.argv[3] || '1379';
|
||||
|
||||
let pass = 0, fail = 0;
|
||||
const failures = [];
|
||||
const chk = (c, m) => {
|
||||
if (c) { pass++; console.log(' PASS ' + m); }
|
||||
else { fail++; failures.push(m); console.log(' FAIL ' + m); }
|
||||
};
|
||||
const step = (t) => console.log('\n' + t);
|
||||
|
||||
const call = async (method, p, body, token) => {
|
||||
const res = await fetch(`${API}/${p}`, {
|
||||
method,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...(token ? { Authorization: 'Bearer ' + token } : {}),
|
||||
},
|
||||
body: body === undefined ? undefined : JSON.stringify(body),
|
||||
});
|
||||
const text = await res.text();
|
||||
let payload = null;
|
||||
try { payload = JSON.parse(text); } catch { /* empty */ }
|
||||
return { status: res.status, ok: res.ok, body: payload, raw: text };
|
||||
};
|
||||
|
||||
/** A one-pixel PNG, so the upload exercises the real MIME whitelist. */
|
||||
const PNG = Buffer.from(
|
||||
'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==',
|
||||
'base64',
|
||||
);
|
||||
|
||||
const upload = async (token, purpose) => {
|
||||
const form = new FormData();
|
||||
form.append('file', new Blob([PNG], { type: 'image/png' }), `${purpose}.png`);
|
||||
form.append('purpose', purpose);
|
||||
const res = await fetch(`${API}/customer/me/documents`, {
|
||||
method: 'POST',
|
||||
headers: token ? { Authorization: 'Bearer ' + token } : {},
|
||||
body: form,
|
||||
});
|
||||
const text = await res.text();
|
||||
let payload = null;
|
||||
try { payload = JSON.parse(text); } catch { /* empty */ }
|
||||
return { status: res.status, ok: res.ok, body: payload, raw: text };
|
||||
};
|
||||
|
||||
const signIn = (mobile) =>
|
||||
call('POST', 'customer/auth/verify-otp', { username: mobile, password: MASTER });
|
||||
|
||||
/** Everything this run creates, removed at the end. */
|
||||
const made = { admins: [], customers: [], files: [] };
|
||||
const uniq = String(Date.now()).slice(-7);
|
||||
|
||||
(async () => {
|
||||
step('SETUP — an unverified customer, and a sales expert');
|
||||
|
||||
const mkCustomer = async (suffix, name) => {
|
||||
const c = await prisma.customer.create({
|
||||
data: {
|
||||
fullName: name,
|
||||
firstName: name.split(' ')[0],
|
||||
lastName: name.split(' ').slice(1).join(' '),
|
||||
mobile: `0917${uniq.slice(0, 3)}${suffix}`,
|
||||
nationalCode: `nc${uniq}${suffix}`,
|
||||
passwordHash: '', kind: 'APP_SHOPKEEPER', isActive: true,
|
||||
goldCreditLimitGrams: '100',
|
||||
verificationStep: 'UNVERIFIED',
|
||||
},
|
||||
});
|
||||
made.customers.push(c.id);
|
||||
return c;
|
||||
};
|
||||
|
||||
const cust = await mkCustomer('11', 'مشتری مدارک');
|
||||
console.log(` customer: ${cust.fullName} (${cust.mobile}) step=${cust.verificationStep}`);
|
||||
|
||||
const expertAdmin = await prisma.adminUser.create({
|
||||
data: {
|
||||
fullName: 'کارشناس مدارک', firstName: 'کارشناس', lastName: 'مدارک',
|
||||
mobile: `0918${uniq.slice(0, 3)}22`,
|
||||
passwordHash: '', role: 'SALES_EXPERT', isActive: true, wagePercent: '3',
|
||||
},
|
||||
});
|
||||
await prisma.salesExpertProfile.create({
|
||||
data: { adminUserId: expertAdmin.id, gramLevel: '120' },
|
||||
});
|
||||
made.admins.push(expertAdmin.id);
|
||||
|
||||
// ── 5. NO TOKEN ─────────────────────────────────────────────────────────
|
||||
step('5 — both routes require a session');
|
||||
const anonComplete = await call('POST', 'customer/me/complete-profile', {
|
||||
business_license_image_id: 'x', shop_image_id: 'x', ncode_image_id: 'x',
|
||||
});
|
||||
chk(anonComplete.status === 401, `complete-profile with no token -> ${anonComplete.status} (expected 401)`);
|
||||
const anonUpload = await upload(null, 'business-license');
|
||||
chk(anonUpload.status === 401, `documents with no token -> ${anonUpload.status} (expected 401)`);
|
||||
|
||||
// ── SIGN IN ─────────────────────────────────────────────────────────────
|
||||
step('SIGN IN — the customer, through the ordinary app flow');
|
||||
await call('POST', 'customer/auth/request-otp', { username: cust.mobile });
|
||||
const login = await signIn(cust.mobile);
|
||||
chk(login.ok, `verify-otp -> ${login.status}`);
|
||||
const token = login.body?.token;
|
||||
chk(Boolean(token), 'an app token came back');
|
||||
|
||||
// The page opens against /customer/me, which is what the router guard reads.
|
||||
const me = await call('GET', 'customer/me', undefined, token);
|
||||
chk(me.ok, `GET customer/me -> ${me.status}`);
|
||||
chk(me.body?.verificationStep === 'UNVERIFIED',
|
||||
`the page is reachable: verificationStep is ${me.body?.verificationStep}`);
|
||||
|
||||
// ── 2. VALIDATION — the empty state ─────────────────────────────────────
|
||||
step('2 — EMPTY STATE: each document is required');
|
||||
const ids = { business_license_image_id: 'a', shop_image_id: 'b', ncode_image_id: 'c' };
|
||||
for (const key of Object.keys(ids)) {
|
||||
const partial = { ...ids };
|
||||
delete partial[key];
|
||||
const r = await call('POST', 'customer/me/complete-profile', partial, token);
|
||||
chk(r.status === 400 || r.status === 422, `missing ${key} -> ${r.status} (expected 400/422)`);
|
||||
}
|
||||
const allEmpty = await call('POST', 'customer/me/complete-profile', {}, token);
|
||||
chk(allEmpty.status === 400 || allEmpty.status === 422,
|
||||
`an empty body -> ${allEmpty.status} (expected 400/422)`);
|
||||
|
||||
const stillUnverified = await prisma.customer.findUnique({ where: { id: cust.id } });
|
||||
chk(stillUnverified.verificationStep === 'UNVERIFIED',
|
||||
'a rejected submission left the verification step untouched');
|
||||
|
||||
// ── 3. ERROR STATE — an id that names no file ───────────────────────────
|
||||
step('3 — ERROR STATE: an unknown document id is refused');
|
||||
const bogus = await call('POST', 'customer/me/complete-profile', {
|
||||
business_license_image_id: 'no-such-file-id',
|
||||
shop_image_id: 'no-such-file-id',
|
||||
ncode_image_id: 'no-such-file-id',
|
||||
}, token);
|
||||
chk(bogus.status === 400, `unknown ids -> ${bogus.status} (expected 400)`);
|
||||
const afterBogus = await prisma.customer.findUnique({ where: { id: cust.id } });
|
||||
chk(afterBogus.verificationStep === 'UNVERIFIED',
|
||||
'and nothing was written: still UNVERIFIED');
|
||||
chk(afterBogus.businessLicenseUrl === null,
|
||||
'and no document URL was stored');
|
||||
|
||||
// ── 1. MAIN FLOW ────────────────────────────────────────────────────────
|
||||
step('1 — MAIN FLOW: upload three documents, then complete');
|
||||
const licence = await upload(token, 'business-license');
|
||||
chk(licence.ok, `upload the business licence -> ${licence.status}`);
|
||||
const shop = await upload(token, 'shop-image');
|
||||
chk(shop.ok, `upload the shop front -> ${shop.status}`);
|
||||
const ncode = await upload(token, 'national-card');
|
||||
chk(ncode.ok, `upload the national card -> ${ncode.status}`);
|
||||
|
||||
for (const u of [licence, shop, ncode]) if (u.body?.id) made.files.push(u.body.id);
|
||||
|
||||
chk(Boolean(licence.body?.id && licence.body?.url),
|
||||
'each upload answers with an id and a stored url');
|
||||
chk(licence.body?.uploadedByAdminUserId === null,
|
||||
'a customer upload is not attributed to an admin user');
|
||||
|
||||
const done = await call('POST', 'customer/me/complete-profile', {
|
||||
business_license_image_id: licence.body.id,
|
||||
shop_image_id: shop.body.id,
|
||||
ncode_image_id: ncode.body.id,
|
||||
}, token);
|
||||
chk(done.ok, `complete-profile -> ${done.status}`);
|
||||
|
||||
const after = await prisma.customer.findUnique({ where: { id: cust.id } });
|
||||
chk(after.verificationStep === 'VERIFIED',
|
||||
`the step moved to the reference's live value (VERIFIED), got ${after.verificationStep}`);
|
||||
chk(after.businessLicenseUrl === licence.body.url, 'the business licence url was stored');
|
||||
chk(after.shopImageUrl === shop.body.url, 'the shop front url was stored');
|
||||
chk(after.nationalIdImageUrl === ncode.body.url, 'the national card url was stored');
|
||||
|
||||
// The router guard must now keep the page shut.
|
||||
const meAfter = await call('GET', 'customer/me', undefined, token);
|
||||
chk(meAfter.body?.verificationStep === 'VERIFIED',
|
||||
'the app now reads VERIFIED, so the guard redirects the page home');
|
||||
|
||||
// ── 7. SEC-14 — extra fields are ignored, not mass-assigned ─────────────
|
||||
step('7 — SEC-14: extra body fields are IGNORED, not written to the row');
|
||||
const before = await prisma.customer.findUnique({ where: { id: cust.id } });
|
||||
const inject = await call('POST', 'customer/me/complete-profile', {
|
||||
business_license_image_id: licence.body.id,
|
||||
shop_image_id: shop.body.id,
|
||||
ncode_image_id: ncode.body.id,
|
||||
// Every one of these was writable through the reference's $request->all().
|
||||
goldCreditLimitGrams: '999999',
|
||||
gram_level: '999999',
|
||||
goldDebtGrams: '-500',
|
||||
makingChargeOffsetPercent: '0',
|
||||
isActive: false,
|
||||
mobile: '09000000000',
|
||||
}, token);
|
||||
chk(inject.status === 400 || inject.ok,
|
||||
`a body with extra fields -> ${inject.status}`);
|
||||
|
||||
const poked = await prisma.customer.findUnique({ where: { id: cust.id } });
|
||||
chk(String(poked.goldCreditLimitGrams) === String(before.goldCreditLimitGrams),
|
||||
`the credit limit is unchanged (${poked.goldCreditLimitGrams})`);
|
||||
chk(String(poked.goldDebtGrams) === String(before.goldDebtGrams),
|
||||
`the gold debt is unchanged (${poked.goldDebtGrams})`);
|
||||
chk(String(poked.makingChargeOffsetPercent) === String(before.makingChargeOffsetPercent),
|
||||
`the making charge is unchanged (${poked.makingChargeOffsetPercent})`);
|
||||
chk(poked.isActive === before.isActive, 'isActive is unchanged');
|
||||
chk(poked.mobile === before.mobile, `the mobile is unchanged (${poked.mobile})`);
|
||||
|
||||
// ── 4. THE SUBJECT COMES FROM THE TOKEN ─────────────────────────────────
|
||||
step('4 — the customer comes from the TOKEN, never from the body');
|
||||
const victim = await mkCustomer('44', 'مشتری دیگر');
|
||||
const victimBefore = await prisma.customer.findUnique({ where: { id: victim.id } });
|
||||
chk(victimBefore.verificationStep === 'UNVERIFIED', 'the second customer starts UNVERIFIED');
|
||||
|
||||
await call('POST', 'customer/me/complete-profile', {
|
||||
business_license_image_id: licence.body.id,
|
||||
shop_image_id: shop.body.id,
|
||||
ncode_image_id: ncode.body.id,
|
||||
// Both spellings, in case either were read.
|
||||
customerId: victim.id,
|
||||
customer_id: victim.id,
|
||||
id: victim.id,
|
||||
}, token);
|
||||
|
||||
const victimAfter = await prisma.customer.findUnique({ where: { id: victim.id } });
|
||||
chk(victimAfter.verificationStep === 'UNVERIFIED',
|
||||
"naming another customer in the body did NOT touch their row");
|
||||
chk(victimAfter.businessLicenseUrl === null,
|
||||
'and stored no document against them');
|
||||
|
||||
// ── 6. AN EXPERT CAN COMPLETE THEIR OWN PROFILE ─────────────────────────
|
||||
step('6 — D21: the same page works for a sales expert');
|
||||
await call('POST', 'customer/auth/request-otp', { username: expertAdmin.mobile });
|
||||
const expLogin = await signIn(expertAdmin.mobile);
|
||||
chk(expLogin.ok, `the expert signs in -> ${expLogin.status}`);
|
||||
const expToken = expLogin.body?.token;
|
||||
|
||||
const prof = await prisma.salesExpertProfile.findUnique({ where: { adminUserId: expertAdmin.id } });
|
||||
if (prof?.tradingCustomerId) made.customers.push(prof.tradingCustomerId);
|
||||
|
||||
const expUpload = await upload(expToken, 'business-license');
|
||||
chk(expUpload.ok, `the expert uploads a document -> ${expUpload.status}`);
|
||||
if (expUpload.body?.id) made.files.push(expUpload.body.id);
|
||||
|
||||
const expDone = await call('POST', 'customer/me/complete-profile', {
|
||||
business_license_image_id: expUpload.body.id,
|
||||
shop_image_id: expUpload.body.id,
|
||||
ncode_image_id: expUpload.body.id,
|
||||
}, expToken);
|
||||
chk(expDone.ok, `the expert completes their profile -> ${expDone.status}`);
|
||||
|
||||
const expTrading = prof?.tradingCustomerId
|
||||
? await prisma.customer.findUnique({ where: { id: prof.tradingCustomerId } })
|
||||
: null;
|
||||
chk(expTrading?.verificationStep === 'VERIFIED',
|
||||
'it landed on the expert\'s own trading account, not on anyone else');
|
||||
|
||||
// ── CLEANUP ─────────────────────────────────────────────────────────────
|
||||
step('CLEANUP');
|
||||
await prisma.uploadedFile.deleteMany({ where: { id: { in: made.files } } });
|
||||
await prisma.customerOtp.deleteMany({ where: { customerId: { in: made.customers } } });
|
||||
await prisma.salesExpertProfile.deleteMany({ where: { adminUserId: { in: made.admins } } });
|
||||
await prisma.customer.deleteMany({ where: { id: { in: made.customers } } });
|
||||
await prisma.adminUser.deleteMany({ where: { id: { in: made.admins } } });
|
||||
console.log(
|
||||
` deleted ${made.files.length} uploaded-file row(s), ${made.customers.length} customer(s) ` +
|
||||
`(including the expert trading account this run created) and ${made.admins.length} admin user(s). ` +
|
||||
'All were created by this run; no pre-existing data was touched. ' +
|
||||
'The uploaded blobs themselves are left on disk, as every other test does.',
|
||||
);
|
||||
|
||||
console.log(`\n${'='.repeat(60)}`);
|
||||
console.log(`COMPLETE PROFILE: passed ${pass} failed ${fail}`);
|
||||
if (fail) { console.log('\nFailures:'); failures.forEach((f) => console.log(' - ' + f)); }
|
||||
console.log('='.repeat(60));
|
||||
|
||||
await prisma.$disconnect();
|
||||
process.exit(fail ? 1 : 0);
|
||||
})().catch(async (e) => {
|
||||
console.error('\nABORTED:', e);
|
||||
await prisma.$disconnect();
|
||||
process.exit(1);
|
||||
});
|
||||
@@ -4,6 +4,7 @@ import { CatalogModule } from './modules/catalog/catalog.module';
|
||||
import { CustomersModule } from './modules/customers/customers.module';
|
||||
import { CustomerAuthModule } from './modules/customer-auth/customer-auth.module';
|
||||
import { SalesExpertAppModule } from './modules/sales-expert-app/sales-expert-app.module';
|
||||
import { CustomerProfileModule } from './modules/customer-profile/customer-profile.module';
|
||||
import { SmsModule } from './modules/sms/sms.module';
|
||||
import { OrdersModule } from './modules/orders/orders.module';
|
||||
import { AccountingModule } from './modules/accounting/accounting.module';
|
||||
@@ -54,6 +55,7 @@ import { SalesAgentModule } from './modules/sales-agent/sales-agent.module';
|
||||
SmsModule,
|
||||
CustomerAuthModule,
|
||||
SalesExpertAppModule,
|
||||
CustomerProfileModule,
|
||||
SalesAgentModule,
|
||||
OrdersModule,
|
||||
AccountingModule,
|
||||
|
||||
@@ -22,6 +22,33 @@ async function bootstrap() {
|
||||
// no longer stops the boot; messages are logged instead of sent.
|
||||
assertSmsConfigured();
|
||||
|
||||
// A missing JWT_CUSTOMER_SECRET is not a cosmetic default: customerJwtSecret()
|
||||
// falls back to JWT_SECRET, so admin and app tokens end up signed with the
|
||||
// SAME key. The `typ` check in JwtStrategy is then the only thing keeping an
|
||||
// app token off the admin routes — one guard instead of two independent ones,
|
||||
// and a sales expert's app token carries their AdminUser id in `sub`. Warn as
|
||||
// loudly as the master-code banner rather than fail the boot, so a running
|
||||
// deployment that has not set it yet still starts.
|
||||
if (!process.env.JWT_CUSTOMER_SECRET?.trim()) {
|
||||
const sharedWithAdmin = Boolean(process.env.JWT_SECRET?.trim());
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(
|
||||
'\n' +
|
||||
'='.repeat(72) +
|
||||
'\n ⚠ JWT_CUSTOMER_SECRET تنظیم نشده است\n' +
|
||||
' ⚠ JWT_CUSTOMER_SECRET IS NOT SET.\n' +
|
||||
(sharedWithAdmin
|
||||
? ' ⚠ Customer/expert app tokens are being signed with JWT_SECRET,\n' +
|
||||
' ⚠ the SAME key as admin tokens. The two token realms are no\n' +
|
||||
' ⚠ longer cryptographically separated.\n'
|
||||
: ' ⚠ Neither JWT_SECRET nor JWT_CUSTOMER_SECRET is set, so app\n' +
|
||||
' ⚠ tokens are signed with a well-known development string.\n') +
|
||||
' ⚠ Set JWT_CUSTOMER_SECRET to a distinct random value before release.\n' +
|
||||
'='.repeat(72) +
|
||||
'\n',
|
||||
);
|
||||
}
|
||||
|
||||
// D20 — a loud, unmissable banner whenever the delivery bypass is armed, so
|
||||
// it cannot reach the real release unnoticed.
|
||||
if (masterOtpEnabled()) {
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
import {
|
||||
Controller,
|
||||
HttpCode,
|
||||
Post,
|
||||
UploadedFile,
|
||||
UseInterceptors,
|
||||
} from '@nestjs/common';
|
||||
import { Body } from '@nestjs/common';
|
||||
import { FileInterceptor } from '@nestjs/platform-express';
|
||||
import { CustomerProfileService } from './customer-profile.service';
|
||||
import { AdminUploadsService } from '../admin-uploads/admin-uploads.service';
|
||||
import { CompleteProfileDto } from './dto/complete-profile.dto';
|
||||
import { CurrentCustomer, CustomerAuth } from '../customer-auth/customer.guards';
|
||||
import type { AuthenticatedCustomer } from '../customer-auth/customer-jwt.strategy';
|
||||
|
||||
/** See AdminUploadsController — the same locally-declared multer subset. */
|
||||
interface UploadedMulterFile {
|
||||
originalname: string;
|
||||
mimetype: string;
|
||||
size: number;
|
||||
buffer: Buffer;
|
||||
}
|
||||
|
||||
/**
|
||||
* The customer's own profile writes.
|
||||
*
|
||||
* Legacy endpoints:
|
||||
* POST file/create -> the PWA's SingleImageUploader posted here with the
|
||||
* customer token (routes/api.php:95, inside the
|
||||
* `auth:api-customer` group)
|
||||
* POST major/complete -> Major\CustomerController::complete
|
||||
* (routes/api.php:114)
|
||||
*
|
||||
* Both are mounted under /customer/me here so the customer surface stays in one
|
||||
* place. The subject always comes from the token — no id is accepted from the
|
||||
* client, per D21.
|
||||
*/
|
||||
@Controller('customer/me')
|
||||
export class CustomerProfileController {
|
||||
constructor(
|
||||
private readonly profile: CustomerProfileService,
|
||||
private readonly uploads: AdminUploadsService,
|
||||
) {}
|
||||
|
||||
/**
|
||||
* A customer uploading one of their own documents.
|
||||
*
|
||||
* The reference let the app upload through the very same `file/create` the
|
||||
* admin panel used, behind the customer guard (routes/api.php:95). The
|
||||
* target's copy of that route sits behind an ADMIN guard
|
||||
* (AdminUploadsController), which no app token can pass — so without this
|
||||
* route the page could not upload at all.
|
||||
*
|
||||
* It reuses AdminUploadsService unchanged, so the size limit, the MIME
|
||||
* whitelist and the stored-name scheme are identical on both paths. The
|
||||
* uploader is recorded as null rather than as an admin, because
|
||||
* `UploadedFile.uploadedByAdminUserId` is an AdminUser FK and this caller is
|
||||
* a customer; `purpose` carries the document kind instead.
|
||||
*/
|
||||
@CustomerAuth()
|
||||
@Post('documents')
|
||||
@HttpCode(200)
|
||||
@UseInterceptors(FileInterceptor('file'))
|
||||
upload(
|
||||
@UploadedFile() file: UploadedMulterFile | undefined,
|
||||
@Body('purpose') purpose: string | undefined,
|
||||
@CurrentCustomer() _me: AuthenticatedCustomer,
|
||||
) {
|
||||
return this.uploads.store(file, purpose ?? 'customer-document', null);
|
||||
}
|
||||
|
||||
/** Ports POST major/complete. The customer is the token's. */
|
||||
@CustomerAuth()
|
||||
@Post('complete-profile')
|
||||
@HttpCode(200)
|
||||
complete(@Body() dto: CompleteProfileDto, @CurrentCustomer() me: AuthenticatedCustomer) {
|
||||
return this.profile.complete(me.id, dto);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { PrismaModule } from '../../prisma/prisma.module';
|
||||
import { SmsModule } from '../sms/sms.module';
|
||||
import { AdminUploadsModule } from '../admin-uploads/admin-uploads.module';
|
||||
import { CustomerProfileController } from './customer-profile.controller';
|
||||
import { CustomerProfileService } from './customer-profile.service';
|
||||
|
||||
/**
|
||||
* The customer's own profile writes ("تکمیل پروفایل").
|
||||
*
|
||||
* AdminUploadsModule is imported for its service only — the controller reuses
|
||||
* it so both upload paths share one implementation, rather than for its
|
||||
* admin-guarded routes.
|
||||
*/
|
||||
@Module({
|
||||
imports: [PrismaModule, SmsModule, AdminUploadsModule],
|
||||
controllers: [CustomerProfileController],
|
||||
providers: [CustomerProfileService],
|
||||
})
|
||||
export class CustomerProfileModule {}
|
||||
@@ -0,0 +1,126 @@
|
||||
import { BadRequestException, Injectable, Logger, NotFoundException } from '@nestjs/common';
|
||||
import { PrismaService } from '../../prisma/prisma.service';
|
||||
import { SmsService } from '../sms/sms.service';
|
||||
import { CompleteProfileDto } from './dto/complete-profile.dto';
|
||||
|
||||
/**
|
||||
* "تکمیل پروفایل" — the customer uploads their three documents.
|
||||
*
|
||||
* Ports henza_server Major/CustomerController::complete
|
||||
* (app/Http/Controllers/Major/CustomerController.php:73-108), reached from the
|
||||
* PWA at POST /major/complete (completeProfile.vue:193).
|
||||
*
|
||||
* Reference behaviour kept:
|
||||
* - all three document ids are required (:75-79); a miss is a 422
|
||||
* - the customer is taken from the session (`auth('api-customer')->id()`, :86)
|
||||
* - the verification step is set to the reference's post-change value 2,
|
||||
* i.e. approved outright, NOT "waiting for an expert" — the reference's
|
||||
* own `$input['sts_verify_step_two'] = 1;` line is commented out at :83
|
||||
* in favour of `= 2` at :85. Here that is VerificationStep.VERIFIED.
|
||||
* - the customer SMS and the admin SMS, both byte-identical (:97-105)
|
||||
*
|
||||
* Reference behaviour deliberately NOT ported, both recorded in ISSUES.md:
|
||||
* - SEC-14: `$customer->update($request->all())` mass-assigned the entire
|
||||
* request body onto the customer row, so the app could set `gram_level`,
|
||||
* `percent`, `active` or `remain` on itself. Only the three document ids
|
||||
* are read here.
|
||||
* - SEC-15: the four admin mobiles were hardcoded in the source
|
||||
* (sendSmsToAdmin, :110-112). They come from PROFILE_ADMIN_MOBILES here,
|
||||
* so no personal number is committed to this repository.
|
||||
*/
|
||||
@Injectable()
|
||||
export class CustomerProfileService {
|
||||
private readonly logger = new Logger(CustomerProfileService.name);
|
||||
|
||||
constructor(
|
||||
private readonly prisma: PrismaService,
|
||||
private readonly sms: SmsService,
|
||||
) {}
|
||||
|
||||
/**
|
||||
* The admins who are told a customer uploaded their documents.
|
||||
*
|
||||
* The reference hardcoded four numbers; this reads a comma-separated env var
|
||||
* instead. Unset means nobody is notified, and the customer's own SMS and the
|
||||
* upload itself still go through — consistent with D20, where SMS never
|
||||
* blocks an operation.
|
||||
*/
|
||||
private adminMobiles(): string[] {
|
||||
return (process.env.PROFILE_ADMIN_MOBILES ?? '')
|
||||
.split(',')
|
||||
.map((m) => m.trim())
|
||||
.filter(Boolean);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves an uploaded-file id to its stored URL.
|
||||
*
|
||||
* The reference stored the raw id in the customer row and joined to `files`
|
||||
* on read; the target's Customer columns hold URLs
|
||||
* (`nationalIdImageUrl`, `businessLicenseUrl`, `shopImageUrl`), so the id is
|
||||
* resolved here. An id that names no file is a 400 rather than a silent
|
||||
* null, so a half-completed profile can never be marked verified.
|
||||
*/
|
||||
private async urlOf(id: string, label: string): Promise<string> {
|
||||
const file = await this.prisma.uploadedFile.findUnique({ where: { id } });
|
||||
if (!file) throw new BadRequestException(`${label} یافت نشد`);
|
||||
return file.url;
|
||||
}
|
||||
|
||||
async complete(customerId: string, dto: CompleteProfileDto) {
|
||||
const customer = await this.prisma.customer.findUnique({ where: { id: customerId } });
|
||||
if (!customer) throw new NotFoundException('مشتری یافت نشد');
|
||||
|
||||
// Resolved before the write, so a bad id fails the whole call.
|
||||
const [businessLicenseUrl, shopImageUrl, nationalIdImageUrl] = await Promise.all([
|
||||
this.urlOf(dto.business_license_image_id, 'تصویر جواز کسب'),
|
||||
this.urlOf(dto.shop_image_id, 'تصویر سردر مغازه'),
|
||||
this.urlOf(dto.ncode_image_id, 'تصویر کارت ملی'),
|
||||
]);
|
||||
|
||||
const updated = await this.prisma.customer.update({
|
||||
where: { id: customerId },
|
||||
data: {
|
||||
businessLicenseUrl,
|
||||
shopImageUrl,
|
||||
nationalIdImageUrl,
|
||||
// The reference's live value: 2, approved outright (:85).
|
||||
verificationStep: 'VERIFIED',
|
||||
},
|
||||
});
|
||||
|
||||
this.notify(updated.mobile, updated.firstName ?? '', updated.lastName ?? '');
|
||||
|
||||
// The reference answered a bare `true` (:107); the app only checks that the
|
||||
// call succeeded (completeProfile.vue:193-194).
|
||||
return { ok: true };
|
||||
}
|
||||
|
||||
/**
|
||||
* Both messages, fire-and-forget.
|
||||
*
|
||||
* D20: a failed or unconfigured SMS must never fail the upload, so nothing
|
||||
* here is awaited and every rejection is swallowed into the log. The
|
||||
* reference likewise queued them (SendSmsAfterCreate::dispatch, :100).
|
||||
*/
|
||||
private notify(mobile: string, firstName: string, lastName: string) {
|
||||
// Byte-identical to Major/CustomerController::complete:97-99.
|
||||
const message =
|
||||
'هنزا گلد\n' +
|
||||
`همکار گرامی ${firstName} ${lastName}\n` +
|
||||
'تکمیل پروفایل شما با موفقیت انجام شد.';
|
||||
|
||||
// Byte-identical to :103-105.
|
||||
const adminMessage =
|
||||
'هنزا گلد\n' + `مشتری با نام ${firstName} ${lastName}` + ' مدارک خود را بارگذاری کرد.';
|
||||
|
||||
const fire = (to: string, body: string) => {
|
||||
void this.sms.send(to, body).catch((e: unknown) => {
|
||||
this.logger.error(`Complete-profile SMS to ${to} failed: ${String(e)}`);
|
||||
});
|
||||
};
|
||||
|
||||
fire(mobile, message);
|
||||
for (const admin of this.adminMobiles()) fire(admin, adminMessage);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
import { IsNotEmpty, IsString, MaxLength } from 'class-validator';
|
||||
|
||||
/**
|
||||
* Body of POST customer/me/complete-profile.
|
||||
*
|
||||
* The three ids are the reference's exactly
|
||||
* (henza_server Major/CustomerController::complete:73-79):
|
||||
*
|
||||
* 'business_license_image_id' => 'required',
|
||||
* 'shop_image_id' => 'required',
|
||||
* 'ncode_image_id' => 'required',
|
||||
*
|
||||
* and the PWA sends those same three keys (completeProfile.vue:136-140, :193).
|
||||
* They are kept verbatim rather than camelCased so the app's payload is
|
||||
* byte-identical to the reference's.
|
||||
*
|
||||
* Deliberately NOT accepted: anything else. The reference did
|
||||
* `$customer->update($request->all())` (:87), so ANY column the caller named —
|
||||
* `gram_level`, `percent`, `active`, `remain` — was written straight onto the
|
||||
* customer row from the app. That is a privilege-escalation and money hole, not
|
||||
* a feature, so only these three ids are read (whitelist, not mass-assign).
|
||||
* Recorded in ISSUES.md as SEC-14.
|
||||
*/
|
||||
export class CompleteProfileDto {
|
||||
@IsString()
|
||||
@IsNotEmpty({ message: 'تصویر جواز کسب الزامی است' })
|
||||
@MaxLength(64)
|
||||
business_license_image_id!: string;
|
||||
|
||||
@IsString()
|
||||
@IsNotEmpty({ message: 'تصویر سردر مغازه الزامی است' })
|
||||
@MaxLength(64)
|
||||
shop_image_id!: string;
|
||||
|
||||
@IsString()
|
||||
@IsNotEmpty({ message: 'تصویر کارت ملی الزامی است' })
|
||||
@MaxLength(64)
|
||||
ncode_image_id!: string;
|
||||
}
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{d as f,o as v,p as g,c as s,l as e,s as u,g as p,h as m,f as t,F as y,r as P,I as k,b as C,e as b,v as h,J as x,j as B,_ as V}from"./index-D7u32dbn.js";import{P as w}from"./PageBar-CihrRnwd.js";import{a as I}from"./Spinner.vue_vue_type_style_index_0_lang-Ce4r_sA4.js";import{S as N}from"./SectionHead-CZ7O6-xd.js";import{P as F}from"./ProductCard-Ccapyn--.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./SingleProduct-BYO4_Jip.js";import"./NotifyVant.vue_vue_type_script_setup_true_lang-I8IV1V1D.js";import"./index-CnhrxceM.js";import"./DialogVant.vue_vue_type_style_index_0_lang-CVN0TLHx.js";import"./cartStore-B3Iy7abs.js";import"./dialogEmpty1-Caw7F5KL.js";import"./index-CGMkzVe8.js";import"./classCallCheck-BIPEroH2.js";const S={class:"coll"},j={key:0,class:"coll__grid"},q={key:1,class:"coll__empty"},z=f({__name:"CollectionView",setup(E){const l=x(),o=p(!1),n=p([]),d=m(()=>l.query.page||"مجموعه"),r=m(()=>n.value.filter(c=>c.collections.some(a=>a.collectionId===l.params.id)));return v(async()=>{o.value=!0;try{n.value=await g.listProducts()}finally{o.value=!1}}),(c,a)=>{const _=h("container");return t(),s("div",S,[e(w,{title:d.value,"back-to":"search"},null,8,["title"]),e(I,{spinning:o.value,tip:"درحال دریافت اطلاعات"},{default:u(()=>[e(_,{class:"coll__body"},{default:u(()=>[e(N,{title:"محصولات این مجموعه",subtitle:"برای دیدن جزئیات، روی محصول ضربه بزنید"}),r.value.length?(t(),s("div",j,[(t(!0),s(y,null,P(r.value,i=>(t(),B(F,{key:i.id,value:i},null,8,["value"]))),128))])):o.value?b("",!0):(t(),s("section",q,[e(k,{icon:"vuesax-linear:box",size:"26"}),a[0]||(a[0]=C("p",null,"در این مجموعه محصولی ثبت نشده است.",-1))]))]),_:1})]),_:1},8,["spinning"])])}}}),W=V(z,[["__scopeId","data-v-6fdc1b6f"]]);export{W as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{d as f,o as v,p as g,c as s,l as e,s as u,g as p,h as d,f as t,F as y,r as P,I as k,b as C,e as b,v as h,J as x,j as B,_ as V}from"./index-l-_Vq2SS.js";import{P as w}from"./PageBar-D_td2wAz.js";import{a as I}from"./Spinner.vue_vue_type_style_index_0_lang-BnT11ju8.js";import{S as N}from"./SectionHead-zQgtsjBU.js";import{P as F}from"./ProductCard-BM6pOJQZ.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./SingleProduct-CD0WkR4b.js";import"./NotifyVant.vue_vue_type_script_setup_true_lang-CuI1q2lG.js";import"./DialogVant.vue_vue_type_style_index_0_lang-BjHJx5gQ.js";import"./cartStore-BjOjwx0l.js";import"./dialogEmpty1-Caw7F5KL.js";import"./index-CBcXlm9y.js";import"./classCallCheck-Cr5U1qnj.js";const S={class:"coll"},j={key:0,class:"coll__grid"},q={key:1,class:"coll__empty"},z=f({__name:"CollectionView",setup(E){const l=x(),o=p(!1),n=p([]),m=d(()=>l.query.page||"مجموعه"),c=d(()=>n.value.filter(r=>r.collections.some(a=>a.collectionId===l.params.id)));return v(async()=>{o.value=!0;try{n.value=await g.listProducts()}finally{o.value=!1}}),(r,a)=>{const _=h("container");return t(),s("div",S,[e(w,{title:m.value,"back-to":"search"},null,8,["title"]),e(I,{spinning:o.value,tip:"درحال دریافت اطلاعات"},{default:u(()=>[e(_,{class:"coll__body"},{default:u(()=>[e(N,{title:"محصولات این مجموعه",subtitle:"برای دیدن جزئیات، روی محصول ضربه بزنید"}),c.value.length?(t(),s("div",j,[(t(!0),s(y,null,P(c.value,i=>(t(),B(F,{key:i.id,value:i},null,8,["value"]))),128))])):o.value?b("",!0):(t(),s("section",q,[e(k,{icon:"vuesax-linear:box",size:"26"}),a[0]||(a[0]=C("p",null,"در این مجموعه محصولی ثبت نشده است.",-1))]))]),_:1})]),_:1},8,["spinning"])])}}}),U=V(z,[["__scopeId","data-v-6fdc1b6f"]]);export{U as default};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
.siu__input[data-v-61170337]{display:none}.siu__box[data-v-61170337]{position:relative;width:100%;padding:18px 2px;display:flex;flex-direction:row-reverse;align-items:center;justify-content:flex-end;gap:12px;border:none;border-bottom:1px solid #ECEDEF;background:transparent;font-family:inherit;text-align:right;cursor:pointer;overflow:hidden}.siu__box[data-v-61170337]:disabled{cursor:progress}.siu__box[data-v-61170337]:active{opacity:.75}.is-done .siu__box[data-v-61170337]{border-bottom-color:#16a34a}.is-error .siu__box[data-v-61170337]{border-bottom-color:#dc2626}.siu__preview[data-v-61170337]{width:46px;height:46px;flex:0 0 auto;-o-object-fit:cover;object-fit:cover;border-radius:12px;order:-1}.siu__icon[data-v-61170337]{display:flex;flex:0 0 auto;align-items:center;justify-content:center;width:46px;height:46px;border-radius:12px;background:#fafafa;color:#5b616e;order:-1}.siu__text[data-v-61170337]{flex:1;font-size:13.5px;font-weight:600;color:#14161a}.siu__badge[data-v-61170337]{flex:0 0 auto;display:flex;color:#16a34a}.siu__error[data-v-61170337]{margin:7px 2px 0;font-size:12px;color:#dc2626}.cpf__body[data-v-c1854a08]{padding-top:84px;padding-bottom:110px}.cpf__lead[data-v-c1854a08]{margin:4px 0 6px;font-size:13px;color:#5b616e}.cpf__form[data-v-c1854a08]{display:flex;flex-direction:column}.cpf__error[data-v-c1854a08]{margin:12px 2px 0;font-size:12.5px;color:#dc2626}.cpf__submit[data-v-c1854a08]{position:fixed;left:16px;right:16px;bottom:20px;z-index:20;max-width:736px;margin:0 auto;padding:15px;border:none;border-radius:999px;background:#7a1b33;color:#fff;font-family:inherit;font-size:15px;font-weight:700;cursor:pointer}.cpf__submit[data-v-c1854a08]:disabled{opacity:.6;cursor:progress}.cpf__dialogText[data-v-c1854a08]{padding:20px;line-height:1.9;text-align:justify;font-size:14px}.cpf__dialogBtn[data-v-c1854a08]{text-align:center;cursor:pointer}
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as z,o as S,c,l as a,s as d,u as w,g as r,p as N,f as i,b as s,F as P,r as B,I as u,t as o,e as m,v as D,i as F,_ as I}from"./index-l-_Vq2SS.js";import{P as E}from"./PageBar-D_td2wAz.js";import{a as R}from"./Spinner.vue_vue_type_style_index_0_lang-BnT11ju8.js";import{S as $}from"./SearchInput-nNX6n27O.js";import{D as U}from"./index-CBcXlm9y.js";import{P as L}from"./index-CY8Sc0iT.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./classCallCheck-Cr5U1qnj.js";const M={class:"cch"},O={class:"cch__barExtra"},T={key:0,class:"cch__list"},j=["onClick"],q={class:"cch__head"},A={class:"cch__name"},G={class:"cch__facts"},H={class:"cch__fact"},J={dir:"ltr"},K={class:"cch__fact"},Q={dir:"ltr"},W={key:0,class:"cch__fact"},X={key:1,class:"cch__empty"},Y={key:2,class:"cch__empty"},Z={key:0,class:"cch__detail"},ss={class:"cch__detailTitle"},es={class:"cch__rows"},ts={class:"cch__row"},os={dir:"ltr"},as={class:"cch__row"},ls={dir:"ltr"},ns={class:"cch__row"},cs={class:"cch__row"},is={class:"cch__row"},rs={dir:"ltr"},_s={class:"cch__row"},ds={dir:"ltr"},us={class:"cch__row"},vs=z({__name:"CustomerChoiceView",setup(hs){const _=r([]),v=r(!1),y=r(!1),h=r(!1),b=r(null),p=r(!1),l=r(null);function g(n){const e=Number(n??0);return Number.isFinite(e)?e.toFixed(3):"0.000"}async function f(){v.value=!0,h.value=!1;try{_.value=await N.getExpertCustomers(b.value)}catch{h.value=!0,_.value=[]}finally{v.value=!1}}async function C(n){b.value=n!=null&&n.trim()?n.trim():null,await f()}async function k(){await f(),y.value=!1}function x(n){l.value=n,p.value=!0}return S(f),(n,e)=>{const V=D("container");return i(),c("div",M,[a(E,{title:"لیست مشتریان","back-to":"userPage::hasSubRoute"},{below:d(()=>[s("div",O,[a($,{onSearch:C,"place-holder":"جستجو"})])]),_:1}),a(R,{spinning:v.value&&!_.value.length,tip:"درحال دریافت اطلاعات"},{default:d(()=>[a(w(L),{modelValue:y.value,"onUpdate:modelValue":e[0]||(e[0]=t=>y.value=t),onRefresh:k},{default:d(()=>[a(V,{class:"cch__body"},{default:d(()=>[_.value.length?(i(),c("div",T,[(i(!0),c(P,null,B(_.value,t=>(i(),c("article",{key:t.id,class:"cch__card",onClick:ps=>x(t)},[s("div",q,[s("h3",A,o(t.name),1),s("span",{class:F(["cch__state",t.active===1?"is-on":"is-off"])},o(t.active===1?"فعال":"غیرفعال"),3)]),s("div",G,[s("div",H,[a(u,{icon:"vuesax-linear:mobile",size:"15"}),s("span",J,o(t.mobile||"—"),1)]),s("div",K,[a(u,{icon:"vuesax-linear:call",size:"15"}),s("span",Q,o(t.phone||"—"),1)]),t.store_name?(i(),c("div",W,[a(u,{icon:"vuesax-linear:shop",size:"15"}),s("span",null,o(t.store_name),1)])):m("",!0)])],8,j))),128))])):!v.value&&!h.value?(i(),c("section",X,[a(u,{icon:"vuesax-linear:profile-2user",size:"26"}),s("p",null,o(b.value?"مشتری با این مشخصات پیدا نشد.":"هنوز مشتریای به شما معرفی نشده است."),1)])):m("",!0),h.value?(i(),c("section",Y,[a(u,{icon:"vuesax-linear:danger",size:"26"}),e[3]||(e[3]=s("p",null,"دریافت اطلاعات با خطا روبهرو شد.",-1)),s("button",{type:"button",class:"cch__retry",onClick:f},"تلاش دوباره")])):m("",!0)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["spinning"]),a(w(U),{open:p.value,"onUpdate:open":e[2]||(e[2]=t=>p.value=t),placement:"bottom",height:"auto",closable:!1,"body-style":{padding:"0"}},{default:d(()=>[l.value?(i(),c("div",Z,[s("h2",ss,o(l.value.name),1),s("dl",es,[s("div",ts,[e[4]||(e[4]=s("dt",null,"موبایل",-1)),s("dd",os,o(l.value.mobile||"—"),1)]),s("div",as,[e[5]||(e[5]=s("dt",null,"تلفن",-1)),s("dd",ls,o(l.value.phone||"—"),1)]),s("div",ns,[e[6]||(e[6]=s("dt",null,"نام مغازه",-1)),s("dd",null,o(l.value.store_name||"—"),1)]),s("div",cs,[e[7]||(e[7]=s("dt",null,"نام پاساژ",-1)),s("dd",null,o(l.value.pasazh_name||"—"),1)]),s("div",is,[e[8]||(e[8]=s("dt",null,"سقف اعتبار",-1)),s("dd",rs,o(g(l.value.gram_level))+" گرم",1)]),s("div",_s,[e[9]||(e[9]=s("dt",null,"بدهی گرمی",-1)),s("dd",ds,o(g(l.value.remain))+" گرم",1)]),s("div",us,[e[10]||(e[10]=s("dt",null,"وضعیت",-1)),s("dd",null,o(l.value.active===1?"فعال":"غیرفعال"),1)])]),s("button",{type:"button",class:"cch__close",onClick:e[1]||(e[1]=t=>p.value=!1)},"بستن")])):m("",!0)]),_:1},8,["open"])])}}}),xs=I(vs,[["__scopeId","data-v-e42fd341"]]);export{xs as default};
|
||||
import{d as z,o as S,c,l as a,s as d,u as w,g as r,p as N,f as i,b as s,F as P,r as B,I as u,t as o,e as m,v as D,i as F,_ as I}from"./index-D7u32dbn.js";import{P as E}from"./PageBar-CihrRnwd.js";import{a as R}from"./Spinner.vue_vue_type_style_index_0_lang-Ce4r_sA4.js";import{S as $}from"./SearchInput-CPHlMOl1.js";import{D as U}from"./index-CGMkzVe8.js";import{P as L}from"./index-B7hk2Rd_.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./classCallCheck-BIPEroH2.js";const M={class:"cch"},O={class:"cch__barExtra"},T={key:0,class:"cch__list"},j=["onClick"],q={class:"cch__head"},A={class:"cch__name"},G={class:"cch__facts"},H={class:"cch__fact"},J={dir:"ltr"},K={class:"cch__fact"},Q={dir:"ltr"},W={key:0,class:"cch__fact"},X={key:1,class:"cch__empty"},Y={key:2,class:"cch__empty"},Z={key:0,class:"cch__detail"},ss={class:"cch__detailTitle"},es={class:"cch__rows"},ts={class:"cch__row"},os={dir:"ltr"},as={class:"cch__row"},ls={dir:"ltr"},ns={class:"cch__row"},cs={class:"cch__row"},is={class:"cch__row"},rs={dir:"ltr"},_s={class:"cch__row"},ds={dir:"ltr"},us={class:"cch__row"},vs=z({__name:"CustomerChoiceView",setup(hs){const _=r([]),v=r(!1),y=r(!1),h=r(!1),b=r(null),p=r(!1),l=r(null);function g(n){const e=Number(n??0);return Number.isFinite(e)?e.toFixed(3):"0.000"}async function f(){v.value=!0,h.value=!1;try{_.value=await N.getExpertCustomers(b.value)}catch{h.value=!0,_.value=[]}finally{v.value=!1}}async function C(n){b.value=n!=null&&n.trim()?n.trim():null,await f()}async function k(){await f(),y.value=!1}function x(n){l.value=n,p.value=!0}return S(f),(n,e)=>{const V=D("container");return i(),c("div",M,[a(E,{title:"لیست مشتریان","back-to":"userPage::hasSubRoute"},{below:d(()=>[s("div",O,[a($,{onSearch:C,"place-holder":"جستجو"})])]),_:1}),a(R,{spinning:v.value&&!_.value.length,tip:"درحال دریافت اطلاعات"},{default:d(()=>[a(w(L),{modelValue:y.value,"onUpdate:modelValue":e[0]||(e[0]=t=>y.value=t),onRefresh:k},{default:d(()=>[a(V,{class:"cch__body"},{default:d(()=>[_.value.length?(i(),c("div",T,[(i(!0),c(P,null,B(_.value,t=>(i(),c("article",{key:t.id,class:"cch__card",onClick:ps=>x(t)},[s("div",q,[s("h3",A,o(t.name),1),s("span",{class:F(["cch__state",t.active===1?"is-on":"is-off"])},o(t.active===1?"فعال":"غیرفعال"),3)]),s("div",G,[s("div",H,[a(u,{icon:"vuesax-linear:mobile",size:"15"}),s("span",J,o(t.mobile||"—"),1)]),s("div",K,[a(u,{icon:"vuesax-linear:call",size:"15"}),s("span",Q,o(t.phone||"—"),1)]),t.store_name?(i(),c("div",W,[a(u,{icon:"vuesax-linear:shop",size:"15"}),s("span",null,o(t.store_name),1)])):m("",!0)])],8,j))),128))])):!v.value&&!h.value?(i(),c("section",X,[a(u,{icon:"vuesax-linear:profile-2user",size:"26"}),s("p",null,o(b.value?"مشتری با این مشخصات پیدا نشد.":"هنوز مشتریای به شما معرفی نشده است."),1)])):m("",!0),h.value?(i(),c("section",Y,[a(u,{icon:"vuesax-linear:danger",size:"26"}),e[3]||(e[3]=s("p",null,"دریافت اطلاعات با خطا روبهرو شد.",-1)),s("button",{type:"button",class:"cch__retry",onClick:f},"تلاش دوباره")])):m("",!0)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["spinning"]),a(w(U),{open:p.value,"onUpdate:open":e[2]||(e[2]=t=>p.value=t),placement:"bottom",height:"auto",closable:!1,"body-style":{padding:"0"}},{default:d(()=>[l.value?(i(),c("div",Z,[s("h2",ss,o(l.value.name),1),s("dl",es,[s("div",ts,[e[4]||(e[4]=s("dt",null,"موبایل",-1)),s("dd",os,o(l.value.mobile||"—"),1)]),s("div",as,[e[5]||(e[5]=s("dt",null,"تلفن",-1)),s("dd",ls,o(l.value.phone||"—"),1)]),s("div",ns,[e[6]||(e[6]=s("dt",null,"نام مغازه",-1)),s("dd",null,o(l.value.store_name||"—"),1)]),s("div",cs,[e[7]||(e[7]=s("dt",null,"نام پاساژ",-1)),s("dd",null,o(l.value.pasazh_name||"—"),1)]),s("div",is,[e[8]||(e[8]=s("dt",null,"سقف اعتبار",-1)),s("dd",rs,o(g(l.value.gram_level))+" گرم",1)]),s("div",_s,[e[9]||(e[9]=s("dt",null,"بدهی گرمی",-1)),s("dd",ds,o(g(l.value.remain))+" گرم",1)]),s("div",us,[e[10]||(e[10]=s("dt",null,"وضعیت",-1)),s("dd",null,o(l.value.active===1?"فعال":"غیرفعال"),1)])]),s("button",{type:"button",class:"cch__close",onClick:e[1]||(e[1]=t=>p.value=!1)},"بستن")])):m("",!0)]),_:1},8,["open"])])}}}),xs=I(vs,[["__scopeId","data-v-e42fd341"]]);export{xs as default};
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{d as l,j as n,s as c,u as _,ao as d,f as r,b as t,A as a,D as o,t as i}from"./index-l-_Vq2SS.js";const m={class:"mDialog__body"},g={class:"mDialog__art"},D={class:"mDialog__title"},u={class:"mDialog__actions"},h=l({__name:"DialogVant",props:{timeOut:{},text1:{},text2:{},text3:{}},setup(s){return(e,x)=>(r(),n(_(d),{class:"mDialog"},{default:c(()=>[t("div",m,[t("div",g,[a(e.$slots,"img",{},()=>[o(i(s.text2),1)])]),t("div",D,[a(e.$slots,"title",{},()=>[o(i(s.text1),1)])]),t("div",u,[a(e.$slots,"button",{},()=>[o(i(s.text3),1)])])])]),_:3}))}});export{h as _};
|
||||
import{d as l,j as n,s as c,u as _,ao as d,f as r,b as t,A as a,D as o,t as i}from"./index-D7u32dbn.js";const m={class:"mDialog__body"},g={class:"mDialog__art"},D={class:"mDialog__title"},u={class:"mDialog__actions"},h=l({__name:"DialogVant",props:{timeOut:{},text1:{},text2:{},text3:{}},setup(s){return(e,x)=>(r(),n(_(d),{class:"mDialog"},{default:c(()=>[t("div",m,[t("div",g,[a(e.$slots,"img",{},()=>[o(i(s.text2),1)])]),t("div",D,[a(e.$slots,"title",{},()=>[o(i(s.text1),1)])]),t("div",u,[a(e.$slots,"button",{},()=>[o(i(s.text3),1)])])])]),_:3}))}});export{h as _};
|
||||
@@ -0,0 +1 @@
|
||||
import{d as f,o as g,p as y,c as o,l as e,s as c,g as p,f as t,F as m,b as i,r as b,I as h,u as k,e as P,x as C,h as x,v as F,j as B,_ as V}from"./index-D7u32dbn.js";import{P as w}from"./PageBar-CihrRnwd.js";import{a as S}from"./Spinner.vue_vue_type_style_index_0_lang-Ce4r_sA4.js";import{S as I}from"./SectionHead-CZ7O6-xd.js";import{P as N}from"./ProductCard-Ccapyn--.js";import{a as $}from"./SingleProduct-BYO4_Jip.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./cartStore-B3Iy7abs.js";import"./index-CGMkzVe8.js";import"./classCallCheck-BIPEroH2.js";import"./NotifyVant.vue_vue_type_script_setup_true_lang-I8IV1V1D.js";import"./index-CnhrxceM.js";import"./DialogVant.vue_vue_type_style_index_0_lang-CVN0TLHx.js";import"./dialogEmpty1-Caw7F5KL.js";const R={class:"favs"},j={class:"favs__grid"},z={key:1,class:"favs__empty"},E=f({__name:"FavoritesView",setup(H){const d=C(),v=$(),a=p(!1),l=p([]),r=x(()=>l.value.filter(u=>v.isFavorite(u.id)));return g(async()=>{a.value=!0;try{l.value=await y.listProducts()}finally{a.value=!1}}),(u,s)=>{const _=F("container");return t(),o("div",R,[e(w,{title:"علاقهمندی","back-to":"userPage::hasSubRoute"}),e(S,{spinning:a.value,tip:"در حال دریافت اطلاعات"},{default:c(()=>[e(_,{class:"favs__body"},{default:c(()=>[r.value.length?(t(),o(m,{key:0},[e(I,{title:"ذخیرهشدهها",subtitle:`${r.value.length} محصول`},null,8,["subtitle"]),i("div",j,[(t(!0),o(m,null,b(r.value,n=>(t(),B(N,{key:n.id,value:n},null,8,["value"]))),128))])],64)):a.value?P("",!0):(t(),o("section",z,[e(h,{icon:"vuesax-linear:heart",size:"26"}),s[1]||(s[1]=i("p",null,"هنوز محصولی را به علاقهمندیها اضافه نکردهاید.",-1)),i("button",{type:"button",class:"favs__emptyCta",onClick:s[0]||(s[0]=n=>k(d).push({name:"home"}))}," دیدن محصولات ")]))]),_:1})]),_:1},8,["spinning"])])}}}),Y=V(E,[["__scopeId","data-v-a8e72280"]]);export{Y as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{d as f,o as g,p as y,c as o,l as e,s as c,g as p,f as t,F as m,b as i,r as b,I as h,u as k,e as P,x as C,h as x,v as F,j as B,_ as V}from"./index-l-_Vq2SS.js";import{P as w}from"./PageBar-D_td2wAz.js";import{a as S}from"./Spinner.vue_vue_type_style_index_0_lang-BnT11ju8.js";import{S as I}from"./SectionHead-zQgtsjBU.js";import{P as N}from"./ProductCard-BM6pOJQZ.js";import{a as $}from"./SingleProduct-CD0WkR4b.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./cartStore-BjOjwx0l.js";import"./index-CBcXlm9y.js";import"./classCallCheck-Cr5U1qnj.js";import"./NotifyVant.vue_vue_type_script_setup_true_lang-CuI1q2lG.js";import"./DialogVant.vue_vue_type_style_index_0_lang-BjHJx5gQ.js";import"./dialogEmpty1-Caw7F5KL.js";const R={class:"favs"},j={class:"favs__grid"},z={key:1,class:"favs__empty"},E=f({__name:"FavoritesView",setup(H){const d=C(),v=$(),a=p(!1),l=p([]),r=x(()=>l.value.filter(u=>v.isFavorite(u.id)));return g(async()=>{a.value=!0;try{l.value=await y.listProducts()}finally{a.value=!1}}),(u,s)=>{const _=F("container");return t(),o("div",R,[e(w,{title:"علاقهمندی","back-to":"userPage::hasSubRoute"}),e(S,{spinning:a.value,tip:"در حال دریافت اطلاعات"},{default:c(()=>[e(_,{class:"favs__body"},{default:c(()=>[r.value.length?(t(),o(m,{key:0},[e(I,{title:"ذخیرهشدهها",subtitle:`${r.value.length} محصول`},null,8,["subtitle"]),i("div",j,[(t(!0),o(m,null,b(r.value,n=>(t(),B(N,{key:n.id,value:n},null,8,["value"]))),128))])],64)):a.value?P("",!0):(t(),o("section",z,[e(h,{icon:"vuesax-linear:heart",size:"26"}),s[1]||(s[1]=i("p",null,"هنوز محصولی را به علاقهمندیها اضافه نکردهاید.",-1)),i("button",{type:"button",class:"favs__emptyCta",onClick:s[0]||(s[0]=n=>k(d).push({name:"home"}))}," دیدن محصولات ")]))]),_:1})]),_:1},8,["spinning"])])}}}),X=V(E,[["__scopeId","data-v-a8e72280"]]);export{X as default};
|
||||
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{d,f as o,c as i,l as a,u as c,y as P,z as S,n as b,A as k,j as v,e as y,g as u,p as B,B as C,C as E,s as p,F as L,r as I,I as N,b as V,h as $,v as A,_ as F}from"./index-D7u32dbn.js";import{P as z}from"./PageBar-CihrRnwd.js";import{E as j,a as h}from"./Spinner.vue_vue_type_style_index_0_lang-Ce4r_sA4.js";import{S as D}from"./SectionHead-CZ7O6-xd.js";import{P as H}from"./ProductCard-Ccapyn--.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./SingleProduct-BYO4_Jip.js";import"./NotifyVant.vue_vue_type_script_setup_true_lang-I8IV1V1D.js";import"./index-CnhrxceM.js";import"./DialogVant.vue_vue_type_style_index_0_lang-CVN0TLHx.js";import"./cartStore-B3Iy7abs.js";import"./dialogEmpty1-Caw7F5KL.js";import"./index-CGMkzVe8.js";import"./classCallCheck-BIPEroH2.js";const T={class:"flex justify-center items-center empty"},q=d({__name:"EmptyState",props:{description:{},image:{}},setup(e){return(t,s)=>(o(),i("div",T,[a(c(j),{description:"موردی یافت نشد",image:e.image,class:"h-[200px] w-[200px] opacity-70"},null,8,["image"])]))}}),G="/assets/favoritEmpty-CIK7qR49.svg",K=d({__name:"ScrollFetchSearch",props:{loading:{type:Boolean},flag:{type:Boolean},padding:{}},emits:["fetch"],setup(e,{emit:t}){const s=t,n=P(),r=u(null);return S(r,()=>{s("fetch")},{distance:50}),(l,m)=>(o(),i("main",{class:"flex flex-col flex-1 overflow-auto no-scrollbar w-[100vw] max-w-screen-md m-auto",style:b({paddingTop:e.padding||c(n).headerHeight+"px"}),ref_key:"scrollArea",ref:r},[k(l.$slots,"default"),a(h,{cls:"my-[10px]",spinning:e.loading,indicator:!0,tip:"درحال دریافت اطلاعات"},null,8,["spinning"]),e.flag?(o(),v(q,{key:0,image:c(G)},null,8,["image"])):y("",!0)],4))}});function M(){const e=C({totalPages:0,productList:[],flag:!1});return{productsData:e,getProducts:async(s,n=!1)=>{if(!n){s.value=!0;try{e.productList=await B.listProducts(),e.flag=e.productList.length<1}catch(r){console.log(r)}finally{s.value=!1}}}}}const R={class:"newest"},Z={key:0,class:"newest__grid"},J={key:1,class:"newest__empty"},g=20,O=d({__name:"NewestView",setup(e){const{productsData:t,getProducts:s}=M(),n=u(!1),r=u(!1),l=u(g),m=$(()=>t.productList.slice(0,l.value));E(async()=>{await s(n,!1)});const w=async()=>{if(l.value<t.productList.length){l.value+=g;return}await s(r,!0)};return(Q,f)=>{const x=A("container");return o(),i("div",R,[a(z,{title:"جدیدترین محصولات","back-to":"home"}),a(h,{spinning:n.value,tip:"درحال دریافت اطلاعات"},{default:p(()=>[a(K,{class:"newest__scroll",loading:r.value,flag:c(t).flag,padding:"0px",onFetch:w},{default:p(()=>[a(x,{class:"newest__body"},{default:p(()=>[a(D,{title:"تازهها",subtitle:"آخرین افزودههای مجموعه"}),c(t).productList.length?(o(),i("div",Z,[(o(!0),i(L,null,I(m.value,_=>(o(),v(H,{key:_.id,value:_},null,8,["value"]))),128))])):n.value?y("",!0):(o(),i("section",J,[a(N,{icon:"vuesax-linear:box",size:"26"}),f[0]||(f[0]=V("p",null,"هنوز محصولی در مجموعه ثبت نشده است.",-1))]))]),_:1})]),_:1},8,["loading","flag"])]),_:1},8,["spinning"])])}}}),ue=F(O,[["__scopeId","data-v-ecd416be"]]);export{ue as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{d,f as o,c as i,l as a,u as c,y as P,z as S,n as b,A as k,j as v,e as y,g as u,p as B,B as C,C as E,s as p,F as L,r as I,I as N,b as V,h as $,v as A,_ as F}from"./index-l-_Vq2SS.js";import{P as z}from"./PageBar-D_td2wAz.js";import{E as j,a as h}from"./Spinner.vue_vue_type_style_index_0_lang-BnT11ju8.js";import{S as D}from"./SectionHead-zQgtsjBU.js";import{P as H}from"./ProductCard-BM6pOJQZ.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./SingleProduct-CD0WkR4b.js";import"./NotifyVant.vue_vue_type_script_setup_true_lang-CuI1q2lG.js";import"./DialogVant.vue_vue_type_style_index_0_lang-BjHJx5gQ.js";import"./cartStore-BjOjwx0l.js";import"./dialogEmpty1-Caw7F5KL.js";import"./index-CBcXlm9y.js";import"./classCallCheck-Cr5U1qnj.js";const T={class:"flex justify-center items-center empty"},q=d({__name:"EmptyState",props:{description:{},image:{}},setup(e){return(t,s)=>(o(),i("div",T,[a(c(j),{description:"موردی یافت نشد",image:e.image,class:"h-[200px] w-[200px] opacity-70"},null,8,["image"])]))}}),G="/assets/favoritEmpty-CIK7qR49.svg",K=d({__name:"ScrollFetchSearch",props:{loading:{type:Boolean},flag:{type:Boolean},padding:{}},emits:["fetch"],setup(e,{emit:t}){const s=t,n=P(),r=u(null);return S(r,()=>{s("fetch")},{distance:50}),(l,m)=>(o(),i("main",{class:"flex flex-col flex-1 overflow-auto no-scrollbar w-[100vw] max-w-screen-md m-auto",style:b({paddingTop:e.padding||c(n).headerHeight+"px"}),ref_key:"scrollArea",ref:r},[k(l.$slots,"default"),a(h,{cls:"my-[10px]",spinning:e.loading,indicator:!0,tip:"درحال دریافت اطلاعات"},null,8,["spinning"]),e.flag?(o(),v(q,{key:0,image:c(G)},null,8,["image"])):y("",!0)],4))}});function M(){const e=C({totalPages:0,productList:[],flag:!1});return{productsData:e,getProducts:async(s,n=!1)=>{if(!n){s.value=!0;try{e.productList=await B.listProducts(),e.flag=e.productList.length<1}catch(r){console.log(r)}finally{s.value=!1}}}}}const R={class:"newest"},Z={key:0,class:"newest__grid"},J={key:1,class:"newest__empty"},g=20,O=d({__name:"NewestView",setup(e){const{productsData:t,getProducts:s}=M(),n=u(!1),r=u(!1),l=u(g),m=$(()=>t.productList.slice(0,l.value));E(async()=>{await s(n,!1)});const w=async()=>{if(l.value<t.productList.length){l.value+=g;return}await s(r,!0)};return(Q,f)=>{const x=A("container");return o(),i("div",R,[a(z,{title:"جدیدترین محصولات","back-to":"home"}),a(h,{spinning:n.value,tip:"درحال دریافت اطلاعات"},{default:p(()=>[a(K,{class:"newest__scroll",loading:r.value,flag:c(t).flag,padding:"0px",onFetch:w},{default:p(()=>[a(x,{class:"newest__body"},{default:p(()=>[a(D,{title:"تازهها",subtitle:"آخرین افزودههای مجموعه"}),c(t).productList.length?(o(),i("div",Z,[(o(!0),i(L,null,I(m.value,_=>(o(),v(H,{key:_.id,value:_},null,8,["value"]))),128))])):n.value?y("",!0):(o(),i("section",J,[a(N,{icon:"vuesax-linear:box",size:"26"}),f[0]||(f[0]=V("p",null,"هنوز محصولی در مجموعه ثبت نشده است.",-1))]))]),_:1})]),_:1},8,["loading","flag"])]),_:1},8,["spinning"])])}}}),ce=F(O,[["__scopeId","data-v-ecd416be"]]);export{ce as default};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as a,c as n,l as o,s as i,v as c,f as _,b as e,I as r,_ as f}from"./index-l-_Vq2SS.js";import{P as l}from"./PageBar-D_td2wAz.js";const p={class:"notif"},d={class:"notif__empty"},m=a({__name:"NotificationsView",setup(u){return(v,t)=>{const s=c("container");return _(),n("div",p,[o(l,{title:"اعلانها","back-to":"home"}),o(s,{class:"notif__body"},{default:i(()=>[e("section",d,[o(r,{icon:"vuesax-linear:notification",size:"26"}),t[0]||(t[0]=e("p",null,"اعلانی برای نمایش وجود ندارد.",-1))])]),_:1})])}}}),N=f(m,[["__scopeId","data-v-44d0c9a5"]]);export{N as default};
|
||||
import{d as a,c as n,l as o,s as i,v as c,f as _,b as e,I as r,_ as f}from"./index-D7u32dbn.js";import{P as l}from"./PageBar-CihrRnwd.js";const p={class:"notif"},d={class:"notif__empty"},m=a({__name:"NotificationsView",setup(u){return(v,t)=>{const s=c("container");return _(),n("div",p,[o(l,{title:"اعلانها","back-to":"home"}),o(s,{class:"notif__body"},{default:i(()=>[e("section",d,[o(r,{icon:"vuesax-linear:notification",size:"26"}),t[0]||(t[0]=e("p",null,"اعلانی برای نمایش وجود ندارد.",-1))])]),_:1})])}}}),N=f(m,[["__scopeId","data-v-44d0c9a5"]]);export{N as default};
|
||||
-1
@@ -1 +0,0 @@
|
||||
import{d as r,l as n,ah as p,ai as f,aj as h,ak as w,al as y,am as x,a6 as g,an as i,a5 as k,ad as N,G as S,f as V,c as v,u as P,n as _,s as b,b as l,I as B,A as I,D as z,t as C,e as O,g as D}from"./index-l-_Vq2SS.js";const[T,U]=k("notify"),j=["lockScroll","position","show","teleport","zIndex"],A=w({},y,{type:i("danger"),color:String,message:g,position:i("top"),className:x,background:String,lockScroll:Boolean});var E=r({name:T,props:A,emits:["update:show"],setup(e,{emit:o,slots:t}){const a=s=>o("update:show",s);return()=>n(h,p({class:[U([e.type]),e.className],style:{color:e.color,background:e.background},overlay:!1,duration:.2,"onUpdate:show":a},f(e,j)),{default:()=>[t.default?t.default():e.message]})}});const G=N(E),$={key:0,class:"flex"},q={class:"w-full text-white my-2"},F={class:"w-full flex content-end"},J=r({__name:"NotifyVant",props:{modelValue:{type:Boolean},timeOut:{},text:{},color:{}},emits:["update:modelValue"],setup(e,{emit:o}){const t=D(!0),a=e,s=o;S(()=>a.modelValue,()=>{a.timeOut!==-1&&u()});const u=()=>{setTimeout(()=>{s("update:modelValue",!1)},a.timeOut)};return(d,c)=>e.modelValue?(V(),v("div",$,[n(P(G),{show:t.value,"onUpdate:show":c[0]||(c[0]=m=>t.value=m),style:_(e.color)},{default:b(()=>[l("div",q,[l("div",F,[n(B,{icon:"vuesax-linear:info-circle",class:"ml-[20px] text-white",size:"25"}),l("div",null,[I(d.$slots,"default",{},()=>[z(C(e.text),1)])])])])]),_:3},8,["show","style"])])):O("",!0)}});export{J as _};
|
||||
+1
@@ -0,0 +1 @@
|
||||
import{d as m,G as r,f,c as h,l,u as w,n as x,s as p,b as o,I as y,A as V,D as N,t as v,e as _,g as B}from"./index-D7u32dbn.js";import{N as k}from"./index-CnhrxceM.js";const C={key:0,class:"flex"},O={class:"w-full text-white my-2"},S={class:"w-full flex content-end"},D=m({__name:"NotifyVant",props:{modelValue:{type:Boolean},timeOut:{},text:{},color:{}},emits:["update:modelValue"],setup(e,{emit:n}){const s=B(!0),t=e,i=n;r(()=>t.modelValue,()=>{t.timeOut!==-1&&c()});const c=()=>{setTimeout(()=>{i("update:modelValue",!1)},t.timeOut)};return(u,a)=>e.modelValue?(f(),h("div",C,[l(w(k),{show:s.value,"onUpdate:show":a[0]||(a[0]=d=>s.value=d),style:x(e.color)},{default:p(()=>[o("div",O,[o("div",S,[l(y,{icon:"vuesax-linear:info-circle",class:"ml-[20px] text-white",size:"25"}),o("div",null,[V(u.$slots,"default",{},()=>[N(v(e.text),1)])])])])]),_:3},8,["show","style"])])):_("",!0)}});export{D as _};
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{d as _,c as s,b as a,l as d,I as b,t as u,A as i,f as t,x as p,_ as k}from"./index-l-_Vq2SS.js";const h={class:"bar"},f={class:"bar__inner"},m={key:1,class:"bar__spacer","aria-hidden":"true"},B={class:"bar__title"},g={class:"bar__trailing"},v=_({__name:"PageBar",props:{title:{},back:{type:Boolean,default:!0},backTo:{}},setup(e){const o=e,r=p();function l(){o.backTo?r.push({name:o.backTo}):r.back()}return(n,c)=>(t(),s("header",h,[a("div",f,[e.back?(t(),s("button",{key:0,type:"button",class:"bar__btn","aria-label":"بازگشت",onClick:l},[d(b,{icon:"vuesax-linear:arrow-right-1",size:"20"})])):(t(),s("span",m)),a("h1",B,u(e.title),1),a("div",g,[i(n.$slots,"trailing",{},()=>[c[0]||(c[0]=a("span",{class:"bar__spacer","aria-hidden":"true"},null,-1))],!0)])]),i(n.$slots,"below",{},void 0,!0)]))}}),x=k(v,[["__scopeId","data-v-d2d3dfeb"]]);export{x as P};
|
||||
import{d as _,c as s,b as a,l as d,I as b,t as u,A as i,f as t,x as p,_ as k}from"./index-D7u32dbn.js";const h={class:"bar"},f={class:"bar__inner"},m={key:1,class:"bar__spacer","aria-hidden":"true"},B={class:"bar__title"},g={class:"bar__trailing"},v=_({__name:"PageBar",props:{title:{},back:{type:Boolean,default:!0},backTo:{}},setup(e){const o=e,r=p();function l(){o.backTo?r.push({name:o.backTo}):r.back()}return(n,c)=>(t(),s("header",h,[a("div",f,[e.back?(t(),s("button",{key:0,type:"button",class:"bar__btn","aria-label":"بازگشت",onClick:l},[d(b,{icon:"vuesax-linear:arrow-right-1",size:"20"})])):(t(),s("span",m)),a("h1",B,u(e.title),1),a("div",g,[i(n.$slots,"trailing",{},()=>[c[0]||(c[0]=a("span",{class:"bar__spacer","aria-hidden":"true"},null,-1))],!0)])]),i(n.$slots,"below",{},void 0,!0)]))}}),x=k(v,[["__scopeId","data-v-d2d3dfeb"]]);export{x as P};
|
||||
@@ -1 +0,0 @@
|
||||
import{d as D,k as F,f as t,c as a,F as P,b as o,u as e,w as S,l as p,I as h,Y as z,i as N,e as c,t as _,D as V,s as I,j as E,g as O,_ as U}from"./index-l-_Vq2SS.js";import{a as $,S as j}from"./SingleProduct-CD0WkR4b.js";import{u as q}from"./cartStore-BjOjwx0l.js";import{D as L}from"./index-CBcXlm9y.js";const M={class:"pc__art"},T=["alt"],Y={key:1,class:"pc__artEmpty","aria-hidden":"true"},A=["aria-label"],G={key:2,class:"pc__flag"},H={key:3,class:"pc__flag pc__flag--soft"},J={class:"pc__title"},K={class:"pc__weight"},Q={key:0,class:"pc__meta"},R={key:0,class:"pc__wageOld"},W={class:"pc__wage"},X=D({__name:"ProductCard",props:{value:{},wageBefore:{}},setup(d){const w=d,r=$(),{image:v,id:i,title:f,min_gram:y,wage:m,is_exist:k,qty:b,isPreOrder:x}=q(w.value),l=O(!1);function C(){l.value=!0}function g(n){return n%1===0?String(n):n.toFixed(2)}return(n,s)=>{const B=F("lazy");return t(),a(P,null,[o("article",{class:"pc",onClick:C},[o("div",M,[e(v)?S((t(),a("img",{key:0,alt:e(f)},null,8,T)),[[B,e(v)]]):(t(),a("div",Y,[p(h,{icon:"vuesax-linear:diamonds",size:"26"})])),o("button",{type:"button",class:N(["pc__fav",{"is-on":e(r).isFavorite(e(i))}]),"aria-label":e(r).isFavorite(e(i))?"حذف از علاقهمندی":"افزودن به علاقهمندی",onClick:s[0]||(s[0]=z(u=>e(r).toggle(e(i)),["stop"]))},[p(h,{icon:e(r).isFavorite(e(i))?"vuesax-linear:heart-fill":"vuesax-linear:heart",size:"16"},null,8,["icon"])],10,A),e(k)?e(x)&&e(b)===0?(t(),a("span",H,"پیشسفارش")):c("",!0):(t(),a("span",G,"ناموجود"))]),o("h3",J,_(e(f)),1),o("p",K,[V(_(e(y))+" ",1),s[3]||(s[3]=o("span",{class:"pc__weightUnit"},"گرم",-1))]),e(m)!=null?(t(),a("div",Q,[d.wageBefore!=null?(t(),a("span",R,"اجرت "+_(g(d.wageBefore))+"٪",1)):c("",!0),o("span",W,_(g(e(m)))+"٪ اجرت",1)])):c("",!0)]),p(e(L),{visible:l.value,"onUpdate:visible":s[2]||(s[2]=u=>l.value=u),placement:"bottom",closable:!1,class:"rtl",height:"100vh",bodyStyle:{padding:0,position:"relative"}},{default:I(()=>[l.value?(t(),E(j,{id:e(i),key:e(i),onCloseDrawer:s[1]||(s[1]=u=>l.value=!1)},null,8,["id"])):c("",!0)]),_:1},8,["visible"])],64)}}}),ae=U(X,[["__scopeId","data-v-ed785ed2"]]);export{ae as P};
|
||||
@@ -0,0 +1 @@
|
||||
import{d as D,k as F,f as t,c as a,F as P,b as o,u as e,w as S,l as p,I as h,a4 as z,i as N,e as c,t as _,D as V,s as I,j as E,g as O,_ as U}from"./index-D7u32dbn.js";import{a as $,S as j}from"./SingleProduct-BYO4_Jip.js";import{u as q}from"./cartStore-B3Iy7abs.js";import{D as L}from"./index-CGMkzVe8.js";const M={class:"pc__art"},T=["alt"],A={key:1,class:"pc__artEmpty","aria-hidden":"true"},G=["aria-label"],H={key:2,class:"pc__flag"},J={key:3,class:"pc__flag pc__flag--soft"},K={class:"pc__title"},Q={class:"pc__weight"},R={key:0,class:"pc__meta"},W={key:0,class:"pc__wageOld"},X={class:"pc__wage"},Y=D({__name:"ProductCard",props:{value:{},wageBefore:{}},setup(d){const w=d,r=$(),{image:v,id:i,title:f,min_gram:y,wage:m,is_exist:k,qty:b,isPreOrder:x}=q(w.value),l=O(!1);function C(){l.value=!0}function g(n){return n%1===0?String(n):n.toFixed(2)}return(n,s)=>{const B=F("lazy");return t(),a(P,null,[o("article",{class:"pc",onClick:C},[o("div",M,[e(v)?S((t(),a("img",{key:0,alt:e(f)},null,8,T)),[[B,e(v)]]):(t(),a("div",A,[p(h,{icon:"vuesax-linear:diamonds",size:"26"})])),o("button",{type:"button",class:N(["pc__fav",{"is-on":e(r).isFavorite(e(i))}]),"aria-label":e(r).isFavorite(e(i))?"حذف از علاقهمندی":"افزودن به علاقهمندی",onClick:s[0]||(s[0]=z(u=>e(r).toggle(e(i)),["stop"]))},[p(h,{icon:e(r).isFavorite(e(i))?"vuesax-linear:heart-fill":"vuesax-linear:heart",size:"16"},null,8,["icon"])],10,G),e(k)?e(x)&&e(b)===0?(t(),a("span",J,"پیشسفارش")):c("",!0):(t(),a("span",H,"ناموجود"))]),o("h3",K,_(e(f)),1),o("p",Q,[V(_(e(y))+" ",1),s[3]||(s[3]=o("span",{class:"pc__weightUnit"},"گرم",-1))]),e(m)!=null?(t(),a("div",R,[d.wageBefore!=null?(t(),a("span",W,"اجرت "+_(g(d.wageBefore))+"٪",1)):c("",!0),o("span",X,_(g(e(m)))+"٪ اجرت",1)])):c("",!0)]),p(e(L),{visible:l.value,"onUpdate:visible":s[2]||(s[2]=u=>l.value=u),placement:"bottom",closable:!1,class:"rtl",height:"100vh",bodyStyle:{padding:0,position:"relative"}},{default:I(()=>[l.value?(t(),E(j,{id:e(i),key:e(i),onCloseDrawer:s[1]||(s[1]=u=>l.value=!1)},null,8,["id"])):c("",!0)]),_:1},8,["visible"])],64)}}}),ae=U(Y,[["__scopeId","data-v-ed785ed2"]]);export{ae as P};
|
||||
@@ -0,0 +1 @@
|
||||
.prof[data-v-33e6f62c]{background:#fff;min-height:100vh}.prof__body[data-v-33e6f62c]{padding-top:80px;padding-bottom:90px}.prof__identity[data-v-33e6f62c]{display:flex;flex-direction:column;align-items:center;text-align:center;padding:26px 20px 28px;border:1px solid #ECEDEF;border-radius:20px;background:#fafafa}.prof__avatar[data-v-33e6f62c]{width:72px;height:72px;border-radius:50%;display:grid;place-items:center;color:#7a1b33;background:#fbf2f4}.prof__name[data-v-33e6f62c]{margin:14px 0 0;font-size:15.5px;font-weight:800;color:#14161a}.prof__mobile[data-v-33e6f62c]{margin:6px 0 0;font-size:12.5px;color:#5b616e;direction:ltr}.prof__seal[data-v-33e6f62c]{margin-top:12px;padding:5px 12px;border-radius:999px;font-size:11px;font-weight:700}.prof__seal.is-ok[data-v-33e6f62c]{color:#16a34a;background:#f0fdf4}.prof__seal.is-pending[data-v-33e6f62c]{color:#7a1b33;background:#fbf2f4}.prof__block[data-v-33e6f62c]{margin-top:26px}.prof__specs[data-v-33e6f62c]{margin:0;border:1px solid #ECEDEF;border-radius:18px;overflow:hidden}.prof__spec[data-v-33e6f62c]{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:13px 14px;border-bottom:1px solid #F4F5F6}.prof__spec[data-v-33e6f62c]:last-child{border-bottom:0}.prof__spec dt[data-v-33e6f62c]{margin:0;font-size:12px;color:#8a909c}.prof__spec dd[data-v-33e6f62c]{margin:0;font-size:12.5px;font-weight:700;color:#14161a;text-align:left}.prof__empty[data-v-33e6f62c]{margin-top:26px;padding:34px 20px;border:1px dashed #ECEDEF;border-radius:18px;display:flex;flex-direction:column;align-items:center;gap:10px;color:#8a909c}.prof__empty p[data-v-33e6f62c]{margin:0;font-size:12.5px}.prof__complete[data-v-33e6f62c]{margin-top:24px;width:100%;padding:15px;border:none;border-radius:999px;background:#7a1b33;color:#fff;font-family:inherit;font-size:15px;font-weight:700;cursor:pointer}
|
||||
@@ -1 +0,0 @@
|
||||
.prof[data-v-adfdabd9]{background:#fff;min-height:100vh}.prof__body[data-v-adfdabd9]{padding-top:80px;padding-bottom:90px}.prof__identity[data-v-adfdabd9]{display:flex;flex-direction:column;align-items:center;text-align:center;padding:26px 20px 28px;border:1px solid #ECEDEF;border-radius:20px;background:#fafafa}.prof__avatar[data-v-adfdabd9]{width:72px;height:72px;border-radius:50%;display:grid;place-items:center;color:#7a1b33;background:#fbf2f4}.prof__name[data-v-adfdabd9]{margin:14px 0 0;font-size:15.5px;font-weight:800;color:#14161a}.prof__mobile[data-v-adfdabd9]{margin:6px 0 0;font-size:12.5px;color:#5b616e;direction:ltr}.prof__seal[data-v-adfdabd9]{margin-top:12px;padding:5px 12px;border-radius:999px;font-size:11px;font-weight:700}.prof__seal.is-ok[data-v-adfdabd9]{color:#16a34a;background:#f0fdf4}.prof__seal.is-pending[data-v-adfdabd9]{color:#7a1b33;background:#fbf2f4}.prof__block[data-v-adfdabd9]{margin-top:26px}.prof__specs[data-v-adfdabd9]{margin:0;border:1px solid #ECEDEF;border-radius:18px;overflow:hidden}.prof__spec[data-v-adfdabd9]{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:13px 14px;border-bottom:1px solid #F4F5F6}.prof__spec[data-v-adfdabd9]:last-child{border-bottom:0}.prof__spec dt[data-v-adfdabd9]{margin:0;font-size:12px;color:#8a909c}.prof__spec dd[data-v-adfdabd9]{margin:0;font-size:12.5px;font-weight:700;color:#14161a;text-align:left}.prof__empty[data-v-adfdabd9]{margin-top:26px;padding:34px 20px;border:1px dashed #ECEDEF;border-radius:18px;display:flex;flex-direction:column;align-items:center;gap:10px;color:#8a909c}.prof__empty p[data-v-adfdabd9]{margin:0;font-size:12.5px}
|
||||
@@ -0,0 +1 @@
|
||||
import{d as y,E as T,o as b,p as k,c as l,l as i,s as V,g as p,v as P,f as n,b as e,I as d,t as a,e as r,i as g,u as B,h as f,x as C,_ as D}from"./index-D7u32dbn.js";import{P as N}from"./PageBar-CihrRnwd.js";import{S as h}from"./SectionHead-CZ7O6-xd.js";const x={class:"prof"},R={class:"prof__identity"},F={class:"prof__avatar","aria-hidden":"true"},M={class:"prof__name"},w={key:0,class:"prof__mobile"},O={key:0,class:"prof__block"},U={class:"prof__specs"},z={class:"prof__spec"},L={class:"prof__spec"},A={class:"prof__spec"},W={class:"prof__spec"},H={key:1,class:"prof__empty"},$=y({__name:"ProfileView",setup(j){const _={UNVERIFIED:"احراز نشده",STEP_ONE_SUBMITTED:"مرحله اول ثبت شده",STEP_TWO_SUBMITTED:"مرحله دوم ثبت شده",VERIFIED:"تایید شده"},v=T(),s=p(null),u=p(!1),m=f(()=>{var t;return((t=s.value)==null?void 0:t.verificationStep)==="VERIFIED"}),E=f(()=>{var o;const t=(o=s.value)==null?void 0:o.verificationStep;return!!t&&t!=="VERIFIED"&&t!=="STEP_TWO_SUBMITTED"}),S=C();return b(async()=>{if(v.isLoggedIn){u.value=!0;try{s.value=await k.getMe()}finally{u.value=!1}}}),(t,o)=>{const I=P("container");return n(),l("div",x,[i(N,{title:"اطلاعات کاربری","back-to":"userPage::hasSubRoute"}),i(I,{class:"prof__body"},{default:V(()=>{var c;return[e("section",R,[e("div",F,[i(d,{icon:"vuesax-linear:user",size:"30"})]),e("h2",M,a(((c=s.value)==null?void 0:c.fullName)??"—"),1),s.value?(n(),l("p",w,a(s.value.mobile),1)):r("",!0),s.value?(n(),l("span",{key:1,class:g(["prof__seal",m.value?"is-ok":"is-pending"])},a(_[s.value.verificationStep]??s.value.verificationStep),3)):r("",!0)]),s.value?(n(),l("section",O,[i(h,{title:"مشخصات",subtitle:"اطلاعات ثبتشده حساب شما"}),e("dl",U,[e("div",z,[o[1]||(o[1]=e("dt",null,"نام و نام خانوادگی",-1)),e("dd",null,a(s.value.fullName),1)]),e("div",L,[o[2]||(o[2]=e("dt",null,"تلفن همراه",-1)),e("dd",null,a(s.value.mobile),1)]),e("div",A,[o[3]||(o[3]=e("dt",null,"کد ملی",-1)),e("dd",null,a(s.value.nationalCode),1)]),e("div",W,[o[4]||(o[4]=e("dt",null,"وضعیت احراز هویت",-1)),e("dd",null,a(_[s.value.verificationStep]??s.value.verificationStep),1)])])])):u.value?r("",!0):(n(),l("section",H,[i(d,{icon:"vuesax-linear:user",size:"26"}),o[5]||(o[5]=e("p",null,"اطلاعات حساب در دسترس نیست.",-1))])),E.value?(n(),l("button",{key:2,type:"button",class:"prof__complete",onClick:o[0]||(o[0]=q=>B(S).push({name:"completeProfile"}))}," تکمیل پروفایل ")):r("",!0)]}),_:1})])}}}),Q=D($,[["__scopeId","data-v-33e6f62c"]]);export{Q as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{d as S,E,o as I,p as y,c as a,l,s as b,g as c,v as V,f as i,b as e,I as p,t,e as _,i as g,h as k,_ as h}from"./index-l-_Vq2SS.js";import{P as N}from"./PageBar-D_td2wAz.js";import{S as T}from"./SectionHead-zQgtsjBU.js";const B={class:"prof"},C={class:"prof__identity"},P={class:"prof__avatar","aria-hidden":"true"},x={class:"prof__name"},D={key:0,class:"prof__mobile"},R={key:0,class:"prof__block"},w={class:"prof__specs"},F={class:"prof__spec"},M={class:"prof__spec"},z={class:"prof__spec"},L={class:"prof__spec"},O={key:1,class:"prof__empty"},U=S({__name:"ProfileView",setup(A){const d={UNVERIFIED:"احراز نشده",STEP_ONE_SUBMITTED:"مرحله اول ثبت شده",STEP_TWO_SUBMITTED:"مرحله دوم ثبت شده",VERIFIED:"تایید شده"},f=E(),s=c(null),n=c(!1),v=k(()=>{var r;return((r=s.value)==null?void 0:r.verificationStep)==="VERIFIED"});return I(async()=>{if(f.isLoggedIn){n.value=!0;try{s.value=await y.getMe()}finally{n.value=!1}}}),(r,o)=>{const m=V("container");return i(),a("div",B,[l(N,{title:"اطلاعات کاربری","back-to":"userPage::hasSubRoute"}),l(m,{class:"prof__body"},{default:b(()=>{var u;return[e("section",C,[e("div",P,[l(p,{icon:"vuesax-linear:user",size:"30"})]),e("h2",x,t(((u=s.value)==null?void 0:u.fullName)??"—"),1),s.value?(i(),a("p",D,t(s.value.mobile),1)):_("",!0),s.value?(i(),a("span",{key:1,class:g(["prof__seal",v.value?"is-ok":"is-pending"])},t(d[s.value.verificationStep]??s.value.verificationStep),3)):_("",!0)]),s.value?(i(),a("section",R,[l(T,{title:"مشخصات",subtitle:"اطلاعات ثبتشده حساب شما"}),e("dl",w,[e("div",F,[o[0]||(o[0]=e("dt",null,"نام و نام خانوادگی",-1)),e("dd",null,t(s.value.fullName),1)]),e("div",M,[o[1]||(o[1]=e("dt",null,"تلفن همراه",-1)),e("dd",null,t(s.value.mobile),1)]),e("div",z,[o[2]||(o[2]=e("dt",null,"کد ملی",-1)),e("dd",null,t(s.value.nationalCode),1)]),e("div",L,[o[3]||(o[3]=e("dt",null,"وضعیت احراز هویت",-1)),e("dd",null,t(d[s.value.verificationStep]??s.value.verificationStep),1)])])])):n.value?_("",!0):(i(),a("section",O,[l(p,{icon:"vuesax-linear:user",size:"26"}),o[4]||(o[4]=e("p",null,"اطلاعات حساب در دسترس نیست.",-1))]))]}),_:1})])}}}),q=h(U,[["__scopeId","data-v-adfdabd9"]]);export{q as default};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{p as n,j as d}from"./filters-CLL9nGZ2.js";import{d as l,c as s,i as u,b as a,D as m,t as i,u as c,e as _,h as v,f as r,_ as q}from"./index-l-_Vq2SS.js";const f={key:0,class:"rate-strip__value"},y={class:"rate-strip__num"},k={key:1,class:"rate-strip__value rate-strip__value--muted"},x={key:2,class:"rate-strip__time"},B=l({__name:"RateStrip",props:{quote:{},compact:{type:Boolean}},setup(t){const o=t,p=v(()=>o.quote?o.quote.pricePerGramRial.split(".")[0]:"");return(R,e)=>(r(),s("div",{class:u(["rate-strip",{"is-empty":!t.quote,"rate-strip--compact":t.compact}])},[e[1]||(e[1]=a("div",{class:"rate-strip__label"},[a("span",{class:"rate-strip__dot","aria-hidden":"true"}),m(" نرخ طلای ۱۸ عیار ")],-1)),t.quote?(r(),s("div",f,[a("span",y,i(c(n)(p.value)),1),e[0]||(e[0]=a("span",{class:"rate-strip__unit"},"ریال / گرم",-1))])):(r(),s("div",k,"در انتظار اعلام نرخ")),t.quote?(r(),s("div",x,i(c(d)(t.quote.quotedAt)),1)):_("",!0)],2))}}),C=q(B,[["__scopeId","data-v-0b16738e"]]);export{C as R};
|
||||
import{p as n,j as d}from"./filters-CLL9nGZ2.js";import{d as l,c as s,i as u,b as a,D as m,t as i,u as c,e as _,h as v,f as r,_ as q}from"./index-D7u32dbn.js";const f={key:0,class:"rate-strip__value"},y={class:"rate-strip__num"},k={key:1,class:"rate-strip__value rate-strip__value--muted"},x={key:2,class:"rate-strip__time"},B=l({__name:"RateStrip",props:{quote:{},compact:{type:Boolean}},setup(t){const o=t,p=v(()=>o.quote?o.quote.pricePerGramRial.split(".")[0]:"");return(R,e)=>(r(),s("div",{class:u(["rate-strip",{"is-empty":!t.quote,"rate-strip--compact":t.compact}])},[e[1]||(e[1]=a("div",{class:"rate-strip__label"},[a("span",{class:"rate-strip__dot","aria-hidden":"true"}),m(" نرخ طلای ۱۸ عیار ")],-1)),t.quote?(r(),s("div",f,[a("span",y,i(c(n)(p.value)),1),e[0]||(e[0]=a("span",{class:"rate-strip__unit"},"ریال / گرم",-1))])):(r(),s("div",k,"در انتظار اعلام نرخ")),t.quote?(r(),s("div",x,i(c(d)(t.quote.quotedAt)),1)):_("",!0)],2))}}),C=q(B,[["__scopeId","data-v-0b16738e"]]);export{C as R};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as v,a2 as h,G as m,f as t,c as l,l as n,I as r,w as f,a3 as b,b as x,a4 as k,e as I,B as w,g as y,_ as B}from"./index-l-_Vq2SS.js";const C={class:"si"},S=["placeholder"],V=v({__name:"SearchInput",props:{placeHolder:{}},emits:["search"],setup(i,{emit:d}){const c=d,a=w({clear:!1}),e=y(void 0),s=()=>{c("search",e.value)},u=()=>{e.value=void 0,a.clear=!1,c("search",void 0)},p=h(e,700);return m(p,()=>{e?a.clear=!0:a.clear=!1,s()}),(N,o)=>(t(),l("div",C,[n(r,{icon:"vuesax-linear:search-normal-1",class:"si__icon",size:"18",onClick:s}),f(x("input",{"onUpdate:modelValue":o[0]||(o[0]=_=>e.value=_),class:"si__input",placeholder:i.placeHolder,onKeyup:k(s,["enter"])},null,40,S),[[b,e.value]]),a.clear?(t(),l("button",{key:0,type:"button",class:"si__clear","aria-label":"پاک کردن",onClick:u},[n(r,{icon:"vuesax-linear:add",size:"16"})])):I("",!0)]))}}),D=B(V,[["__scopeId","data-v-8ebd3183"]]);export{D as S};
|
||||
import{d as v,a9 as h,G as m,f as t,c as l,l as n,I as r,w as f,aa as b,b as x,ab as k,e as I,B as w,g as y,_ as B}from"./index-D7u32dbn.js";const C={class:"si"},S=["placeholder"],V=v({__name:"SearchInput",props:{placeHolder:{}},emits:["search"],setup(i,{emit:d}){const c=d,a=w({clear:!1}),e=y(void 0),s=()=>{c("search",e.value)},u=()=>{e.value=void 0,a.clear=!1,c("search",void 0)},p=h(e,700);return m(p,()=>{e?a.clear=!0:a.clear=!1,s()}),(N,o)=>(t(),l("div",C,[n(r,{icon:"vuesax-linear:search-normal-1",class:"si__icon",size:"18",onClick:s}),f(x("input",{"onUpdate:modelValue":o[0]||(o[0]=_=>e.value=_),class:"si__input",placeholder:i.placeHolder,onKeyup:k(s,["enter"])},null,40,S),[[b,e.value]]),a.clear?(t(),l("button",{key:0,type:"button",class:"si__clear","aria-label":"پاک کردن",onClick:u},[n(r,{icon:"vuesax-linear:add",size:"16"})])):I("",!0)]))}}),D=B(V,[["__scopeId","data-v-8ebd3183"]]);export{D as S};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{d as r,f as t,c as s,b as o,t as a,e as n,D as _,l as d,I as u,_ as b}from"./index-l-_Vq2SS.js";const m={class:"sec"},f={class:"sec__text"},x={class:"sec__title"},h={key:0,class:"sec__sub"},k=r({__name:"SectionHead",props:{title:{},subtitle:{},actionLabel:{}},emits:["action"],setup(e,{emit:i}){const l=i;return(p,c)=>(t(),s("header",m,[o("div",f,[o("h2",x,a(e.title),1),e.subtitle?(t(),s("p",h,a(e.subtitle),1)):n("",!0)]),e.actionLabel?(t(),s("button",{key:0,type:"button",class:"sec__action",onClick:c[0]||(c[0]=v=>l("action"))},[_(a(e.actionLabel)+" ",1),d(u,{icon:"vuesax-linear:arrow-left-2",size:"15"})])):n("",!0)]))}}),N=b(k,[["__scopeId","data-v-e5c65b7c"]]);export{N as S};
|
||||
import{d as r,f as t,c as s,b as o,t as a,e as n,D as _,l as d,I as u,_ as b}from"./index-D7u32dbn.js";const m={class:"sec"},f={class:"sec__text"},x={class:"sec__title"},h={key:0,class:"sec__sub"},k=r({__name:"SectionHead",props:{title:{},subtitle:{},actionLabel:{}},emits:["action"],setup(e,{emit:i}){const l=i;return(p,c)=>(t(),s("header",m,[o("div",f,[o("h2",x,a(e.title),1),e.subtitle?(t(),s("p",h,a(e.subtitle),1)):n("",!0)]),e.actionLabel?(t(),s("button",{key:0,type:"button",class:"sec__action",onClick:c[0]||(c[0]=v=>l("action"))},[_(a(e.actionLabel)+" ",1),d(u,{icon:"vuesax-linear:arrow-left-2",size:"15"})])):n("",!0)]))}}),N=b(k,[["__scopeId","data-v-e5c65b7c"]]);export{N as S};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{d as k,E as A,o as C,p as D,c as i,l as r,s as f,j as w,u as E,e as m,g as u,f as l,F as y,b as s,r as L,I as g,t as o,i as p,v as N,_ as M}from"./index-l-_Vq2SS.js";import{P}from"./PageBar-D_td2wAz.js";import{a as O}from"./Spinner.vue_vue_type_style_index_0_lang-BnT11ju8.js";import{S as B}from"./SectionHead-zQgtsjBU.js";import{j as R,p as U}from"./filters-CLL9nGZ2.js";import{D as I}from"./index-CBcXlm9y.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./classCallCheck-Cr5U1qnj.js";const V={class:"tx"},$={class:"tx__list"},Y=["onClick"],j={class:"tx__main"},z={class:"tx__head"},F={class:"tx__kind"},G={key:0,class:"tx__note"},H={class:"tx__foot"},J={class:"tx__date"},K={key:1,class:"tx__empty"},Q={class:"sheet"},W={class:"sheet__specs"},q={class:"sheet__spec"},X={class:"sheet__spec"},Z={class:"sheet__spec"},ss={class:"sheet__spec"},es={class:"sheet__spec"},ts=k({__name:"TransactionsView",setup(os){const x={ORDER_STOCK:"سفارش",ORDER_PRE_ORDER:"سفارش ساخت",REPAYMENT_MELTED_GOLD:"طلای آبشده",REPAYMENT_TRANSFER:"حواله",REPAYMENT_CHEQUE:"چک",REPAYMENT_CASH:"پولی",WALLET_BONUS:"پاداش",ADJUSTMENT:"اصلاحیه"},T=A(),_=u(!1),d=u([]),v=u(!1),n=u(null),c=a=>a.direction==="CREDIT",h=a=>a.currency==="GOLD_GRAM"?`${a.amount} گرم`:`${U(a.amount)} ریال`,S=a=>{n.value=a,v.value=!0};return C(async()=>{if(T.isLoggedIn){_.value=!0;try{d.value=await D.getMyLedgerEntries()}finally{_.value=!1}}}),(a,e)=>{const b=N("container");return l(),i("div",V,[r(P,{title:"اسناد","back-to":"userPage::hasSubRoute"}),r(O,{spinning:_.value,tip:"درحال دریافت اطلاعات"},{default:f(()=>[r(b,{class:"tx__body"},{default:f(()=>[d.value.length?(l(),i(y,{key:0},[r(B,{title:"گردش حساب",subtitle:`${d.value.length} سند`},null,8,["subtitle"]),s("div",$,[(l(!0),i(y,null,L(d.value,t=>(l(),i("article",{key:t.id,class:"tx__row",onClick:ns=>S(t)},[s("span",{class:p(["tx__mark",c(t)?"is-in":"is-out"]),"aria-hidden":"true"},[r(g,{icon:c(t)?"vuesax-linear:arrow-down":"vuesax-linear:arrow-up",size:"16"},null,8,["icon"])],2),s("div",j,[s("div",z,[s("h3",F,o(x[t.sourceType]??t.sourceType),1),s("span",{class:p(["tx__amount",c(t)?"is-in":"is-out"])},o(h(t)),3)]),t.note?(l(),i("p",G,o(t.note),1)):m("",!0),s("div",H,[s("span",J,o(E(R)(t.createdAt)),1),s("span",{class:p(["tx__state",{"is-pending":!t.confirmed}])},o(t.confirmed?"تایید شده":"در انتظار تایید"),3)])])],8,Y))),128))])],64)):_.value?m("",!0):(l(),i("section",K,[r(g,{icon:"vuesax-linear:receipt-text",size:"26"}),e[1]||(e[1]=s("p",null,"سندی برای حساب شما ثبت نشده است.",-1))]))]),_:1})]),_:1},8,["spinning"]),n.value?(l(),w(E(I),{key:0,visible:v.value,"onUpdate:visible":e[0]||(e[0]=t=>v.value=t),placement:"bottom",closable:!1,height:"420px",class:"rtl",bodyStyle:{padding:0}},{default:f(()=>[s("div",Q,[e[7]||(e[7]=s("h3",{class:"sheet__title"},"جزئیات سند",-1)),s("dl",W,[s("div",q,[e[2]||(e[2]=s("dt",null,"نوع سند",-1)),s("dd",null,o(x[n.value.sourceType]??n.value.sourceType),1)]),s("div",X,[e[3]||(e[3]=s("dt",null,"مبلغ",-1)),s("dd",{class:p(c(n.value)?"is-in":"is-out")},o(h(n.value)),3)]),s("div",Z,[e[4]||(e[4]=s("dt",null,"وضعیت",-1)),s("dd",null,o(n.value.confirmed?"تایید شده":"در انتظار تایید"),1)]),s("div",ss,[e[5]||(e[5]=s("dt",null,"تاریخ",-1)),s("dd",null,o(E(R)(n.value.createdAt)),1)]),s("div",es,[e[6]||(e[6]=s("dt",null,"توضیحات",-1)),s("dd",null,o(n.value.note||"—"),1)])])])]),_:1},8,["visible"])):m("",!0)])}}}),ps=M(ts,[["__scopeId","data-v-d21f0dcb"]]);export{ps as default};
|
||||
import{d as k,E as A,o as C,p as D,c as i,l as r,s as f,j as w,u as E,e as m,g as u,f as l,F as y,b as s,r as L,I as g,t as o,i as p,v as N,_ as M}from"./index-D7u32dbn.js";import{P}from"./PageBar-CihrRnwd.js";import{a as O}from"./Spinner.vue_vue_type_style_index_0_lang-Ce4r_sA4.js";import{S as B}from"./SectionHead-CZ7O6-xd.js";import{j as R,p as U}from"./filters-CLL9nGZ2.js";import{D as I}from"./index-CGMkzVe8.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./classCallCheck-BIPEroH2.js";const V={class:"tx"},$={class:"tx__list"},Y=["onClick"],j={class:"tx__main"},z={class:"tx__head"},F={class:"tx__kind"},G={key:0,class:"tx__note"},H={class:"tx__foot"},J={class:"tx__date"},K={key:1,class:"tx__empty"},Q={class:"sheet"},W={class:"sheet__specs"},q={class:"sheet__spec"},X={class:"sheet__spec"},Z={class:"sheet__spec"},ss={class:"sheet__spec"},es={class:"sheet__spec"},ts=k({__name:"TransactionsView",setup(os){const x={ORDER_STOCK:"سفارش",ORDER_PRE_ORDER:"سفارش ساخت",REPAYMENT_MELTED_GOLD:"طلای آبشده",REPAYMENT_TRANSFER:"حواله",REPAYMENT_CHEQUE:"چک",REPAYMENT_CASH:"پولی",WALLET_BONUS:"پاداش",ADJUSTMENT:"اصلاحیه"},T=A(),_=u(!1),d=u([]),v=u(!1),n=u(null),c=a=>a.direction==="CREDIT",h=a=>a.currency==="GOLD_GRAM"?`${a.amount} گرم`:`${U(a.amount)} ریال`,S=a=>{n.value=a,v.value=!0};return C(async()=>{if(T.isLoggedIn){_.value=!0;try{d.value=await D.getMyLedgerEntries()}finally{_.value=!1}}}),(a,e)=>{const b=N("container");return l(),i("div",V,[r(P,{title:"اسناد","back-to":"userPage::hasSubRoute"}),r(O,{spinning:_.value,tip:"درحال دریافت اطلاعات"},{default:f(()=>[r(b,{class:"tx__body"},{default:f(()=>[d.value.length?(l(),i(y,{key:0},[r(B,{title:"گردش حساب",subtitle:`${d.value.length} سند`},null,8,["subtitle"]),s("div",$,[(l(!0),i(y,null,L(d.value,t=>(l(),i("article",{key:t.id,class:"tx__row",onClick:ns=>S(t)},[s("span",{class:p(["tx__mark",c(t)?"is-in":"is-out"]),"aria-hidden":"true"},[r(g,{icon:c(t)?"vuesax-linear:arrow-down":"vuesax-linear:arrow-up",size:"16"},null,8,["icon"])],2),s("div",j,[s("div",z,[s("h3",F,o(x[t.sourceType]??t.sourceType),1),s("span",{class:p(["tx__amount",c(t)?"is-in":"is-out"])},o(h(t)),3)]),t.note?(l(),i("p",G,o(t.note),1)):m("",!0),s("div",H,[s("span",J,o(E(R)(t.createdAt)),1),s("span",{class:p(["tx__state",{"is-pending":!t.confirmed}])},o(t.confirmed?"تایید شده":"در انتظار تایید"),3)])])],8,Y))),128))])],64)):_.value?m("",!0):(l(),i("section",K,[r(g,{icon:"vuesax-linear:receipt-text",size:"26"}),e[1]||(e[1]=s("p",null,"سندی برای حساب شما ثبت نشده است.",-1))]))]),_:1})]),_:1},8,["spinning"]),n.value?(l(),w(E(I),{key:0,visible:v.value,"onUpdate:visible":e[0]||(e[0]=t=>v.value=t),placement:"bottom",closable:!1,height:"420px",class:"rtl",bodyStyle:{padding:0}},{default:f(()=>[s("div",Q,[e[7]||(e[7]=s("h3",{class:"sheet__title"},"جزئیات سند",-1)),s("dl",W,[s("div",q,[e[2]||(e[2]=s("dt",null,"نوع سند",-1)),s("dd",null,o(x[n.value.sourceType]??n.value.sourceType),1)]),s("div",X,[e[3]||(e[3]=s("dt",null,"مبلغ",-1)),s("dd",{class:p(c(n.value)?"is-in":"is-out")},o(h(n.value)),3)]),s("div",Z,[e[4]||(e[4]=s("dt",null,"وضعیت",-1)),s("dd",null,o(n.value.confirmed?"تایید شده":"در انتظار تایید"),1)]),s("div",ss,[e[5]||(e[5]=s("dt",null,"تاریخ",-1)),s("dd",null,o(E(R)(n.value.createdAt)),1)]),s("div",es,[e[6]||(e[6]=s("dt",null,"توضیحات",-1)),s("dd",null,o(n.value.note||"—"),1)])])])]),_:1},8,["visible"])):m("",!0)])}}}),ps=M(ts,[["__scopeId","data-v-d21f0dcb"]]);export{ps as default};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{g as d,u as O,h as a,m as _,p as C}from"./index-l-_Vq2SS.js";function F(t){return(t.qty??0)>0||!!t.isPreOrder}function S(t){if(!t||t.length===0)return null;const e=t.filter(F);return(e.length?e:t).reduce((i,r)=>parseFloat(r.defaultWagePercent)<parseFloat(i.defaultWagePercent)?r:i)}function w(t,e){const s=d(t),i=a(()=>{var o,m;return(m=(o=s.value.images)==null?void 0:o[0])==null?void 0:m.url}),r=a(()=>s.value.id),n=a(()=>s.value.title),l=a(()=>s.value.variants),c=d(e??S(O(l))),v=a(()=>c.value?parseFloat(c.value.rashWeightGrams):0),y=a(()=>c.value?parseFloat(c.value.defaultWagePercent):null),g=d(null),h=a(()=>{var o;return((o=c.value)==null?void 0:o.qty)??0}),f=a(()=>{var o;return((o=c.value)==null?void 0:o.isPreOrder)??!1}),x=a(()=>h.value>0||f.value),q=a(()=>s.value.productCode??null),P=d(!1);return{product:s,image:i,id:r,title:n,productCode:q,variants:l,selectedVariant:c,min_gram:v,wage:y,hasDiscountWage:g,qty:h,isPreOrder:f,is_exist:x,has_warranty:P}}const p="appCart";function W(){try{const t=localStorage.getItem(p);return t?JSON.parse(t):[]}catch{return[]}}function u(t){localStorage.setItem(p,JSON.stringify(t))}const I=_("cart",{state:()=>({items:W()}),actions:{async init(){try{const t=await C.listProducts(),e=[];for(const s of this.items){const i=t.find(n=>n.id===s.pid),r=i==null?void 0:i.variants.find(n=>n.id===s.vid);i&&r&&e.push({...s,product:i})}this.items=e,u(this.items)}catch(t){console.log(t)}},addToCart(t){var i,r;const e=(r=(i=t.product)==null?void 0:i.variants)==null?void 0:r.find(n=>n.id===t.vid);if(!e||!((e.qty??0)>0||e.isPreOrder))return!1;const s=this.find_index(t);return s===-1?this.items.push({...t,qty:this.capQty(t.qty,e)}):(this.items[s].product=t.product,this.items[s].qty=this.capQty(t.qty,e)),u(this.items),!0},capQty(t,e){const s=Math.max(1,Math.floor(t)||1);if(e.isPreOrder)return s;const i=e.qty??0;return i>0?Math.min(s,i):s},maxQty(t){const e=this.find_index(t);if(e===-1)return null;const s=this.variant(this.items[e]);return!s||s.isPreOrder?null:(s.qty??0)>0?s.qty:null},remove(t){const e=this.find_index(t);e>-1&&this.items.splice(e,1),u(this.items)},updateFeild(t,e,s,i){if(!this.isInCart(s))return!1;const r=e??this.find_index(s);if(i==="qty"){const n=this.variant(this.items[r]);t=n?this.capQty(Number(t),n):Math.max(1,Number(t)||1)}return this.items[r][i]=t,u(this.items),!0},find_index(t){return this.items.findIndex(e=>e.pid===t.pid&&e.vid===t.vid)},isInCart(t){return this.find_index(t)>-1},variant(t){return t.product.variants.find(e=>e.id===t.vid)},total(){return this.items.reduce((t,e)=>{const s=this.variant(e);return t+(s?parseFloat(s.rashWeightGrams)*e.qty:0)},0).toFixed(2)},clear(){this.items=[],u(this.items)}}});export{I as a,F as i,w as u};
|
||||
import{g as d,u as O,h as a,m as _,p as C}from"./index-D7u32dbn.js";function F(t){return(t.qty??0)>0||!!t.isPreOrder}function S(t){if(!t||t.length===0)return null;const e=t.filter(F);return(e.length?e:t).reduce((i,r)=>parseFloat(r.defaultWagePercent)<parseFloat(i.defaultWagePercent)?r:i)}function w(t,e){const s=d(t),i=a(()=>{var o,m;return(m=(o=s.value.images)==null?void 0:o[0])==null?void 0:m.url}),r=a(()=>s.value.id),n=a(()=>s.value.title),l=a(()=>s.value.variants),c=d(e??S(O(l))),v=a(()=>c.value?parseFloat(c.value.rashWeightGrams):0),y=a(()=>c.value?parseFloat(c.value.defaultWagePercent):null),g=d(null),h=a(()=>{var o;return((o=c.value)==null?void 0:o.qty)??0}),f=a(()=>{var o;return((o=c.value)==null?void 0:o.isPreOrder)??!1}),x=a(()=>h.value>0||f.value),q=a(()=>s.value.productCode??null),P=d(!1);return{product:s,image:i,id:r,title:n,productCode:q,variants:l,selectedVariant:c,min_gram:v,wage:y,hasDiscountWage:g,qty:h,isPreOrder:f,is_exist:x,has_warranty:P}}const p="appCart";function W(){try{const t=localStorage.getItem(p);return t?JSON.parse(t):[]}catch{return[]}}function u(t){localStorage.setItem(p,JSON.stringify(t))}const I=_("cart",{state:()=>({items:W()}),actions:{async init(){try{const t=await C.listProducts(),e=[];for(const s of this.items){const i=t.find(n=>n.id===s.pid),r=i==null?void 0:i.variants.find(n=>n.id===s.vid);i&&r&&e.push({...s,product:i})}this.items=e,u(this.items)}catch(t){console.log(t)}},addToCart(t){var i,r;const e=(r=(i=t.product)==null?void 0:i.variants)==null?void 0:r.find(n=>n.id===t.vid);if(!e||!((e.qty??0)>0||e.isPreOrder))return!1;const s=this.find_index(t);return s===-1?this.items.push({...t,qty:this.capQty(t.qty,e)}):(this.items[s].product=t.product,this.items[s].qty=this.capQty(t.qty,e)),u(this.items),!0},capQty(t,e){const s=Math.max(1,Math.floor(t)||1);if(e.isPreOrder)return s;const i=e.qty??0;return i>0?Math.min(s,i):s},maxQty(t){const e=this.find_index(t);if(e===-1)return null;const s=this.variant(this.items[e]);return!s||s.isPreOrder?null:(s.qty??0)>0?s.qty:null},remove(t){const e=this.find_index(t);e>-1&&this.items.splice(e,1),u(this.items)},updateFeild(t,e,s,i){if(!this.isInCart(s))return!1;const r=e??this.find_index(s);if(i==="qty"){const n=this.variant(this.items[r]);t=n?this.capQty(Number(t),n):Math.max(1,Number(t)||1)}return this.items[r][i]=t,u(this.items),!0},find_index(t){return this.items.findIndex(e=>e.pid===t.pid&&e.vid===t.vid)},isInCart(t){return this.find_index(t)>-1},variant(t){return t.product.variants.find(e=>e.id===t.vid)},total(){return this.items.reduce((t,e)=>{const s=this.variant(e);return t+(s?parseFloat(s.rashWeightGrams)*e.qty:0)},0).toFixed(2)},clear(){this.items=[],u(this.items)}}});export{I as a,F as i,w as u};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{c as l}from"./Spinner.vue_vue_type_style_index_0_lang-BnT11ju8.js";var f=function(n){return setTimeout(n,16)},c=function(n){return clearTimeout(n)};typeof window<"u"&&"requestAnimationFrame"in window&&(f=function(n){return window.requestAnimationFrame(n)},c=function(n){return window.cancelAnimationFrame(n)});var i=0,o=new Map;function u(e){o.delete(e)}function w(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;i+=1;var r=i;function a(t){if(t===0)u(r),e();else{var s=f(function(){a(t-1)});o.set(r,s)}}return a(n),r}w.cancel=function(e){var n=o.get(e);return u(n),c(n)};function m(e,n){for(var r=l({},e),a=0;a<n.length;a+=1){var t=n[a];delete r[t]}return r}function p(e,n,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}function v(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}export{p as _,v as a,m as o,w};
|
||||
import{c as l}from"./Spinner.vue_vue_type_style_index_0_lang-Ce4r_sA4.js";var f=function(n){return setTimeout(n,16)},c=function(n){return clearTimeout(n)};typeof window<"u"&&"requestAnimationFrame"in window&&(f=function(n){return window.requestAnimationFrame(n)},c=function(n){return window.cancelAnimationFrame(n)});var i=0,o=new Map;function u(e){o.delete(e)}function w(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;i+=1;var r=i;function a(t){if(t===0)u(r),e();else{var s=f(function(){a(t-1)});o.set(r,s)}}return a(n),r}w.cancel=function(e){var n=o.get(e);return u(n),c(n)};function m(e,n){for(var r=l({},e),a=0;a<n.length;a+=1){var t=n[a];delete r[t]}return r}function p(e,n,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}function v(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}export{p as _,v as a,m as o,w};
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{a5 as y,d as L,a6 as $,a7 as w,G as A,a8 as B,l as c,g as D,B as N,L as p,a9 as G,q as I,aa as f,ab as M,ac as R,ad as U}from"./index-l-_Vq2SS.js";const[Y,r,q]=y("pull-refresh"),x=50,C=["pulling","loosing","success"],F={disabled:Boolean,modelValue:Boolean,headHeight:f(x),successText:String,pullingText:String,loosingText:String,loadingText:String,pullDistance:$,successDuration:f(500),animationDuration:f(300)};var X=L({name:Y,props:F,emits:["change","refresh","update:modelValue"],setup(s,{emit:d,slots:o}){let u;const g=D(),T=D(),H=w(g),e=N({status:"normal",distance:0,duration:0}),i=R(),P=()=>{if(s.headHeight!==x)return{height:`${s.headHeight}px`}},h=()=>e.status!=="loading"&&e.status!=="success"&&!s.disabled,k=t=>{const a=+(s.pullDistance||s.headHeight);return t>a&&(t<a*2?t=a+(t-a)/2:t=a*1.5+(t-a*2)/4),Math.round(t)},n=(t,a)=>{const l=+(s.pullDistance||s.headHeight);e.distance=t,a?e.status="loading":t===0?e.status="normal":t<l?e.status="pulling":e.status="loosing",d("change",{status:e.status,distance:t})},m=()=>{const{status:t}=e;return t==="normal"?"":s[`${t}Text`]||q(t)},E=()=>{const{status:t,distance:a}=e;if(o[t])return o[t]({distance:a});const l=[];return C.includes(t)&&l.push(c("div",{class:r("text")},[m()])),t==="loading"&&l.push(c(p,{class:r("loading")},{default:m})),l},V=()=>{e.status="success",setTimeout(()=>{n(0)},+s.successDuration)},v=t=>{u=M(H.value)===0,u&&(e.duration=0,i.start(t))},b=t=>{h()&&v(t)},_=t=>{if(h()){u||v(t);const{deltaY:a}=i;i.move(t),u&&a.value>=0&&i.isVertical()&&(G(t),n(k(a.value)))}},S=()=>{u&&i.deltaY.value&&h()&&(e.duration=+s.animationDuration,e.status==="loosing"?(n(+s.headHeight,!0),d("update:modelValue",!0),I(()=>d("refresh"))):n(0))};return A(()=>s.modelValue,t=>{e.duration=+s.animationDuration,t?n(+s.headHeight,!0):o.success||s.successText?V():n(0,!1)}),B("touchmove",_,{target:T}),()=>{var t;const a={transitionDuration:`${e.duration}ms`,transform:e.distance?`translate3d(0,${e.distance}px, 0)`:""};return c("div",{ref:g,class:r()},[c("div",{ref:T,class:r("track"),style:a,onTouchstartPassive:b,onTouchend:S,onTouchcancel:S},[c("div",{class:r("head"),style:P()},[E()]),(t=o.default)==null?void 0:t.call(o)])])}}});const z=U(X);export{z as P};
|
||||
import{ac as y,d as L,ad as $,ae as w,G as A,af as B,l as c,g as D,B as N,L as p,ag as G,q as I,ah as f,ai as M,aj as R,ak as U}from"./index-D7u32dbn.js";const[Y,r,j]=y("pull-refresh"),x=50,q=["pulling","loosing","success"],C={disabled:Boolean,modelValue:Boolean,headHeight:f(x),successText:String,pullingText:String,loosingText:String,loadingText:String,pullDistance:$,successDuration:f(500),animationDuration:f(300)};var F=L({name:Y,props:C,emits:["change","refresh","update:modelValue"],setup(s,{emit:d,slots:o}){let u;const g=D(),T=D(),H=w(g),e=N({status:"normal",distance:0,duration:0}),i=R(),P=()=>{if(s.headHeight!==x)return{height:`${s.headHeight}px`}},h=()=>e.status!=="loading"&&e.status!=="success"&&!s.disabled,k=t=>{const a=+(s.pullDistance||s.headHeight);return t>a&&(t<a*2?t=a+(t-a)/2:t=a*1.5+(t-a*2)/4),Math.round(t)},n=(t,a)=>{const l=+(s.pullDistance||s.headHeight);e.distance=t,a?e.status="loading":t===0?e.status="normal":t<l?e.status="pulling":e.status="loosing",d("change",{status:e.status,distance:t})},m=()=>{const{status:t}=e;return t==="normal"?"":s[`${t}Text`]||j(t)},E=()=>{const{status:t,distance:a}=e;if(o[t])return o[t]({distance:a});const l=[];return q.includes(t)&&l.push(c("div",{class:r("text")},[m()])),t==="loading"&&l.push(c(p,{class:r("loading")},{default:m})),l},V=()=>{e.status="success",setTimeout(()=>{n(0)},+s.successDuration)},v=t=>{u=M(H.value)===0,u&&(e.duration=0,i.start(t))},_=t=>{h()&&v(t)},b=t=>{if(h()){u||v(t);const{deltaY:a}=i;i.move(t),u&&a.value>=0&&i.isVertical()&&(G(t),n(k(a.value)))}},S=()=>{u&&i.deltaY.value&&h()&&(e.duration=+s.animationDuration,e.status==="loosing"?(n(+s.headHeight,!0),d("update:modelValue",!0),I(()=>d("refresh"))):n(0))};return A(()=>s.modelValue,t=>{e.duration=+s.animationDuration,t?n(+s.headHeight,!0):o.success||s.successText?V():n(0,!1)}),B("touchmove",b,{target:T}),()=>{var t;const a={transitionDuration:`${e.duration}ms`,transform:e.distance?`translate3d(0,${e.distance}px, 0)`:""};return c("div",{ref:g,class:r()},[c("div",{ref:T,class:r("track"),style:a,onTouchstartPassive:_,onTouchend:S,onTouchcancel:S},[c("div",{class:r("head"),style:P()},[E()]),(t=o.default)==null?void 0:t.call(o)])])}}});const z=U(F);export{z as P};
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{d as r,l as c,a2 as p,ap as l,aq as d,$ as i,ar as u,as as m,ad as f,at as e,ac as g,ak as k}from"./index-D7u32dbn.js";const[h,P]=g("notify"),w=["lockScroll","position","show","teleport","zIndex"],y=i({},u,{type:e("danger"),color:String,message:f,position:e("top"),className:m,background:String,lockScroll:Boolean});var S=r({name:h,props:y,emits:["update:show"],setup(a,{emit:s,slots:o}){const t=n=>s("update:show",n);return()=>c(d,p({class:[P([a.type]),a.className],style:{color:a.color,background:a.background},overlay:!1,duration:.2,"onUpdate:show":t},l(a,w)),{default:()=>[o.default?o.default():a.message]})}});const b=k(S);export{b as N,S as s};
|
||||
Vendored
+13
-13
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -9,7 +9,7 @@
|
||||
<meta name="background-color" content="#1C2D56" />
|
||||
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport" />
|
||||
<title>طلای منتزر</title>
|
||||
<script type="module" crossorigin src="/assets/index-l-_Vq2SS.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-D7u32dbn.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-D-jEuKqG.css">
|
||||
<link rel="manifest" href="/manifest.webmanifest"></head>
|
||||
<body style="background-color: #1C2D56">
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -264,4 +264,51 @@ export const api = {
|
||||
'/expert/child-orders',
|
||||
{ method: 'POST', body: JSON.stringify({ page, search: search ?? null }) },
|
||||
),
|
||||
|
||||
// ── complete_profile ─────────────────────────────────────────────────
|
||||
// Ports POST /major/complete (henza_server Major/CustomerController::complete)
|
||||
// and the PWA's document uploads, which went through the same file/create the
|
||||
// admin used but behind the customer guard (routes/api.php:95).
|
||||
/**
|
||||
* Uploads one document and resolves its stored id, which is what
|
||||
* completeProfile sends. multipart/form-data, so it bypasses `request()` —
|
||||
* that helper forces a JSON content-type, and setting it here would break
|
||||
* the multipart boundary.
|
||||
*/
|
||||
uploadDocument: async (file: File, purpose: string): Promise<{ id: string; url: string }> => {
|
||||
const body = new FormData();
|
||||
body.append('file', file);
|
||||
body.append('purpose', purpose);
|
||||
|
||||
const token = readToken();
|
||||
const res = await fetch(`${BASE}/customer/me/documents`, {
|
||||
method: 'POST',
|
||||
// No Content-Type: the browser sets it with the boundary.
|
||||
headers: token ? { Authorization: `Bearer ${token}` } : {},
|
||||
body,
|
||||
});
|
||||
|
||||
if (res.status === 401) {
|
||||
onUnauthorized?.();
|
||||
throw new UnauthorizedError('/customer/me/documents');
|
||||
}
|
||||
if (!res.ok) {
|
||||
throw new Error(`آپلود فایل ناموفق بود (${res.status})`);
|
||||
}
|
||||
return res.json();
|
||||
},
|
||||
|
||||
/**
|
||||
* The three ids keep the reference's snake_case keys so the payload matches
|
||||
* what henza_pwa sent (completeProfile.vue:136-140).
|
||||
*/
|
||||
completeProfile: (payload: {
|
||||
business_license_image_id: string;
|
||||
shop_image_id: string;
|
||||
ncode_image_id: string;
|
||||
}) =>
|
||||
request<{ ok: boolean }>('/customer/me/complete-profile', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(payload),
|
||||
}),
|
||||
};
|
||||
|
||||
@@ -0,0 +1,178 @@
|
||||
<!--
|
||||
One document slot for "تکمیل پروفایل".
|
||||
|
||||
Ports henza_pwa's SingleImageUploader (/@/components/SingleImageUploader),
|
||||
which the reference used three times on completeProfile.vue:45-56. Its
|
||||
contract is the reference's: pick one file, upload it immediately, and emit
|
||||
the stored id through `done` — the form only holds ids, never the files.
|
||||
|
||||
This is the user-app-v2 styling; user-app has its own. The SCRIPT is
|
||||
identical in both.
|
||||
-->
|
||||
<template>
|
||||
<div class="siu" :class="{ 'is-done': Boolean(fileId), 'is-error': Boolean(error) }">
|
||||
<input
|
||||
ref="input"
|
||||
type="file"
|
||||
accept="image/jpeg,image/png,image/webp,application/pdf"
|
||||
class="siu__input"
|
||||
@change="onPick"
|
||||
/>
|
||||
|
||||
<button type="button" class="siu__box" :disabled="busy" @click="input?.click()">
|
||||
<img v-if="preview" :src="preview" class="siu__preview" alt="" />
|
||||
|
||||
<span v-else class="siu__icon">
|
||||
<Icon :icon="busy ? 'vuesax-linear:refresh' : 'vuesax-linear:gallery-add'" size="26" />
|
||||
</span>
|
||||
|
||||
<span class="siu__text">
|
||||
{{ busy ? 'در حال بارگذاری…' : fileId ? 'تغییر تصویر' : uploadText }}
|
||||
</span>
|
||||
|
||||
<span v-if="fileId && !busy" class="siu__badge">
|
||||
<Icon icon="vuesax-linear:tick-circle" size="16" />
|
||||
</span>
|
||||
</button>
|
||||
|
||||
<p v-if="error" class="siu__error">{{ error }}</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import Icon from '../icon/Icon.vue'
|
||||
import { api } from '../../api/client'
|
||||
|
||||
const props = defineProps<{
|
||||
uploadText: string
|
||||
/** Sent through as the stored file's `purpose`, so documents stay labelled. */
|
||||
purpose: string
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{ (e: 'done', id: string): void }>()
|
||||
|
||||
const input = ref<HTMLInputElement | null>(null)
|
||||
const busy = ref(false)
|
||||
const error = ref<string | null>(null)
|
||||
const fileId = ref<string | null>(null)
|
||||
const preview = ref<string | null>(null)
|
||||
|
||||
/** 8 MB — the same ceiling the API enforces, checked here for a fast message. */
|
||||
const MAX_BYTES = 8 * 1024 * 1024
|
||||
|
||||
async function onPick(event: Event) {
|
||||
const target = event.target as HTMLInputElement
|
||||
const file = target.files?.[0]
|
||||
// Reset immediately so re-picking the same file fires `change` again.
|
||||
target.value = ''
|
||||
if (!file) return
|
||||
|
||||
error.value = null
|
||||
|
||||
if (file.size > MAX_BYTES) {
|
||||
error.value = 'حجم فایل بیش از حد مجاز است (۸ مگابایت)'
|
||||
return
|
||||
}
|
||||
|
||||
busy.value = true
|
||||
try {
|
||||
const stored = await api.uploadDocument(file, props.purpose)
|
||||
fileId.value = stored.id
|
||||
preview.value = file.type.startsWith('image/') ? URL.createObjectURL(file) : null
|
||||
emit('done', stored.id)
|
||||
} catch {
|
||||
error.value = 'بارگذاری انجام نشد. دوباره تلاش کنید.'
|
||||
fileId.value = null
|
||||
preview.value = null
|
||||
} finally {
|
||||
busy.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
/*
|
||||
v2 styling. The template and script above are IDENTICAL to user-app's — only
|
||||
this block differs. v2 draws a flat hairline-separated row rather than an
|
||||
outlined dashed card, matching its CartView and OrdersView.
|
||||
*/
|
||||
.siu__input {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.siu__box {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
padding: 18px 2px;
|
||||
display: flex;
|
||||
flex-direction: row-reverse;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
gap: 12px;
|
||||
border: none;
|
||||
border-bottom: 1px solid @hairline;
|
||||
background: transparent;
|
||||
font-family: inherit;
|
||||
text-align: right;
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.siu__box:disabled {
|
||||
cursor: progress;
|
||||
}
|
||||
|
||||
.siu__box:active {
|
||||
opacity: 0.75;
|
||||
}
|
||||
|
||||
.is-done .siu__box {
|
||||
border-bottom-color: #16a34a;
|
||||
}
|
||||
|
||||
.is-error .siu__box {
|
||||
border-bottom-color: #dc2626;
|
||||
}
|
||||
|
||||
.siu__preview {
|
||||
width: 46px;
|
||||
height: 46px;
|
||||
flex: 0 0 auto;
|
||||
object-fit: cover;
|
||||
border-radius: 12px;
|
||||
order: -1;
|
||||
}
|
||||
|
||||
.siu__icon {
|
||||
display: flex;
|
||||
flex: 0 0 auto;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 46px;
|
||||
height: 46px;
|
||||
border-radius: 12px;
|
||||
background: @canvasSoft;
|
||||
color: @inkMuted;
|
||||
order: -1;
|
||||
}
|
||||
|
||||
.siu__text {
|
||||
flex: 1;
|
||||
font-size: 13.5px;
|
||||
font-weight: 600;
|
||||
color: @ink;
|
||||
}
|
||||
|
||||
.siu__badge {
|
||||
flex: 0 0 auto;
|
||||
display: flex;
|
||||
color: #16a34a;
|
||||
}
|
||||
|
||||
.siu__error {
|
||||
margin: 7px 2px 0;
|
||||
font-size: 12px;
|
||||
color: #dc2626;
|
||||
}
|
||||
</style>
|
||||
@@ -2,6 +2,7 @@ import { createRouter, createWebHistory } from 'vue-router';
|
||||
import { useSessionStore } from '../stores/session';
|
||||
import { useNavStore } from '../stores/navStore';
|
||||
import { useTransitionStore } from '../stores/transitionStore';
|
||||
import { api } from '../api/client';
|
||||
|
||||
// Legacy lazy-loaded every route component (`component: () => import(...)`) so
|
||||
// the initial bundle only carries the entry route. Matched here.
|
||||
@@ -52,6 +53,15 @@ export const router = createRouter({
|
||||
component: () => import('../views/expert/CustomerChoiceView.vue'),
|
||||
meta: { title: 'انتخاب مشتری', layout: 'FullPage', requiresAuth: true, requiresExpert: true },
|
||||
},
|
||||
// Reference path and name kept (henza_pwa router/index.ts:208-215). The
|
||||
// guard below mirrors the reference's: once the documents are in, the page
|
||||
// redirects home (henza_pwa router/index.ts:266).
|
||||
{
|
||||
path: '/complete_profile',
|
||||
name: 'completeProfile',
|
||||
component: () => import('../views/user/CompleteProfileView.vue'),
|
||||
meta: { title: 'تکمیل پروفایل', layout: 'FullPage', requiresAuth: true, requiresIncompleteProfile: true },
|
||||
},
|
||||
{ path: '/notifications', name: 'notifications', component: () => import('../views/user/NotificationsView.vue') },
|
||||
{ path: '/search', name: 'search', component: () => import('../views/search/SearchView.vue') },
|
||||
{ path: '/collection/:id?', name: 'collection', component: () => import('../views/search/CollectionView.vue') },
|
||||
@@ -65,7 +75,7 @@ export const router = createRouter({
|
||||
// user away from /login, and blocks unauthenticated access to routes that
|
||||
// require a session (legacy blocked ordersList/transactionsList/profileData/
|
||||
// favoritesList/completeProfile the same way).
|
||||
router.beforeEach((to) => {
|
||||
router.beforeEach(async (to) => {
|
||||
const session = useSessionStore();
|
||||
const nav = useNavStore();
|
||||
|
||||
@@ -83,6 +93,23 @@ router.beforeEach((to) => {
|
||||
return { name: 'userPage::hasSubRoute' };
|
||||
}
|
||||
|
||||
// Ported from henza_pwa router/index.ts:266 — once the documents are in,
|
||||
// /complete_profile is not reachable any more and redirects home. The
|
||||
// reference read its cached store; this asks the server, so a profile
|
||||
// completed on another device is respected too. A failed lookup lets the
|
||||
// navigation through: the page itself is harmless, and the server is the
|
||||
// one that decides whether the write is allowed.
|
||||
if (to.meta.requiresIncompleteProfile && session.isLoggedIn) {
|
||||
try {
|
||||
const me = await api.getMe();
|
||||
if (me.verificationStep === 'VERIFIED' || me.verificationStep === 'STEP_TWO_SUBMITTED') {
|
||||
return { name: 'home' };
|
||||
}
|
||||
} catch {
|
||||
// fall through
|
||||
}
|
||||
}
|
||||
|
||||
// legacy router/index.ts:268-270 — the product page slides down into view.
|
||||
if (to.name === 'singleProduct') nav.setPgaTransition('slideDown');
|
||||
else nav.setPgaTransition(undefined);
|
||||
|
||||
@@ -0,0 +1,199 @@
|
||||
<!--
|
||||
"تکمیل پروفایل" — the customer uploads their three documents.
|
||||
|
||||
Ported from henza_pwa/src/views/user/src/completeProfile.vue (route
|
||||
/complete_profile, name completeProfile), restyled into this app's design
|
||||
language. The LOGIC is the reference's and is identical in user-app; only
|
||||
the styling differs.
|
||||
|
||||
Kept from the reference:
|
||||
- the header title "تکمیل پروفایل" (completeProfile.vue:12) and the back
|
||||
arrow returning to the dashboard (:11)
|
||||
- exactly three uploads, in the reference's order and with its texts:
|
||||
جواز کسب, سردر مغازه, کارت ملی (:45-56)
|
||||
- the submit button "بارگذاری اطلاعات" (:81)
|
||||
- the client-side all-three check BEFORE posting, with the reference's own
|
||||
message "لطفا تمامی عکس های خواسته شده را آپلود کنید" (:191-198)
|
||||
- POST with the three snake_case ids (:193)
|
||||
- the success dialog with its text and its "متوجه شدم" button (:94-111),
|
||||
after which the reference navigated home (:175-181)
|
||||
|
||||
Deliberately NOT ported: the reference's `window.setInterval(... reload)` in
|
||||
refresh() (:178-180), which reloaded the whole page every second FOREVER —
|
||||
an unterminated timer, not a refresh. The store is re-read once instead.
|
||||
|
||||
The page is reachable only while the profile is incomplete; see the router
|
||||
guard, which mirrors the reference's (henza_pwa router/index.ts:266).
|
||||
-->
|
||||
<template>
|
||||
<div class="cpf">
|
||||
<PageBar title="تکمیل پروفایل" back-to="userPage::hasSubRoute" />
|
||||
|
||||
<Spinner :spinning="submitting" tip="در حال ثبت اطلاعات">
|
||||
<container class="cpf__body">
|
||||
<p class="cpf__lead">
|
||||
برای تکمیل پروفایل، سه مدرک زیر را بارگذاری کنید.
|
||||
</p>
|
||||
|
||||
<form class="cpf__form" @submit.prevent="submit">
|
||||
<SingleImageUploader
|
||||
upload-text="بارگذاری عکس جواز کسب"
|
||||
purpose="business-license"
|
||||
@done="(id: string) => (form.business_license_image_id = id)"
|
||||
/>
|
||||
<SingleImageUploader
|
||||
upload-text="بارگذاری عکس سردر مغازه"
|
||||
purpose="shop-image"
|
||||
@done="(id: string) => (form.shop_image_id = id)"
|
||||
/>
|
||||
<SingleImageUploader
|
||||
upload-text="بارگذاری عکس کارت ملی"
|
||||
purpose="national-card"
|
||||
@done="(id: string) => (form.ncode_image_id = id)"
|
||||
/>
|
||||
|
||||
<p v-if="error" class="cpf__error">{{ error }}</p>
|
||||
|
||||
<button type="submit" class="cpf__submit" :disabled="submitting">
|
||||
بارگذاری اطلاعات
|
||||
</button>
|
||||
</form>
|
||||
</container>
|
||||
</Spinner>
|
||||
|
||||
<DialogVantOneButton
|
||||
v-model:show="done"
|
||||
:time-out="-1"
|
||||
:close-on-click-overlay="false"
|
||||
>
|
||||
<template #title>
|
||||
<div class="cpf__dialogText">
|
||||
تکمیل اطلاعات شما با موفقیت انجام شد.
|
||||
</div>
|
||||
</template>
|
||||
<template #button>
|
||||
<div class="cpf__dialogBtn" @click="finish">متوجه شدم</div>
|
||||
</template>
|
||||
</DialogVantOneButton>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { reactive, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { showNotify } from 'vant'
|
||||
import PageBar from '../../components/ui/PageBar.vue'
|
||||
import Spinner from '../../components/Spinner.vue'
|
||||
import DialogVantOneButton from '../../components/DialogVantOneButton.vue'
|
||||
import SingleImageUploader from '../../components/upload/SingleImageUploader.vue'
|
||||
import { api } from '../../api/client'
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
const form = reactive({
|
||||
business_license_image_id: null as string | null,
|
||||
shop_image_id: null as string | null,
|
||||
ncode_image_id: null as string | null,
|
||||
})
|
||||
|
||||
const submitting = ref(false)
|
||||
const done = ref(false)
|
||||
const error = ref<string | null>(null)
|
||||
|
||||
async function submit() {
|
||||
error.value = null
|
||||
|
||||
// The reference checked all three client-side before posting
|
||||
// (completeProfile.vue:191-198); the server requires them too.
|
||||
if (!form.business_license_image_id || !form.shop_image_id || !form.ncode_image_id) {
|
||||
showNotify('لطفا تمامی عکس های خواسته شده را آپلود کنید')
|
||||
return
|
||||
}
|
||||
|
||||
submitting.value = true
|
||||
try {
|
||||
await api.completeProfile({
|
||||
business_license_image_id: form.business_license_image_id,
|
||||
shop_image_id: form.shop_image_id,
|
||||
ncode_image_id: form.ncode_image_id,
|
||||
})
|
||||
done.value = true
|
||||
} catch {
|
||||
error.value = 'ثبت اطلاعات انجام نشد. دوباره تلاش کنید.'
|
||||
} finally {
|
||||
submitting.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** The reference sent the user home after the dialog (:175-177). */
|
||||
function finish() {
|
||||
done.value = false
|
||||
router.push({ name: 'home' })
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
/*
|
||||
v2 styling. The template and script above are IDENTICAL to user-app's — only
|
||||
this block differs. v2 keeps the flat, hairline-separated rhythm of its other
|
||||
screens, so the three slots run together as a continuous list rather than as
|
||||
three spaced cards, and the action bar pins to the bottom.
|
||||
*/
|
||||
.cpf__body {
|
||||
padding-top: 84px;
|
||||
padding-bottom: 110px;
|
||||
}
|
||||
|
||||
.cpf__lead {
|
||||
margin: 4px 0 6px;
|
||||
font-size: 13px;
|
||||
color: @inkMuted;
|
||||
}
|
||||
|
||||
.cpf__form {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.cpf__error {
|
||||
margin: 12px 2px 0;
|
||||
font-size: 12.5px;
|
||||
color: #dc2626;
|
||||
}
|
||||
|
||||
.cpf__submit {
|
||||
position: fixed;
|
||||
left: 16px;
|
||||
right: 16px;
|
||||
bottom: 20px;
|
||||
z-index: 20;
|
||||
max-width: 736px;
|
||||
margin: 0 auto;
|
||||
padding: 15px;
|
||||
border: none;
|
||||
border-radius: 999px;
|
||||
background: @wine;
|
||||
color: #fff;
|
||||
font-family: inherit;
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.cpf__submit:disabled {
|
||||
opacity: 0.6;
|
||||
cursor: progress;
|
||||
}
|
||||
|
||||
.cpf__dialogText {
|
||||
padding: 20px;
|
||||
line-height: 1.9;
|
||||
text-align: justify;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.cpf__dialogBtn {
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
@@ -60,12 +60,27 @@
|
||||
<Icon icon="vuesax-linear:user" size="26" />
|
||||
<p>اطلاعات حساب در دسترس نیست.</p>
|
||||
</section>
|
||||
<!--
|
||||
"تکمیل پروفایل" — the reference showed this button here, on the profile,
|
||||
and only while sts_verify_step_two was neither 1 nor 2
|
||||
(henza_pwa .../components/profile.vue:96-102). The same condition holds
|
||||
here against the target VerificationStep enum.
|
||||
-->
|
||||
<button
|
||||
v-if="canCompleteProfile"
|
||||
type="button"
|
||||
class="prof__complete"
|
||||
@click="router.push({ name: 'completeProfile' })"
|
||||
>
|
||||
تکمیل پروفایل
|
||||
</button>
|
||||
</container>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import Icon from '../../components/icon/Icon.vue'
|
||||
import PageBar from '../../components/ui/PageBar.vue'
|
||||
import SectionHead from '../../components/home/SectionHead.vue'
|
||||
@@ -85,6 +100,18 @@ const loading = ref(false)
|
||||
|
||||
const isVerified = computed(() => customer.value?.verificationStep === 'VERIFIED')
|
||||
|
||||
/**
|
||||
* The reference gated the button on sts_verify_step_two being neither 1 nor 2,
|
||||
* i.e. show it only while the documents have not been submitted. STEP_TWO_
|
||||
* SUBMITTED and VERIFIED are those two states here.
|
||||
*/
|
||||
const canCompleteProfile = computed(() => {
|
||||
const step = customer.value?.verificationStep
|
||||
return Boolean(step) && step !== 'VERIFIED' && step !== 'STEP_TWO_SUBMITTED'
|
||||
})
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
onMounted(async () => {
|
||||
if (!session.isLoggedIn) return
|
||||
loading.value = true
|
||||
@@ -213,4 +240,18 @@ onMounted(async () => {
|
||||
margin: 0;
|
||||
font-size: 12.5px;
|
||||
}
|
||||
|
||||
.prof__complete {
|
||||
margin-top: 24px;
|
||||
width: 100%;
|
||||
padding: 15px;
|
||||
border: none;
|
||||
border-radius: 999px;
|
||||
background: @wine;
|
||||
color: #fff;
|
||||
font-family: inherit;
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
import{d as f,o as v,q as g,c as s,k as e,s as u,g as p,h as d,i as t,F as y,r as k,I as P,b as x,f as C,v as b,K as h,x as B,_ as V}from"./index-zU76P609.js";import{P as w}from"./PageBar-BNTdgQIH.js";import{a as I}from"./Spinner.vue_vue_type_style_index_0_lang-8IfA4lPE.js";import{S as N}from"./SectionHead-DiMH7kD3.js";import{P as q}from"./ProductCard-DnjzY-Hn.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./SingleProduct-Bo-ynxSe.js";import"./NotifyVant.vue_vue_type_script_setup_true_lang-BFiftwB2.js";import"./DialogVant.vue_vue_type_style_index_0_lang-j8dd-xd3.js";import"./cartStore-BxC8w6kf.js";import"./dialogEmpty1-Caw7F5KL.js";import"./index-BL4GBXwx.js";import"./classCallCheck-BeQXLUEU.js";const F={class:"coll"},S={key:0,class:"coll__grid"},z={key:1,class:"coll__empty"},E=f({__name:"CollectionView",setup(H){const l=h(),o=p(!1),n=p([]),m=d(()=>l.query.page||"مجموعه"),i=d(()=>n.value.filter(r=>r.collections.some(a=>a.collectionId===l.params.id)));return v(async()=>{o.value=!0;try{n.value=await g.listProducts()}finally{o.value=!1}}),(r,a)=>{const _=b("container");return t(),s("div",F,[e(w,{title:m.value,"back-to":"search"},null,8,["title"]),e(I,{spinning:o.value,tip:"درحال دریافت اطلاعات"},{default:u(()=>[e(_,{class:"coll__body"},{default:u(()=>[e(N,{title:"محصولات این مجموعه",subtitle:"برای دیدن جزئیات، روی محصول ضربه بزنید"}),i.value.length?(t(),s("div",S,[(t(!0),s(y,null,k(i.value,c=>(t(),B(q,{key:c.id,value:c},null,8,["value"]))),128))])):o.value?C("",!0):(t(),s("section",z,[e(P,{icon:"vuesax-linear:box",size:"26"}),a[0]||(a[0]=x("p",null,"در این مجموعه محصولی ثبت نشده است.",-1))]))]),_:1})]),_:1},8,["spinning"])])}}}),U=V(E,[["__scopeId","data-v-4e05d52b"]]);export{U as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{d as f,o as v,q as g,c as s,k as e,s as u,g as p,h as m,i as t,F as y,r as k,I as P,b as x,f as C,v as b,K as h,x as B,_ as V}from"./index-0lMAZRQB.js";import{P as w}from"./PageBar-DP6LpIFv.js";import{a as I}from"./Spinner.vue_vue_type_style_index_0_lang-Q7UPdMbi.js";import{S as N}from"./SectionHead-BuisDFZg.js";import{P as q}from"./ProductCard-Cbfp9CSN.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./SingleProduct-BCX5wlE-.js";import"./NotifyVant.vue_vue_type_script_setup_true_lang-BKaF0fT-.js";import"./index-W8LzFWDq.js";import"./DialogVant.vue_vue_type_style_index_0_lang-DiDmrjDM.js";import"./cartStore-qaurfaGv.js";import"./dialogEmpty1-Caw7F5KL.js";import"./index-BlJivYzz.js";import"./classCallCheck-Tw9-kd3s.js";const F={class:"coll"},S={key:0,class:"coll__grid"},z={key:1,class:"coll__empty"},E=f({__name:"CollectionView",setup(H){const l=h(),o=p(!1),n=p([]),d=m(()=>l.query.page||"مجموعه"),i=m(()=>n.value.filter(r=>r.collections.some(a=>a.collectionId===l.params.id)));return v(async()=>{o.value=!0;try{n.value=await g.listProducts()}finally{o.value=!1}}),(r,a)=>{const _=b("container");return t(),s("div",F,[e(w,{title:d.value,"back-to":"search"},null,8,["title"]),e(I,{spinning:o.value,tip:"درحال دریافت اطلاعات"},{default:u(()=>[e(_,{class:"coll__body"},{default:u(()=>[e(N,{title:"محصولات این مجموعه",subtitle:"برای دیدن جزئیات، روی محصول ضربه بزنید"}),i.value.length?(t(),s("div",S,[(t(!0),s(y,null,k(i.value,c=>(t(),B(q,{key:c.id,value:c},null,8,["value"]))),128))])):o.value?C("",!0):(t(),s("section",z,[e(P,{icon:"vuesax-linear:box",size:"26"}),a[0]||(a[0]=x("p",null,"در این مجموعه محصولی ثبت نشده است.",-1))]))]),_:1})]),_:1},8,["spinning"])])}}}),W=V(E,[["__scopeId","data-v-4e05d52b"]]);export{W as default};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
.siu__input[data-v-186945da]{display:none}.siu__box[data-v-186945da]{position:relative;width:100%;min-height:132px;padding:20px 16px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;border:1px dashed #ECEDEF;border-radius:18px;background:#fafafa;font-family:inherit;cursor:pointer;overflow:hidden;transition:border-color .2s ease}.siu__box[data-v-186945da]:disabled{cursor:progress}.is-done .siu__box[data-v-186945da]{border-style:solid;border-color:#16a34a}.is-error .siu__box[data-v-186945da]{border-color:#dc2626}.siu__preview[data-v-186945da]{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;-o-object-fit:cover;object-fit:cover;opacity:.32}.siu__icon[data-v-186945da],.siu__text[data-v-186945da]{position:relative;z-index:1}.siu__text[data-v-186945da]{font-size:13px;font-weight:600;color:#5b616e}.siu__badge[data-v-186945da]{position:absolute;top:10px;left:10px;z-index:1;display:flex;color:#16a34a}.siu__error[data-v-186945da]{margin:7px 2px 0;font-size:12px;color:#dc2626}.cpf__body[data-v-11de2b30]{padding-top:90px;padding-bottom:40px}.cpf__lead[data-v-11de2b30]{margin:4px 0 18px;font-size:13px;color:#5b616e}.cpf__form[data-v-11de2b30]{display:flex;flex-direction:column;gap:14px}.cpf__error[data-v-11de2b30]{margin:2px;font-size:12.5px;color:#dc2626}.cpf__submit[data-v-11de2b30]{margin-top:6px;width:100%;padding:14px;border:none;border-radius:14px;background:#14161a;color:#fff;font-family:inherit;font-size:15px;font-weight:700;cursor:pointer}.cpf__submit[data-v-11de2b30]:disabled{opacity:.6;cursor:progress}.cpf__dialogText[data-v-11de2b30]{padding:20px;line-height:1.9;text-align:justify;font-size:14px}.cpf__dialogBtn[data-v-11de2b30]{text-align:center;cursor:pointer}
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as z,o as S,c,k as a,s as d,u as w,g as r,q as N,i,b as s,F as P,r as B,I as u,t as o,f as m,v as D,e as F,_ as I}from"./index-zU76P609.js";import{P as E}from"./PageBar-BNTdgQIH.js";import{a as R}from"./Spinner.vue_vue_type_style_index_0_lang-8IfA4lPE.js";import{S as $}from"./SearchInput-DKDqPKX6.js";import{D as U}from"./index-BL4GBXwx.js";import{P as q}from"./index-CJgwp52_.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./classCallCheck-BeQXLUEU.js";const L={class:"cch"},M={class:"cch__barExtra"},O={key:0,class:"cch__list"},T=["onClick"],j={class:"cch__head"},A={class:"cch__name"},G={class:"cch__facts"},H={class:"cch__fact"},J={dir:"ltr"},K={class:"cch__fact"},Q={dir:"ltr"},W={key:0,class:"cch__fact"},X={key:1,class:"cch__empty"},Y={key:2,class:"cch__empty"},Z={key:0,class:"cch__detail"},ss={class:"cch__detailTitle"},es={class:"cch__rows"},ts={class:"cch__row"},os={dir:"ltr"},as={class:"cch__row"},ls={dir:"ltr"},ns={class:"cch__row"},cs={class:"cch__row"},is={class:"cch__row"},rs={dir:"ltr"},_s={class:"cch__row"},ds={dir:"ltr"},us={class:"cch__row"},vs=z({__name:"CustomerChoiceView",setup(hs){const _=r([]),v=r(!1),y=r(!1),h=r(!1),b=r(null),p=r(!1),l=r(null);function g(n){const e=Number(n??0);return Number.isFinite(e)?e.toFixed(3):"0.000"}async function f(){v.value=!0,h.value=!1;try{_.value=await N.getExpertCustomers(b.value)}catch{h.value=!0,_.value=[]}finally{v.value=!1}}async function k(n){b.value=n!=null&&n.trim()?n.trim():null,await f()}async function C(){await f(),y.value=!1}function x(n){l.value=n,p.value=!0}return S(f),(n,e)=>{const V=D("container");return i(),c("div",L,[a(E,{title:"لیست مشتریان","back-to":"userPage::hasSubRoute"},{below:d(()=>[s("div",M,[a($,{onSearch:k,"place-holder":"جستجو"})])]),_:1}),a(R,{spinning:v.value&&!_.value.length,tip:"درحال دریافت اطلاعات"},{default:d(()=>[a(w(q),{modelValue:y.value,"onUpdate:modelValue":e[0]||(e[0]=t=>y.value=t),onRefresh:C},{default:d(()=>[a(V,{class:"cch__body"},{default:d(()=>[_.value.length?(i(),c("div",O,[(i(!0),c(P,null,B(_.value,t=>(i(),c("article",{key:t.id,class:"cch__card",onClick:ps=>x(t)},[s("div",j,[s("h3",A,o(t.name),1),s("span",{class:F(["cch__state",t.active===1?"is-on":"is-off"])},o(t.active===1?"فعال":"غیرفعال"),3)]),s("div",G,[s("div",H,[a(u,{icon:"vuesax-linear:mobile",size:"15"}),s("span",J,o(t.mobile||"—"),1)]),s("div",K,[a(u,{icon:"vuesax-linear:call",size:"15"}),s("span",Q,o(t.phone||"—"),1)]),t.store_name?(i(),c("div",W,[a(u,{icon:"vuesax-linear:shop",size:"15"}),s("span",null,o(t.store_name),1)])):m("",!0)])],8,T))),128))])):!v.value&&!h.value?(i(),c("section",X,[a(u,{icon:"vuesax-linear:profile-2user",size:"26"}),s("p",null,o(b.value?"مشتری با این مشخصات پیدا نشد.":"هنوز مشتریای به شما معرفی نشده است."),1)])):m("",!0),h.value?(i(),c("section",Y,[a(u,{icon:"vuesax-linear:danger",size:"26"}),e[3]||(e[3]=s("p",null,"دریافت اطلاعات با خطا روبهرو شد.",-1)),s("button",{type:"button",class:"cch__retry",onClick:f},"تلاش دوباره")])):m("",!0)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["spinning"]),a(w(U),{open:p.value,"onUpdate:open":e[2]||(e[2]=t=>p.value=t),placement:"bottom",height:"auto",closable:!1,"body-style":{padding:"0"}},{default:d(()=>[l.value?(i(),c("div",Z,[s("h2",ss,o(l.value.name),1),s("dl",es,[s("div",ts,[e[4]||(e[4]=s("dt",null,"موبایل",-1)),s("dd",os,o(l.value.mobile||"—"),1)]),s("div",as,[e[5]||(e[5]=s("dt",null,"تلفن",-1)),s("dd",ls,o(l.value.phone||"—"),1)]),s("div",ns,[e[6]||(e[6]=s("dt",null,"نام مغازه",-1)),s("dd",null,o(l.value.store_name||"—"),1)]),s("div",cs,[e[7]||(e[7]=s("dt",null,"نام پاساژ",-1)),s("dd",null,o(l.value.pasazh_name||"—"),1)]),s("div",is,[e[8]||(e[8]=s("dt",null,"سقف اعتبار",-1)),s("dd",rs,o(g(l.value.gram_level))+" گرم",1)]),s("div",_s,[e[9]||(e[9]=s("dt",null,"بدهی گرمی",-1)),s("dd",ds,o(g(l.value.remain))+" گرم",1)]),s("div",us,[e[10]||(e[10]=s("dt",null,"وضعیت",-1)),s("dd",null,o(l.value.active===1?"فعال":"غیرفعال"),1)])]),s("button",{type:"button",class:"cch__close",onClick:e[1]||(e[1]=t=>p.value=!1)},"بستن")])):m("",!0)]),_:1},8,["open"])])}}}),xs=I(vs,[["__scopeId","data-v-0f43a8be"]]);export{xs as default};
|
||||
import{d as z,o as S,c,k as a,s as d,u as w,g as r,q as N,i,b as s,F as P,r as B,I as u,t as o,f as m,v as D,e as F,_ as I}from"./index-0lMAZRQB.js";import{P as E}from"./PageBar-DP6LpIFv.js";import{a as R}from"./Spinner.vue_vue_type_style_index_0_lang-Q7UPdMbi.js";import{S as $}from"./SearchInput-BoLb-2jQ.js";import{D as U}from"./index-BlJivYzz.js";import{P as q}from"./index-CWibuKdZ.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./classCallCheck-Tw9-kd3s.js";const L={class:"cch"},M={class:"cch__barExtra"},O={key:0,class:"cch__list"},T=["onClick"],j={class:"cch__head"},A={class:"cch__name"},G={class:"cch__facts"},H={class:"cch__fact"},J={dir:"ltr"},K={class:"cch__fact"},Q={dir:"ltr"},W={key:0,class:"cch__fact"},X={key:1,class:"cch__empty"},Y={key:2,class:"cch__empty"},Z={key:0,class:"cch__detail"},ss={class:"cch__detailTitle"},es={class:"cch__rows"},ts={class:"cch__row"},os={dir:"ltr"},as={class:"cch__row"},ls={dir:"ltr"},ns={class:"cch__row"},cs={class:"cch__row"},is={class:"cch__row"},rs={dir:"ltr"},_s={class:"cch__row"},ds={dir:"ltr"},us={class:"cch__row"},vs=z({__name:"CustomerChoiceView",setup(hs){const _=r([]),v=r(!1),y=r(!1),h=r(!1),b=r(null),p=r(!1),l=r(null);function g(n){const e=Number(n??0);return Number.isFinite(e)?e.toFixed(3):"0.000"}async function f(){v.value=!0,h.value=!1;try{_.value=await N.getExpertCustomers(b.value)}catch{h.value=!0,_.value=[]}finally{v.value=!1}}async function k(n){b.value=n!=null&&n.trim()?n.trim():null,await f()}async function C(){await f(),y.value=!1}function x(n){l.value=n,p.value=!0}return S(f),(n,e)=>{const V=D("container");return i(),c("div",L,[a(E,{title:"لیست مشتریان","back-to":"userPage::hasSubRoute"},{below:d(()=>[s("div",M,[a($,{onSearch:k,"place-holder":"جستجو"})])]),_:1}),a(R,{spinning:v.value&&!_.value.length,tip:"درحال دریافت اطلاعات"},{default:d(()=>[a(w(q),{modelValue:y.value,"onUpdate:modelValue":e[0]||(e[0]=t=>y.value=t),onRefresh:C},{default:d(()=>[a(V,{class:"cch__body"},{default:d(()=>[_.value.length?(i(),c("div",O,[(i(!0),c(P,null,B(_.value,t=>(i(),c("article",{key:t.id,class:"cch__card",onClick:ps=>x(t)},[s("div",j,[s("h3",A,o(t.name),1),s("span",{class:F(["cch__state",t.active===1?"is-on":"is-off"])},o(t.active===1?"فعال":"غیرفعال"),3)]),s("div",G,[s("div",H,[a(u,{icon:"vuesax-linear:mobile",size:"15"}),s("span",J,o(t.mobile||"—"),1)]),s("div",K,[a(u,{icon:"vuesax-linear:call",size:"15"}),s("span",Q,o(t.phone||"—"),1)]),t.store_name?(i(),c("div",W,[a(u,{icon:"vuesax-linear:shop",size:"15"}),s("span",null,o(t.store_name),1)])):m("",!0)])],8,T))),128))])):!v.value&&!h.value?(i(),c("section",X,[a(u,{icon:"vuesax-linear:profile-2user",size:"26"}),s("p",null,o(b.value?"مشتری با این مشخصات پیدا نشد.":"هنوز مشتریای به شما معرفی نشده است."),1)])):m("",!0),h.value?(i(),c("section",Y,[a(u,{icon:"vuesax-linear:danger",size:"26"}),e[3]||(e[3]=s("p",null,"دریافت اطلاعات با خطا روبهرو شد.",-1)),s("button",{type:"button",class:"cch__retry",onClick:f},"تلاش دوباره")])):m("",!0)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["spinning"]),a(w(U),{open:p.value,"onUpdate:open":e[2]||(e[2]=t=>p.value=t),placement:"bottom",height:"auto",closable:!1,"body-style":{padding:"0"}},{default:d(()=>[l.value?(i(),c("div",Z,[s("h2",ss,o(l.value.name),1),s("dl",es,[s("div",ts,[e[4]||(e[4]=s("dt",null,"موبایل",-1)),s("dd",os,o(l.value.mobile||"—"),1)]),s("div",as,[e[5]||(e[5]=s("dt",null,"تلفن",-1)),s("dd",ls,o(l.value.phone||"—"),1)]),s("div",ns,[e[6]||(e[6]=s("dt",null,"نام مغازه",-1)),s("dd",null,o(l.value.store_name||"—"),1)]),s("div",cs,[e[7]||(e[7]=s("dt",null,"نام پاساژ",-1)),s("dd",null,o(l.value.pasazh_name||"—"),1)]),s("div",is,[e[8]||(e[8]=s("dt",null,"سقف اعتبار",-1)),s("dd",rs,o(g(l.value.gram_level))+" گرم",1)]),s("div",_s,[e[9]||(e[9]=s("dt",null,"بدهی گرمی",-1)),s("dd",ds,o(g(l.value.remain))+" گرم",1)]),s("div",us,[e[10]||(e[10]=s("dt",null,"وضعیت",-1)),s("dd",null,o(l.value.active===1?"فعال":"غیرفعال"),1)])]),s("button",{type:"button",class:"cch__close",onClick:e[1]||(e[1]=t=>p.value=!1)},"بستن")])):m("",!0)]),_:1},8,["open"])])}}}),xs=I(vs,[["__scopeId","data-v-0f43a8be"]]);export{xs as default};
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{d as l,x as n,s as r,u as d,ap as c,i as x,b as t,B as o,E as a,t as i}from"./index-zU76P609.js";const f={class:"my-4"},u={class:"w-full flex justify-center"},m={class:"w-full flex justify-center text-[18px] font-semibold"},_={class:"grid grid-cols-2 border-t border-solid border-[#E5E7EB] pt-4 mx-2 mt-6 font-semibold text-[15px]"},g=l({__name:"DialogVant",props:{timeOut:{},text1:{},text2:{},text3:{}},setup(e){return(s,p)=>(x(),n(d(c),null,{default:r(()=>[t("div",f,[t("div",u,[o(s.$slots,"img",{},()=>[a(i(e.text2),1)])]),t("div",m,[o(s.$slots,"title",{},()=>[a(i(e.text1),1)])]),t("div",_,[o(s.$slots,"button",{},()=>[a(i(e.text3),1)])])])]),_:3}))}});export{g as _};
|
||||
import{d as l,x as n,s as r,u as d,ap as c,i as x,b as t,B as o,E as a,t as i}from"./index-0lMAZRQB.js";const f={class:"my-4"},u={class:"w-full flex justify-center"},m={class:"w-full flex justify-center text-[18px] font-semibold"},_={class:"grid grid-cols-2 border-t border-solid border-[#E5E7EB] pt-4 mx-2 mt-6 font-semibold text-[15px]"},g=l({__name:"DialogVant",props:{timeOut:{},text1:{},text2:{},text3:{}},setup(e){return(s,p)=>(x(),n(d(c),null,{default:r(()=>[t("div",f,[t("div",u,[o(s.$slots,"img",{},()=>[a(i(e.text2),1)])]),t("div",m,[o(s.$slots,"title",{},()=>[a(i(e.text1),1)])]),t("div",_,[o(s.$slots,"button",{},()=>[a(i(e.text3),1)])])])]),_:3}))}});export{g as _};
|
||||
@@ -0,0 +1 @@
|
||||
import{d as f,o as y,q as b,c as o,k as e,s as c,g as m,i as t,F as p,b as i,r as g,I as k,u as h,f as P,y as C,h as x,v as F,x as B,_ as V}from"./index-0lMAZRQB.js";import{P as w}from"./PageBar-DP6LpIFv.js";import{a as S}from"./Spinner.vue_vue_type_style_index_0_lang-Q7UPdMbi.js";import{S as I}from"./SectionHead-BuisDFZg.js";import{P as N}from"./ProductCard-Cbfp9CSN.js";import{u as $}from"./SingleProduct-BCX5wlE-.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./cartStore-qaurfaGv.js";import"./index-BlJivYzz.js";import"./classCallCheck-Tw9-kd3s.js";import"./NotifyVant.vue_vue_type_script_setup_true_lang-BKaF0fT-.js";import"./index-W8LzFWDq.js";import"./DialogVant.vue_vue_type_style_index_0_lang-DiDmrjDM.js";import"./dialogEmpty1-Caw7F5KL.js";const R={class:"favs"},q={class:"favs__grid"},z={key:1,class:"favs__empty"},E=f({__name:"FavoritesView",setup(H){const d=C(),v=$(),a=m(!1),l=m([]),r=x(()=>l.value.filter(u=>v.isFavorite(u.id)));return y(async()=>{a.value=!0;try{l.value=await b.listProducts()}finally{a.value=!1}}),(u,s)=>{const _=F("container");return t(),o("div",R,[e(w,{title:"علاقهمندی","back-to":"userPage::hasSubRoute"}),e(S,{spinning:a.value,tip:"در حال دریافت اطلاعات"},{default:c(()=>[e(_,{class:"favs__body"},{default:c(()=>[r.value.length?(t(),o(p,{key:0},[e(I,{title:"ذخیرهشدهها",subtitle:`${r.value.length} محصول`},null,8,["subtitle"]),i("div",q,[(t(!0),o(p,null,g(r.value,n=>(t(),B(N,{key:n.id,value:n},null,8,["value"]))),128))])],64)):a.value?P("",!0):(t(),o("section",z,[e(k,{icon:"vuesax-linear:heart",size:"26"}),s[1]||(s[1]=i("p",null,"هنوز محصولی را به علاقهمندیها اضافه نکردهاید.",-1)),i("button",{type:"button",class:"favs__emptyCta",onClick:s[0]||(s[0]=n=>h(d).push({name:"home"}))}," دیدن محصولات ")]))]),_:1})]),_:1},8,["spinning"])])}}}),Y=V(E,[["__scopeId","data-v-93bb7c6a"]]);export{Y as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{d as f,o as y,q as b,c as o,k as e,s as c,g as m,i as t,F as p,b as i,r as g,I as k,u as h,f as P,y as C,h as x,v as F,x as B,_ as V}from"./index-zU76P609.js";import{P as w}from"./PageBar-BNTdgQIH.js";import{a as S}from"./Spinner.vue_vue_type_style_index_0_lang-8IfA4lPE.js";import{S as I}from"./SectionHead-DiMH7kD3.js";import{P as N}from"./ProductCard-DnjzY-Hn.js";import{u as $}from"./SingleProduct-Bo-ynxSe.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./cartStore-BxC8w6kf.js";import"./index-BL4GBXwx.js";import"./classCallCheck-BeQXLUEU.js";import"./NotifyVant.vue_vue_type_script_setup_true_lang-BFiftwB2.js";import"./DialogVant.vue_vue_type_style_index_0_lang-j8dd-xd3.js";import"./dialogEmpty1-Caw7F5KL.js";const R={class:"favs"},q={class:"favs__grid"},z={key:1,class:"favs__empty"},E=f({__name:"FavoritesView",setup(H){const d=C(),v=$(),a=m(!1),l=m([]),r=x(()=>l.value.filter(u=>v.isFavorite(u.id)));return y(async()=>{a.value=!0;try{l.value=await b.listProducts()}finally{a.value=!1}}),(u,s)=>{const _=F("container");return t(),o("div",R,[e(w,{title:"علاقهمندی","back-to":"userPage::hasSubRoute"}),e(S,{spinning:a.value,tip:"در حال دریافت اطلاعات"},{default:c(()=>[e(_,{class:"favs__body"},{default:c(()=>[r.value.length?(t(),o(p,{key:0},[e(I,{title:"ذخیرهشدهها",subtitle:`${r.value.length} محصول`},null,8,["subtitle"]),i("div",q,[(t(!0),o(p,null,g(r.value,n=>(t(),B(N,{key:n.id,value:n},null,8,["value"]))),128))])],64)):a.value?P("",!0):(t(),o("section",z,[e(k,{icon:"vuesax-linear:heart",size:"26"}),s[1]||(s[1]=i("p",null,"هنوز محصولی را به علاقهمندیها اضافه نکردهاید.",-1)),i("button",{type:"button",class:"favs__emptyCta",onClick:s[0]||(s[0]=n=>h(d).push({name:"home"}))}," دیدن محصولات ")]))]),_:1})]),_:1},8,["spinning"])])}}}),X=V(E,[["__scopeId","data-v-93bb7c6a"]]);export{X as default};
|
||||
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
import{P as x}from"./PageBar-BNTdgQIH.js";import{E as P,a as _}from"./Spinner.vue_vue_type_style_index_0_lang-8IfA4lPE.js";import{S}from"./SectionHead-DiMH7kD3.js";import{P as k}from"./ProductCard-DnjzY-Hn.js";import{d,i as n,c,k as o,u as l,z as B,A as C,n as E,B as b,x as v,f as y,g as u,q as L,C as $,D as A,s as p,F,r as I,h as N,v as V,_ as D}from"./index-zU76P609.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./SingleProduct-Bo-ynxSe.js";import"./NotifyVant.vue_vue_type_script_setup_true_lang-BFiftwB2.js";import"./DialogVant.vue_vue_type_style_index_0_lang-j8dd-xd3.js";import"./cartStore-BxC8w6kf.js";import"./dialogEmpty1-Caw7F5KL.js";import"./index-BL4GBXwx.js";import"./classCallCheck-BeQXLUEU.js";const q={class:"flex justify-center items-center empty"},z=d({__name:"EmptyState",props:{description:{},image:{}},setup(t){return(e,a)=>(n(),c("div",q,[o(l(P),{description:"موردی یافت نشد",image:t.image,class:"h-[200px] w-[200px] opacity-70"},null,8,["image"])]))}}),H="/assets/favoritEmpty-CIK7qR49.svg",T=d({__name:"ScrollFetchSearch",props:{loading:{type:Boolean},flag:{type:Boolean},padding:{}},emits:["fetch"],setup(t,{emit:e}){const a=e,r=B(),s=u(null);return C(s,()=>{a("fetch")},{distance:50}),(i,m)=>(n(),c("main",{class:"flex flex-col flex-1 overflow-auto no-scrollbar w-[100vw] max-w-screen-md m-auto",style:E({paddingTop:t.padding||l(r).headerHeight+"px"}),ref_key:"scrollArea",ref:s},[b(i.$slots,"default"),o(_,{cls:"my-[10px]",spinning:t.loading,indicator:!0,tip:"درحال دریافت اطلاعات"},null,8,["spinning"]),t.flag?(n(),v(z,{key:0,image:l(H)},null,8,["image"])):y("",!0)],4))}});function j(){const t=$({totalPages:0,productList:[],flag:!1});return{productsData:t,getProducts:async(a,r=!1)=>{if(!r){a.value=!0;try{t.productList=await L.listProducts(),t.flag=t.productList.length<1}catch(s){console.log(s)}finally{a.value=!1}}}}}const G={class:"newest"},K={key:0,class:"newest__grid"},g=20,M=d({__name:"NewestView",setup(t){const{productsData:e,getProducts:a}=j(),r=u(!1),s=u(!1),i=u(g),m=N(()=>e.productList.slice(0,i.value));A(async()=>{await a(r,!1)});const h=async()=>{if(i.value<e.productList.length){i.value+=g;return}await a(s,!0)};return(R,Z)=>{const w=V("container");return n(),c("div",G,[o(x,{title:"جدیدترین محصولات","back-to":"home"}),o(_,{spinning:r.value,tip:"درحال دریافت اطلاعات"},{default:p(()=>[o(T,{class:"newest__scroll",loading:s.value,flag:l(e).flag,padding:"0px",onFetch:h},{default:p(()=>[o(w,{class:"newest__body"},{default:p(()=>[o(S,{title:"تازهها",subtitle:"آخرین افزودههای مجموعه"}),l(e).productList.length?(n(),c("div",K,[(n(!0),c(F,null,I(m.value,f=>(n(),v(k,{key:f.id,value:f},null,8,["value"]))),128))])):y("",!0)]),_:1})]),_:1},8,["loading","flag"])]),_:1},8,["spinning"])])}}}),rt=D(M,[["__scopeId","data-v-62cb523e"]]);export{rt as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{P as x}from"./PageBar-DP6LpIFv.js";import{E as P,a as _}from"./Spinner.vue_vue_type_style_index_0_lang-Q7UPdMbi.js";import{S}from"./SectionHead-BuisDFZg.js";import{P as k}from"./ProductCard-Cbfp9CSN.js";import{d,i as n,c,k as o,u as l,z as B,A as C,n as E,B as b,x as v,f as y,g as u,q as L,C as $,D as A,s as p,F,r as I,h as N,v as V,_ as D}from"./index-0lMAZRQB.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./SingleProduct-BCX5wlE-.js";import"./NotifyVant.vue_vue_type_script_setup_true_lang-BKaF0fT-.js";import"./index-W8LzFWDq.js";import"./DialogVant.vue_vue_type_style_index_0_lang-DiDmrjDM.js";import"./cartStore-qaurfaGv.js";import"./dialogEmpty1-Caw7F5KL.js";import"./index-BlJivYzz.js";import"./classCallCheck-Tw9-kd3s.js";const q={class:"flex justify-center items-center empty"},z=d({__name:"EmptyState",props:{description:{},image:{}},setup(t){return(e,a)=>(n(),c("div",q,[o(l(P),{description:"موردی یافت نشد",image:t.image,class:"h-[200px] w-[200px] opacity-70"},null,8,["image"])]))}}),H="/assets/favoritEmpty-CIK7qR49.svg",T=d({__name:"ScrollFetchSearch",props:{loading:{type:Boolean},flag:{type:Boolean},padding:{}},emits:["fetch"],setup(t,{emit:e}){const a=e,r=B(),s=u(null);return C(s,()=>{a("fetch")},{distance:50}),(i,m)=>(n(),c("main",{class:"flex flex-col flex-1 overflow-auto no-scrollbar w-[100vw] max-w-screen-md m-auto",style:E({paddingTop:t.padding||l(r).headerHeight+"px"}),ref_key:"scrollArea",ref:s},[b(i.$slots,"default"),o(_,{cls:"my-[10px]",spinning:t.loading,indicator:!0,tip:"درحال دریافت اطلاعات"},null,8,["spinning"]),t.flag?(n(),v(z,{key:0,image:l(H)},null,8,["image"])):y("",!0)],4))}});function j(){const t=$({totalPages:0,productList:[],flag:!1});return{productsData:t,getProducts:async(a,r=!1)=>{if(!r){a.value=!0;try{t.productList=await L.listProducts(),t.flag=t.productList.length<1}catch(s){console.log(s)}finally{a.value=!1}}}}}const G={class:"newest"},K={key:0,class:"newest__grid"},g=20,M=d({__name:"NewestView",setup(t){const{productsData:e,getProducts:a}=j(),r=u(!1),s=u(!1),i=u(g),m=N(()=>e.productList.slice(0,i.value));A(async()=>{await a(r,!1)});const h=async()=>{if(i.value<e.productList.length){i.value+=g;return}await a(s,!0)};return(R,Z)=>{const w=V("container");return n(),c("div",G,[o(x,{title:"جدیدترین محصولات","back-to":"home"}),o(_,{spinning:r.value,tip:"درحال دریافت اطلاعات"},{default:p(()=>[o(T,{class:"newest__scroll",loading:s.value,flag:l(e).flag,padding:"0px",onFetch:h},{default:p(()=>[o(w,{class:"newest__body"},{default:p(()=>[o(S,{title:"تازهها",subtitle:"آخرین افزودههای مجموعه"}),l(e).productList.length?(n(),c("div",K,[(n(!0),c(F,null,I(m.value,f=>(n(),v(k,{key:f.id,value:f},null,8,["value"]))),128))])):y("",!0)]),_:1})]),_:1},8,["loading","flag"])]),_:1},8,["spinning"])])}}}),it=D(M,[["__scopeId","data-v-62cb523e"]]);export{it as default};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as a,c as n,k as o,s as i,v as c,i as _,b as e,I as r,_ as p}from"./index-zU76P609.js";import{P as d}from"./PageBar-BNTdgQIH.js";const f={class:"notif"},l={class:"notif__empty"},m=a({__name:"NotificationsView",setup(u){return(v,t)=>{const s=c("container");return _(),n("div",f,[o(d,{title:"اعلانها","back-to":"home"}),o(s,{class:"notif__body"},{default:i(()=>[e("section",l,[o(r,{icon:"vuesax-linear:notification",size:"26"}),t[0]||(t[0]=e("p",null,"اعلانی برای نمایش وجود ندارد.",-1))])]),_:1})])}}}),B=p(m,[["__scopeId","data-v-44d0c9a5"]]);export{B as default};
|
||||
import{d as a,c as n,k as o,s as i,v as c,i as _,b as e,I as r,_ as p}from"./index-0lMAZRQB.js";import{P as d}from"./PageBar-DP6LpIFv.js";const f={class:"notif"},l={class:"notif__empty"},m=a({__name:"NotificationsView",setup(u){return(v,t)=>{const s=c("container");return _(),n("div",f,[o(d,{title:"اعلانها","back-to":"home"}),o(s,{class:"notif__body"},{default:i(()=>[e("section",l,[o(r,{icon:"vuesax-linear:notification",size:"26"}),t[0]||(t[0]=e("p",null,"اعلانی برای نمایش وجود ندارد.",-1))])]),_:1})])}}}),B=p(m,[["__scopeId","data-v-44d0c9a5"]]);export{B as default};
|
||||
-1
@@ -1 +0,0 @@
|
||||
import{d as r,k as n,ai as p,aj as f,ak as h,al as w,am as y,an as k,a7 as x,ao as c,a6 as g,ae as N,H as S,i as V,c as v,u as P,n as B,s as _,b as l,I as b,B as I,E as z,t as C,f as O,g as E}from"./index-zU76P609.js";const[T,U]=g("notify"),j=["lockScroll","position","show","teleport","zIndex"],D=w({},y,{type:c("danger"),color:String,message:x,position:c("top"),className:k,background:String,lockScroll:Boolean});var H=r({name:T,props:D,emits:["update:show"],setup(e,{emit:o,slots:t}){const a=s=>o("update:show",s);return()=>n(h,p({class:[U([e.type]),e.className],style:{color:e.color,background:e.background},overlay:!1,duration:.2,"onUpdate:show":a},f(e,j)),{default:()=>[t.default?t.default():e.message]})}});const $=N(H),q={key:0,class:"flex"},A={class:"w-full text-white my-2"},F={class:"w-full flex content-end"},J=r({__name:"NotifyVant",props:{modelValue:{type:Boolean},timeOut:{},text:{},color:{}},emits:["update:modelValue"],setup(e,{emit:o}){const t=E(!0),a=e,s=o;S(()=>a.modelValue,()=>{a.timeOut!==-1&&u()});const u=()=>{setTimeout(()=>{s("update:modelValue",!1)},a.timeOut)};return(d,i)=>e.modelValue?(V(),v("div",q,[n(P($),{show:t.value,"onUpdate:show":i[0]||(i[0]=m=>t.value=m),style:B(e.color)},{default:_(()=>[l("div",A,[l("div",F,[n(b,{icon:"vuesax-linear:info-circle",class:"ml-[20px] text-white",size:"25"}),l("div",null,[I(d.$slots,"default",{},()=>[z(C(e.text),1)])])])])]),_:3},8,["show","style"])])):O("",!0)}});export{J as _};
|
||||
+1
@@ -0,0 +1 @@
|
||||
import{d as m,H as r,i as f,c as h,k as l,u as w,n as x,s as p,b as o,I as y,B as V,E as N,t as v,f as B,g as _}from"./index-0lMAZRQB.js";import{N as k}from"./index-W8LzFWDq.js";const C={key:0,class:"flex"},O={class:"w-full text-white my-2"},S={class:"w-full flex content-end"},E=m({__name:"NotifyVant",props:{modelValue:{type:Boolean},timeOut:{},text:{},color:{}},emits:["update:modelValue"],setup(e,{emit:i}){const s=_(!0),t=e,n=i;r(()=>t.modelValue,()=>{t.timeOut!==-1&&c()});const c=()=>{setTimeout(()=>{n("update:modelValue",!1)},t.timeOut)};return(u,a)=>e.modelValue?(f(),h("div",C,[l(w(k),{show:s.value,"onUpdate:show":a[0]||(a[0]=d=>s.value=d),style:x(e.color)},{default:p(()=>[o("div",O,[o("div",S,[l(y,{icon:"vuesax-linear:info-circle",class:"ml-[20px] text-white",size:"25"}),o("div",null,[V(u.$slots,"default",{},()=>[N(v(e.text),1)])])])])]),_:3},8,["show","style"])])):B("",!0)}});export{E as _};
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{d as _,c as s,b as a,k as d,I as b,t as u,B as i,i as t,y as p,_ as k}from"./index-zU76P609.js";const h={class:"bar"},f={class:"bar__inner"},B={key:1,class:"bar__spacer","aria-hidden":"true"},m={class:"bar__title"},g={class:"bar__trailing"},y=_({__name:"PageBar",props:{title:{},back:{type:Boolean,default:!0},backTo:{}},setup(e){const o=e,r=p();function l(){o.backTo?r.push({name:o.backTo}):r.back()}return(n,c)=>(t(),s("header",h,[a("div",f,[e.back?(t(),s("button",{key:0,type:"button",class:"bar__btn","aria-label":"بازگشت",onClick:l},[d(b,{icon:"vuesax-linear:arrow-right-1",size:"20"})])):(t(),s("span",B)),a("h1",m,u(e.title),1),a("div",g,[i(n.$slots,"trailing",{},()=>[c[0]||(c[0]=a("span",{class:"bar__spacer","aria-hidden":"true"},null,-1))],!0)])]),i(n.$slots,"below",{},void 0,!0)]))}}),I=k(y,[["__scopeId","data-v-d2d3dfeb"]]);export{I as P};
|
||||
import{d as _,c as s,b as a,k as d,I as b,t as u,B as i,i as t,y as p,_ as k}from"./index-0lMAZRQB.js";const h={class:"bar"},f={class:"bar__inner"},B={key:1,class:"bar__spacer","aria-hidden":"true"},m={class:"bar__title"},g={class:"bar__trailing"},y=_({__name:"PageBar",props:{title:{},back:{type:Boolean,default:!0},backTo:{}},setup(e){const o=e,r=p();function l(){o.backTo?r.push({name:o.backTo}):r.back()}return(n,c)=>(t(),s("header",h,[a("div",f,[e.back?(t(),s("button",{key:0,type:"button",class:"bar__btn","aria-label":"بازگشت",onClick:l},[d(b,{icon:"vuesax-linear:arrow-right-1",size:"20"})])):(t(),s("span",B)),a("h1",m,u(e.title),1),a("div",g,[i(n.$slots,"trailing",{},()=>[c[0]||(c[0]=a("span",{class:"bar__spacer","aria-hidden":"true"},null,-1))],!0)])]),i(n.$slots,"below",{},void 0,!0)]))}}),I=k(y,[["__scopeId","data-v-d2d3dfeb"]]);export{I as P};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as D,l as P,i as s,c as i,F as S,b as t,u as e,w as z,k as _,I as f,j as B,e as I,f as d,t as u,s as N,x as V,g as E,h as $,_ as j}from"./index-zU76P609.js";import{u as q,S as L}from"./SingleProduct-Bo-ynxSe.js";import{u as M}from"./cartStore-BxC8w6kf.js";import{D as O}from"./index-BL4GBXwx.js";const U={class:"pc__art"},A=["alt"],G={key:1,class:"pc__artEmpty","aria-hidden":"true"},H=["aria-label"],J={key:2,class:"pc__flag"},K={key:3,class:"pc__flag pc__flag--soft"},Q={class:"pc__body"},R={class:"pc__title"},T={class:"pc__meta"},W={class:"pc__weight"},X={key:0,class:"pc__wage"},Y=D({__name:"ProductCard",props:{value:{}},setup(g){const h=g,n=q(),{image:p,id:a,title:v,min_gram:y,wage:m,is_exist:b,qty:k,isPreOrder:w}=M(h.value),l=E(!1);function x(){l.value=!0}const C=$(()=>{const r=m.value;return r==null?"":r%1===0?String(r):r.toFixed(2)});return(r,o)=>{const F=P("lazy");return s(),i(S,null,[t("article",{class:"pc",onClick:x},[t("div",U,[e(p)?z((s(),i("img",{key:0,alt:e(v)},null,8,A)),[[F,e(p)]]):(s(),i("div",G,[_(f,{icon:"vuesax-linear:diamonds",size:"26"})])),t("button",{type:"button",class:I(["pc__fav",{"is-on":e(n).isFavorite(e(a))}]),"aria-label":e(n).isFavorite(e(a))?"حذف از علاقهمندی":"افزودن به علاقهمندی",onClick:o[0]||(o[0]=B(c=>e(n).toggle(e(a)),["stop"]))},[_(f,{icon:e(n).isFavorite(e(a))?"vuesax-linear:heart-fill":"vuesax-linear:heart",size:"16"},null,8,["icon"])],10,H),e(b)?e(w)&&e(k)===0?(s(),i("span",K,"پیشسفارش")):d("",!0):(s(),i("span",J,"ناموجود"))]),t("div",Q,[t("h3",R,u(e(v)),1),t("div",T,[t("span",W,u(e(y))+" گرم",1),e(m)!=null?(s(),i("span",X,"اجرت "+u(C.value)+"٪",1)):d("",!0)])])]),_(e(O),{visible:l.value,"onUpdate:visible":o[2]||(o[2]=c=>l.value=c),placement:"bottom",closable:!1,class:"rtl",height:"100vh",bodyStyle:{padding:0,position:"relative"}},{default:N(()=>[l.value?(s(),V(L,{id:e(a),key:e(a),onCloseDrawer:o[1]||(o[1]=c=>l.value=!1)},null,8,["id"])):d("",!0)]),_:1},8,["visible"])],64)}}}),ae=j(Y,[["__scopeId","data-v-5658bc04"]]);export{ae as P};
|
||||
import{d as D,l as P,i as s,c as i,F as S,b as t,u as e,w as z,k as _,I as f,j as B,e as I,f as d,t as u,s as N,x as V,g as E,h as $,_ as j}from"./index-0lMAZRQB.js";import{u as q,S as L}from"./SingleProduct-BCX5wlE-.js";import{u as M}from"./cartStore-qaurfaGv.js";import{D as O}from"./index-BlJivYzz.js";const U={class:"pc__art"},A=["alt"],G={key:1,class:"pc__artEmpty","aria-hidden":"true"},H=["aria-label"],J={key:2,class:"pc__flag"},K={key:3,class:"pc__flag pc__flag--soft"},Q={class:"pc__body"},R={class:"pc__title"},T={class:"pc__meta"},W={class:"pc__weight"},X={key:0,class:"pc__wage"},Y=D({__name:"ProductCard",props:{value:{}},setup(g){const h=g,n=q(),{image:p,id:a,title:v,min_gram:y,wage:m,is_exist:b,qty:k,isPreOrder:w}=M(h.value),l=E(!1);function x(){l.value=!0}const C=$(()=>{const r=m.value;return r==null?"":r%1===0?String(r):r.toFixed(2)});return(r,o)=>{const F=P("lazy");return s(),i(S,null,[t("article",{class:"pc",onClick:x},[t("div",U,[e(p)?z((s(),i("img",{key:0,alt:e(v)},null,8,A)),[[F,e(p)]]):(s(),i("div",G,[_(f,{icon:"vuesax-linear:diamonds",size:"26"})])),t("button",{type:"button",class:I(["pc__fav",{"is-on":e(n).isFavorite(e(a))}]),"aria-label":e(n).isFavorite(e(a))?"حذف از علاقهمندی":"افزودن به علاقهمندی",onClick:o[0]||(o[0]=B(c=>e(n).toggle(e(a)),["stop"]))},[_(f,{icon:e(n).isFavorite(e(a))?"vuesax-linear:heart-fill":"vuesax-linear:heart",size:"16"},null,8,["icon"])],10,H),e(b)?e(w)&&e(k)===0?(s(),i("span",K,"پیشسفارش")):d("",!0):(s(),i("span",J,"ناموجود"))]),t("div",Q,[t("h3",R,u(e(v)),1),t("div",T,[t("span",W,u(e(y))+" گرم",1),e(m)!=null?(s(),i("span",X,"اجرت "+u(C.value)+"٪",1)):d("",!0)])])]),_(e(O),{visible:l.value,"onUpdate:visible":o[2]||(o[2]=c=>l.value=c),placement:"bottom",closable:!1,class:"rtl",height:"100vh",bodyStyle:{padding:0,position:"relative"}},{default:N(()=>[l.value?(s(),V(L,{id:e(a),key:e(a),onCloseDrawer:o[1]||(o[1]=c=>l.value=!1)},null,8,["id"])):d("",!0)]),_:1},8,["visible"])],64)}}}),ae=j(Y,[["__scopeId","data-v-5658bc04"]]);export{ae as P};
|
||||
@@ -0,0 +1 @@
|
||||
.prof[data-v-bde55e2f]{background:#fff;min-height:100vh}.prof__body[data-v-bde55e2f]{padding-top:80px;padding-bottom:90px}.prof__identity[data-v-bde55e2f]{display:flex;flex-direction:column;align-items:center;text-align:center;padding:26px 20px 28px;border:1px solid #ECEDEF;border-radius:20px;background:#fafafa}.prof__avatar[data-v-bde55e2f]{width:72px;height:72px;border-radius:50%;display:grid;place-items:center;color:#7a1b33;background:#fbf2f4}.prof__name[data-v-bde55e2f]{margin:14px 0 0;font-size:15.5px;font-weight:800;color:#14161a}.prof__mobile[data-v-bde55e2f]{margin:6px 0 0;font-size:12.5px;color:#5b616e;direction:ltr}.prof__seal[data-v-bde55e2f]{margin-top:12px;padding:5px 12px;border-radius:999px;font-size:11px;font-weight:700}.prof__seal.is-ok[data-v-bde55e2f]{color:#16a34a;background:#f0fdf4}.prof__seal.is-pending[data-v-bde55e2f]{color:#7a1b33;background:#fbf2f4}.prof__block[data-v-bde55e2f]{margin-top:26px}.prof__specs[data-v-bde55e2f]{margin:0;border:1px solid #ECEDEF;border-radius:18px;overflow:hidden}.prof__spec[data-v-bde55e2f]{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:13px 14px;border-bottom:1px solid #F4F5F6}.prof__spec[data-v-bde55e2f]:last-child{border-bottom:0}.prof__spec dt[data-v-bde55e2f]{margin:0;font-size:12px;color:#8a909c}.prof__spec dd[data-v-bde55e2f]{margin:0;font-size:12.5px;font-weight:700;color:#14161a;text-align:left}.prof__empty[data-v-bde55e2f]{margin-top:26px;padding:34px 20px;border:1px dashed #ECEDEF;border-radius:18px;display:flex;flex-direction:column;align-items:center;gap:10px;color:#8a909c}.prof__empty p[data-v-bde55e2f]{margin:0;font-size:12.5px}.prof__complete[data-v-bde55e2f]{margin-top:20px;width:100%;padding:14px;border:none;border-radius:14px;background:#14161a;color:#fff;font-family:inherit;font-size:15px;font-weight:700;cursor:pointer}
|
||||
@@ -1 +0,0 @@
|
||||
import{d as S,G as I,o as E,q as y,c as a,k as i,s as b,g as c,v as k,i as l,b as e,I as p,t,f as _,e as V,h as g,_ as h}from"./index-zU76P609.js";import{P as N}from"./PageBar-BNTdgQIH.js";import{S as T}from"./SectionHead-DiMH7kD3.js";const B={class:"prof"},C={class:"prof__identity"},P={class:"prof__avatar","aria-hidden":"true"},x={class:"prof__name"},D={key:0,class:"prof__mobile"},R={key:0,class:"prof__block"},w={class:"prof__specs"},F={class:"prof__spec"},M={class:"prof__spec"},z={class:"prof__spec"},L={class:"prof__spec"},O={key:1,class:"prof__empty"},U=S({__name:"ProfileView",setup(A){const d={UNVERIFIED:"احراز نشده",STEP_ONE_SUBMITTED:"مرحله اول ثبت شده",STEP_TWO_SUBMITTED:"مرحله دوم ثبت شده",VERIFIED:"تایید شده"},f=I(),s=c(null),n=c(!1),v=g(()=>{var r;return((r=s.value)==null?void 0:r.verificationStep)==="VERIFIED"});return E(async()=>{if(f.isLoggedIn){n.value=!0;try{s.value=await y.getMe()}finally{n.value=!1}}}),(r,o)=>{const m=k("container");return l(),a("div",B,[i(N,{title:"اطلاعات کاربری","back-to":"userPage::hasSubRoute"}),i(m,{class:"prof__body"},{default:b(()=>{var u;return[e("section",C,[e("div",P,[i(p,{icon:"vuesax-linear:user",size:"30"})]),e("h2",x,t(((u=s.value)==null?void 0:u.fullName)??"—"),1),s.value?(l(),a("p",D,t(s.value.mobile),1)):_("",!0),s.value?(l(),a("span",{key:1,class:V(["prof__seal",v.value?"is-ok":"is-pending"])},t(d[s.value.verificationStep]??s.value.verificationStep),3)):_("",!0)]),s.value?(l(),a("section",R,[i(T,{title:"مشخصات",subtitle:"اطلاعات ثبتشده حساب شما"}),e("dl",w,[e("div",F,[o[0]||(o[0]=e("dt",null,"نام و نام خانوادگی",-1)),e("dd",null,t(s.value.fullName),1)]),e("div",M,[o[1]||(o[1]=e("dt",null,"تلفن همراه",-1)),e("dd",null,t(s.value.mobile),1)]),e("div",z,[o[2]||(o[2]=e("dt",null,"کد ملی",-1)),e("dd",null,t(s.value.nationalCode),1)]),e("div",L,[o[3]||(o[3]=e("dt",null,"وضعیت احراز هویت",-1)),e("dd",null,t(d[s.value.verificationStep]??s.value.verificationStep),1)])])])):n.value?_("",!0):(l(),a("section",O,[i(p,{icon:"vuesax-linear:user",size:"26"}),o[4]||(o[4]=e("p",null,"اطلاعات حساب در دسترس نیست.",-1))]))]}),_:1})])}}}),W=h(U,[["__scopeId","data-v-adfdabd9"]]);export{W as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{d as y,G as b,o as k,q as T,c as l,k as i,s as V,g as d,v as P,i as n,b as e,I as p,t as a,f as r,e as g,u as B,h as f,y as C,_ as D}from"./index-0lMAZRQB.js";import{P as N}from"./PageBar-DP6LpIFv.js";import{S as h}from"./SectionHead-BuisDFZg.js";const R={class:"prof"},x={class:"prof__identity"},F={class:"prof__avatar","aria-hidden":"true"},M={class:"prof__name"},w={key:0,class:"prof__mobile"},O={key:0,class:"prof__block"},U={class:"prof__specs"},z={class:"prof__spec"},L={class:"prof__spec"},A={class:"prof__spec"},W={class:"prof__spec"},q={key:1,class:"prof__empty"},G=y({__name:"ProfileView",setup(H){const _={UNVERIFIED:"احراز نشده",STEP_ONE_SUBMITTED:"مرحله اول ثبت شده",STEP_TWO_SUBMITTED:"مرحله دوم ثبت شده",VERIFIED:"تایید شده"},v=b(),s=d(null),u=d(!1),m=f(()=>{var t;return((t=s.value)==null?void 0:t.verificationStep)==="VERIFIED"}),S=f(()=>{var o;const t=(o=s.value)==null?void 0:o.verificationStep;return!!t&&t!=="VERIFIED"&&t!=="STEP_TWO_SUBMITTED"}),E=C();return k(async()=>{if(v.isLoggedIn){u.value=!0;try{s.value=await T.getMe()}finally{u.value=!1}}}),(t,o)=>{const I=P("container");return n(),l("div",R,[i(N,{title:"اطلاعات کاربری","back-to":"userPage::hasSubRoute"}),i(I,{class:"prof__body"},{default:V(()=>{var c;return[e("section",x,[e("div",F,[i(p,{icon:"vuesax-linear:user",size:"30"})]),e("h2",M,a(((c=s.value)==null?void 0:c.fullName)??"—"),1),s.value?(n(),l("p",w,a(s.value.mobile),1)):r("",!0),s.value?(n(),l("span",{key:1,class:g(["prof__seal",m.value?"is-ok":"is-pending"])},a(_[s.value.verificationStep]??s.value.verificationStep),3)):r("",!0)]),s.value?(n(),l("section",O,[i(h,{title:"مشخصات",subtitle:"اطلاعات ثبتشده حساب شما"}),e("dl",U,[e("div",z,[o[1]||(o[1]=e("dt",null,"نام و نام خانوادگی",-1)),e("dd",null,a(s.value.fullName),1)]),e("div",L,[o[2]||(o[2]=e("dt",null,"تلفن همراه",-1)),e("dd",null,a(s.value.mobile),1)]),e("div",A,[o[3]||(o[3]=e("dt",null,"کد ملی",-1)),e("dd",null,a(s.value.nationalCode),1)]),e("div",W,[o[4]||(o[4]=e("dt",null,"وضعیت احراز هویت",-1)),e("dd",null,a(_[s.value.verificationStep]??s.value.verificationStep),1)])])])):u.value?r("",!0):(n(),l("section",q,[i(p,{icon:"vuesax-linear:user",size:"26"}),o[5]||(o[5]=e("p",null,"اطلاعات حساب در دسترس نیست.",-1))])),S.value?(n(),l("button",{key:2,type:"button",class:"prof__complete",onClick:o[0]||(o[0]=$=>B(E).push({name:"completeProfile"}))}," تکمیل پروفایل ")):r("",!0)]}),_:1})])}}}),Q=D(G,[["__scopeId","data-v-bde55e2f"]]);export{Q as default};
|
||||
@@ -1 +0,0 @@
|
||||
.prof[data-v-adfdabd9]{background:#fff;min-height:100vh}.prof__body[data-v-adfdabd9]{padding-top:80px;padding-bottom:90px}.prof__identity[data-v-adfdabd9]{display:flex;flex-direction:column;align-items:center;text-align:center;padding:26px 20px 28px;border:1px solid #ECEDEF;border-radius:20px;background:#fafafa}.prof__avatar[data-v-adfdabd9]{width:72px;height:72px;border-radius:50%;display:grid;place-items:center;color:#7a1b33;background:#fbf2f4}.prof__name[data-v-adfdabd9]{margin:14px 0 0;font-size:15.5px;font-weight:800;color:#14161a}.prof__mobile[data-v-adfdabd9]{margin:6px 0 0;font-size:12.5px;color:#5b616e;direction:ltr}.prof__seal[data-v-adfdabd9]{margin-top:12px;padding:5px 12px;border-radius:999px;font-size:11px;font-weight:700}.prof__seal.is-ok[data-v-adfdabd9]{color:#16a34a;background:#f0fdf4}.prof__seal.is-pending[data-v-adfdabd9]{color:#7a1b33;background:#fbf2f4}.prof__block[data-v-adfdabd9]{margin-top:26px}.prof__specs[data-v-adfdabd9]{margin:0;border:1px solid #ECEDEF;border-radius:18px;overflow:hidden}.prof__spec[data-v-adfdabd9]{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:13px 14px;border-bottom:1px solid #F4F5F6}.prof__spec[data-v-adfdabd9]:last-child{border-bottom:0}.prof__spec dt[data-v-adfdabd9]{margin:0;font-size:12px;color:#8a909c}.prof__spec dd[data-v-adfdabd9]{margin:0;font-size:12.5px;font-weight:700;color:#14161a;text-align:left}.prof__empty[data-v-adfdabd9]{margin-top:26px;padding:34px 20px;border:1px dashed #ECEDEF;border-radius:18px;display:flex;flex-direction:column;align-items:center;gap:10px;color:#8a909c}.prof__empty p[data-v-adfdabd9]{margin:0;font-size:12.5px}
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{p as c,j as d}from"./filters-CLL9nGZ2.js";import{d as u,c as s,e as _,b as a,E as l,t as i,u as n,f as m,h as v,i as r,_ as q}from"./index-zU76P609.js";const f={key:0,class:"rate-strip__value"},k={class:"rate-strip__num"},y={key:1,class:"rate-strip__value rate-strip__value--muted"},x={key:2,class:"rate-strip__time"},R=u({__name:"RateStrip",props:{quote:{}},setup(t){const o=t,p=v(()=>o.quote?o.quote.pricePerGramRial.split(".")[0]:"");return(b,e)=>(r(),s("div",{class:_(["rate-strip",{"is-empty":!t.quote}])},[e[1]||(e[1]=a("div",{class:"rate-strip__label"},[a("span",{class:"rate-strip__dot","aria-hidden":"true"}),l(" نرخ طلای ۱۸ عیار ")],-1)),t.quote?(r(),s("div",f,[a("span",k,i(n(c)(p.value)),1),e[0]||(e[0]=a("span",{class:"rate-strip__unit"},"ریال / گرم",-1))])):(r(),s("div",y,"در انتظار اعلام نرخ")),t.quote?(r(),s("div",x,i(n(d)(t.quote.quotedAt)),1)):m("",!0)],2))}}),C=q(R,[["__scopeId","data-v-16b4c8d5"]]);export{C as R};
|
||||
import{p as c,j as d}from"./filters-CLL9nGZ2.js";import{d as u,c as s,e as _,b as a,E as l,t as i,u as n,f as m,h as v,i as r,_ as q}from"./index-0lMAZRQB.js";const f={key:0,class:"rate-strip__value"},k={class:"rate-strip__num"},y={key:1,class:"rate-strip__value rate-strip__value--muted"},x={key:2,class:"rate-strip__time"},R=u({__name:"RateStrip",props:{quote:{}},setup(t){const o=t,p=v(()=>o.quote?o.quote.pricePerGramRial.split(".")[0]:"");return(b,e)=>(r(),s("div",{class:_(["rate-strip",{"is-empty":!t.quote}])},[e[1]||(e[1]=a("div",{class:"rate-strip__label"},[a("span",{class:"rate-strip__dot","aria-hidden":"true"}),l(" نرخ طلای ۱۸ عیار ")],-1)),t.quote?(r(),s("div",f,[a("span",k,i(n(c)(p.value)),1),e[0]||(e[0]=a("span",{class:"rate-strip__unit"},"ریال / گرم",-1))])):(r(),s("div",y,"در انتظار اعلام نرخ")),t.quote?(r(),s("div",x,i(n(d)(t.quote.quotedAt)),1)):m("",!0)],2))}}),C=q(R,[["__scopeId","data-v-16b4c8d5"]]);export{C as R};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as v,a3 as h,H as m,i as t,c as l,k as n,I as r,w as f,a4 as b,b as k,a5 as x,f as C,C as I,g as w,_ as y}from"./index-zU76P609.js";const S={class:"si"},V=["placeholder"],B=v({__name:"SearchInput",props:{placeHolder:{}},emits:["search"],setup(i,{emit:d}){const c=d,a=I({clear:!1}),e=w(void 0),s=()=>{c("search",e.value)},u=()=>{e.value=void 0,a.clear=!1,c("search",void 0)},p=h(e,700);return m(p,()=>{e?a.clear=!0:a.clear=!1,s()}),(H,o)=>(t(),l("div",S,[n(r,{icon:"vuesax-linear:search-normal-1",class:"si__icon",size:"18",onClick:s}),f(k("input",{"onUpdate:modelValue":o[0]||(o[0]=_=>e.value=_),class:"si__input",placeholder:i.placeHolder,onKeyup:x(s,["enter"])},null,40,V),[[b,e.value]]),a.clear?(t(),l("button",{key:0,type:"button",class:"si__clear","aria-label":"پاک کردن",onClick:u},[n(r,{icon:"vuesax-linear:add",size:"16"})])):C("",!0)]))}}),z=y(B,[["__scopeId","data-v-4c50067a"]]);export{z as S};
|
||||
import{d as v,aa as h,H as m,i as t,c as l,k as n,I as r,w as f,ab as b,b as k,ac as x,f as C,C as I,g as w,_ as y}from"./index-0lMAZRQB.js";const S={class:"si"},V=["placeholder"],B=v({__name:"SearchInput",props:{placeHolder:{}},emits:["search"],setup(i,{emit:d}){const c=d,a=I({clear:!1}),e=w(void 0),s=()=>{c("search",e.value)},u=()=>{e.value=void 0,a.clear=!1,c("search",void 0)},p=h(e,700);return m(p,()=>{e?a.clear=!0:a.clear=!1,s()}),(H,o)=>(t(),l("div",S,[n(r,{icon:"vuesax-linear:search-normal-1",class:"si__icon",size:"18",onClick:s}),f(k("input",{"onUpdate:modelValue":o[0]||(o[0]=_=>e.value=_),class:"si__input",placeholder:i.placeHolder,onKeyup:x(s,["enter"])},null,40,V),[[b,e.value]]),a.clear?(t(),l("button",{key:0,type:"button",class:"si__clear","aria-label":"پاک کردن",onClick:u},[n(r,{icon:"vuesax-linear:add",size:"16"})])):C("",!0)]))}}),z=y(B,[["__scopeId","data-v-4c50067a"]]);export{z as S};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{d as r,c as t,b as o,t as s,f as n,E as _,k as d,I as u,i as a,_ as b}from"./index-zU76P609.js";const m={class:"sec"},f={class:"sec__text"},k={class:"sec__title"},x={key:0,class:"sec__sub"},h=r({__name:"SectionHead",props:{title:{},subtitle:{},actionLabel:{}},emits:["action"],setup(e,{emit:i}){const l=i;return(p,c)=>(a(),t("header",m,[o("div",f,[o("h2",k,s(e.title),1),e.subtitle?(a(),t("p",x,s(e.subtitle),1)):n("",!0)]),e.actionLabel?(a(),t("button",{key:0,type:"button",class:"sec__action",onClick:c[0]||(c[0]=v=>l("action"))},[_(s(e.actionLabel)+" ",1),d(u,{icon:"vuesax-linear:arrow-left-2",size:"15"})])):n("",!0)]))}}),N=b(h,[["__scopeId","data-v-e5c65b7c"]]);export{N as S};
|
||||
import{d as r,c as t,b as o,t as s,f as n,E as _,k as d,I as u,i as a,_ as b}from"./index-0lMAZRQB.js";const m={class:"sec"},f={class:"sec__text"},k={class:"sec__title"},x={key:0,class:"sec__sub"},h=r({__name:"SectionHead",props:{title:{},subtitle:{},actionLabel:{}},emits:["action"],setup(e,{emit:i}){const l=i;return(p,c)=>(a(),t("header",m,[o("div",f,[o("h2",k,s(e.title),1),e.subtitle?(a(),t("p",x,s(e.subtitle),1)):n("",!0)]),e.actionLabel?(a(),t("button",{key:0,type:"button",class:"sec__action",onClick:c[0]||(c[0]=v=>l("action"))},[_(s(e.actionLabel)+" ",1),d(u,{icon:"vuesax-linear:arrow-left-2",size:"15"})])):n("",!0)]))}}),N=b(h,[["__scopeId","data-v-e5c65b7c"]]);export{N as S};
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{d as b,G as A,o as C,q as D,c as i,k as r,s as f,x as w,u as E,f as m,g as u,i as l,F as y,b as s,r as L,I as g,t as o,e as p,v as N,_ as M}from"./index-zU76P609.js";import{P}from"./PageBar-BNTdgQIH.js";import{a as O}from"./Spinner.vue_vue_type_style_index_0_lang-8IfA4lPE.js";import{S as B}from"./SectionHead-DiMH7kD3.js";import{j as R,p as U}from"./filters-CLL9nGZ2.js";import{D as I}from"./index-BL4GBXwx.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./classCallCheck-BeQXLUEU.js";const V={class:"tx"},$={class:"tx__list"},G=["onClick"],Y={class:"tx__main"},z={class:"tx__head"},F={class:"tx__kind"},H={key:0,class:"tx__note"},j={class:"tx__foot"},q={class:"tx__date"},J={key:1,class:"tx__empty"},K={class:"sheet"},Q={class:"sheet__specs"},W={class:"sheet__spec"},X={class:"sheet__spec"},Z={class:"sheet__spec"},ss={class:"sheet__spec"},es={class:"sheet__spec"},ts=b({__name:"TransactionsView",setup(os){const x={ORDER_STOCK:"سفارش",ORDER_PRE_ORDER:"سفارش ساخت",REPAYMENT_MELTED_GOLD:"طلای آبشده",REPAYMENT_TRANSFER:"حواله",REPAYMENT_CHEQUE:"چک",REPAYMENT_CASH:"پولی",WALLET_BONUS:"پاداش",ADJUSTMENT:"اصلاحیه"},T=A(),_=u(!1),d=u([]),v=u(!1),n=u(null),c=a=>a.direction==="CREDIT",h=a=>a.currency==="GOLD_GRAM"?`${a.amount} گرم`:`${U(a.amount)} ریال`,k=a=>{n.value=a,v.value=!0};return C(async()=>{if(T.isLoggedIn){_.value=!0;try{d.value=await D.getMyLedgerEntries()}finally{_.value=!1}}}),(a,e)=>{const S=N("container");return l(),i("div",V,[r(P,{title:"اسناد","back-to":"userPage::hasSubRoute"}),r(O,{spinning:_.value,tip:"درحال دریافت اطلاعات"},{default:f(()=>[r(S,{class:"tx__body"},{default:f(()=>[d.value.length?(l(),i(y,{key:0},[r(B,{title:"گردش حساب",subtitle:`${d.value.length} سند`},null,8,["subtitle"]),s("div",$,[(l(!0),i(y,null,L(d.value,t=>(l(),i("article",{key:t.id,class:"tx__row",onClick:ns=>k(t)},[s("span",{class:p(["tx__mark",c(t)?"is-in":"is-out"]),"aria-hidden":"true"},[r(g,{icon:c(t)?"vuesax-linear:arrow-down":"vuesax-linear:arrow-up",size:"16"},null,8,["icon"])],2),s("div",Y,[s("div",z,[s("h3",F,o(x[t.sourceType]??t.sourceType),1),s("span",{class:p(["tx__amount",c(t)?"is-in":"is-out"])},o(h(t)),3)]),t.note?(l(),i("p",H,o(t.note),1)):m("",!0),s("div",j,[s("span",q,o(E(R)(t.createdAt)),1),s("span",{class:p(["tx__state",{"is-pending":!t.confirmed}])},o(t.confirmed?"تایید شده":"در انتظار تایید"),3)])])],8,G))),128))])],64)):_.value?m("",!0):(l(),i("section",J,[r(g,{icon:"vuesax-linear:receipt-text",size:"26"}),e[1]||(e[1]=s("p",null,"سندی برای حساب شما ثبت نشده است.",-1))]))]),_:1})]),_:1},8,["spinning"]),n.value?(l(),w(E(I),{key:0,visible:v.value,"onUpdate:visible":e[0]||(e[0]=t=>v.value=t),placement:"bottom",closable:!1,height:"420px",class:"rtl",bodyStyle:{padding:0}},{default:f(()=>[s("div",K,[e[7]||(e[7]=s("h3",{class:"sheet__title"},"جزئیات سند",-1)),s("dl",Q,[s("div",W,[e[2]||(e[2]=s("dt",null,"نوع سند",-1)),s("dd",null,o(x[n.value.sourceType]??n.value.sourceType),1)]),s("div",X,[e[3]||(e[3]=s("dt",null,"مبلغ",-1)),s("dd",{class:p(c(n.value)?"is-in":"is-out")},o(h(n.value)),3)]),s("div",Z,[e[4]||(e[4]=s("dt",null,"وضعیت",-1)),s("dd",null,o(n.value.confirmed?"تایید شده":"در انتظار تایید"),1)]),s("div",ss,[e[5]||(e[5]=s("dt",null,"تاریخ",-1)),s("dd",null,o(E(R)(n.value.createdAt)),1)]),s("div",es,[e[6]||(e[6]=s("dt",null,"توضیحات",-1)),s("dd",null,o(n.value.note||"—"),1)])])])]),_:1},8,["visible"])):m("",!0)])}}}),ps=M(ts,[["__scopeId","data-v-d21f0dcb"]]);export{ps as default};
|
||||
import{d as b,G as A,o as C,q as D,c as i,k as r,s as f,x as w,u as E,f as m,g as u,i as l,F as y,b as s,r as L,I as g,t as o,e as p,v as N,_ as M}from"./index-0lMAZRQB.js";import{P}from"./PageBar-DP6LpIFv.js";import{a as O}from"./Spinner.vue_vue_type_style_index_0_lang-Q7UPdMbi.js";import{S as B}from"./SectionHead-BuisDFZg.js";import{j as R,p as U}from"./filters-CLL9nGZ2.js";import{D as I}from"./index-BlJivYzz.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./classCallCheck-Tw9-kd3s.js";const V={class:"tx"},$={class:"tx__list"},G=["onClick"],Y={class:"tx__main"},z={class:"tx__head"},F={class:"tx__kind"},H={key:0,class:"tx__note"},j={class:"tx__foot"},q={class:"tx__date"},J={key:1,class:"tx__empty"},K={class:"sheet"},Q={class:"sheet__specs"},W={class:"sheet__spec"},X={class:"sheet__spec"},Z={class:"sheet__spec"},ss={class:"sheet__spec"},es={class:"sheet__spec"},ts=b({__name:"TransactionsView",setup(os){const x={ORDER_STOCK:"سفارش",ORDER_PRE_ORDER:"سفارش ساخت",REPAYMENT_MELTED_GOLD:"طلای آبشده",REPAYMENT_TRANSFER:"حواله",REPAYMENT_CHEQUE:"چک",REPAYMENT_CASH:"پولی",WALLET_BONUS:"پاداش",ADJUSTMENT:"اصلاحیه"},T=A(),_=u(!1),d=u([]),v=u(!1),n=u(null),c=a=>a.direction==="CREDIT",h=a=>a.currency==="GOLD_GRAM"?`${a.amount} گرم`:`${U(a.amount)} ریال`,k=a=>{n.value=a,v.value=!0};return C(async()=>{if(T.isLoggedIn){_.value=!0;try{d.value=await D.getMyLedgerEntries()}finally{_.value=!1}}}),(a,e)=>{const S=N("container");return l(),i("div",V,[r(P,{title:"اسناد","back-to":"userPage::hasSubRoute"}),r(O,{spinning:_.value,tip:"درحال دریافت اطلاعات"},{default:f(()=>[r(S,{class:"tx__body"},{default:f(()=>[d.value.length?(l(),i(y,{key:0},[r(B,{title:"گردش حساب",subtitle:`${d.value.length} سند`},null,8,["subtitle"]),s("div",$,[(l(!0),i(y,null,L(d.value,t=>(l(),i("article",{key:t.id,class:"tx__row",onClick:ns=>k(t)},[s("span",{class:p(["tx__mark",c(t)?"is-in":"is-out"]),"aria-hidden":"true"},[r(g,{icon:c(t)?"vuesax-linear:arrow-down":"vuesax-linear:arrow-up",size:"16"},null,8,["icon"])],2),s("div",Y,[s("div",z,[s("h3",F,o(x[t.sourceType]??t.sourceType),1),s("span",{class:p(["tx__amount",c(t)?"is-in":"is-out"])},o(h(t)),3)]),t.note?(l(),i("p",H,o(t.note),1)):m("",!0),s("div",j,[s("span",q,o(E(R)(t.createdAt)),1),s("span",{class:p(["tx__state",{"is-pending":!t.confirmed}])},o(t.confirmed?"تایید شده":"در انتظار تایید"),3)])])],8,G))),128))])],64)):_.value?m("",!0):(l(),i("section",J,[r(g,{icon:"vuesax-linear:receipt-text",size:"26"}),e[1]||(e[1]=s("p",null,"سندی برای حساب شما ثبت نشده است.",-1))]))]),_:1})]),_:1},8,["spinning"]),n.value?(l(),w(E(I),{key:0,visible:v.value,"onUpdate:visible":e[0]||(e[0]=t=>v.value=t),placement:"bottom",closable:!1,height:"420px",class:"rtl",bodyStyle:{padding:0}},{default:f(()=>[s("div",K,[e[7]||(e[7]=s("h3",{class:"sheet__title"},"جزئیات سند",-1)),s("dl",Q,[s("div",W,[e[2]||(e[2]=s("dt",null,"نوع سند",-1)),s("dd",null,o(x[n.value.sourceType]??n.value.sourceType),1)]),s("div",X,[e[3]||(e[3]=s("dt",null,"مبلغ",-1)),s("dd",{class:p(c(n.value)?"is-in":"is-out")},o(h(n.value)),3)]),s("div",Z,[e[4]||(e[4]=s("dt",null,"وضعیت",-1)),s("dd",null,o(n.value.confirmed?"تایید شده":"در انتظار تایید"),1)]),s("div",ss,[e[5]||(e[5]=s("dt",null,"تاریخ",-1)),s("dd",null,o(E(R)(n.value.createdAt)),1)]),s("div",es,[e[6]||(e[6]=s("dt",null,"توضیحات",-1)),s("dd",null,o(n.value.note||"—"),1)])])])]),_:1},8,["visible"])):m("",!0)])}}}),ps=M(ts,[["__scopeId","data-v-d21f0dcb"]]);export{ps as default};
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{g as d,u as C,h as a,m as F,q as S}from"./index-zU76P609.js";function W(t){return(t.qty??0)>0||!!t.isPreOrder}function Q(t){if(!t||t.length===0)return null;const e=t.filter(W);return(e.length?e:t).reduce((s,r)=>parseFloat(r.defaultWagePercent)<parseFloat(s.defaultWagePercent)?r:s)}function M(t,e){const i=d(t),s=a(()=>i.value.id),r=a(()=>i.value.title),n=a(()=>i.value.variants),o=d(e??Q(C(n))),y=a(()=>{var u,f,m,p;return((f=(u=o.value)==null?void 0:u.image)==null?void 0:f.url)??((p=(m=i.value.images)==null?void 0:m[0])==null?void 0:p.url)}),g=a(()=>o.value?parseFloat(o.value.rashWeightGrams):0),x=a(()=>o.value?parseFloat(o.value.defaultWagePercent):null),q=d(null),l=a(()=>{var u;return((u=o.value)==null?void 0:u.qty)??0}),h=a(()=>{var u;return((u=o.value)==null?void 0:u.isPreOrder)??!1}),P=a(()=>l.value>0||h.value),O=a(()=>i.value.productCode??null),_=d(!1);return{product:i,image:y,id:s,title:r,productCode:O,variants:n,selectedVariant:o,min_gram:g,wage:x,hasDiscountWage:q,qty:l,isPreOrder:h,is_exist:P,has_warranty:_}}const v="appCart";function w(){try{const t=localStorage.getItem(v);return t?JSON.parse(t):[]}catch{return[]}}function c(t){localStorage.setItem(v,JSON.stringify(t))}const N=F("cart",{state:()=>({items:w()}),actions:{async init(){try{const t=await S.listProducts(),e=[];for(const i of this.items){const s=t.find(n=>n.id===i.pid),r=s==null?void 0:s.variants.find(n=>n.id===i.vid);s&&r&&e.push({...i,product:s})}this.items=e,c(this.items)}catch(t){console.log(t)}},addToCart(t){var s,r;const e=(r=(s=t.product)==null?void 0:s.variants)==null?void 0:r.find(n=>n.id===t.vid);if(!e||!((e.qty??0)>0||e.isPreOrder))return!1;const i=this.find_index(t);return i===-1?this.items.push({...t,qty:this.capQty(t.qty,e)}):(this.items[i].product=t.product,this.items[i].qty=this.capQty(t.qty,e)),c(this.items),!0},capQty(t,e){const i=Math.max(1,Math.floor(t)||1);if(e.isPreOrder)return i;const s=e.qty??0;return s>0?Math.min(i,s):i},maxQty(t){const e=this.find_index(t);if(e===-1)return null;const i=this.variant(this.items[e]);return!i||i.isPreOrder?null:(i.qty??0)>0?i.qty:null},remove(t){const e=this.find_index(t);e>-1&&this.items.splice(e,1),c(this.items)},updateFeild(t,e,i,s){if(!this.isInCart(i))return!1;const r=e??this.find_index(i);if(s==="qty"){const n=this.variant(this.items[r]);t=n?this.capQty(Number(t),n):Math.max(1,Number(t)||1)}return this.items[r][s]=t,c(this.items),!0},find_index(t){return this.items.findIndex(e=>e.pid===t.pid&&e.vid===t.vid)},isInCart(t){return this.find_index(t)>-1},variant(t){return t.product.variants.find(e=>e.id===t.vid)},total(){return this.items.reduce((t,e)=>{const i=this.variant(e);return t+(i?parseFloat(i.rashWeightGrams)*e.qty:0)},0).toFixed(2)},clear(){this.items=[],c(this.items)}}});export{N as a,W as i,M as u};
|
||||
import{g as d,u as C,h as a,m as F,q as S}from"./index-0lMAZRQB.js";function W(t){return(t.qty??0)>0||!!t.isPreOrder}function Q(t){if(!t||t.length===0)return null;const e=t.filter(W);return(e.length?e:t).reduce((s,r)=>parseFloat(r.defaultWagePercent)<parseFloat(s.defaultWagePercent)?r:s)}function M(t,e){const i=d(t),s=a(()=>i.value.id),r=a(()=>i.value.title),n=a(()=>i.value.variants),o=d(e??Q(C(n))),y=a(()=>{var u,f,m,p;return((f=(u=o.value)==null?void 0:u.image)==null?void 0:f.url)??((p=(m=i.value.images)==null?void 0:m[0])==null?void 0:p.url)}),g=a(()=>o.value?parseFloat(o.value.rashWeightGrams):0),x=a(()=>o.value?parseFloat(o.value.defaultWagePercent):null),q=d(null),l=a(()=>{var u;return((u=o.value)==null?void 0:u.qty)??0}),h=a(()=>{var u;return((u=o.value)==null?void 0:u.isPreOrder)??!1}),P=a(()=>l.value>0||h.value),O=a(()=>i.value.productCode??null),_=d(!1);return{product:i,image:y,id:s,title:r,productCode:O,variants:n,selectedVariant:o,min_gram:g,wage:x,hasDiscountWage:q,qty:l,isPreOrder:h,is_exist:P,has_warranty:_}}const v="appCart";function w(){try{const t=localStorage.getItem(v);return t?JSON.parse(t):[]}catch{return[]}}function c(t){localStorage.setItem(v,JSON.stringify(t))}const N=F("cart",{state:()=>({items:w()}),actions:{async init(){try{const t=await S.listProducts(),e=[];for(const i of this.items){const s=t.find(n=>n.id===i.pid),r=s==null?void 0:s.variants.find(n=>n.id===i.vid);s&&r&&e.push({...i,product:s})}this.items=e,c(this.items)}catch(t){console.log(t)}},addToCart(t){var s,r;const e=(r=(s=t.product)==null?void 0:s.variants)==null?void 0:r.find(n=>n.id===t.vid);if(!e||!((e.qty??0)>0||e.isPreOrder))return!1;const i=this.find_index(t);return i===-1?this.items.push({...t,qty:this.capQty(t.qty,e)}):(this.items[i].product=t.product,this.items[i].qty=this.capQty(t.qty,e)),c(this.items),!0},capQty(t,e){const i=Math.max(1,Math.floor(t)||1);if(e.isPreOrder)return i;const s=e.qty??0;return s>0?Math.min(i,s):i},maxQty(t){const e=this.find_index(t);if(e===-1)return null;const i=this.variant(this.items[e]);return!i||i.isPreOrder?null:(i.qty??0)>0?i.qty:null},remove(t){const e=this.find_index(t);e>-1&&this.items.splice(e,1),c(this.items)},updateFeild(t,e,i,s){if(!this.isInCart(i))return!1;const r=e??this.find_index(i);if(s==="qty"){const n=this.variant(this.items[r]);t=n?this.capQty(Number(t),n):Math.max(1,Number(t)||1)}return this.items[r][s]=t,c(this.items),!0},find_index(t){return this.items.findIndex(e=>e.pid===t.pid&&e.vid===t.vid)},isInCart(t){return this.find_index(t)>-1},variant(t){return t.product.variants.find(e=>e.id===t.vid)},total(){return this.items.reduce((t,e)=>{const i=this.variant(e);return t+(i?parseFloat(i.rashWeightGrams)*e.qty:0)},0).toFixed(2)},clear(){this.items=[],c(this.items)}}});export{N as a,W as i,M as u};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{c as l}from"./Spinner.vue_vue_type_style_index_0_lang-8IfA4lPE.js";var f=function(n){return setTimeout(n,16)},c=function(n){return clearTimeout(n)};typeof window<"u"&&"requestAnimationFrame"in window&&(f=function(n){return window.requestAnimationFrame(n)},c=function(n){return window.cancelAnimationFrame(n)});var i=0,o=new Map;function u(e){o.delete(e)}function w(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;i+=1;var r=i;function a(t){if(t===0)u(r),e();else{var s=f(function(){a(t-1)});o.set(r,s)}}return a(n),r}w.cancel=function(e){var n=o.get(e);return u(n),c(n)};function m(e,n){for(var r=l({},e),a=0;a<n.length;a+=1){var t=n[a];delete r[t]}return r}function p(e,n,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}function v(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}export{p as _,v as a,m as o,w};
|
||||
import{c as l}from"./Spinner.vue_vue_type_style_index_0_lang-Q7UPdMbi.js";var f=function(n){return setTimeout(n,16)},c=function(n){return clearTimeout(n)};typeof window<"u"&&"requestAnimationFrame"in window&&(f=function(n){return window.requestAnimationFrame(n)},c=function(n){return window.cancelAnimationFrame(n)});var i=0,o=new Map;function u(e){o.delete(e)}function w(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;i+=1;var r=i;function a(t){if(t===0)u(r),e();else{var s=f(function(){a(t-1)});o.set(r,s)}}return a(n),r}w.cancel=function(e){var n=o.get(e);return u(n),c(n)};function m(e,n){for(var r=l({},e),a=0;a<n.length;a+=1){var t=n[a];delete r[t]}return r}function p(e,n,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}function v(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}export{p as _,v as a,m as o,w};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{m as e}from"./index-zU76P609.js";const t={colors:[],brands:[],ciny_id:[],limit_percent:[],limit_gram:[],has_discount:!1,text:void 0,cats:void 0,page:0},i=e("filters",{state:()=>({query:{...t}}),actions:{reset(){this.query={...t}}}});export{i as u};
|
||||
import{m as e}from"./index-0lMAZRQB.js";const t={colors:[],brands:[],ciny_id:[],limit_percent:[],limit_gram:[],has_discount:!1,text:void 0,cats:void 0,page:0},i=e("filters",{state:()=>({query:{...t}}),actions:{reset(){this.query={...t}}}});export{i as u};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user