[本时生活H5]
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
<template>
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="campus-header">
|
||||
<view class="logo">
|
||||
<image src="@/static/img/campusLogin_logo.png" mode="aspectFill"></image>
|
||||
<view class="title">中石油活动登录</view>
|
||||
<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">
|
||||
<view class="campus-cont">
|
||||
<form @submit="forgetlogin">
|
||||
<view class="campus-inputs">
|
||||
<image class="campus-form-icon" src="/static/img/campus_login_02.png" mode="aspectFill"></image>
|
||||
@@ -25,91 +25,91 @@
|
||||
<view class="resPassword">
|
||||
<navigator url="./password">忘记密码</navigator>
|
||||
</view>
|
||||
<button class="campus-form-btn" form-type="submit">登录</button>
|
||||
<button class="campus-form-btn" form-type="submit">登录</button>
|
||||
</form>
|
||||
<view class="login-box">
|
||||
<view @click="onCutLogin">{{passwordLogin ? '验证码登录': '密码登录'}}</view>
|
||||
<navigator url="./register">快速注册</navigator>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { send, auth, passlogin } from '@/apis/interfaces/auth'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
codename : '获取验证码',
|
||||
mobileNo : '', // 手机号
|
||||
<script>
|
||||
import { send, auth, passlogin } from '@/apis/interfaces/auth'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
codename : '获取验证码',
|
||||
mobileNo : '', // 手机号
|
||||
code : '', // 验证码
|
||||
passwordLogin: false, // 登录方式
|
||||
disabled : false,
|
||||
}
|
||||
},
|
||||
|
||||
passwordLogin: true, // 登录方式
|
||||
disabled : false,
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 切换登录方式
|
||||
onCutLogin(){
|
||||
this.passwordLogin = !this.passwordLogin
|
||||
},
|
||||
// mobileNo
|
||||
getNameValue(e) {
|
||||
this.mobileNo = e.detail.value
|
||||
},
|
||||
|
||||
// 获取code
|
||||
getCode(){
|
||||
let mobileNo = this.mobileNo,
|
||||
myreg = /^(14[0-9]|13[0-9]|15[0-9]|17[0-9]|18[0-9]|16[0-9])\d{8}$$/
|
||||
|
||||
var _this = this
|
||||
if (mobileNo == "") {
|
||||
uni.showToast({
|
||||
title : '手机号不能为空',
|
||||
icon : 'none',
|
||||
duration : 1000
|
||||
})
|
||||
return false;
|
||||
}else if (!myreg.test(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=>{})
|
||||
}
|
||||
},
|
||||
|
||||
// 获取后输入code
|
||||
getCodeValue (e) {
|
||||
this.code = e.detail.value
|
||||
},
|
||||
|
||||
// 立即登录
|
||||
},
|
||||
// mobileNo
|
||||
getNameValue(e) {
|
||||
this.mobileNo = e.detail.value
|
||||
},
|
||||
|
||||
// 获取code
|
||||
getCode(){
|
||||
let mobileNo = this.mobileNo,
|
||||
myreg = /^(14[0-9]|13[0-9]|15[0-9]|17[0-9]|18[0-9]|16[0-9])\d{8}$$/
|
||||
|
||||
var _this = this
|
||||
if (mobileNo == "") {
|
||||
uni.showToast({
|
||||
title : '手机号不能为空',
|
||||
icon : 'none',
|
||||
duration : 1000
|
||||
})
|
||||
return false;
|
||||
}else if (!myreg.test(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=>{})
|
||||
}
|
||||
},
|
||||
|
||||
// 获取后输入code
|
||||
getCodeValue (e) {
|
||||
this.code = e.detail.value
|
||||
},
|
||||
|
||||
// 立即登录
|
||||
forgetlogin(e){
|
||||
let mobileNo = e.detail.value.mobile || '',
|
||||
let mobileNo = e.detail.value.mobile || '',
|
||||
code = this.code || '',
|
||||
password = e.detail.value.password || '',
|
||||
loginFunction
|
||||
@@ -138,8 +138,8 @@
|
||||
icon : 'none'
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user