|
@@ -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
|
|
@@ -115,6 +116,10 @@ function renderList(tabList){
|
|
|
`
|
|
|
}
|
|
|
$(".resultItemWrap").html(str);
|
|
|
+ /*setTimeout(function(){console.log($(".resultItemWrap").scrollTop())
|
|
|
+ $(".staticListWrap").scrollTop(10);
|
|
|
+ },1000)*/
|
|
|
+
|
|
|
$('.resultItem').click(function(){
|
|
|
let name = $(this).attr('data-name')
|
|
|
let type = $(this).attr('data-type')
|
|
@@ -134,14 +139,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>
|
|
@@ -191,7 +188,7 @@ function renderPagination(totalPage,activePage,totalNum){
|
|
|
$('.pagination').html(str)
|
|
|
$('.page' + activePage).addClass('activePage')
|
|
|
$(".pageNum").on("click", function(e){
|
|
|
- console.log($(this)[0])
|
|
|
+ //console.log($(this)[0])
|
|
|
const activePageNow = Number($(this).attr('data-page'))
|
|
|
curPage = activePageNow
|
|
|
getTabData()
|
|
@@ -217,8 +214,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-" + totalPage + "范围内的整数");
|
|
|
return;
|
|
|
}
|
|
|
curPage = n;
|
|
@@ -230,5 +227,5 @@ $(function () {
|
|
|
$(".warning-box .confirm,.warning-box .close").click(function () {
|
|
|
toggleWarnBox();
|
|
|
})
|
|
|
-})();
|
|
|
+});
|
|
|
|