Align older CRM pages with the Mento visual language.
Restyle list, form, settings, and secondary modules to match contacts/activities patterns with teal chrome, soft panels, and mobile layouts — without changing already-redesigned screens. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import axios from 'axios';
|
||||
import { api } from '@/lib/api';
|
||||
import { useAuthStore } from '@/stores/auth';
|
||||
import { canManageSettings } from '@/lib/roles';
|
||||
import UiIcon from '@/components/UiIcon.vue';
|
||||
import type {
|
||||
CreateLoyaltyTierRequest,
|
||||
LoyaltyMemberDto,
|
||||
@@ -128,12 +129,11 @@ onMounted(load);
|
||||
<template>
|
||||
<section class="page">
|
||||
<header class="page-head">
|
||||
<div>
|
||||
<p class="eyebrow">مشتریان</p>
|
||||
<div class="head-copy">
|
||||
<h1>باشگاه مشتریان</h1>
|
||||
<p class="lead">امتیاز و سطح وفاداری پایه برای اشخاص.</p>
|
||||
</div>
|
||||
<button class="btn btn-ghost" type="button" :disabled="loading" @click="load">
|
||||
<button class="btn ghost" type="button" :disabled="loading" @click="load">
|
||||
بروزرسانی
|
||||
</button>
|
||||
</header>
|
||||
@@ -145,7 +145,7 @@ onMounted(load);
|
||||
<h2>سطوح</h2>
|
||||
<ul class="tiers">
|
||||
<li v-for="t in tiers" :key="t.id">
|
||||
<span class="swatch" :style="{ background: t.color || '#ccc' }" />
|
||||
<span class="swatch" :style="{ background: t.color || '#cbd5e1' }" />
|
||||
<strong>{{ t.name }}</strong>
|
||||
<span class="muted">از {{ t.minPoints }} امتیاز</span>
|
||||
<span class="muted">{{ t.memberCount ?? 0 }} عضو</span>
|
||||
@@ -160,12 +160,12 @@ onMounted(load);
|
||||
<input v-model="tierName" type="text" placeholder="نام سطح" required minlength="2" />
|
||||
<input v-model.number="tierMin" type="number" min="0" placeholder="حداقل امتیاز" />
|
||||
<input v-model="tierColor" type="text" placeholder="رنگ (مثلاً #d4af37)" />
|
||||
<button class="btn" type="submit" :disabled="saving">
|
||||
<button class="btn primary" type="submit" :disabled="saving">
|
||||
{{ editingTierId ? 'بهروزرسانی سطح' : 'سطح جدید' }}
|
||||
</button>
|
||||
<button
|
||||
v-if="editingTierId"
|
||||
class="btn btn-ghost"
|
||||
class="btn ghost"
|
||||
type="button"
|
||||
@click="resetTierForm"
|
||||
>
|
||||
@@ -178,8 +178,8 @@ onMounted(load);
|
||||
<div class="row">
|
||||
<h2>اعضا</h2>
|
||||
<form class="search" @submit.prevent="load">
|
||||
<input v-model="q" type="search" placeholder="جستجو…" />
|
||||
<button class="btn btn-ghost" type="submit">جستجو</button>
|
||||
<UiIcon name="search" :size="18" />
|
||||
<input v-model="q" type="search" placeholder="جستجو در اعضا…" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -191,7 +191,7 @@ onMounted(load);
|
||||
</option>
|
||||
</select>
|
||||
<input v-model.number="adjustDelta" type="number" step="1" />
|
||||
<button class="btn" type="submit" :disabled="saving">تغییر امتیاز</button>
|
||||
<button class="btn primary" type="submit" :disabled="saving">تغییر امتیاز</button>
|
||||
</form>
|
||||
|
||||
<div class="table-wrap">
|
||||
@@ -212,7 +212,7 @@ onMounted(load);
|
||||
<span
|
||||
v-if="m.loyaltyTier"
|
||||
class="tier-pill"
|
||||
:style="{ borderColor: m.loyaltyTier.color || '#ccc' }"
|
||||
:style="{ borderColor: m.loyaltyTier.color || '#cbd5e1' }"
|
||||
>
|
||||
{{ m.loyaltyTier.name }}
|
||||
</span>
|
||||
@@ -222,7 +222,7 @@ onMounted(load);
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p v-if="!members.length && !loading" class="muted">عضوی نیست.</p>
|
||||
<p v-if="!members.length && !loading" class="muted empty-msg">عضوی نیست.</p>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
@@ -232,110 +232,250 @@ onMounted(load);
|
||||
.page {
|
||||
display: grid;
|
||||
gap: 1rem;
|
||||
min-width: 0;
|
||||
overflow-x: clip;
|
||||
}
|
||||
|
||||
.page-head {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
flex-wrap: wrap;
|
||||
align-items: flex-start;
|
||||
}
|
||||
.eyebrow {
|
||||
margin: 0;
|
||||
color: var(--accent);
|
||||
font-weight: 700;
|
||||
|
||||
.head-copy {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin: 0.2rem 0;
|
||||
}
|
||||
.lead,
|
||||
.muted {
|
||||
color: var(--muted);
|
||||
}
|
||||
.panel {
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 16px;
|
||||
padding: 1rem;
|
||||
background: #fff;
|
||||
display: grid;
|
||||
gap: 0.75rem;
|
||||
margin: 0 0 0.3rem;
|
||||
font-size: clamp(1.45rem, 2.5vw, 1.85rem);
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
h2 {
|
||||
margin: 0;
|
||||
font-size: 1.1rem;
|
||||
font-size: 1.05rem;
|
||||
color: #0f172a;
|
||||
}
|
||||
|
||||
.lead,
|
||||
.muted {
|
||||
margin: 0;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.panel {
|
||||
border-radius: 18px;
|
||||
padding: 1rem 1.05rem;
|
||||
background: #fff;
|
||||
display: grid;
|
||||
gap: 0.85rem;
|
||||
box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.35rem;
|
||||
min-height: 42px;
|
||||
padding: 0.55rem 1rem;
|
||||
border-radius: 12px;
|
||||
font-weight: 700;
|
||||
border: 1px solid transparent;
|
||||
cursor: pointer;
|
||||
font: inherit;
|
||||
}
|
||||
|
||||
.btn.primary {
|
||||
background: #14b8a6;
|
||||
color: #fff;
|
||||
box-shadow: 0 8px 18px rgba(20, 184, 166, 0.24);
|
||||
}
|
||||
|
||||
.btn.primary:disabled {
|
||||
opacity: 0.6;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.btn.ghost {
|
||||
background: #fff;
|
||||
color: #0f766e;
|
||||
border-color: #99f6e4;
|
||||
}
|
||||
|
||||
.tiers {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: grid;
|
||||
gap: 0.45rem;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.tiers li {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.55rem;
|
||||
align-items: center;
|
||||
padding: 0.55rem 0.65rem;
|
||||
background: #f8fafc;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.swatch {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-radius: 999px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.tier-form,
|
||||
.adjust,
|
||||
.search,
|
||||
.row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.5rem;
|
||||
gap: 0.55rem;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.row {
|
||||
justify-content: space-between;
|
||||
}
|
||||
input,
|
||||
select {
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 10px;
|
||||
padding: 0.55rem 0.7rem;
|
||||
|
||||
.search {
|
||||
flex: 1 1 200px;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
background: #fff;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 12px;
|
||||
padding: 0 0.85rem;
|
||||
color: #94a3b8;
|
||||
}
|
||||
|
||||
.search input {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
border: 0;
|
||||
background: none;
|
||||
padding: 0.75rem 0;
|
||||
font: inherit;
|
||||
}
|
||||
|
||||
input,
|
||||
select {
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 12px;
|
||||
padding: 0.65rem 0.85rem;
|
||||
font: inherit;
|
||||
background: #fff;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.table-wrap {
|
||||
overflow-x: auto;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
min-width: 480px;
|
||||
}
|
||||
|
||||
th,
|
||||
td {
|
||||
text-align: right;
|
||||
padding: 0.55rem 0.4rem;
|
||||
border-bottom: 1px solid var(--line);
|
||||
padding: 0.65rem 0.5rem;
|
||||
border-bottom: 1px solid #f1f5f9;
|
||||
font-size: 0.92rem;
|
||||
}
|
||||
|
||||
th {
|
||||
font-size: 0.78rem;
|
||||
color: #94a3b8;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.tier-pill {
|
||||
display: inline-block;
|
||||
border: 1px solid;
|
||||
border-radius: 999px;
|
||||
padding: 0.1rem 0.55rem;
|
||||
padding: 0.15rem 0.55rem;
|
||||
font-size: 0.82rem;
|
||||
font-weight: 700;
|
||||
color: #0f766e;
|
||||
background: #f0fdfa;
|
||||
}
|
||||
|
||||
.link {
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--accent);
|
||||
color: #0f766e;
|
||||
cursor: pointer;
|
||||
font: inherit;
|
||||
padding: 0;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.danger {
|
||||
color: #b42318;
|
||||
color: #b91c1c;
|
||||
}
|
||||
|
||||
.error {
|
||||
color: #b42318;
|
||||
margin: 0;
|
||||
color: #b91c1c;
|
||||
}
|
||||
|
||||
.ok {
|
||||
color: #067647;
|
||||
margin: 0;
|
||||
color: #047857;
|
||||
}
|
||||
|
||||
.empty-msg {
|
||||
padding: 0.75rem 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.row {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.search {
|
||||
flex: 1 1 auto;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 700px) {
|
||||
.page-head {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.page-head .btn.ghost {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.tier-form,
|
||||
.adjust {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.tier-form input,
|
||||
.tier-form select,
|
||||
.adjust input,
|
||||
.adjust select,
|
||||
.tier-form .btn,
|
||||
.adjust .btn {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user