2025-03-25 10:17:30 +08:00
|
|
|
<template>
|
|
|
|
|
<view class="content">
|
|
|
|
|
<view class="login">
|
|
|
|
|
<view class="editem">
|
|
|
|
|
<view class="item">
|
|
|
|
|
<view class="text">邮箱</view>
|
|
|
|
|
<view class="input">
|
|
|
|
|
<input v-model="phone" placeholder="请输入邮箱"/>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="item ">
|
|
|
|
|
<view class="text">验证码</view>
|
|
|
|
|
<view class="input yanzhengma">
|
|
|
|
|
<input class="uni-input" v-model="code" />
|
|
|
|
|
<button class="code" type="none" @click="handleCode" v-model="code"
|
|
|
|
|
:disabled="disabled">{{second<60 ? second+'S后重发':'获取验证码'}}
|
|
|
|
|
</button>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="btnlogin" @click="handleTelLogin">确认</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
phone: "",
|
|
|
|
|
code: "",
|
|
|
|
|
disabled: false,
|
|
|
|
|
second: 60,
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
// 登录、
|
|
|
|
|
handleTelLogin() {
|
|
|
|
|
let that = this
|
|
|
|
|
if (!(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(that.phone))) {
|
|
|
|
|
that.$tools.msg("请输入正确的邮箱")
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (!that.code) {
|
|
|
|
|
that.$tools.msg("请填写验证码")
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
that.$model.getAccountMsg({
|
|
|
|
|
data: that.phone,
|
|
|
|
|
code: that.code,
|
|
|
|
|
}).then(res => {
|
|
|
|
|
if (res.code != 0) {
|
|
|
|
|
that.$tools.msg(res.msg)
|
|
|
|
|
return
|
|
|
|
|
} else {
|
|
|
|
|
that.$tools.msg("设置成功!")
|
|
|
|
|
that.$store.commit('changeAccountNumber', {
|
|
|
|
|
my_email: that.phone
|
|
|
|
|
})
|
2025-04-02 09:49:39 +08:00
|
|
|
setTimeout(function() {
|
|
|
|
|
uni.redirectTo({
|
|
|
|
|
url: "/pageTwo/setting/setting"
|
|
|
|
|
})
|
|
|
|
|
}, 1000)
|
2025-03-25 10:17:30 +08:00
|
|
|
}
|
|
|
|
|
}).catch(err => {})
|
|
|
|
|
},
|
|
|
|
|
// 获取验证码
|
|
|
|
|
handleCode() {
|
|
|
|
|
let that = this
|
|
|
|
|
if (!that.phone) {
|
|
|
|
|
that.$tools.msg("请输入邮箱")
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (!(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(that.phone))) {
|
|
|
|
|
that.$tools.msg("请输入正确的邮箱")
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
//
|
|
|
|
|
that.$model.getSendCode({
|
|
|
|
|
data: that.phone,
|
|
|
|
|
// type: that.type
|
|
|
|
|
}).then(res => {
|
|
|
|
|
console.log(res)
|
|
|
|
|
if (res.code != 0) {
|
|
|
|
|
that.$tools.msg(res.msg)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
that.disabled = true
|
|
|
|
|
let interval = setInterval(() => {
|
|
|
|
|
--that.second
|
|
|
|
|
}, 1000)
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
clearInterval(interval)
|
|
|
|
|
that.disabled = false
|
|
|
|
|
that.second = 60
|
|
|
|
|
}, 60000)
|
|
|
|
|
}).catch(err => {})
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
.content {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100vh;
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.login {
|
2025-11-25 14:21:22 +08:00
|
|
|
width: calc(100% - 60rpx);
|
2025-03-25 10:17:30 +08:00
|
|
|
height: auto;
|
|
|
|
|
background: #fff;
|
2025-11-25 14:21:22 +08:00
|
|
|
border-radius: 20rpx;
|
|
|
|
|
padding: 30rpx;
|
2025-03-25 10:17:30 +08:00
|
|
|
|
|
|
|
|
z-index: 99;
|
|
|
|
|
|
|
|
|
|
.title {
|
|
|
|
|
text-align: left;
|
|
|
|
|
color: #333;
|
|
|
|
|
font-size: 40rpx;
|
|
|
|
|
font-weight: bold;
|
2025-11-25 14:21:22 +08:00
|
|
|
margin-bottom: 30rpx;
|
2025-03-25 10:17:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.editem {
|
|
|
|
|
position: relative;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
font-size: 32rpx;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.item {
|
|
|
|
|
width: 100%;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
2025-11-25 14:21:22 +08:00
|
|
|
margin-bottom: 30rpx;
|
2025-03-25 10:17:30 +08:00
|
|
|
|
|
|
|
|
.text {
|
|
|
|
|
width: 80px;
|
2025-11-25 14:21:22 +08:00
|
|
|
height: 80rpx;
|
|
|
|
|
line-height: 80rpx;
|
2025-03-25 10:17:30 +08:00
|
|
|
font-size: 32rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.input {
|
|
|
|
|
width: calc(100% - 100px);
|
|
|
|
|
height: 35px;
|
|
|
|
|
line-height: 35px;
|
|
|
|
|
display: flex;
|
|
|
|
|
position: relative;
|
|
|
|
|
border: #dfdfdf 1px solid;
|
|
|
|
|
border-radius: 5px;
|
2025-11-25 14:21:22 +08:00
|
|
|
padding: 0 20rpx;
|
2025-03-25 10:17:30 +08:00
|
|
|
background-color: #f7f7f7;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
input {
|
2025-11-25 14:21:22 +08:00
|
|
|
height: 80rpx;
|
|
|
|
|
line-height: 80rpx;
|
2025-03-25 10:17:30 +08:00
|
|
|
position: absolute;
|
2025-11-25 14:21:22 +08:00
|
|
|
left: 20rpx;
|
2025-03-25 10:17:30 +08:00
|
|
|
right: 0px;
|
|
|
|
|
z-index: 88;
|
|
|
|
|
font-size: 32rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.yanzhengma {
|
|
|
|
|
input {
|
2025-11-25 14:21:22 +08:00
|
|
|
right: 140rpx;
|
2025-03-25 10:17:30 +08:00
|
|
|
font-size: 32rpx;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.code {
|
2025-11-25 14:21:22 +08:00
|
|
|
width: 120rpx;
|
2025-03-25 10:17:30 +08:00
|
|
|
background: #dfdfdf;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
margin: 0;
|
2025-11-25 14:21:22 +08:00
|
|
|
line-height: 80rpx;
|
2025-03-25 10:17:30 +08:00
|
|
|
border-radius: 5px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
position: absolute;
|
|
|
|
|
right: 0px;
|
|
|
|
|
top: 0px;
|
|
|
|
|
bottom: 0;
|
|
|
|
|
z-index: 99;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.btnlogin {
|
|
|
|
|
width: 100%;
|
2025-11-25 14:21:22 +08:00
|
|
|
margin: 30rpx 0;
|
2025-03-25 10:17:30 +08:00
|
|
|
height: 42px;
|
|
|
|
|
line-height: 42px;
|
|
|
|
|
background: $btncolor;
|
|
|
|
|
font-weight: 700;
|
2025-11-25 14:21:22 +08:00
|
|
|
border-radius: 30rpx;
|
2025-03-25 10:17:30 +08:00
|
|
|
text-align: center;
|
|
|
|
|
color: #fff !important;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|