Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
bb40014b
Commit
bb40014b
authored
Apr 26, 2018
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分页控件
parent
41fdb526
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
60 deletions
+42
-60
public.css
public/resource/css/public.css
+17
-0
watch_shop.js
public/resource/js/watch_shop.js
+1
-8
Pagination.js
public/resource/lib/js/Pagination.js
+0
-0
zw.pagination.js
public/resource/lib/js/zw.pagination.js
+24
-52
No files found.
public/resource/css/public.css
View file @
bb40014b
...
...
@@ -192,3 +192,19 @@ a:hover{
margin-top
:
7px
;
margin-left
:
7px
;
}
#pagediv
a
,
#pagediv
span
{
display
:
inline-block
;
width
:
30px
;
line-height
:
30px
;
text-align
:
center
;
}
#pagediv
.active
{
color
:
#fff
;
background-color
:
#00a5e0
;
}
#pagediv
.jump-ipt
{
width
:
50px
;
margin-left
:
5px
;
}
\ No newline at end of file
public/resource/js/watch_shop.js
View file @
bb40014b
...
...
@@ -211,14 +211,7 @@ define (['doT', 'text!temp/watch_template_tpl.html', 'css!style/home.css','pagin
$
(
"#sublet_list"
).
html
(
doTtmpl
(
data
.
data
.
list
));
/*分页代码*/
$
(
"#pagediv"
).
pagination
({
length
:
data
.
data
.
total
,
current
:
pageNo
,
every
:
user
.
pageSize
,
onClick
:
function
(
el
)
{
user
.
getList
(
el
.
num
.
current
);
}
});
add_page
(
data
.
data
.
total
,
pageNo
,
user
.
pageSize
,
user
.
getList
);
}
});
},
...
...
public/resource/lib/js/Pagination.js
View file @
bb40014b
This diff is collapsed.
Click to expand it.
public/resource/lib/js/zw.pagination.js
View file @
bb40014b
/**
* 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
)
{
if
(
pagination_page_no
>
pagination_pages
)
pagination_page_no
=
pagination_pages
;
$
(
".pageinfo"
).
pagination
({
length
:
data
.
data
.
total
,
current
:
pageNo
,
coping
:
true
,
every
:
user
.
pageSize
,
onClick
:
function
(
el
)
{
user
.
getList
(
el
.
num
.
current
);
}
});
/* $('.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 = ' <select class="page_size_select" style="width:80px;">';
var pagearr = [15, 30, 50, 100];
$.each(pagearr, function () {
function
add_page
(
total_list
,
page_no
,
page_size
,
methodName
)
{
console
.
log
(
total_list
-
page_size
);
if
(
total_list
-
page_size
<
0
)
{
$
(
'#pagediv'
).
html
(
''
);
return
;
}
if (this == pagination_pagesize) {
pageselect = pageselect + '<option value="' + this + '" selected>' + this + '</option>';
} else {
pageselect = pageselect + '<option value="' + this + '" >' + this + '</option>';
$
(
'#pagediv'
).
pagination
({
totalData
:
total_list
,
/*总条数*/
jump
:
true
,
current
:
page_no
,
/*第几页*/
showData
:
page_size
,
/*每页显示多少条*/
coping
:
true
,
homePage
:
'首页'
,
endPage
:
'末页'
,
prevContent
:
'上页'
,
nextContent
:
'下页'
,
callback
:
function
(
api
)
{
//console.log(api.getCurrent())
methodName
(
api
.
getCurrent
());
}
});
var
str
=
'<span style="float: left;min-width: 250px !important;text-align: left !important;">'
+
'每页显示'
+
page_size
+
'条 | 共'
+
total_list
+
'条</span>'
;
$
(
'#pagediv'
).
append
(
str
);
pageselect = pageselect + '</select> ';
if (!$('.page_size_select').val()) {
$('.pageinfo').find('span:contains(共)').prepend(pageselect);
}
$('.page_size_select').one('change', function () {
pagination_pagesize = $(this).val();
methodName();
});*/
};
};
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment