feat(申请靓号页): 新增提示弹窗,阿语翻译

This commit is contained in:
hzj 2025-12-11 16:40:23 +08:00
parent 5cf48bc741
commit fa91e7dba8
5 changed files with 203 additions and 98 deletions

View File

@ -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": "تم استخدام المعرف من قبل مستخدم آخر."
}

View File

@ -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."
}

View File

@ -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已被其他用户使用。"
}

View File

@ -170,147 +170,171 @@
>
<!-- 总收入 -->
<div style="display: flex; justify-content: space-between; align-items: center">
<div style="font-weight: 600">
{{ t('team_earnings_this_period') }} ${{ teamSummary.teamEarningsThisPeriod || 0 }}
<!-- 基本信息 -->
<div style="display: flex; flex-direction: column; gap: 4px">
<div style="font-weight: 600">
{{ t('team_earnings_this_period') }} ${{ teamSummary.teamEarningsThisPeriod || 0 }}
</div>
<div style="color: rgba(0, 0, 0, 0.4); font-size: 0.8em; font-weight: 500">
Available income${{ availableIncome?.availableBalance || 0 }}
</div>
</div>
<!-- 跳转按钮 -->
<img
src="../../assets/icon/arrowBlack.png"
alt=""
style="display: block; width: 1.5em"
style="display: block; width: 2em"
class="flipImg"
@click="gotoIncome"
/>
</div>
<!-- 分割线 -->
<div style="border-bottom: 1px solid #e6e6e6"></div>
<!-- 我的BD Leader团队 -->
<div style="display: flex; flex-direction: column; gap: 4px">
<div style="display: flex; justify-content: space-between; align-items: center">
<div style="display: flex; justify-content: space-between; align-items: center">
<!-- 基本信息 -->
<div style="display: flex; flex-direction: column; gap: 4px">
<div style="font-weight: 600">
{{ t('my_bd_leader_teams') }}({{ teamSummary.bdLeaderTeams?.count || 0 }})
</div>
<div style="align-self: stretch; display: flex; align-items: center; gap: 4px">
<img
src="../../assets/icon/addUser.png"
alt=""
style="display: block; width: 1.6em"
class="flipImg"
@click="gotoPage('/invite-bd-leader')"
/>
<img
src="../../assets/icon/list.png"
alt=""
style="display: block; width: 1.6em"
class="flipImg"
@click="gotoPage('/my-BDLeader-teams')"
/>
<div style="color: rgba(0, 0, 0, 0.4); font-size: 0.8em; font-weight: 500">
{{ t('total_income') }} ${{ teamSummary.bdLeaderTeams?.totalIncome || 0 }}
</div>
</div>
<div style="color: rgba(0, 0, 0, 0.4); font-size: 0.8em; font-weight: 500">
{{ t('total_income') }} ${{ teamSummary.bdLeaderTeams?.totalIncome || 0 }}
<!-- 跳转按钮 -->
<div style="align-self: stretch; display: flex; align-items: center; gap: 4px">
<img
src="../../assets/icon/addUser.png"
alt=""
style="display: block; width: 1.6em"
class="flipImg"
@click="gotoPage('/invite-bd-leader')"
/>
<img
src="../../assets/icon/list.png"
alt=""
style="display: block; width: 1.6em"
class="flipImg"
@click="gotoPage('/my-BDLeader-teams')"
/>
</div>
<!-- 分割线 -->
<div style="border-bottom: 1px solid #e6e6e6"></div>
</div>
<!-- 分割线 -->
<div style="border-bottom: 1px solid #e6e6e6"></div>
<!-- 我的BD团队 -->
<div style="display: flex; flex-direction: column; gap: 4px">
<div style="display: flex; justify-content: space-between; align-items: center">
<div style="display: flex; justify-content: space-between; align-items: center">
<!-- 基本信息 -->
<div style="display: flex; flex-direction: column; gap: 4px">
<div style="font-weight: 600">
{{ t('my_bd_teams') }}({{ teamSummary.bdTeams?.count || 0 }})
</div>
<div style="align-self: stretch; display: flex; align-items: center; gap: 4px">
<img
src="../../assets/icon/addUser.png"
alt=""
style="display: block; width: 1.6em"
class="flipImg"
@click="gotoPage('/invite-bd')"
/>
<img
src="../../assets/icon/list.png"
alt=""
style="display: block; width: 1.6em"
class="flipImg"
@click="gotoPage('/my-BD-teams')"
/>
<div style="color: rgba(0, 0, 0, 0.4); font-size: 0.8em; font-weight: 500">
{{ t('total_income') }} ${{ teamSummary.bdTeams?.totalIncome || 0 }}
</div>
</div>
<div style="color: rgba(0, 0, 0, 0.4); font-size: 0.8em; font-weight: 500">
{{ t('total_income') }} ${{ teamSummary.bdTeams?.totalIncome || 0 }}
<!-- 跳转按钮 -->
<div style="align-self: stretch; display: flex; align-items: center; gap: 4px">
<img
src="../../assets/icon/addUser.png"
alt=""
style="display: block; width: 1.6em"
class="flipImg"
@click="gotoPage('/invite-bd')"
/>
<img
src="../../assets/icon/list.png"
alt=""
style="display: block; width: 1.6em"
class="flipImg"
@click="gotoPage('/my-BD-teams')"
/>
</div>
<!-- 分割线 -->
<div style="border-bottom: 1px solid #e6e6e6"></div>
</div>
<!-- 分割线 -->
<div style="border-bottom: 1px solid #e6e6e6"></div>
<!-- 我的Agency团队 -->
<div style="display: flex; flex-direction: column; gap: 4px">
<div style="display: flex; justify-content: space-between; align-items: center">
<div style="display: flex; justify-content: space-between; align-items: center">
<!-- 基本信息 -->
<div style="display: flex; flex-direction: column; gap: 4px">
<div style="font-weight: 600">
{{ t('my_agency_teams') }}({{ teamSummary.agencyTeams?.count || 0 }})
</div>
<div style="align-self: stretch; display: flex; align-items: center; gap: 4px">
<img
src="../../assets/icon/addUser.png"
alt=""
style="display: block; width: 1.6em"
class="flipImg"
@click="gotoPage('/invite-agency')"
/>
<img
src="../../assets/icon/list.png"
alt=""
style="display: block; width: 1.6em"
class="flipImg"
@click="gotoPage('/my-agency-teams')"
/>
<div style="color: rgba(0, 0, 0, 0.4); font-size: 0.8em; font-weight: 500">
{{ t('total_income') }} ${{ teamSummary.agencyTeams?.totalIncome || 0 }}
</div>
</div>
<div style="color: rgba(0, 0, 0, 0.4); font-size: 0.8em; font-weight: 500">
{{ t('total_income') }} ${{ teamSummary.agencyTeams?.totalIncome || 0 }}
<!-- 跳转按钮 -->
<div style="align-self: stretch; display: flex; align-items: center; gap: 4px">
<img
src="../../assets/icon/addUser.png"
alt=""
style="display: block; width: 1.6em"
class="flipImg"
@click="gotoPage('/invite-agency')"
/>
<img
src="../../assets/icon/list.png"
alt=""
style="display: block; width: 1.6em"
class="flipImg"
@click="gotoPage('/my-agency-teams')"
/>
</div>
<!-- 分割线 -->
<div style="border-bottom: 1px solid #e6e6e6"></div>
</div>
<!-- 分割线 -->
<div style="border-bottom: 1px solid #e6e6e6"></div>
<!-- 我的Recharge Agency团队 -->
<div style="display: flex; flex-direction: column; gap: 4px">
<div style="display: flex; justify-content: space-between; align-items: center">
<div style="display: flex; justify-content: space-between; align-items: center">
<!-- 基本信息 -->
<div style="display: flex; flex-direction: column; gap: 4px">
<div style="font-weight: 600">
{{ t('number_of_recharge_agents_invited') }}({{
teamSummary.rechargeTeams?.count || 0
}})
</div>
<div style="align-self: stretch; display: flex; align-items: center; gap: 4px">
<img
src="../../assets/icon/addUser.png"
alt=""
style="display: block; width: 1.6em"
class="flipImg"
@click="gotoPage('/invite-recharge-agency')"
/>
<img
src="../../assets/icon/list.png"
alt=""
style="display: block; width: 1.6em"
class="flipImg"
@click="gotoPage('/my-recharge-agency')"
/>
<div style="color: rgba(0, 0, 0, 0.4); font-size: 0.8em; font-weight: 500">
Total recharge: $-
</div>
</div>
<div style="color: rgba(0, 0, 0, 0.4); font-size: 0.8em; font-weight: 500">
{{ t('total_income') }} ${{ teamSummary.rechargeTeams?.totalIncome || 0 }}
<!-- 跳转按钮 -->
<div style="align-self: stretch; display: flex; align-items: center; gap: 4px">
<img
src="../../assets/icon/addUser.png"
alt=""
style="display: block; width: 1.6em"
class="flipImg"
@click="gotoPage('/invite-recharge-agency')"
/>
<img
src="../../assets/icon/list.png"
alt=""
style="display: block; width: 1.6em"
class="flipImg"
@click="gotoPage('/my-recharge-agency')"
/>
</div>
<!-- 分割线 -->
<div style="border-bottom: 1px solid #e6e6e6"></div>
</div>
<!-- 分割线 -->
<div style="border-bottom: 1px solid #e6e6e6"></div>
</div>
<!-- 赠送礼物 -->
@ -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() //
}

View File

@ -120,6 +120,18 @@
/>
</div>
</maskLayer>
<!-- 提示弹窗 -->
<div
v-show="tipShow"
style="position: fixed; top: 50vh; display: flex; justify-content: center; width: 100vw"
>
<div
style="padding: 12px; border-radius: 8px; background: rgba(0, 0, 0, 0.4); font-weight: 600"
>
{{ tipText }}
</div>
</div>
</div>
</template>
@ -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', // 82
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)
}
}
}