Commit fd340ce7 zxt@theyeasy.com
2 个父辈 ec3e3a9b 0cdfc316
...@@ -58,24 +58,7 @@ ...@@ -58,24 +58,7 @@
keyword: null keyword: null
}; };
initData(queryObj); //初始化方法
//查询
form.on('submit(querybtn)', function(data) {
queryObj.keyword = $("[name=keyword]").val();
queryObj.page = 1;
initData(queryObj)
});
$(".resetBtn").on("click", function() {
$("[name=keyword]").val("")
queryObj.page = 1;
queryObj.keyword = null;
initData(queryObj)
return false
})
//初始化数据
initData(queryObj);
function initData(queryObj) { function initData(queryObj) {
$.get("/zzhnc/article/getArticlesList", queryObj, function(data) { $.get("/zzhnc/article/getArticlesList", queryObj, function(data) {
var data = data.data; var data = data.data;
...@@ -101,24 +84,42 @@ ...@@ -101,24 +84,42 @@
$("#tablelist").html(str); $("#tablelist").html(str);
form.render(); form.render();
toNull_G(); toNull_G();
laypage.render({
elem: 'page',
count: data.total,
limit: queryObj.pagesize,
curr: queryObj.page,
skip: true,
jump: function(obj, first) {
if(!first) {
queryObj.page = obj.curr
initData(queryObj);
}
}
})
} }
laypage.render({
elem: 'page',
count: data.total,
limit: queryObj.pagesize,
curr: queryObj.page,
layout: ['count', 'prev', 'page', 'next', 'skip'],
jump: function(obj, first) {
if(!first) {
queryObj.page = obj.curr
initData(queryObj);
}
}
})
}) })
} }
//初始化数据
initData(queryObj);
//查询
form.on('submit(querybtn)', function(data) {
queryObj.keyword = $("[name=keyword]").val();
queryObj.page = 1;
initData(queryObj)
});
//重置
$(".resetBtn").on("click", function() {
$("[name=keyword]").val("")
queryObj.page = 1;
queryObj.keyword = null;
initData(queryObj)
return false
})
//添加文章 //添加文章
$(document).on("click", ".createBtn", function() { $(document).on("click", ".createBtn", function() {
if(parent.tab.exists("添加文章") > 0) { if(parent.tab.exists("添加文章") > 0) {
...@@ -131,6 +132,7 @@ ...@@ -131,6 +132,7 @@
title: "添加文章" title: "添加文章"
}); });
}) })
//修改文章 //修改文章
$(document).on("click", ".updataBtn", function() { $(document).on("click", ".updataBtn", function() {
var id = $(this).parents("tr").attr("data-id"); var id = $(this).parents("tr").attr("data-id");
...@@ -144,6 +146,7 @@ ...@@ -144,6 +146,7 @@
title: "修改文章" title: "修改文章"
}); });
}) })
//删除文章 //删除文章
$(document).on("click", ".deleteBtn", function() { $(document).on("click", ".deleteBtn", function() {
var id = $(this).parents("tr").attr("data-id"); var id = $(this).parents("tr").attr("data-id");
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="keywords" lay-verify="required" placeholder="关键词" class="layui-input"> <input type="text" name="keywords" lay-verify="required" placeholder="关键词" class="layui-input">
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label"></label> <label class="layui-form-label"></label>
...@@ -78,12 +78,13 @@ ...@@ -78,12 +78,13 @@
size: 10, size: 10,
keyword: null keyword: null
} }
//页面初始化 //页面初始化
function initdata(queryObj) { function initdata(queryObj) {
$.get("/zzhnc/autoreply/getAutoreplyList", queryObj, function(data) { $.get("/zzhnc/autoreply/getAutoreplyList", queryObj, function(data) {
var data = data.data; var data = data.data;
console.log(data) console.log(data)
$("#tablelist").html("");
if(data.rows.length < 1) { if(data.rows.length < 1) {
$(".nodata").show(); $(".nodata").show();
} else { } else {
...@@ -103,23 +104,23 @@ ...@@ -103,23 +104,23 @@
$("#tablelist").html(str); $("#tablelist").html(str);
form.render(); form.render();
toNull_G(); toNull_G();
laypage.render({
elem: 'page',
count: data.total,
limit: queryObj.size,
curr: queryObj.page,
skip: true,
jump: function(obj, first) {
if(!first) {
queryObj.page = obj.curr
initdata(queryObj);
}
}
})
} }
laypage.render({
elem: 'page',
count: data.total,
limit: queryObj.size,
curr: queryObj.page,
layout: ['count', 'prev', 'page', 'next', 'skip'],
jump: function(obj, first) {
if(!first) {
queryObj.page = obj.curr
initdata(queryObj);
}
}
})
}) })
} }
//初始化数据 //初始化数据
initdata(queryObj); initdata(queryObj);
...@@ -150,7 +151,7 @@ ...@@ -150,7 +151,7 @@
} }
}) })
}) })
//添加关键字 //添加关键字
$(document).on("click", ".createBtn", function() { $(document).on("click", ".createBtn", function() {
layer.open({ layer.open({
...@@ -232,7 +233,7 @@ ...@@ -232,7 +233,7 @@
}); });
form.render(); form.render();
}, },
success: function(){ success: function() {
$.get("/zzhnc/autoreply/getAutoReply", { $.get("/zzhnc/autoreply/getAutoReply", {
id: id id: id
}, function(data) { }, function(data) {
......
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
'<td>' + data.rows[i].sellerName + '</td>' + '<td>' + data.rows[i].sellerName + '</td>' +
'<td>' + data.rows[i].sellerAddress + '</td>' + '<td>' + data.rows[i].sellerAddress + '</td>' +
'<td>' + data.rows[i].sellerPhone + '</td>' + '<td>' + data.rows[i].sellerPhone + '</td>' +
'<td>' + isHome(data.rows[i].isHome) +'</td>' + '<td>' + isHome(data.rows[i].isHome) + '</td>' +
'<td><a href="#" class="layui-btn layui-btn-sm updataBtn">修改</a>' + '<td><a href="#" class="layui-btn layui-btn-sm updataBtn">修改</a>' +
'<a href="#" class="layui-btn layui-btn-sm deleteBtn">删除</a>' + '<a href="#" class="layui-btn layui-btn-sm deleteBtn">删除</a>' +
'</td>' + '</td>' +
...@@ -96,20 +96,20 @@ ...@@ -96,20 +96,20 @@
$("#tablelist").html(str); $("#tablelist").html(str);
form.render(); form.render();
toNull_G(); toNull_G();
laypage.render({
elem: 'page',
count: data.total,
limit: queryObj.size,
curr: queryObj.page,
skip: true,
jump: function(obj, first) {
if(!first) {
queryObj.page = obj.curr
initData(queryObj);
}
}
})
} }
laypage.render({
elem: 'page',
count: data.total,
limit: queryObj.size,
curr: queryObj.page,
layout: ['count', 'prev', 'page', 'next', 'skip'],
jump: function(obj, first) {
if(!first) {
queryObj.page = obj.curr
initData(queryObj);
}
}
})
}) })
} }
...@@ -183,10 +183,11 @@ ...@@ -183,10 +183,11 @@
}); });
}); });
function isHome(v){ //是否在首页显示的bool值转为是或否
if(v){ function isHome(v) {
if(v) {
v = "是" v = "是"
}else{ } else {
v = "否" v = "否"
} }
return v; return v;
......
...@@ -333,7 +333,7 @@ ...@@ -333,7 +333,7 @@
console.log(data) console.log(data)
if(data.code == 0) { if(data.code == 0) {
//基本信息 //基本信息
$("[name=beginTime]").val(toTime_G(data.data.beginTime)); $("[name=beginTime]").val(data.data.beginTime);
$("[name=status]").val(data.data.status); $("[name=status]").val(data.data.status);
$("[name=turn]").val(data.data.turn); $("[name=turn]").val(data.data.turn);
$("[name=planMny]").val(data.data.planMny); $("[name=planMny]").val(data.data.planMny);
...@@ -461,7 +461,7 @@ ...@@ -461,7 +461,7 @@
} }
var submitData = { var submitData = {
//beginTime: e.field.beginTime, beginTime: e.field.beginTime,
status: e.field.status, status: e.field.status,
turn: e.field.turn, turn: e.field.turn,
planMny: e.field.planMny, planMny: e.field.planMny,
...@@ -509,14 +509,14 @@ ...@@ -509,14 +509,14 @@
}, function(data) { }, function(data) {
console.log(data); console.log(data);
if(data.code == 0) { if(data.code == 0) {
top.layer.msg("开启活动成功"); layer.msg("开启活动成功");
} else { } else {
top.layer.msg(data.msg); layer.msg(data.msg);
} }
}) })
} else { } else {
top.layer.msg("只有未开启的活动才可以开启"); layer.msg("只有未开启的活动才可以开启");
} }
}); });
...@@ -529,35 +529,31 @@ ...@@ -529,35 +529,31 @@
}, function(data) { }, function(data) {
console.log(data); console.log(data);
if(data.code == 0) { if(data.code == 0) {
top.layer.msg("设置活动结束成功"); layer.msg("设置活动结束成功");
} else { } else {
top.layer.msg(data.msg); layer.msg(data.msg);
} }
}) })
} else { } else {
top.layer.msg("只有进行中的活动可以结束"); layer.msg("只有进行中的活动可以结束");
} }
}); });
//设置下一轮 //设置下一轮
form.on('submit(nextround)', function(e) { form.on('submit(nextround)', function(e) {
var status = $("select[name=status]").val(); var status = $("select[name=status]").val();
if(status == "3") { if(status == "3") {
$.post("/zzhnc/activity/clearActivity", function(data) { $.get("/zzhnc/activity/clearActivity", function(data) {
console.log(data); console.log(data);
if(data.code == 0) { if(data.code == 0) {
top.layer.msg("开启下一轮成功"); layer.msg("开启下一轮成功");
} else { } else {
top.layer.msg(data.msg); layer.msg(data.msg);
} }
}) })
} else { } else {
top.layer.msg("活动结束后才能开启下一轮"); layer.msg("活动结束后才能开启下一轮");
} }
}); });
//数值转为true或false //数值转为true或false
......
...@@ -79,20 +79,20 @@ ...@@ -79,20 +79,20 @@
$("#fanslist").html(str) $("#fanslist").html(str)
form.render() form.render()
toNull_G(); toNull_G();
laypage.render({
elem: 'page',
count: data.total,
limit: 10,
curr: queryObj.page,
skip: true,
jump: function(obj, first) {
if(!first) {
queryObj.page = obj.curr
initData(queryObj)
}
}
})
} }
laypage.render({
elem: 'page',
count: data.total,
limit: 10,
curr: queryObj.page,
layout: ['count', 'prev', 'page', 'next', 'skip'],
jump: function(obj, first) {
if(!first) {
queryObj.page = obj.curr
initData(queryObj)
}
}
})
}) })
} }
......
...@@ -92,20 +92,20 @@ ...@@ -92,20 +92,20 @@
$("#tablelist").html(str); $("#tablelist").html(str);
form.render(); form.render();
toNull_G(); toNull_G();
laypage.render({
elem: 'page',
count: data.total,
limit: queryObj.size,
curr: queryObj.page,
skip: true,
jump: function(obj, first) {
if(!first) {
queryObj.page = obj.curr
initData(queryObj);
}
}
})
} }
laypage.render({
elem: 'page',
count: data.total,
limit: queryObj.size,
curr: queryObj.page,
layout: ['count', 'prev', 'page', 'next', 'skip'],
jump: function(obj, first) {
if(!first) {
queryObj.page = obj.curr
initData(queryObj);
}
}
})
}) })
} }
......
...@@ -89,14 +89,12 @@ ...@@ -89,14 +89,12 @@
data = data.data; data = data.data;
$('#moneySum').text(data.sum) $('#moneySum').text(data.sum)
console.log(data) console.log(data)
$("#tablelist").html("");
var str = ""; var str = "";
if(data.rows.length < 1) { if(data.rows.length < 1) {
$(".nodata").show(); $(".nodata").show();
$("#page").hide();
} else { } else {
$(".nodata").hide(); $(".nodata").hide();
$("#page").show();
for(var i = 0; i < data.rows.length; i++) { for(var i = 0; i < data.rows.length; i++) {
str += '<tr>' + str += '<tr>' +
'<td>' + ((data.page - 1) * data.pageSize + i + 1) + '</td>' + '<td>' + ((data.page - 1) * data.pageSize + i + 1) + '</td>' +
...@@ -110,21 +108,21 @@ ...@@ -110,21 +108,21 @@
$("#tablelist").html(str); $("#tablelist").html(str);
form.render(); form.render();
toNull_G(); toNull_G();
laypage.render({
elem: 'page',
count: data.total,
limit: queryObj.pagesize,
curr: queryObj.page,
skip: true,
jump: function(obj, first) {
if(!first) {
queryObj.page = obj.curr
initData(queryObj);
}
}
})
} }
laypage.render({
elem: 'page',
count: data.total,
limit: queryObj.pagesize,
curr: queryObj.page,
layout: ['count', 'prev', 'page', 'next', 'skip'],
jump: function(obj, first) {
if(!first) {
queryObj.page = obj.curr
initData(queryObj);
}
}
})
}) })
} }
......
...@@ -107,7 +107,8 @@ ...@@ -107,7 +107,8 @@
margin-right: 5px; margin-right: 5px;
} }
.layui-code, .layui-upload-list{ .layui-code,
.layui-upload-list {
margin: 0; margin: 0;
} }
...@@ -144,11 +145,16 @@ ...@@ -144,11 +145,16 @@
margin-right: 5px; margin-right: 5px;
} }
#upload{ #upload {
float: left; float: left;
margin-right: 10px; margin-right: 10px;
} }
#page {
text-align: center;
}
/*-----------公共样式 end-----------*/ /*-----------公共样式 end-----------*/
...@@ -172,14 +178,17 @@ ...@@ -172,14 +178,17 @@
margin-bottom: 40px; margin-bottom: 40px;
color: #666; color: #666;
} }
.popupbos .layui-form-label{
.popupbos .layui-form-label {
width: 90px; width: 90px;
padding: 9px 0; padding: 9px 0;
} }
.popupbos .layui-input-block{
.popupbos .layui-input-block {
margin-left: 90px; margin-left: 90px;
} }
.popupbos .layui-form-mid{
.popupbos .layui-form-mid {
padding: 0!important; padding: 0!important;
} }
......
...@@ -63,7 +63,6 @@ body .layui-layout-admin .footer-demo{height: auto; padding: 5px 0; line-height: ...@@ -63,7 +63,6 @@ body .layui-layout-admin .footer-demo{height: auto; padding: 5px 0; line-height:
90% {opacity: 0.1; transform: translate3d(0, 0, 0) rotate(3600deg) scale(6);} 90% {opacity: 0.1; transform: translate3d(0, 0, 0) rotate(3600deg) scale(6);}
100% {opacity: 1; transform: translate3d(0, 0, 0) rotate(3600deg) scale(1);} 100% {opacity: 1; transform: translate3d(0, 0, 0) rotate(3600deg) scale(1);}
} }
@-webkit-keyframes site-desc { @-webkit-keyframes site-desc {
0% { -webkit-transform: scale(1.1);} 0% { -webkit-transform: scale(1.1);}
100% {opacity: 1; -webkit-transform: scale(1);} 100% {opacity: 1; -webkit-transform: scale(1);}
......
/** index.js By Beginner Emain:zheng_jinfan@126.com HomePage:http://www.zhengjinfan.cn */ /** index.js By Beginner Emain:zheng_jinfan@126.com HomePage:http://www.zhengjinfan.cn */
var tab,layer; var tab, layer;
layui.config({ layui.config({
base: '/zzhnc/res/js/', base: '/zzhnc/res/js/',
version: new Date().getTime() version: new Date().getTime()
}).use(['element', 'layer', 'navbar', 'tab'], function () { }).use(['element', 'layer', 'navbar', 'tab'], function() {
var element = layui.element, var element = layui.element,
$ = layui.jquery, $ = layui.jquery,
navbar = layui.navbar(); navbar = layui.navbar();
layer = layui.layer layer = layui.layer
tab = layui.tab({ tab = layui.tab({
elem: '.admin-nav-card' //设置选项卡容器 elem: '.admin-nav-card', //设置选项卡容器
, //maxSetting: {
//maxSetting: { // max: 5,
// max: 5, // tipMsg: '只能开5个哇,不能再开了。真的。'
// tipMsg: '只能开5个哇,不能再开了。真的。' //},
//}, contextMenu: true,
contextMenu: true, onSwitch: function(data) {
onSwitch: function (data) { /*console.log(data.id); //当前Tab的Id
/*console.log(data.id); //当前Tab的Id console.log(data.index); //得到当前Tab的所在下标
console.log(data.index); //得到当前Tab的所在下标 console.log(data.elem); //得到当前的Tab大容器
console.log(data.elem); //得到当前的Tab大容器
console.log(tab.getCurrentTabId())*/ console.log(tab.getCurrentTabId())*/
$('iframe[data-id=' + (data.index+1) + ']').each(function () { $('iframe[data-id=' + (data.index + 1) + ']').each(function() {
$(this)[0].src = $(this)[0].src; $(this)[0].src = $(this)[0].src;
}); });
} }
}); });
//iframe自适应 //iframe自适应
$(window).on('resize', function () { $(window).on('resize', function() {
var $content = $('.admin-nav-card .layui-tab-content'); var $content = $('.admin-nav-card .layui-tab-content');
$content.height($(this).height() - 147); $content.height($(this).height() - 147);
$content.find('iframe').each(function () { $content.find('iframe').each(function() {
$(this).height($content.height()); $(this).height($content.height());
}); });
}).resize(); }).resize();
//设置navbar
navbar.set({
//设置navbar spreadOne: true,
navbar.set({ elem: '#admin-navbar-side',
spreadOne: true, cached: true,
elem: '#admin-navbar-side', data: navs2
cached: true,
data: navs2
// cached:true, // cached:true,
// url: '../res/plugins/datas/nav.json' // url: '../res/plugins/datas/nav.json'
}); });
//渲染navbar //渲染navbar
navbar.render(); navbar.render();
//监听点击事件 //监听点击事件
navbar.on('click(side)', function (data) { navbar.on('click(side)', function(data) {
tab.tabAdd(data.field); tab.tabAdd(data.field);
}); });
$('.admin-side-toggle').on('click', function () {
var sideWidth = $('#admin-side').width();
if (sideWidth === 200) {
$('#admin-body').animate({
left: '0'
}); //admin-footer
$('#admin-footer').animate({
left: '0'
});
$('#admin-side').animate({
width: '0'
});
} else {
$('#admin-body').animate({
left: '200px'
});
$('#admin-footer').animate({
left: '200px'
});
$('#admin-side').animate({
width: '200px'
});
}
});
$('.admin-side-full').on('click', function () {
var docElm = document.documentElement;
//W3C
if (docElm.requestFullscreen) {
docElm.requestFullscreen();
}
//FireFox
else if (docElm.mozRequestFullScreen) {
docElm.mozRequestFullScreen();
}
//Chrome等
else if (docElm.webkitRequestFullScreen) {
docElm.webkitRequestFullScreen();
}
//IE11
else if (elem.msRequestFullscreen) {
elem.msRequestFullscreen();
}
layer.msg('按Esc即可退出全屏');
});
$('.admin-side-toggle').on('click', function() {
var sideWidth = $('#admin-side').width();
if(sideWidth === 200) {
$('#admin-body').animate({
left: '0'
}); //admin-footer
$('#admin-footer').animate({
left: '0'
});
$('#admin-side').animate({
width: '0'
});
} else {
$('#admin-body').animate({
left: '200px'
});
$('#admin-footer').animate({
left: '200px'
});
$('#admin-side').animate({
width: '200px'
});
}
});
$('.admin-side-full').on('click', function() {
var docElm = document.documentElement;
//W3C
if(docElm.requestFullscreen) {
docElm.requestFullscreen();
}
//FireFox
else if(docElm.mozRequestFullScreen) {
docElm.mozRequestFullScreen();
}
//Chrome等
else if(docElm.webkitRequestFullScreen) {
docElm.webkitRequestFullScreen();
}
//IE11
else if(elem.msRequestFullscreen) {
elem.msRequestFullscreen();
}
layer.msg('按Esc即可退出全屏');
});
//锁屏 //锁屏
$(document).on('keydown', function () { $(document).on('keydown', function() {
var e = window.event; var e = window.event;
if (e.keyCode === 76 && e.altKey) { if(e.keyCode === 76 && e.altKey) {
//alert("你按下了alt+l"); //alert("你按下了alt+l");
lock($, layer); lock($, layer);
} }
}); });
$('#lock').on('click', function () { $('#lock').on('click', function() {
lock($, layer); lock($, layer);
}); });
//手机设备的简单适配 //手机设备的简单适配
var treeMobile = $('.site-tree-mobile'), var treeMobile = $('.site-tree-mobile'),
shadeMobile = $('.site-mobile-shade'); shadeMobile = $('.site-mobile-shade');
treeMobile.on('click', function () { treeMobile.on('click', function() {
$('body').addClass('site-mobile'); $('body').addClass('site-mobile');
}); });
shadeMobile.on('click', function () { shadeMobile.on('click', function() {
$('body').removeClass('site-mobile'); $('body').removeClass('site-mobile');
}); });
}); });
var isShowLock = false; var isShowLock = false;
function lock($, layer) { function lock($, layer) {
if (isShowLock) if(isShowLock)
return; return;
//自定页 //自定页
layer.open({ layer.open({
title: false, title: false,
type: 1, type: 1,
closeBtn: 0, closeBtn: 0,
anim: 6, anim: 6,
content: $('#lock-temp').html(), content: $('#lock-temp').html(),
shade: [0.9, '#393D49'], shade: [0.9, '#393D49'],
success: function (layero, lockIndex) { success: function(layero, lockIndex) {
isShowLock = true; isShowLock = true;
//给显示用户名赋值 //给显示用户名赋值
layero.find('div#lockUserName').text('admin'); layero.find('div#lockUserName').text('admin');
layero.find('input[name=lockPwd]').on('focus', function () { layero.find('input[name=lockPwd]').on('focus', function() {
var $this = $(this); var $this = $(this);
if ($this.val() === '输入登录密码解锁..') { if($this.val() === '输入登录密码解锁..') {
$this.val('').attr('type', 'password'); $this.val('').attr('type', 'password');
} }
}) })
.on('blur', function () { .on('blur', function() {
var $this = $(this); var $this = $(this);
if ($this.val() === '' || $this.length === 0) { if($this.val() === '' || $this.length === 0) {
$this.attr('type', 'text').val('输入登录密码解锁..'); $this.attr('type', 'text').val('输入登录密码解锁..');
} }
}); });
//在此处可以写一个请求到服务端删除相关身份认证,因为考虑到如果浏览器被强制刷新的时候,身份验证还存在的情况 //在此处可以写一个请求到服务端删除相关身份认证,因为考虑到如果浏览器被强制刷新的时候,身份验证还存在的情况
//do something... //do something...
//e.g. //e.g.
/* /*
$.post(url,params,callback,'json'); $.post(url,params,callback,'json');
*/ */
//绑定解锁按钮的点击事件 //绑定解锁按钮的点击事件
layero.find('button#unlock').on('click', function () { layero.find('button#unlock').on('click', function() {
var $lockBox = $('div#lock-box'); var $lockBox = $('div#lock-box');
if(window.sessionStorage){ if(window.sessionStorage) {
if(sessionStorage.getItem('phone')){ if(sessionStorage.getItem('phone')) {
var userName = sessionStorage.getItem('phone') var userName = sessionStorage.getItem('phone')
} }
}else{ } else {
if(document.cookie.length > 0){ if(document.cookie.length > 0) {
if(document.cookie.indexOf("phone") > 0 ) if(document.cookie.indexOf("phone") > 0)
var userName = document.cookie.slice(6) var userName = document.cookie.slice(6)
} }
} }
var pwd = $lockBox.find('input[name=lockPwd]').val(); var pwd = $lockBox.find('input[name=lockPwd]').val();
if (pwd === '输入登录密码解锁..' || pwd.length === 0) { if(pwd === '输入登录密码解锁..' || pwd.length === 0) {
layer.msg('请输入登录密码..', { layer.msg('请输入登录密码..', {
icon: 2, icon: 2,
time: 1000 time: 1000
}); });
return; return;
} }
unlock(userName, pwd); unlock(userName, pwd);
}); });
/** /**
* 解锁操作方法 * 解锁操作方法
* @param {String} 用户名 * @param {String} 用户名
* @param {String} 密码 * @param {String} 密码
*/ */
var unlock = function (un, pwd) { var unlock = function(un, pwd) {
var code = "" var code = ""
//这里可以使用ajax方法解锁 //这里可以使用ajax方法解锁
/*$.post('api/xx',{username:un,password:pwd},function(data){ /*$.post('api/xx',{username:un,password:pwd},function(data){
//验证成功 //验证成功
if(data.success){ if(data.success){
...@@ -202,27 +198,32 @@ function lock($, layer) { ...@@ -202,27 +198,32 @@ function lock($, layer) {
} }
},'json'); },'json');
*/ */
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
async: false, async: false,
url: "../center/login", url: "../center/login",
data: {account:un,pwd:pwd,code:code}, data: {
success: function (data) { account: un,
if(data.code==0){ pwd: pwd,
isShowLock = false; code: code
//演示:默认输入密码都算成功 },
//关闭锁屏层 success: function(data) {
layer.close(lockIndex); if(data.code == 0) {
}else{ isShowLock = false;
//演示:默认输入密码都算成功
layer.msg(data.msg,{icon:2,time:1000}); //关闭锁屏层
} layer.close(lockIndex);
} } else {
});
layer.msg(data.msg, {
icon: 2,
time: 1000
}; });
} }
}); }
});
};
}
});
}; };
\ No newline at end of file \ No newline at end of file
...@@ -9,10 +9,12 @@ function toTime_G(v) { ...@@ -9,10 +9,12 @@ function toTime_G(v) {
var day = time.getDate(); var day = time.getDate();
var hour = time.getHours(); var hour = time.getHours();
var min = time.getMinutes(); var min = time.getMinutes();
var second = time.getSeconds();
if(mon < 10) mon = "0" + mon if(mon < 10) mon = "0" + mon
if(day < 10) day = "0" + day if(day < 10) day = "0" + day
if(hour < 10) hour = "0" + hour if(hour < 10) hour = "0" + hour
if(min < 10) min = "0" + min if(min < 10) min = "0" + min
if(second < 10) second = "0" + second
return year + "-" + mon + "-" + day + " " + hour + ":" + min return year + "-" + mon + "-" + day + " " + hour + ":" + min
} }
} }
......
...@@ -152,8 +152,8 @@ layui.define(['element', 'common'], function(exports) { ...@@ -152,8 +152,8 @@ layui.define(['element', 'common'], function(exports) {
} else { } else {
element.tabChange(ELEM.tabFilter, that.getTabId(data.title)); element.tabChange(ELEM.tabFilter, that.getTabId(data.title));
//自动刷新 //自动刷新
if (_config.autoRefresh) { if(_config.autoRefresh) {
_config.elem.find('div.layui-tab-content > div').eq(tabIndex).children('iframe')[0].contentWindow.location.reload(); _config.elem.find('div.layui-tab-content > div').eq(tabIndex).children('iframe')[0].contentWindow.location.reload();
} }
} }
if(_config.contextMenu) { if(_config.contextMenu) {
......
var threeSelectData = null //城市数据
$.ajax({
url: url_gobol + "public/getDropDownCity",
type:"get",
async:false,
beforeSend:function(){
top.layer.load()
},
success:function(data){
data = JSON.parse(data.data)
threeSelectData = data
top.layer.close(top.layer.load())
},
error:function(){
top.layer.close(top.layer.load())
top.layer.msg("获取城市数据失败,请刷新重试")
}
})
Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
请先完成此消息的编辑!