|
@@ -1,6 +1,5 @@
|
|
<template>
|
|
<template>
|
|
<view class="app-login-page">
|
|
<view class="app-login-page">
|
|
- <u-toast ref="uToast" />
|
|
|
|
<view class="app-login">
|
|
<view class="app-login">
|
|
<view class="app-icon mb-30">
|
|
<view class="app-icon mb-30">
|
|
<image src="/static/images/login-icon.png" mode="aspectFit" style="height: 40px;"></image>
|
|
<image src="/static/images/login-icon.png" mode="aspectFit" style="height: 40px;"></image>
|
|
@@ -34,11 +33,11 @@
|
|
</view>
|
|
</view>
|
|
<view class="phone-form" v-if="loginType=='username'">、
|
|
<view class="phone-form" v-if="loginType=='username'">、
|
|
<view class="form-item">
|
|
<view class="form-item">
|
|
- <u-input height="80" placeholder="请输入账号" border-color="#b1b1b1" v-model="phoneForm.shoujihao"
|
|
|
|
|
|
+ <u-input height="80" placeholder="请输入账号" border-color="#b1b1b1" v-model="usernameForm.zhanghao"
|
|
:border="true" class="form-item-input" />
|
|
:border="true" class="form-item-input" />
|
|
</view>
|
|
</view>
|
|
<view class="form-item">
|
|
<view class="form-item">
|
|
- <u-input height="80" placeholder="请输入密码" border-color="#b1b1b1" v-model="phoneForm.yanzhengma"
|
|
|
|
|
|
+ <u-input height="80" placeholder="请输入密码" border-color="#b1b1b1" v-model="usernameForm.mima"
|
|
:border="true" class="form-item-input" />
|
|
:border="true" class="form-item-input" />
|
|
</view>
|
|
</view>
|
|
<view class="form-button" @click="usenameLoginHandle">
|
|
<view class="form-button" @click="usenameLoginHandle">
|
|
@@ -65,6 +64,8 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+ import { usernameLogin } from "@/api/user.js"
|
|
|
|
+ import { msg } from "@/utils/common.js"
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -88,11 +89,11 @@
|
|
phoneLoginHandle() {
|
|
phoneLoginHandle() {
|
|
const regex = /^1[3-9]\d{9}$/;
|
|
const regex = /^1[3-9]\d{9}$/;
|
|
if (!regex.test(this.phoneForm.shoujihao)) {
|
|
if (!regex.test(this.phoneForm.shoujihao)) {
|
|
- this.showToast("请输入正确的手机号")
|
|
|
|
|
|
+ msg("请输入正确的手机号")
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
if (!this.phoneForm.yanzhengma) {
|
|
if (!this.phoneForm.yanzhengma) {
|
|
- this.showToast("请输入验证码")
|
|
|
|
|
|
+ msg("请输入验证码")
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
console.log(this.phoneForm)
|
|
console.log(this.phoneForm)
|
|
@@ -101,13 +102,16 @@
|
|
// 账号登录
|
|
// 账号登录
|
|
usenameLoginHandle(){
|
|
usenameLoginHandle(){
|
|
if(!this.usernameForm.zhanghao){
|
|
if(!this.usernameForm.zhanghao){
|
|
- this.showToast("请输入账号")
|
|
|
|
|
|
+ msg("请输入账号")
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
if(!this.usernameForm.mima){
|
|
if(!this.usernameForm.mima){
|
|
- this.showToast("请输入密码")
|
|
|
|
|
|
+ msg("请输入密码")
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ // usernameLogin(this.usernameForm).then(res=>{
|
|
|
|
+ // console.log(res,45699)
|
|
|
|
+ // })
|
|
console.log(this.usernameForm)
|
|
console.log(this.usernameForm)
|
|
},
|
|
},
|
|
toPage(url){
|
|
toPage(url){
|
|
@@ -116,14 +120,6 @@
|
|
url:url
|
|
url:url
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- // 提示
|
|
|
|
- showToast(msg, type) {
|
|
|
|
- this.$refs.uToast.show({
|
|
|
|
- title: msg,
|
|
|
|
- type: type ? type : "error",
|
|
|
|
- position: "top"
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
// 点击获取验证码
|
|
// 点击获取验证码
|
|
requestVerificationCode() {
|
|
requestVerificationCode() {
|
|
if (!this.isCounting) {
|
|
if (!this.isCounting) {
|