feat: 使用新的头部组件,对接语言切换功能并调整布局

This commit is contained in:
hzj 2025-10-31 21:50:08 +08:00
parent c73d267160
commit 18e3fa024f
5 changed files with 68 additions and 16 deletions

View File

@ -219,5 +219,14 @@
"kyc": "KYC", "kyc": "KYC",
"passport_id_card": "جواز السفر/بطاقة الهوية:({current}/3)", "passport_id_card": "جواز السفر/بطاقة الهوية:({current}/3)",
"transfer_coins": "تحويل العملات", "transfer_coins": "تحويل العملات",
"plus_coins": "+{amount} عملات" "plus_coins": "+{amount} عملات",
"enter_contact_number": "يرجى إدخال رقم الاتصال الخاص بك",
"enter_other_description": "يرجى إدخال وصف آخر",
"passport_id_card_title": "جواز السفر/بطاقة الهوية",
"submit": "إرسال",
"unsupported_file_type": "نوع الملف غير مدعوم",
"max_images_warning": "يمكنك تحميل 3 صور كحد أقصى",
"upload_failed": "فشل التحميل",
"please_enter_contact_number": "يرجى إدخال رقم الاتصال"
} }

View File

@ -219,5 +219,14 @@
"kyc": "KYC", "kyc": "KYC",
"passport_id_card": "Passport/ID card:({current}/3)", "passport_id_card": "Passport/ID card:({current}/3)",
"transfer_coins": "Transfer Coins", "transfer_coins": "Transfer Coins",
"plus_coins": "+{amount} Coins" "plus_coins": "+{amount} Coins",
"enter_contact_number": "Please enter your contact number",
"enter_other_description": "Please enter other description",
"passport_id_card_title": "Passport/ID card",
"submit": "Submit",
"unsupported_file_type": "Unsupported file type",
"max_images_warning": "You can upload up to 3 pictures at most",
"upload_failed": "Upload failed",
"please_enter_contact_number": "Please enter contact number"
} }

View File

@ -219,5 +219,14 @@
"kyc": "KYC", "kyc": "KYC",
"passport_id_card": "护照/身份证:({current}/3)", "passport_id_card": "护照/身份证:({current}/3)",
"transfer_coins": "转账金币", "transfer_coins": "转账金币",
"plus_coins": "+{amount} 金币" "plus_coins": "+{amount} 金币",
"enter_contact_number": "请输入您的联系电话",
"enter_other_description": "请输入其他说明",
"passport_id_card_title": "护照/身份证",
"submit": "提交",
"unsupported_file_type": "不支持的文件类型",
"max_images_warning": "最多只能上传3张图片",
"upload_failed": "上传失败",
"please_enter_contact_number": "请输入联系电话"
} }

View File

@ -19,10 +19,10 @@
" "
> >
<div style="font-weight: 600">{{ t('available_salaries') }}</div> <div style="font-weight: 600">{{ t('available_salaries') }}</div>
<div style="display: flex; align-items: center" @click="showDetails"> <!-- <div style="display: flex; align-items: center" @click="showDetails">
<div style="color: rgba(0, 0, 0, 0.4)">{{ t('details') }}</div> <div style="color: rgba(0, 0, 0, 0.4)">{{ t('details') }}</div>
<img src="../../assets/icon/arrow.png" alt="" width="16px" class="flipImg" /> <img src="../../assets/icon/arrow.png" alt="" width="16px" class="flipImg" />
</div> </div> -->
</div> </div>
<div <div
style=" style="

View File

@ -2,14 +2,15 @@
<div class="fullPage"> <div class="fullPage">
<GeneralHeader <GeneralHeader
style="width: 100%" style="width: 100%"
title="KYC" :title="t('kyc')"
color="color: rgba(0, 0, 0, 0.80)" :showLanguageList="true"
color="black"
backImg="/src/assets/icon/arrowBackBlack.png" backImg="/src/assets/icon/arrowBackBlack.png"
/> />
<div style="padding: 16px; display: flex; flex-direction: column; gap: 8px"> <div style="padding: 16px; display: flex; flex-direction: column; gap: 8px">
<!-- 银行卡号 --> <!-- 银行卡号 -->
<div style="font-weight: 600">Contact number</div> <div style="font-weight: 600">{{ t('contact_number') }}</div>
<div <div
style=" style="
border-radius: 8px; border-radius: 8px;
@ -21,13 +22,13 @@
<input <input
type="text" type="text"
v-model="cardNum" v-model="cardNum"
placeholder="Please enter your bank card number" :placeholder="t('enter_contact_number')"
style="width: 100%; border: none; outline: none" style="width: 100%; border: none; outline: none"
/> />
</div> </div>
<!-- 申请信息 --> <!-- 申请信息 -->
<div style="font-weight: 600">Other description</div> <div style="font-weight: 600">{{ t('other_description') }}</div>
<div <div
style=" style="
padding: 12px 12px 20px; padding: 12px 12px 20px;
@ -41,7 +42,7 @@
v-model="description" v-model="description"
rows="5" rows="5"
maxlength="100" maxlength="100"
placeholder="Please enter other description" :placeholder="t('enter_other_description')"
@input="updateCount" @input="updateCount"
style="width: 100%; border: none; outline: none; resize: none" style="width: 100%; border: none; outline: none; resize: none"
></textarea> ></textarea>
@ -59,7 +60,7 @@
</div> </div>
<!-- 上传图片 --> <!-- 上传图片 -->
<div style="font-weight: 600">Passport/lD card:</div> <div style="font-weight: 600">{{ t('passport_id_card_title') }}:</div>
<div style="display: flex; align-items: center"> <div style="display: flex; align-items: center">
<div style="position: relative"> <div style="position: relative">
<img <img
@ -79,7 +80,7 @@
alt="" alt=""
style="display: block; width: 5vw; aspect-ratio: 1/1; object-fit: cover" style="display: block; width: 5vw; aspect-ratio: 1/1; object-fit: cover"
/> />
<div v-for="(imgUrl, index) in previewUrls" style="position: relative"> <div v-for="(imgUrl, index) in previewUrls" :key="index" style="position: relative">
<img <img
:src="imgUrl" :src="imgUrl"
alt="" alt=""
@ -118,7 +119,7 @@
" "
@click="Submit" @click="Submit"
> >
Submit {{ t('submit') }}
</div> </div>
</div> </div>
</div> </div>
@ -126,15 +127,21 @@
</template> </template>
<script setup> <script setup>
import { useI18n } from 'vue-i18n'
import GeneralHeader from '@/components/GeneralHeader.vue' import GeneralHeader from '@/components/GeneralHeader.vue'
import { ref, onMounted, computed } from 'vue' import { ref, onMounted, computed } from 'vue'
import { showError, showWarning, showInfo, showSuccess } from '@/utils/toast.js' import { showError, showWarning, showInfo, showSuccess } from '@/utils/toast.js'
import { setApplyInfo, getApplyInfo } from '@/utils/applyStore.js' import { setApplyInfo, getApplyInfo } from '@/utils/applyStore.js'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { uploadImg } from '@/api/upload.js' import { uploadImg } from '@/api/upload.js'
import { setDocumentDirection } from '@/locales/i18n'
const { t, locale } = useI18n()
const router = useRouter() const router = useRouter()
//
locale.value && setDocumentDirection(locale.value)
const cardNum = ref('') const cardNum = ref('')
const description = ref('') const description = ref('')
const count = computed(() => description.value.length) const count = computed(() => description.value.length)
@ -143,6 +150,11 @@ const previewUrls = ref([]) //预览图
const tempFiles = ref([]) // const tempFiles = ref([]) //
const resImgUrls = ref([]) // const resImgUrls = ref([]) //
//
const updateCount = () => {
// @input
}
// //
// //
const handleFileChange = (e) => { const handleFileChange = (e) => {
@ -160,6 +172,7 @@ const handleFileChange = (e) => {
const file = fileList[0] const file = fileList[0]
if (!file.type || !file.type.startsWith('image/')) { if (!file.type || !file.type.startsWith('image/')) {
console.error(`不支持的文件类型: ${file.type || '未知'}`) console.error(`不支持的文件类型: ${file.type || '未知'}`)
showError(t('unsupported_file_type'))
return return
} }
@ -174,7 +187,7 @@ const handleFileChange = (e) => {
tempFiles.value.push(file) tempFiles.value.push(file)
// uploadImgUrl() // uploadImgUrl()
} else { } else {
showWarning('you can upload up to 3 pictures at most') showWarning(t('max_images_warning'))
} }
} }
@ -194,13 +207,18 @@ const uploadImgUrl = async () => {
resImgUrls.value.push(res.body) resImgUrls.value.push(res.body)
} }
} catch (error) { } catch (error) {
showError(error.errorMsg) showError(error.response?.errorMsg || t('upload_failed'))
} }
} }
} }
// //
const Submit = async () => { const Submit = async () => {
if (!cardNum.value) {
showError(t('please_enter_contact_number'))
return
}
await uploadImgUrl() await uploadImgUrl()
let data = { let data = {
amount: 10, amount: 10,
@ -210,6 +228,7 @@ const Submit = async () => {
} }
setApplyInfo(data) setApplyInfo(data)
router.go(-1) router.go(-1)
showSuccess(t('application_submitted'))
} }
</script> </script>
@ -267,4 +286,10 @@ textarea::-webkit-scrollbar {
font-size: 32px; font-size: 32px;
} }
} }
/* RTL支持 */
[dir='rtl'] .word-count {
right: auto;
left: 4px;
}
</style> </style>