Commit 902f40de by 梁建民

login

parent 4179e221
......@@ -198,8 +198,6 @@ body { overflow-x: hidden; }
.layui-laypage a:hover { color: #1080d0 !important; }
.layui-laypage .layui-laypage-curr .layui-laypage-em:hover { background-color: #0A66C1 !important; cursor: pointer; }
.liexin-layer { padding: 20px; }
.liexin-layer .shop-list { width: 100%; border-collapse: collapse; }
.liexin-layer .shop-list tr th { height: 35px; line-height: 35px; background-color: #f6f6f6; border-bottom: 1px solid #e5e5e5; border-top: 1px solid #e5e5e5; text-align: left; font-weight: normal; }
......@@ -258,4 +256,68 @@ body { overflow-x: hidden; }
.lx-findpwd-content .lx-findpwd-wrap .step-box .done .t2 a { width: 72px; height: 30px; background-color: #1080d0; border-radius: 3px; border: solid 1px #1080d0; color: #ffffff; font-size: 14px; line-height: 30px; text-align: center; margin-left: 6px; }
.lx-findpwd-content .lx-findpwd-wrap .step-box .done .t2 a:hover { background: #0A66C1; }
.layui-laypage .layui-laypage-curr .layui-laypage-em:hover { background-color: #0A66C1 !important; cursor: pointer; }
#footer { background: #fff; min-width: 1190px; }
.foot-one { padding: 25px 0; border-bottom: 1px solid #e5e5e5; }
.foot-one dl { float: left; width: 297px; }
.foot-one dt { float: left; margin-right: 10px; }
.foot-one dt i { display: block; width: 80px; height: 80px; background-size: 100% 100%; background-position: center center; }
.foot-one dd { width: 207px; float: left; line-height: 24px; }
.foot-one dd h4 { font-size: 14px; padding-bottom: 12px; font-weight: bold; }
.foot-one dd p { font-size: 12px; }
.foot-two { padding: 30px 0; border-bottom: 1px solid #e5e5e5; overflow: hidden; }
.foot-two dl { width: 150px; height: 125px; padding: 0 35px 0 35px; margin: 30px 0 0 -1px; float: left; }
.foot-two dt { font-size: 14px; line-height: 36px; height: 36px; margin-top: -36px; padding-bottom: 5px; font-weight: bold; color: #666666; }
.foot-two dd { line-height: 20px; color: #666666; }
.foot-two dd a { font-size: 12px; }
.foot-two .saoma_box { width: 310px; height: 145px; float: left; border-left: 1px solid #e5e5e5; }
.foot-two .saoma_box .saoma_bottom_img { display: block; width: 119px; height: 119px; margin: 0 auto; }
.foot-two .saoma_box .saoma_text { height: 24px; text-align: center; font-family: "Microsoft Yahei"; font-size: 14px; line-height: 24px; color: #666666; }
.foot-three { font-size: 12px; padding-top: 20px; }
.foot-three p { color: #747474; text-align: center; line-height: 26px; }
.foot-three .string { overflow: hidden; display: inline-block; width: 1px; height: 8px; background-color: #ccc; }
.foot-three p span { margin-right: 20px; }
.foot-three p a { margin-right: 20px; }
.foot-three ul { text-align: center; padding: 20px 0; margin: 0 auto; width: 860px; }
.foot-three li { padding: 0 5px; display: inline-block; width: 133px; float: left; }
.foot-three li img { display: block; }
.foot-seo { padding: 15px 0; border-bottom: 1px solid #e5e5e5; }
.foot-seo dl { line-height: 22px; }
.foot-seo dt { width: 65px; float: left; font-size: 12px; }
.foot-seo dd { width: 1125px; float: left; color: #999999; overflow: hidden; }
.foot-seo dd a { display: inline-block; width: 110px; color: #999999; margin-right: 15px; font-family: "Microsoft Yahei"; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foot-seo dd a:hover { color: #1080d0; }
.foot-seo dd.zimu a { margin-right: 17px; width: auto; }
/*# sourceMappingURL=style.min.css.map */
......@@ -700,11 +700,6 @@
color: #1080d0 !important;
}
.layui-laypage .layui-laypage-curr .layui-laypage-em:hover {
background-color: #0A66C1 !important;
cursor: pointer;
}
.liexin-layer {
padding: 20px;
.shop-list {
......@@ -1007,10 +1002,198 @@
}
}
.layui-laypage .layui-laypage-curr .layui-laypage-em:hover {
background-color: #0A66C1 !important;
cursor: pointer;
}
#footer {
background: #fff;
min-width: 1190px;
}
.foot-one {
padding: 25px 0;
border-bottom: 1px solid #e5e5e5;
}
.foot-one dl {
float: left;
width: 297px;
}
.foot-one dt {
float: left;
margin-right: 10px;
}
.foot-one dt i {
display: block;
width: 80px;
height: 80px;
background-size: 100% 100%;
background-position: center center;
}
.foot-one dd {
width: 207px;
float: left;
line-height: 24px;
}
.foot-one dd h4 {
font-size: 14px;
padding-bottom: 12px;
font-weight: bold;
}
.foot-one dd p {
font-size: 12px;
}
.foot-two {
padding: 30px 0;
border-bottom: 1px solid #e5e5e5;
overflow: hidden;
}
.foot-two dl {
width: 150px;
height: 125px;
padding: 0 35px 0 35px;
margin: 30px 0 0 -1px;
float: left;
}
.foot-two dt {
font-size: 14px;
line-height: 36px;
height: 36px;
margin-top: -36px;
padding-bottom: 5px;
font-weight: bold;
color: #666666;
}
.foot-two dd {
line-height: 20px;
color: #666666;
}
.foot-two dd a {
font-size: 12px;
}
.foot-two .saoma_box {
width: 310px;
height: 145px;
float: left;
border-left: 1px solid #e5e5e5;
}
.foot-two .saoma_box .saoma_bottom_img {
display: block;
width: 119px;
height: 119px;
margin: 0 auto;
}
.foot-two .saoma_box .saoma_text {
height: 24px;
text-align: center;
font-family: "Microsoft Yahei";
font-size: 14px;
line-height: 24px;
color: #666666;
}
.foot-three {
font-size: 12px;
padding-top: 20px;
}
.foot-three p {
color: #747474;
text-align: center;
line-height: 26px;
}
.foot-three .string {
overflow: hidden;
display: inline-block;
width: 1px;
height: 8px;
background-color: #ccc;
}
.foot-three p span {
margin-right: 20px;
}
.foot-three p a {
margin-right: 20px;
}
.foot-three ul {
text-align: center;
padding: 20px 0;
margin: 0 auto;
width: 860px;
}
.foot-three li {
padding: 0 5px;
display: inline-block;
width: 133px;
float: left;
}
.foot-three li img {
display: block;
}
.foot-seo {
padding: 15px 0;
border-bottom: 1px solid #e5e5e5;
}
.foot-seo dl {
line-height: 22px;
}
.foot-seo dt {
width: 65px;
float: left;
font-size: 12px;
}
.foot-seo dd {
width: 1125px;
float: left;
color: #999999;
overflow: hidden;
}
.foot-seo dd a {
display: inline-block;
width: 110px;
color: #999999;
margin-right: 15px;
font-family: "Microsoft Yahei";
font-size: 12px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.foot-seo dd a:hover {
color: #1080d0;
}
.foot-seo dd.zimu a {
margin-right: 17px;
width: auto;
}
......
;!function () {
window.loginController = {
init: function () {
this.handleBind(this);
},
getUserName: function () {
var val = $("input[name='username']").val();
if (val) {
return val;
}
return false;
},
getPasswd: function () {
var val = $("input[name='pwd']").val();
if (val) {
return val;
}
return false;
},
getCode: function () {
var val = $("input[name='code']").val();
if (val) {
return val;
}
return false;
},
getData: function (params,callback) {
$.ajax({
url: _URL_ + '/api/ApiLogin',
type: 'post',
data: params,
async: false,
dataType: 'json',
timeout: 10000,
success: function (res) {
typeof callback == 'function' && callback(res);
/* if (resp.code > 0) {
alert(resp.msg)
} else {
setCookie('yunxin_token', resp.data)
window.location.href = "/web/orderList"
}*/
}
})
},
calcForm: function (opt) {
if (!opt.getUserName()) {
$(".error").show().text('请输入手机号/邮箱/企业用户名');
return false;
}
if (!opt.getPasswd()) {
$(".error").show().text('请输入登录密码');
return false;
}
if (!opt.getCode()) {
$(".error").show().text('请输入验证码');
return false;
}
$(".error").hide().text('');
return true;
},
handleBind: function (opt) {
//提交
$("#submit").on('click', function () {
if (opt.calcForm(opt)) {
opt.getData(function (res) {
console.log(res)
});
}
});
$("input[name='username']").on('blur', function () {
opt.calcForm(opt);
});
$("input[name='pwd']").on('blur', function () {
opt.calcForm(opt);
});
$("input[name='code']").on('blur', function () {
opt.calcForm(opt);
});
return this;
},
}, $(function () {
loginController.init();
})
}();
/**
* Created by hcy on 2019/2/19.
*/
......@@ -5,37 +99,37 @@ var _URL_ = "http://yunxin.liexin.com";
function login() {
$.ajax({
url:_URL_+'/api/ApiLogin',
type:'post',
data:{
'mobile':$("#mobile").val(),
'password':$.md5($("#password").val()),
url: _URL_ + '/api/ApiLogin',
type: 'post',
data: {
'mobile': $("#mobile").val(),
'password': $.md5($("#password").val()),
'code': $("#code").val()
},
async: false,
dataType:'json',
timeout:10000,
success:function (resp) {
if(resp.code > 0 ){
dataType: 'json',
timeout: 10000,
success: function (resp) {
if (resp.code > 0) {
alert(resp.msg)
}else{
setCookie('yunxin_token',resp.data)
} else {
setCookie('yunxin_token', resp.data)
window.location.href = "/web/orderList"
}
}
})
}
function setCookie(name,value){
function setCookie(name, value) {
var Days = 30;
var exp = new Date();
exp.setTime(exp.getTime() + Days*24*60*60*30);
document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 30);
document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString();
}
function getCookie(name){
var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
if(arr=document.cookie.match(reg))
function getCookie(name) {
var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
if (arr = document.cookie.match(reg))
return unescape(arr[2]);
else
return null;
......
......@@ -28,3 +28,80 @@
liexinController.init();
})
}();
(function (window) {
Util = {
/**
* 设置cookie
* @param name
* @param value
* @param time
* @param domain
* @returns {boolean}
*/
setCookie: function (name, value, time, domain) {
domain = domain ? ";domain=" + domain : "";
var Days = time;
var exp = new Date();
exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
document.cookie = name + "=" + encodeURIComponent(value) + ";expires=" + exp.toGMTString() + ";path=/" + domain;
return true;
},
/**
* 获取cookie
* @param name
* @returns {*}
*/
getCookie: function (name) {
var strCookie = document.cookie;
var arrCookie = strCookie.split("; ");
for (var i = 0; i < arrCookie.length; i++) {
var arr = arrCookie[i].split("=");
if (name == arr[0]) {
return arr[1];
}
}
return "";
},
/**
* 删除cookie
* @param name
*/
delCookie: function (name) {
var exp = new Date();
exp.setTime(exp.getTime() - 1);
var cval = getCookie(name);
if (cval != null) document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString();
},
/**
* 获取参数
* @param value
* @returns {*}
*/
getRequest: function (value) {
if (window.location.pathname == "/s/") {
var url = unescape(location.search);
} else {
var url = decodeURI(location.search);
}
var object = {};
if (url.indexOf("?") != -1) {
var str = url.substr(1);
var strs = str.split("&");
for (var i = 0; i < strs.length; i++) {
object[strs[i].split("=")[0]] = strs[i].split("=")[1]
}
}
return object[value];
}
};
if (typeof define === "function" && define.amd) {
return Util;
} else {
window.Util = Util;
}
})(window);
var _URL_ = "http://yunxin.liexin.com";
......@@ -10,8 +10,8 @@
<title>欢迎使用云芯系统</title>
<script>document.domain="{{ Config::get('website.domain') }}";</script>
<link rel="stylesheet" type="text/css" href="/pc/font/iconfont.css">
<link rel="stylesheet" type="text/css" href="/pc/css/style.min.css">
<link rel="stylesheet" type="text/css" href="/pc/js/layui/css/layui.css">
<link rel="stylesheet" type="text/css" href="/pc/css/style.min.css">
</head>
<body>
<!--头部-->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment