<template>
|
|
<view class="content">
|
|
|
|
<view v-if="step === 1">
|
|
<view style="height: 138rpx; width: 100%;"></view>
|
|
<view class="a1 flex">
|
|
<image src="/static/icons/icon7.png" style="width: 29rpx;height: 32rpx; margin-right: 10rpx"/>
|
|
<span>手机号快捷登录</span>
|
|
</view>
|
|
<!-- <view class="a2">未注册手机号将自动创建账号</view> -->
|
|
<view class="a3"></view>
|
|
<view class="a4 flex">
|
|
<view class="left-area">+86</view>
|
|
<input placeholder="请输入手机号" v-model="phone"/>
|
|
</view>
|
|
<button class="a5" @click="clickSendCode">下一步</button>
|
|
</view>
|
|
|
|
<view v-if="step === 2">
|
|
<view class="b1">
|
|
<span>输入验证码</span>
|
|
</view>
|
|
<view class="b2">
|
|
验证码已发送至{{ phone }}
|
|
</view>
|
|
<view>
|
|
<view class="flex flex-sb" style="padding: 40rpx; width: calc(100% - 80rpx)">
|
|
<input v-for="i in 4" class="input-m" type="number"
|
|
:class="{active: i === yzmCode.length+1}"
|
|
:focus="i === yzmCode.length+1"
|
|
:value="yzmCode[i-1]"
|
|
@click="clickNum(i)" @input="inputNum" />
|
|
</view>
|
|
</view>
|
|
<view class="b3">
|
|
没收到验证码?<span @click="clickSendCode">重新发送</span>
|
|
</view>
|
|
<view class="b4" @click="toWxLogin">
|
|
确认登录
|
|
</view>
|
|
</view>
|
|
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
step: 1,
|
|
openid: '',
|
|
yzmCode: '',
|
|
phone : '',
|
|
}
|
|
},
|
|
onShow() {
|
|
// this.getConfig()
|
|
// this.code = this.GetQueryString('code');
|
|
// if (!this.code) {
|
|
// this.getwx_authorize();
|
|
// }
|
|
},
|
|
methods: {
|
|
clickCancel(){
|
|
uni.switchTab({ url: '/pages/index/index' })
|
|
},
|
|
clickSendCode(){
|
|
this.$api('getVipCode', {
|
|
phone : this.phone
|
|
}, res => {
|
|
if(res.code == 200){
|
|
this.step = 2
|
|
uni.showToast({
|
|
title : '发送成功',
|
|
icon : 'none'
|
|
})
|
|
}
|
|
}, '发送中...')
|
|
},
|
|
clickNum(i){
|
|
this.yzmCode = this.yzmCode.substring(0, i-1)
|
|
},
|
|
inputNum(event){
|
|
if (event){
|
|
this.yzmCode = this.yzmCode + event.detail.value.toString().substring(0,1)
|
|
// if (this.yzmCode.length === 6){
|
|
// this.checkCode()
|
|
// }
|
|
}
|
|
},
|
|
checkCode(){
|
|
this.clickCancel()
|
|
},
|
|
//微信登录
|
|
toWxLogin(code) {
|
|
let data = {
|
|
code : this.yzmCode,
|
|
phone : this.phone
|
|
}
|
|
console.log(data);
|
|
this.$api('wxTechnicianLogin', data, res=> {
|
|
if(res.code == 200){
|
|
uni.setStorageSync("token", res.result.token)
|
|
uni.setStorageSync("userInfo", JSON.stringify(res.result.userInfo))
|
|
uni.switchTab({
|
|
url: '/pages/index/index'
|
|
})
|
|
}
|
|
}, true)
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
|
|
|
|
.b1{
|
|
width: 100%;
|
|
height: 56rpx;
|
|
font-size: 40rpx;
|
|
font-family: PingFang SC, PingFang SC-Heavy;
|
|
font-weight: 800;
|
|
text-align: center;
|
|
color: #333333;
|
|
|
|
margin-top: 38rpx;
|
|
}
|
|
|
|
.b2{
|
|
width: 100%;
|
|
height: 40rpx;
|
|
font-size: 28rpx;
|
|
font-family: PingFang SC, PingFang SC-Regular;
|
|
font-weight: 400;
|
|
text-align: center;
|
|
color: #a5a5a5;
|
|
|
|
margin-top: 20rpx;
|
|
}
|
|
|
|
.input-m{
|
|
width: 96rpx;
|
|
height: 136rpx;
|
|
background: #f8f8f8;
|
|
border-radius: 16rpx;
|
|
|
|
line-height: 136rpx;
|
|
|
|
font-size: 52rpx;
|
|
font-family: PingFang SC, PingFang SC-Heavy;
|
|
font-weight: 800;
|
|
text-align: center;
|
|
color: #333333;
|
|
}
|
|
|
|
.input-m.active{
|
|
width: 90rpx;
|
|
height: 130rpx;
|
|
border: 3rpx solid #51d0b4;
|
|
}
|
|
|
|
.b3{
|
|
font-size: 28rpx;
|
|
font-family: PingFang SC, PingFang SC-Regular;
|
|
font-weight: 400;
|
|
text-align: center;
|
|
color: #666666;
|
|
}
|
|
|
|
.b3 span{
|
|
color: #51D0B4;
|
|
}
|
|
|
|
.b4{
|
|
width: 556rpx;
|
|
height: 90rpx;
|
|
line-height: 90rpx;
|
|
border-radius: 46rpx;
|
|
background: #51d0b4;
|
|
|
|
font-size: 28rpx;
|
|
font-family: PingFang SC, PingFang SC-Regular;
|
|
font-weight: 400;
|
|
text-align: center;
|
|
color: #ffffff;
|
|
|
|
margin: 94rpx auto;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.a1{
|
|
font-size: 32rpx;
|
|
line-height: 38rpx;
|
|
font-family: PingFang SC, PingFang SC-Heavy,serif;
|
|
font-weight: 800;
|
|
text-align: left;
|
|
color: #333333;
|
|
|
|
margin-left: 98rpx;
|
|
margin-bottom: 12rpx;
|
|
}
|
|
.a2 {
|
|
font-size: 28rpx;
|
|
font-family: PingFang SC, PingFang SC-Regular;
|
|
font-weight: 400;
|
|
text-align: left;
|
|
color: #a5a5a5;
|
|
|
|
margin-left: 98rpx;
|
|
}
|
|
|
|
.a3 {
|
|
width: 100%;
|
|
height: 120rpx;
|
|
}
|
|
|
|
.a4 {
|
|
width: 556rpx;
|
|
height: 90rpx;
|
|
line-height: 90rpx;
|
|
background: #f5f5f5;
|
|
border-radius: 45rpx;
|
|
|
|
margin: 0 auto;
|
|
}
|
|
.left-area{
|
|
width: 136rpx;
|
|
font-size: 32rpx;
|
|
font-family: PingFang SC, PingFang SC-Bold;
|
|
font-weight: 700;
|
|
text-align: center;
|
|
color: #333333;
|
|
}
|
|
.a4 input{
|
|
line-height: 90rpx;
|
|
padding: 22rpx 0;
|
|
font-size: 32rpx;
|
|
font-family: PingFang SC, PingFang SC-Bold;
|
|
font-weight: 700;
|
|
color: #333333;
|
|
}
|
|
|
|
.a5 {
|
|
width: 556rpx;
|
|
height: 90rpx;
|
|
line-height: 90rpx;
|
|
background: #51d0b4;
|
|
border-radius: 46px;
|
|
|
|
margin: 60rpx auto;
|
|
|
|
font-size: 28rpx;
|
|
font-family: PingFang SC, PingFang SC-Regular;
|
|
font-weight: 400;
|
|
text-align: center;
|
|
color: #ffffff;
|
|
}
|
|
|
|
</style>
|