149 lines
4.3 KiB
HTML
149 lines
4.3 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<title>绑定手机</title>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
|
|
<link rel="stylesheet" href="css/login.css?__HTML_VERSION__=3">
|
|
<link rel="stylesheet" href="./libs/bootstrap/bootstrap.min.css?__HTML_VERSION__=3">
|
|
<link rel="stylesheet" href="./libs/font-awesome.min.css?__HTML_VERSION__=3">
|
|
<link rel="stylesheet" href="./css/common.css?__HTML_VERSION__=7">
|
|
</head>
|
|
<body>
|
|
<div id="app" class="container">
|
|
<section class="form-horizontal" style="padding-top: 200px">
|
|
<p>因实名制要求,请尽快绑定手机号。</p>
|
|
<div class="form-group">
|
|
<div class="col-xs-8">
|
|
<input type="number" placeholder="手机号" class="form-control" v-model="phone">
|
|
</div>
|
|
<div class="col-xs-4 text-right pl0">
|
|
<button class="btn zhbtn" @click="getCheckCode" :disabled="disabled" style="margin-top: 0; width: 100%; color: #fff;">{{btnMsg}}</button>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<div class="col-xs-12">
|
|
<input type="number" placeholder="请输入验证码" class="form-control" v-model="captcha">
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<article class="text-center">
|
|
<a href="javascript:;" type="button" class="logbtn zhbtn" @click="bindPhone">绑定</a>
|
|
</article>
|
|
|
|
</div>
|
|
|
|
|
|
<script src="./libs/jquery.min.js?__HTML_VERSION__=3"></script>
|
|
<script src="./libs/vue.min.js?__HTML_VERSION__=3"></script>
|
|
<script src="./libs/layer_mobile/layer.js?__HTML_VERSION__=3"></script>
|
|
<script src="./js/function.js?__HTML_VERSION__=18"></script>
|
|
<script>
|
|
new Vue(
|
|
{
|
|
el: "#app",
|
|
data: {
|
|
isLoading: true,
|
|
isWeiXin: false,
|
|
disabled: false,
|
|
phone: '',
|
|
captcha: '',
|
|
btnMsg: '发送验证码',
|
|
params: {},
|
|
myInfo: {},
|
|
agentInfo: {}
|
|
},
|
|
methods: {
|
|
/**
|
|
* 发送手机验证码
|
|
*/
|
|
getCheckCode: function (r) {
|
|
var that = this;
|
|
|
|
if(!$.isMobile(that.phone)) {
|
|
$.alert("请输入正确的手机号");
|
|
return;
|
|
}
|
|
|
|
$.api(
|
|
"sms.sms.sendBindCode",
|
|
{
|
|
agentid: this.params.agentid,
|
|
channelid: this.params.channelid,
|
|
salesid: this.myInfo.salesid,
|
|
isbind: 0,
|
|
phone: this.phone
|
|
},
|
|
function (res) {
|
|
|
|
that.disabled = true;
|
|
that.timeout(60);
|
|
|
|
}.bind(this), 1
|
|
);
|
|
},
|
|
/**
|
|
* 发送验证码后的倒计时
|
|
* @param time 倒计时的时间(单位:秒)
|
|
*/
|
|
timeout: function (time) {
|
|
time--;
|
|
if(time > 0) {
|
|
this.btnMsg=time;
|
|
var that = this;
|
|
setTimeout(function () {
|
|
that.timeout(time);
|
|
}, 1000);
|
|
} else {
|
|
this.btnMsg='发送验证码';
|
|
this.disabled = false;
|
|
}
|
|
},
|
|
bindPhone: function () {
|
|
var that = this;
|
|
|
|
var param = {
|
|
agentid: this.params.agentid,
|
|
channelid: this.params.channelid,
|
|
salesid: this.myInfo.salesid,
|
|
phone: this.phone,
|
|
msgcode: this.captcha
|
|
};
|
|
|
|
$.api(
|
|
"sms.sms.bindPhone",
|
|
param,
|
|
function (res) {
|
|
that.myInfo.is_bind = 1;
|
|
sessionStorage.setItem("userInfo", JSON.stringify(that.myInfo));
|
|
layer.open({
|
|
content: '绑定成功',
|
|
btn: '我知道了',
|
|
yes: function (i) {
|
|
window.location.href='Charge_card.html?agentid='+that.params.agentid+'&channelid='+that.params.channelid;
|
|
}
|
|
});
|
|
}, 1
|
|
);
|
|
}
|
|
},
|
|
created: function () {
|
|
var that = this;
|
|
this.isWeiXin=$.isWeiXin();
|
|
$.getAgentInfo(function (agentInfo) {
|
|
that.agentInfo = agentInfo;
|
|
that.params = $.getQueryObj();
|
|
|
|
$.getUserInfo(function (r) {
|
|
that.myInfo = r;
|
|
that.isLoading = false;
|
|
});
|
|
|
|
})
|
|
|
|
}
|
|
})
|
|
</script>
|
|
</body>
|
|
</html> |