123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935 |
- var pageSize = 50;
- var nbflag = false;//是否显示的是最新招标数据
- var currentPage = 1;//当前页
- var submitflag = true;
- var tabularflag = "Y";
- var onAntiSpiderWhitelist = false; // 是否在反爬虫白名单
- var commonSearchWordsRegExp = [] // 通用搜索词语
- var tParams = goTemplateData.params
- if (!(tParams.isEntniche || tParams.isVip || tParams.isMember)) {
- localStorage.setItem('login-clear-bidsearch-list-model', 'S')
- }
- var listModel = localStorage.getItem('login-clear-bidsearch-list-model') || 'S' // 列表精简or详细 S:精简 D:详细
- // 采购单位画像中转页
- var buyerLink = '/swordfish/page_big_pc/free/loading/buyer/'
- // 企业画像中转页
- var winnerLink = '/swordfish/page_big_pc/free/loading/ent/'
- $(function() {
- priceTime();
- $(".Price-content").find("span:first-child").click(function(){
- $(this).addClass("active");
- $(".pricefat").removeClass("active");
- beforeSubmit('filter-price');
- })
- $(".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('filter-price');
- })
- //
- $("#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('filter-time')
- })
- //
- //筛选关闭和打开
- //根据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.totalPage = 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')
- }
- })
- })
- //取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(),
- searchGroup: $("#zbSeatchT [name='searchGroup']").val()
- },function(r){
- if(r&&r.list!=null&&r.list.length>0){
- $(".tabContainer").show();
- $(".hasNoData").hide();
- searchInnerVue.listState.totalPage = 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
- }
- allCount = r.total
- searchInnerVue.listState.allCount = r.total
- // getBidIsColl()
- })
- }
- ////最新招标信息
- function getNewBiddings(num, size){
- 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: $("#zbSeatchT [name='notkey']").val(),
- fileExists: $("#zbSeatchT [name='fileExists']").val(),
- city: $("#zbSeatchT [name='city']").val(),
- bid_field: $("#zbSeatchT [name='bid_field']").val(),
- searchGroup: $("#zbSeatchT [name='searchGroup']").val(),
- searchMode: $("#zbSeatchT [name='searchMode']").val(),
- wordsMode: $("#zbSeatchT [name='wordsMode']").val(),
- additionalWords: $("#zbSeatchT [name='additionalWords']").val()
- };
- $.post("/front/pcAjaxReq",param,function(r){
- heightWords = r.heightWords
- if(r&&r.list!=null&&r.list.length>0){
- // 计算总页码
- if (currentPage == 1) {
- searchInnerVue.listState.totalPage = Math.ceil(r.count/pageSize)
- allCount = r.total
- searchInnerVue.listState.allCount = r.total
- // searchInnerVue.checkPageNumAdd1()
- }
- $(".tabContainer").show();
- $(".hasNoData").hide();
- if (size && num === 1) {
- appendDatas(r.list,true,true, true);
- } else {
- appendDatas(r.list,false,false);
- }
- }else{
- if(currentPage>1){
- currentPage = currentPage-1;
- return false
- }
- submitflag=true;
- $(".tabContainer").hide();
- $(".pagination").hide();
- $(".working").hide();
- $(".hasNoData").show();
- // 隐藏页码
- searchInnerVue.showPage = false
- allCount = 0
- searchInnerVue.listState.allCount = 0
- }
- autoModelFn(r)
- })
- }
- //
- 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();
- // 列表模式下显示页码 表格模式下隐藏
- if (searchInnerVue.dataTab == 'list') {
- searchInnerVue.showPage = true
- } else {
- searchInnerVue.showPage = false
- }
- var searchvalueArray = heightWords.split(" ");
- // console.log('需要高亮的关键词、附加词组:' + searchvalueArray)
- $(".pagination-inner").find("span").text(currentPage);
- //(数据够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,"")
- if (detail) {
- 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>'
- listHtml +='<div class="liLuceneList" style="border-bottom: 1px solid #EBEBEB;">'
- listHtml += '<input class="custom-checkbox title-text-checkbox" name="bid-list" type="checkbox" dataid="'+datas[i]._id+'" data-area="'+ datas[i].area+'"/>'
- listHtml +='<div class="list-container">'
- // 标题、推送时间
- listHtml += '<div class="bid-list-title">'
- + '<div class="list-title-flex ellipsis"><em class="visited-hd">'+index+'.</em>'
- + '<a class="visited-hd" onclick="noIn(this)" dataid="'+datas[i]._id+'" dataindustry="'+datas[i].industry+'" target="_blank"> '+title+ '</a></div>'
- if(typeof(datas[i].publishtime) != "undefined" && datas[i].publishtime != null && datas[i].publishtime != ""){
- var diff =new Date(parseInt(datas[i].publishtime*1000)).pattern('yyyy-MM-dd');
- if(diff != null){
- listHtml += '<span class="com-time">'+diff+'</span>';
- }
- }
- listHtml += '</div>'
- // 正文
- if(selectContext && detail) {
- listHtml += '<div class="bid-list-content">' + detail + '</div>'
- }
- // 分类标签、收藏
- listHtml += '<div class="bid-list-tags">'
- +'<div>'
- if (datas[i].site == '剑鱼信息发布平台') {
- listHtml += '<span class="tags-item tags-publish">用户发布</span>'
- }
- if ($.trim(datas[i].area) != "" && datas[i].area != "A"&&datas[i].area.indexOf("免费注册")<0) {
- listHtml += '<a class="tags-item" 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 != ""&&type.indexOf("免费注册")<0) {
- listHtml += '<a class="tags-item" 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 class="tags-item tags-industry" 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>';
- // }
- if (typeof(datas[i].buyerclass) != "undefined" && datas[i].buyerclass != null && datas[i].buyerclass != ""&&!is_field && datas[i].buyerclass !== '其它'&&datas[i].buyerclass.indexOf("免费注册")<0) {
- listHtml += '<a class="tags-item" href="javascript:volid(0);"'+'>'+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!="") {
- /**
- * @date 2023/2/15 支持未登录用户使用,存在字符串 略,需要额外判断
- */
- var tempMoneyNumber = amount
- if (typeof tempMoneyNumber === 'number') {
- tempMoneyNumber = conversionMoeny(tempMoneyNumber)
- }
- listHtml += '<a class="tags-item">'+tempMoneyNumber+'</a>';
- } else {
- listHtml += '<a href="javascript:volid(0);" style="display:none;"></a>';
- }
- // 附件
- if (fileExists) {
- listHtml+='<span class="tags-item tags-file">'+'有附件'+'</span>'
- }
- listHtml+='</div>'
- listHtml+='<div>'
- // 是否参标(2022/05/12)
- listHtml += '<i class="icon-canbiao" style="display:none" dataid="'+datas[i]._id+'" ></i>'
- // // 是否收藏
- 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>'
- listHtml += '</div>'
- // 详细列表内容
- if (listModel === 'D') {
- listHtml += '<div class="bid-detail-info" data-subtype='+ datas[i].subtype +'>'
- if (datas[i].buyer || datas[i].buyertel || datas[i].budget) {
- listHtml += '<p class="d-i-item">'
- if (datas[i].buyer) {
- listHtml += '<span><i class="d-i-item-label">采购单位:</i>'
- // 可能是多个采购单位(测试环境出现过)
- if (datas[i].buyer.indexOf('、') > -1) {
- var buyerArr = datas[i].buyer.split('、')
- console.log(buyerArr);
- for(var j = 0; j< buyerArr.length;j++) {
- var dun = j != buyerArr.length - 1 ? '<i class="highlight-text">、</i>' : ''
- listHtml += '<a class="highlight-text" href="' + buyerLink + buyerArr[j] +'" target="_blank">'+ buyerArr[j]+ '</a>' + dun
- }
- } else {
- listHtml += '<a class="highlight-text" href="' + buyerLink + datas[i].buyer +'" target="_blank">'+ datas[i].buyer+ '</a>'
- }
- listHtml += '</span>'
- }
- if (datas[i].buyertel) {
- datas[i].buyerperson = datas[i].buyerperson ? datas[i].buyerperson +',' : ''
- listHtml += '<span><i class="d-i-item-label">采购单位联系方式:</i>'+ datas[i].buyerperson + datas[i].buyertel + '<a class="highlight-text" href="' + buyerLink + datas[i].buyer + '?position=contact" target="_blank"> 获取更多</a></span>'
- }
- if (datas[i].budget) {
- /**
- * @date 2023/2/15 支持未登录用户使用,存在字符串 略,需要额外判断
- */
- var tempMoneyNumber = datas[i].budget
- if (typeof tempMoneyNumber === 'number') {
- tempMoneyNumber = conversionMoeny(tempMoneyNumber)
- }
- listHtml += '<span><i class="d-i-item-label">预算金额:</i>' + tempMoneyNumber + '</span>'
- }
- listHtml +='</p>'
- }
- if (datas[i].agency || datas[i].agencytel) {
- listHtml += '<p class="d-i-item">'
- if (datas[i].agency) {
- listHtml += '<span><i class="d-i-item-label">代理机构:</i>' + datas[i].agency + '</span>'
- }
- if (datas[i].agencytel) {
- datas[i].agencyperson = datas[i].agencyperson ? datas[i].agencyperson +',' : ''
- listHtml += '<span><i class="d-i-item-label">代理机构联系方式:</i>' + datas[i].agencyperson + datas[i].agencytel + '</span>'
- }
- listHtml +='</p>'
- }
- if (datas[i].winnerInfo || datas[i].winnertel || datas[i].bidamount) {
- listHtml += '<p class="d-i-item">'
- if (datas[i].winnerInfo) {
- listHtml += '<span><i class="d-i-item-label">中标单位:</i>'
- for(var j=0;j<datas[i].winnerInfo.length;j++) {
- var dun = j != datas[i].winnerInfo.length - 1 ? '<i class="highlight-text">、</i>' : ''
- listHtml +='<a class="highlight-text" href="' + winnerLink + datas[i].winnerInfo[j].winnerId +'" target="_blank">'+ datas[i].winnerInfo[j].winner+ '</a>'+ dun
- }
- listHtml +='</span>'
- }
- if (datas[i].winnertel && datas[i].winnerInfo) {
- // 如果有两个中标单位则不显示‘获取更多’,只有一个中标单位显示‘获取更多’并跳到画像通讯录锚点位置
- var moreWinnerTel = datas[i].winnerInfo && datas[i].winnerInfo.length > 1 ? '' :'<a class="highlight-text" href="' + winnerLink + datas[i].winnerInfo[0].winnerId + '?position=contact" target="_blank"> 获取更多</a></span>'
- datas[i].winnerperson = datas[i].winnerperson ? datas[i].winnerperson +',' : ''
- listHtml += '<span><i class="d-i-item-label">中标单位联系方式:</i>' + datas[i].winnerperson + datas[i].winnertel + moreWinnerTel +'</span>'
- }
- if (datas[i].bidamount) {
- /**
- * @date 2023/2/15 支持未登录用户使用,存在字符串 略,需要额外判断
- */
- var tempMoneyNumber = datas[i].bidamount
- if (typeof tempMoneyNumber === 'number') {
- tempMoneyNumber = conversionMoeny(tempMoneyNumber)
- }
- listHtml += '<span><i class="d-i-item-label">中标金额:</i>'+ tempMoneyNumber +'</span>'
- }
- listHtml +='</p>'
- }
- if (datas[i].signendtime || datas[i].bidendtime || datas[i].bidopentime) {
- listHtml += '<p class="d-i-item">'
- if (datas[i].signendtime) {
- listHtml += '<span><i class="d-i-item-label">报名截止日期:</i>' + utils.dateFromNow(Number(datas[i].signendtime+"000")) +'</span>'
- }
- if (datas[i].bidendtime) {
- listHtml += '<span><i class="d-i-item-label">投标截止日期:</i>' + utils.dateFromNow(Number(datas[i].bidendtime+"000")) + '</span>'
- }
- if (datas[i].bidopentime) {
- /**
- * @date 2023/2/15 支持未登录用户使用,存在字符串 略,需要额外判断
- */
- var tempDate = datas[i].bidopentime
- if (typeof tempDate === 'number') {
- tempDate = utils.dateFromNow(Number(tempDate+"000"))
- }
- listHtml += '<span><i class="d-i-item-label">开标日期:</i>' + tempDate + '</span>'
- }
- listHtml +='</p>'
- }
- //领域化展示 商品&采购单位&中标单位
- if (is_field){
- listHtml += '<p class="d-i-item">'
- if (datas[i].purchasing) {
- listHtml += '<span><i class="d-i-item-label">产品:</i>' + datas[i].purchasing +'</span>'
- }
- listHtml +='</p>'
- }
- listHtml += '</div>'
- }
- listHtml += '</div>'
- listHtml +='</div>'
- listHtml += '</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 != ""){
- /**
- * @date 2023/2/15 支持未登录用户使用,存在字符串 略,需要额外判断
- */
- var budget = datas[i].budget
- if (typeof datas[i].budget === 'number') {
- 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 != ""){
- /**
- * @date 2023/2/15 支持未登录用户使用,存在字符串 略,需要额外判断
- */
- var diff = datas[i].bidopentime
- if (typeof datas[i].bidopentime === 'number') {
- 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 != ""){
- /**
- * @date 2023/2/15 支持未登录用户使用,存在字符串 略,需要额外判断
- */
- var bidamount = datas[i].bidamount
- if (typeof datas[i].bidamount === 'number') {
- 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()
- // 生成dom之后再查标讯有无参标
- getBidIsJoin()
- checkVisited()
- // 生成dom之后再查询是否勾选
- getCheckList()
- distributeInit() // 分发初始化
- /**
- * @date 2022/12/15 山川环境嵌入搜索
- * 更新是否已添加状态
- */
- InBIInjectHooks.check()
- // 信息类型是“采购意向”和“拟建项目”,无采购意向和拟建项目权限的超级订阅用户(老超级订阅用户),即使选择详细列表,也按照精简列表展示
- // 大会员、商机管理、超级订阅(配置时间之前的老用户)有超前项目权限
- if (!goTemplateData.params.vipBefore202209 && !goTemplateData.params.isMember && !goTemplateData.params.isEntniche) {
- $('.bid-detail-info[data-subtype="拟建"]').hide()
- $('.bid-detail-info[data-subtype="采购意向"]').hide()
- }
- }
- function getacount(bidamount,budget){
- if(typeof(bidamount) != "undefined" && bidamount != null && bidamount != ""&&bidamount!=="免费注册即可查看"){
- return bidamount
- }
- if(typeof(budget) != "undefined" && budget != null && budget != ""&&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);
- // 处理endtime,endtime取当日23:59:59
- // 将enttime时间戳加1天并减去1秒(单位用s来计算)
- //var day1 = 24 * 60 * 60
- //var seconds1 = 1
- //endtime = Number(endtime) + day1 - seconds1
- //电脑端保存的刷选 结束时间+1天没问题,因为结束时间是当前0点;移动端保存刷选的结束时间是当前23点59分59秒,再+1天会延长到第二天 23点59分58秒;
- // 这块放后端处理:搜索的时候默认到当天23点59分59秒;
- }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;
- }
- 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: $("#zbSeatchT [name='notkey']").val(),
- fileExists: $("#zbSeatchT [name='fileExists']").val(),
- city: $("#zbSeatchT [name='city']").val(),
- bid_field: $("#zbSeatchT [name='bid_field']").val(),
- searchGroup: $("#zbSeatchT [name='searchGroup']").val(),
- searchMode: $("#zbSeatchT [name='searchMode']").val(),
- wordsMode: $("#zbSeatchT [name='wordsMode']").val(),
- additionalWords: $("#zbSeatchT [name='additionalWords']").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();
- // appendDatas(r.list,tlflag,true,true);
- appendDatas(r.list,tlflag,true,false);
- }else{
- $(".working").hide();
- $(".hasNoData").show();
- // 隐藏页码
- searchInnerVue.showPage = false
- }
- tabflag = true;
- autoModelFn(r)
- }
- })
- return tabflag
- }
- getWhetherInAntiSpiderWhiteList()
- // 判断文字中是否有通用词(返回true表示text是通用词)
- // (关键词不为空时,判断是否包含通用词)
- function checkTextIncludesCommonWords (text) {
- if (!text) {
- return false
- }
- var passArr = []
- text = $.trim(text)
- if ($.isArray(commonSearchWordsRegExp)) {
- commonSearchWordsRegExp.forEach(function (reg) {
- var c = text.replace(reg, '')
- passArr.push(!!c)
- })
- }
- var hasNoPass = passArr.indexOf(false) !== -1
- return hasNoPass
- }
- // text: 去空格后的主关键词
- function checkAndClearTextIncludesCommonWords (text) {
- var mainKeysHasCommonWords = false
- var additionalWordsHasCommonWords = false
- // 检查主关键词
- if (checkTextIncludesCommonWords(text)) {
- mainKeysHasCommonWords = true
- $('#t-clear').trigger('click')
- }
- // 检查附加词
- var additionalWords = searchInnerVue.keywordTags
- var replacedAdditionalWords = []
- if ($.isArray(additionalWords)) {
- for(var i = 0; i < additionalWords.length; i++) {
- var item = additionalWords[i]
- if (checkTextIncludesCommonWords(item)) {
- // ...
- additionalWordsHasCommonWords = true
- } else {
- replacedAdditionalWords.push(item)
- }
- }
- if (additionalWordsHasCommonWords) {
- searchInnerVue.keywordTags = replacedAdditionalWords
- }
- }
- return mainKeysHasCommonWords || additionalWordsHasCommonWords
- }
- /// 搜索前执行函数
- function beforeSubmit(from){
- // from=='F'即执行的是点击搜索按钮或回车搜索事件
- // from=='filter-*'表示筛选查询事件
- // from=='tab-*'表示tab切换查询事件
- // from=='page-init-recovery'回显搜索
- from = from || ''
- var searchKeywords = $.trim($("#zbSeatchT input[name='keywords']").val())
- // 如果在反爬白名单,则空搜索刷新搜索结果(即允许空搜索)
- // 不在,则不允许空搜索(此处空搜索指的是主搜索框是否为空)
- if (!onAntiSpiderWhitelist) {
- // 切换三种筛选类型时候判断(切换tab时不弹窗)
- if (!searchKeywords) {
- if (from.indexOf('tab-') !== -1) {
- return false
- }
- }
- // 关键词去两边空格后为空
- if (!searchKeywords && searchInnerVue.keywordTags.length === 0) {
- showToast('请先输入关键词')
- return false
- } else {
- // 判断关键词中是否有通用词,并清空对应通用词的项
- var hasCommonWords = checkAndClearTextIncludesCommonWords(searchKeywords)
- if (hasCommonWords) {
- showToast('请输入项目名称等关键词')
- return false
- }
- }
- }
- // 关键词不为空时 存sessionStorage值
- if (searchKeywords !== "") {
- 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();
- searchInnerVue.dataTab = 'list'
- searchInnerVue.listModel = localStorage.getItem('login-clear-bidsearch-list-model')
- setTimeout(function(){
- currentPage=1;
- // 重置element ui页码为1
- searchInnerVue.listState.num = 1
- //时间
- 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($("#zbSeatchT [name='notkey']").val());
- if(!$("#zbSeatchT [name='keywords']").val()&&!$("#zbSeatchT [name='industry']").val()&&from!="F" && !$("#zbSeatchT [name='additionalWords']").val()){
- // getNewBids(currentPage);
- getNewBiddings(currentPage)
- }else{
- if(from!="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;
- }
- }
- 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: $("#zbSeatchT [name='notkey']").val(),
- fileExists: $("#zbSeatchT [name='fileExists']").val(),
- city: $("#zbSeatchT [name='city']").val(),
- bid_field: $("#zbSeatchT [name='bid_field']").val(),
- searchGroup: $("#zbSeatchT [name='searchGroup']").val(),
- searchMode: $("#zbSeatchT [name='searchMode']").val(),
- wordsMode: $("#zbSeatchT [name='wordsMode']").val(),
- additionalWords: $("#zbSeatchT [name='additionalWords']").val()
- };
- $.post("/front/pcAjaxReq",param,function(r){
- heightWords = r.heightWords
- if(r.limitFlag){
- LimitClass.limitFlag = true;
- LimitClass.result = r;
- LimitClass.list = r.list;
- LimitClass.paging(currentPage);
- LimitClass.prevNoLimitFlag = false;
- // 重新分页
- searchInnerVue.listState.totalPage = Math.ceil(r.count / pageSize)
- allCount = r.total
- searchInnerVue.listState.allCount = r.total
- // searchInnerVue.checkPageNumAdd1()
- }else{
- LimitClass.prevNoLimitFlag = true;
- LimitClass.limitFlag = false;
- pcAjaxReqCallBack(r);
- }
- autoModelFn(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)
- document.addEventListener('visibilitychange', function() {
- if (document.visibilityState === 'visible') {
- getBidIsJoin()
- }
- })
- })
- function autoModelFn (r) {
- var keywordFlag = $("#zbSeatchT [name='keywords']").val()
- var addkeyFlag = $("#zbSeatchT [name='additionalWords']").val()
- var sModel = $("#zbSeatchT [name='searchMode']").val()
- // console.log(autoSwitchModel, sModel, (keywordFlag || addkeyFlag), r.list);
- var jzFlag = !autoSwitchModel && sModel == 0 && (keywordFlag || addkeyFlag) && r.list == null
- var mhFlag = autoSwitchModel && sModel == 1 && (keywordFlag || addkeyFlag)
- if (jzFlag) {
- console.log(jzFlag, '精准flag');
- $("#zbSeatchT [name='searchMode']").val(1)
- searchInnerVue.keywordSearchType = 1
- beforeSubmit('filter-mode')
- autoSwitchModel = true
- }
- if (mhFlag) {
- console.log(mhFlag, '模糊flag');
- if (r.list && r.list.length > 0) {
- toastFn('精准搜索无结果,已为您自动切换到模糊搜索', 5000)
- autoSwitchModel = false
- } else {
- $("#zbSeatchT [name='searchMode']").val(0)
- searchInnerVue.keywordSearchType = 0
- }
- }
- }
- 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){
- currentPage = currentPage-1;
- return false
- }
- }
- $(".tabContainer").hide();
- $(".pagination").hide();
- $(".working").hide();
- $(".hasNoData").show();
- // 隐藏页码
- searchInnerVue.showPage = false
- submitflag=true;
- }else{
- //$(".tabContainer").show();
- $(".hasNoData").hide();
- searchInnerVue.listState.totalPage = Math.ceil(r.count / pageSize);
- appendDatas(r.list,true,false)
- }
- allCount = r.total
- searchInnerVue.listState.allCount = r.total
- }
- function afterAjaxReq(r){
- secondFlag=r.secondFlag;
- if(r.interceptOtherWord){
- $("#intercept .interceptWord").text(r.interceptOtherWord);
- $("#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.heightWords) != "undefined"){
- // heightWords = r.heightWords;
- // }
- heightWords = r.heightWords;
- if(r.pcAjaxFlag=="T"){
- // heightWords = r.heightWords;
- totalPage = Math.ceil(r.count / pageSize)
- list= r.list;
- secondList= r.secondList;
- // vue 重置总页数
- searchInnerVue.listState.totalPage = Math.ceil(r.count / pageSize);
- allCount = r.total
- searchInnerVue.listState.allCount = r.total
- // 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.totalPage = totalPage
- // searchInnerVue.checkPageNumAdd1()
- }else{
- totalPage = Math.ceil(r.count / pageSize);
- searchInnerVue.listState.totalPage = Math.ceil(r.count / pageSize)
- // searchInnerVue.checkPageNumAdd1()
- }
- allCount = r.total
- searchInnerVue.listState.allCount = r.total
- }
- }
- 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)
- }
- })
- }
- function distributeInit(){
- $.ajax({
- type: 'get',
- contentType: "application/json",
- url: '/entbase/ent/entinfo',
- success: function (r) {
- if (r.data) {
- if(r.data.admin_system || r.data.admin_department){
- $('#right-distribute').show();
- $('.line-distribute').show();
- }
- }
- }
- })
- // $('#right-distribute').show();
- // $('.line-distribute').show();
- $('#right-distribute').off('click').bind('click',function(e){
- e.stopPropagation()
- let len = $('.custom-checkbox:not(".check-all"):checked').length;
- let checkedArea = []
- let checked_id = []
- $('.custom-checkbox:not(".check-area"):checked').each(function(){
- if ($(this).attr('data-area')) {
- checkedArea.push($(this).attr('data-area'))
- }
- if ($(this).attr('dataid')) {
- checked_id.push($(this).attr('dataid'))
- }
- })
- if(len) {
- if(checkedArea.length !== 0){
- // 拉起选择人员弹窗 有地区
- person_Dialog.selectAreas = checkedArea
- }else{
- // 无地区
- person_Dialog.selectArea = []
- }
- person_Dialog.titleMsg = '选择接收人员' // 设置弹窗标题
- person_Dialog.searchVal = ''
- person_Dialog.centerDialogVisible = true // 打开弹窗
- person_Dialog.selectDataIds = checked_id // 传入标讯ID
- person_Dialog.getData('yes') // 发送获取人员列表请求
- }else{
- toastFn('尚未选择公告,请选择', 1000)
- }
- })
- }
- /*******参标方法start**********/
- /*
- 招标信息是否参标藏接口ajax
- bids: String, // 招标信息id(多个用,号拼接) 必填
- */
- function getBidIsJoin () {
- joinBidsClick()
- 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"]')
- var $dom = $('.title-text-checkbox[name="bid-list"]')
- $dom.each(function () {
- if ($(this).attr('dataid')) {
- dataId = $(this).attr("dataid");
- if (bids != "") {
- bids += ",";
- }
- bids += dataId;
- }
- })
- var paramsData = {
- ids: bids
- }
- $.ajax({
- type: 'post',
- contentType: "application/json",
- url: '/jyapi/jybx/core/participate/show?t=' + Date.now(),
- data: JSON.stringify(paramsData),
- dataType: 'json',
- success: function (r) {
- if (r.data) {
- var data = r.data
- if(data.length > 0) {
- Bidrenewal_Dialog.initBidrenewalDialog = true // 加载参标状态更新弹窗
- }
- $('.icon-canbiao').removeClass('checked')
- data.forEach(function (item, index) {
- $('.icon-canbiao[dataid="' + item.id + '"]').show()
- // $('.icon-canbiao[dataid="' + item + '"]').css("display","inline-block");
- if(item.value) {
- $('.icon-canbiao[dataid="' + item.id + '"]').addClass('checked')
- }
- })
- }
- }
- })
- }
- // 参标点击事件
- function joinBidsClick() {
- // console.log(vipState, '是否是超级订阅用户')
- // 单个参标点击事件
- $('.icon-canbiao').unbind('click').on('click',function(e) {
- // 登录判断
- if (!loginflag) {
- openLoginDig()
- return
- }
- e.stopPropagation()
- var $that = $(this)
- var checked = $(this).hasClass('checked')
- var checkedId = $(this).attr('dataid')
- if (checked) {
- toastFn('如需终止参标,需要在详情页进行操作。', 800)
- } else {
- joinBidAction('in', checkedId, function(res) {
- if (res.data && res.error_code == 0) {
- // toastFn('已参标,请前往我的参标项目列表查看', 1500)
- // 调起参标更新弹窗
- Bidrenewal_Dialog.sendId(checkedId)
- window.$BidrenewalDialog.open()
- $that.addClass('checked')
- } else if(res.error_code == -1){
- var msg = res.error_msg || '操作错误,请稍后重试'
- toastFn(msg, 1500)
- }
- })
- }
- })
- }
- /********参标方法end********/
- /**
- * @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
- window.open(link)
- }
- function getWhetherInAntiSpiderWhiteList () {
- $.ajax({
- url: '/publicapply/userbase/whitelist',
- type: 'GET',
- success: function(r){
- if (r && r.data) {
- onAntiSpiderWhitelist = r.data.onTheWhitelist
- if ($.isArray(r.data.filterReg)) {
- var w = []
- r.data.filterReg.forEach(function (item) {
- w.push(new RegExp(item))
- })
- commonSearchWordsRegExp = w
- }
- // 首次执行一次(兼容url传参查询)
- // 延迟执行,需要等到Vue实例初始化, clear按钮事件绑定完成, whitelist内容获取完成之后在校验
- var urlSearchValue = getParam('keywords')
- if (urlSearchValue && !onAntiSpiderWhitelist) {
- setTimeout(function () {
- var hasCommonWords = checkAndClearTextIncludesCommonWords(searchvalue || urlSearchValue)
- if (hasCommonWords) {
- showToast('请输入项目名称等关键词')
- }
- }, 500)
- }
- }
- }
- })
- }
|