优化代码

This commit is contained in:
pengxiaolong
2025-08-27 22:06:45 +08:00
parent 50f3126fc1
commit d294f62469
26 changed files with 1172 additions and 507 deletions

View File

@@ -1,5 +1,5 @@
# tk-page
备注前面带gj的是国家化文本
## Project setup
```
npm install

View File

@@ -248,23 +248,27 @@
class="password-input"
show-password
/>
<!-- gj请确认新密码 -->
<div class="password-btn" @click="changePassword()">{{ t('Confirm') }}</div>
<!-- gj确认 -->
</div>
</el-dialog>
<!-- 修改邮箱弹窗 -->
<el-dialog v-model="emailVisible" center title="修改邮箱" width="600" align-center>
<el-dialog v-model="emailVisible" center :title="t('ModifyTheEmailAddress')" width="600" align-center>
<!-- gj修改邮箱 -->
<div class="password-content">
<div class="email-content">
<div class="emailNumber">
{{ info.email }}
</div>
<div class="email-input">
<el-input type="text" size="large" class="input-item" v-model="Email" placeholder="请输入旧邮箱验证码" />
<el-input type="text" size="large" class="input-item" v-model="Email" :placeholder="t('PleaseEnterTheVerificationCodeOfYourOldEmailAddress')" />
<!-- gj请输入旧邮箱验证码 -->
<div class="email-Verification-btn" @click="sendEmail()">
<div class="email-Verification-btn-text" v-if="isSendEmail == 0">
获取验证码
{{ t('GetTheVerificationCode') }}
<!-- gj获取验证码 -->
</div>
<div id="timer" class="email-Verification-btn-text" v-else-if="isSendEmail == 1">
@@ -273,16 +277,19 @@
</div>
<div class="email-Verification-btn-text" v-else-if="isSendEmail == 2">
重新发送
{{ t('Resend') }}
<!-- gj重新发送 -->
</div>
</div>
</div>
<div class="newEmail">
<el-input type="text" size="large" class="newEmail-item" v-model="newEmail" placeholder="请输入新邮箱" />
<el-input type="text" size="large" class="newEmail-item" v-model="newEmail" :placeholder="t('PleaseEnterYourNewEmailAddress')" />
<!-- gj请输入新邮箱 -->
</div>
<div class="email-btn" @click="changeEmail()">
修改
{{ t('Modify') }}
<!-- gj修改 -->
</div>
</div>
<!-- -->
@@ -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) => {});
}

View File

@@ -29,7 +29,8 @@
background: item.gender == 1 ? '#59D8DB' : '#F3876F',
}"
>
{{ item.gender == 1 ? "男" : "女" }}
{{ item.gender == 1 ?t('man') : t('woman') }}
<!-- gj男女 -->
</div>
<div class="Country">{{ item.country }}</div>
</div>
@@ -48,7 +49,8 @@
</div>
</div>
<div class="chatNotDeta" v-if="list.length === 0">
<div class="chatNotDeta-text">您还没有主播快去添加吧</div>
<div class="chatNotDeta-text">{{ t('YouDonHaveALiveStreamerYetHurryUpAndAddOne') }}</div>
<!-- gj您还没有主播快去添加吧 -->
</div>
</div>
</el-splitter-panel>
@@ -58,8 +60,10 @@
<div class="add-anchor-library">
<div class="title">
<img class="titleimg" src="@/assets/embellish.png" alt="" />
<div v-if="!anchormodifystate">添加我的主播</div>
<div v-if="anchormodifystate">修改我的主播</div>
<div v-if="!anchormodifystate">{{ t('AddMyStreamer') }}</div>
<!-- gj添加主播 -->
<div v-if="anchormodifystate">{{ t('ModifyMyStreamer') }}</div>
<!-- gj修改主播 -->
<img class="titleimg" src="@/assets/embellish.png" alt="" />
</div>
<div class="add-anchor-library-content">
@@ -69,7 +73,7 @@
@blur="blur()"
v-model="anchorName"
size="large"
placeholder="请输入主播名称"
:placeholder="t('PleaseEnterTheNameOfTheHost')"
/>
</div>
<div class="country">
@@ -78,12 +82,13 @@
v-model="countryvalue"
filterable
:options="country"
placeholder="请选择国家"
:placeholder="t('PleaseSelectACountry')"
size="large"
style="vertical-align: middle"
class="select"
/>
</div>
<!-- gj选择国家 -->
<div class="gender">
<!-- 性别 -->
<el-select-v2
@@ -91,14 +96,15 @@
filterable
:options="genderOptions"
size="large"
placeholder="请选择性别"
:placeholder="t('PleaseSelectACountry')"
style="vertical-align: middle"
class="select"
/>
<!-- gj男女 -->
</div>
<div class="Confirm" @click="Confirm()">确认</div>
<div class="Reset" @click="Reset()">重置</div>
<div class="Reset" v-if="anchormodifystate" @click="cancel()">取消</div>
<div class="Confirm" @click="Confirm()">{{ t('Confirm') }}</div>
<div class="Reset" @click="Reset()">{{ t('Reset') }}</div>
<div class="Reset" v-if="anchormodifystate" @click="cancel()">{{ t('Cancel') }}</div>
</div>
</div>
</div>
@@ -110,15 +116,19 @@
center
class="center-dialog"
v-model="centerDialogVisible"
title="提示"
:title="t('Hint')"
width="200"
align-center
>
<span>确认删除该主播</span>
<!-- gj提示 -->
<span>{{ t('ConfirmTheDeletionOfThisStreamer') }}</span>
<!-- gj确认删除此主播 -->
<template #footer>
<div class="dialog-footer">
<el-button @click="centerDialogVisible = false">取消</el-button>
<el-button type="primary" @click="deleteAnchor()"> 确认 </el-button>
<el-button @click="centerDialogVisible = false">{{ t('Cancel') }}</el-button>
<!-- gj取消 -->
<el-button type="primary" @click="deleteAnchor()"> {{ t('Confirm') }}</el-button>
<!-- gj确认 -->
</div>
</template>
</el-dialog>
@@ -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 })

View File

@@ -46,7 +46,8 @@
<div class="content-left">
<div class="name">{{ item.anchorIdA }}</div>
<div class="time">
PK时间{{ TimestamptolocalTime(item.pkTime * 1000) }}
{{t('PKTime')+TimestamptolocalTime(item.pkTime * 1000) }}
<!-- gjPK时间 -->
</div>
<div class="gold" v-if="item.userACoins != null">
<img
@@ -54,7 +55,8 @@
src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/gold.png"
alt=""
/>
实际金币数
{{ t('ActualNumberOfGoldCoins') }}
<!-- gj实际金币数 -->
<div class="gold-num">
{{ goldCoinCalculation(item.userACoins) }}
</div>
@@ -72,7 +74,7 @@
<div class="content-right">
<div class="name">{{ item.anchorIdB }}</div>
<div class="time">
PK时间{{ TimestamptolocalTime(item.pkTime * 1000) }}
{{t('PKTime')+TimestamptolocalTime(item.pkTime * 1000) }}
</div>
<div class="gold" v-if="item.userBCoins != null">
<img
@@ -80,7 +82,8 @@
src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/gold.png"
alt=""
/>
实际金币数
{{ t('ActualNumberOfGoldCoins') }}
<!-- gj实际金币数 -->
<div class="gold-num">
{{ goldCoinCalculation(item.userBCoins) }}
</div>
@@ -94,7 +97,8 @@
</div>
</div>
<div class="chatNotDeta"v-if="list.length === 0">
<div class="chatNotDeta-text">您还没有PK记录</div>
<div class="chatNotDeta-text">{{ t('YouDonHaveAPKRecordYet') }}</div>
<!-- gj您还没有PK记录 -->
</div>
</div>
</el-splitter-panel>
@@ -117,7 +121,8 @@
<div class="altogether">
<div class="altogethercard">
<div class="altogether-num">
总共{{ goldCoinCalculation(selectedData.userACoins) }}
{{t('InTotal')+goldCoinCalculation(selectedData.userACoins) }}
<!-- gj总计 -->
</div>
<img
class="altogether-icon"
@@ -125,7 +130,8 @@
alt=""
/>
<div class="altogether-num">
总共{{ goldCoinCalculation(selectedData.userBCoins) }}
{{t('InTotal')+goldCoinCalculation(selectedData.userBCoins) }}
<!-- gj总计 -->
</div>
</div>
</div>
@@ -139,7 +145,8 @@
background: item.anchorCoinA > item.anchorCoinB ? '#D1F6F7' : '#F9DFD9',
}"
>
{{ index + 1 }}:
{{t('The')+index + 1+t('THInning') }}:
<!-- gj第几局 -->
{{ goldCoinCalculation(item.anchorCoinA) }}
</div>
</div>
@@ -152,14 +159,15 @@
background: item.anchorCoinB > item.anchorCoinA ? '#D1F6F7' : '#F9DFD9',
}"
>
{{ index + 1 }}:
{{t('The')+index + 1+t('THInning') }}:
<!-- gj第几局 -->
{{ goldCoinCalculation(item.anchorCoinB) }}
</div>
</div>
</div>
</div>
<div class="notdata" v-if="selectedData == null">
<div class="chatNotDeta-text">右方选择记录立即查看详情</div>
<div class="chatNotDeta-text">{{ t('SelectRecordOnTheRightToViewDetailsImmediately') }}</div>
</div>
</el-splitter-panel>
</el-splitter>
@@ -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;

View File

@@ -28,7 +28,8 @@
background: item.sex == 1 ? '#59D8DB' : '#F3876F',
}"
>
{{ item.sex == 1 ? "男" : "女" }}
{{ item.sex == 1 ? t('Male') : t('Female') }}
<!-- gj性别 -->
</div>
<div class="Country">{{ item.country }}</div>
<div class="goldbox">
@@ -38,7 +39,8 @@
alt=""
/>
<div class="gold">
金币
{{ t('GoldCoin') }}
<!-- gj金币 -->
<div class="gold-num">{{ item.coin }}K</div>
</div>
</div>
@@ -49,13 +51,14 @@
alt=""
/>
<div class="gold">
场次
<div class="gold-num">{{ item.pkNumber }}</div>
{{ t('session') }}
<!-- gj场次 -->
<div class="gold-num">{{ item.pkNumber+t('match') }}</div>
</div>
</div>
</div>
<div class="time">
PK时间:{{ TimestamptolocalTime(item.pkTime * 1000) }}
{{t('PKTime')+TimestamptolocalTime(item.pkTime * 1000) }}
</div>
</div>
<div class="card-Operation">
@@ -87,7 +90,8 @@
</div>
</div>
<div class="chatNotDeta" v-if="list.length === 0">
<div class="chatNotDeta-text">您还没有PK信息快去添加吧</div>
<div class="chatNotDeta-text">{{ t('YoudonHaveAnyPKInformationYetHurryUpAndAddIt') }}</div>
<!-- gj没有PK信息 -->
</div>
</div>
</el-splitter-panel>
@@ -99,7 +103,7 @@
<img class="titleimg" src="@/assets/embellish.png" alt="" />
<!-- gj发布新PK -->
<div v-if="!modifyDialogstate">{{ t('ReleaseANewPK') }}</div>
<div v-if="modifyDialogstate">修改PK信息</div>
<div v-if="modifyDialogstate">{{ t('ModifyThePKInformation') }}</div>
<img class="titleimg" src="@/assets/embellish.png" alt="" />
</div>
<div class="add-anchor-library-content">
@@ -184,7 +188,7 @@
<!-- gj确认 -->
<div class="Reset" @click="Reset()">{{ t('Reset') }}</div>
<!-- gj重置 -->
<div class="Reset" v-if="modifyDialogstate" @click="cancel()">取消</div>
<div class="Reset" v-if="modifyDialogstate" @click="cancel()">{{ t('Cancel') }}</div>
</div>
</div>
</div>
@@ -197,19 +201,21 @@
class="center-dialog"
v-model="centerDialogVisible"
title="提示"
width="200"
width="300"
align-center
>
<span>确认删除该条主播PK信息</span>
<span>{{ t('ConfirmTheDeletionOfThisStreamerPKInformation') }}</span>
<!-- gj确认删除该主播的PK信息 -->
<template #footer>
<div class="dialog-footer">
<el-button @click="centerDialogVisible = false">取消</el-button>
<el-button type="primary" @click="deleteAnchor()"> 确认 </el-button>
<el-button @click="centerDialogVisible = false">{{ t('Cancel') }}</el-button>
<el-button type="primary" @click="deleteAnchor()"> {{ t('Confirm') }} </el-button>
</div>
</template>
</el-dialog>
<!-- 选择我的主播弹窗 -->
<el-dialog align-center center v-model="myAnchorDialogVisible" title="选择我的主播库主播" width="800">
<el-dialog align-center center v-model="myAnchorDialogVisible" :title="t('SelectTheStreamersFromMyStreamerLibrary')" width="800">
<!-- gj选择我的主播 -->
<div class="myanchor-content">
<div class="myanchor-list">
<div
@@ -235,7 +241,8 @@
background: item.gender == 1 ? '#59D8DB' : '#F3876F',
}"
>
{{ item.gender == 1 ? "男" : "女" }}
{{ item.gender == 1 ? t('man') : t('woman') }}
<!-- gj性别 -->
</div>
<div class="Country">{{ item.country }}</div>
</div>
@@ -244,44 +251,51 @@
</div>
</div>
<div class="myanchor-dialog-btn">
<div class="Reset" @click="myAnchorDialogVisible = false">取消</div>
<div class="Confirm" @click="myAnchorDialogConfirm()">确认</div>
<div class="Reset" @click="myAnchorDialogVisible = false">{{ t('Cancel') }}</div>
<div class="Confirm" @click="myAnchorDialogConfirm()">{{ t('Confirm') }}</div>
</div>
</div>
</el-dialog>
<!-- 置顶弹窗 -->
<el-dialog align-center center v-model="topPositionstate" title="置顶" width="800">
<el-dialog align-center center v-model="topPositionstate" :title="t('TopPosition')" width="800">
<!-- gj置顶 -->
<div class="topPosition-content">
<div class="topPosition-content-title">
置顶后该用户将在首页置顶并在指定时长内享有置顶特权置顶时长
不足1小时系统将按1小时计算积分扣除请选择置顶时长
{{ t('TopPromptOnTheHomepage') }}
<!-- gj置顶提示 -->
</div>
<div class="topPosition-input">
<el-select-v2
v-model="topPositionvalue"
:options="topPositionOptions"
placeholder="请选择置顶时长"
:placeholder="t('PleaseSelectThePinnedDuration')"
style="width: 100%"
size="large"
filterable
/>
<!-- gj请选择置顶时长 -->
</div>
<div class="myanchor-dialog-btn">
<div class="Reset" @click="topPositionstate = false">取消</div>
<div class="Confirm" @click="topPositionstateConfirm()">确认</div>
<div class="Reset" @click="topPositionstate = false">{{ t('Cancel') }}</div>
<!-- gj取消 -->
<div class="Confirm" @click="topPositionstateConfirm()">{{ t('Confirm') }}</div>
<!-- gj确认置顶 -->
</div>
</div>
</el-dialog>
<!-- 取消置顶弹窗 -->
<el-dialog center v-model="cancelTopPositionstate" title="取消置顶" width="700" align-center>
<el-dialog center v-model="cancelTopPositionstate" :title="t('Unpinned')" width="700" align-center>
<!-- gj取消置顶 -->
<div class="cancelTopPosition">
<div class="cancelTopPosition-content">
您确定要取消置顶吗?取消置顶后该用户将不再享有置顶特权但仍可继续参与
PK挑战若置顶时长不足1小时系统将按1小时计算积分扣除取消后按实际使用时长比例返还剩余积分是否确认执行此操作?
{{ t('UnpinTheTopPrompt') }}
<!-- gj确认取消置顶 -->
</div>
<div class="myanchor-dialog-btn">
<div class="Reset" @click="cancelTopPositionstate = false">取消</div>
<div class="Confirm" @click="cancelTopPositionstateConfirm()">确认</div>
<div class="Reset" @click="cancelTopPositionstate = false">{{ t('Cancel') }}</div>
<!-- gj取消 -->
<div class="Confirm" @click="cancelTopPositionstateConfirm()">{{ t('Confirm') }}</div>
<!-- gj确认取消置顶 -->
</div>
</div>
</el-dialog>
@@ -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;
}
</style>

View File

@@ -4,7 +4,8 @@
<div class="points-list-title">
<img class="points-icon" src="@/assets/Points.png" mode="scaleToFill" />
<div class="points-text">
我的积分:{{ user.points }}
{{t('MyPoints')+user.points }}
<!-- gj我的积分 -->
<div class="points-alwaysnum"></div>
</div>
</div>
@@ -26,7 +27,8 @@
</div>
</div>
<div class="chatNotDeta" v-if="pointsList.length === 0">
<div class="chatNotDeta-text">您还没有积分记录</div>
<div class="chatNotDeta-text">{{ t('YouDonHaveAnyPointsRecordsYet') }}</div>
<!-- gj您还没有积分记录-->
</div>
</div>
</div>
@@ -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);

View File

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

3
src/i18n/en/country.json Normal file
View File

@@ -0,0 +1,3 @@
{
"Andorra": "Andorra"
}

View File

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

169
src/i18n/en/index.json Normal file
View File

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

View File

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

View File

@@ -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":"请再次输入新密码"
}

5
src/i18n/zh/country.json Normal file
View File

@@ -0,0 +1,5 @@
{
"Andorra":"安道尔"
}

View File

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

168
src/i18n/zh/index.json Normal file
View File

@@ -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":"添加成功"
}

View File

@@ -1,12 +0,0 @@
{
"login": "登录",
"Welcome_to_login": "欢迎登录",
"PleaseEnterEmailOrUsername": "请输入邮箱或用户名",
"PleaseEnterPassword": "请输入密码",
"WechatMiniProgramLogin": "微信小程序登录",
"LogInByScanningTheQRCodeWithTheWechatMini-program": "使用微信小程序扫描二维码登录",
"DontHaveAnAccountYet":"还没有账号?",
"Register": "注册",
"AlreadyHaveAnAccount": "已有账号?",
"ForgotPassword": "忘记密码?"
}

View File

@@ -1,10 +1,12 @@
<template>
<div class="activate-email">
<div class="activate-email-content">
您的邮箱{{ user.email }},尚未激活请在您的邮箱中点击激活链接激活您的账号
{{t('YourEmailAddressIs') + user.email + t('ItHasNotBeenActivatedYetPleaseClickTheActivationLinkInYourEmailToActivateYourAccount') }}
<!-- gj您的邮箱是{{user.email}}尚未激活请点击激活链接中的链接激活您的账户 -->
</div>
<div class="activate-email-btn" @click="sendActivateEmail">
重发激活邮件
{{ t('ResendTheActivationEmail') }}
<!-- gj重新发送激活邮件 -->
</div>
</div>
</template>
@@ -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) => {
// 变化后执行

View File

@@ -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);
}
}

View File

@@ -3,31 +3,41 @@
<!-- 完成注册 -->
<div class="form">
<div class="title">
{{Hinttext}}
{{ Hinttext }}
</div>
</div>
</div>
</template>
<script setup>
import { useRoute,useRouter } from "vue-router";
import { ref, watch, onMounted, onUpdated, onUnmounted } from "vue";
import { useRoute, useRouter } from "vue-router";
import { ref, watch, onMounted, onUpdated, onUnmounted, onBeforeMount } from "vue";
import { activeEmail } from "@/api/account";
import { setLocale } from "@/i18n";
//
import { useI18n } from "vue-i18n";
const { t } = useI18n();
const language = ref(null); // 语言
window["$t"] = t;
//
const route = useRoute();
const router = useRouter();
const token = ref("");
import { ElMessage } from "element-plus";
const Hinttext = ref("激活中,请稍候");
const Hinttext = ref(t('ActivationInProgressPleaseWaitAMoment'));
//gj激活中请稍候
//确认
function nextStep() {
activeEmail(
token.value,
).then(() => {
Hinttext.value = "激活成功,请登录";
activeEmail(token.value)
.then(() => {
Hinttext.value = t('ActivationSuccessfulPleaseLogIn');
//gj激活成功,请登录
setTimeout(() => {
router.push("/");
}, 3000);
}).catch(() => {
Hinttext.value = "激活失败";
})
.catch(() => {
Hinttext.value = t('ActivationFailed');
//gj激活失败
});
}
@@ -39,7 +49,18 @@ onMounted(() => {
onUpdated(() => {
// 组件更新后执行
});
onBeforeMount(() => {
// 语言
getPromiseStorage("language")
.then((res) => {
console.log("获取语言成功", res);
language.value = res;
setLocale(language.value);
})
.catch((err) => {
console.log("获取语言失败", err);
});
});
onUnmounted(() => {
// 组件销毁前执行
});

View File

@@ -7,43 +7,55 @@
finish-status="success"
simple
>
<el-step title="账号信息" />
<el-step title="邮箱验证" />
<el-step :title="t('AccountInformation')" />
<!-- gj账号信息 -->
<el-step :title="t('EmailVerification')" />
<!-- gj邮箱验证 -->
</el-steps>
</div>
<!-- 账号信息 -->
<div class="form" v-if="active === 0">
<div class="title">注册</div>
<div class="title">{{ t('Register') }}</div>
<!-- gj注册 -->
<div class="Email">
<el-input type="text" size="large" class="input-item" v-model="Email" placeholder="请输入邮箱" />
<el-input type="text" size="large" class="input-item" v-model="Email" :placeholder="t('PleaseEnterYourEmailAddress')" />
<!-- gj输入邮箱 -->
</div>
<div class="Email">
<el-input type="text" size="large" class="input-item" v-model="userName" placeholder="请输入用户名" @blur="userNameBlur"/>
<el-input type="text" size="large" class="input-item" v-model="userName" :placeholder="t('PleaseEnterYourUsername')" @blur="userNameBlur"/>
<!-- gj输入用户名 -->
</div>
<div class="Password">
<el-input type="Password" size="large" class="input-item" v-model="Password" show-password placeholder="请输入密码" />
<text class="password-tip">您的密码必须包含大小字母和数字长度在6-16位之间</text>
<el-input type="Password" size="large" class="input-item" v-model="Password" show-password :placeholder="t('PleaseEnterPassword')" />
<!-- gj输入密码 -->
<text class="password-tip">{{t('ThePasswordMustContainBothUpperAndLowerCaseLettersAndNumbersAndBe6To16CharactersLong')}}</text>
<!-- gj密码规则 -->
</div>
<div class="ConfirmPassword">
<el-input type="Password" size="large" class="input-item" v-model="ConfirmPassword" show-password placeholder="请再次输入密码" />
<el-input type="Password" size="large" class="input-item" v-model="ConfirmPassword" show-password :placeholder="t('PleaseEnterThePasswordAgain')" />
<!-- gj确认密码 -->
</div>
<div class="btn">
<div class="Return" @click="Return">返回</div>
<div class="nextStep" @click="nextStep" >下一步</div>
<div class="Return" @click="Return">{{ t('Return') }}</div>
<!-- gj返回 -->
<div class="nextStep" @click="nextStep" >{{ t('NextStep') }}</div>
<!-- gj下一步 -->
</div>
</div>
<!-- 完成注册 -->
<div class="form" v-if="active === 1">
<div class="title">邮箱验证</div>
<div class="title">{{ t('EmailVerification') }}</div>
<!-- gj邮箱验证 -->
<div class="Hint">
已向您的{{Email}}邮箱发送了一封验证邮件请点击邮件中的链接完成注册
{{t('AVerificationEmailHasBeenSentToYour')+ Email+ t('emailAddressPleaseClickOnTheLinkInTheEmailToCompleteTheRegistration')}}
</div>
<div
class="ResendEmail"
@click="ResendEmail"
:style="isCounting ? 'background-image: linear-gradient(0deg, #cccccc, #dddddd); cursor: not-allowed;' : ''"
>
{{ isCounting ? `${countdown}秒后重发` : '重发邮件' }}
{{ isCounting ? t('ResendIn')+`${countdown}`+t('seconds') : t('ResendTheEmail') }}
<!-- gjxxx秒后重发邮件/重发邮件 -->
</div>
</div>
</div>
@@ -59,9 +71,16 @@ import {
onMounted, // 组件挂载完成后执行
onUpdated, // 组件更新后执行
onUnmounted, // 组件销毁前执行
onBeforeMount, // 组件挂载前执行
} from "vue";
import { ElMessage } from "element-plus";
import { useRouter } from 'vue-router'
import { setLocale } from '@/i18n'
//
import { useI18n } from 'vue-i18n'
const { t } = useI18n()
window['$t'] = t
//
const router = useRouter()
const active = ref(0);// 当前步骤
const Email = ref("");// 邮箱
@@ -74,6 +93,7 @@ const userNamebtn = ref(false)
const countdown = ref(0); // 倒计时秒数
const isCounting = ref(false); // 是否正在倒计时
let timer = null; // 定时器
const language = ref(null); // 语言
// 倒计时
function startCountdown() {
countdown.value = 60;
@@ -91,16 +111,19 @@ function startCountdown() {
// 用户名失去焦点
function userNameBlur() {
if (userName.value.length < 6 || userName.value.length > 16 || userName.value == '' || userName.value == null) {
ElMessage.error('用户名长度不能小于2不能大于16,不能为空');
ElMessage.error(t('TheLengthOfAUsernameCannotBeLessThan2CannotExceed16AndCannotBeEmpty'));
// gj用户名长度不能小于2不能大于16,不能为空
return;
}
checkUsername({ userName: userName.value }).then(res => {
if (res==false) {
ElMessage.error('用户名已存在');
ElMessage.error(t('TheUsernameAlreadyExists'));
// gj用户名已存在
userNamebtn.value = false
return;
} else {
ElMessage.success('用户名可用');
ElMessage.success(t('TheUsernameIsAvailable'));
// gj用户名可用
userNamebtn.value = true
}
}).catch((err) => {});
@@ -109,40 +132,46 @@ function userNameBlur() {
function nextStep() {
//用户名验证
if (userNamebtn.value == false) {
ElMessage.error('用户名已存在');
ElMessage.error(t('TheUsernameAlreadyExists'));
// gj用户名已存在
return;
}
// 邮箱验证
const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
if (!emailRegex.test(Email.value)) {
ElMessage.error('请输入有效的邮箱地址');
ElMessage.error(t('PleaseEnterAValidEmailAddress'));
// gj邮箱格式不正确
return;
}
// 密码验证
const passwordRegex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{6,16}$/;
if (!passwordRegex.test(Password.value)) {
ElMessage.error('密码必须包含大小写字母和数字长度6-16位');
ElMessage.error(t('ThePasswordMustContainBothUpperAndLowerCaseLettersAndNumbersAndBe6To16CharactersLong'));
// gj密码规则
return;
}
//用户名验证
if (userName.value.length < 6 || userName.value.length > 16 || userName.value == '' || userName.value == null) {
ElMessage.error('用户名长度不能小于2不能大于16,不能为空');
ElMessage.error(t('TheLengthOfAUsernameCannotBeLessThan2CannotExceed16AndCannotBeEmpty'));
// gj用户名长度不能小于2不能大于16,不能为空
return;
}
// 确认密码验证
if (Password.value !== ConfirmPassword.value) {
ElMessage.error('两次输入的密码不一致');
ElMessage.error(t('TheTwoPasswordEntriesAreInconsistent'));
// gj两次密码不一致
return;
}
register({ userName: userName.value,password: Password.value, email: Email.value, nickName: '用户' + Math.floor(Math.random() * 1000000),headerIcon:'181754562968_.pic_hd.jpg'}).then(res => {
register({ userName: userName.value,password: Password.value, email: Email.value, nickName: 'User' + Math.floor(Math.random() * 1000000),headerIcon:'181754562968_.pic_hd.jpg'}).then(res => {
active.value = active.value + 1;
check(res.id);
token.setToken(res.token);
setStorage('token', res.token)
startCountdown();
userNamebtn.value = true;
}).catch(err => {});
}
@@ -164,10 +193,25 @@ function pollstop() {
clearInterval(poll)
}
onBeforeMount(() => {
// 语言
getPromiseStorage("language")
.then((res) => {
console.log("获取语言成功", res);
language.value = res;
setLocale(language.value);
})
.catch((err) => {
console.log("获取语言失败", err);
});
});
/// 重发邮件
function ResendEmail() {
resendEmail({mailAddress: Email.value,type:1}).then(res => {
ElMessage.success('邮件已重新发送');
ElMessage.success(t('TheEmailHasBeenResold'));
// gj邮件重发成功
startCountdown();
}).catch(err => {});
}

View File

@@ -7,44 +7,55 @@
finish-status="success"
simple
>
<el-step title="账号信息" />
<el-step title="邮箱验证" />
<el-step :title="t('AccountInformation')" />
<!-- gj账号信息 -->
<el-step :title="t('EmailVerification')" />
<!-- gj邮箱验证 -->
</el-steps>
</div>
<!-- 账号信息 -->
<div class="form" v-if="active === 0">
<div class="title">找回密码</div>
<div class="title">{{ t('RetrieveThePassword') }}</div>
<!-- gj找回密码 -->
<div class="Email">
<el-input
type="text"
size="large"
class="input-item"
v-model="Email"
placeholder="请输入需要找回密码的邮箱"
:placeholder="t('PleaseEnterTheEmailAddressForWhichYouNeedToRetrieveYourPassword')"
@keydown.enter.native="nextStep"
/>
<!-- gj请输入需要找回密码的邮箱地址 -->
</div>
<div class="btn">
<div class="Return" @click="Return">返回</div>
<div class="nextStep" @click="nextStep">下一步</div>
<div class="Return" @click="Return">{{ t('Return') }}</div>
<!-- gj返回 -->
<div class="nextStep" @click="nextStep">{{ t('NextStep') }}</div>
<!-- gj下一步 -->
</div>
</div>
<!-- 完成注册 -->
<div class="form" v-if="active === 1">
<div class="title">邮箱验证</div>
<div class="title">{{ t('EmailVerification') }}</div>
<!-- gj邮箱验证 -->
<div class="Hint">
已向您的{{ Email }}邮箱发送了一封验证邮件请点击邮件中的链接完成找回
{{t('AVerificationEmailHasBeenSentToYour')+ Email+ t('emailAddressPleaseClickOnTheLinkInTheEmailToCompleteTheRetrieval')}}
<!-- gj已向您发送验证邮件请点击邮件中的链接完成密码找回 -->
</div>
<div class="ResendEmailbtn">
<div class="Return" @click="previousStep">上一步</div>
<div class="Return" @click="previousStep">{{ t('PreviousStep') }}</div>
<!-- gj上一步 -->
<div
class="ResendEmail"
@click="nextStep(1)"
:style="isCounting ? 'background-image: linear-gradient(0deg, #cccccc, #dddddd); cursor: not-allowed;' : ''"
>
{{ isCounting ? `${countdown}秒后重发` : '重发邮件' }}
{{ isCounting ? t('ResendIn')+`${countdown}`+t('seconds') : t('ResendTheEmail') }}
<!-- gjxxx秒后重发邮件/重发邮件 -->
</div>
<div class="Return" @click="Return">返回登录</div>
<div class="Return" @click="Return">{{ t('ReturnToLogin') }}</div>
<!-- gj返回登录 -->
</div>
</div>
</div>
@@ -58,15 +69,23 @@ import {
onMounted, // 组件挂载完成后执行
onUpdated, // 组件更新后执行
onUnmounted, // 组件销毁前执行
onBeforeMount, // 组件挂载前执行
} from "vue";
import { ElMessage } from "element-plus";
import { useRouter } from "vue-router";
import { setLocale } from '@/i18n'
//
import { useI18n } from 'vue-i18n'
const { t } = useI18n()
window['$t'] = t
//
const router = useRouter();
const active = ref(0); // 当前步骤
const Email = ref(""); // 邮箱
const countdown = ref(0); // 倒计时秒数
const isCounting = ref(false); // 是否正在倒计时
let timer = null; // 定时器
const language = ref(null); // 语言
function startCountdown() {
countdown.value = 60;
@@ -87,7 +106,8 @@ function nextStep(type) {
// 邮箱验证
const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
if (!emailRegex.test(Email.value)) {
ElMessage.error("请输入有效的邮箱地址");
ElMessage.error(t('PleaseEnterAValidEmailAddress'));
// gj请输入正确的邮箱地址
return;
}
@@ -101,9 +121,11 @@ function nextStep(type) {
active.value = active.value + 1;
}
ElMessage.success("邮件发送成功");
ElMessage.success(t('TheEmailWasSentSuccessfully'));
// gj邮件发送成功
}).catch((err) => {
ElMessage.error("邮件发送失败");
ElMessage.error(t('TheEmailFailedToSend'));
// gj邮件发送失败
});
}
@@ -111,6 +133,18 @@ function previousStep() {
active.value = active.value - 1;
}
onBeforeMount(() => {
// 语言
getPromiseStorage("language")
.then((res) => {
console.log("获取语言成功", res);
language.value = res;
setLocale(language.value);
})
.catch((err) => {
console.log("获取语言失败", err);
});
});
//返回登录页
function Return() {

View File

@@ -163,7 +163,8 @@
</div>
<!-- 发送按钮 -->
<div class="chat-input-Send" @click="sendMsg">发送</div>
<div class="chat-input-Send" @click="sendMsg">{{ t('Send') }}</div>
<!-- gj发送 -->
</div>
</div>
<div class="input">
@@ -183,7 +184,8 @@
</div>
</div>
<el-dialog v-model="PKInvitationdialog" center title="PK邀请" width="800" align-center>
<el-dialog v-model="PKInvitationdialog" center :title="t('PKInvitation')" width="800" align-center>
<!-- gjPK邀请 -->
<div class="PKcontent">
<div class="infinite-list-item">
<div
@@ -211,7 +213,8 @@
background: hostOtherSide.sex == 1 ? '#59D8DB' : '#F3876F',
}"
>
{{ hostOtherSide.sex == 1 ? "男" : "女" }}
{{ hostOtherSide.sex == 1 ? t("man") : t("woman") }}
<!-- gj男女 -->
</div>
<div class="Information-Country">
{{ hostOtherSide.country }}
@@ -219,7 +222,8 @@
</div>
<!-- 时间 -->
<div class="time">
PK时间本地时间:{{ TimestamptolocalTime(hostOtherSide.pkTime * 1000) }}
{{t('PKTime')+TimestamptolocalTime(hostOtherSide.pkTime * 1000) }}
<!-- gjPK时间 -->
</div>
<!--PK信息 -->
<div class="Information-PK">
@@ -228,13 +232,15 @@
src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/gold.png"
alt=""
/>
<div class="gold">金币{{ hostOtherSide.coin }}K</div>
<div class="gold">{{ t('GoldCoin')+hostOtherSide.coin }}K</div>
<!-- gj金币 -->
<img
class="sessionimg"
src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/session.png"
alt=""
/>
<div class="Session">场次{{ hostOtherSide.pkNumber }}</div>
<div class="Session">{{t('session')+hostOtherSide.pkNumber+t('match') }}</div>
<!-- gj场次 -->
</div>
<!-- 备注信息 -->
<div class="Information-Remarks">
@@ -247,7 +253,8 @@
@click="otherParticipates = true"
v-if="hostOtherSide == null"
>
选择对方的PK主播
{{ t('ChooseTheOpponentPKStreamer') }}
<!-- gj选择对手PK主播 -->
</div>
</div>
<!-- -->
@@ -277,7 +284,8 @@
background: hostmySide.sex == 1 ? '#59D8DB' : '#F3876F',
}"
>
{{ hostmySide.sex == 1 ? "男" : "女" }}
{{ hostmySide.sex == 1 ? t("man") : t("woman") }}
<!-- gj男女 -->
</div>
<div class="Information-Country">
{{ hostmySide.country }}
@@ -285,7 +293,8 @@
</div>
<!-- 时间 -->
<div class="time">
PK时间本地时间:{{ TimestamptolocalTime(hostmySide.pkTime * 1000) }}
{{t('PKTime')+TimestamptolocalTime(hostmySide.pkTime * 1000) }}
<!-- gjPK时间 -->
</div>
<!--PK信息 -->
<div class="Information-PK">
@@ -294,13 +303,15 @@
src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/gold.png"
alt=""
/>
<div class="gold">金币{{ hostmySide.coin }}K</div>
<div class="gold">{{t('GoldCoin')+hostmySide.coin }}K</div>
<!-- gj金币 -->
<img
class="sessionimg"
src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/session.png"
alt=""
/>
<div class="Session">场次{{ hostmySide.pkNumber }}</div>
<div class="Session">{{t('session')+ hostmySide.pkNumber+t('match') }}</div>
<!-- gj场次 -->
</div>
<!-- 备注信息 -->
<div class="Information-Remarks">
@@ -309,13 +320,16 @@
</div>
</div>
<div class="nodata" @click="myParticipates = true" v-if="hostmySide == null">
选择自己的PK主播
{{ t('ChooseYourOwnPKStreamer') }}
<!-- gj选择我方PK主播 -->
</div>
</div>
<!-- -->
<div class="PKcontentbtn">
<div class="myAnchorDialogReset" @click="reset">取消</div>
<div class="myAnchorDialogConfirm" @click="PKInvitationdialogclick">确认</div>
<div class="myAnchorDialogReset" @click="reset">{{ t('Cancel') }}</div>
<!-- gj取消 -->
<div class="myAnchorDialogConfirm" @click="PKInvitationdialogclick">{{ t('Confirm') }}</div>
<!-- gj确认 -->
</div>
</div>
</el-dialog>
@@ -324,10 +338,11 @@
<el-dialog
v-model="otherParticipates"
center
title="选择对方参与PK的主播"
:title="t('PleaseSelectTheStreamerWhoWillParticipateInThePK')"
width="800"
align-center
>
<!-- gj选择对手PK主播弹窗 -->
<div class="myanchor-content">
<div class="myanchor-list">
<div class="infinite-list-item" v-for="(item, index) in getAnchorListdata">
@@ -360,7 +375,8 @@
background: item.sex == 1 ? '#59D8DB' : '#F3876F',
}"
>
{{ item.sex == 1 ? "男" : "女" }}
{{ item.sex == 1 ? t("man") : t("woman") }}
<!-- gj男女 -->
</div>
<div class="Information-Country">
{{ item.country }}
@@ -368,7 +384,8 @@
</div>
<!-- 时间 -->
<div class="time">
PK时间本地时间:{{ TimestamptolocalTime(item.pkTime * 1000) }}
{{t('PKTime')+TimestamptolocalTime(item.pkTime * 1000) }}
<!-- gjPK时间 -->
</div>
<!--PK信息 -->
<div class="Information-PK">
@@ -377,13 +394,15 @@
src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/gold.png"
alt=""
/>
<div class="gold">金币{{ item.coin }}K</div>
<div class="gold">{{t('GoldCoin')+item.coin }}K</div>
<!-- gj金币 -->
<img
class="sessionimg"
src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/session.png"
alt=""
/>
<div class="Session">场次{{ item.pkNumber }}</div>
<div class="Session">{{t('session')+ item.pkNumber+t('match') }}</div>
<!-- gj场次 -->
</div>
<!-- 备注信息 -->
<div class="Information-Remarks">
@@ -394,9 +413,11 @@
</div>
</div>
<div class="myanchor-dialog-btn">
<div class="myAnchorDialogReset" @click="otherParticipates = false">取消</div>
<div class="myAnchorDialogReset" @click="otherParticipates = false">{{ t('Cancel') }}</div>
<!-- gj取消 -->
<div class="myAnchorDialogConfirm" @click="otherParticipatesDialogConfirm()">
确认
{{ t('Confirm') }}
<!-- gj确认 -->
</div>
</div>
</div>
@@ -406,10 +427,11 @@
<el-dialog
v-model="myParticipates"
center
title="选择我方参与PK的主播"
:title="t('PleaseSelectOurStreamerToParticipateInThePK')"
width="800"
align-center
>
<!-- gj选择我方PK主播弹窗 -->
<div class="myanchor-content">
<div class="myanchor-list">
<div class="infinite-list-item" v-for="(item, index) in getMyAnchorListdata">
@@ -442,7 +464,8 @@
background: item.sex == 1 ? '#59D8DB' : '#F3876F',
}"
>
{{ item.sex == 1 ? "男" : "女" }}
{{ item.sex == 1 ? t('man') : t('woman') }}
<!-- gj男女 -->
</div>
<div class="Information-Country">
{{ item.country }}
@@ -450,7 +473,8 @@
</div>
<!-- 时间 -->
<div class="time">
PK时间本地时间:{{ TimestamptolocalTime(item.pkTime * 1000) }}
{{t('PKTime')+ TimestamptolocalTime(item.pkTime * 1000) }}
<!-- gjPK时间 -->
</div>
<!--PK信息 -->
<div class="Information-PK">
@@ -459,13 +483,15 @@
src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/gold.png"
alt=""
/>
<div class="gold">金币{{ item.coin }}K</div>
<div class="gold">{{t('GoldCoin')+item.coin }}K</div>
<!-- gj金币 -->
<img
class="sessionimg"
src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/session.png"
alt=""
/>
<div class="Session">场次{{ item.pkNumber }}</div>
<div class="Session">{{t('session')+ item.pkNumber+t('match') }}</div>
<!-- gj场次 -->
</div>
<!-- 备注信息 -->
<div class="Information-Remarks">
@@ -476,25 +502,31 @@
</div>
</div>
<div class="myanchor-dialog-btn">
<div class="myAnchorDialogReset" @click="myParticipates = false">取消</div>
<div class="myAnchorDialogReset" @click="myParticipates = false">{{ t('Cancel') }}</div>
<!-- gj取消 -->
<div class="myAnchorDialogConfirm" @click="myParticipatesDialogConfirm()">
确认
{{ t('Confirm') }}
<!-- gj确认 -->
</div>
</div>
</div>
</el-dialog>
<el-dialog v-model="reminder" center title="提示" width="400" align-center>
<el-dialog v-model="reminder" center :title="t('Hint')" width="400" align-center>
<!-- gj提示 -->
<div class="reminder-content">
<div class="reminder-text">
<div>
您确定要发送PK邀请消息吗邀请成功后的pk不可修改不可删除请谨慎操作
{{ t('AreYouSureYouWantToSendAPKInvitationMessageAfterASuccessfulInvitationThePkCannotBeModifiedOrDeletedPleasePaution') }}
<!-- gj确定是否发送PK邀请消息邀请成功后无法修改或删除PK请谨慎操作 -->
</div>
</div>
<div class="myanchor-dialog-btn">
<div class="remindermyAnchorDialogReset" @click="reminder = false">取消</div>
<div class="remindermyAnchorDialogReset" @click="reminder = false">{{ t('Cancel') }}</div>
<!-- gj取消 -->
<div class="remindermyAnchorDialogConfirm" @click="reminderDialogConfirm()">
确认
{{ t('Confirm') }}
<!-- gj确认 -->
</div>
</div>
</div>
@@ -530,7 +562,11 @@ import PKMessage from "@/components/chatMessage/PKMessage";
import { getAnchorListById, createPkRecord } from "@/api/account";
import { ElMessage } from "element-plus";
import voiceMessage from "@/components/chatMessage/voiceMessage";
//
import { useI18n } from "vue-i18n";
const { t } = useI18n();
window["$t"] = t;
//
var im = goeasy.im;
const counter = IMloginStore();
const textarea = ref(""); // 输入框内容
@@ -559,7 +595,8 @@ function otherParticipatesDialogConfirm() {
hostOtherSide.value = hostOtherSidenotSure.value;
otherParticipates.value = false;
} else {
ElMessage.error("请选择对方参与PK的主播");
ElMessage.error(t('PleaseSelectTheStreamerWhoWillParticipateInThePK'));
// gj请选择对手PK主播
}
}
//确认我方参与PK的主播
@@ -568,7 +605,8 @@ function myParticipatesDialogConfirm() {
hostmySide.value = hostmySidenotSure.value;
myParticipates.value = false;
} else {
ElMessage.error("请选择我方参与PK的主播");
ElMessage.error(t('PleaseSelectOurStreamerToParticipateInThePK'));
// gj请选择我方PK主播
}
}
@@ -649,7 +687,8 @@ function PKInvitationdialogclick() {
if (hostOtherSide.value && hostmySide.value) {
reminder.value = true;
} else {
ElMessage.error("请选择对方和自己的主播");
ElMessage.error(t('PleaseSelectTheOtherPartyAndYourOwnStreamer'));
// gj请选择对手和我方PK主播
return;
}
}
@@ -752,7 +791,6 @@ function handleClick(item) {
timestamp: null,
})
.then((res) => {
console.log("消息列表", res);
messageslist.value = res;
nextTick(() => {
if (chatlistContainer.value) {

View File

@@ -36,27 +36,34 @@ import PointsList from "@/components/mineSubComponent/PointsList";
import PKRecord from "@/components/mineSubComponent/PKRecord";
import PKmessage from "@/components/mineSubComponent/PKmessage";
import AnchorLibrary from "@/components/mineSubComponent/AnchorLibrary";
//
import { useI18n } from "vue-i18n";
const { t } = useI18n();
window["$t"] = t;
//
const options = [
{
label: '主播库',
label: t('AnchorLibrary'),
// gj主播库
value: 1,
icon: require("@/assets/AnchorLibrary.png"),
},
{
label: 'PK信息',
label: t('PKInformation'),
//gjpk信息
value: 2,
icon: require("@/assets/PKInformation.png"),
},
{
label: '我的PK记录',
label: t('MyPKRecord'),
// gj我的pk记录
value: 3,
icon: require("@/assets/PKRecord.png"),
},
{
label: '积分列表',
label:t('PointsList'),
value: 4,
icon: require("@/assets/PointsList.png"),
},

View File

@@ -16,11 +16,14 @@
@touchmove="handleTouchMove"
@touchend="handleTouchEnd"
>
<div class="today-text" @click="Switch">PK大厅</div>
<div class="today-text" @click="Switch">今日PK</div>
<div class="today-text" @click="Switch">{{ t("PKHall") }}</div>
<!-- gjPK大厅 -->
<div class="today-text" @click="Switch">{{ t("TodayPK") }}</div>
<!-- gj今日PK -->
<!-- 滑块 -->
<div class="slider">
{{ PKistodayorhall ? "PK大厅" : "今日PK" }}
{{ PKistodayorhall ? t("PKHall") : t("TodayPK") }}
<!-- gjPK大厅/gj今日PK -->
</div>
</div>
@@ -30,24 +33,29 @@
v-model="countryvalue"
filterable
:options="country"
placeholder="请选择国家"
:placeholder="t('Country')"
style="vertical-align: middle"
class="select"
/>
<!-- gj国家 -->
<!-- 性别 -->
<el-select-v2
v-model="gendervalue"
filterable
:options="genderOptions"
placeholder="请选择性别"
:placeholder="t('Gender')"
style="vertical-align: middle"
class="select"
/>
<!-- gj请选择性别 -->
</div>
<!-- 最大最小金币 -->
<div class="Goldcoinbox">
<div class="Goldcoinbox-left">
<div class="Goldcoinbox-text">最小金币数单位为K</div>
<div class="Goldcoinbox-text">
{{ t("MinimumNumberOfGoldCoins") }}
</div>
<!-- gj最小金币数 -->
<el-input-number
v-model="minnum"
controls-position="right"
@@ -56,7 +64,10 @@
</div>
<div class="Goldcoinbox-middle"></div>
<div class="Goldcoinbox-right">
<div class="Goldcoinbox-text">最大金币数单位为K</div>
<div class="Goldcoinbox-text">
{{ t("MaximumNumberOfGoldCoins") }}
</div>
<!-- gj最大金币数 -->
<el-input-number
v-model="maxnum"
controls-position="right"
@@ -69,12 +80,13 @@
<el-date-picker
v-model="timevalue"
type="datetimerange"
range-separator=""
start-placeholder="最小PK时间"
end-placeholder="最大PK时间"
:range-separator="t('to')"
:start-placeholder="t('MinimumPKTime')"
:end-placeholder="t('MaximumPKTime')"
format="YYYY/MM/DD hh:mm"
value-format="x"
/>
<!-- gj选择PK时间/最大PK时间/最小PK时间/ -->
</div>
<div
class="btnbox"
@@ -152,7 +164,8 @@
background: item.sex == 1 ? '#59D8DB' : '#F3876F',
}"
>
{{ item.sex == 1 ? "男" : "女" }}
{{ item.sex == 1 ? t("man") : t("woman") }}
<!-- gj男/ -->
</div>
<div class="Information-Country">
{{ item.country }}
@@ -160,9 +173,8 @@
</div>
<!-- 时间 -->
<div class="time">
PK时间本地时间:{{
TimestamptolocalTime(item.pkTime * 1000)
}}
{{ t("PKTime") + TimestamptolocalTime(item.pkTime * 1000) }}
<!-- gjPK时间 -->
</div>
<!--PK信息 -->
<div class="Information-PK">
@@ -171,13 +183,17 @@
src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/gold.png"
alt=""
/>
<div class="gold">金币{{ item.coin }}K</div>
<div class="gold">{{ t("GoldCoin") + item.coin }}K</div>
<!-- gj金币数 -->
<img
class="sessionimg"
src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/session.png"
alt=""
/>
<div class="Session">场次{{ item.pkNumber }}</div>
<div class="Session">
{{ t("session") + item.pkNumber + t("match") }}
</div>
<!-- gjPK场次 -->
</div>
<!-- 备注信息 -->
<div class="Information-Remarks">
@@ -191,7 +207,7 @@
</el-splitter-panel>
<el-splitter-panel collapsible size="27%" :resizable="false">
<!-- 聊天面板 -->
<div class="demo-panel" >
<div class="demo-panel">
<div class="chat" v-if="handleClickdata != null">
<div class="chat-name">{{ info.nickName }}</div>
<!-- 聊天列表 -->
@@ -237,7 +253,12 @@
v-if="item.type == 'pk'"
></miniPKMessage>
<!-- 语音消息 -->
<voiceMessage :item="item.payload.url" :size="item.payload.duration" :senderId="item.senderId" v-if="item.type == 'audio'">
<voiceMessage
:item="item.payload.url"
:size="item.payload.duration"
:senderId="item.senderId"
v-if="item.type == 'audio'"
>
</voiceMessage>
</div>
</div>
@@ -259,7 +280,12 @@
v-if="item.type == 'pk'"
></miniPKMessage>
<!-- 语音消息 -->
<voiceMessage :item="item.payload.url" :size="item.payload.duration" :senderId="item.senderId" v-if="item.type == 'audio'">
<voiceMessage
:item="item.payload.url"
:size="item.payload.duration"
:senderId="item.senderId"
v-if="item.type == 'audio'"
>
</voiceMessage>
</div>
<div class="Me-Triangle" v-if="item.type == 'text'">
@@ -300,7 +326,10 @@
</div>
</div>
<!-- 发送 -->
<div class="chat-input-Send" @click="sendMsg">发送</div>
<div class="chat-input-Send" @click="sendMsg">
{{ t("Send") }}
</div>
<!-- gj发送 -->
</div>
<!-- 输入框 -->
<div class="chat-input-Textarea">
@@ -324,7 +353,8 @@
</div>
<div class="chatNotDeta" v-if="handleClickdata == null">
<div class="chatNotDeta-text">
右方选择主播立即聊天
{{ t("SelectTheHostOnTheRightToChatImmediately") }}
<!-- gj选择对方PK主播开始聊天 -->
</div>
</div>
</div>
@@ -340,7 +370,13 @@
</div>
<!-- 弹窗 -->
<el-dialog v-model="PKInvitationdialog" center title="PK邀请" width="800" align-center>
<el-dialog
v-model="PKInvitationdialog"
center
:title="t('PKInvitation')"
width="800"
align-center
>
<div class="PKcontent">
<div class="pk-infinite-list-item">
<div
@@ -368,7 +404,8 @@
background: hostOtherSide.sex == 1 ? '#59D8DB' : '#F3876F',
}"
>
{{ hostOtherSide.sex == 1 ? "男" : "女" }}
{{ hostOtherSide.sex == 1 ? t("man") : t("woman") }}
<!-- gj男/ -->
</div>
<div class="pk-Information-Country">
{{ hostOtherSide.country }}
@@ -376,7 +413,8 @@
</div>
<!-- 时间 -->
<div class="pk-time">
PK时间本地时间:{{ TimestamptolocalTime(hostOtherSide.pkTime * 1000) }}
{{ t("PKTime") + TimestamptolocalTime(hostOtherSide.pkTime * 1000) }}
<!-- gjPK时间 -->
</div>
<!--PK信息 -->
<div class="pk-Information-PK">
@@ -385,13 +423,17 @@
src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/gold.png"
alt=""
/>
<div class="pk-gold">金币{{ hostOtherSide.coin }}K</div>
<div class="pk-gold">{{ t("GoldCoin") + hostOtherSide.coin }}K</div>
<!-- gj金币数 -->
<img
class="pk-sessionimg"
src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/session.png"
alt=""
/>
<div class="pk-Session">场次{{ hostOtherSide.pkNumber }}</div>
<div class="pk-Session">
{{ t("session") + hostOtherSide.pkNumber + t("match") }}
</div>
<!-- gjPK场次 -->
</div>
<!-- 备注信息 -->
<div class="pk-Information-Remarks">
@@ -404,7 +446,8 @@
@click="otherParticipates = true"
v-if="hostOtherSide == null"
>
选择对方的PK主播
{{ t("ChooseTheOpponentPKStreamer") }}
<!-- gj选择PK对手 -->
</div>
</div>
<!-- -->
@@ -434,7 +477,8 @@
background: hostmySide.sex == 1 ? '#59D8DB' : '#F3876F',
}"
>
{{ hostmySide.sex == 1 ? "男" : "女" }}
{{ hostmySide.sex == 1 ? t("man") : t("woman") }}
<!-- gj男/ -->
</div>
<div class="pk-Information-Country">
{{ hostmySide.country }}
@@ -442,7 +486,8 @@
</div>
<!-- 时间 -->
<div class="pk-time">
PK时间本地时间:{{ TimestamptolocalTime(hostmySide.pkTime * 1000) }}
{{ t("PKTime") + TimestamptolocalTime(hostmySide.pkTime * 1000) }}
<!-- gjPK时间 -->
</div>
<!--PK信息 -->
<div class="pk-Information-PK">
@@ -451,13 +496,17 @@
src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/gold.png"
alt=""
/>
<div class="pk-gold">金币{{ hostmySide.coin }}K</div>
<div class="pk-gold">{{ t("GoldCoin") + hostmySide.coin }}K</div>
<!-- gj金币数 -->
<img
class="pk-sessionimg"
src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/session.png"
alt=""
/>
<div class="pk-Session">场次{{ hostmySide.pkNumber }}</div>
<div class="pk-Session">
{{ t("session") + hostmySide.pkNumber + t("match") }}
</div>
<!-- gjPK场次 -->
</div>
<!-- 备注信息 -->
<div class="pk-Information-Remarks">
@@ -466,13 +515,18 @@
</div>
</div>
<div class="nodata" @click="myParticipates = true" v-if="hostmySide == null">
选择自己的PK主播
{{ t("ChooseYourOwnPKStreamer") }}
<!-- gj选择自己的PK主播 -->
</div>
</div>
<!-- -->
<div class="PKcontentbtn">
<div class="myAnchorDialogReset" @click="resets">取消</div>
<div class="myAnchorDialogConfirm" @click="PKInvitationdialogclick">确认</div>
<div class="myAnchorDialogReset" @click="resets">{{ t("Cancel") }}</div>
<!-- gj取消 -->
<div class="myAnchorDialogConfirm" @click="PKInvitationdialogclick">
{{ t("Confirm") }}
</div>
<!-- gj确认 -->
</div>
</div>
</el-dialog>
@@ -481,10 +535,11 @@
<el-dialog
v-model="otherParticipates"
center
title="选择对方参与PK的主播"
:title="t('ChooseTheOpponentPKStreamer')"
width="800"
align-center
>
<!-- gj选择对方主播 -->
<div class="myanchor-content">
<div class="myanchor-list">
<div class="pk-infinite-list-item" v-for="(item, index) in getAnchorListdata">
@@ -517,7 +572,8 @@
background: item.sex == 1 ? '#59D8DB' : '#F3876F',
}"
>
{{ item.sex == 1 ? "男" : "女" }}
{{ item.sex == 1 ? t("man") : t("woman") }}
<!-- gj男/ -->
</div>
<div class="pk-Information-Country">
{{ item.country }}
@@ -525,7 +581,8 @@
</div>
<!-- 时间 -->
<div class="pk-time">
PK时间本地时间:{{ TimestamptolocalTime(item.pkTime * 1000) }}
{{ t("PKTime") + TimestamptolocalTime(item.pkTime * 1000) }}
<!-- gjPK时间 -->
</div>
<!--PK信息 -->
<div class="pk-Information-PK">
@@ -534,13 +591,17 @@
src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/gold.png"
alt=""
/>
<div class="pk-gold">金币{{ item.coin }}K</div>
<div class="pk-gold">{{ t("GoldCoin") + item.coin }}K</div>
<!-- gj金币数 -->
<img
class="pk-sessionimg"
src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/session.png"
alt=""
/>
<div class="pk-Session">场次{{ item.pkNumber }}</div>
<div class="pk-Session">
{{ t("session") + item.pkNumber + t("match") }}
</div>
<!-- gjPK场次 -->
</div>
<!-- 备注信息 -->
<div class="pk-Information-Remarks">
@@ -551,9 +612,11 @@
</div>
</div>
<div class="myanchor-dialog-btn">
<div class="myAnchorDialogReset" @click="otherParticipates = false">取消</div>
<div class="myAnchorDialogReset" @click="otherParticipates = false">
{{ t("Cancel") }}
</div>
<div class="myAnchorDialogConfirm" @click="otherParticipatesDialogConfirm()">
确认
{{ t("Confirm") }}
</div>
</div>
</div>
@@ -563,10 +626,11 @@
<el-dialog
v-model="myParticipates"
center
title="选择我方参与PK的主播"
:title="t('ChooseYourOwnPKStreamer')"
width="800"
align-center
>
<!-- gj选择自己的主播 -->
<div class="myanchor-content">
<div class="myanchor-list">
<div class="pk-infinite-list-item" v-for="(item, index) in getMyAnchorListdata">
@@ -599,7 +663,8 @@
background: item.sex == 1 ? '#59D8DB' : '#F3876F',
}"
>
{{ item.sex == 1 ? "男" : "女" }}
{{ item.sex == 1 ? t("man") : t("woman") }}
<!-- gj男/ -->
</div>
<div class="pk-Information-Country">
{{ item.country }}
@@ -607,7 +672,8 @@
</div>
<!-- 时间 -->
<div class="pk-time">
PK时间本地时间:{{ TimestamptolocalTime(item.pkTime * 1000) }}
{{ t("PKTime") + TimestamptolocalTime(item.pkTime * 1000) }}
<!-- gjPK时间 -->
</div>
<!--PK信息 -->
<div class="pk-Information-PK">
@@ -616,13 +682,15 @@
src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/gold.png"
alt=""
/>
<div class="pk-gold">金币{{ item.coin }}K</div>
<div class="pk-gold">{{t('GoldCoin')+item.coin }}K</div>
<!-- gj金币数 -->
<img
class="pk-sessionimg"
src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/session.png"
alt=""
/>
<div class="pk-Session">场次{{ item.pkNumber }}</div>
<div class="pk-Session">{{t('session')+ item.pkNumber+t('match')}}</div>
<!-- gjPK场次 -->
</div>
<!-- 备注信息 -->
<div class="pk-Information-Remarks">
@@ -633,25 +701,30 @@
</div>
</div>
<div class="myanchor-dialog-btn">
<div class="myAnchorDialogReset" @click="myParticipates = false">取消</div>
<div class="myAnchorDialogReset" @click="myParticipates = false">{{ t("Cancel") }}</div>
<!-- gj取消 -->
<div class="myAnchorDialogConfirm" @click="myParticipatesDialogConfirm()">
确认
{{ t("Confirm") }}
<!-- gj确认 -->
</div>
</div>
</div>
</el-dialog>
<el-dialog v-model="reminder" center title="提示" width="400" align-center>
<el-dialog v-model="reminder" center :title="t('Hint')" width="400" align-center>
<div class="reminder-content">
<div class="reminder-text">
<div>
您确定要发送PK邀请消息吗邀请成功后的pk不可修改不可删除请谨慎操作
{{ t('AreYouSureYouWantToSendAPKInvitationMessageAfterASuccessfulInvitationThePkCannotBeModifiedOrDeletedPleasePaution') }}
<!-- gj您确定要发送PK邀请消息吗邀请成功后的pk不可修改不可删除请谨慎操作 -->
</div>
</div>
<div class="myanchor-dialog-btn">
<div class="remindermyAnchorDialogReset" @click="reminder = false">取消</div>
<div class="remindermyAnchorDialogReset" @click="reminder = false">{{ t("Cancel") }}</div>
<!-- gj取消 -->
<div class="remindermyAnchorDialogConfirm" @click="reminderDialogConfirm()">
确认
{{ t("Confirm") }}
</div>
</div>
</div>
@@ -689,6 +762,11 @@ import { getAnchorListById, createPkRecord } from "@/api/account";
import PictureMessage from "@/components/chatMessage/PictureMessage";
import miniPKMessage from "@/components/chatMessage/miniPKMessage";
import voiceMessage from "@/components/chatMessage/voiceMessage";
//
import { useI18n } from "vue-i18n";
const { t } = useI18n();
window["$t"] = t;
//
var im = goeasy.im;
const country = ref([]);
country.value = getCountryNamesArray(); //国家条目
@@ -711,8 +789,8 @@ const isLoading = ref(false); // 防止重复加载
const isPage = ref(false); // 是否在页面
const genderOptions = [
{ value: 1, label: "男" },
{ value: 2, label: "女" },
{ value: 1, label: t("man") },
{ value: 2, label: t("woman") },
]; // 性别选项
const handleClickdata = ref(null); // 点击列表数据
const messageslist = ref([]); // 聊天列表数据
@@ -734,7 +812,8 @@ function otherParticipatesDialogConfirm() {
hostOtherSide.value = hostOtherSidenotSure.value;
otherParticipates.value = false;
} else {
ElMessage.error("请选择对方参与PK的主播");
ElMessage.error(t('PleaseSelectTheStreamerWhoWillParticipateInThePK'));
// gj请选择对方参与PK的主播
}
}
//确认我方参与PK的主播
@@ -743,7 +822,8 @@ function myParticipatesDialogConfirm() {
hostmySide.value = hostmySidenotSure.value;
myParticipates.value = false;
} else {
ElMessage.error("请选择我方参与PK的主播");
ElMessage.error(t('PleaseSelectOurStreamerToParticipateInThePK'));
// gj请选择我们参与PK的主播
}
}
@@ -761,17 +841,21 @@ function selectMyAnchor(item) {
function getAnchorList() {
getAnchorListById({
userId: info.value.id,
}).then((res) => {
})
.then((res) => {
getAnchorListdata.value = res;
}).catch((err) => {});
})
.catch((err) => {});
}
//查询我方已发布的未被邀请的主播列表
function getMyAnchorList() {
getAnchorListById({
userId: user.value.id,
}).then((res) => {
})
.then((res) => {
getMyAnchorListdata.value = res;
}).catch((err) => {});
})
.catch((err) => {});
}
//确认邀请
@@ -789,7 +873,8 @@ function reminderDialogConfirm() {
anchorIconB: hostmySide.value.anchorIcon,
piIdA: hostOtherSide.value.id,
piIdB: hostmySide.value.id,
}).then((res) => {
})
.then((res) => {
const data = {
msgid: res.id,
pkIdA: hostOtherSide.value.id,
@@ -798,7 +883,8 @@ function reminderDialogConfirm() {
avatar: info.value.headerIconr,
nickname: info.value.nickName,
};
goEasySendPKMessage(data).then((res) => {
goEasySendPKMessage(data)
.then((res) => {
messageslist.value.push(res);
reminder.value = false;
resets();
@@ -807,15 +893,18 @@ function reminderDialogConfirm() {
chatlistContainer.value.scrollTop = chatlistContainer.value.scrollHeight;
}
});
}).catch((err) => {});
}).catch((err) => {});
})
.catch((err) => {});
})
.catch((err) => {});
}
// PK邀请弹窗
function PKInvitationdialogclick() {
if (hostOtherSide.value && hostmySide.value) {
reminder.value = true;
} else {
ElMessage.error("请选择对方和自己的主播");
ElMessage.error(t('PleaseSelectTheOtherPartyAndYourOwnStreamer'));
// gj请选择对方主播和我们自己的主播
return;
}
}
@@ -858,14 +947,16 @@ const handleFileSelect = (event) => {
id: String(info.value.id),
avatar: info.value.headerIcon,
nickname: info.value.nickName,
}).then((res) => {
})
.then((res) => {
messageslist.value.push(res);
nextTick(() => {
if (chatlistContainer.value) {
chatlistContainer.value.scrollTop = chatlistContainer.value.scrollHeight;
}
});
}).catch((err) => {});
})
.catch((err) => {});
}
};
@@ -879,7 +970,8 @@ function sendMsg() {
id: String(info.value.id),
avatar: info.value.headerIcon,
nickname: info.value.nickName,
}).then((res) => {
})
.then((res) => {
messageslist.value.push(res);
textarea.value = "";
nextTick(() => {
@@ -887,7 +979,8 @@ function sendMsg() {
chatlistContainer.value.scrollTop = chatlistContainer.value.scrollHeight;
}
});
}).catch((err) => {});
})
.catch((err) => {});
}
// 选中主播后获取聊天列表数据
function handleClick(time) {
@@ -897,12 +990,14 @@ function handleClick(time) {
messageRead();
getUserInfo({
id: handleClickdata.value.senderId,
}).then((res) => {
})
.then((res) => {
info.value = res;
goEasyGetMessages({
id: String(handleClickdata.value.senderId),
timestamp: null,
}).then((res) => {
})
.then((res) => {
messageslist.value = res;
nextTick(() => {
if (chatlistContainer.value) {
@@ -910,8 +1005,10 @@ function handleClick(time) {
}
});
chatlistContainer.value.addEventListener("scroll", scrollHandler);
}).catch((err) => {});
}).catch((err) => {});
})
.catch((err) => {});
})
.catch((err) => {});
}
// 加载更多消息
@@ -926,7 +1023,9 @@ function loadMore() {
function messageRead() {
goEasyMessageRead({
id: String(handleClickdata.value.senderId),
}).then((res) => {}).catch((err) => {});
})
.then((res) => {})
.catch((err) => {});
}
//私聊消息接收
@@ -998,11 +1097,11 @@ function scrollHandler() {
}
}
// 获取pk列表
function PkList(body,type) {
function PkList(body, type) {
console.log("body", body);
getPkList(body).then((res) => {
getPkList(body)
.then((res) => {
console.log("res", res);
if (type == "load" && res.length == []) {
page.value--;
@@ -1018,7 +1117,8 @@ function PkList(body,type) {
list.value = TodayList.value;
}
}
}).catch((err) => {});
})
.catch((err) => {});
}
// 加载更多
@@ -1056,16 +1156,19 @@ function load() {
end: maxnum.value,
};
} else if (minnum.value != null && maxnum.value == null) {
ElMessage.error("请输入最大金币数");
ElMessage.error(t('PleaseEnterTheMaximumNumberOfGoldCoins'));
// gj请输入最大金币数
return;
} else if (minnum.value == null && maxnum.value != null) {
ElMessage.error("请输入最小金币数");
ElMessage.error(t('PleaseEnterTheMinimumNumberOfGoldCoins'));
// gj请输入最小金币数
return;
}
if (timevalue.value != null) {
const currentTime = Date.now();
if (timevalue.value[0] < currentTime) {
ElMessage.error("开始时间不能小于当前时间");
ElMessage.error(t('TheStartTimeCannotBeLessThanTheCurrentTime'));
// gj开始时间不能小于当前时间
return;
}
body.condition.pkTime = {
@@ -1094,7 +1197,7 @@ function load() {
body.condition.type = 1;
}
}
PkList(body,"load");
PkList(body, "load");
}
}
@@ -1146,16 +1249,19 @@ function search(data) {
end: maxnum.value,
};
} else if (minnum.value != null && maxnum.value == null) {
ElMessage.error("请输入最大金币数");
ElMessage.error(t('PleaseEnterTheMaximumNumberOfGoldCoins'));
// gj请输入最大金币数
return;
} else if (minnum.value == null && maxnum.value != null) {
ElMessage.error("请输入最小金币数");
ElMessage.error(t('PleaseEnterTheMinimumNumberOfGoldCoins'));
// gj请输入最小金币数
return;
}
if (timevalue.value != null) {
const currentTime = Date.now();
if (timevalue.value[0] < currentTime) {
ElMessage.error("开始时间不能小于当前时间");
ElMessage.error(t('TheStartTimeCannotBeLessThanTheCurrentTime'));
// gj开始时间不能小于当前时间
return;
}
body.condition.pkTime = {
@@ -1476,7 +1582,9 @@ onBeforeUnmount(() => {
color: @font-color;
}
.Information-gender {
width: 50px;
width: auto;
padding-left: 10px;
padding-right: 10px;
height: 20px;
background-color: #e9e7e7;
border-radius: 10px;
@@ -1541,7 +1649,7 @@ onBeforeUnmount(() => {
border-top-right-radius: 16px;
border-left: 1px solid #03aba82f;
}
.chatNotDeta{
.chatNotDeta {
width: 100%;
height: 100%;
background-color: #ffffff;
@@ -1551,7 +1659,7 @@ onBeforeUnmount(() => {
border-top-right-radius: 16px;
border-left: 1px solid #03aba82f;
}
.chatNotDeta-text{
.chatNotDeta-text {
font-size: 20px;
color: #03aba8;
font-weight: bold;

View File

@@ -2,7 +2,8 @@
<div class="email-registration">
<!-- 账号信息 -->
<div class="form" v-if="active === 0">
<div class="title">重设密码</div>
<div class="title">{{ t('ResetThePassword') }}</div>
<!-- gj重置密码 -->
<div class="Password">
<el-input
type="Password"
@@ -10,9 +11,11 @@
class="input-item"
v-model="Password"
show-password
placeholder="请输入新密码"
:placeholder="t('PleaseEnterTheNewPassword')"
/>
<text class="password-tip">您的密码必须包含大小字母和数字长度在6-16位之间</text>
<!-- gj请输入新密码 -->
<text class="password-tip">{{ t('ThePasswordMustContainBothUpperAndLowerCaseLettersAndNumbersAndBe6To16CharactersLong') }}</text>
<!-- gj密码须包含大小写字母和数字长度6-16 -->
</div>
<div class="ConfirmPassword">
<el-input
@@ -21,23 +24,26 @@
class="input-item"
v-model="ConfirmPassword"
show-password
placeholder="请再次输入新密码"
:placeholder="t('PleaseEnterThePasswordAgain')"
/>
<!-- gj请再次输入密码 -->
</div>
<div class="btn">
<div class="nextStep" @click="nextStep">确认</div>
<div class="nextStep" @click="nextStep">{{ t('Confirm') }}</div>
<!-- gj确认 -->
</div>
</div>
<!-- 完成注册 -->
<div class="forms" v-if="active === 1">
<div class="title">重设密码成功</div>
<div class="title">{{ t('PasswordResetSuccessful') }}</div>
<!-- gj密码重置成功 -->
</div>
</div>
</template>
<script setup>
import { useRoute } from "vue-router";
import { ref, watch, onMounted, onUpdated, onUnmounted } from "vue";
import { ref, watch, onMounted, onUpdated, onUnmounted,onBeforeMount } from "vue";
import { resetPassword } from "@/api/account";
const active = ref(0);// 当前步骤
const route = useRoute();
@@ -45,17 +51,24 @@ const token = ref("");
const Password = ref("");// 密码
const ConfirmPassword = ref("");// 确认密码
import { ElMessage } from "element-plus";
import { setLocale } from "@/i18n";
//
import { useI18n } from "vue-i18n";
const { t } = useI18n();
const language = ref(null); // 语言
window["$t"] = t;
//
//确认
function nextStep() {
// 密码验证
const passwordRegex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{6,16}$/;
if (!passwordRegex.test(Password.value)) {
ElMessage.error('密码必须包含大小写字母和数字长度6-16位');
ElMessage.error(t('ThePasswordMustContainBothUpperAndLowerCaseLettersAndNumbersAndBe6To16CharactersLong'));
return;
}
// 确认密码验证
if (Password.value !== ConfirmPassword.value) {
ElMessage.error('两次输入的密码不一致');
ElMessage.error(t('TheTwoPasswordEntriesAreInconsistent'));
return;
}
resetPassword({
@@ -70,7 +83,18 @@ function nextStep() {
onMounted(() => {
token.value = route.params.token;
});
onBeforeMount(() => {
// 语言
getPromiseStorage("language")
.then((res) => {
console.log("获取语言成功", res);
language.value = res;
setLocale(language.value);
})
.catch((err) => {
console.log("获取语言失败", err);
});
});
onUpdated(() => {
// 组件更新后执行
});

View File

@@ -10,28 +10,49 @@
</template>
<script setup>
import { useRoute, useRouter } from "vue-router";
import { ref, watch, onMounted, onUpdated, onUnmounted } from "vue";
import { ref, watch, onMounted, onUpdated, onUnmounted,onBeforeMount} from "vue";
import { checkAccount } from "@/api/account";
const route = useRoute();
const router = useRouter();
const token = ref("");
import { ElMessage } from "element-plus";
const Hinttext = ref("验证中,请稍候");
import { setLocale } from "@/i18n";
//
import { useI18n } from "vue-i18n";
const { t } = useI18n();
const language = ref(null); // 语言
window["$t"] = t;
//
const Hinttext = ref(t('VerificationInProgressPleaseWaitAMoment'));
// gj验证中请稍候
//确认
function nextStep() {
checkAccount(token.value,
)
.then(() => {
Hinttext.value = "验证成功,请登录";
Hinttext.value = t('VerificationSuccessfulPleaseLogIn');
// gj登录成功跳转到首页
setTimeout(() => {
router.push("/");
}, 3000);
})
.catch(() => {
Hinttext.value = "验证失败";
Hinttext.value = t('VerificationFailed');
// gj验证失败
});
}
onBeforeMount(() => {
// 语言
getPromiseStorage("language")
.then((res) => {
console.log("获取语言成功", res);
language.value = res;
setLocale(language.value);
})
.catch((err) => {
console.log("获取语言失败", err);
});
});
onMounted(() => {
token.value = route.params.token;
nextStep();