[本时生活H5]
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<image src="@/static/img/campusLogin_logo.png" mode="aspectFill"></image>
|
||||
<view class="title">用户注册</view>
|
||||
</view>
|
||||
<image class="cover" src="@/static/img/campusLogin_back_01.png" mode="aspectFill"></image>
|
||||
<image class="cover" src="@/static/img/campus_nologo.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="campus-cont">
|
||||
<form @submit="submitRegister">
|
||||
@@ -29,71 +29,71 @@
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { send, register } from '@/apis/interfaces/auth'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
codename : '获取验证码',
|
||||
mobileNo : '', // 手机号
|
||||
<script>
|
||||
import { send, register } from '@/apis/interfaces/auth'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
codename : '获取验证码',
|
||||
mobileNo : '', // 手机号
|
||||
code : '', // 验证码
|
||||
disabled : false,
|
||||
}
|
||||
},
|
||||
disabled : false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// mobileNo
|
||||
getNameValue(e) {
|
||||
this.mobileNo = e.detail.value
|
||||
},
|
||||
|
||||
// 获取code
|
||||
getCode(){
|
||||
let mobileNo = this.mobileNo
|
||||
|
||||
var _this = this
|
||||
if (mobileNo == "") {
|
||||
uni.showToast({
|
||||
title : '手机号不能为空',
|
||||
icon : 'none',
|
||||
duration : 1000
|
||||
})
|
||||
return false;
|
||||
}else{
|
||||
send({mobile: mobileNo, channel: 'LOGIN'}).then(res=>{
|
||||
uni.showToast({
|
||||
title : '发送成功',
|
||||
icon : 'success',
|
||||
duration: 2000
|
||||
})
|
||||
var num = 61;
|
||||
var timer = setInterval(function () {
|
||||
num--;
|
||||
if (num <= 0) {
|
||||
clearInterval(timer);
|
||||
_this.codename = '重新发送'
|
||||
_this.disabled = false
|
||||
|
||||
} else {
|
||||
_this.codename = num + "s后重新获取"
|
||||
_this.disabled = true
|
||||
}
|
||||
}, 1000)
|
||||
}).catch(err=>{
|
||||
uni.showToast({
|
||||
title : err.message,
|
||||
icon :'none',
|
||||
duration: 2000
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
// 获取后输入code
|
||||
getCodeValue (e) {
|
||||
this.code = e.detail.value
|
||||
},
|
||||
|
||||
// 立即登录
|
||||
// mobileNo
|
||||
getNameValue(e) {
|
||||
this.mobileNo = e.detail.value
|
||||
},
|
||||
|
||||
// 获取code
|
||||
getCode(){
|
||||
let mobileNo = this.mobileNo
|
||||
|
||||
var _this = this
|
||||
if (mobileNo == "") {
|
||||
uni.showToast({
|
||||
title : '手机号不能为空',
|
||||
icon : 'none',
|
||||
duration : 1000
|
||||
})
|
||||
return false;
|
||||
}else{
|
||||
send({mobile: mobileNo, channel: 'LOGIN'}).then(res=>{
|
||||
uni.showToast({
|
||||
title : '发送成功',
|
||||
icon : 'success',
|
||||
duration: 2000
|
||||
})
|
||||
var num = 61;
|
||||
var timer = setInterval(function () {
|
||||
num--;
|
||||
if (num <= 0) {
|
||||
clearInterval(timer);
|
||||
_this.codename = '重新发送'
|
||||
_this.disabled = false
|
||||
|
||||
} else {
|
||||
_this.codename = num + "s后重新获取"
|
||||
_this.disabled = true
|
||||
}
|
||||
}, 1000)
|
||||
}).catch(err=>{
|
||||
uni.showToast({
|
||||
title : err.message,
|
||||
icon :'none',
|
||||
duration: 2000
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
// 获取后输入code
|
||||
getCodeValue (e) {
|
||||
this.code = e.detail.value
|
||||
},
|
||||
|
||||
// 立即登录
|
||||
submitRegister(e){
|
||||
let formValue = e.detail.value
|
||||
|
||||
@@ -124,8 +124,8 @@
|
||||
icon : 'none'
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user