@@ -531,7 +550,7 @@ const getDeviceCount = (subTitle?: string, clientNumEnable?: boolean): string =>
{{ t('page.headerbanner.Remainingcredit') }}
- {{ baseData[0].displayValue === '-' ? '-' : '¥' + baseData[0].displayValue }}
+ {{ baseData[0].displayValue === '-' ? '-' : currencySymbol + baseData[0].displayValue }}
{{ t('page.headerbanner.client') }}
diff --git a/src/views/recharge/balancerecharge/index.vue b/src/views/recharge/balancerecharge/index.vue
index bdd04a7..fec0266 100644
--- a/src/views/recharge/balancerecharge/index.vue
+++ b/src/views/recharge/balancerecharge/index.vue
@@ -8,6 +8,7 @@ import { useRouterPush } from '@/hooks/common/router';
import type { Ref } from 'vue';
import OrderConfirmModal from '@/components/order-confirm/orderConfirmModal.vue';
import { useAppStore } from '@/store/modules/app';
+import { getPaymentConfig } from '@/service/api/payment';
defineOptions({
name: 'BalanceRecharge'
@@ -16,7 +17,18 @@ defineOptions({
const { t } = useI18n();
const { routerPushByKey } = useRouterPush();
const appStore = useAppStore();
+const currencySymbol = ref('¥');
+const fetchCurrencySymbol = async () => {
+ try {
+ const response = await getPaymentConfig();
+ if (response && response.data) {
+ currencySymbol.value = response.data.currencySymbol || '¥';
+ }
+ } catch (error) {
+ console.error('Failed to fetch currency symbol:', error);
+ }
+};
interface RechargeOption {
amount: number;
displayAmount: string;
@@ -27,13 +39,13 @@ const customAmount = ref(undefined);
const selectedAmount = ref(null);
const isCustomMode = ref(false);
-const rechargeOptions: Ref = ref([
- { amount: 10, displayAmount: `${t('page.carddata.money')}10`, price: 10.00 },
- { amount: 20, displayAmount: `${t('page.carddata.money')}20`, price: 20.00 },
- { amount: 30, displayAmount: `${t('page.carddata.money')}30`, price: 30.00 },
- { amount: 50, displayAmount: `${t('page.carddata.money')}50`, price: 50.00 },
- { amount: 100, displayAmount: `${t('page.carddata.money')}100`, price: 100.00 },
- { amount: 200, displayAmount: `${t('page.carddata.money')}200`, price: 200.00 },
+const rechargeOptions = computed(() => [
+ { amount: 10, displayAmount: `${currencySymbol.value}10`, price: 10.00 },
+ { amount: 20, displayAmount: `${currencySymbol.value}20`, price: 20.00 },
+ { amount: 30, displayAmount: `${currencySymbol.value}30`, price: 30.00 },
+ { amount: 50, displayAmount: `${currencySymbol.value}50`, price: 50.00 },
+ { amount: 100, displayAmount: `${currencySymbol.value}100`, price: 100.00 },
+ { amount: 200, displayAmount: `${currencySymbol.value}200`, price: 200.00 },
]);
const paymentAmount = computed(() => {
@@ -76,10 +88,12 @@ const handleBlur = () => {
};
onMounted(() => {
+ fetchCurrencySymbol();
document.addEventListener('click', handleClickOutside);
});
onUnmounted(() => {
+ fetchCurrencySymbol();
document.removeEventListener('click', handleClickOutside);
});
@@ -202,7 +216,7 @@ const handlePaymentConfirm = async (paymentMethod: 'alipay' | 'wxpay') => {
:disabled="!paymentAmount || paymentAmount <= 0"
@click="handleRecharge"
>
- ¥{{ paymentAmount.toFixed(2) }} {{ t('page.carddata.pay') }}
+ {{ currencySymbol }}{{ paymentAmount.toFixed(2) }} {{ t('page.carddata.pay') }}
diff --git a/src/views/recharge/package/index.vue b/src/views/recharge/package/index.vue
index e10fbc0..753ba02 100644
--- a/src/views/recharge/package/index.vue
+++ b/src/views/recharge/package/index.vue
@@ -8,10 +8,23 @@ import { aliPayPcPay,aliPayWapPay, wxPayScanCode, payBalance } from '@/service/a
import { useRouterPush } from '@/hooks/common/router';
import { useAppStore } from '@/store/modules/app';
import { useAuthStore} from '@/store/modules/auth';
+import { getPaymentConfig } from '@/service/api/payment';
defineOptions({
name: 'PackageSubscription'
});
+const currencySymbol = ref('¥');
+
+const fetchCurrencySymbol = async () => {
+ try {
+ const response = await getPaymentConfig();
+ if (response && response.data) {
+ currencySymbol.value = response.data.currencySymbol || '¥';
+ }
+ } catch (error) {
+ console.error('Failed to fetch currency symbol:', error);
+ }
+};
const { t } = useI18n();
const authStore = useAuthStore();
interface RateLimit {
@@ -343,6 +356,7 @@ const isPackageActive = computed(() => {
});
onMounted(async () => {
+ await fetchCurrencySymbol();
fetchDashboardData();
await fetchPackages();
await fetchUserBalance();
@@ -354,7 +368,7 @@ onMounted(async () => {
{{ option.packageName }}
-
¥{{ option.price }}
+
{{ currencySymbol }}{{ option.price }}
{{ option.trafficEnable ? option.trafficDisplay : t('page.setmeal.unlimit') }}
{{ option.clientNumEnable ? `${option.clientNum} ${t('page.setmeal.device')}` : t('page.setmeal.unlimit') }}