|
@@ -19,7 +19,7 @@ window.onload = function () {
|
|
|
pageNo: 1
|
|
|
},
|
|
|
success: function (data) {
|
|
|
- console.log(data);
|
|
|
+ // console.log(data);
|
|
|
if (data.error && data.error.length) {
|
|
|
alert("数据加载失败,请刷新页面");
|
|
|
} else {
|
|
@@ -33,7 +33,7 @@ window.onload = function () {
|
|
|
<div class="newslist_img"><img src="${globalConfig.avatarUploadHost + item.pictureUrl}" alt=""></div>
|
|
|
<div class="newslist_content">
|
|
|
<h6 class="title">${item.title}</h6>
|
|
|
- <div class="date">${item.createTimes}</div>
|
|
|
+ <div class="date">${item.releaseTimes}</div>
|
|
|
<p class="content">${item.content}</p>
|
|
|
</div>
|
|
|
</li>`
|
|
@@ -111,7 +111,7 @@ window.onload = function () {
|
|
|
}
|
|
|
$(".btn").remove()
|
|
|
if (buer) {
|
|
|
- console.log(123);
|
|
|
+ // console.log(123);
|
|
|
btnstart++
|
|
|
btnend++
|
|
|
buer = false
|
|
@@ -167,7 +167,6 @@ window.onload = function () {
|
|
|
function select() {
|
|
|
$(".pagebtn").click(function () {
|
|
|
selected = $(this).attr("index")
|
|
|
- console.log("woanle");
|
|
|
jump()
|
|
|
$(".pagebtn").css({
|
|
|
"background": "#fff",
|
|
@@ -197,28 +196,38 @@ window.onload = function () {
|
|
|
btnend = Number(selected) + 3
|
|
|
buer = true
|
|
|
select()
|
|
|
- } else if (selected < 6) {
|
|
|
- $(".beforemore").remove()
|
|
|
- btnstart = 2
|
|
|
- btnend = btnstart + 6
|
|
|
- $(".btn").remove()
|
|
|
- for (let i = btnstart; i <= btnend; i++) {
|
|
|
- let pagebtn = `<button class="pagebtn btn" index="${i}">${i}</button>`
|
|
|
- $(".btns").append(pagebtn)
|
|
|
- }
|
|
|
- select()
|
|
|
- } else if (selected > pagenum - 5) {
|
|
|
+ } else if (pagenum < 8) {
|
|
|
$(".more").remove()
|
|
|
- btnend = pagenum - 1
|
|
|
- btnstart = btnend - 6
|
|
|
$(".btn").remove()
|
|
|
- for (let i = btnstart; i <= btnend; i++) {
|
|
|
+ for (let i = 2; i <= pagenum; i++) {
|
|
|
let pagebtn = `<button class="pagebtn btn" index="${i}">${i}</button>`
|
|
|
$(".btns").append(pagebtn)
|
|
|
}
|
|
|
select()
|
|
|
+ } else if (pagenum >= 8) {
|
|
|
+ if (selected < 6) {
|
|
|
+ $(".beforemore").remove()
|
|
|
+ btnstart = 2
|
|
|
+ btnend = btnstart + 6
|
|
|
+ $(".btn").remove()
|
|
|
+ for (let i = btnstart; i <= btnend; i++) {
|
|
|
+ let pagebtn = `<button class="pagebtn btn" index="${i}">${i}</button>`
|
|
|
+ $(".btns").append(pagebtn)
|
|
|
+ }
|
|
|
+ select()
|
|
|
+ } else if (selected > pagenum - 5) {
|
|
|
+ $(".more").remove()
|
|
|
+ btnend = pagenum - 1
|
|
|
+ btnstart = btnend - 6
|
|
|
+ $(".btn").remove()
|
|
|
+ for (let i = btnstart; i <= btnend; i++) {
|
|
|
+ let pagebtn = `<button class="pagebtn btn" index="${i}">${i}</button>`
|
|
|
+ $(".btns").append(pagebtn)
|
|
|
+ }
|
|
|
+ select()
|
|
|
+ }
|
|
|
}
|
|
|
- console.log(btnend, btnstart);
|
|
|
+ // console.log(btnend, btnstart);
|
|
|
request()
|
|
|
select()
|
|
|
bidden()
|
|
@@ -313,7 +322,9 @@ window.onload = function () {
|
|
|
if (loginTxt && ($(loginTxt).text()) == '登录') {
|
|
|
$('.head_login').click();
|
|
|
window.location.hash = 'jump';
|
|
|
- $(".login").css({"display" : "block"})
|
|
|
+ $(".login").css({
|
|
|
+ "display": "block"
|
|
|
+ })
|
|
|
return false;
|
|
|
} else {
|
|
|
if (window.adminData && window.adminData.mobile) {
|
|
@@ -324,8 +335,10 @@ window.onload = function () {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
- $(".login_close").click(function(){
|
|
|
- $(".login").css({"display" : "none"})
|
|
|
+ $(".login_close").click(function () {
|
|
|
+ $(".login").css({
|
|
|
+ "display": "none"
|
|
|
+ })
|
|
|
})
|
|
|
}
|
|
|
}
|