|
@@ -18,7 +18,7 @@ $(function(){
|
|
|
initData()
|
|
|
getAllTypes()
|
|
|
getSearchList()
|
|
|
- getTabData(curPage)
|
|
|
+ getTabData()
|
|
|
});
|
|
|
//tab
|
|
|
function renderTab(data){
|
|
@@ -28,6 +28,7 @@ function renderTab(data){
|
|
|
str += `<li class="${i==0?'tabFst':''}" data-id="${element.val}">${element.name}</li>`
|
|
|
}
|
|
|
$('.staticTopTab ul').html(str)
|
|
|
+ $('.staticTopTab li[data-id='+searchType+']').css({color:'#2A9BD5'}).siblings().css({color:'#333'});
|
|
|
$(".staticTopTab li").click(function(){
|
|
|
searchType = $(this).attr('data-id')
|
|
|
$(this).css({color:'#2A9BD5'}).siblings().css({color:'#333'})
|
|
@@ -74,7 +75,7 @@ function getTabData(){
|
|
|
const totalPage = data.pages;
|
|
|
const totalNum = data.total;
|
|
|
renderList(tabList);
|
|
|
- if(totalPage > 1){
|
|
|
+ if(totalNum > 0){
|
|
|
renderPagination(totalPage,Number(curPage),totalNum)
|
|
|
} else{
|
|
|
$('.pagination').html("")
|
|
@@ -111,7 +112,7 @@ function renderList(tabList){
|
|
|
$('.resultItem').click(function(){
|
|
|
let name = $(this).attr('data-name')
|
|
|
let type = $(this).attr('data-type')
|
|
|
- window.location.href = `./staticInfo.html?name=${name}&type=${type}`
|
|
|
+ window.open(`./staticInfo.html?name=${name}&type=${type}`);
|
|
|
})
|
|
|
}
|
|
|
function initData(){
|