|
@@ -2,6 +2,7 @@ require('./../css/searchStaticList.less');
|
|
|
|
|
|
const $ = require("jquery");
|
|
|
const { post,config,getUrlArgObject,openNewWin } = require('./promise.js');
|
|
|
+const {toggleWarnBox} = require('./util.js');
|
|
|
|
|
|
let searchType = 0, inputStr = '', curPage = 1, size = 10, totalPage = 1;
|
|
|
searchType = getUrlArgObject('type') || 0
|
|
@@ -133,14 +134,6 @@ function initData(){
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-function toggleWarnBox(text) {
|
|
|
- if (text) {
|
|
|
- $(".warning-box .content span").text(text);
|
|
|
- $(".warning-box").show();
|
|
|
- } else {
|
|
|
- $(".warning-box").hide();
|
|
|
- }
|
|
|
-}
|
|
|
// 分页
|
|
|
function renderPagination(totalPage,activePage,totalNum){
|
|
|
let str = `<span class="totalSum">共${totalNum}条</span>
|
|
@@ -216,8 +209,8 @@ function renderPagination(totalPage,activePage,totalNum){
|
|
|
})
|
|
|
$('.goNum input').change(function(){
|
|
|
const n = $(this).val()
|
|
|
- if (totalPage < n) {
|
|
|
- toggleWarnBox("输入页数不能大于最大页数");
|
|
|
+ if (totalPage < n || n < 1) {
|
|
|
+ toggleWarnBox("请输入1到最大页数范围内的数字");
|
|
|
return;
|
|
|
}
|
|
|
curPage = n;
|
|
@@ -229,5 +222,5 @@ $(function () {
|
|
|
$(".warning-box .confirm,.warning-box .close").click(function () {
|
|
|
toggleWarnBox();
|
|
|
})
|
|
|
-})();
|
|
|
+});
|
|
|
|