-
{{ title }}
+
+
+
+ {{ title }}
+
+
+ {{ subtitle }}
+
-
diff --git a/src/pages/menuPages/customers/base/components/CustomerMobileCardList.vue b/src/pages/menuPages/customers/base/components/CustomerMobileCardList.vue
index 4e5b897..8bf264e 100644
--- a/src/pages/menuPages/customers/base/components/CustomerMobileCardList.vue
+++ b/src/pages/menuPages/customers/base/components/CustomerMobileCardList.vue
@@ -21,13 +21,14 @@
@@ -40,7 +41,7 @@ import { useMobileTableList } from '@/components/mobile/composables/useMobileTab
import CustomerMobileListItem from './CustomerMobileListItem.vue'
import CustomerMobileDetailSheet from './CustomerMobileDetailSheet.vue'
-defineEmits<{
+const emit = defineEmits<{
(e: 'info', item: Customer): void
(e: 'edit', item: Customer): void
(e: 'archive', item: Customer): void
@@ -53,6 +54,25 @@ defineEmits<{
const { sheetVisible, selectedItem, openSheet, syncSelectedItem } = useMobileDetailSheet
()
+type SheetAction =
+ | 'info'
+ | 'edit'
+ | 'archive'
+ | 'toggleActive'
+ | 'chargeMoney'
+ | 'chargeGold'
+ | 'toggleTrade'
+ | 'confirmUser'
+
+function forward(action: SheetAction, item: Customer) {
+ emit(action, item)
+}
+
+function forwardAndClose(action: SheetAction, item: Customer) {
+ sheetVisible.value = false
+ emit(action, item)
+}
+
const { loading, search, items, hasMore, reload, loadMore, fetch } = useMobileTableList({
fetchApi: getCustomerTable,
onFetched: (rows) => syncSelectedItem(rows)
diff --git a/src/pages/menuPages/customers/base/components/CustomerMobileDetailSheet.vue b/src/pages/menuPages/customers/base/components/CustomerMobileDetailSheet.vue
index a5de9e1..5702bc4 100644
--- a/src/pages/menuPages/customers/base/components/CustomerMobileDetailSheet.vue
+++ b/src/pages/menuPages/customers/base/components/CustomerMobileDetailSheet.vue
@@ -1,36 +1,54 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
+ {{ row.name || '-' }}
+ {{ row.mobile }}
+
+
+
+ شارژ ریالی
+
+
+ شارژ طلایی
+
+
+ تایید کاربر
+
+
+ مشخصات کامل
+
+
+ ویرایش
+
+
+ بایگانی
+
+
+ {{ row.active ? 'غیرفعال کردن' : 'فعال کردن' }}
+
+
+ {{ row.trade_active === 1 ? 'ممنوعیت سفارش' : 'مجاز کردن سفارش' }}
+
+
@@ -57,9 +75,9 @@
- {{ row.trade_active ? 'مجاز' : 'غیر مجاز' }}
+ {{ row.trade_active === 1 ? 'مجاز' : 'غیر مجاز' }}
@@ -79,11 +97,8 @@ import { MODAL_ABOVE_ACTION_SHEET_Z_INDEX } from '@/constants/overlayZIndex'
import MobileDetailRow from '@/components/mobile/MobileDetailRow.vue'
import MobileStatCard from '@/components/mobile/MobileStatCard.vue'
import MobileDetailSheet from '@/components/mobile/MobileDetailSheet.vue'
-import MobileIconButton from '@/components/mobile/MobileIconButton.vue'
import MobileInfoGrid from '@/components/mobile/MobileInfoGrid.vue'
-import MobileSheetHeader from '@/components/mobile/MobileSheetHeader.vue'
import { getCashBalance, getGoldBalance } from '@/components/mobile/utils/wallet'
-import { isMobile } from '@core/utils/is'
import { toJalali } from '@core/utils/useDataTime'
import { usePrice } from '@core/utils/usePrice'
@@ -95,6 +110,7 @@ const props = defineProps<{
const emit = defineEmits<{
(e: 'update:visible', value: boolean): void
(e: 'info', item: Customer): void
+ (e: 'edit', item: Customer): void
(e: 'archive', item: Customer): void
(e: 'toggleActive', item: Customer): void
(e: 'chargeMoney', item: Customer): void
@@ -108,24 +124,7 @@ const visibleProxy = computed({
set: (value: boolean) => emit('update:visible', value)
})
-function cashBalance(row: Customer) {
- return getCashBalance(row.wallet)
-}
-
-function goldBalance(row: Customer) {
- return getGoldBalance(row.wallet)
-}
-
-function lastSeen(row: Customer) {
- return row.last_seen_at ? toJalali(row.last_seen_at) : '-'
-}
-
-type SheetEmit =
- | 'archive'
- | 'chargeMoney'
- | 'chargeGold'
- | 'info'
- | 'confirmUser'
+type SheetEmit = 'archive' | 'chargeMoney' | 'chargeGold' | 'info' | 'confirmUser' | 'edit'
function closeAndEmit(event: SheetEmit, row: Customer) {
visibleProxy.value = false
@@ -145,9 +144,7 @@ function confirmToggleActive(row: Customer) {
function confirmToggleTrade(row: Customer) {
Modal.confirm({
- title: row.trade_active
- ? 'آیا سفارش دهی را غیرمجاز میکنید؟'
- : 'آیا سفارش دهی را مجاز میکنید؟',
+ title: row.trade_active === 1 ? 'آیا سفارش دهی را غیرمجاز میکنید؟' : 'آیا سفارش دهی را مجاز میکنید؟',
okText: 'تایید',
cancelText: 'رد',
centered: true,
@@ -155,4 +152,16 @@ function confirmToggleTrade(row: Customer) {
onOk: () => emit('toggleTrade', row)
})
}
+
+function cashBalance(row: Customer) {
+ return getCashBalance(row.wallet)
+}
+
+function goldBalance(row: Customer) {
+ return getGoldBalance(row.wallet)
+}
+
+function lastSeen(row: Customer) {
+ return row.last_seen_at ? toJalali(row.last_seen_at) : '-'
+}
diff --git a/src/pages/menuPages/customers/base/components/CustomerMobileListItem.vue b/src/pages/menuPages/customers/base/components/CustomerMobileListItem.vue
index 08f85e8..f21a513 100644
--- a/src/pages/menuPages/customers/base/components/CustomerMobileListItem.vue
+++ b/src/pages/menuPages/customers/base/components/CustomerMobileListItem.vue
@@ -1,25 +1,54 @@
-
-
+
+
-
-
{{ item.mobile || '-' }}
+
+
+
+
+
-
-
- {{ item.type_str || 'کاربر' }}
-
-
-
+
+ {{ item.mobile || '-' }}
+
+ {{ item.type_str || 'کاربر' }}
+
+
+
+
+
+
+ عملیات
+
+
+ ویرایش
+
@@ -28,7 +57,6 @@