Commit e2bd8d3f authored by clone's avatar clone

时间控件和分页组建

parent 03f03716
......@@ -46,7 +46,7 @@ class Login extends Basic
Session::set("userName",$result[0]["name"]);
Session::set("userId",$result[0]["id"]);
Session::set("lastLoginTime",$result[0]["last_login_time"]);
$this->redirect('banner/banner');
} else {
return view("login/login", [ "msg" => "用户名或密码错误" ]);
......
<script src='/resource/lib/js/require.min.js' data-main='/resource/js/main?version=1vsdfv1235544241' charset='utf-8'></script>
\ No newline at end of file
<script src='/resource/lib/js/require.min.js' data-main='/resource/js/main?version=1' charset='utf-8'></script>
\ No newline at end of file
......@@ -5,6 +5,8 @@
<link rel="stylesheet" href="/resource/css/bootstrap.css" type="text/css" />
<link rel="stylesheet" href="/resource/css/public.css" type="text/css" />
<link rel="stylesheet" href="//qidian.gtimg.com/lulu/theme/peak/css/common/ui/Pagination.css">
<link rel="stylesheet" href="/resource/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="/resource/css/bootstrap-datetimepicker.min.css">
</head>
<body>
......
This diff is collapsed.
This diff is collapsed.
/**
* Created by zw on 2017/12/15.
*/
define (['doT', 'text!temp/banner_template_tpl.html', 'ckfinder', 'ckfinderStart', 'css!style/home.css', 'bootstrapJs', 'pagination'], function (doT, template) {
define (['doT', 'text!temp/banner_template_tpl.html', 'ckfinder', 'ckfinderStart', 'css!style/home.css'], function (doT, template) {
var banner = {
pageNo: 1, /*第几页*/
pageSize: 15, /*每页显示多少条*/
......
......@@ -14,6 +14,7 @@ require.config ({
'bootstrapJs': 'lib/js/bootstrap.min',
'datetimepicker': 'lib/js/bootstrap-datetimepicker.min',
'pagination': 'lib/js/pagination',
'paginationStart': 'lib/js/zw.pagination',
},
'shim': {
'jquery': {
......@@ -47,4 +48,4 @@ require.config ({
}
});
require (['require', 'jquery', 'doT', 'app/public' ]);
require (['require', 'jquery', 'doT', 'app/public' ,"datetimepicker",'pagination','bootstrapJs',"paginationStart"]);
define (['doT', 'text!temp/transfer_template_tpl.html', 'css!style/home.css',"datetimepicker",'pagination','bootstrapJs'], function (doT, template) {
define (['doT', 'text!temp/transfer_template_tpl.html', 'css!style/home.css'], function (doT, template) {
user = {
pageNo: 1, /*第几页*/
pageSize: 10, /*每页显示多少条*/
urls: '',
init: function () {
;(function($){
$.fn.datetimepicker.dates['zh-CN'] = {
days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"],
daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"],
months: ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"],
monthsShort: ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"],
today: "今日",
suffix: [],
meridiem: ["am", "pm"],
weekStart: 1,
};
}(jQuery));
$('.form_datetime').datetimepicker({
//language: 'fr',
weekStart: 1,
todayBtn: 1,
autoclose: 1,
todayHighlight: 1,
startView: 2,
forceParse: 0,
showMeridian: 1
});
$('.form_date').datetimepicker({
language: 'zh-CN',
weekStart: 1,
todayBtn: 1,
autoclose: 1,
todayHighlight: 1,
startView: 2,
minView: 2,
forceParse: 0
});
$('.form_time').datetimepicker({
language: 'zh-CN',
weekStart: 1,
todayBtn: 1,
autoclose: 1,
todayHighlight: 1,
startView: 1,
minView: 0,
maxView: 1,
forceParse: 0
});
//初始化dot
$ ("body").append (template);
user.getList ();
......@@ -53,14 +101,16 @@ define (['doT', 'text!temp/transfer_template_tpl.html', 'css!style/home.css',"da
$ ("#sublet_list").html (doTtmpl (data.data.list));
/*分页代码*/
$ ("#pagediv").pagination ({
/* $ ("#pagediv").pagination ({
length: data.data.total,
current: pageNo,
coping:true,
every: user.pageSize,
onClick: function (el) {
user.getList (el.num.current);
}
});
});*/
addpage(user.getList);
}
});
},
......
/**
* Created by zw on 2017/12/22.
*/
var pagination_page_no = 1; //页码
var pagination_pages = 1; //总页数
var pagination_totals = 0; //总条数
var pagination_pagesize = 15; //每页显示多少条
function addpage(methodName) {
alert(111111111);
if (pagination_page_no > pagination_pages) pagination_page_no = pagination_pages;
$('.pageinfo').pagination({
pages: pagination_pages, //总页数
styleClass: ['pagination-large'],
showCtrl: true,
displayPage: 6,
currentPage: pagination_page_no, //当前页码
onSelect: function (num) {
pagination_page_no = num;
if (typeof methodName === "function") {
methodName();
}
}
});
/*
$('.pageinfo').find('span:contains(共)').append("(" + pagination_totals + "条记录)");
var pageselect = '&nbsp;<select class="page_size_select" style="width:80px;">';
var pagearr = [15, 30, 50, 100];
$.each(pagearr, function () {
if (this == pagination_pagesize) {
pageselect = pageselect + '<option value="' + this + '" selected>' + this + '</option>';
} else {
pageselect = pageselect + '<option value="' + this + '" >' + this + '</option>';
}
});
pageselect = pageselect + '</select>&nbsp;';
if (!$('.page_size_select').val()) {
$('.pageinfo').find('span:contains(共)').prepend(pageselect);
}
$('.page_size_select').one('change', function () {
pagination_pagesize = $(this).val();
methodName();
});*/
};
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 to comment