diff --git a/src/pages/menuPages/configuration/settingGroups.ts b/src/pages/menuPages/configuration/settingGroups.ts index 24e3df9..73ec7d1 100644 --- a/src/pages/menuPages/configuration/settingGroups.ts +++ b/src/pages/menuPages/configuration/settingGroups.ts @@ -15,6 +15,12 @@ export type SettingGroupDef = { /** گروههای صفحه تنظیمات عادی (فقط can_edit=1) */ export const EDITABLE_SETTING_GROUPS: SettingGroupDef[] = [ + { + id: 'digipay_installment', + title: 'خرید اقساطی دیجیپی', + icon: 'vuesax-linear:calendar', + match: (k) => k === 'enable_digipay_installment' || k.startsWith('digipay_') + }, { id: 'general', title: 'عمومی و برند', diff --git a/src/pages/menuPages/customers/digipayInstallment/index.vue b/src/pages/menuPages/customers/digipayInstallment/index.vue new file mode 100644 index 0000000..ed499d6 --- /dev/null +++ b/src/pages/menuPages/customers/digipayInstallment/index.vue @@ -0,0 +1,84 @@ + + + + ثبت اعتبار بعد از دیجیپی + + کاربر اول با لینک تنظیمات به دیجیپی میرود. بعد از احراز، مانده اعتبارش را اینجا بنویسید تا در اپ بتواند مس بخرد. + + + + + + + + + + + + + ثبت اعتبار + + + + خریدهای اخیر + + + + + + diff --git a/src/pages/menuPages/customers/index.vue b/src/pages/menuPages/customers/index.vue index 5b5657c..ce2ea58 100644 --- a/src/pages/menuPages/customers/index.vue +++ b/src/pages/menuPages/customers/index.vue @@ -21,7 +21,7 @@ import { computed } from 'vue' import BasicMenu from '@/components/BasicMenu/index.vue' import { useRouterStore } from '@core/stores/router' import { get } from 'lodash' -import { customerSpecialPricingEnabledSetting, goldCreditEnabledSetting, initWalletSettingsFromApi } from '@/utils/config' +import { customerSpecialPricingEnabledSetting, digipayInstallmentEnabledSetting, goldCreditEnabledSetting, initWalletSettingsFromApi } from '@/utils/config' initWalletSettingsFromApi() @@ -36,6 +36,7 @@ const menu = computed(() => { .filter((child) => { if (child.name === 'customerMain_specialPrice') return customerSpecialPricingEnabledSetting.value if (child.name === 'customerMain_goldCredit') return goldCreditEnabledSetting.value + if (child.name === 'customerMain_digipayInstallment') return digipayInstallmentEnabledSetting.value return true }) .sort((a, b) => (a.meta?.order ?? 99) - (b.meta?.order ?? 99)) diff --git a/src/router/routes/customers.ts b/src/router/routes/customers.ts index 828c119..9f73362 100644 --- a/src/router/routes/customers.ts +++ b/src/router/routes/customers.ts @@ -81,6 +81,16 @@ const Customers: RouteRecordRaw = { order: 4 } }, + { + name: 'customerMain_digipayInstallment', + path: 'digipay-installment', + component: () => import('@/pages/menuPages/customers/digipayInstallment/index.vue'), + meta: { + icon: 'vuesax-linear:calendar', + title: 'خرید اقساطی', + order: 6 + } + }, { name: 'customerMain_goldCredit', path: 'gold-credit', diff --git a/src/utils/adminHelpCopy.ts b/src/utils/adminHelpCopy.ts index d932067..a5edc72 100644 --- a/src/utils/adminHelpCopy.ts +++ b/src/utils/adminHelpCopy.ts @@ -183,6 +183,9 @@ export const customersArchivePageIntro = export const customersOnlinePageIntro = 'مشتریانی که الان اپ را باز دارند. با بستن اپ از لیست حذف میشوند. برای جزئیات روی کارت بزنید.' +export const digipayInstallmentPageIntro = + 'بعد از احراز کاربر در دیجیپی، مانده اعتبار ۴ قسط و ۱۲ قسط را با موبایل مشتری اینجا بنویسید. خرید از اپ همان مانده را کم میکند و مس را به کیف مینشاند.' + export const goldCreditPageIntro = 'اعتبار طلایی مشتریان: درخواستهای جدید و اعتبارهای فعال. از تبها بین درخواست و فعال جابهجا شوید.' diff --git a/src/utils/adminPageAccess.ts b/src/utils/adminPageAccess.ts index d254c3b..b1a840a 100644 --- a/src/utils/adminPageAccess.ts +++ b/src/utils/adminPageAccess.ts @@ -7,6 +7,7 @@ import { customerSpecialPricingEnabledSetting, getConfigApp, giftCardEnabledSetting, + digipayInstallmentEnabledSetting, goldCreditEnabledSetting, hasLandingSetting, isStoreApp, @@ -64,6 +65,12 @@ export const ADMIN_PAGE_TREE: AccessNode[] = [ title: 'اعتبار', route: 'customerMain_goldCredit', enabled: () => goldCreditEnabledSetting.value + }, + { + key: 'customerMain_digipayInstallment', + title: 'خرید اقساطی', + route: 'customerMain_digipayInstallment', + enabled: () => digipayInstallmentEnabledSetting.value } ] }, @@ -240,6 +247,7 @@ export const PAGE_TABLE_ACTIONS: Record = { { key: 'toggle', label: 'فعال/غیرفعال' }, { key: 'delete', label: 'حذف' } ], + customerMain_digipayInstallment: [{ key: 'edit', label: 'ثبت اعتبار' }], customerMain_goldCredit: [ { key: 'detail', label: 'جزئیات' }, { key: 'edit', label: 'ویرایش' }, diff --git a/src/utils/config.ts b/src/utils/config.ts index dbbf2c4..6f0ad96 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -80,6 +80,9 @@ export const customerSpecialPricingEnabledSetting = ref(false) /** reactive — زیرمنوی اعتبار طلایی در مشتریان */ export const goldCreditEnabledSetting = ref(false) +/** reactive — زیرمنوی خرید اقساطی دیجیپی */ +export const digipayInstallmentEnabledSetting = ref(false) + /** reactive — منو و زنگوله اعلان داخل اپ */ export const appNotificationEnabledSetting = ref(true) @@ -185,6 +188,10 @@ export function setCustomerSpecialPricingEnabledFromSettings(value: boolean): vo customerSpecialPricingEnabledSetting.value = value } +export function setDigipayInstallmentEnabledFromSettings(value: boolean): void { + digipayInstallmentEnabledSetting.value = value +} + export function setGoldCreditEnabledFromSettings(value: boolean): void { goldCreditEnabledSetting.value = value } @@ -314,6 +321,13 @@ export function applyCustomerSpecialPricingFromRows( if (row) setCustomerSpecialPricingEnabledFromSettings(isSwitchOn(row.value)) } +export function applyDigipayInstallmentEnabledFromRows( + rows: Array<{ key?: string; value?: string | null }> +) { + const row = rows.find((item) => item.key === 'enable_digipay_installment') + if (row) setDigipayInstallmentEnabledFromSettings(isSwitchOn(row.value)) +} + export function applyGoldCreditEnabledFromRows( rows: Array<{ key?: string; value?: string | null }> ) { @@ -340,6 +354,7 @@ export function applySuperAdminAccessFlagsFromItems( applyGroupSmsFromRows(rows) applyCustomerSpecialPricingFromRows(rows) applyGoldCreditEnabledFromRows(rows) + applyDigipayInstallmentEnabledFromRows(rows) applyConditionalOrderEnabledFromRows(rows) applyAutomationEnabledFromRows(rows) applyProductFundsEnabledFromRows(rows) @@ -442,6 +457,7 @@ async function bootstrapSettingsFromApi(): Promise { applyGroupSmsFromRows(list) applyCustomerSpecialPricingFromRows(list) applyGoldCreditEnabledFromRows(list) + applyDigipayInstallmentEnabledFromRows(list) applyConditionalOrderEnabledFromRows(list) applyAutomationEnabledFromRows(list) applyProductFundsEnabledFromRows(list)
+ کاربر اول با لینک تنظیمات به دیجیپی میرود. بعد از احراز، مانده اعتبارش را اینجا بنویسید تا در اپ بتواند مس بخرد. +