feat(团队收入页): 使用新的头部组件,对接语言切换功能并调整布局

This commit is contained in:
hzj 2025-10-30 15:28:18 +08:00
parent 39c2a4614f
commit 888bf0bdb7
6 changed files with 69 additions and 28 deletions

View File

@ -96,6 +96,8 @@ watch(
// //
const updateTypeShowText = () => { const updateTypeShowText = () => {
console.log('更新展示类型')
if (props.type == 'In Progress') { if (props.type == 'In Progress') {
typeShowText.value = t('in_progress') typeShowText.value = t('in_progress')
} else if (props.type == 'Pending') { } else if (props.type == 'Pending') {
@ -111,23 +113,23 @@ watch(
() => props.type, () => props.type,
(newType) => { (newType) => {
console.log('newType:', newType) console.log('newType:', newType)
updateTypeShowText()
if (newType == 'In Progress') { if (newType == 'In Progress' || newType == t('in_progress')) {
backgroundImage.value = 'linear-gradient(112deg, #759CFF 5.66%, #3D73FF 42.49%)' backgroundImage.value = 'linear-gradient(112deg, #759CFF 5.66%, #3D73FF 42.49%)'
fontSize.value = '0.9em' fontSize.value = '0.9em'
typeShowText.value = t('in_progress') typeShowText.value = t('in_progress')
} }
if (newType == 'Pending') { if (newType == 'Pending' || newType == t('pending')) {
backgroundImage.value = 'linear-gradient(112deg, #FF7578 5.66%, #FF3D40 42.49%)' backgroundImage.value = 'linear-gradient(112deg, #FF7578 5.66%, #FF3D40 42.49%)'
fontSize.value = '1em' fontSize.value = '1em'
typeShowText.value = t('pending') typeShowText.value = t('pending')
} }
if (newType == 'Completed') { if (newType == 'Completed' || newType == t('completed')) {
backgroundImage.value = 'linear-gradient(112deg, #75FF98 5.66%, #3DFF54 42.49%)' backgroundImage.value = 'linear-gradient(112deg, #75FF98 5.66%, #3DFF54 42.49%)'
fontSize.value = '1em' fontSize.value = '1em'
typeShowText.value = t('completed') typeShowText.value = t('completed')
} }
if (newType == 'Out of account') { if (newType == 'Out of account' || newType == t('out_of_account')) {
backgroundImage.value = 'linear-gradient(112deg, #BDBDBD 5.66%, #AEAEAE 42.49%)' backgroundImage.value = 'linear-gradient(112deg, #BDBDBD 5.66%, #AEAEAE 42.49%)'
fontSize.value = '0.7em' fontSize.value = '0.7em'
typeShowText.value = t('out_of_account') typeShowText.value = t('out_of_account')

View File

@ -20,6 +20,7 @@
"not_authorized": "غير مُصرح به للانضمام", "not_authorized": "غير مُصرح به للانضمام",
"cancellation_failed": "فشلت الإلغاء", "cancellation_failed": "فشلت الإلغاء",
"network_error": "خطأ في الشبكة، يرجى التحقق من اتصالك والمحاولة مرة أخرى", "network_error": "خطأ في الشبكة، يرجى التحقق من اتصالك والمحاولة مرة أخرى",
"host": "المضيف",
"host_center": "مركز المضيف", "host_center": "مركز المضيف",
"my_account": "حسابي", "my_account": "حسابي",
"my_salary": "راتبي", "my_salary": "راتبي",
@ -180,5 +181,7 @@
"information_details": "تفاصيل المعلومات", "information_details": "تفاصيل المعلومات",
"no_transaction_records": "لا توجد سجلات معاملات", "no_transaction_records": "لا توجد سجلات معاملات",
"retry": "إعادة المحاولة", "retry": "إعادة المحاولة",
"failed_to_load_data": "فشل تحميل البيانات" "failed_to_load_data": "فشل تحميل البيانات",
"no_data_available": "لا توجد بيانات متاحة"
} }

View File

@ -20,6 +20,7 @@
"not_authorized": "Not authorized to join", "not_authorized": "Not authorized to join",
"cancellation_failed": "Cancellation failed", "cancellation_failed": "Cancellation failed",
"network_error": "Network error,please check yourconnection and try again", "network_error": "Network error,please check yourconnection and try again",
"host": "Host",
"host_center": "Host Center", "host_center": "Host Center",
"my_account": "My account", "my_account": "My account",
"my_salary": "My salary", "my_salary": "My salary",
@ -180,5 +181,7 @@
"information_details": "Information details", "information_details": "Information details",
"no_transaction_records": "No transaction records", "no_transaction_records": "No transaction records",
"retry": "Retry", "retry": "Retry",
"failed_to_load_data": "Failed to load data" "failed_to_load_data": "Failed to load data",
"no_data_available": "No data available"
} }

View File

@ -20,6 +20,7 @@
"not_authorized": "无权加入", "not_authorized": "无权加入",
"cancellation_failed": "取消失败", "cancellation_failed": "取消失败",
"network_error": "网络错误,请检查您的连接并重试。", "network_error": "网络错误,请检查您的连接并重试。",
"host": "主播",
"host_center": "主播中心", "host_center": "主播中心",
"my_account": "我的账户", "my_account": "我的账户",
"my_salary": "我的工资", "my_salary": "我的工资",
@ -180,5 +181,7 @@
"information_details": "信息详情", "information_details": "信息详情",
"no_transaction_records": "无交易记录", "no_transaction_records": "无交易记录",
"retry": "重试", "retry": "重试",
"failed_to_load_data": "加载数据失败" "failed_to_load_data": "加载数据失败",
"no_data_available": "暂无数据"
} }

View File

@ -413,10 +413,10 @@ const fetchMemberWorkData = async () => {
// //
const formatStatus = (status) => { const formatStatus = (status) => {
const statusMap = { const statusMap = {
SETTLED: t('completed'), SETTLED: 'Completed',
UNPAID: t('in_progress'), UNPAID: 'In Progress',
HANG_UP: t('out_of_account'), HANG_UP: 'Out of account',
PAY_OUT: t('completed'), PAY_OUT: 'Completed',
} }
return statusMap[status] || status return statusMap[status] || status
} }

View File

@ -1,6 +1,13 @@
<template> <template>
<div class="team-bill gradient-background-circles"> <div class="team-bill gradient-background-circles">
<MobileHeader title="Team Bill" /> <!-- 使用 GeneralHeader 替换 MobileHeader -->
<GeneralHeader
:title="t('team_bill')"
:isHomePage="false"
:showLanguageList="true"
color="black"
style="box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); z-index: 999"
/>
<div class="content"> <div class="content">
<!-- 成员资料信息 --> <!-- 成员资料信息 -->
@ -17,7 +24,7 @@
" "
> >
<div style="display: flex; flex-direction: column; gap: 10px"> <div style="display: flex; flex-direction: column; gap: 10px">
<div>History Team Income:</div> <div>{{ t('history_team_income') }}</div>
<div style="font-weight: 600">$000</div> <div style="font-weight: 600">$000</div>
</div> </div>
<div <div
@ -43,12 +50,14 @@
<!-- 工作报告 --> <!-- 工作报告 -->
<div style="margin-bottom: 20px"> <div style="margin-bottom: 20px">
<!-- 工作报告标题 --> <!-- 工作报告标题 -->
<div style="margin: 10px 1%; font-weight: 600; color: rgba(0, 0, 0, 0.4)">Work report:</div> <div style="margin: 10px 1%; font-weight: 600; color: rgba(0, 0, 0, 0.4)">
{{ t('work_report') }}
</div>
<!-- 加载状态 --> <!-- 加载状态 -->
<div v-if="loading" class="loading-container"> <div v-if="loading" class="loading-container">
<div class="loading-spinner"></div> <div class="loading-spinner"></div>
<p>Loading...</p> <p>{{ t('loading') }}...</p>
</div> </div>
<!-- 账单列表 --> <!-- 账单列表 -->
@ -73,7 +82,7 @@
<!-- 空数据状态 --> <!-- 空数据状态 -->
<div v-else class="empty-state"> <div v-else class="empty-state">
<div class="empty-icon">📋</div> <div class="empty-icon">📋</div>
<p>No data available</p> <p>{{ t('no_data_available') }}</p>
</div> </div>
</div> </div>
</div> </div>
@ -104,7 +113,9 @@
position: relative; position: relative;
" "
> >
<div style="margin: 0; font-size: 18px; font-weight: 600; color: #333">Help</div> <div style="margin: 0; font-size: 18px; font-weight: 600; color: #333">
{{ t('help') }}
</div>
<div <div
style=" style="
position: absolute; position: absolute;
@ -122,14 +133,12 @@
</div> </div>
<div style="padding: 0 20px 20px; overflow-y: auto"> <div style="padding: 0 20px 20px; overflow-y: auto">
<p>Shown below is the work report of the members "More" can view more work detailed.</p> <p>{{ t('work_report_description') }}</p>
<p>Status Description:</p> <p>{{ t('status_description') }}</p>
<p>(1)Completed: The system has completed the settlement report.</p> <p>{{ t('status_completed') }}</p>
<p> <p>{{ t('status_pending') }}</p>
(2)Pending: There is currently a dispute, and the system cannot perform a settlement. <p>{{ t('status_out_of_account') }}</p>
</p> <p>{{ t('status_in_progress') }}</p>
<p>(3)Out of account: waiting for system verification.</p>
<p>(4)In progress: work now in progress.</p>
</div> </div>
</div> </div>
@ -147,7 +156,8 @@
<script setup> <script setup>
import { ref, onMounted } from 'vue' import { ref, onMounted } from 'vue'
import MobileHeader from '../components/MobileHeader.vue' import { useI18n } from 'vue-i18n'
import GeneralHeader from '../components/GeneralHeader.vue'
import TeamBillMore from '../components/team/TeamBillMore.vue' import TeamBillMore from '../components/team/TeamBillMore.vue'
import { getUserIdentity } from '@/api/wallet.js' import { getUserIdentity } from '@/api/wallet.js'
import { import {
@ -157,6 +167,12 @@ import {
getTeamReleasePolicy, getTeamReleasePolicy,
} from '../api/teamBill.js' } from '../api/teamBill.js'
import { getTeamId } from '@/utils/userStore.js' import { getTeamId } from '@/utils/userStore.js'
import { setDocumentDirection } from '@/locales/i18n'
const { t, locale } = useI18n()
//
locale.value && setDocumentDirection(locale.value)
const loading = ref(false) const loading = ref(false)
const showHelpModal = ref(false) const showHelpModal = ref(false)
@ -284,7 +300,7 @@ const fetchBillWorkMembers = async (billId) => {
// //
const getStatusText = (status) => { const getStatusText = (status) => {
const statusInfo = formatBillStatus(status) const statusInfo = formatBillStatus(status)
return statusInfo.text return t(statusInfo.textKey) // 使
} }
// //
@ -747,4 +763,18 @@ onMounted(() => {
font-size: 24px; font-size: 24px;
} }
} }
/* RTL支持 */
[dir='rtl'] .help-btn {
transform: scaleX(-1);
}
[dir='rtl'] .arrow {
transform: scaleX(-1);
}
[dir='rtl'] .close-btn {
right: auto;
left: 10px;
}
</style> </style>