|
|
@ -17,14 +17,16 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="inputBox my"> |
|
|
|
<u--input placeholder="请输入手机号" border="none" clearable type="number" maxlength="11" v-model="FormData.phone"></u--input> |
|
|
|
<!-- <u--input placeholder="请输入手机号" border="none" clearable type="number" maxlength="11" v-model="FormData.phone" :holdKeyboard="true" :adjustPosition="false"></u--input> --> |
|
|
|
<input v-model="FormData.phone" placeholder="请输入手机号" type="number" maxlength="11" > |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="form-item"> |
|
|
|
<view class="inputBox my"> |
|
|
|
<u--input placeholder="请输入验证码" border="none" clearable style="height: 100%;" :clearable="false" v-model="FormData.code"></u--input> |
|
|
|
<!-- <u--input placeholder="请输入验证码" border="none" clearable style="height: 100%;" :clearable="false" v-model="FormData.code"></u--input> --> |
|
|
|
<input type="text" placeholder="请输入验证码" v-model="FormData.code"> |
|
|
|
</view> |
|
|
|
<view class="code" @click='goSms' :class="{active: isPhone&&!codeOn}">{{codeText}}</view> |
|
|
|
<view class="code" @click.stop='goSms' :class="{active: isPhone&&!codeOn}">{{codeText}}</view> |
|
|
|
</view> |
|
|
|
<view class="loginBtn" :class="{active: btnHighlight}" @click="submitFn">登 录</view> |
|
|
|
<view style="margin-top: 40rpx;"> |
|
|
@ -50,11 +52,12 @@ |
|
|
|
FormData: {}, |
|
|
|
codeOn: false, |
|
|
|
bgColor: 'transparent', |
|
|
|
autoBack:'arrow-left' |
|
|
|
autoBack:'arrow-left', |
|
|
|
redirect: '' |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(options) { |
|
|
|
|
|
|
|
if(options.redirect) this.redirect = options.redirect |
|
|
|
this.isCheck = options.isCheck=='true'?true:false |
|
|
|
// alert(options.autoBack) |
|
|
|
if(options.autoBack) this.autoBack = '' |
|
|
@ -71,10 +74,12 @@ |
|
|
|
methods: { |
|
|
|
// 是否选择协议 |
|
|
|
changeRadio(val) { |
|
|
|
uni.hideKeyboard(); |
|
|
|
this.isCheck = val |
|
|
|
}, |
|
|
|
// 发送短信验证码 |
|
|
|
goSms() { |
|
|
|
uni.hideKeyboard(); |
|
|
|
const { |
|
|
|
FormData |
|
|
|
} = this |
|
|
@ -104,6 +109,7 @@ |
|
|
|
|
|
|
|
}, |
|
|
|
async submitFn() { |
|
|
|
uni.hideKeyboard(); |
|
|
|
if(!this.btnHighlight) return |
|
|
|
if(!this.isCheck) return this.$u.toast('请勾选产品协议与隐私政策'); |
|
|
|
let obj = { |
|
|
@ -113,14 +119,12 @@ |
|
|
|
const res = await loginSMS(obj) |
|
|
|
this.$store.commit('update_vuex_loginInfo',res.data) |
|
|
|
await this.$store.dispatch('getUserInfo') |
|
|
|
let login_front = uni.getStorageSync('login_front') |
|
|
|
console.log('login_front') |
|
|
|
console.log(login_front) |
|
|
|
if(login_front) { |
|
|
|
|
|
|
|
if(this.redirect) { |
|
|
|
let switchBar = ['/pages/tabbar/index/index', '/pages/tabbar/learnCar/index', '/pages/tabbar/mine/index'] |
|
|
|
if(switchBar.includes(login_front)) { |
|
|
|
if(switchBar.includes(this.redirect)) { |
|
|
|
uni.reLaunch({ |
|
|
|
url: login_front |
|
|
|
url: this.redirect |
|
|
|
}) |
|
|
|
}else { |
|
|
|
const pages = getCurrentPages(); |
|
|
@ -153,6 +157,9 @@ |
|
|
|
min-height: 100vh; |
|
|
|
// background: url('../../../static/images/userCenter/loginTopBg.png') no-repeat; |
|
|
|
// background-size: 100% 360rpx; |
|
|
|
.uni-input-placeholder { |
|
|
|
color: #BBBBBB !important; |
|
|
|
} |
|
|
|
.u-back-top { |
|
|
|
padding: 32rpx 0 0 0; |
|
|
|
.backBox { |
|
|
@ -189,10 +196,19 @@ |
|
|
|
|
|
|
|
.inputBox { |
|
|
|
flex: 1; |
|
|
|
input { |
|
|
|
display: block; |
|
|
|
width: 100%; |
|
|
|
height: 100%; |
|
|
|
display: block; |
|
|
|
line-height: 112rpx; |
|
|
|
font-size: 30rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
.code { |
|
|
|
color: #BBBBBB; |
|
|
|
margin-left: 30rpx; |
|
|
|
font-size: 30rpx; |
|
|
|
&.active { |
|
|
|
color: $themC |
|
|
|
} |
|
|
|