|
@@ -0,0 +1,1660 @@
|
|
|
+var pageSize = 50;
|
|
|
+var nbflag = false;//是否显示的是最新招标数据
|
|
|
+var currentPage = 1;//当前页
|
|
|
+var submitflag = true;
|
|
|
+var tabularflag = "Y";
|
|
|
+$(function() {
|
|
|
+ priceTime();
|
|
|
+ $(".Price-content").find("span:first-child").click(function(){
|
|
|
+ $(this).addClass("active");
|
|
|
+ $(".pricefat").removeClass("active");
|
|
|
+ beforeSubmit();
|
|
|
+ })
|
|
|
+ $(".timer").find("ul li:first-child").click(function(){
|
|
|
+ timeshow = false;
|
|
|
+ $("#starttime").css({"border-color":""});
|
|
|
+ $("#endtime").css({"border-color":""});
|
|
|
+ $("#timebut").hide();
|
|
|
+ $(".timerInput").removeClass("customtime-active");
|
|
|
+ $(this).addClass("active");
|
|
|
+ $(".timerInput").removeClass("active");
|
|
|
+ })
|
|
|
+ //
|
|
|
+ $(".pricebut").click(function(){
|
|
|
+ priceCss();
|
|
|
+ beforeSubmit();
|
|
|
+ })
|
|
|
+ //
|
|
|
+ $("#timebut").click(function(){
|
|
|
+ timeshow=false;
|
|
|
+ $(this).hide();
|
|
|
+ $(".timerInput").removeClass("customtime-active");
|
|
|
+ if($("#starttime").val()==""&&$("#endtime").val()==""){
|
|
|
+ $("#starttime").css({"border-color":""});
|
|
|
+ $("#endtime").css({"border-color":""});
|
|
|
+ $("#timebut").hide();
|
|
|
+ $(".timerInput").removeClass("customtime-active");
|
|
|
+ $("#timerAll").addClass("active");
|
|
|
+ $(".timerInput").removeClass("active");
|
|
|
+ }else{
|
|
|
+ $(".timerInput").addClass("active");
|
|
|
+ $(".timer").find("ul li:first-child").removeClass("active");
|
|
|
+ $(".release-time .timer li").removeClass("active");
|
|
|
+ }
|
|
|
+ beforeSubmit()
|
|
|
+ })
|
|
|
+ //
|
|
|
+ $(".nbprev").click(function(){
|
|
|
+ $(window).scrollTop(0);
|
|
|
+ $('.custom-checkbox.check-all').prop('checked', false)
|
|
|
+ prev();
|
|
|
+ })
|
|
|
+ $(".nbnext").click(function(){
|
|
|
+ $(window).scrollTop(0);
|
|
|
+ $('.custom-checkbox.check-all').prop('checked', false)
|
|
|
+ next();
|
|
|
+
|
|
|
+ })
|
|
|
+ //筛选关闭和打开
|
|
|
+ //根据cookie值设置筛选是否显示 移除该需求操作
|
|
|
+ // var rsw = localStorage.getItem("hideorshow");
|
|
|
+ // if(rsw!=null){
|
|
|
+ // if(rsw=="D"){
|
|
|
+ // $("#screenBtn").addClass("down");
|
|
|
+ // $(".searchTender").show();
|
|
|
+ // $('#fold').show()
|
|
|
+ // }else{
|
|
|
+ // $("#screenBtn").removeClass("down");
|
|
|
+ // $(".searchTender").hide();
|
|
|
+ // $('#fold').hide()
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ //记录用户刷选按钮状态
|
|
|
+ $("#screenBtn").click(function(){
|
|
|
+ if($(this).attr("class").indexOf("down")>0){
|
|
|
+ // localStorage.setItem("hideorshow", "D");
|
|
|
+ $('#fold').show()
|
|
|
+ }else{
|
|
|
+ // localStorage.setItem("hideorshow", "U");
|
|
|
+ $('#fold').hide()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ //
|
|
|
+ var iuod = localStorage.getItem("industryuod");
|
|
|
+ if(iuod!=null){
|
|
|
+ if(iuod=="U"){
|
|
|
+ $(".stop").click();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //
|
|
|
+ $(".stop").click(function(){
|
|
|
+ if($(this).attr("class").indexOf("up")>0){
|
|
|
+ localStorage.setItem("industryuod", "U");
|
|
|
+ }else{
|
|
|
+ localStorage.setItem("industryuod", "D");
|
|
|
+ }
|
|
|
+ })
|
|
|
+ //全文检索和标题检索切换
|
|
|
+ $("#newsclass li:nth-child(2)").click(function(){
|
|
|
+ // searchInnerVue.listState.total = totalPage
|
|
|
+ // 重置全选按钮
|
|
|
+ $('.custom-checkbox.check-all').prop('checked', false)
|
|
|
+ $(".tabContainer-2 .lucene ul").html("");
|
|
|
+ $("#zbSeatchT [name='selectType']").val("all");
|
|
|
+ $("#right-list").addClass("active").siblings().removeClass("active");
|
|
|
+ $("#allnews .lucene").show().siblings().hide();
|
|
|
+ $(".tabContainer-2").hide();
|
|
|
+ currentPage=1;
|
|
|
+ if(submitflag){
|
|
|
+ $(".hasNoData").hide();
|
|
|
+ $(".working").show();
|
|
|
+ // 隐藏页码
|
|
|
+ searchInnerVue.showPage = false
|
|
|
+ $(".tabContainer").css("min-height","600px");
|
|
|
+ selectType = "all";
|
|
|
+ searchOnsubmit();
|
|
|
+ submitflag=false;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ $("#newsclass li:nth-child(1)").click(function(){
|
|
|
+ // 重置全选按钮
|
|
|
+ $('.custom-checkbox.check-all').prop('checked', false)
|
|
|
+ $("#allnews .lucene ul").html("");
|
|
|
+ $("#zbSeatchT [name='selectType']").val("title");
|
|
|
+ $("#right-list").addClass("active").siblings().removeClass("active");
|
|
|
+ $(".tabContainer-2 .lucene").show().siblings().hide();
|
|
|
+ $("#allnews").hide();
|
|
|
+ currentPage=1;
|
|
|
+ if(submitflag){
|
|
|
+ $(".hasNoData").hide();
|
|
|
+ $(".working").show();
|
|
|
+ // 隐藏页码
|
|
|
+ searchInnerVue.showPage = false
|
|
|
+ $(".tabContainer").css("min-height","600px");
|
|
|
+ selectType = "title";
|
|
|
+ searchOnsubmit();
|
|
|
+ submitflag=false;
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ $('#entsearch, #pursearch, #gysearch').on('click', function () {
|
|
|
+ if($(this).attr('datahref')){
|
|
|
+ location.href= $(this).attr('datahref')
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+})
|
|
|
+//
|
|
|
+function next(){
|
|
|
+ if($(".nbnext").hasClass("disabled")){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ $(".hasNoData").hide();
|
|
|
+ $(".working").show();
|
|
|
+ $(".tabContainer").hide();
|
|
|
+ $("#allnews").hide();
|
|
|
+ $(".pagination").hide();
|
|
|
+ currentPage = parseInt($(".pagination-inner").find("span").text())+parseInt(1)
|
|
|
+ if(currentPage==10){
|
|
|
+ $(".nbnext").addClass("disabled");
|
|
|
+ }else if(currentPage==2){
|
|
|
+ $(".nbprev").removeClass("disabled");
|
|
|
+ }
|
|
|
+ if(!$("#zbSeatchT [name='keywords']").val()&&!$("#zbSeatchT [name='industry']").val()){
|
|
|
+ getNewBids(currentPage);
|
|
|
+ }else{
|
|
|
+ if(!$("#right-table").hasClass("active")){
|
|
|
+ if(secondFlag=="T"){
|
|
|
+ $(".tabContainer").show();
|
|
|
+ $(".hasNoData").hide();
|
|
|
+ $(".nbnext").addClass("disabled");
|
|
|
+ appendDatas(secondList,true,false);
|
|
|
+ }else if(!nbflag&¤tPage<11){
|
|
|
+ getNewBiddings();
|
|
|
+ }else{
|
|
|
+ searchOnsubmit(true);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+//表格点击下一页
|
|
|
+// if(secondFlag=="T"){
|
|
|
+// $(".tabContainer").show();
|
|
|
+// $(".hasNoData").hide();
|
|
|
+// $(".nbnext").addClass("disabled");
|
|
|
+// appendDatas(secondList,true,false);
|
|
|
+// }else{
|
|
|
+// getVIPData(true);
|
|
|
+// }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+function prev(){
|
|
|
+ if($(".nbprev").hasClass("disabled")){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ $(".hasNoData").hide();
|
|
|
+ $(".working").show();
|
|
|
+ $(".tabContainer").hide();
|
|
|
+ $("#allnews").hide();
|
|
|
+ $(".pagination").hide();
|
|
|
+ currentPage = parseInt($(".pagination-inner").find("span").text())-parseInt(1)
|
|
|
+ if(currentPage==1){
|
|
|
+ $(".nbprev").addClass("disabled");
|
|
|
+ }else if(currentPage<10){
|
|
|
+ $(".nbnext").removeClass("disabled");
|
|
|
+ }
|
|
|
+ if(!$("#zbSeatchT [name='keywords']").val()&&!$("#zbSeatchT [name='industry']").val()){
|
|
|
+ getNewBids(currentPage);
|
|
|
+ }else{
|
|
|
+ if(!$("#right-table").hasClass("active")){
|
|
|
+ if(secondFlag=="T"){
|
|
|
+ $(".tabContainer").show();
|
|
|
+ $(".hasNoData").hide();
|
|
|
+ //$(".nbnext").addClass("disabled");
|
|
|
+ appendDatas(list,true,false);
|
|
|
+ }else if(!nbflag&¤tPage>0){
|
|
|
+ getNewBiddings();
|
|
|
+ }else{
|
|
|
+ searchOnsubmit(true);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+//表格点击上一页
|
|
|
+// getVIPData(true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//取redis里的数据
|
|
|
+function getNewBids(pnum, size){
|
|
|
+ $.post("/jylab/supsearch/getNewBids",{pageNumber:pnum,pageSize: size? size : pageSize, pageType:"", fileExists: $("#zbSeatchT [name='fileExists']").val(),bid_field: $("#zbSeatchT [name='bid_field']").val()},function(r){
|
|
|
+ if(r&&r.list!=null&&r.list.length>0){
|
|
|
+ $(".tabContainer").show();
|
|
|
+ //$(".pagination").show();
|
|
|
+ $(".hasNoData").hide();
|
|
|
+ //$(".pagination-inner").find("span").text(currentPage);
|
|
|
+ if(r.list.length<pageSize||currentPage==10){
|
|
|
+ $(".nbnext").addClass("disabled");
|
|
|
+ }else{
|
|
|
+ $(".nbnext").removeClass("disabled");
|
|
|
+ }
|
|
|
+ searchInnerVue.listState.total = Math.ceil(r.count/pageSize)
|
|
|
+ searchInnerVue.checkPageNumAdd1()
|
|
|
+ if (size) {
|
|
|
+ appendDatas(r.list,false,true, true);
|
|
|
+ } else {
|
|
|
+ appendDatas(r.list,false,true);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ submitflag=true;
|
|
|
+ $(".tabContainer").hide();
|
|
|
+ $(".pagination").hide();
|
|
|
+ $(".working").hide();
|
|
|
+ $(".hasNoData").show();
|
|
|
+ // 隐藏页码
|
|
|
+ searchInnerVue.showPage = false
|
|
|
+ }
|
|
|
+ // getBidIsColl()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+////最新招标信息
|
|
|
+function getNewBiddings(num, size){
|
|
|
+ // $("#newsclass").hide();
|
|
|
+ // $("#newsnow").show();
|
|
|
+ if(currentPage==1){
|
|
|
+ $(".nbprev").addClass("disabled");
|
|
|
+ }
|
|
|
+ var param = {
|
|
|
+ pageNumber: num ? num : currentPage,
|
|
|
+ pageSize: size ? size : pageSize,
|
|
|
+ reqType: "lastNews",
|
|
|
+ tabularflag: "Y",
|
|
|
+ searchvalue: $("#zbSeatchT [name='keywords']").val(),
|
|
|
+ area: $("#zbSeatchT [name='area']").val(),
|
|
|
+ subtype: $("#zbSeatchT [name='subtype']").val(),
|
|
|
+ publishtime: $("#zbSeatchT [name='publishtime']").val(),
|
|
|
+ selectType : $("#zbSeatchT [name='selectType']").val() || 'title,content',
|
|
|
+ minprice : $("#zbSeatchT [name='minprice']").val(),
|
|
|
+ maxprice : $("#zbSeatchT [name='maxprice']").val(),
|
|
|
+ industry : $("#zbSeatchT [name='industry']").val(),
|
|
|
+ buyerclass: $("#zbSeatchT [name='buyerclass']").val(),
|
|
|
+ buyertel: $("#zbSeatchT [name='buyertel']").val(),
|
|
|
+ winnertel: $("#zbSeatchT [name='winnertel']").val(),
|
|
|
+ notkey: $(".not-key-input-group input").val().slice(0, 10),
|
|
|
+ fileExists: $("#zbSeatchT [name='fileExists']").val(),
|
|
|
+ city: $("#zbSeatchT [name='city']").val(),
|
|
|
+ bid_field: $("#zbSeatchT [name='bid_field']").val()
|
|
|
+ };
|
|
|
+ $.post("/front/pcAjaxReq",param,function(r){
|
|
|
+ if(r&&r.list!=null&&r.list.length>0){
|
|
|
+ // 计算总页码
|
|
|
+ if (currentPage == 1) {
|
|
|
+ searchInnerVue.listState.total = Math.ceil(r.count/pageSize)
|
|
|
+ searchInnerVue.checkPageNumAdd1()
|
|
|
+ }
|
|
|
+ $(".tabContainer").show();
|
|
|
+ //$(".pagination").show();
|
|
|
+ $(".hasNoData").hide();
|
|
|
+ //$(".pagination-inner").find("span").text(currentPage);
|
|
|
+ if(r.list.length<pageSize||currentPage==10){
|
|
|
+ $(".nbnext").addClass("disabled");
|
|
|
+ }else{
|
|
|
+ $(".nbnext").removeClass("disabled");
|
|
|
+ }
|
|
|
+ if (size && num === 1) {
|
|
|
+ appendDatas(r.list,true,true, true);
|
|
|
+ } else {
|
|
|
+ appendDatas(r.list,false,false);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if(currentPage>1){
|
|
|
+ $(".nbnext").addClass("disabled");
|
|
|
+ if(currentPage==2){
|
|
|
+ $(".nbprev").addClass("disabled");
|
|
|
+ }
|
|
|
+ currentPage = currentPage-1;
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ submitflag=true;
|
|
|
+ $(".tabContainer").hide();
|
|
|
+ $(".pagination").hide();
|
|
|
+ $(".working").hide();
|
|
|
+ $(".hasNoData").show();
|
|
|
+ // 隐藏页码
|
|
|
+ searchInnerVue.showPage = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+//
|
|
|
+
|
|
|
+function appendDatas(datas,flag,isNew,onlyUpdateTable){
|
|
|
+ // flag // 是否有输入
|
|
|
+ let is_field=$("#zbSeatchT [name='bid_field']").val() //是否是领域化
|
|
|
+ let selectContext=selectType.indexOf('content') > -1 //是否正文搜索
|
|
|
+ console.log('selectType: ' + selectType,',flag: ',flag)
|
|
|
+ var listHtml = '';
|
|
|
+ var tableHtml = '';
|
|
|
+ $(".working").hide();
|
|
|
+ $(".pagination").show();
|
|
|
+ // 显示页码
|
|
|
+ searchInnerVue.showPage = true
|
|
|
+ var searchvalueArray = searchvalue.split("+");
|
|
|
+ $(".pagination-inner").find("span").text(currentPage);
|
|
|
+ if(datas.length<pageSize){
|
|
|
+ $(".nbnext").addClass("disabled");
|
|
|
+ }
|
|
|
+ if(!isNew && typeof(totalPage) != "undefined"){
|
|
|
+ if(currentPage == totalPage){
|
|
|
+ $(".nbnext").addClass("disabled");
|
|
|
+ }else{
|
|
|
+ $(".nbnext").removeClass("disabled");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //(数据够20条显示查看更多遮罩层)
|
|
|
+ if (currentPage==1){//第一页得时候需要判断 是否显示遮罩层
|
|
|
+ if(datas.length>=20){
|
|
|
+ $(".shade_table").css("display","");
|
|
|
+ }else{
|
|
|
+ $(".shade_table").css("display","none");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for(var i=0;i<datas.length;i++){
|
|
|
+ var index = (currentPage - 1) * pageSize + i + 1;
|
|
|
+ var title = datas[i].title;
|
|
|
+ var detail = datas[i].detail;
|
|
|
+ var fileExists = datas[i].fileExists
|
|
|
+ if(detail){
|
|
|
+ detail = detail.replace(/[^\{\u4e00-\u9fa5]{1,90}{[^\}\u4e00-\u9fa5]+?}/g,"")
|
|
|
+ if(detail.length>200){
|
|
|
+ detail = detail.substring(0,200)+"..."
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(flag){
|
|
|
+ title = keyWordHighlight(title,searchvalueArray,"<font class='com-highlight'>$1</font>");
|
|
|
+ title=title.replace(/\<br>/g,"")
|
|
|
+ detail = keyWordHighlight(detail,searchvalueArray,"<font class='com-highlight'>$1</font>");
|
|
|
+ }
|
|
|
+ if(title.length<40){
|
|
|
+ title=title+"<span style='color:#fff;display:none;'>"+Math.random().toString(36).substring(2)+"<span>";
|
|
|
+ }
|
|
|
+ var type = datas[i].subtype;
|
|
|
+ if(typeof(type) == "undefined" || type == null || type == ""){
|
|
|
+ type = datas[i].toptype;
|
|
|
+ }
|
|
|
+ if(typeof(type) == "undefined" || type == null || type == ""){
|
|
|
+ type = datas[i].type;
|
|
|
+ if(type == "bid"){
|
|
|
+ type = "中标";
|
|
|
+ datas[i].stypeadd="ZHB"
|
|
|
+ }else if(type == "tender"){
|
|
|
+ datas[i].stypeadd="ZB"
|
|
|
+ type = "招标";
|
|
|
+ }else{
|
|
|
+ type = "";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!onlyUpdateTable){ //是否仅更新table
|
|
|
+ listHtml += '<li>'
|
|
|
+ //if(datas.length==(i+1)){
|
|
|
+ // listHtml +='<div class="liLuceneList">'
|
|
|
+ //}else{
|
|
|
+ listHtml +='<div class="liLuceneList" style="border-bottom: 1px solid #EBEBEB;">'
|
|
|
+ //}
|
|
|
+ // 标题搜索 选择框
|
|
|
+ if (!selectContext || !flag) {
|
|
|
+ listHtml += '<input class="custom-checkbox title-text-checkbox" name="bid-list" type="checkbox" dataid="'+datas[i]._id+'" />'
|
|
|
+ listHtml +='<div class="luce-left">'
|
|
|
+ if(datas[i].site == '剑鱼信息发布平台') {
|
|
|
+ listHtml += '<span class="userPublish">用户发布</span>'
|
|
|
+ }
|
|
|
+ listHtml += '<em class="visited-hd">'+index+'.</em>'
|
|
|
+ +'<div class="left-title" style="width:auto;max-width:700px">'
|
|
|
+ +'<a class="visited-hd" onclick="noIn(this)" dataid="'+datas[i]._id+'" dataindustry="'+datas[i].industry+'" target="_blank"> '+title+ '</a>'
|
|
|
+ if(fileExists) {
|
|
|
+ listHtml+='<span class="haveFile">'+'有附件'+'</span>'
|
|
|
+ }
|
|
|
+ listHtml+='</div>'
|
|
|
+ }
|
|
|
+ // 全文搜索
|
|
|
+ if(flag && selectContext){
|
|
|
+ listHtml +='<div class="luce-left">'
|
|
|
+ if(datas[i].site == '剑鱼信息发布平台') {
|
|
|
+ listHtml += '<span class="userPublish">用户发布</span>'
|
|
|
+ listHtml += '<em class="visited-hd">'+index+'.</em>'
|
|
|
+ +'<div class="left-title" style="width:auto;max-width:1080px">'
|
|
|
+ +'<a class="visited-hd" onclick="noIn(this)" dataid="'+datas[i]._id+'" dataindustry="'+datas[i].industry+'" target="_blank"> '+title+ '</a>'
|
|
|
+ } else {
|
|
|
+ listHtml +='<em class="visited-hd" style="padding-left:30px;">'+index+'.</em>'
|
|
|
+ +'<div class="left-title" style="width:auto;max-width:1080px">'
|
|
|
+ +'<a class="visited-hd" onclick="noIn(this)" dataid="'+datas[i]._id+'" dataindustry="'+datas[i].industry+'" target="_blank"> '+title+ '</a>'
|
|
|
+ }
|
|
|
+ if(fileExists) {
|
|
|
+ listHtml+='<span class="haveFile">'+'有附件'+'</span>'
|
|
|
+ }
|
|
|
+ listHtml+='</div>'
|
|
|
+ // 全文搜索选择框
|
|
|
+ listHtml += '<div class="left-content" style="width:100%;padding:0;">'
|
|
|
+ + '<input class="custom-checkbox all-text-checkbox" name="bid-list" type="checkbox" dataid="'+datas[i]._id+'" />'
|
|
|
+ +'<a style="float:left;width:calc(100% - 32px)" href="javascript:volid(0);">'+detail+'...</a>'
|
|
|
+ +'</div>'
|
|
|
+ }
|
|
|
+ listHtml += '</div><div class="luce-right">'
|
|
|
+ if($.trim(datas[i].area) != "" && datas[i].area != "A"){
|
|
|
+
|
|
|
+ listHtml += '<a href="javascript:;"'+'onclick="gologin('+"'/list/area/"+datas[i].areaadd+".html')"+'">'+datas[i].area+'</a>';
|
|
|
+ }else{
|
|
|
+ listHtml += '<a href="#" style="display:none;"></a>';
|
|
|
+ }
|
|
|
+ if(typeof(type) != "undefined" && type != null && type != ""){
|
|
|
+ // listHtml += '<a href="/list/stype/'+datas[i].stypeadd+'.html">'+type+'</a>';
|
|
|
+ listHtml += '<a href="javascript:;"'+'onclick="gologin('+"'/list/stype/"+datas[i].stypeadd+".html')"+'">'+type+'</a>';
|
|
|
+ }else{
|
|
|
+ listHtml += '<a href="#" style="display:none;"></a>';
|
|
|
+ }
|
|
|
+ //
|
|
|
+ if(typeof(datas[i].industry) != "undefined" && datas[i].industry != null && datas[i].industry != ""&&!is_field){
|
|
|
+ // listHtml += '<a href="/list/industry/'+datas[i].indadd+'.html">'+datas[i].industry+'</a>';
|
|
|
+ listHtml += '<a href="javascript:;"'+'onclick="gologin('+"'/list/industry/"+datas[i].indadd+".html')"+'">'+datas[i].industry+'</a>';
|
|
|
+ }else{
|
|
|
+ listHtml += '<a href="javascript:volid(0);" style="display:none;"></a>';
|
|
|
+ }
|
|
|
+ // vipState付费用户显示采购单位类型 免费用户不显示
|
|
|
+ // if(typeof(datas[i].buyerclass) != "undefined" && datas[i].buyerclass != null && datas[i].buyerclass != "" && vipState){
|
|
|
+ // listHtml += '<a href="javascript:;">'+datas[i].buyerclass+'</a>';
|
|
|
+ // }else{
|
|
|
+ // listHtml += '<a href="javascript:volid(0);" style="display:none;"></a>';
|
|
|
+ // }
|
|
|
+
|
|
|
+ var amount= getacount(datas[i].bidamount,datas[i].budget)
|
|
|
+ if(amount!=""){
|
|
|
+ listHtml += '<a>'+conversionMoeny(amount)+'</a>';
|
|
|
+ }else{
|
|
|
+ listHtml += '<a href="javascript:volid(0);" style="display:none;"></a>';
|
|
|
+ }
|
|
|
+
|
|
|
+ //
|
|
|
+ if(typeof(datas[i].publishtime) != "undefined" && datas[i].publishtime != null && datas[i].publishtime != ""){
|
|
|
+ var diff = utils.dateFromNow(Number(datas[i].publishtime+"000"));
|
|
|
+ if(diff != null){
|
|
|
+ listHtml += '<span class="com-time">'+diff+'</span>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 是否收藏
|
|
|
+ listHtml += '<i class="icon-collect" dataid="'+datas[i]._id+'"></i>'
|
|
|
+ // 是否山川应用嵌入环境 添加操作按钮
|
|
|
+ var inInjectBI = getParam('report') === 'bi' || (location.href.indexOf('/jylab/bi/index') !== -1)
|
|
|
+ if (inInjectBI) {
|
|
|
+ listHtml += '<button class="bi-report-inject-button" data-id="'+datas[i]._id+'">添加</button>'
|
|
|
+ }
|
|
|
+ listHtml += '</div>'
|
|
|
+
|
|
|
+
|
|
|
+ //领域化展示 商品&采购单位&中标单位
|
|
|
+ if (is_field && !selectContext){
|
|
|
+ listHtml += '<div class="luce-field">'
|
|
|
+ if (typeof(datas[i].purchasing) != "undefined" && datas[i].purchasing != null && datas[i].purchasing != ""){
|
|
|
+ listHtml += '<div class="nowrap"><span>产品</span><span>'+datas[i].purchasing +'</span></div>'
|
|
|
+ }
|
|
|
+
|
|
|
+ let secondLine=''
|
|
|
+ if (typeof(datas[i].buyer) != "undefined" && datas[i].buyer != null && datas[i].buyer != ""){
|
|
|
+ secondLine += '<div class="nowrap"><span>采购单位</span><span>'+datas[i].buyer +'</span></div>'
|
|
|
+ }
|
|
|
+
|
|
|
+ if (typeof(datas[i].s_winner) != "undefined" && datas[i].s_winner != null && datas[i].s_winner != ""){
|
|
|
+ secondLine += '<div class="nowrap"><span>中标单位</span><span>'+datas[i].s_winner +'</span></div>'
|
|
|
+ }
|
|
|
+
|
|
|
+ if (secondLine!=='') {
|
|
|
+ listHtml += '<div class="secondLine">'+secondLine+'</div>'
|
|
|
+ }
|
|
|
+
|
|
|
+ listHtml += '</div>'
|
|
|
+ }
|
|
|
+
|
|
|
+ listHtml += '</div></li>';
|
|
|
+
|
|
|
+ if(i == 5) {
|
|
|
+ listHtml += '<div data-list-ad class="_t3di2018y5"></div>'
|
|
|
+ }
|
|
|
+ if(i == 26) {
|
|
|
+ listHtml += '<div data-list-ad class="_6omliqck79a"></div>'
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //表格仅显示前20条信息
|
|
|
+ if (i >= 20||currentPage!=1){
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ tableHtml +='<tr onclick="noIn(this)" dataid="'+datas[i]._id+'" dataindustry="'+datas[i].industry+'" target="_blank">'
|
|
|
+ +'<td width="48"><div>'+index+'</div></td>'
|
|
|
+ if(typeof(datas[i].projectname) != "undefined" && datas[i].projectname != null && datas[i].projectname != ""){
|
|
|
+ datas[i].projectname = keyWordHighlight(datas[i].projectname,searchvalueArray,"<font class='com-highlight'>$1</font>");
|
|
|
+ tableHtml += '<td class="tt-l" width="315"><div>'+datas[i].projectname+'</div></td>';
|
|
|
+ }else{
|
|
|
+ let title=datas[i].title.replace(/\<br>/g,"")
|
|
|
+ tableHtml += '<td class="tt-l" width="315"><div>'+title+'</div></td>';
|
|
|
+ }
|
|
|
+
|
|
|
+ if(typeof(type) != "undefined" && type != null && type != ""){
|
|
|
+ tableHtml += '<td width="84"><div>'+type+'公告</div></td>';
|
|
|
+ }else{
|
|
|
+ tableHtml += '<td width="84"><div></div></td>';
|
|
|
+ }
|
|
|
+
|
|
|
+ if(typeof(datas[i].budget) != "undefined" && datas[i].budget != null && datas[i].budget != ""){
|
|
|
+ var budget = tableFormatMoney(datas[i].budget, {
|
|
|
+ type: 'number',
|
|
|
+ digit: 2,
|
|
|
+ level: 1
|
|
|
+ })
|
|
|
+ tableHtml += '<td class="tt-r" width="73"><div>'+budget+'</div></td>';
|
|
|
+ }else{
|
|
|
+ tableHtml += '<td class="tt-r" width="73"><div></div></td>';
|
|
|
+ }
|
|
|
+ if(typeof(datas[i].buyer) != "undefined" && datas[i].buyer != null && datas[i].buyer != ""){
|
|
|
+ tableHtml += '<td class="tt-l" width="181"><div>'+datas[i].buyer+'</div></td>';
|
|
|
+ }else{
|
|
|
+ tableHtml += '<td class="tt-l" width="181"><div></div></td>';
|
|
|
+ }
|
|
|
+ if(typeof(datas[i].bidopentime) != "undefined" && datas[i].bidopentime != null && datas[i].bidopentime != ""){
|
|
|
+ var diff = formatDate(Number(datas[i].bidopentime),"l");
|
|
|
+ tableHtml += '<td width="103"><div>'+diff+'</div></td>';
|
|
|
+ }else{
|
|
|
+ tableHtml += '<td width="103"><div></div></td>';
|
|
|
+ }
|
|
|
+ if(typeof(datas[i].winner) != "undefined" && datas[i].winner != null && datas[i].winner != ""){
|
|
|
+ tableHtml += '<td class="tt-l" width="174"><div>'+datas[i].winner+'</div></td>';
|
|
|
+ }else{
|
|
|
+ tableHtml += '<td class="tt-l" width="174"><div></div></td>';
|
|
|
+ }
|
|
|
+ if(typeof(datas[i].bidamount) != "undefined" && datas[i].bidamount != null && datas[i].bidamount != ""){
|
|
|
+ var bidamount = tableFormatMoney(datas[i].bidamount, {
|
|
|
+ type: 'number',
|
|
|
+ digit: 2,
|
|
|
+ level: 1
|
|
|
+ })
|
|
|
+ tableHtml += '<td class="tt-r" width="76"><div>'+bidamount+'</div></td>';
|
|
|
+ }else{
|
|
|
+ tableHtml += '<td class="tt-r" width="76"><div></div></td>';
|
|
|
+ }
|
|
|
+
|
|
|
+ if(typeof(datas[i].publishtime) != "undefined" && datas[i].publishtime != null && datas[i].publishtime != ""){
|
|
|
+ var diff = formatDate(Number(datas[i].publishtime),"s");
|
|
|
+ if(diff != null){
|
|
|
+ tableHtml += '<td width="103"><div>'+diff+'</div></td>';
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ tableHtml += '<td width="103"><div></div></td>';
|
|
|
+ }
|
|
|
+ tableHtml+='</tr>'
|
|
|
+ }
|
|
|
+ // 搜索框有输入词
|
|
|
+ if(flag){
|
|
|
+ if(selectContext) {
|
|
|
+ $("#allnews").show();
|
|
|
+ $(".tabContainer-2").hide();
|
|
|
+ } else {
|
|
|
+ $("#allnews").hide();
|
|
|
+ $(".tabContainer-2").show();
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ $("#allnews").hide();
|
|
|
+ $(".tabContainer-2").show();
|
|
|
+ }
|
|
|
+
|
|
|
+ if (currentPage!=1){
|
|
|
+ tableHtml = sessionStorage.getItem("table_first_context")
|
|
|
+ }else{
|
|
|
+ sessionStorage.setItem("table_first_context",tableHtml)
|
|
|
+ }
|
|
|
+ //console.log(listHtml)
|
|
|
+ // 没有关键词或者没有选中正文
|
|
|
+ if(!flag||!selectContext){
|
|
|
+ if (!onlyUpdateTable){
|
|
|
+ $(".tabContainer-2 .lucene ul").html(listHtml);
|
|
|
+ }
|
|
|
+ $(".tabContainer-2 .lucene-table table tbody").html(tableHtml);
|
|
|
+ }else{
|
|
|
+ if(selectContext){
|
|
|
+ if (!onlyUpdateTable){
|
|
|
+ $("#allnews .lucene ul").html(listHtml);
|
|
|
+ }
|
|
|
+ $("#allnews .lucene-table table tbody").html(tableHtml);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $(".tabContainer").css("min-height","");
|
|
|
+ submitflag=true;
|
|
|
+ // backTopAdjust();
|
|
|
+ // 生成dom之后再查标讯有无收藏
|
|
|
+ getBidIsColl()
|
|
|
+ checkVisited()
|
|
|
+ // 生成dom之后再查询是否勾选
|
|
|
+ getCheckList()
|
|
|
+ /**
|
|
|
+ * @date 2022/12/15 山川环境嵌入搜索
|
|
|
+ * 更新是否已添加状态
|
|
|
+ */
|
|
|
+ InBIInjectHooks.check()
|
|
|
+}
|
|
|
+
|
|
|
+function getacount(bidamount,budget){
|
|
|
+ if(typeof(bidamount) != "undefined" && bidamount != null && bidamount != ""){
|
|
|
+ return bidamount
|
|
|
+ }
|
|
|
+ if(typeof(budget) != "undefined" && budget != null && budget != ""){
|
|
|
+ return budget
|
|
|
+ }
|
|
|
+ return ""
|
|
|
+}
|
|
|
+
|
|
|
+//金额转化 金额:0-万元以下单位为元 ,万元以上至亿元以下单位为万元 ,亿元以上单位为亿元。保留 小数点后 2 位,不进行四舍五入。
|
|
|
+function conversionMoeny(money){
|
|
|
+ var m = ""+money;
|
|
|
+ var m_arr = m.split(".")
|
|
|
+ var m_1 = m_arr[0]
|
|
|
+ var len_m1 = m_1.length;
|
|
|
+ if (len_m1 >= 9 ){
|
|
|
+ m = m_1.substring(0,len_m1-8) + "." + m_1.substring(len_m1-8,len_m1-6) + "亿元"
|
|
|
+ } else if (len_m1 >= 5) {
|
|
|
+ m =m_1.substring(0,len_m1-4) + "." + m_1.substring(len_m1-4,len_m1-2) + "万元"
|
|
|
+ } else {
|
|
|
+ if(m_arr.length == 1) {
|
|
|
+ return m + ".00元"
|
|
|
+ }
|
|
|
+ var m_2 = m_arr[1]
|
|
|
+ if (m_2.length > 1) {
|
|
|
+ m_2 = m_2.substring(0,2)
|
|
|
+ } else {
|
|
|
+ m_2 = m_2.substring(0,1) + "0"
|
|
|
+ }
|
|
|
+ m = m_1 + "." + m_2 + "元"
|
|
|
+ }
|
|
|
+ return m
|
|
|
+}
|
|
|
+
|
|
|
+//关闭遮罩层
|
|
|
+function layerClose(){
|
|
|
+ $("#myModal").modal("hide");
|
|
|
+}
|
|
|
+//
|
|
|
+function formatDate(date,sl) {
|
|
|
+ var myDate = new Date(date*1000);
|
|
|
+ var year=myDate.getFullYear();
|
|
|
+ var month=myDate.getMonth()+1;
|
|
|
+ var date=myDate.getDate();
|
|
|
+ var hour = myDate.getHours()
|
|
|
+ var min = myDate.getMinutes()
|
|
|
+ if(sl=="l"){
|
|
|
+ if(hour<10){
|
|
|
+ hour="0"+hour
|
|
|
+ }
|
|
|
+ if(min<10){
|
|
|
+ min="0"+min
|
|
|
+ }
|
|
|
+ return year+"-"+month+"-"+date+"<br>"+hour+":"+min;
|
|
|
+ }else{
|
|
|
+ return year+"-"+month+"-"+date;
|
|
|
+ }
|
|
|
+}
|
|
|
+//
|
|
|
+function onpicking(dp,obj){
|
|
|
+ var time = new Date(dp.cal.newdate.y,dp.cal.newdate.M-1,dp.cal.newdate.d).getTime()+"";
|
|
|
+ time = time.substring(0,time.length - 3);
|
|
|
+ $(obj).attr("data-value",time);
|
|
|
+}
|
|
|
+//
|
|
|
+function onclearing(obj){
|
|
|
+ $(obj).attr("data-value","");
|
|
|
+ //localStorage.removeItem($(obj).attr("id"))
|
|
|
+ if($(".customtime").hasClass("active") && getInputTime().join("") == ""){
|
|
|
+ $(".customtime").removeClass("active");
|
|
|
+ $("#publishtime #alltime").addClass("active");
|
|
|
+ }
|
|
|
+}
|
|
|
+//
|
|
|
+function picked(dp,obj){
|
|
|
+ //localStorage.setItem($(obj).attr("id"),$(obj).val()+"_"+$(obj).attr("data-value"))
|
|
|
+}
|
|
|
+//
|
|
|
+function getInputTime(){
|
|
|
+ var starttime = $("#starttime").attr("data-value");
|
|
|
+ if(starttime){
|
|
|
+ starttime = $.trim(starttime);
|
|
|
+ }else{
|
|
|
+ starttime = "";
|
|
|
+ }
|
|
|
+ var endtime = $("#endtime").attr("data-value");
|
|
|
+ if(endtime){
|
|
|
+ endtime = $.trim(endtime);
|
|
|
+ }else{
|
|
|
+ endtime = "";
|
|
|
+ }
|
|
|
+ return [starttime,endtime]
|
|
|
+}
|
|
|
+
|
|
|
+//---取VIP数据---
|
|
|
+function getVIPData(clickpaging){
|
|
|
+ var this_selectType = $("#zbSeatchT [name='selectType']").val();
|
|
|
+ if(this_selectType != "all"){
|
|
|
+ LimitClass.limitFlag = false;
|
|
|
+ LimitClass.result = null;
|
|
|
+ LimitClass.list = null;
|
|
|
+ }else{
|
|
|
+ if(LimitClass.limitFlag){
|
|
|
+ if(clickpaging){
|
|
|
+ LimitClass.paging(currentPage);
|
|
|
+ }else{
|
|
|
+ $(".tabContainer .lucene").hide();
|
|
|
+ $(".tabContainer .lucene-table").show();
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var tlflag = false;
|
|
|
+ $(".tabContainer-2 .lucene").hide();
|
|
|
+ $("#allnews").hide();
|
|
|
+ $(".pagination").hide();
|
|
|
+ $(".working").show();
|
|
|
+ // 隐藏页码
|
|
|
+ searchInnerVue.showPage = false
|
|
|
+ if(!$("#zbSeatchT [name='keywords']").val()&&!$("#zbSeatchT [name='keywords']").val()&&!$("#zbSeatchT [name='industry']").val()){
|
|
|
+ $(".working").hide();
|
|
|
+ $(".pagination").show();
|
|
|
+ // 显示页码
|
|
|
+ searchInnerVue.showPage = true
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ var tabflag = false;
|
|
|
+ if($("#zbSeatchT [name='keywords']").val()!=""){
|
|
|
+ // $("#newsclass").show();
|
|
|
+ // $("#newsnow").hide();
|
|
|
+ tlflag = true;
|
|
|
+ }else{
|
|
|
+ // $("#newsclass").hide();
|
|
|
+ // $("#newsnow").show();
|
|
|
+ tlflag = false;
|
|
|
+ }
|
|
|
+ if(currentPage==1){
|
|
|
+ $(".nbprev").addClass("disabled");
|
|
|
+ }
|
|
|
+ var reqType="bidSearch";
|
|
|
+ if($("#zbSeatchT [name='keywords']").val()==""){
|
|
|
+ reqType="lastNews";
|
|
|
+ }
|
|
|
+ var param = {
|
|
|
+ pageNumber: 1,
|
|
|
+ pageSize: pageSize,
|
|
|
+ reqType: reqType,
|
|
|
+ searchvalue: $("#zbSeatchT [name='keywords']").val(),
|
|
|
+ area: $("#zbSeatchT [name='area']").val(),
|
|
|
+ subtype: $("#zbSeatchT [name='subtype']").val(),
|
|
|
+ publishtime: $("#zbSeatchT [name='publishtime']").val(),
|
|
|
+ selectType : this_selectType || 'title,content',
|
|
|
+ minprice : $("#zbSeatchT [name='minprice']").val(),
|
|
|
+ maxprice : $("#zbSeatchT [name='maxprice']").val(),
|
|
|
+ industry : $("#zbSeatchT [name='industry']").val(),
|
|
|
+ tabularflag : tabularflag,
|
|
|
+ buyerclass: $("#zbSeatchT [name='buyerclass']").val(),
|
|
|
+ buyertel: $("#zbSeatchT [name='buyertel']").val(),
|
|
|
+ winnertel: $("#zbSeatchT [name='winnertel']").val(),
|
|
|
+ notkey: $(".not-key-input-group input").val().slice(0, 10),
|
|
|
+ fileExists: $("#zbSeatchT [name='fileExists']").val(),
|
|
|
+ city: $("#zbSeatchT [name='city']").val(),
|
|
|
+ bid_field: $("#zbSeatchT [name='bid_field']").val()
|
|
|
+ };
|
|
|
+ $.ajax({
|
|
|
+ type:'post',
|
|
|
+ url:'/front/pcAjaxReq',
|
|
|
+ async:false,
|
|
|
+ data:param,
|
|
|
+ dataType:'json',
|
|
|
+ success:function(r){
|
|
|
+ afterAjaxReq(r);
|
|
|
+ if(r&&r.list!=null&&r.list.length>0){
|
|
|
+ $(".hasNoData").hide();
|
|
|
+ if(r.list.length<pageSize||currentPage==10){
|
|
|
+ $(".nbnext").addClass("disabled");
|
|
|
+ }else{
|
|
|
+ $(".nbnext").removeClass("disabled");
|
|
|
+ }
|
|
|
+ // appendDatas(r.list,tlflag,true,true);
|
|
|
+ appendDatas(r.list,tlflag,true,false);
|
|
|
+ }else{
|
|
|
+ $(".working").hide();
|
|
|
+ $(".hasNoData").show();
|
|
|
+ // 隐藏页码
|
|
|
+ searchInnerVue.showPage = false
|
|
|
+ }
|
|
|
+ tabflag = true;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return tabflag
|
|
|
+}
|
|
|
+///
|
|
|
+function beforeSubmit(n){
|
|
|
+ // n有值即执行的是点击搜索按钮或回车搜索事件
|
|
|
+ // n有值且关键词不为空时 存sessionStorage值
|
|
|
+ if ($("#zbSeatchT [name='keywords']").val() !=="") {
|
|
|
+ sessionStorage.setItem('is-click-search', 1)
|
|
|
+ } else {
|
|
|
+ sessionStorage.removeItem('is-click-search')
|
|
|
+ }
|
|
|
+ // 重置全选按钮
|
|
|
+ $('.custom-checkbox.check-all').prop('checked', false)
|
|
|
+ $(".hasNoData").hide();
|
|
|
+ $(".working").show();
|
|
|
+ // 隐藏页码
|
|
|
+ searchInnerVue.showPage = false
|
|
|
+ //$(".tabContainer-2 .lucene ul").html("");
|
|
|
+ //$(".tabContainer-2 .lucene-table table tbody").html("");
|
|
|
+ $(".tabContainer .lucene ul").html("");
|
|
|
+ //$(".tabContainer .lucene-table table tbody").html("");
|
|
|
+ $(".tabContainer").css("min-height","600px");
|
|
|
+ $("#right-list").addClass("active").siblings().removeClass("active");
|
|
|
+ $(".tabContainer-2 .lucene").show().siblings().hide();
|
|
|
+ $("#right-list").addClass("active").siblings().removeClass("active");
|
|
|
+ $("#allnews .lucene").show().siblings().hide();
|
|
|
+ $(".tabContainer-2").hide();
|
|
|
+ $("#allnews").hide();
|
|
|
+ $(".pagination").hide();
|
|
|
+ setTimeout(function(){
|
|
|
+ currentPage=1;
|
|
|
+ // 重置element ui页码为1
|
|
|
+ searchInnerVue.listState.num = 1
|
|
|
+ //时间
|
|
|
+ if(currentPage==1){
|
|
|
+ $(".nbprev").addClass("disabled");
|
|
|
+ }
|
|
|
+ var publishtime = null;
|
|
|
+ var timeslot = getInputTime().join("_");
|
|
|
+ if($(".timerInput").hasClass("active")){
|
|
|
+ if(timeslot != "_"){
|
|
|
+ $("#zbSeatchT [name='publishtime']").val(timeslot);
|
|
|
+ }else{
|
|
|
+ $("#zbSeatchT [name='publishtime']").val("");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ publishtime = $(".timer .active").attr("data-value");
|
|
|
+ if(typeof(publishtime) != "undefined"){
|
|
|
+ $("#zbSeatchT [name='publishtime']").val(publishtime);
|
|
|
+ }else{
|
|
|
+ $("#zbSeatchT [name='publishtime']").val("");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(timeslot != "_"){
|
|
|
+ $("#zbSeatchT [name='timeslot']").val(timeslot);
|
|
|
+ }else{
|
|
|
+ $("#zbSeatchT [name='timeslot']").val("");
|
|
|
+ }
|
|
|
+ //地区
|
|
|
+ // var selectAreas = "";
|
|
|
+ // $(".region-content .active:not(.parent-node)").each(function(){
|
|
|
+ // var thisText = $(this).text();
|
|
|
+ // if(thisText != "全国"){
|
|
|
+ // if(selectAreas != ""){
|
|
|
+ // selectAreas += ",";
|
|
|
+ // }
|
|
|
+ // selectAreas += thisText;
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // $("#zbSeatchT [name='area']").val(selectAreas);
|
|
|
+ //类型
|
|
|
+ var selectSubTypes = "";
|
|
|
+ $(".info-content .active:not(.parent-node)").each(function(){
|
|
|
+ if($(this).attr("id") == "whole"||$(this).attr("id") == "infoBtn"){
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ var thisText = $(this).attr("data-value");
|
|
|
+ if (thisText!=undefined){
|
|
|
+ if(selectSubTypes != ""){
|
|
|
+ selectSubTypes += ",";
|
|
|
+ }
|
|
|
+ selectSubTypes += thisText;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // 信息类型二级分类全选只传一级分类文案
|
|
|
+ $(".info-content .parent-node").each(function(){
|
|
|
+ if($(this).attr("id") == "whole"||$(this).attr("id") == "infoBtn"){
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ var thisHaveClass = $(this).hasClass("active");
|
|
|
+ let thisText = $(this).text()
|
|
|
+ if (thisHaveClass){
|
|
|
+ if(thisText == '招标预告') {
|
|
|
+ selectSubTypes = selectSubTypes.replace(/预告,预审,预审结果,论证意见,需求公示/, "招标预告")
|
|
|
+ } else if(thisText == '招标公告') {
|
|
|
+ selectSubTypes = selectSubTypes.replace(/招标,邀标,询价,竞谈,单一,竞价,变更/, "招标公告")
|
|
|
+ } else if(thisText == '招标结果') {
|
|
|
+ selectSubTypes = selectSubTypes.replace(/中标,成交,废标,流标/, "招标结果")
|
|
|
+ } else if(thisText == '招标信用信息') {
|
|
|
+ selectSubTypes = selectSubTypes.replace(/合同,验收,违规/, "招标信用信息")
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $("#zbSeatchT [name='subtype']").val(selectSubTypes);
|
|
|
+ //行业
|
|
|
+ var selectIndustrys = "";
|
|
|
+ var thisText = "";
|
|
|
+ $(".industry-content .active").each(function(){
|
|
|
+ if($(this).attr("id") == "induAll"){
|
|
|
+ return true;
|
|
|
+ }else if($(this).hasClass("active")&&$(this).hasClass("parent-node")){
|
|
|
+ $(this).nextUntil(".diver").each(function(){
|
|
|
+ thisText = $(this).attr("data-value");
|
|
|
+ if(selectIndustrys != ""){
|
|
|
+ selectIndustrys += ",";
|
|
|
+ }
|
|
|
+ selectIndustrys += thisText;
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ thisText = $(this).attr("data-value");
|
|
|
+ if(selectIndustrys != ""){
|
|
|
+ selectIndustrys += ",";
|
|
|
+ }
|
|
|
+ selectIndustrys += thisText;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $("#zbSeatchT [name='industry']").val(selectIndustrys);
|
|
|
+ //价格
|
|
|
+ if(!$("#priceAll").hasClass("active")){
|
|
|
+ var selectMinPrices = $(".PriceInput [name='minprice']").val();
|
|
|
+ var selectMaxPrices = $(".PriceInput [name='maxprice']").val();
|
|
|
+ $("#zbSeatchT [name='minprice']").val(selectMinPrices);
|
|
|
+ $("#zbSeatchT [name='maxprice']").val(selectMaxPrices);
|
|
|
+ }else{
|
|
|
+ $("#zbSeatchT [name='minprice']").val("");
|
|
|
+ $("#zbSeatchT [name='maxprice']").val("");
|
|
|
+ }
|
|
|
+ //搜索关键词
|
|
|
+ var searchname = $("#zbSeatchT input[name='keywords']").val();
|
|
|
+ //$("#zbSeatchT input[name='searchvalue']").val($.trim(searchname));
|
|
|
+ // 采购单位类型
|
|
|
+ var buyerTypeArr = ""
|
|
|
+ var buyerText = ""
|
|
|
+ $(".buyclass .active").each(function(){
|
|
|
+ if ($(this).hasClass('buyclass-all')) {
|
|
|
+ return true
|
|
|
+ } else if ($(this).hasClass('buy-list')) {
|
|
|
+ if ($(this).attr("data-value")) {
|
|
|
+ buyerText = $(this).attr("data-value");
|
|
|
+ if(buyerTypeArr != ""){
|
|
|
+ buyerTypeArr += ",";
|
|
|
+ }
|
|
|
+ buyerTypeArr += buyerText;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ //采购单位类型
|
|
|
+ $("#zbSeatchT [name='buyerclass']").val(buyerTypeArr)
|
|
|
+ // $("#buyerInput").val(buyerTypeArr);
|
|
|
+ //采购单位联系方式有无
|
|
|
+ $("#zbSeatchT [name='buyertel']").val($(".custom-input[name='buyertel']").attr('data-value'));
|
|
|
+ //中标单位联系方式有无
|
|
|
+ $("#zbSeatchT [name='winnertel']").val($(".custom-input[name='winnertel']").attr('data-value'));
|
|
|
+ //排除词
|
|
|
+ $("#zbSeatchT [name='notkey']").val($(".not-key-input-group input").val().slice(0, 10));
|
|
|
+ if(!$("#zbSeatchT [name='keywords']").val()&&!$("#zbSeatchT [name='industry']").val()&&n!="F"){
|
|
|
+ getNewBids(currentPage);
|
|
|
+ }else{
|
|
|
+ if(n!="F"){
|
|
|
+ if(submitflag){
|
|
|
+ if($.trim(searchname)==""){
|
|
|
+ getNewBiddings();
|
|
|
+ nbflag = false;
|
|
|
+ }else{
|
|
|
+ searchvalue = $.trim(searchname);
|
|
|
+ searchOnsubmit();
|
|
|
+ nbflag = true;
|
|
|
+ }
|
|
|
+ submitflag=false;
|
|
|
+ }
|
|
|
+ setTimeout(function(){
|
|
|
+ submitflag=true
|
|
|
+ },200);
|
|
|
+ }else{
|
|
|
+ if($.trim(searchname)!=""){
|
|
|
+ nbflag = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true
|
|
|
+ },200)
|
|
|
+}
|
|
|
+var LimitClass = {
|
|
|
+ prevNoLimitFlag: false,
|
|
|
+ limitFlag: false,
|
|
|
+ list: null,
|
|
|
+ result: null,
|
|
|
+ paging: function(cp){
|
|
|
+ if(LimitClass.list != null){
|
|
|
+ var start = (cp-1)*pageSize;
|
|
|
+ var end = start+pageSize;
|
|
|
+ if(end > LimitClass.list.length){
|
|
|
+ end = LimitClass.list.length;
|
|
|
+ }
|
|
|
+ LimitClass.result.list = LimitClass.list.slice(start,end);
|
|
|
+ }
|
|
|
+ pcAjaxReqCallBack(LimitClass.result);
|
|
|
+ }
|
|
|
+};
|
|
|
+//搜索关键词信息
|
|
|
+function searchOnsubmit(clickpaging){
|
|
|
+ var this_selectType = $("#zbSeatchT [name='selectType']").val();
|
|
|
+ if(this_selectType != "all"){
|
|
|
+ LimitClass.limitFlag = false;
|
|
|
+ LimitClass.result = null;
|
|
|
+ LimitClass.list = null;
|
|
|
+ }else{
|
|
|
+ if(clickpaging&&LimitClass.limitFlag){
|
|
|
+ LimitClass.paging(currentPage);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // $("#newsclass").show();
|
|
|
+ // $("#newsnow").hide();
|
|
|
+ if(currentPage==1){
|
|
|
+ $(".nbprev").addClass("disabled");
|
|
|
+ }
|
|
|
+ var param = {
|
|
|
+ pageNumber: currentPage,
|
|
|
+ pageSize: pageSize,
|
|
|
+ reqType: "bidSearch",
|
|
|
+ searchvalue: $("#zbSeatchT [name='keywords']").val(),
|
|
|
+ area: $("#zbSeatchT [name='area']").val(),
|
|
|
+ subtype: $("#zbSeatchT [name='subtype']").val(),
|
|
|
+ publishtime: $("#zbSeatchT [name='publishtime']").val(),
|
|
|
+ selectType : this_selectType || 'title,content',
|
|
|
+ minprice : $("#zbSeatchT [name='minprice']").val(),
|
|
|
+ maxprice : $("#zbSeatchT [name='maxprice']").val(),
|
|
|
+ industry : $("#zbSeatchT [name='industry']").val(),
|
|
|
+ tabularflag: "Y",
|
|
|
+ buyerclass: $("#zbSeatchT [name='buyerclass']").val(),
|
|
|
+ buyertel: $("#zbSeatchT [name='buyertel']").val(),
|
|
|
+ winnertel: $("#zbSeatchT [name='winnertel']").val(),
|
|
|
+ notkey: $(".not-key-input-group input").val().slice(0, 10),
|
|
|
+ fileExists: $("#zbSeatchT [name='fileExists']").val(),
|
|
|
+ city: $("#zbSeatchT [name='city']").val(),
|
|
|
+ bid_field: $("#zbSeatchT [name='bid_field']").val()
|
|
|
+ };
|
|
|
+ $.post("/front/pcAjaxReq",param,function(r){
|
|
|
+ if(r.limitFlag){
|
|
|
+ LimitClass.limitFlag = true;
|
|
|
+ LimitClass.result = r;
|
|
|
+ LimitClass.list = r.list;
|
|
|
+ LimitClass.paging(currentPage);
|
|
|
+ LimitClass.prevNoLimitFlag = false;
|
|
|
+ // 重新分页
|
|
|
+ searchInnerVue.listState.total = r.totalPage
|
|
|
+ searchInnerVue.checkPageNumAdd1()
|
|
|
+ }else{
|
|
|
+ LimitClass.prevNoLimitFlag = true;
|
|
|
+ LimitClass.limitFlag = false;
|
|
|
+ pcAjaxReqCallBack(r);
|
|
|
+ }
|
|
|
+ // getBidIsColl()
|
|
|
+ });
|
|
|
+}
|
|
|
+function showSearchTipForTimeRange (type) {
|
|
|
+ var tempDom = $("#hasNoData_tiptext>font:eq(0)")
|
|
|
+ var tipMap = {
|
|
|
+ 'fiveyear': '近5年',
|
|
|
+ 'threeyear': '近3年',
|
|
|
+ 'thisyear': '近1年',
|
|
|
+ 'lately-7': '近7天',
|
|
|
+ 'lately-30': '近30天'
|
|
|
+ }
|
|
|
+ var tempStr = ''
|
|
|
+ var defaultRange = $("#zbSeatchT [name='publishtime']").val() || selectPublishtime
|
|
|
+ if (tipMap[defaultRange]) {
|
|
|
+ tempStr = tipMap[defaultRange]
|
|
|
+ } else {
|
|
|
+ var tempTimeList = defaultRange.split('_')
|
|
|
+ if (tempTimeList[0]) {
|
|
|
+ tempStr = new Date(tempTimeList[0] * 1000).pattern('yyyy/MM/dd')
|
|
|
+ }
|
|
|
+ if (tempTimeList[1]) {
|
|
|
+ if (tempStr.length) {
|
|
|
+ tempStr += '-'
|
|
|
+ }
|
|
|
+ tempStr += new Date(tempTimeList[1] * 1000).pattern('yyyy/MM/dd')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ tempDom.find('span').text(tempStr)
|
|
|
+ if (type !== false) {
|
|
|
+ tempDom.show();
|
|
|
+ }
|
|
|
+}
|
|
|
+$(function () {
|
|
|
+ setTimeout(function(){
|
|
|
+ showSearchTipForTimeRange(false);
|
|
|
+ },500)
|
|
|
+})
|
|
|
+function pcAjaxReqCallBack(r){
|
|
|
+ afterAjaxReq(r);
|
|
|
+ var isAllSearch = $("#zbSeatchT [name='selectType']").val()=="all";
|
|
|
+ if(r.list == null || r.list.length == 0){
|
|
|
+ $("#hasNoData_tiptext>font").hide();
|
|
|
+ if(r.status==-1){
|
|
|
+ $("#hasNoData_tiptext>font:eq(1)").show();
|
|
|
+ }else if (r.status==-2){
|
|
|
+ $("#hasNoData_tiptext>font:eq(2)").show();
|
|
|
+ }else{
|
|
|
+ showSearchTipForTimeRange()
|
|
|
+ }
|
|
|
+ if(isAllSearch){
|
|
|
+ $("#allSearchModel").hide();
|
|
|
+ }else{
|
|
|
+ // $("#allSearchModel").show();
|
|
|
+ }
|
|
|
+ //分页过程中,突然切换控制状态
|
|
|
+ if(r.limitFlag && LimitClass.prevNoLimitFlag){
|
|
|
+ $("#hasNoData_tiptext>font").hide();
|
|
|
+ $("#hasNoData_tiptext>font:eq(1)").show();
|
|
|
+ }else{
|
|
|
+ if(currentPage>1){
|
|
|
+ $(".nbnext").addClass("disabled");
|
|
|
+ if(currentPage==2){
|
|
|
+ $(".nbprev").addClass("disabled");
|
|
|
+ }
|
|
|
+ currentPage = currentPage-1;
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $(".tabContainer").hide();
|
|
|
+ $(".pagination").hide();
|
|
|
+ $(".working").hide();
|
|
|
+ $(".hasNoData").show();
|
|
|
+ // 隐藏页码
|
|
|
+ searchInnerVue.showPage = false
|
|
|
+ submitflag=true;
|
|
|
+ }else{
|
|
|
+ //$(".tabContainer").show();
|
|
|
+ $(".hasNoData").hide();
|
|
|
+ appendDatas(r.list,true,false)
|
|
|
+ }
|
|
|
+}
|
|
|
+function afterAjaxReq(r){
|
|
|
+ secondFlag=r.secondFlag;
|
|
|
+ if(r.interceptWord != ""){
|
|
|
+ $("#intercept .interceptWord").text(r.interceptWord);
|
|
|
+ $("#intercept .interceptLimit").text(r.interceptLimit);
|
|
|
+ $("#intercept").removeClass("hidden");
|
|
|
+ }else{
|
|
|
+ $("#intercept").addClass("hidden");
|
|
|
+ }
|
|
|
+ if(r.keywords != null && typeof(r.keywords) != "undefined"){
|
|
|
+ $(".searchname").val(r.keywords);
|
|
|
+ }
|
|
|
+ $(".side-bar-bottom-font").text("“"+$.trim($(".searchname").val()).replace(/\s+/," ")+"”");
|
|
|
+ if(secondFlag==""&&typeof(r.searchvalue) != "undefined"){
|
|
|
+ searchvalue = r.searchvalue;
|
|
|
+ }
|
|
|
+ if(r.pcAjaxFlag=="T"){
|
|
|
+ searchvalue = r.searchvalue;
|
|
|
+ totalPage = r.totalPage;
|
|
|
+ list= r.list;
|
|
|
+ secondList= r.secondList;
|
|
|
+ // vue 重置总页数
|
|
|
+ searchInnerVue.listState.total = totalPage
|
|
|
+ searchInnerVue.checkPageNumAdd1()
|
|
|
+ }
|
|
|
+ if(secondFlag==""&&typeof(totalPage) != "undefined" && currentPage == 1){
|
|
|
+ if (r.totalPage==1){
|
|
|
+ totalPage = parseInt(r.count/pageSize)+1;
|
|
|
+ if(totalPage>10){
|
|
|
+ totalPage=10;
|
|
|
+ }
|
|
|
+ // vue 重置总页数
|
|
|
+ searchInnerVue.listState.total = totalPage
|
|
|
+ searchInnerVue.checkPageNumAdd1()
|
|
|
+ }else{
|
|
|
+ totalPage = r.totalPage;
|
|
|
+ searchInnerVue.listState.total = totalPage
|
|
|
+ searchInnerVue.checkPageNumAdd1()
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+function getCheckList() {
|
|
|
+ var getSelectNum = 0 // 获取这一页有多少个选中
|
|
|
+ var $dom = $('.custom-checkbox:not(.check-all)[name="bid-list"]')
|
|
|
+ $.each($dom,function(i, value) {
|
|
|
+ if(selectDataIds.length == 0) return
|
|
|
+ selectDataIds.forEach(function(item,index) {
|
|
|
+ let dataid = $(value).attr('dataid')
|
|
|
+ if (item == dataid) {
|
|
|
+ getSelectNum++
|
|
|
+ $(this).attr('checked', true)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ if(getSelectNum>=50) {
|
|
|
+ $('.custom-checkbox').prop("checked",true)
|
|
|
+ } else {
|
|
|
+ $('.custom-checkbox').prop("checked",false)
|
|
|
+ $dom.each(function(i, dNode) {
|
|
|
+ if(selectDataIds.length == 0) return
|
|
|
+ selectDataIds.forEach(function(item,index) {
|
|
|
+ let dataid = $(dNode).attr('dataid')
|
|
|
+ if (item == dataid) {
|
|
|
+ getSelectNum++
|
|
|
+ $(dNode).prop('checked', true)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+/*
|
|
|
+ 招标信息是否被收藏接口ajax
|
|
|
+ bids: String, // 招标信息id(多个用,号拼接) 必填
|
|
|
+*/
|
|
|
+function getBidIsColl () {
|
|
|
+ collectClick()
|
|
|
+ var bids = ""
|
|
|
+ var dataId = ""
|
|
|
+ // 区分标题搜索和全文搜索收藏
|
|
|
+ var allSearch = selectType.indexOf('content') > -1 && $("#zbSeatchT [name='keywords']").val() !==""
|
|
|
+ // console.log('当前是否显示的是全文',allSearch)
|
|
|
+ var $dom = allSearch ? $('.all-text-checkbox[name="bid-list"]') : $('.title-text-checkbox[name="bid-list"]')
|
|
|
+ $dom.each(function() {
|
|
|
+ if ($(this).attr('dataid')) {
|
|
|
+ dataId = $(this).attr("dataid");
|
|
|
+ if(bids != ""){
|
|
|
+ bids += ",";
|
|
|
+ }
|
|
|
+ bids += dataId;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ $.ajax({
|
|
|
+ type:'post',
|
|
|
+ url:'/publicapply/bidcoll/isColl?t=' + Date.now(),
|
|
|
+ data: {
|
|
|
+ bids: bids
|
|
|
+ },
|
|
|
+ dataType:'json',
|
|
|
+ success: function(r){
|
|
|
+ if (r.data) {
|
|
|
+ var data = r.data
|
|
|
+ $('.icon-collect').removeClass('checked')
|
|
|
+ data.forEach(function(item,index){
|
|
|
+ if (selectType == 'title') {
|
|
|
+ $('.icon-collect[dataid="' + item + '"]').addClass('checked')
|
|
|
+ } else {
|
|
|
+ $('.icon-collect[dataid="' + item + '"]').addClass('checked')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// 收藏点击事件
|
|
|
+function collectClick() {
|
|
|
+ // console.log(vipState, '是否是超级订阅用户')
|
|
|
+ // 单个收藏点击事件
|
|
|
+ $('.icon-collect').unbind('click').on('click',function(e) {
|
|
|
+ // 登录判断
|
|
|
+ if (!loginflag) {
|
|
|
+ openLoginDig()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ baiduEvent('列表页标讯收藏-星标') // 百度统计代码
|
|
|
+ e.stopPropagation()
|
|
|
+ var $that = $(this)
|
|
|
+ var checked = $(this).hasClass('checked')
|
|
|
+ var checkedId = $(this).attr('dataid')
|
|
|
+ var binfo = [{
|
|
|
+ bid: checkedId
|
|
|
+ }]
|
|
|
+ if (checked) {
|
|
|
+ // 单个取消收藏行为
|
|
|
+ collBidAction('R', binfo, function(res) {
|
|
|
+ if (res.data) {
|
|
|
+ if (selectType == 'title') {
|
|
|
+ // 标题搜索下相关样式
|
|
|
+ // $that.removeClass('checked').parents().siblings('input[type="checkbox"]').prop("checked",false).removeAttr('disabled')
|
|
|
+ $that.removeClass('checked')
|
|
|
+ } else {
|
|
|
+ // 全文搜索下相关样式
|
|
|
+ // $that.removeClass('checked').parents('.luce-right').siblings().find('input[type="checkbox"]').prop("checked",false).removeAttr('disabled')
|
|
|
+ $that.removeClass('checked')
|
|
|
+ }
|
|
|
+ toastFn('已取消收藏', 800)
|
|
|
+ } else {
|
|
|
+ toastFn(res.error_msg, 1000)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ // 单个收藏行为
|
|
|
+ vm.dialogTitle = '重要项目一键创建标签收藏!请完善个人信息,为您匹配精准服务'
|
|
|
+ // 查询是否需要用户留资料 不需要 则执行下一步回调(收藏标讯行为)
|
|
|
+ vm.isNeedSubmit('article_collection',function() {
|
|
|
+ sessionStorage.setItem('$save-tags-binfo', JSON.stringify(binfo)) // 将本次收藏的标讯id缓存起来 用于绑定标签时使用
|
|
|
+ collBidAction('C', binfo, function(res) {
|
|
|
+ if (res.data) {
|
|
|
+ toastFn('收藏成功', 1500)
|
|
|
+ if (selectType == 'title') {
|
|
|
+ $that.addClass('checked')
|
|
|
+ } else {
|
|
|
+ $that.addClass('checked')
|
|
|
+ }
|
|
|
+ var top = (parseInt($that.position().top) + 50 ) + 'px';
|
|
|
+ $('.tags-box').show(function(){
|
|
|
+ activeTags = []
|
|
|
+ $('.tag-labels').empty()
|
|
|
+ $('.clear-input').val('')
|
|
|
+ $('.tags-list').find('.tags-item').removeClass('tags-active')
|
|
|
+ $('.tag-placeholder').show()
|
|
|
+ }).css('top', top)
|
|
|
+ getUserTags()
|
|
|
+ } else {
|
|
|
+ // 是超级订阅用户或者其他付费用户
|
|
|
+ if (vipState || res.error_msg.indexOf('付费') > -1) {
|
|
|
+ toastFn('您的标讯收藏上限为5000条,请联系客服人员。', 1500)
|
|
|
+ } else {
|
|
|
+ updateVipDialog('标讯收藏满100条-去升级')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }, $(this))
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // 批量收藏
|
|
|
+ $('#bid-collect').off('click').bind('click',function(e){
|
|
|
+ // 登录判断
|
|
|
+ if (!loginflag) {
|
|
|
+ openLoginDig()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ baiduEvent('列表页标讯收藏-星标') // 百度统计代码
|
|
|
+ e.stopPropagation()
|
|
|
+ var top = (parseInt($(this).position().top) + 60 ) + 'px';
|
|
|
+ var len = $('.custom-checkbox:not(".check-all"):checked').length;
|
|
|
+ var checkedId = [] // 提交后端需要的标讯id数组
|
|
|
+ var leftArr = [] // checkbox选中的数据
|
|
|
+ var rightArr = [] // 当前已收藏过的数据
|
|
|
+ var notSameArr = [] // 选中的数据 与 收藏过的数据相比不同的数组
|
|
|
+ $('.custom-checkbox:not(".check-all"):checked').each(function(){
|
|
|
+ if ($(this).attr('dataid')) {
|
|
|
+ checkedId.push({
|
|
|
+ bid: $(this).attr('dataid')
|
|
|
+ })
|
|
|
+ leftArr.push($(this).attr('dataid'))
|
|
|
+ }
|
|
|
+ })
|
|
|
+ $('.icon-collect.checked').each(function() {
|
|
|
+ if ($(this).attr('dataid')) {
|
|
|
+ rightArr.push($(this).attr('dataid'))
|
|
|
+ }
|
|
|
+ })
|
|
|
+ var $that = $(this)
|
|
|
+ // 判断有无选中的标讯信息
|
|
|
+ if (len > 0 || selectDataIds.length > 0) {
|
|
|
+ selectDataIds.forEach(function(v) {
|
|
|
+ checkedId.push({
|
|
|
+ bid: v
|
|
|
+ })
|
|
|
+ })
|
|
|
+ checkedId = arrUnique(checkedId)
|
|
|
+ if(leftArr.length <= rightArr.length) {
|
|
|
+ for (key in leftArr) {
|
|
|
+ var stra = leftArr[key];
|
|
|
+ var count = 0;
|
|
|
+ for (var j = 0; j < rightArr.length; j++) {
|
|
|
+ var strb = rightArr[j];
|
|
|
+ if (stra == strb) {
|
|
|
+ count++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (count === 0) { //表示数组1的这个值没有重复的,放到notSameArr列表中
|
|
|
+ notSameArr.push(stra);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 如果没有不同的值 即为选中的标讯都已收藏过 有不同的值即为有未收藏的标讯
|
|
|
+ // console.log(notSameArr, 'notSameArr')
|
|
|
+ if(notSameArr.length == 0) {
|
|
|
+ toastFn('已收藏', 800)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ vm.dialogTitle = '重要项目一键创建标签收藏!请完善个人信息,为您匹配精准服务'
|
|
|
+ // 查询是否需要用户留资料 不需要 则执行下一步回调(批量收藏标讯行为)
|
|
|
+ vm.isNeedSubmit('article_collection', function() {
|
|
|
+ sessionStorage.setItem('$save-tags-binfo', JSON.stringify(checkedId)) // 将本次收藏的标讯id缓存起来 用于绑定标签时使用
|
|
|
+ collBidAction('C', checkedId, function(res) {
|
|
|
+ if (res.data) {
|
|
|
+ toastFn('收藏成功', 1500)
|
|
|
+ if (selectType == 'title') {
|
|
|
+ $('.custom-checkbox:not(".check-all"):checked').siblings().children('.icon-collect').addClass('checked')
|
|
|
+ } else {
|
|
|
+ $('.custom-checkbox:not(".check-all"):checked').parents('.liLuceneList').find('.icon-collect').addClass('checked')
|
|
|
+ }
|
|
|
+ // 收藏成功后再查一次收藏状态,为了区分达到收藏上限点时部分收藏成功,部分收藏失败
|
|
|
+ getBidIsColl()
|
|
|
+ // 弹出标签弹框时 清除上次选择的标签
|
|
|
+ $('.tags-box').show().css('top', top)
|
|
|
+ getUserTags()
|
|
|
+ } else {
|
|
|
+ // 是超级订阅用户或者其他付费用户
|
|
|
+ if (vipState || res.error_msg.indexOf('付费') > -1) {
|
|
|
+ toastFn('您的标讯收藏上限为5000条,请联系客服人员。', 1500)
|
|
|
+ } else {
|
|
|
+ updateVipDialog('标讯收藏满100条-去升级')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ toastFn('尚未选择标讯,请选择', 1000)
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * @date 2022/12/15 山川环境嵌入搜索
|
|
|
+ * 山川应用嵌入环境 特殊处理
|
|
|
+ */
|
|
|
+
|
|
|
+var InBIInjectHooks = {
|
|
|
+ // 已添加的标讯信息
|
|
|
+ ids: [],
|
|
|
+ // 获取已添加的标讯信息
|
|
|
+ getInfoIds: function () {
|
|
|
+ $.ajax({
|
|
|
+ url: '/jyapi/biService/getInfoId',
|
|
|
+ type: 'POST',
|
|
|
+ success: function (res) {
|
|
|
+ if (Array.isArray(res.data)) {
|
|
|
+ this.ids = res.data
|
|
|
+ this.upDateView()
|
|
|
+ }
|
|
|
+ }.bind(this)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 添加标讯信息
|
|
|
+ setInfoId (ids) {
|
|
|
+ $.ajax({
|
|
|
+ url: '/jyapi/biService/addProject',
|
|
|
+ type: 'POST',
|
|
|
+ contentType: 'application/json',
|
|
|
+ data: JSON.stringify({
|
|
|
+ info_id: ids.join(','),
|
|
|
+ source: 2
|
|
|
+ }),
|
|
|
+ success: function () {
|
|
|
+ this.getInfoIds()
|
|
|
+ if (ids.length > 1) {
|
|
|
+ selectDataIds = []
|
|
|
+ $('.custom-checkbox').prop("checked", false)
|
|
|
+ }
|
|
|
+ }.bind(this)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 刷新视图
|
|
|
+ upDateView () {
|
|
|
+ var _this = this
|
|
|
+ $(".liLuceneList").each(function () {
|
|
|
+ var nowId = $(this).find('.custom-checkbox').attr('dataid')
|
|
|
+ var hasNowId = _this.ids.indexOf(nowId) !== -1
|
|
|
+
|
|
|
+ // 刷新 dom 状态
|
|
|
+ $(this).find('.bi-report-inject-button').text(hasNowId ? '已添加' : '添加')
|
|
|
+ $(this).find('.custom-checkbox').prop('disabled', hasNowId)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getCheckIds () {
|
|
|
+ return selectDataIds || []
|
|
|
+ },
|
|
|
+ checkInBI () {
|
|
|
+ var inInjectBI = getParam('report') === 'bi' || (location.href.indexOf('/jylab/bi/index') !== -1)
|
|
|
+ return inInjectBI
|
|
|
+ },
|
|
|
+ check () {
|
|
|
+ if (this.checkInBI()) {
|
|
|
+ // 获取数据
|
|
|
+ this.getInfoIds()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ inject () {
|
|
|
+ if (this.checkInBI()) {
|
|
|
+ $("body").addClass('in-iframe in-bi')
|
|
|
+
|
|
|
+ // 仅展示信息-结果类型
|
|
|
+ $(".bi-mark.parent-node").trigger('click')
|
|
|
+
|
|
|
+ var _this = this
|
|
|
+ // 添加按钮点击事件
|
|
|
+ $("body").on('click', '.bi-report-inject-button', function () {
|
|
|
+ var nowStatus = $(this).text() === '已添加'
|
|
|
+ if (nowStatus) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var nowId = $(this).attr('data-id')
|
|
|
+ var isAllButton = nowId === 'all'
|
|
|
+ // 批量添加
|
|
|
+ if (isAllButton) {
|
|
|
+ _this.setInfoId(_this.getCheckIds())
|
|
|
+ } else {
|
|
|
+ // 单个添加
|
|
|
+ _this.setInfoId([nowId])
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ // 获取数据
|
|
|
+ this.getInfoIds()
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+$(function () {
|
|
|
+ InBIInjectHooks.inject()
|
|
|
+})
|
|
|
+
|
|
|
+function arrUnique(arr){
|
|
|
+ let ojb = {};
|
|
|
+ arr = arr.reduce(function(prevArr, currentItem) {
|
|
|
+ //利用对象的键名无法重复的特点,mch_id是唯一区别的属性值
|
|
|
+ ojb[currentItem.bid] ? '' : ojb[currentItem.bid] = true && prevArr.push(currentItem);
|
|
|
+ return prevArr
|
|
|
+ }, [])
|
|
|
+ return arr;
|
|
|
+}
|
|
|
+
|
|
|
+function openBigMemberDialog (str, content) {
|
|
|
+ $('.auth-dialog').show()
|
|
|
+ $('.auth-dialog .dialog-title').text('您暂无使用权限')
|
|
|
+ $('.auth-dialog .dialog-content').html(content || '开通大会员,查看更多招标项目,畅享商机不受限!')
|
|
|
+ $('.auth-dialog .default-btn').click(function () {
|
|
|
+ $('.auth-dialog').hide(300)
|
|
|
+ })
|
|
|
+ $('.auth-dialog .confirm-btn').text('免费体验')
|
|
|
+ $('.auth-dialog .confirm-btn').off('click').bind('click',function () {
|
|
|
+ var advName = '招标搜索' + str + '-去开通'
|
|
|
+ baiduEvent(advName) // 点击去开通事件 百度统计
|
|
|
+ $('.auth-dialog').hide(300)
|
|
|
+ vm.dialogTitle = '免费用户查看超过500条招标搜索结果'
|
|
|
+ vm.isNeedSubmit('jylab_see500_plus', function () {
|
|
|
+ vm.showSuccess = true
|
|
|
+ })
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// 开通提醒弹框
|
|
|
+function openVipDialog(str, content) {
|
|
|
+ $('.auth-dialog').show()
|
|
|
+ $('.auth-dialog .dialog-title').text('开通超级订阅')
|
|
|
+ $('.auth-dialog .dialog-content').html(content || '立享更多搜索权限,寻找商机更精准')
|
|
|
+ $('.auth-dialog .default-btn').click(function () {
|
|
|
+ $('.auth-dialog').hide(300)
|
|
|
+ })
|
|
|
+ $('.auth-dialog .confirm-btn').text('去开通')
|
|
|
+ $('.auth-dialog .confirm-btn').off('click').bind('click',function () {
|
|
|
+ var advName = '招标搜索' + str + '-去开通'
|
|
|
+ baiduEvent(advName) // 点击去开通事件 百度统计
|
|
|
+ window.open('/swordfish/page_big_pc/free/svip/buy')
|
|
|
+ })
|
|
|
+}
|
|
|
+// 升级提醒弹框
|
|
|
+function updateVipDialog(str) {
|
|
|
+ $('.update-dialog').show()
|
|
|
+ $('.update-dialog .default-btn').click(function () {
|
|
|
+ $('.update-dialog').hide(300)
|
|
|
+ })
|
|
|
+ $('.update-dialog .confirm-btn').off('click').bind('click',function () {
|
|
|
+ baiduEvent(str) // 点击去升级事件 百度统计
|
|
|
+ window.open('/front/subscribe.html')
|
|
|
+ })
|
|
|
+}
|
|
|
+// 列表页收藏点击事件 百度统计
|
|
|
+function baiduEvent(name) {
|
|
|
+ // console.log(name, 'name')
|
|
|
+ try {
|
|
|
+ _hmt.push(['_trackEvent', '超级订阅-pc', 'click', name]);
|
|
|
+ } catch (e) {
|
|
|
+ console.log('未初始化百度统计')
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// toast上限提示
|
|
|
+function toastFn (text, duration) {
|
|
|
+ if (duration) {
|
|
|
+ duration = 1000
|
|
|
+ }
|
|
|
+ var _html = ""
|
|
|
+ _html+='<div class="custom-toast"><div class="mask" style="background-color: transparent;"></div><div class="toast-container">'
|
|
|
+ _html+='<span>' + text + '</span></div></div>'
|
|
|
+ $('body').append(_html)
|
|
|
+ setTimeout(function(){
|
|
|
+ $(".custom-toast").fadeOut().remove();
|
|
|
+ },duration)
|
|
|
+}
|
|
|
+function gologin (link) {
|
|
|
+ window.location.href=link
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+// 是否有权限
|
|
|
+// isPower()
|
|
|
+function isPower () {
|
|
|
+ $.ajax({
|
|
|
+ type:'post',
|
|
|
+ url:'/publicapply/bidcoll/power?t=' + Date.now(),
|
|
|
+ success: function(r){
|
|
|
+ if (r.data) {
|
|
|
+ var entniche = r.data.entniche
|
|
|
+ var member = r.data.member
|
|
|
+ var vip = r.data.vip
|
|
|
+ if (entniche || member || vip > 0) {
|
|
|
+ return 'true'
|
|
|
+ } else {
|
|
|
+ return 'false'
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return 'false'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|