186 lines
7.1 KiB
HTML
186 lines
7.1 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" v-show="!isLoading" style="display: none">
|
|
<section>
|
|
<div class="logins">
|
|
<input type="number" placeholder="ID/手机号" id="salesid" class="login-input" v-model="salesid">
|
|
<input type="password" placeholder="请输入密码" id="password" class="login-input" v-model="password">
|
|
<div class="row cwdaili" v-if="false" style="font-size: 16px; font-weight: 700; padding-left: 20px; padding-right: 20px;">
|
|
<div class="col-xs-6">
|
|
<a :href="becomeSalesLink" v-if="isWeiXin">微信注册</a>
|
|
</div>
|
|
<div class="col-xs-6 text-right">
|
|
<a :href="becomeSalesLinkPhone">手机注册</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<article class="text-center">
|
|
<a href="javascript:;" type="button" class="logbtn zhbtn" @click="loginByPassword">账号登录</a>
|
|
<a href="javascript:;" type="button" class="logbtn wxbtn" @click="loginByWechat" v-show="isWeiXin">微信登录</a>
|
|
<p style="padding-top: 10px; color: #d3d3d3;"></p>
|
|
</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-a.js?__HTML_VERSION__=10"></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",
|
|
data: {
|
|
isLoading: true,
|
|
isWeiXin: false,
|
|
salesid: '',
|
|
password: '',
|
|
params: {},
|
|
agentInfo: {},
|
|
managePage: './your_purchase.html'
|
|
},
|
|
computed: {
|
|
becomeSalesLink: function () {
|
|
if (this.agentInfo.html_applysales && parseInt(this.agentInfo.html_applysales) === 2) {
|
|
return './become_sales_free.html?agentid=' + this.params.agentid + '&channelid=' + this.params.channelid;
|
|
} else {
|
|
return './become_sales.html?agentid=' + this.params.agentid + '&channelid=' + this.params.channelid;
|
|
}
|
|
},
|
|
becomeSalesLinkPhone: function () {
|
|
if (this.agentInfo.html_applysales && parseInt(this.agentInfo.html_applysales) === 2) {
|
|
return './become_sales_free_phone.html?agentid=' + this.params.agentid + '&channelid=' + this.params.channelid;
|
|
} else {
|
|
return './become_sales_phone.html?agentid=' + this.params.agentid + '&channelid=' + this.params.channelid;
|
|
}
|
|
},
|
|
loginByPhoneUrl: function () {
|
|
return './manage_login_phone.html?agentid=' + this.params.agentid + '&channelid=' + this.params.channelid;
|
|
}
|
|
},
|
|
methods: {
|
|
loginByWechat: function () {
|
|
var that = this;
|
|
sessionStorage.setItem('wxLogin', 'yes');
|
|
sessionStorage.removeItem('salesid');
|
|
sessionStorage.removeItem('password');
|
|
sessionStorage.removeItem('wxInfo');
|
|
$.getUserInfoFirst(function (userInfo) {
|
|
|
|
try {
|
|
if (userInfo.sausstatus && parseInt(userInfo.sausstatus) !== 0) throw '对不起,你的账号已被账号冻结';
|
|
|
|
//if (userInfo.salesman && parseInt(userInfo.salesman) !== 1) throw '对不起,你还不是代理,请先成为代理。';
|
|
|
|
//if (userInfo.salesman && parseInt(userInfo.salesman) === 1) {
|
|
sessionStorage.setItem('wxLogin', 'no');
|
|
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;
|
|
//} else {
|
|
//throw '获取用户信息错误';
|
|
//}
|
|
} catch (e) {
|
|
$.alert(e);
|
|
}
|
|
}, 1)
|
|
},
|
|
loginByPassword: function () {
|
|
try {
|
|
var that = this;
|
|
|
|
if (!$.isRightId(this.salesid)) throw '请输入正确的ID';
|
|
|
|
if (!this.password) throw '请输入密码';
|
|
|
|
$.api(
|
|
'agent.user.login',
|
|
{
|
|
agentid: that.params.agentid,
|
|
channelid: that.params.channelid,
|
|
salesid: that.salesid,
|
|
password: that.password,
|
|
type: 1,
|
|
islog: 1
|
|
},
|
|
function (userInfo) {
|
|
try {
|
|
if (userInfo.sausstatus && parseInt(userInfo.sausstatus) !== 0) throw '对不起,你的账号已被账号冻结';
|
|
|
|
//if (userInfo.salesman && parseInt(userInfo.salesman) !== 1) throw '对不起,你还没有代理身份';
|
|
|
|
//if (userInfo.salesman && parseInt(userInfo.salesman) === 1) {
|
|
localStorage.setItem('salesid', that.salesid);
|
|
sessionStorage.setItem('salesid', that.salesid);
|
|
localStorage.setItem('password', that.password);
|
|
sessionStorage.setItem('password', that.password);
|
|
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;
|
|
//} else {
|
|
//} else {
|
|
// throw '获取用户信息错误';
|
|
//}
|
|
} catch (e) {
|
|
$.alert(e)
|
|
}
|
|
}, 1
|
|
);
|
|
} catch (e) {
|
|
$.alert(e)
|
|
}
|
|
}
|
|
},
|
|
created: function () {
|
|
var that = this;
|
|
this.isWeiXin=$.isWeiXin();
|
|
$.getAgentInfo(function (agentInfo) {
|
|
that.agentInfo = agentInfo;
|
|
that.params = $.getQueryObj();
|
|
var isWxLogin = sessionStorage.getItem('wxLogin');
|
|
that.isLoading = false;
|
|
if(isWxLogin === 'yes') {
|
|
that.loginByWechat();
|
|
} else {
|
|
that.salesid = localStorage.getItem('salesid');
|
|
that.password = localStorage.getItem('password');
|
|
}
|
|
})
|
|
|
|
}
|
|
})
|
|
</script>
|
|
</body>
|
|
</html> |