|
@@ -5,13 +5,13 @@
|
|
<view class="login">
|
|
<view class="login">
|
|
<view class="login-title">验证码登录</view>
|
|
<view class="login-title">验证码登录</view>
|
|
<view class="login-input pat">
|
|
<view class="login-input pat">
|
|
- <u-input placeholder="请输入手机号" type="number" v-model="mobile" border="none" clearable/>
|
|
|
|
|
|
+ <u-input placeholder="请输入手机号" type="number" v-model="mobile" border="none" clearable @blur="changeNumber"/>
|
|
</view>
|
|
</view>
|
|
<view class="login-input">
|
|
<view class="login-input">
|
|
- <u-input placeholder="请输入短信验证码" type="number" v-model="code" clearable>
|
|
|
|
|
|
+ <u-input placeholder="请输入短信验证码" type="number" v-model="code" clearable @blur="changeCode">
|
|
<template slot="suffix">
|
|
<template slot="suffix">
|
|
<u-code ref="uCode" @change="codeChange" seconds="60" changeText="Xs"></u-code>
|
|
<u-code ref="uCode" @change="codeChange" seconds="60" changeText="Xs"></u-code>
|
|
- <u-button @tap="getCode" :text="tips" type="default" size="mini"></u-button>
|
|
|
|
|
|
+ <u-button @click="getCode" :text="tips" type="default" size="mini"></u-button>
|
|
</template>
|
|
</template>
|
|
</u-input>
|
|
</u-input>
|
|
</view>
|
|
</view>
|
|
@@ -55,10 +55,7 @@
|
|
return
|
|
return
|
|
}
|
|
}
|
|
if (this.$refs.uCode.canGetCode) {
|
|
if (this.$refs.uCode.canGetCode) {
|
|
- // 模拟向后端请求验证码
|
|
|
|
- uni.showLoading({
|
|
|
|
- title: '正在获取验证码'
|
|
|
|
- })
|
|
|
|
|
|
+
|
|
// 这里此提示会被this.start()方法中的提示覆盖
|
|
// 这里此提示会被this.start()方法中的提示覆盖
|
|
uni.$u.toast('验证码已发送');
|
|
uni.$u.toast('验证码已发送');
|
|
// 通知验证码组件内部开始倒计时
|
|
// 通知验证码组件内部开始倒计时
|
|
@@ -76,6 +73,13 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ changeNumber(e) {
|
|
|
|
+ this.mobile = e
|
|
|
|
+ },
|
|
|
|
+ changeCode(e) {
|
|
|
|
+ this.code = e
|
|
|
|
+ },
|
|
|
|
+
|
|
login() {
|
|
login() {
|
|
let _this = this
|
|
let _this = this
|
|
if (!_this.mobile) {
|
|
if (!_this.mobile) {
|
|
@@ -105,7 +109,7 @@
|
|
uni.setStorageSync('token', res.token)
|
|
uni.setStorageSync('token', res.token)
|
|
_this.getBaseInfo()
|
|
_this.getBaseInfo()
|
|
// #endif
|
|
// #endif
|
|
- // #ifdef H5
|
|
|
|
|
|
+ // #ifdef H5 || MP-ALIPAY
|
|
uni.$u.toast('登录成功');
|
|
uni.$u.toast('登录成功');
|
|
uni.setStorageSync('token', res.token)
|
|
uni.setStorageSync('token', res.token)
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|