<template>
|
<div class="loan-info-box">
|
<x-header slot="header"
|
style="width:100%;height:46px;background-color: #ec6758"
|
title="短信验证码"
|
:left-options="{backText: '', preventGoBack:true}"
|
@on-click-back="goBackPage"
|
></x-header>
|
<div class="Code_ls">
|
<h4>请注意查收短信验证码,并完成短信认证。</h4>
|
<span>手机号码</span><span v-text="newPhoneNum">12312</span>
|
</div>
|
<div id="code" class="code_input">
|
<x-input placeholder="请输入短信验证码"
|
:max="6"
|
:min="6"
|
type="text"
|
v-model.trim="checkform.code"
|
>
|
</x-input>
|
<span v-if="codeSecond===-1" @click="getCode">获取验证码</span>
|
<span v-else class="count">{{codeSecond}}秒后重发</span>
|
</div>
|
<div style="height: 20px"></div>
|
<box gap="0 15px">
|
<x-button type="primary" @click.native="handleNextStep">确认贷款</x-button>
|
</box>
|
<div style="height: 20px"></div>
|
</div>
|
</template>
|
|
<script>
|
import {
|
Flow,
|
FlowState,
|
FlowLine,
|
XHeader,
|
Group,
|
GroupTitle,
|
Cell,
|
XInput,
|
Selector,
|
XButton,
|
Box,
|
Actionsheet
|
} from 'vux';
|
|
import FSpace from '../../../components/common/FSpace.vue';
|
import validate from '../../../tool/validator';
|
import SysApi from '../../../api/api'
|
import statusCodeManage from '../../../api/statusCodeManage'
|
|
export default {
|
name: 'messageCode',
|
data() {
|
return {
|
checkform: {
|
code: ''
|
}, // 初始化的用户信息
|
isLastStep: false, // 是否是最后一步
|
activePageItem: 0, // 激活当前页
|
pageList: [], // 一共有几页
|
count: '',
|
newPhoneNum: '',
|
codeSecond: -1,//验证码倒计时
|
|
};
|
},
|
components: {
|
Group,
|
GroupTitle,
|
Cell,
|
XInput,
|
Selector,
|
XHeader,
|
XButton,
|
Box,
|
Flow,
|
FlowState,
|
FlowLine,
|
Actionsheet,
|
FSpace
|
},
|
activated: function () {
|
this.init();
|
this.getCode();
|
},
|
methods: {
|
init() {
|
this.newPhoneNum = sessionStorage.newPhoneNum
|
},
|
//下一步跳转
|
handleNextStep() {
|
if (validate.checkValEmpty(this.checkform.code)) {
|
this.validateTip('请输入验证码');
|
return false;
|
}
|
let _this = this;
|
let checkform = {
|
prodId: this.$route.query.prodId,
|
codeType: 2,
|
code: this.checkform.code
|
};
|
SysApi.checkCode(checkform).then(
|
res => {
|
this.$router.push({
|
path: '/bnd/credit/subSuss', query: {prodId: _this.$route.query.prodId,}
|
});
|
}, error => {
|
statusCodeManage.showTipOfStatusCode(error)
|
}
|
);
|
},
|
|
// 弹窗
|
validateTip(errorMsg) {
|
return this.$vux.toast.show({
|
width: 'auto',
|
type: 'text',
|
text: errorMsg,
|
time: 2000,
|
position: 'middle'
|
});
|
},
|
// 得到选项列表统一的方法
|
getOptionsList(optionList) {
|
let tmpList = [];
|
if (optionList instanceof Array) {
|
optionList.forEach(function (item) {
|
tmpList.push({
|
key: item.code,
|
value: item.name
|
});
|
});
|
}
|
return tmpList;
|
},
|
//返回上一页
|
goBackPage() {
|
// 如果是第一步的话,那么返回到上一个页面
|
if (this.activePageItem <= 1) {
|
this.$router.back();
|
// 不是的话,那么显示上一步
|
} else {
|
this.activePageItem--;
|
this.isLastStep = this.pageList.length === this.activePageItem;
|
}
|
},
|
//验证码倒计时
|
getCode() {
|
this.codeSecond = 60;
|
let timer = setInterval(() => this.codeSecond === -1 ? clearInterval(timer) : this.codeSecond--, 1000);
|
//调用发送验证码接口
|
SysApi.resendCode({codeType: 1, prodId: this.$route.query.prodId}).then(res => {
|
}, err => {
|
statusCodeManage.showTipOfStatusCode(err);
|
this.codeSecond = -1
|
})
|
},
|
|
},
|
|
};
|
</script>
|
|
<style lang="less">
|
@import "../../../style/mixin.less";
|
|
.loan-info-box {
|
background-color: @color-background-default;
|
.vux-header {
|
.color-linear-gradient(@color-primary-light, @color-primary, 90deg);
|
.vux-header-left {
|
.left-arrow:before {
|
border: solid 1px @color-white;
|
border-width: 2px 0 0 2px;
|
}
|
}
|
}
|
.progressState div p {
|
font-size: @font-size-tiny;
|
}
|
.weui-wepay-flow__state {
|
width: 16px;
|
height: 16px;
|
top: -1px;
|
padding-top: 1px;
|
}
|
.currentStep .weui-wepay-flow__state {
|
width: 16px;
|
height: 16px;
|
padding-top: 1px;
|
border: 1px solid @color-primary;
|
color: @color-primary;
|
border-radius: 50%;
|
background-color: @color-white;
|
}
|
.weui-input {
|
height: 28px;
|
line-height: 28px;
|
}
|
.weui-wepay-flow, .weui-wepay-flow-auto {
|
padding: 10px 40px 30px;
|
background: @color-white;
|
}
|
.weui-wepay-flow__li_done .weui-wepay-flow__state,
|
.weui-wepay-flow__process {
|
background-color: @color-primary;
|
}
|
}
|
|
.weui-wepay-flow {
|
background-color: @color-white;
|
}
|
|
.left-arrow:before {
|
border-color: @color-white;
|
}
|
|
.weui-cells__title {
|
margin: 0 !important;
|
font-size: 16PX !important;
|
}
|
|
.weui-input, .weui-cell__bd {
|
font-size: @font-size-base;
|
}
|
|
.weui-label {
|
font-size: @font-size-base;
|
}
|
|
.personInfo ::-webkit-input-placeholder { /* WebKit browsers */
|
color: #bfbfbf;
|
}
|
|
.personInfo :-moz-placeholder { /* Mozilla Firefox 4 to 18 */
|
color: #bfbfbf;
|
}
|
|
.personInfo ::-moz-placeholder { /* Mozilla Firefox 19+ */
|
color: #bfbfbf;
|
}
|
|
.personInfo :-ms-input-placeholder { /* Internet Explorer 10+ */
|
color: #bfbfbf;
|
}
|
|
.header-space {
|
height: 46px;
|
}
|
|
.loan-info-box .weui-cell_select .weui-select {
|
padding-right: 2.5rem;
|
direction: rtl;
|
}
|
|
.loan-info-box .weui-input {
|
text-align: right;
|
}
|
|
.loan-info-box .weui-btn_primary {
|
.color-linear-gradient(@color-primary-light, @color-primary, 90deg);
|
}
|
|
.loan-info-box .weui-btn_primary:not(.weui-btn_disabled):active {
|
color: rgba(255, 255, 255, 0.6);
|
background-color: rgb(241, 95, 79);;
|
}
|
|
/*------------------------------*/
|
.Code_ls {
|
padding: 0.25rem 1.25rem;
|
h4 {
|
padding-bottom: 1.2rem;
|
padding-top: 1rem;
|
font-size: @font-size-medium;
|
font-weight: normal;
|
color: @color-text-primary;
|
}
|
span {
|
color: @color-text-third;
|
display: inline-block;
|
}
|
span:last-child {
|
margin-left: 0.5rem;
|
}
|
}
|
|
.vux-no-group-title {
|
margin-top: 0.77rem !important;
|
}
|
|
.loan-info-box .currentStep .weui-wepay-flow__state {
|
background-color: @color-primary;
|
color: @color-white !important;
|
line-height: 1rem;
|
}
|
|
.weui-wepay-flow__li.weui-wepay-flow__li .weui-wepay-flow__state {
|
width: 1.33333rem;
|
height: 1.33333rem;
|
border-radius: 1.58333rem;
|
color: @color-text-third;
|
line-height: 1.33333rem;
|
}
|
|
.loan-info-box .weui-input {
|
text-align: left;
|
}
|
|
.porcolor p {
|
color: @color-primary;
|
}
|
|
#code.code_input {
|
padding: 1rem 1.25rem;
|
background-color: @color-white !important;
|
font-size: @font-size-medium;
|
overflow: hidden;
|
.weui-cell {
|
margin: 0px;
|
padding: 0px;
|
width: 69%;
|
float: left;
|
.weui-cell__bd {
|
width: 70%;
|
display: inline-block;
|
}
|
.weui-cell__ft {
|
display: inline-block;
|
}
|
}
|
input {
|
border: none;
|
width: 100%;
|
text-align: left !important;
|
outline: none;
|
font-size: @font-size-medium;
|
}
|
span {
|
display: inline-block;
|
font-size: @font-size-medium;
|
color: @color-text-third;
|
padding: 0.25rem 0;
|
border-left: 1px solid @color-text-third;
|
text-align: center;
|
width: 30%;
|
float: left;
|
}
|
|
}
|
|
.weui-cell__ft button {
|
background-color: @color-white !important;
|
}
|
|
.weui-btn:after {
|
border: none !important;
|
}
|
|
.weui-btn {
|
font-size: @font-size-primary !important;
|
}
|
</style>
|