用户接口对接
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<view slot="body">
|
||||
<view class="login">
|
||||
<view class="login-title">登录</view>
|
||||
<view class="login-des">{{ companyName }}</view>
|
||||
<view class="login-des">灿能物联</view>
|
||||
<view class="login-box">
|
||||
<!-- <image class="login-box-logo" mode="widthFix" src="/static/logo.png"></image> -->
|
||||
<image class="login-box-logo" mode="widthFix" src="/static/logo.png"></image>
|
||||
@@ -24,7 +24,7 @@
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="login-box-input mt100">
|
||||
<input class="login-box-input-main" v-model="pwdForm.account" placeholder="请输入账号" />
|
||||
<input class="login-box-input-main" v-model="pwdForm.phone" placeholder="请输入账号" />
|
||||
</view>
|
||||
<view class="login-box-input mt40">
|
||||
<input type="password" class="login-box-input-main" v-model="pwdForm.pwd" placeholder="请输入密码" />
|
||||
@@ -62,7 +62,7 @@ export default {
|
||||
loading: false,
|
||||
loginType: 'pwd',
|
||||
pwdForm: {
|
||||
account: '',
|
||||
phone: '',
|
||||
pwd: '',
|
||||
imgCode: '',
|
||||
},
|
||||
@@ -79,23 +79,31 @@ export default {
|
||||
},
|
||||
components: {},
|
||||
methods: {
|
||||
async getCode () {
|
||||
getCode () {
|
||||
if (!this.yzmForm.phone) {
|
||||
return this.$util.toast('请输入手机号!')
|
||||
}
|
||||
const res = await apiGetYms({
|
||||
uni.showLoading({
|
||||
title: '请稍等'
|
||||
})
|
||||
apiGetYms({
|
||||
phone: this.yzmForm.phone,
|
||||
type: 0,
|
||||
}).then(res => {
|
||||
uni.hideLoading()
|
||||
console.log(res);
|
||||
this.waitTime = 60
|
||||
this.inter = setInterval(() => {
|
||||
if (this.waitTime == 0) {
|
||||
clearInterval(this.inter)
|
||||
} else {
|
||||
this.waitTime--
|
||||
}
|
||||
}, 1000)
|
||||
}).catch(err => {
|
||||
uni.hideLoading()
|
||||
console.log(err);
|
||||
})
|
||||
console.log(res);
|
||||
this.waitTime = 60
|
||||
this.inter = setInterval(() => {
|
||||
if (this.waitTime == 0) {
|
||||
clearInterval(this.inter)
|
||||
} else {
|
||||
this.waitTime--
|
||||
}
|
||||
}, 1000)
|
||||
},
|
||||
login () {
|
||||
console.log(this.loginType);
|
||||
@@ -106,17 +114,12 @@ export default {
|
||||
}
|
||||
},
|
||||
pwdLogin () {
|
||||
console.log({
|
||||
phone: this.yzmForm.phone,
|
||||
key: this.yzmForm.pwd,
|
||||
type: 1,
|
||||
})
|
||||
if (!this.pwdForm.account && !this.pwdForm.pwd) {
|
||||
if (!this.pwdForm.phone && !this.pwdForm.pwd) {
|
||||
return this.$util.toast('请填写登录信息!')
|
||||
}
|
||||
apiLogin({
|
||||
phone: this.yzmForm.phone,
|
||||
key: this.yzmForm.pwd,
|
||||
phone: this.pwdForm.phone,
|
||||
key: this.pwdForm.pwd,
|
||||
type: 1,
|
||||
}).then(res => {
|
||||
console.log(res);
|
||||
|
||||
Reference in New Issue
Block a user