diff --git a/src/locales/ar.json b/src/locales/ar.json index ebddac1..2a75b66 100644 --- a/src/locales/ar.json +++ b/src/locales/ar.json @@ -356,5 +356,11 @@ "ranking_hourly": "بالساعة", "good_id_placeholder": "أدخل من 2 إلى 8 أرقام", - "my_wealth_level": "مستوى الثراء الخاص بي:" + "my_wealth_level": "مستوى الثراء الخاص بي:", + + "application_submitted_success": "تم تقديم طلبك بنجاح، يرجى انتظار المراجعة!", + "error_wealth_level_insufficient": "يجب أن تصل إلى مستوى الثراء 10 لتقديم طلب للحصول على معرف حصري.", + "error_invalid_id_format": "يرجى إدخال المعرف بالتنسيق الصحيح.", + "error_already_applied": "لقد قدمت بالفعل طلبًا للحصول على معرف حصري في مستوى الثراء الحالي.", + "error_id_already_used": "تم استخدام المعرف من قبل مستخدم آخر." } diff --git a/src/locales/en.json b/src/locales/en.json index 14f55ce..854f952 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -356,5 +356,11 @@ "ranking_hourly": "Hourly", "good_id_placeholder": "Enter 2 To 8 Digits", - "my_wealth_level": "My wealth level:" + "my_wealth_level": "My wealth level:", + + "application_submitted_success": "Your application has been successfully submitted, please wait for review!", + "error_wealth_level_insufficient": "You must reach wealth level 10 to apply for an exclusive ID.", + "error_invalid_id_format": "Please enter an ID in the correct format.", + "error_already_applied": "You've already applied for an exclusive ID at the current wealth level.", + "error_id_already_used": "ID has already been used by another user." } diff --git a/src/locales/zh.json b/src/locales/zh.json index 152a20a..1ce746e 100644 --- a/src/locales/zh.json +++ b/src/locales/zh.json @@ -356,5 +356,11 @@ "ranking_hourly": "小时榜", "good_id_placeholder": "输入2到8位数字", - "my_wealth_level": "我的财富等级:" + "my_wealth_level": "我的财富等级:", + + "application_submitted_success": "您的申请已成功提交,请等待审核!", + "error_wealth_level_insufficient": "您必须达到财富等级10才能申请专属ID。", + "error_invalid_id_format": "请输入正确格式的ID。", + "error_already_applied": "您已在当前财富等级申请过专属ID。", + "error_id_already_used": "该ID已被其他用户使用。" } diff --git a/src/views/AdminCenter/index.vue b/src/views/AdminCenter/index.vue index ec57d83..a24e804 100644 --- a/src/views/AdminCenter/index.vue +++ b/src/views/AdminCenter/index.vue @@ -170,147 +170,171 @@ >
-
- {{ t('team_earnings_this_period') }} ${{ teamSummary.teamEarningsThisPeriod || 0 }} + +
+
+ {{ t('team_earnings_this_period') }} ${{ teamSummary.teamEarningsThisPeriod || 0 }} +
+ +
+ Available income:${{ availableIncome?.availableBalance || 0 }} +
+ +
+ +
+ -
-
+
+ +
{{ t('my_bd_leader_teams') }}({{ teamSummary.bdLeaderTeams?.count || 0 }})
-
- - + +
+ {{ t('total_income') }} ${{ teamSummary.bdLeaderTeams?.totalIncome || 0 }}
-
- {{ t('total_income') }} ${{ teamSummary.bdLeaderTeams?.totalIncome || 0 }} + +
+ +
- - -
+ +
+ -
-
+
+ +
{{ t('my_bd_teams') }}({{ teamSummary.bdTeams?.count || 0 }})
-
- - + +
+ {{ t('total_income') }} ${{ teamSummary.bdTeams?.totalIncome || 0 }}
-
- {{ t('total_income') }} ${{ teamSummary.bdTeams?.totalIncome || 0 }} + +
+ +
- - -
+ +
+ -
-
+
+ +
{{ t('my_agency_teams') }}({{ teamSummary.agencyTeams?.count || 0 }})
-
- - + +
+ {{ t('total_income') }} ${{ teamSummary.agencyTeams?.totalIncome || 0 }}
-
- {{ t('total_income') }} ${{ teamSummary.agencyTeams?.totalIncome || 0 }} + +
+ +
- - -
+ +
+ -
-
+
+ +
{{ t('number_of_recharge_agents_invited') }}({{ teamSummary.rechargeTeams?.count || 0 }})
-
- - + +
+ Total recharge: $-
-
- {{ t('total_income') }} ${{ teamSummary.rechargeTeams?.totalIncome || 0 }} + +
+ +
- - -
+ + +
@@ -410,6 +434,9 @@ import { apiGetTeamSummary, // 查询BD团队总览 apiGetTeamPermissionCheck, // 检查权限 } from '@/api/admin.js' +import { + apiGetBankBalance, //获取当前余额 +} from '@/api/wallet.js' import GeneralHeader from '@/components/GeneralHeader.vue' @@ -423,6 +450,7 @@ const identityStore = useIdentityStore() locale.value && setDocumentDirection(locale.value) const taskData = ref({}) //任务项目数据 +const availableIncome = ref({}) const teamSummary = ref({}) //团队总览 const teamPermissionCheck = ref({}) //团队权限检查 @@ -481,6 +509,20 @@ const getTaskList = async () => { } } +// 获取银行余额 +const fetchBankBalance = async () => { + try { + const response = await apiGetBankBalance('ADMIN_SALARY') + + if (response.status && response.body) { + availableIncome.value = response.body || {} + } + } catch (error) { + console.error('Failed to fetch bank balance:', error) + showError(t('failed_to_load_balance')) + } +} + // 查询团队总览 const getTeamSummary = async () => { const resTeamSummary = await apiGetTeamSummary() @@ -502,6 +544,7 @@ const getTeamPermissionCheck = async () => { // 初始化数据 const init = () => { getTaskList() // 获取任务列表 + fetchBankBalance() // 获取银行余额 getTeamSummary() // 查询BD团队总览 getTeamPermissionCheck() // 检查权限 } diff --git a/src/views/GoodID/index.vue b/src/views/GoodID/index.vue index 91ba451..18ad981 100644 --- a/src/views/GoodID/index.vue +++ b/src/views/GoodID/index.vue @@ -120,6 +120,18 @@ />
+ + +
+
+ {{ tipText }} +
+
@@ -133,7 +145,10 @@ import { preloadImages } from '@/utils/imagePreloader.js' import { getUserId } from '@/utils/userStore.js' import { showError, showWarning, showSuccess } from '@/utils/toast.js' -import { apiGetUserWealthLevel, applyGoodID } from '@/api/goodId.js' +import { + apiGetUserWealthLevel, // 获取用户消费等级 + applyGoodID, // 申请靓号 +} from '@/api/goodId.js' import itemCenter from '@/components/itemCenter.vue' import maskLayer from '@/components/MaskLayer.vue' @@ -156,6 +171,26 @@ const wealthLevel = ref('-') //财富等级 const goodId = ref('') //靓号 const maskLayerShow = ref(false) //帮助模块 +const tipShow = ref(false) //提示弹窗 +const tipText = ref('') //提示文本 + +// 定义错误消息映射 +const errorMessages = { + 4200: 'error_wealth_level_insufficient', // 财富等级尚未>=10级 + 4201: 'error_invalid_id_format', // 输入的内容大于8位数或少于2位数 + 4202: 'application_submitted_success', // 用户未在当前财富等级申请过ID(申请成功,待审核) + 4203: 'error_already_applied', // 用户在当前财富等级已经申请过ID(申请失败) + 4204: 'error_id_already_used', // 用户申请的ID已经被他人使用 +} + +// 限时提示弹窗 +const showMessage = (messageKey) => { + tipText.value = t(messageKey) + tipShow.value = true + setTimeout(() => { + tipShow.value = false + }, 2000) +} // 申请靓号 const confirm = async () => { @@ -163,10 +198,19 @@ const confirm = async () => { let data = { account: goodId.value.trim(), wealthLevel: wealthLevel.value } try { - await applyGoodID(data) - goodId.value = '-' + const resApplyGoodID = await applyGoodID(data) + if (resApplyGoodID.status && resApplyGoodID.body) { + goodId.value = '' + showMessage('application_submitted_success') + initData() //重新获取数据 + } } catch (error) { - showError(error.errorMsg) + const errorCode = error.response?.errorCode + if (errorCode in errorMessages) { + showMessage(errorMessages[errorCode]) + } else { + showError(error.errorMsg) + } } }