160 lines
4.9 KiB
HTML
160 lines
4.9 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">
|
|
<meta http-equiv="Cache" content="no-cache">
|
|
<meta http-equiv="Pragma" content="no-cache">
|
|
<meta http-equiv="Cache-Control" content="no-cache">
|
|
<meta http-equiv="Expires" content="0">
|
|
<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" v-show="!isLoading" style="display: none">
|
|
<section class="form-horizontal" style="padding-top: 200px">
|
|
<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="loginByPhone">手机号登录</a>
|
|
<p style="padding-top: 10px; color: #d3d3d3;"></p>
|
|
</article>
|
|
|
|
<agent-nav></agent-nav>
|
|
</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 src="./components/agent-nav.js?__HTML_VERSION__=8"></script>
|
|
<script src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
|
|
<script>
|
|
new Vue(
|
|
{
|
|
el: "#app",
|
|
components: {
|
|
'agent-nav': agentNav
|
|
},
|
|
data: {
|
|
isLoading: true,
|
|
isWeiXin: false,
|
|
disabled: false,
|
|
phone: '',
|
|
captcha: '',
|
|
btnMsg: '发送验证码',
|
|
params: {},
|
|
agentInfo: {},
|
|
managePage: './Charge_card.html'
|
|
},
|
|
methods: {
|
|
/**
|
|
* 发送手机验证码
|
|
*/
|
|
getCheckCode: function (r) {
|
|
var that = this;
|
|
|
|
$.api(
|
|
"sales.sales.captchaLogin",
|
|
{
|
|
agentid: this.params.agentid,
|
|
channelid: this.params.channelid,
|
|
phone: this.phone
|
|
},
|
|
function (res) {
|
|
|
|
that.disabled = true;
|
|
that.timeout(60);
|
|
|
|
}.bind(this), true
|
|
);
|
|
},
|
|
loginByPhone: function () {
|
|
try {
|
|
var that = this;
|
|
|
|
if (!$.isMobile(this.phone)) throw '请输入正确的手机号';
|
|
|
|
if (!this.captcha) throw '请输入验证码';
|
|
|
|
$.api(
|
|
'sales.sales.loginByPhone',
|
|
{
|
|
agentid: that.params.agentid,
|
|
channelid: that.params.channelid,
|
|
phone: that.phone,
|
|
captcha: that.captcha,
|
|
type: 2
|
|
},
|
|
function (userInfo) {
|
|
try {
|
|
sessionStorage.setItem('salesid', userInfo.salesid);
|
|
sessionStorage.setItem('password', userInfo.ppp);
|
|
sessionStorage.setItem('wxInfo', JSON.stringify(userInfo));
|
|
sessionStorage.setItem('userInfo', JSON.stringify(userInfo));
|
|
|
|
var fromUrl = sessionStorage.getItem('fromUrl');
|
|
if(fromUrl) {
|
|
sessionStorage.removeItem('fromUrl');
|
|
window.location.href = fromUrl;
|
|
}
|
|
else
|
|
window.location.href = that.managePage + '?agentid=' + that.params.agentid + '&channelid=' + that.params.channelid;
|
|
} catch (e) {
|
|
$.alert(e)
|
|
}
|
|
}, 1
|
|
);
|
|
} catch (e) {
|
|
$.alert(e)
|
|
}
|
|
},
|
|
/**
|
|
* 发送验证码后的倒计时
|
|
* @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;
|
|
}
|
|
}
|
|
},
|
|
created: function () {
|
|
var that = this;
|
|
this.isWeiXin=$.isWeiXin();
|
|
$.getAgentInfo(function (agentInfo) {
|
|
that.agentInfo = agentInfo;
|
|
that.params = $.getQueryObj();
|
|
that.isLoading = false;
|
|
})
|
|
|
|
}
|
|
})
|
|
</script>
|
|
</body>
|
|
</html> |