diff --git a/README.md b/README.md index 74f9a98..60edab7 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # tk-page - +备注前面带(gj)的是国家化文本 ## Project setup ``` npm install diff --git a/src/components/Appaside.vue b/src/components/Appaside.vue index 0976ed9..721b7ab 100644 --- a/src/components/Appaside.vue +++ b/src/components/Appaside.vue @@ -248,23 +248,27 @@ class="password-input" show-password /> +
{{ t('Confirm') }}
- + +
@@ -335,8 +342,9 @@ const avatar = ref(null); //头像 const country = ref([]); country.value = getCountryNamesArray(); //国家条目 const genderOptions = [ - { value: 1, label: "男" }, - { value: 2, label: "女" }, + { value: 1, label: t('man') }, + // gj男女 + { value: 2, label: t('woman') }, ]; // 性别选项 const gendervalue = ref(null); // 性别值 const countryvalue = ref(null); //国家 @@ -443,8 +451,10 @@ function initNotification() { } function showNotification() { - const notification = new Notification("新消息到达", { - body: "您有 "+ chatList.value.unreadTotal +" 封未读消息", + const notification = new Notification(t('NewNewsHasArrived'), { + // gj新消息到来 + body: t('YouHave') + chatList.value.unreadTotal + t('unreadMessages'), + // gj你有xxx封未读消息 lang: "zh-CN", // 语言 }); notification.addEventListener('click', () => { @@ -476,24 +486,28 @@ function ResendEmail() { //修改新邮箱 function changeEmail() { if (Email.value == null || Email.value == "") { - ElMessage.error("请输入邮箱验证码"); + ElMessage.error(t('PleaseEnterTheEmailVerificationCode')); + // gj请输入邮箱验证码 return; } if (newEmail.value == null || newEmail.value == "") { - ElMessage.error("请输入新邮箱"); + ElMessage.error(t('PleaseEnterYourNewEmailAddress')); + // gj请输入新邮箱 return; } // 邮箱验证 const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/; if (!emailRegex.test(newEmail.value)) { - ElMessage.error("请输入有效的邮箱地址"); + ElMessage.error(t('PleaseEnterAValidEmailAddress')); + // gj请输入正确的邮箱 return; } editEmail({ mailAddress: newEmail.value, code: Email.value, }).then(res => { - ElMessage.success("修改成功,请至新邮箱中验证邮箱"); + ElMessage.success(t('TheModificationIsSuccessfulPleaseVerifyYourEmailInTheNewEmailAddress')); + // gj修改成功,请验证新邮箱 emailVisible.value = false; UserInfo(); }).catch((err) => {}); @@ -525,7 +539,7 @@ function startCountdown() { //打开修改邮箱弹窗 function emailVisiblefu() { if (info.value.mailVerification == 1) { - ElMessage.error("您暂时无法修改邮箱,请先验证邮箱,如果已经验证请刷新页面"); + ElMessage.error(t('YouAreTemporarilyUnableToModifyYourEmailAddressPleaseVerifyYourEmailFirstIfItHasBeenVerifiedPleaseRefreshThePage')); return; } emailVisible.value = true; @@ -533,7 +547,7 @@ function emailVisiblefu() { // 打开修改密码弹窗 function passwordVisiblefn() { if (info.value.mailVerification == 1) { - ElMessage.error("您暂时无法修改密码,请先验证邮箱,如果已经验证请刷新页面"); + ElMessage.error(t('YouAreTemporarilyUnableToChangeYourPasswordPleaseVerifyYourEmailFirstIfYouHaveAlreadyVerifiedItPleaseRefreshThePage')); return; } passwordVisible.value = true; @@ -542,24 +556,24 @@ function passwordVisiblefn() { // 修改密码 function changePassword() { if (password.value == null || password.value == "") { - ElMessage.error("请输入旧密码"); + ElMessage.error(t('PleaseEnterTheOldPassword')); return; } if (newPassword.value == null || newPassword.value == "") { - ElMessage.error("请输入新密码"); + ElMessage.error(t('PleaseEnterTheNewPassword')); return; } const passwordRegex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{6,16}$/; if (!passwordRegex.test(newPassword.value)) { - ElMessage.error("密码必须包含大小写字母和数字,长度6-16位"); + ElMessage.error(t('ThePasswordMustContainBothUpperAndLowerCaseLettersAndNumbersAndBe6To16CharactersLong')); return; } if (confirmPassword.value == null || confirmPassword.value == "") { - ElMessage.error("请确认新密码"); + ElMessage.error(t('PleaseEnterTheConfirmPassword')); return; } if (newPassword.value !== confirmPassword.value) { - ElMessage.error("两次密码输入不一致"); + ElMessage.error(t('TheTwoPasswordEntriesAreInconsistent')); return; } editUserInfo({ @@ -569,7 +583,7 @@ function changePassword() { oldPassword: password.value, }).then(res => { passwordVisible.value = false; - ElMessage.success("修改成功"); + ElMessage.success(t('ModificationSuccessful')); }).catch((err) => {}); } //修改昵称 @@ -579,7 +593,7 @@ function handleNickNameChange() { nickName: info.value.nickName, }).then(res => { setStorage("user", res); - ElMessage.success("修改成功"); + ElMessage.success(t('ModificationSuccessful')); UserInfo(); }).catch((err) => {}); } @@ -597,17 +611,17 @@ const handleAvatarSuccess = ( headerIcon: response.data.filename, }).then(res => { setStorage("user", res); - ElMessage.success("修改成功"); + ElMessage.success(t('ModificationSuccessful')); UserInfo(); }).catch((err) => {}); } const beforeAvatarUpload = (rawFile) => { if (rawFile.type !== 'image/jpeg' && rawFile.type !== 'image/png'){ - ElMessage.error('请上传 jpg/png 格式的图片') + ElMessage.error(t('PleaseUploadImagesInjpgPngFormat')) return false } else if (rawFile.size / 1024 / 1024 > 2) { - ElMessage.error('图片大小不能超过2M') + ElMessage.error(t('TheSizeOfThePictureCannotExceed2M')) return false } return true @@ -618,19 +632,22 @@ const beforeAvatarUpload = (rawFile) => { //输入框失去焦点 function handleChange() { if (anchorName.value == null || anchorName.value == "") { - ElMessage.error("请输入主播名称"); + ElMessage.error(t('PleaseEnterTheNameOfTheHost')); + //gj请输入主播名称 return; } const loading = ElLoading.service({ lock: true, - text: "查询主播中....", + text: t('CheckTheStreamerAt'), + //gj正在检查主播 background: "rgba(0, 0, 0, 0.7)", }); getAnchorAvatar({ name: anchorName.value }) .then((res) => { loading.close(); AnchorProfilePicture.value = res; - ElMessage.success("查询成功"); + ElMessage.success(t('QuerySuccessful')); + //gj查询成功 }) .catch((err) => { loading.close(); @@ -640,31 +657,38 @@ function handleChange() { function Confirm() { const currentTime = Date.now(); if (anchorName.value == null || anchorName.value == "") { - ElMessage.error("请输入主播名称"); + ElMessage.error(t('PleaseEnterTheNameOfTheHost')); + //gj请输入主播名称 return; } if (gendervalue.value == null || gendervalue.value == "") { - ElMessage.error("请选择性别"); + ElMessage.error(t('PleaseSelectGender')); + //gj请选择性别 return; } if (timevalue.value == null || timevalue.value == "") { - ElMessage.error("请选择PK时间"); + ElMessage.error(t('SelectThePKTime')); + //gj请选择PK时间 return; } if (currentTime > timevalue.value) { - ElMessage.error("PK时间不能早于当前时间"); + ElMessage.error(t('ThePKTimeCannotBeEarlierThanTheCurrentTime')); + //gjPK时间不能早于当前时间 return; } if (countryvalue.value == null || countryvalue.value == "") { - ElMessage.error("请选择国家"); + ElMessage.error(t('PleaseSelectACountry')); + //gj选择国家 return; } if (goldvalue.value == null || goldvalue.value == "") { - ElMessage.error("请输入金币数"); + ElMessage.error(t('PleaseEnterTheNumberOfGoldCoins')); + //gj请输入金币数 return; } if (sessionnum.value == null || sessionnum.value == "") { - ElMessage.error("请输入场次"); + ElMessage.error(t('PleaseEnterTheSession')); + //gj请输入场次 return; } releasePkInfo({ @@ -680,7 +704,8 @@ function Confirm() { pkNumber: sessionnum.value, }) .then((res) => { - ElMessage.success("发布成功"); + ElMessage.success(t('PublishedSuccessfully')); + //gj发布成功 Reset(); drawer.value = false; }) @@ -703,7 +728,8 @@ function Reset() { // 选择我的主播弹窗确认 function myAnchorDialogConfirm() { if (selectAnchor.value == null) { - ElMessage.error("请选择主播"); + ElMessage.error(t('PleaseSelectTheHost')); + //gj请选择主播 return; } AnchorProfilePicture.value = selectAnchor.value.headerIcon.split("/").pop(); @@ -741,10 +767,11 @@ function handleClick(path, id) { // 复制到剪切板 function copyToClipboard(text) { navigator.clipboard.writeText(text).then(() => { - ElMessage.success("邮箱地址已复制到剪切板"); + ElMessage.success(t('TheEmailAddressHasBeenCopiedToTheClipboard')); + //gj邮箱已复制到剪切板 }).catch(err => { - ElMessage.error("复制失败,请手动复制"); - console.error('复制失败: ', err); + console.error(t('CopyFailed'), err); + //gj复制失败 }); } //头像弹出框 @@ -766,7 +793,8 @@ function popoverClick(id) { id: info.value.id, }).then(res => { goEasyDisConnect().then(() => { - ElMessage.success("退出登录成功"); + ElMessage.success(t('LogoutSuccessful')); + //gj退出登录成功 clearStorage("user") clearStorage("token") clearStorage("activeId") @@ -780,7 +808,7 @@ function setsignIn() { signIn({ userId: info.value.id, }).then(res => { - ElMessage.success("签到成功"); + ElMessage.success(t('CheckInSuccessful')); }).catch((err) => {}); } @@ -795,7 +823,8 @@ function UserInfo() { router.push('/ActivateEmail') } if (info.value.mailVerification == 1 && info.value.email != null) { - ElMessage.error("邮箱未验证,请至设置验证邮箱,如果已经验证请刷新页面"); + ElMessage.error(t('YourEmailHasNotBeenVerifiedPleaseGoToTheSettingsToVerifyYourEmailIfItHasBeenVerifiedPleaseRefreshThePage')); + //gj邮箱未验证,请前往设置验证邮箱 } }).catch((err) => {}); } diff --git a/src/components/mineSubComponent/AnchorLibrary.vue b/src/components/mineSubComponent/AnchorLibrary.vue index 54687ee..29af35f 100644 --- a/src/components/mineSubComponent/AnchorLibrary.vue +++ b/src/components/mineSubComponent/AnchorLibrary.vue @@ -29,7 +29,8 @@ background: item.gender == 1 ? '#59D8DB' : '#F3876F', }" > - {{ item.gender == 1 ? "男" : "女" }} + {{ item.gender == 1 ?t('man') : t('woman') }} +
{{ item.country }}
@@ -48,7 +49,8 @@
-
您还没有主播,快去添加吧!
+
{{ t('YouDonHaveALiveStreamerYetHurryUpAndAddOne') }}
+
@@ -58,8 +60,10 @@
-
添加我的主播
-
修改我的主播
+
{{ t('AddMyStreamer') }}
+ +
{{ t('ModifyMyStreamer') }}
+
@@ -69,7 +73,7 @@ @blur="blur()" v-model="anchorName" size="large" - placeholder="请输入主播名称" + :placeholder="t('PleaseEnterTheNameOfTheHost')" />
@@ -78,12 +82,13 @@ v-model="countryvalue" filterable :options="country" - placeholder="请选择国家" + :placeholder="t('PleaseSelectACountry')" size="large" style="vertical-align: middle" class="select" />
+
+
-
确认
-
重置
-
取消
+
{{ t('Confirm') }}
+
{{ t('Reset') }}
+
{{ t('Cancel') }}
@@ -110,15 +116,19 @@ center class="center-dialog" v-model="centerDialogVisible" - title="提示" + :title="t('Hint')" width="200" align-center > - 确认删除该主播? + + {{ t('ConfirmTheDeletionOfThisStreamer') }} +
@@ -143,11 +153,16 @@ import { getCountryNamesArray } from "../../utils/countryUtil"; import { ElLoading } from "element-plus"; import { ElMessage } from "element-plus"; import { setStorage, getStorage, getPromiseStorage } from "@/utils/storage.js"; +// +import { useI18n } from 'vue-i18n' +const { t } = useI18n() +window['$t'] = t +// const country = ref([]); country.value = getCountryNamesArray(); //国家条目 const genderOptions = [ - { value: 1, label: "男" }, - { value: 2, label: "女" }, + { value: 1, label: t('man') }, + { value: 2, label: t('woman') }, ]; // 性别选项 const gendervalue = ref(null); // 性别值 const countryvalue = ref(null); //国家 @@ -158,7 +173,6 @@ const AnchorProfilePicture = ref(null); // 主播头像 const centerDialogVisible = ref(false); // 确认删除弹窗 const anchormodifystate = ref(false); // 编辑 const anchormodifystateId = ref(null); // 主播头像 - // 获取主播列表 function AnchorList() { getAnchorList({ id: user.value.id }) @@ -197,7 +211,8 @@ const deleteAnchor = () => { delAnchor({ id: deleteAnchorID.value }) .then((res) => { centerDialogVisible.value = false; - ElMessage.success("删除成功"); + ElMessage.success(t('DeletedSuccessfully')); + // gj删除成功 AnchorList(); }) .catch((err) => {}); @@ -211,15 +226,18 @@ function load() {} // 确认添加或修改主播 function Confirm() { if (anchorName.value == null || anchorName.value == "") { - ElMessage.error("请输入主播名称"); + ElMessage.error(t('PleaseEnterTheNameOfTheHost')); + // gj请输入主播名称 return; } if (gendervalue.value == null) { - ElMessage.error("请选择性别"); + ElMessage.error(t('PleaseSelectGender')); + // gj请选择性别 return; } if (countryvalue.value == null) { - ElMessage.error("请选择国家"); + ElMessage.error(t('PleaseSelectACountry')); + //gj请选择国家 return; } //修改主播还是添加 @@ -234,7 +252,8 @@ function Confirm() { createUserId: user.value.id, }) .then((res) => { - ElMessage.success("修改成功"); + ElMessage.success(t('ModificationSuccessful')); + // gj修改成功 cancel(); AnchorList(); }) @@ -251,7 +270,7 @@ function Confirm() { createUserId: user.value.id, }) .then((res) => { - ElMessage.success("添加成功"); + ElMessage.success(t('AddedSuccessfully')); AnchorList(); }) .catch((err) => { @@ -268,12 +287,14 @@ function Reset() { //输入框失去焦点 function blur() { if (anchorName.value == null || anchorName.value == "") { - ElMessage.error("请输入主播名称"); + ElMessage.error(t('PleaseEnterTheNameOfTheHost')); + // gj请输入主播名称 return; } const loading = ElLoading.service({ lock: true, - text: "查询主播中....", + text: t('CheckTheStreamerAt'), + // gj正在检查主播 background: "rgba(0, 0, 0, 0.7)", }); getAnchorAvatar({ name: anchorName.value }) diff --git a/src/components/mineSubComponent/PKRecord.vue b/src/components/mineSubComponent/PKRecord.vue index bc39509..3121361 100644 --- a/src/components/mineSubComponent/PKRecord.vue +++ b/src/components/mineSubComponent/PKRecord.vue @@ -46,7 +46,8 @@
{{ item.anchorIdA }}
- PK时间:{{ TimestamptolocalTime(item.pkTime * 1000) }} + {{t('PKTime')+TimestamptolocalTime(item.pkTime * 1000) }} +
- 实际金币数: + {{ t('ActualNumberOfGoldCoins') }} +
{{ goldCoinCalculation(item.userACoins) }}
@@ -72,7 +74,7 @@
{{ item.anchorIdB }}
- PK时间:{{ TimestamptolocalTime(item.pkTime * 1000) }} + {{t('PKTime')+TimestamptolocalTime(item.pkTime * 1000) }}
- 实际金币数: + {{ t('ActualNumberOfGoldCoins') }} +
{{ goldCoinCalculation(item.userBCoins) }}
@@ -94,7 +97,8 @@
-
您还没有PK记录
+
{{ t('YouDonHaveAPKRecordYet') }}
+
@@ -117,7 +121,8 @@
- 总共:{{ goldCoinCalculation(selectedData.userACoins) }} + {{t('InTotal')+goldCoinCalculation(selectedData.userACoins) }} +
- 总共:{{ goldCoinCalculation(selectedData.userBCoins) }} + {{t('InTotal')+goldCoinCalculation(selectedData.userBCoins) }} +
@@ -139,7 +145,8 @@ background: item.anchorCoinA > item.anchorCoinB ? '#D1F6F7' : '#F9DFD9', }" > - 第{{ index + 1 }}局: + {{t('The')+index + 1+t('THInning') }}: + {{ goldCoinCalculation(item.anchorCoinA) }}
@@ -152,14 +159,15 @@ background: item.anchorCoinB > item.anchorCoinA ? '#D1F6F7' : '#F9DFD9', }" > - 第{{ index + 1 }}局: + {{t('The')+index + 1+t('THInning') }}: + {{ goldCoinCalculation(item.anchorCoinB) }}
-
右方选择记录立即查看详情
+
{{ t('SelectRecordOnTheRightToViewDetailsImmediately') }}
@@ -180,18 +188,26 @@ import { getPromiseStorage } from "@/utils/storage.js"; import { TimestamptolocalTime } from "@/utils/timeConversion.js"; import { goldCoinCalculation } from "@/utils/goldCoinCalculation.js"; +// +import { useI18n } from "vue-i18n"; +const { t } = useI18n(); +window["$t"] = t; +// + const user = ref(null); // 用户信息 const refname = ref(""); const segmentedvalue = ref(1); const options = [ { - label: "我发布的PK", + label: t('ThePKIPosted'), + // gj发布的PK value: 1, icon: require("@/assets/Publish.png"), SelectedIcon: require("@/assets/PublishSelected.png"), }, { - label: "我邀请的PK", + label: t('ThePKIInvited'), + // gj邀请的PK value: 2, icon: require("@/assets/Invitation.png"), SelectedIcon: require("@/assets/InvitationSelected.png"), @@ -219,10 +235,8 @@ function optionsclick(value) { selectedData.value = null; if (value === 1) { list.value = IPKPostedData.value; - console.log("我发布的PK", list.value); } else { list.value = InvitationData.value; - console.log("我邀请的PK", list.value); } } @@ -385,7 +399,7 @@ onUnmounted(() => { display: flex; } .Options { - width: 178px; + width: 300px; height: 100px; margin-right: 120px; display: flex; diff --git a/src/components/mineSubComponent/PKmessage.vue b/src/components/mineSubComponent/PKmessage.vue index 021a9e0..c28ebd8 100644 --- a/src/components/mineSubComponent/PKmessage.vue +++ b/src/components/mineSubComponent/PKmessage.vue @@ -28,7 +28,8 @@ background: item.sex == 1 ? '#59D8DB' : '#F3876F', }" > - {{ item.sex == 1 ? "男" : "女" }} + {{ item.sex == 1 ? t('Male') : t('Female') }} +
{{ item.country }}
@@ -38,7 +39,8 @@ alt="" />
- 金币: + {{ t('GoldCoin') }} +
{{ item.coin }}K
@@ -49,13 +51,14 @@ alt="" />
- 场次: -
{{ item.pkNumber }}场
+ {{ t('session') }} + +
{{ item.pkNumber+t('match') }}
- PK时间:{{ TimestamptolocalTime(item.pkTime * 1000) }} + {{t('PKTime')+TimestamptolocalTime(item.pkTime * 1000) }}
@@ -87,7 +90,8 @@
-
您还没有PK信息,快去添加吧!
+
{{ t('YoudonHaveAnyPKInformationYetHurryUpAndAddIt') }}
+
@@ -99,7 +103,7 @@
{{ t('ReleaseANewPK') }}
-
修改PK信息
+
{{ t('ModifyThePKInformation') }}
@@ -184,7 +188,7 @@
{{ t('Reset') }}
-
取消
+
{{ t('Cancel') }}
@@ -197,19 +201,21 @@ class="center-dialog" v-model="centerDialogVisible" title="提示" - width="200" + width="300" align-center > - 确认删除该条主播PK信息? + {{ t('ConfirmTheDeletionOfThisStreamerPKInformation') }} +
- + +
- {{ item.gender == 1 ? "男" : "女" }} + {{ item.gender == 1 ? t('man') : t('woman') }} +
{{ item.country }}
@@ -244,44 +251,51 @@
-
取消
-
确认
+
{{ t('Cancel') }}
+
{{ t('Confirm') }}
- + +
- 置顶后,该用户将在首页置顶,并在指定时长内享有置顶特权。置顶时长 - 不足1小时,系统将按1小时计算积分扣除。请选择置顶时长: + {{ t('TopPromptOnTheHomepage') }} +
+
-
取消
-
确认
+
{{ t('Cancel') }}
+ +
{{ t('Confirm') }}
+
- + +
- 您确定要取消置顶吗?取消置顶后,该用户将不再享有置顶特权,但仍可继续参与 - PK挑战。若置顶时长不足1小时,系统将按1小时计算积分扣除。取消后按实际使用时长比例返还剩余积分,是否确认执行此操作? + {{ t('UnpinTheTopPrompt') }} +
-
取消
-
确认
+
{{ t('Cancel') }}
+ +
{{ t('Confirm') }}
+
@@ -318,8 +332,8 @@ window['$t'] = t const country = ref([]); country.value = getCountryNamesArray(); //国家条目 const genderOptions = [ - { value: 1, label: "男" }, - { value: 2, label: "女" }, + { value: 1, label: t('man') }, + { value: 2, label: t('woman') }, ]; // 性别选项 const user = ref(null); // 用户信息 const gendervalue = ref(null); // 性别值 @@ -358,7 +372,6 @@ function myAnchorDialogConfirm() { //获取我的主播库数据 function getMyAnchorLibrary() { getAnchorList({ id: user.value.id }).then((res) => { - console.log("anchorLibrary", res); anchorLibrary.value = res; }).catch((err) => {}); } @@ -384,7 +397,7 @@ function topPositionstateConfirm() { articleId: topPositiondata.value.id, pinExpireTime: topPositionvalue.value, }).then((res) => { - ElMessage.success("置顶成功"); + ElMessage.success(t('TopPlacementSuccessful')); topPositionstate.value = false; list.value = []; page.value = 0; @@ -407,13 +420,15 @@ function cancelTopPositionstateConfirm() { function generateTimeOptions(currentTimestamp, targetTimestamp) { const timeDiff = targetTimestamp - currentTimestamp; // 时间差小于0,说明已过期 - if (timeDiff <= 0) return [{ value: 0, label: "已过期" }]; + if (timeDiff <= 0) return [{ value: 0, label: t('Expired') }]; + //gj已过期 const hours = Math.ceil(timeDiff / 3600); const options = Array.from({ length: hours }, (_, i) => { const hour = i + 1; return { value: currentTimestamp + hour * 3600, - label: `${hour}个小时`, + label: `${hour}`+t('hour'), + //gj时长 }; }); return options; @@ -463,7 +478,8 @@ function deleteAnchor() { delPkInfo({ id: deletePKInfodata.value.id, }).then((res) => { - ElMessage.success("删除成功"); + ElMessage.success(t('DeletedSuccessfully')); + // gj删除成功 list.value = []; page.value = 0; PKInfo(); @@ -474,38 +490,40 @@ function deleteAnchor() { function Confirm() { const currentTime = Date.now(); if (anchorName.value == null || anchorName.value == "") { - ElMessage.error("请输入主播名称"); + ElMessage.error(t('PleaseEnterTheNameOfTheHost')); + //gj请输入主播名称 return; } if (gendervalue.value == null || gendervalue.value == "") { - ElMessage.error("请选择性别"); + ElMessage.error(t('PleaseSelectGender')); + //gj请选择性别 return; } if (timevalue.value == null || timevalue.value == "") { - ElMessage.error("请选择PK时间"); + ElMessage.error(t('SelectThePKTime')); + //gj请选择PK时间 return; } if (currentTime > timevalue.value) { - ElMessage.error("PK时间不能早于当前时间"); + ElMessage.error(t('ThePKTimeCannotBeEarlierThanTheCurrentTime')); + //gjPK时间不能早于当前时间 return; } if (countryvalue.value == null || countryvalue.value == "") { - ElMessage.error("请选择国家"); + ElMessage.error(t('PleaseSelectACountry')); + //gj国家 return; } if (goldvalue.value == null || goldvalue.value == "") { - ElMessage.error("请输入金币数"); + ElMessage.error(t('PleaseEnterTheNumberOfGoldCoins')); + //gj请输入金币数 return; } if (sessionnum.value == null || sessionnum.value == "") { - ElMessage.error("请输入场次"); + ElMessage.error(t('PleaseEnterTheSession')); + //gj请输入场次 return; } - const loading = ElLoading.service({ - lock: true, - text: "发布中....", - background: "rgba(0, 0, 0, 0.7)", - }); if (modifyDialogstate.value) { editPkInfo({ id: modifyDialogstateID.value, @@ -520,8 +538,8 @@ function Confirm() { anchorIcon: AnchorProfilePicture.value, pkNumber: sessionnum.value, }).then((res) => { - loading.close(); - ElMessage.success("修改成功"); + ElMessage.success(t('ModificationSuccessful')); + // gj修改成功 list.value = []; page.value = 0; PKInfo(); @@ -541,15 +559,13 @@ function Confirm() { pkNumber: sessionnum.value, }) .then((res) => { - loading.close(); - ElMessage.success("发布成功"); + ElMessage.success(t('PublishedSuccessfully')); list.value = []; page.value = 0; PKInfo(); Reset(); }) .catch((err) => { - loading.close(); console.log(err); }); } @@ -569,19 +585,22 @@ function Reset() { //输入框失去焦点 function handleChange() { if (anchorName.value == null || anchorName.value == "") { - ElMessage.error("请输入主播名称"); + ElMessage.error(t('PleaseEnterTheNameOfTheHost')); + //gj请输入主播名称 return; } const loading = ElLoading.service({ lock: true, - text: "查询主播中....", + text: t('CheckTheStreamerAt'), + //gj正在查询 background: "rgba(0, 0, 0, 0.7)", }); getAnchorAvatar({ name: anchorName.value }) .then((res) => { loading.close(); AnchorProfilePicture.value = res; - ElMessage.success("查询成功"); + ElMessage.success(t('QuerySuccessful')); + // gj查询成功 }) .catch((err) => { loading.close(); @@ -974,14 +993,14 @@ watch(refname, async (newQuestion, oldQuestion) => { } .topPosition-content { width: 100%; - height: 500px; + height: 600px; display: flex; align-items: center; flex-direction: column; } .topPosition-content-title { width: 80%; - height: 100px; + height: 200px; margin-top: 50px; color: #999999; font-size: 24px; @@ -993,7 +1012,7 @@ watch(refname, async (newQuestion, oldQuestion) => { } .cancelTopPosition{ width: 100%; - height: 400px; + height: 500px; display: flex; flex-direction: column; align-items: center; @@ -1002,6 +1021,6 @@ watch(refname, async (newQuestion, oldQuestion) => { width: 80%; color: #999999; font-size: 24px; - height: 300px; + height: 400px; } diff --git a/src/components/mineSubComponent/PointsList.vue b/src/components/mineSubComponent/PointsList.vue index 5ced117..77c6909 100644 --- a/src/components/mineSubComponent/PointsList.vue +++ b/src/components/mineSubComponent/PointsList.vue @@ -4,7 +4,8 @@
- 我的积分:{{ user.points }} + {{t('MyPoints')+user.points }} +
@@ -26,7 +27,8 @@
-
您还没有积分记录!
+
{{ t('YouDonHaveAnyPointsRecordsYet') }}
+
@@ -44,6 +46,11 @@ import { getIntegralDetail } from "@/api/account"; import { ElMessage } from "element-plus"; import { getPromiseStorage } from "@/utils/storage.js"; import { TimestamptolocalTime } from "../../utils/timeConversion"; +// +import { useI18n } from "vue-i18n"; +const { t } = useI18n(); +window["$t"] = t; +// const pointsList = ref([]); const user = ref({}); //用户信息 const page = ref(0); diff --git a/src/i18n/en/Appaside.json b/src/i18n/en/Appaside.json deleted file mode 100644 index 80b3731..0000000 --- a/src/i18n/en/Appaside.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "InSiteMessage": "In-site message", - "Mine": "Mine", - "SignIn": "Sign in", - "message": "message", - "Settings": "Settings", - "ContactCustomerService": "Contact customer service (click to copy the email address)", - "Logout": "Log out", - "ReleaseANewPK": "Release a new PK", - "PleaseEnterTheNameOfTheHost": "Please enter the name of the host", - "ChooseMyStreamer": "Choose mine", - "PleaseSelectACountry": "Please select a country", - "PleaseSelectGender": "Please select gender", - "SelectThePKTime": "Select the PK time", - "NumberOfGoldCoins": "The number of gold coins (in K)", - "Session": "Session", - "PleaseEnterTheRemarks": "Please enter the remarks (optional)", - "Confirm": "Confirm", - "Reset": "Reset", - "Cancel": "Cancel", - "SelectTheStreamersFromMyStreamerLibrary": "Select the streamers from my streamer library", - "man": "man", - "woman": "woman", - "ClickOnTheAvatarAboveToModifyIt": "Click on the avatar above to modify it", - "ClickToEnterAndModifyYourNickname": "Click to enter and modify your nickname", - "ResendTheEmailTo": "Resend the email to", - "ForVerification": "for verification", - "ModifyTheEmailAddress": "Modify the email address", - "ChangePassword":"Change password", - "PleaseEnterTheOldPassword": "Please enter the old password", - "PleaseEnterTheNewPassword": "Please enter the new password", - "PleaseEnterTheConfirmPassword": "Please enter the confirm password" -} \ No newline at end of file diff --git a/src/i18n/en/country.json b/src/i18n/en/country.json new file mode 100644 index 0000000..cb99135 --- /dev/null +++ b/src/i18n/en/country.json @@ -0,0 +1,3 @@ +{ + "Andorra": "Andorra" +} \ No newline at end of file diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index 213e045..5db2679 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -1,11 +1,11 @@ -import login from './login.json' -import Appaside from './Appaside.json' +import index from './index.json' +import country from './country.json' const global = { logout: 'Logout', } export default { ...global, - ...login, - ...Appaside + ...index, + ...country } diff --git a/src/i18n/en/index.json b/src/i18n/en/index.json new file mode 100644 index 0000000..81249e1 --- /dev/null +++ b/src/i18n/en/index.json @@ -0,0 +1,169 @@ +{ + "login": "Login", + "Login": "Log in.....", + "LoginFailed": "Login failed", + "Welcome_to_login": "Welcome to login", + "PleaseEnterEmailOrUsername": "Please enter email or username", + "PleaseEnterPassword": "Please enter password", + "WechatMiniProgramLogin": "Wechat Mini Program Login", + "LogInByScanningTheQRCodeWithTheWechatMini-program": "Log in by scanning the QR code with the wechat mini-program", + "DontHaveAnAccountYet": "Don't have an account yet?", + "Register": "Register", + "AlreadyHaveAnAccount": "Already have an account?", + "ForgotPassword": "Forgot password?", + "InSiteMessage": "In-site message", + "Mine": "Mine", + "SignIn": "Sign in", + "message": "message", + "Settings": "Settings", + "ContactCustomerService": "Contact customer service (click to copy the email address)", + "Logout": "Log out", + "ReleaseANewPK": "Release a new PK", + "ModifyThePKInformation": "Modify the PK information", + "PleaseEnterTheNameOfTheHost": "Please enter the name of the host", + "ChooseMyStreamer": "Choose mine", + "PleaseSelectACountry": "Please select a country", + "PleaseSelectGender": "Please select gender", + "SelectThePKTime": "Select the PK time", + "NumberOfGoldCoins": "The number of gold coins (in K)", + "Session": "Session", + "PleaseEnterTheRemarks": "Please enter the remarks (optional)", + "Confirm": "Confirm", + "Reset": "Reset", + "Cancel": "Cancel", + "SelectTheStreamersFromMyStreamerLibrary": "Select the streamers from my streamer library", + "man": "man", + "woman": "woman", + "ClickOnTheAvatarAboveToModifyIt": "Click on the avatar above to modify it", + "ClickToEnterAndModifyYourNickname": "Click to enter and modify your nickname", + "ResendTheEmailTo": "Resend the email to", + "ForVerification": "for verification", + "ModifyTheEmailAddress": "Modify the email address", + "ChangePassword": "Change password", + "PleaseEnterTheOldPassword": "Please enter the old password", + "PleaseEnterTheNewPassword": "Please enter the new password", + "PleaseEnterTheConfirmPassword": "Please enter the confirm password", + "PleaseEnterTheVerificationCodeOfYourOldEmailAddress": "Please enter the verification code of your old email address", + "PleaseEnterYourNewEmailAddress": "Please enter your new email address", + "Modify": "Modify", + "PleaseEnterTheEmailVerificationCode": "Please enter the email verification code", + "GetTheVerificationCode": "Get the verification code", + "Resend": "Resend", + "PleaseEnterAValidEmailAddress": "Please enter a valid email address", + "TheModificationIsSuccessfulPleaseVerifyYourEmailInTheNewEmailAddress": "The modification is successful. Please verify your email in the new email address.", + "YouAreTemporarilyUnableToModifyYourEmailAddressPleaseVerifyYourEmailFirstIfItHasBeenVerifiedPleaseRefreshThePage": "You are temporarily unable to modify your email address. Please verify your email first if it has been verified. Please refresh the page.", + "YouAreTemporarilyUnableToChangeYourPasswordPleaseVerifyYourEmailFirstIfYouHaveAlreadyVerifiedItPleaseRefreshThePage": "You are temporarily unable to change your password. Please verify your email first if you have already verified it. Please refresh the page.", + "ThePasswordMustContainBothUpperAndLowerCaseLettersAndNumbersAndBe6To16CharactersLong": "The password must contain both upper and lower case letters and numbers and be 6 to 16 characters long.", + "TheTwoPasswordEntriesAreInconsistent": "The two password entries are inconsistent.", + "ModificationSuccessful": "Modification successful.", + "PleaseUploadImagesInjpgPngFormat": "Please upload images in jpg/png format.", + "TheSizeOfThePictureCannotExceed2M": "The size of the picture cannot exceed 2M.", + "CheckTheStreamerAt": "Check the streamer at...", + "QuerySuccessful": "Query successful.", + "ThePKTimeCannotBeEarlierThanTheCurrentTime": "The PK time cannot be earlier than the current time.", + "PleaseEnterTheNumberOfGoldCoins": "Please enter the number of gold coins", + "PleaseEnterTheSession": "Please enter the session", + "PublishedSuccessfully": "Published successfully.", + "PleaseSelectTheHost": "Please select the host", + "TheEmailAddressHasBeenCopiedToTheClipboard": "The email address has been copied to the clipboard.", + "CopyFailed": "Copy failed.", + "LogoutSuccessful": "Logout successful.", + "CheckInSuccessful": "Check-in successful.", + "YourEmailHasNotBeenVerifiedPleaseGoToTheSettingsToVerifyYourEmailIfItHasBeenVerifiedPleaseRefreshThePage": "Your email has not been verified. Please go to the settings to verify your email if it has been verified. Please refresh the page.", + "NewNewsHasArrived": "New news has arrived.", + "YouHave": "You have", + "unreadMessages": "unread messages", + "AccountInformation": "Account information", + "EmailVerification": "Email verification", + "RetrieveThePassword": "Retrieve the password", + "PleaseEnterTheEmailAddressForWhichYouNeedToRetrieveYourPassword": "Please enter the email address for which you need to retrieve your password", + "Return": "Return", + "NextStep": "Next step", + "AVerificationEmailHasBeenSentToYour": "A verification email has been sent to your ", + "emailAddressPleaseClickOnTheLinkInTheEmailToCompleteTheRetrieval": "email address. Please click on the link in the email to complete the retrieval.", + "emailAddressPleaseClickOnTheLinkInTheEmailToCompleteTheRegistration": "email address. Please click on the link in the email to complete the registration.", + "PreviousStep": "Previous step", + "ResendIn": "Resend in", + "seconds": "seconds", + "ResendTheEmail": "Resend the email", + "ReturnToLogin": "Return to login", + "TheEmailWasSentSuccessfully": "The email was sent successfully.", + "TheEmailFailedToSend": "The email failed to send.", + "PleaseEnterYourEmailAddress": "Please enter your email address", + "PleaseEnterYourUsername": "Please enter your username", + "PleaseEnterThePasswordAgain": "Please enter the password again", + "TheLengthOfAUsernameCannotBeLessThan2CannotExceed16AndCannotBeEmpty": "The length of a username cannot be less than 2, cannot exceed 16, and cannot be empty.", + "TheUsernameAlreadyExists": "The username already exists.", + "TheUsernameIsAvailable": "The username is available.", + "TheEmailHasBeenResold": "The email has been resold.", + "ActivationInProgressPleaseWaitAMoment": "Activation in progress. Please wait a moment.", + "ActivationSuccessfulPleaseLogIn": "Activation successful. Please log in.", + "ActivationFailed": "Activation failed.", + "YourEmailAddressIs": "Your email address is", + "ItHasNotBeenActivatedYetPleaseClickTheActivationLinkInYourEmailToActivateYourAccount": ". It has not been activated yet. Please click the activation link in your email to activate your account.", + "ResendTheActivationEmail": "Resend the activation email", + "TheActivationEmailHasBeenSentPleaseCheckItInTime": "The activation email has been sent. Please check it in time.", + "TheActivationEmailSendingFailedPleaseTryAgainLater":"The activation email sending failed. Please try again later.", + "ResetThePassword": "Reset the password", + "PasswordResetSuccessful": "Password reset successful.", + "VerificationInProgressPleaseWaitAMoment":"Verification in progress. Please wait a moment.", + "VerificationSuccessfulPleaseLogIn":"Verification successful. Please log in.", + "VerificationFailed":"Verification failed.", + "PKHall": "PK Hall", + "TodayPK": "Today PK", + "MinimumNumberOfGoldCoins":"Minimum number of gold coins (in K)", + "MaximumNumberOfGoldCoins":"Maximum number of gold coins (in K)", + "MinimumPKTime":"Minimum PK time", + "MaximumPKTime":"Maximum PK time", + "to":"to", + "Country":"Country", + "Gender":"Gender", + "PKTime":"PK time (local time) :", + "GoldCoin":"Gold coin :", + "session":"Session:", + "match":"Match", + "Send":"Send", + "SelectTheHostOnTheRightToChatImmediately":"Select the host on the right to chat immediately.", + "PKInvitation":"PK invitation", + "ChooseTheOpponentPKStreamer":"Choose the opponent's PK streamer", + "ChooseYourOwnPKStreamer":"Choose your own PK streamer", + "Hint":"Hint", + "AreYouSureYouWantToSendAPKInvitationMessageAfterASuccessfulInvitationThePkCannotBeModifiedOrDeletedPleasePaution":"Are you sure you want to send a PK invitation message? After a successful invitation, the pk cannot be modified or deleted. Please operate with caution!", + "PleaseSelectTheStreamerWhoWillParticipateInThePK":"Please select the streamer who will participate in the PK", + "PleaseSelectOurStreamerToParticipateInThePK":"Please select our streamer to participate in the PK", + "PleaseSelectTheOtherPartyAndYourOwnStreamer":"Please select the other party and your own streamer", + "PleaseEnterTheMaximumNumberOfGoldCoins":"Please enter the maximum number of gold coins", + "PleaseEnterTheMinimumNumberOfGoldCoins":"Please enter the minimum number of gold coins", + "TheStartTimeCannotBeLessThanTheCurrentTime":"The start time cannot be less than the current time", + "AnchorLibrary":"Anchor Library", + "PKInformation":"PK Information", + "MyPKRecord":"My PK record", + "PointsList":"Points list", + "MyPoints":"My points :", + "YouDonHaveAnyPointsRecordsYet":"You don't have any points records yet !", + "ActualNumberOfGoldCoins":"Actual number of gold coins :", + "YouDonHaveAPKRecordYet":"You don't have a PK record yet !", + "InTotal":"In total :", + "The":"The", + "THInning":"TH inning", + "SelectRecordOnTheRightToViewDetailsImmediately":"Select Record on the right to view details immediately", + "ThePKIPosted":"The PK I posted", + "ThePKIInvited":"The PK I invited", + "YoudonHaveAnyPKInformationYetHurryUpAndAddIt":"You don't have any PK information yet. Hurry up and add it!", + "ConfirmTheDeletionOfThisStreamerPKInformation":"Confirm the deletion of this streamer PK information?", + "TopPosition":"Top position", + "TopPromptOnTheHomepage":"After being pinned to the top, the user will be pinned to the top of the home page and enjoy the privilege of being pinned for a specified period of time. If the pinned duration is less than one hour, the system will calculate the points deduction as one hour. Please select the pinned duration:", + "PleaseSelectThePinnedDuration":"Please select the pinned duration", + "UnpinTheTopPrompt":"Are you sure you want to cancel the pinning? After the pinning is cancelled, the user will no longer enjoy the pinning privilege, but can still continue to participatePK challenge. If the pinned duration is less than one hour, the system will calculate the points deduction as one hour. After cancellation, the remaining points will be returned in proportion to the actual usage time. Is this operation confirmed to be carried out?", + "Unpinned":"Unpinned", + "hour":"hour", + "Expired":"Expired", + "TopPlacementSuccessful":"Top placement successful.", + "DeletedSuccessfully":"Deleted successfully.", + "YouDonHaveALiveStreamerYetHurryUpAndAddOne":"You don't have a live-streamer yet. Hurry up and add one!", + "AddMyStreamer":"Add my streamer", + "ModifyMyStreamer":"Modify my streamer", + "ConfirmTheDeletionOfThisStreamer":"Confirm the deletion of this streamer?", + "AddedSuccessfully":"Added successfully." + +} \ No newline at end of file diff --git a/src/i18n/en/login.json b/src/i18n/en/login.json deleted file mode 100644 index 05b8e73..0000000 --- a/src/i18n/en/login.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "login": "Login", - "Welcome_to_login": "Welcome to login", - "PleaseEnterEmailOrUsername": "Please enter email or username", - "PleaseEnterPassword": "Please enter password", - "WechatMiniProgramLogin": "Wechat Mini Program Login", - "LogInByScanningTheQRCodeWithTheWechatMini-program":"Log in by scanning the QR code with the wechat mini-program", - "DontHaveAnAccountYet":"Don't have an account yet?", - "Register":"Register", - "AlreadyHaveAnAccount":"Already have an account?", - "ForgotPassword":"Forgot password?" - } \ No newline at end of file diff --git a/src/i18n/zh/Appaside.json b/src/i18n/zh/Appaside.json deleted file mode 100644 index 78eaeb0..0000000 --- a/src/i18n/zh/Appaside.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "InSiteMessage":"站内信", - "Mine":"我的", - "SignIn":"签到", - "message":"消息", - "Settings":"设置", - "ContactCustomerService":"联系客服(点击复制邮箱)", - "Logout":"退出登录", - "ReleaseANewPK":"发布新PK", - "PleaseEnterTheNameOfTheHost":"请输入主播名称", - "ChooseMyStreamer":"选择我的主播", - "PleaseSelectACountry":"请选择国家", - "PleaseSelectGender":"请选择性别", - "SelectThePKTime":"选择PK时间", - "NumberOfGoldCoins":"金币数(单位为K)", - "Session":"场次", - "PleaseEnterTheRemarks":"请输入备注(选填)", - "Confirm":"确认", - "Reset":"重置", - "Cancel":"取消", - "SelectTheStreamersFromMyStreamerLibrary":"选择我的主播库主播", - "man":"男", - "woman":"女", - "ClickOnTheAvatarAboveToModifyIt":"点击头像上方修改头像", - "ClickToEnterAndModifyYourNickname":"点击输入修改昵称", - "ResendTheEmailTo":"向", - "ForVerification":"重发邮箱验证", - "ModifyTheEmailAddress":"修改邮箱", - "ChangePassword":"修改密码", - "PleaseEnterTheOldPassword":"请输入旧密码", - "PleaseEnterTheNewPassword":"请输入新密码", - "PleaseEnterTheConfirmPassword":"请再次输入新密码" -} \ No newline at end of file diff --git a/src/i18n/zh/country.json b/src/i18n/zh/country.json new file mode 100644 index 0000000..4dae4d7 --- /dev/null +++ b/src/i18n/zh/country.json @@ -0,0 +1,5 @@ +{ + "Andorra":"安道尔" + + +} \ No newline at end of file diff --git a/src/i18n/zh/index.js b/src/i18n/zh/index.js index 0f12279..8d8b2ec 100644 --- a/src/i18n/zh/index.js +++ b/src/i18n/zh/index.js @@ -1,11 +1,11 @@ -import login from './login.json' -import Appaside from './Appaside.json' +import index from './index.json' +import country from './country.json' const global = { logout: '退出登录', } export default { ...global, - ...login, - ...Appaside + ...index, + ...country } \ No newline at end of file diff --git a/src/i18n/zh/index.json b/src/i18n/zh/index.json new file mode 100644 index 0000000..2bf126c --- /dev/null +++ b/src/i18n/zh/index.json @@ -0,0 +1,168 @@ +{ + "login": "登录", + "Login": "登录中...", + "LoginFailed": "登录失败", + "Welcome_to_login": "欢迎登录", + "PleaseEnterEmailOrUsername": "请输入邮箱或用户名", + "PleaseEnterPassword": "请输入密码", + "WechatMiniProgramLogin": "微信小程序登录", + "LogInByScanningTheQRCodeWithTheWechatMini-program": "使用微信小程序扫描二维码登录", + "DontHaveAnAccountYet":"还没有账号?", + "Register": "注册", + "AlreadyHaveAnAccount": "已有账号?", + "ForgotPassword": "忘记密码?", + "InSiteMessage":"站内信", + "Mine":"我的", + "SignIn":"签到", + "message":"消息", + "Settings":"设置", + "ContactCustomerService":"联系客服(点击复制邮箱)", + "Logout":"退出登录", + "ReleaseANewPK":"发布新PK", + "ModifyThePKInformation":"修改 PK 信息", + "PleaseEnterTheNameOfTheHost":"请输入主播名称", + "ChooseMyStreamer":"选择我的主播", + "PleaseSelectACountry":"请选择国家", + "PleaseSelectGender":"请选择性别", + "SelectThePKTime":"请选择PK时间", + "NumberOfGoldCoins":"金币数(单位为K)", + "Session":"场次", + "PleaseEnterTheRemarks":"请输入备注(选填)", + "Confirm":"确认", + "Reset":"重置", + "Cancel":"取消", + "SelectTheStreamersFromMyStreamerLibrary":"选择我的主播库主播", + "man":"男", + "woman":"女", + "ClickOnTheAvatarAboveToModifyIt":"点击头像上方修改头像", + "ClickToEnterAndModifyYourNickname":"点击输入修改昵称", + "ResendTheEmailTo":"向", + "ForVerification":"重发邮箱验证", + "ModifyTheEmailAddress":"修改邮箱", + "ChangePassword":"修改密码", + "PleaseEnterTheOldPassword":"请输入旧密码", + "PleaseEnterTheNewPassword":"请输入新密码", + "PleaseEnterTheConfirmPassword":"请再次输入新密码", + "PleaseEnterTheVerificationCodeOfYourOldEmailAddress":"请输入旧邮箱的验证码", + "PleaseEnterYourNewEmailAddress":"请输入新邮箱地址", + "Modify":"修改", + "PleaseEnterTheEmailVerificationCode":"请输入邮箱验证码", + "GetTheVerificationCode":"获取验证码", + "Resend":"重发", + "PleaseEnterAValidEmailAddress":"请输入有效的邮箱地址", + "TheModificationIsSuccessfulPleaseVerifyYourEmailInTheNewEmailAddress":"修改成功,请至新邮箱中验证邮箱", + "YouAreTemporarilyUnableToModifyYourEmailAddressPleaseVerifyYourEmailFirstIfItHasBeenVerifiedPleaseRefreshThePage":"你暂时无法修改邮箱,请先验证邮箱,如果已经验证,请刷新页面", + "YouAreTemporarilyUnableToChangeYourPasswordPleaseVerifyYourEmailFirstIfYouHaveAlreadyVerifiedItPleaseRefreshThePage":"你暂时无法修改密码,请先验证邮箱,如果已经验证,请刷新页面", + "ThePasswordMustContainBothUpperAndLowerCaseLettersAndNumbersAndBe6To16CharactersLong":"密码必须包含大小写字母和数字,长度为6-16位", + "TheTwoPasswordEntriesAreInconsistent":"两次输入的密码不一致", + "ModificationSuccessful":"修改成功", + "PleaseUploadImagesInjpgPngFormat":"请上传 jpg/png 格式的图片", + "TheSizeOfThePictureCannotExceed2M":"图片大小不能超过 2M", + "CheckTheStreamerAt":"查询主播中...", + "QuerySuccessful":"查询成功", + "ThePKTimeCannotBeEarlierThanTheCurrentTime":"PK 时间不能早于当前时间", + "PleaseEnterTheNumberOfGoldCoins":"请输入金币数", + "PleaseEnterTheSession":"请输入场次", + "PublishedSuccessfully":"发布成功", + "PleaseSelectTheHost":"请选择主播", + "TheEmailAddressHasBeenCopiedToTheClipboard":"邮箱地址已复制到剪切板", + "CopyFailed":"复制失败", + "LogoutSuccessful":"退出登录成功", + "CheckInSuccessful":"签到成功", + "YourEmailHasNotBeenVerifiedPleaseGoToTheSettingsToVerifyYourEmailIfItHasBeenVerifiedPleaseRefreshThePage":"邮箱未验证,请至设置验证邮箱,如果已经验证请刷新页面", + "NewNewsHasArrived":"新消息到来", + "YouHave": "你有", + "unreadMessages":"封未读消息", + "AccountInformation":"账号信息", + "EmailVerification":"邮箱验证", + "RetrieveThePassword":"找回密码", + "PleaseEnterTheEmailAddressForWhichYouNeedToRetrieveYourPassword":"请输入需要找回密码的邮箱地址", + "Return":"返回", + "NextStep":"下一步", + "AVerificationEmailHasBeenSentToYour":"已向您的", + "emailAddressPleaseClickOnTheLinkInTheEmailToCompleteTheRetrieval":"邮箱发送了一封验证邮件,请点击邮件中的链接完成找回密码。", + "emailAddressPleaseClickOnTheLinkInTheEmailToCompleteTheRegistration":"邮箱发送了一封验证邮件,请点击邮件中的链接完成注册。", + "PreviousStep":"上一步", + "ResendIn":"", + "seconds":"秒后重发", + "ResendTheEmail":"重发邮件", + "ReturnToLogin":"返回登录", + "TheEmailWasSentSuccessfully":"邮件发送成功", + "TheEmailFailedToSend":"邮件发送失败", + "PleaseEnterYourEmailAddress":"请输入邮箱地址", + "PleaseEnterYourUsername":"请输入用户名", + "PleaseEnterThePasswordAgain":"请再次输入密码", + "TheLengthOfAUsernameCannotBeLessThan2CannotExceed16AndCannotBeEmpty":"用户名长度不能小于2,不能大于16,不能为空", + "TheUsernameAlreadyExists":"用户名已存在", + "TheUsernameIsAvailable":"用户名可用", + "TheEmailHasBeenResold":"邮件已重新发送", + "ActivationInProgressPleaseWaitAMoment":"激活中,请稍候", + "ActivationSuccessfulPleaseLogIn":"激活成功,请登录", + "ActivationFailed":"激活失败", + "YourEmailAddressIs":"您的邮箱", + "ItHasNotBeenActivatedYetPleaseClickTheActivationLinkInYourEmailToActivateYourAccount":",尚未激活,请在您的邮箱中点击激活链接激活您的账", + "ResendTheActivationEmail":"重新发送激活邮件", + "TheActivationEmailHasBeenSentPleaseCheckItInTime":"激活邮件已发送,请注意查收", + "TheActivationEmailSendingFailedPleaseTryAgainLater":"激活邮件发送失败,请稍后再试", + "ResetThePassword":"重置密码", + "PasswordResetSuccessful":"密码重置成功", + "VerificationInProgressPleaseWaitAMoment":"验证中,请稍候", + "VerificationSuccessfulPleaseLogIn":"验证成功,请登录", + "VerificationFailed":"验证失败", + "PKHall":"PK大厅", + "TodayPK":"今日PK", + "MinimumNumberOfGoldCoins":"最小金币数(单位为K)", + "MaximumNumberOfGoldCoins":"最大金币数(单位为K)", + "MinimumPKTime":"最小PK时间", + "MaximumPKTime":"最大PK时间", + "to":"至", + "Country":"国家", + "Gender":"性别", + "PKTime":"PK时间(本地时间):", + "GoldCoin":"金币:", + "session":"场次:", + "match":"场", + "Send":"发送", + "SelectTheHostOnTheRightToChatImmediately":"右方选择主播立即聊天", + "PKInvitation":"PK邀请", + "ChooseTheOpponentPKStreamer":"选择对方的PK主播", + "ChooseYourOwnPKStreamer": "选择自己的PK主播", + "Hint":"提示", + "AreYouSureYouWantToSendAPKInvitationMessageAfterASuccessfulInvitationThePkCannotBeModifiedOrDeletedPleasePaution":" 您确定要发送PK邀请消息吗?邀请成功后的pk不可修改,不可删除,请谨慎操作!", + "PleaseSelectTheStreamerWhoWillParticipateInThePK":"请选择对方参与PK的主播", + "PleaseSelectOurStreamerToParticipateInThePK":"请选择我方参与PK的主播", + "PleaseSelectTheOtherPartyAndYourOwnStreamer":"请选择对方和自己的主播", + "PleaseEnterTheMaximumNumberOfGoldCoins":"请输入最大金币数", + "PleaseEnterTheMinimumNumberOfGoldCoins":"请输入最小金币数", + "TheStartTimeCannotBeLessThanTheCurrentTime":"开始时间不能早于当前时间", + "AnchorLibrary":"主播库", + "PKInformation":"PK信息", + "MyPKRecord":"我的PK记录", + "PointsList":"积分列表", + "MyPoints":"我的积分:", + "YouDonHaveAnyPointsRecordsYet":"您还没有积分记录!", + "ActualNumberOfGoldCoins":"实际金币数:", + "YouDonHaveAPKRecordYet":"您还没有PK记录!", + "InTotal":"总共:", + "The":"第", + "THInning":"回", + "SelectRecordOnTheRightToViewDetailsImmediately":"选择右侧的记录,可立即查看详细信息", + "ThePKIPosted":"发布的PK", + "ThePKIInvited":"邀请的PK", + "YoudonHaveAnyPKInformationYetHurryUpAndAddIt":"您还没有PK信息,快去添加吧!", + "ConfirmTheDeletionOfThisStreamerPKInformation":"确认删除该主播的PK信息?", + "TopPosition":"置顶", + "TopPromptOnTheHomepage":"置顶后,该用户将在首页置顶,并在指定时长内享有置顶特权。置顶时长不足1小时,系统将按1小时计算积分扣除。请选择置顶时长:", + "PleaseSelectThePinnedDuration":"请选择置顶时长", + "UnpinTheTopPrompt":" 您确定要取消置顶吗?取消置顶后,该用户将不再享有置顶特权,但仍可继续参与PK挑战。若置顶时长不足1小时,系统将按1小时计算积分扣除。取消后按实际使用时长比例返还剩余积分,是否确认执行此操作?", + "Unpinned":"取消置顶", + "hour":"小时", + "Expired":"已过期", + "TopPlacementSuccessful":"置顶成功", + "DeletedSuccessfully":"删除成功", + "YouDonHaveALiveStreamerYetHurryUpAndAddOne":"您还没有主播,快去添加吧!", + "AddMyStreamer":"添加我的主播", + "ModifyMyStreamer":"修改我的主播", + "ConfirmTheDeletionOfThisStreamer":"确认删除该主播?", + "AddedSuccessfully":"添加成功" +} \ No newline at end of file diff --git a/src/i18n/zh/login.json b/src/i18n/zh/login.json deleted file mode 100644 index 3f79230..0000000 --- a/src/i18n/zh/login.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "login": "登录", - "Welcome_to_login": "欢迎登录", - "PleaseEnterEmailOrUsername": "请输入邮箱或用户名", - "PleaseEnterPassword": "请输入密码", - "WechatMiniProgramLogin": "微信小程序登录", - "LogInByScanningTheQRCodeWithTheWechatMini-program": "使用微信小程序扫描二维码登录", - "DontHaveAnAccountYet":"还没有账号?", - "Register": "注册", - "AlreadyHaveAnAccount": "已有账号?", - "ForgotPassword": "忘记密码?" -} \ No newline at end of file diff --git a/src/views/ActivateEmail.vue b/src/views/ActivateEmail.vue index e7af6b3..9632ff9 100644 --- a/src/views/ActivateEmail.vue +++ b/src/views/ActivateEmail.vue @@ -1,10 +1,12 @@ @@ -16,11 +18,19 @@ import { onMounted, // 组件挂载完成后执行 onUpdated, // 组件更新后执行 onUnmounted, // 组件销毁前执行 + onBeforeMount, // 组件挂载前执行 } from "vue"; import {getPromiseStorage} from '@/utils/storage.js'; import {resendEmail} from "@/api/account"; import { useRouter } from 'vue-router'; import { ElMessage } from "element-plus"; +import { setLocale } from "@/i18n"; +// +import { useI18n } from "vue-i18n"; +const { t } = useI18n(); +const language = ref(null); // 语言 +window["$t"] = t; +// const router = useRouter(); const refname = ref(''); @@ -29,14 +39,27 @@ function sendActivateEmail() { mailAddress:user.value.email, type:1 }).then(res => { - ElMessage.success('激活邮件已发送,请注意查收。'); + ElMessage.success(t('TheActivationEmailHasBeenSentPleaseCheckItInTime')); + // gj激活邮件已发送,请注意查收 router.push('/'); }).catch(err => { - ElMessage.error('激活邮件发送失败,请稍后再试。'); + ElMessage.error(t('TheActivationEmailSendingFailedPleaseTryAgainLater')); + // gj激活邮件发送失败,请稍后再试 }) } - +onBeforeMount(() => { + // 语言 + getPromiseStorage("language") + .then((res) => { + console.log("获取语言成功", res); + language.value = res; + setLocale(language.value); + }) + .catch((err) => { + console.log("获取语言失败", err); + }); +}); watch(refname, async (newQuestion, oldQuestion) => { // 变化后执行 diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 5a9b8ee..dd1bba1 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -111,12 +111,13 @@ function EmailLogin() { // 密码验证 const passwordRegex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{6,16}$/; if (!passwordRegex.test(refpassword.value)) { - ElMessage.error("密码必须包含大小写字母和数字,长度6-16位"); + ElMessage.error(t('ThePasswordMustContainBothUpperAndLowerCaseLettersAndNumbersAndBe6To16CharactersLong')); + // gj密码必须包含大小写字母和数字,长度为6-16位 return; } const loading = ElLoading.service({ lock: true, - text: "登录中.....", + text:t('Login'), background: "rgba(0, 0, 0, 0.7)", }); @@ -143,7 +144,7 @@ function EmailLogin() { loading.close(); router.push("/nav"); }).catch((err) => { - ElMessage.error("登录失败:"+err.content); + ElMessage.error(t('LoginFailed')+err.content); loading.close(); }); }).catch((err) => { @@ -160,7 +161,6 @@ function fuSWitch() { if (refSwitch.value) { vxloginstatus = setInterval(checkLogin, 2000); } else { - console.log("邮箱登录"); clearInterval(vxloginstatus); } } diff --git a/src/views/activationSuccessful.vue b/src/views/activationSuccessful.vue index becf91d..1135635 100644 --- a/src/views/activationSuccessful.vue +++ b/src/views/activationSuccessful.vue @@ -2,33 +2,43 @@