页面多语言

This commit is contained in:
chenlan
2025-03-19 21:57:16 +08:00
parent a028628667
commit a1e9b19884
4 changed files with 36 additions and 20 deletions
+32 -16
View File
@@ -8,42 +8,42 @@
<view class="inputs_button">
<view class="inputs">
<view class="laber">邮箱</view>
<view class="laber">{{$t('email')}}</view>
<view class="vcode">
<u--input
type="password"
placeholder="邮箱地址"
type="text"
:placeholder="$t('emailinput')"
border="none"
></u--input>
<text v-if="vcodeTime==0" @click="getVcode">获取验证码</text>
<text v-else style="color:#fff">重新获取({{vcodeTime}}s)</text>
<text v-if="vcodeTime==0" @click="getVcode">{{$t('getcode')}}</text>
<text v-else style="color:#fff">({{vcodeTime}}s)</text>
</view>
<view class="password">
<u--input
type="password"
placeholder="验证码"
type="text"
:placeholder="$t('code')"
border="none"
></u--input>
</view>
<view class="laber">重置密码</view>
<view class="laber">{{$t('resetpassword')}}</view>
<view class="account">
<u--input
type="password"
placeholder="新密码"
:placeholder="$t('newpassword')"
border="none"
></u--input>
</view>
<view class="password">
<u--input
type="password"
placeholder="确认密码"
:placeholder="$t('Confirmpassword')"
border="none"
></u--input>
</view>
</view>
<view class="button">
<view @click="login">
确认修改
{{$t('Confirmbtn')}}
</view>
</view>
</view>
@@ -74,20 +74,27 @@
login() {
if(this.email==''){
uni.showToast({
title:'邮箱不能为空',
title:this.$t('emailerr'),
icon: 'none'
});
return false
}
if(this.password==''){
uni.showToast({
title:'密码不能为空',
title:this.$t('passworerr'),
icon: 'none'
});
return false
}
},
getVcode() {
if(this.email==''){
uni.showToast({
title:this.$t('emailerr'),
icon: 'none'
});
return false
}
this.vcodeTime = 60
this.vcodeTimer = setInterval(() => {
if (this.vcodeTime > 0) {
@@ -97,9 +104,18 @@
this.vcodeTimer = null
}
}, 1000)
uni.showToast({
title: "获取验证码",
icon: 'none'
request({
url:'user/sendCode',
method:'POST',
data:{
email: this.email,
}
}).then(res => {
console.log(res.data.data)
uni.showToast({
title:res.data.message,
icon: 'none'
})
})
},
}