1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842 |
- /*
- * fixed top input for zyh @date 2020/6/8
- * */
- var userReadnum = 0
- var vSwitch = 'f'
- var newUserType = false
- // 判断用户权限版本
- function getUserType() {
- $.ajax({
- type: 'POST',
- url: '/publicapply/subscribe/vipSwitch',
- success: function(res) {
- if (res && res.data) {
- vSwitch = res.data.vt || 'f'
- }
- }
- })
- }
- getUserType()
- function hiddenTips() {
- $('#UserTips').hide()
- }
- function gotoPay() {
- $('#UserTips').hide()
- location.href = '/areaPack/wx/page/buy?type=buy'
- }
- // 获取用户是否为新用户
- function getUserNewType() {
- window.jyAddInfo = {
- isUpgrade: false
- }
- $.ajax({
- url: '/bigmember/use/isAdd',
- type: 'POST',
- success: function (r) {
- if (r && r.data) {
- window.jyAddInfo = r.data
- }
- }
- })
- }
- getUserNewType()
- function hiddenTips2() {
- $('#tipsType').hide()
- }
- function updateJump2() {
- $('#tipsType').hide()
- // location.replace('/jyapp/vipsubscribe/toSubVipSetPage?vSwitch=v')
- $.ajax({
- url: '/publicapply/free/oneProvinceSet',
- type: 'POST',
- success: function (res) {
- location.href = '/front/vipsubscribe/toSubVipSetPage'
- }
- })
- }
- var nowClientHeight = document.documentElement.clientHeight || document.body.clientHeight
- // 监听banner高度变化
- $(function () {
- var GolBalTime;
- function listenerBannerHeight () {
- // fix swiper autoplay
- if (swiper1 && !Boolean(swiper1.translate)) {
- swiper1.update()
- swiper1.autoplay.run()
- }
- var tTop = $(document).scrollTop()
- if (tTop >= 12) {
- $('.home_search').addClass('fixed-top')
- } else {
- $('.home_search').removeClass('fixed-top')
- }
- GolBalTime = requestAnimationFrame(listenerBannerHeight)
- }
- listenerBannerHeight()
- $("body").on('tap longTap', '.tslist', function () {
- var tempS = $(this).addClass('hover')
- setTimeout(function() {
- tempS.removeClass('hover')
- }, 50)
- })
- })
- /*
- * money unit for zyh @date 2020/6/5
- * */
- var MoneyUnit = {
- levelArr: ['元', '万元', '亿元', '万亿元'],
- test: function (num, type, lv) {
- if (type === void 0) {
- type = 'string';
- }
- if (lv === void 0) {
- lv = 0;
- }
- if (num === 0) {
- if (type === 'string') {
- return '0';
- }
- if (type === 'lv') {
- return this.levelArr[lv];
- }
- if (type === 'number') {
- return 0;
- }
- if (type === 'index') {
- return lv;
- }
- }
- var result = num / Math.pow(10000, lv);
- if (result > 10000 && lv < 2) {
- return this.test(num, type, lv + 1);
- } else {
- if (type === 'string') {
- return String(Math.floor(result * 100) / 100).replace('.00', '') + this.levelArr[lv];
- }
- if (type === 'lv') {
- return this.levelArr[lv];
- }
- if (type === 'index') {
- return lv;
- }
- if (type === 'number') {
- return String(Math.floor(result * 100) / 100).replace('.00', '');
- }
- }
- }
- }
- function getDefaultRangeForLocal () {
- function changeDefaultForSearchRange (type, key, value) {
- var prefixForKey = 'mainSearchRangeFor'
- if (type === 'set') {
- localStorage.setItem(prefixForKey + key, value)
- } else {
- return localStorage.getItem(prefixForKey + key)
- }
- }
- var tempList = []
- if (changeDefaultForSearchRange('get', 'Title') == 'true') {
- tempList.push('title')
- }
- if (changeDefaultForSearchRange('get', 'Content') == 'true') {
- tempList.push('content')
- }
- if (!tempList.length) {
- tempList = ['title', 'content']
- }
- return tempList.join(',')
- }
- function showSearchTipForTimeRange () {
- var tempDom = $("#supersearchPage #hasNoData_tiptext>font:eq(0)")
- var tipMap = {
- 'thisyear': '近一年',
- 'lately-7': '近7天',
- 'lately-30': '近30天'
- }
- var tempStr = ''
- var defaultRange = sessionStorage.superSearch_publishtime || SuperSearch.reqParam.publishtime || 'thisyear'
- 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)
- tempDom.show();
- }
- var SuperSearch = {
- // 筛选企业信息
- filterWin: {},
- filterBuy: {},
- secondFlag:"",
- secondList:"",
- secondKWS:"",
- isMyPage: false,
- initFlag: false,
- dropload: null,
- ZBADDRESS: "",
- s_words: "",
- myHistory: "",
- msgset: "",
- dyDiv: true, //显示订阅剑鱼标讯信息
- subtype_proposed: "拟建",
- requesting: false,
- noMoreCache: false,
- showNull: null,//null true false
- advert: null,
- advertIsClose: false,
- interceptWord: "",
- industry: "",
- sortArray: "",
- limitFlag: false,
- localFalg:false,
- reqParam: {
- "searchvalue": "",
- "subtype": "",
- "scope": "",
- "publishtime": "thisyear",
- "selectType": getDefaultRangeForLocal(),
- "minprice":"",
- "maxprice":"",
- "industry":"",
- "pageNum": 1,
- "winner":"",
- "buyerclass":""
- },
- njTipEasyPopup: null,
- hasHistory :false,
- hasSubscribe:false,
- isVip :false,
- locationCity:"",
- listLength:0,
- locationCount:0,
- init: function(isReload,isFocus,isPushHistory){
- this.dyDiv = true;
- // 初始化高级搜索和筛选中标企业
- initSearchHeader()
- if(!isReload){
- this.recoveryPage();
- }
- if (isReload && vMainSearchComponent) {
- sessionStorage.removeItem('superSearch_newQueryParams')
- sessionStorage.removeItem('superSearch_newQueryParams_components')
- vMainSearchComponent.resetInitStatus()
- }
- //loadTipMsg加载历史记录和我的订阅
- this.loadTipMsg();
- this.clearSessionStorage();
- EntSearch.isMyPage = false;
- this.isMyPage = true;
- $("#supersearchPage").addClass("absolute-hide");
- $("#searchIndex").addClass("hidden");
- $("#supersearchPage").removeClass("hidden");
- setTimeout(function(){
- $("#supersearchPage").removeClass("absolute-hide");
- },0);
- try{
- JyObj.hiddenBottom("0");
- }catch(e){}
- $("body").css("background-color","#fff");
- if(SuperSearch.dyDiv){ //首次进来是否显示订阅
- SuperSearch.showToOrder(false)
- }else{
- SuperSearch.showToOrder(true)
- }
- SuperSearch.canSearch();
- if(isReload){
- this.resetPage(isFocus);
- if(sessionStorage && history && isPushHistory){
- history.pushState({},"","");
- }
- this.searchKeyword();
- }
- if(this.initFlag){
- return;
- }
- this.initFlag = true;
- //localsession存储标题/全文搜索 和 列表/表格展示
- //if(localStorage){
- // if(localStorage.selectType=="allSearch"){
- // $("#supersearchPage #search_all").addClass("on").siblings().removeClass("on");
- // }else if(localStorage.selectType=="titleSearch"){
- //$("#supersearchPage #search_title").addClass("on").siblings().removeClass("on");
- // }
- //}
- $("#supersearchPage #feedback").on("tap",function(){
- SuperSearch.goToFeedbackPage();
- });
- $("#supersearchPage #allSearchModel").on("tap",function(){
- SuperSearch.allSearch();
- });
- $("#supersearchPage #search_title").on("tap",function(){
- SuperSearch.titleSearch();
- });
- $("#supersearchPage #search_all").on("tap",function(){
- SuperSearch.allSearch();
- });
- $("#supersearchPage .showType>.showlist").on("tap",function(){
- SuperSearch.showlist();
- });
- $("#supersearchPage .showType>.showtable").on("tap",function(){
- SuperSearch.showTable();
- });
- $("#supersearchPage .jyshaxuan>div").on("tap",function(){
- SuperSearch.inputBlur();
- });
- $("#supersearchPage .tableclose").on("tap",function(){
- $("#supersearchPage .TableTip").fadeOut("normal",function(){
- $.post('/jylab/changePro',function(r){});
- });
- });
- //筛选菜单展示or隐藏
- $("#supersearchPage").on("tap" , "#clickFilter", function(){
- // 企业搜索
- if ($(".tabs-nav .active").index() === 1 && $("#search-header-input").val().trim() != '') {
- $("#supersearchPage input[name=super_searchinput]").blur();
- window.isKeyDownToEntSearch = true
- if (vEntSearchComponent) {
- // vEntSearchComponent.toggleEntShow(true)
- }
- return
- }
- if ($(this).text().trim() !== '搜索' || $("#search-header-input").val().trim() === '') {
- return
- }
- if (vMainSearchComponent) {
- vMainSearchComponent.toggleEntShow(true)
- }
- return;
- hideTab();
- SuperSearch.inputBlur();
- if(SuperSearch.requesting){
- return;
- }
- $("#supersearchPage .inputDiv").addClass("hidden");
- $("#supersearchPage #super_search").toggleClass("hidden");
- if($("#supersearchPage #super_search").hasClass("hidden")){
- if(SuperSearch.interceptWord != ""){
- $("#supersearchPage #intercept").removeClass("hidden");
- }
- if(SuperSearch.showNull){
- $("#supersearchPage #selLable").removeClass("hidden");
- $("#supersearchPage .nullcontent").removeClass("hidden");
- }else{
- if(SuperSearch.showNull == null){
- $("#supersearchPage #selLable").addClass("hidden");
- }else{
- $("#supersearchPage #selLable").removeClass("hidden");
- }
- $("#supersearchPage #wrapper").removeClass("hidden");
- }
- }else{
- $("#supersearchPage #intercept").addClass("hidden");
- $("#supersearchPage #selLable").addClass("hidden");
- $("#supersearchPage .nullcontent").addClass("hidden");
- $("#supersearchPage #wrapper").addClass("hidden");
- }
- });
- $("#supersearchPage input[name=super_searchinput]").on("input",function(){
- SuperSearch.canSearch();
- });
- //是否显示提示搜索框
- $("#supersearchPage input[name=super_searchinput]").focus(function(){
- hideTab();
- SuperSearch.afterFocus();
- }).blur(function(){
- setTimeout(function(){
- $("#supersearchPage .clearInpt").addClass("hidden");
- },300);
- });
- //清除输入框功能
- $("#supersearchPage .clearInpt").on("tap",function(){
- $("#supersearchPage input[name=super_searchinput]").val("");
- $("#supersearchPage input[name=super_searchinput]").focus();
- SuperSearch.canSearch();
- });
- //提交查询
- $("#supersearchPage").on('click', "#clickFilter",function(){
- // 企业搜索
- if ($(".tabs-nav .active").index() === 1 && $("#search-header-input").val().trim() != '') {
- $("#supersearchPage input[name=super_searchinput]").blur();
- window.isKeyDownToEntSearch = true
- if (vEntSearchComponent) {
- vEntSearchComponent.toggleEntShow(true)
- }
- return
- }
- if ($(this).text().trim() !== '搜索' || $("#search-header-input").val().trim() === '') {
- return
- }
- sessionStorage.setItem('isSearchListPage', 'true')
- // SuperSearch.isSearchListPage = true
- $(".loading_").show();
- SuperSearch.formSubmit("N");
- });
- $("#supersearchPage .jyshxbottom .jydqsure").on("tap",function(){
- if($(this).hasClass("on")){
- var max=$("#supersearchPage .maxMrice").val(),min=$("#supersearchPage .minMrice").val();
- if(Number(max)<Number(min)&&max!=""&&min!=""){
- $("#supersearchPage .maxMrice").val(min);
- $("#supersearchPage .minMrice").val(max);
- }
- setTimeout(function(){
- $(".loading_").show();
- SuperSearch.formSubmit("N");
- },300)
- }
- });
- //清除筛选
- $("#supersearchPage .jydqreset").on("tap",function(){
- SuperSearch.resetSx();
- });
- //是否开通超级搜索服务
- //关闭搜索后订阅================================================================
- $("#supersearchPage #close_set").on("tap",function(){
- SuperSearch.showToOrder(false);
- SuperSearch.dyDiv=true;
- });
- // 获取用户信息-用于立即订阅按钮
- function getKeyUserInfo () {
- // 免费用户
- // --> 已设置10组关键词,订阅失败提示
- // --> 小于10组
- // --> 历史老用户-未选择区域-提示更新
- // --> 选择区域-关键词列表
- // --> 新用户-未选择区域-订阅页面
- // --> 选择区域-关键词列表
- var isOldUser = false
- var nowKeyLength = 8
- var isSelectArea = false
- // 获取用户关键词数据
- $.ajax({
- url: '/publicapply/free/subscribe',
- type: 'post',
- success: function (res) {
- if (res.error_code === 0 && res.data) {
- try {
- isSelectArea = !!res.data.area
- nowKeyLength = res.data.keys.length
- } catch (e) {
- console.warn('error format keys length')
- }
- }
- },
- })
- // S-直接订阅
- $("#supersearchPage #zjdy").on("tap",function(){
- var rFlag = false;
- if (SuperSearch.s_words==""){
- SuperSearch.s_words=$.trim($("#supersearchPage [name='super_searchinput']").val());
- SuperSearch.s_words=SuperSearch.s_words.replace(/\s+/g," ");
- }
- if(SuperSearch.isVip || window.jyUserPower.member){
- $.ajax({
- type: "post",
- url: "/publicapply/subscribe/setUserInfo",
- data: {
- pageType:'keyWords',
- actionType: 'directSubKWS',
- kws_name:SuperSearch.s_words,
- vSwitch: vSwitch
- },
- dataType: "json",
- async: false,
- success: function(r){
- if(r.flag=="y"){
- rFlag = true;
- }else if(r.flag=="o"){
- EasyAlert.show("您已经订阅过此关键字");
- }else if(r.flag=="m"){
- EasyAlert.show("您已经超过订阅<br>关键字上限");
- }
- },error: function(){
- rFlag = true;
- }
- });
- if(rFlag){
- SuperSearch.setSessionStorage();
- window.location.href = "/front/vipsubscribe/toSetKeyWordPage";
- }
- }else{
- // 免费用户
- isOldUser = !jyAddInfo.isUpgrade
- if (nowKeyLength >= 10) {
- return EasyAlert.show("您已经超过订阅<br>关键字上限");
- } else {
- if (isSelectArea) {
- // 执行下方原有逻辑
- } else if (isOldUser) {
- return $('#tipsType').show()
- }
- }
- $.ajax({
- type: "post",
- url: "/member/swordfish/ajaxReq",
- data: {keys:SuperSearch.s_words,reqType: "subscribe"},
- dataType: "json",
- async: false,
- success: function(r){
- if(r.flag=="y"){
- rFlag = true;
- }else if(r.flag=="o"){
- EasyAlert.show("您已经超过订阅<br>关键字上限");
- }
- },error: function(){
- rFlag = true;
- }
- });
- if(rFlag){
- SuperSearch.setSessionStorage();
- var goHref = "/front/vipsubscribe/toSetKeyWordPage";
- if (!isSelectArea) {
- goHref = "/front/vipsubscribe/toSubVipSetPage";
- }
- window.location.href = goHref
- }
- }
- });
- // E-直接订阅
- }
- getKeyUserInfo()
- //删除历史搜索
- $("#supersearchPage").on("click", " #del_history", function(){
- if(localStorage){
- localStorage.removeItem("superSearch_history");
- }
- if($("#supersearchPage .search-one-box ul.history-list-box").find("li").length >0){
- $.ajax({
- type:"post",
- url:"/swordfish/delWxHistorySearch",
- success:function(rt){
- $(".tabs-box .tabs-content-page").eq(0).addClass("hidden")
- }
- });
- }
- $("#supersearchPage .search-one-box ul.history-list-box").find("li").remove();
- });
- ////
- SuperSearch.njTipEasyPopup = new EasyPopup("nijianTip");
- $("#supersearchPage .q-mark").on("tap",function(){
- setTimeout(function(){
- SuperSearch.njTipEasyPopup.show();
- },500);
- });
- //金额点击事件
- $("#supersearchPage .money-dialog .btn").on("tap",function(){
- $(this).addClass("active");
- $("#supersearchPage .money-dialog .money-inp").removeClass("active");
- });
- $("#supersearchPage .money-dialog .money-inp").on("tap",function(){
- $(this).addClass("active");
- $("#supersearchPage .money-dialog .btn").removeClass("active");
- });
- var reg = /^[\u4e00-\u9fa5]+$/;
- var maxnum = "";
- $("#supersearchPage .maxMrice").on("input propertychange",function(){
- /*
- var minp = $(this).val()
- if(!/^[\d]{1,9}([.][\d]{0,2})?$/.test(minp)){
- minp = minp.substr(0,minp.length-1);
- $(this).val(minp)
- }*/
- var oldvalue = $(this).val();
- var maxp = $.trim($(this).val()).replace(/\s/g,"");
- if(oldvalue != maxp){
- $(this).val(maxp);
- }
- if(!/^[\d]{1,9}([.][\d]{0,2})?$/.test(maxp)){
- if((reg.test(maxp)||isNaN(maxp)||maxp.indexOf("e")>0)&&maxp.indexOf(".")<0){
- $(this).val(maxnum);
- }else{
- //maxp = maxp.substr(0,maxp.length-1);
- if(reg.test(maxp)||isNaN(maxp)||maxp.indexOf("e")>0){
- $(this).val(maxnum);
- }else{
- if(maxp.indexOf(".")>0){
- var offront = maxp.split(".")[0];
- var ofafter = maxp.split(".")[1];
- if(offront.length>9||ofafter.length>2){
- //if(offront.length>9){
- $(this).val(maxnum);
- // maxnum = offront.substr(0,9)+"."+ maxnum.split(".")[1].substr(0,2);
- //}else{
- // $(this).val(offront.substr(0,9)+"."+ofafter.substr(0,2))
- // maxnum = offront.substr(0,9)+"."+ofafter.substr(0,2);
- //}
- }else{
- //$(this).val(maxp);
- maxnum = maxp;
- }
- }else{
- if(maxp.length>9){
- $(this).val(maxnum);
- }else{
- //$(this).val(maxp);
- maxnum = maxp;
- }
- }
- }
- }
- }else{
- maxnum = maxp;
- }
- }).blur(function(){
- var max=$("#supersearchPage .maxMrice").val(),min=$("#supersearchPage .minMrice").val();
- if(Number(max)<Number(min)&&max!=""&&min!=""){
- $("#supersearchPage .maxMrice").val(min);
- $("#supersearchPage .minMrice").val(max);
- minnum = max;
- maxnum = min;
- }
- });
- var minnum = "";
- $("#supersearchPage .minMrice").on("input propertychange",function(){
- /*
- var minp = $(this).val()
- if(!/^[\d]{1,9}([.][\d]{0,2})?$/.test(minp)){
- minp = minp.substr(0,minp.length-1);
- $(this).val(minp)
- }*/
- var oldvalue = $(this).val();
- var minp = $.trim($(this).val()).replace(/\s/g,"");
- if(oldvalue != minp){
- $(this).val(minp);
- }
- if(!/^[\d]{1,9}([.][\d]{0,2})?$/.test(minp)){
- if((reg.test(minp)||isNaN(minp)||minp.indexOf("e")>0)&&minp.indexOf(".")<0){
- $(this).val(minnum);
- }else{
- //minp = minp.substr(0,minp.length-1);
- if(reg.test(minp)||isNaN(minp)||minp.indexOf("e")>0){
- $(this).val(minnum);
- }else{
- if(minp.indexOf(".")>0){
- var offront = minp.split(".")[0];
- var ofafter = minp.split(".")[1];
- if(offront.length>9||ofafter.length>2){
- //if(offront.length>9){
- $(this).val(minnum);
- // minnum = offront.substr(0,9)+"."+ minnum.split(".")[1].substr(0,2);
- //}else{
- // $(this).val(offront.substr(0,9)+"."+ofafter.substr(0,2))
- // minnum = offront.substr(0,9)+"."+ofafter.substr(0,2);
- //}
- }else{
- //$(this).val(minp);
- minnum = minp;
- }
- }else{
- if(minp.length>9){
- $(this).val(minnum);
- }else{
- //$(this).val(minp);
- minnum = minp;
- }
- }
- }
- }
- }else{
- minnum = minp;
- }
- }).blur(function(){
- var max=$("#supersearchPage .maxMrice").val(),min=$("#supersearchPage .minMrice").val();
- if(Number(max)<Number(min)&&max!=""&&min!=""){
- $("#supersearchPage .maxMrice").val(min);
- $("#supersearchPage .minMrice").val(max);
- minnum = max;
- maxnum = min;
- }
- });
- $("#supersearchPage .shaixIndustry").on("tap",function(){
- $(this).addClass("shaixcl");
- $(this).siblings().removeClass("shaixcl");
- $("#supersearchPage .industry-dialog").removeClass("hidden");
- $("#supersearchPage .jydq-dialog,#supersearchPage .jytype-dialog,#supersearchPage .jypt-dialog,#supersearchPage .money-dialog").addClass("hidden");
- });
- $("#supersearchPage .shaixMoney").on("tap",function(){
- $(this).addClass("shaixcl");
- $(this).siblings().removeClass("shaixcl");
- $("#supersearchPage .money-dialog").removeClass("hidden");
- $("#supersearchPage .jydq-dialog,#supersearchPage .jytype-dialog,#supersearchPage .jypt-dialog,#supersearchPage .industry-dialog").addClass("hidden");
- });
- //
- $("#supersearchPage .shaixpt").on("tap",function(){
- $("#supersearchPage .jypt-dialog").removeClass("hidden");
- $("#supersearchPage .jydq-dialog,#supersearchPage .jytype-dialog,#supersearchPage .money-dialog,#supersearchPage .industry-dialog").addClass("hidden");
- $(this).addClass("shaixcl");
- $(this).siblings().removeClass("shaixcl");
- });
- $("#supersearchPage .shaixone").on("tap",function(){
- $("#supersearchPage .jydq-dialog").removeClass("hidden");
- $("#supersearchPage .jypt-dialog,#supersearchPage .jytype-dialog,#supersearchPage .money-dialog,#supersearchPage .industry-dialog").addClass("hidden");
- $(this).addClass("shaixcl");
- $(this).siblings().removeClass("shaixcl");
- });
- $("#supersearchPage .shaixtwo").on("tap",function(){
- $("#supersearchPage .newest").removeClass("hidden");
- $("#supersearchPage .jytype-dialog").removeClass("hidden");
- $("#supersearchPage .jypt-dialog,#supersearchPage .jydq-dialog,#supersearchPage .money-dialog,#supersearchPage .industry-dialog").addClass("hidden");
- $(this).addClass("shaixcl");
- $(this).siblings().removeClass("shaixcl");
- });
- var dialogObj = $("#supersearchPage .contentone");
- dialogObj.find(".btn").on("tap",function(){
- if($(this).parent().index() == 0){
- dialogObj.find(".btn").removeClass("active");
- }else{
- dialogObj.find("ul:first li:first .btn").removeClass("active");
- };
- $(this).toggleClass("active");
- if(dialogObj.find(".btn.active").length == 0){
- dialogObj.find("ul:first li:first .btn").addClass("active");
- };
- });
- var dialogObjtwo = $("#supersearchPage .contenttwo");
- dialogObjtwo.find(".btn").on("tap",function(){
- if($(this).parent().index() == 0){
- dialogObjtwo.find('div[id="dqbtn"]').removeClass("active");
- dialogObjtwo.find(".btn").removeClass("active");
- }else{
- dialogObjtwo.find("ul:first li:first .btn").removeClass("active");
- };
- $(this).toggleClass("active");
- if ($(this).attr("class")!="active"){
- $(this).prevAll('div[id="dqbtn"]').removeClass("active");
- };
- if($(this).parent("li").find(".btn").length == $(this).parent("li").find(".btn.active").length){
- $(this).prevAll('div[id="dqbtn"]').addClass("active");
- dialogObjtwo.find("ul:first li:first .btn").removeClass("active");
- };
- if(dialogObjtwo.find(".btn.active").length == 0){
- dialogObjtwo.find("ul:first li:first .btn").addClass("active");
- };
- });
- dialogObjtwo.find('div[id="dqbtn"]').on("tap",function(){
- $(this).toggleClass("active");
- if ($(this).attr("class") != "active"){
- $(this).nextAll(".btn").removeClass("active");
- }else{
- $(this).nextAll(".btn").addClass("active");
- dialogObjtwo.find("ul:first li:first .btn").removeClass("active");
- };
- if(dialogObjtwo.find(".btn.active").length == 0){
- dialogObjtwo.find("ul:first li:first .btn").addClass("active");
- };
- });
- //获取输入时间
- $("#supersearchPage .jypt-pt button").on("tap",function(){
- var thisIndex = $("#supersearchPage .jypt-pt .jypt-active").index();
- $("#supersearchPage .jypt-pt .jypt-active").removeClass("jypt-active");
- if(thisIndex == $(this).index()){
- $(this).removeClass("jypt-active");
- }else{
- $(this).addClass("jypt-active");
- }
- if($("#supersearchPage .jypt-pt .jypt-active").length == 0){
- $("#supersearchPage .jypt-pt>button:first").addClass("jypt-active");
- }
- $("#supersearchPage .jypt-timeinputs").removeClass("jypt-timeinputs-active");
- });
- $("#supersearchPage .jypt-fg").on("tap",function(){
- $("#supersearchPage .jypt-pt .jypt-active").removeClass("jypt-active");
- $("#supersearchPage .jypt-timeinputs").toggleClass("jypt-timeinputs-active");
- if(!$("#supersearchPage .jypt-timeinputs").hasClass("jypt-timeinputs-active")){
- $("#supersearchPage .jypt-pt>button:first").addClass("jypt-active");
- }
- });
- //获取当前时间
- var date = (function () {
- var date = new Date();
- var year = date.getFullYear();
- var month = date.getMonth() + 1;
- var day = date.getDate();
- month = month < 10 ? '0' + month : month;
- day = day < 10 ? '0' + day : day;
- return year + '-' + month + '-' + day;
- })();
- // 显示记录值
- var nowStartTime, nowEndTime;
- function resetDefaultTime () {
- var stime = localStorage.search_starttime;
- var etime = localStorage.search_endtime;
- var regTime = new RegExp(/\d{4}年\d{2}月\d{2}日/)
- if (stime && regTime.test(stime)) {
- nowStartTime = stime.replace('日', '').split(/[年|月]/)
- $("#supersearchPage #starttime").val(stime).attr('data-value', new Date(nowStartTime.join('/')).getTime());
- } else {
- $("#supersearchPage #starttime").val('').attr('data-value', '');
- localStorage.removeItem('search_starttime')
- }
- if (etime && regTime.test(etime)) {
- nowEndTime = etime.replace('日', '').split(/[年|月]/)
- $("#supersearchPage #endtime").val(etime).attr('data-value', new Date(nowEndTime.join('/')).getTime());
- } else {
- $("#supersearchPage #endtime").val('').attr('data-value', '');
- localStorage.removeItem('search_endtime')
- }
- }
- resetDefaultTime()
- // 点击事件绑定datepicker
- $("#supersearchPage #starttime").on("click",function(){
- if(typeof(isWxsearchlist) != "undefined"){
- $("#supersearchPage .sl-jyshxbottom").addClass("hide");
- }
- weui.datePicker({
- id: 'start' + new Date().getTime(),
- start: 2000,
- title: '选择开始时间',
- end: nowEndTime ? nowEndTime.join('-') : new Date(),
- defaultValue: nowStartTime ? nowStartTime : date.split('-'),
- className: 'jymobile-datePicker start',
- onChange: function (result) {
- var nowTArr = result.map(function (v) {
- return v.label
- })
- $(".jymobile-datePicker.start .weui-picker__item").each(function(){
- var nowT = $(this).text()
- $(this).removeClass('is-now-select')
- if (nowTArr.indexOf(nowT) !== -1) {
- $(this).addClass('is-now-select')
- }
- })
- },
- onClose: function () {
- if(typeof(isWxsearchlist) != "undefined"){
- $("#supersearchPage .sl-jyshxbottom").removeClass("hide");
- }
- },
- onConfirm: function (result) {
- var year = result[0].value;
- var month = result[1].value < 10 ? '0' + result[1].value : result[1].value;
- var day = result[2].value < 10 ? '0' + result[2].value : result[2].value;
- var time_result = year + '年' + month + '月' + day + '日';
- var timeSec = year + '/' + month + '/' + day
- nowStartTime = [year, month, day]
- if(localStorage){
- localStorage.search_starttime = time_result;
- }
- $("#supersearchPage #starttime").val(time_result).attr('data-value', new Date(timeSec).getTime());
- SuperSearch.afterSelect();
- }
- });
- $(".jymobile-datePicker.start #weui-picker-confirm").text('确认')
- if (!nowStartTime) {return}
- $(".jymobile-datePicker.start .weui-half-screen-dialog__ft").prepend("<a href=\"javascript:;\" class=\"weui-btn weui-btn_disabled weui-picker__btn\" id=\"resetTime\" data-action=\"select\" style=\"text-decoration: none;\">\u91CD\u7F6E</a>");
- // $(".jymobile-datePicker.start .weui-half-screen-dialog__ft").prepend(`<a href="javascript:;" class="weui-btn weui-btn_disabled weui-picker__btn" id="resetTime" data-action="select" style="text-decoration: none;">重置</a>`)
- $(".jymobile-datePicker.start #resetTime").on('click',function () {
- $('.jymobile-datePicker.start .weui-mask.weui-animate-fade-in').trigger('click');
- $('.jymobile-datePicker.start .weui-mask.weui-animate-fade-in').click();
- $("#supersearchPage #starttime").attr("data-value","").val('');
- nowStartTime = null
- if(localStorage){
- localStorage.removeItem("search_starttime");
- }
- SuperSearch.afterOnClear();
- })
- });
- $("#supersearchPage #endtime").on("click",function(){
- if(typeof(isWxsearchlist) != "undefined"){
- $("#supersearchPage .sl-jyshxbottom").addClass("hide");
- }
- weui.datePicker({
- id: 'end' + new Date().getTime(),
- start: nowStartTime ? nowStartTime.join('-') : 2000,
- title: '选择结束时间',
- end: new Date(),
- defaultValue: nowEndTime ? nowEndTime : date.split('-'),
- className: 'jymobile-datePicker end',
- onChange: function (result) {
- var nowTArr = result.map(function (v) {
- return v.label
- })
- $(".jymobile-datePicker.end .weui-picker__item").each(function(){
- var nowT = $(this).text()
- $(this).removeClass('is-now-select')
- if (nowTArr.indexOf(nowT) !== -1) {
- $(this).addClass('is-now-select')
- }
- })
- },
- onClose: function () {
- if(typeof(isWxsearchlist) != "undefined"){
- $("#supersearchPage .sl-jyshxbottom").removeClass("hide");
- }
- },
- onConfirm: function (result) {
- var year = result[0].value;
- var month = result[1].value < 10 ? '0' + result[1].value : result[1].value;
- var day = result[2].value < 10 ? '0' + result[2].value : result[2].value;
- var time_result = year + '年' + month + '月' + day + '日';
- var timeSec = year + '/' + month + '/' + day
- nowEndTime = [year, month, day]
- if(localStorage){
- localStorage.search_endtime = time_result;
- }
- $("#supersearchPage #endtime").val(time_result).attr('data-value', new Date(timeSec).getTime());
- SuperSearch.afterSelect();
- }
- });
- $(".jymobile-datePicker.end #weui-picker-confirm").text('确认')
- if (!nowEndTime) {return}
- $(".jymobile-datePicker.end .weui-half-screen-dialog__ft").prepend("<a href=\"javascript:;\" class=\"weui-btn weui-btn_disabled weui-picker__btn\" id=\"resetTime\" data-action=\"select\" style=\"text-decoration: none;\">\u91CD\u7F6E</a>");
- // $(".jymobile-datePicker.end .weui-half-screen-dialog__ft").prepend(`<a href="javascript:;" class="weui-btn weui-btn_disabled weui-picker__btn" id="resetTime" data-action="select" style="text-decoration: none;">重置</a>`)
- $(".jymobile-datePicker.end #resetTime").on('click',function () {
- $('.jymobile-datePicker.end .weui-mask.weui-animate-fade-in').trigger('click');
- $('.jymobile-datePicker.end .weui-mask.weui-animate-fade-in').click();
- $("#supersearchPage #endtime").attr("data-value","").val('');
- nowEndTime = null
- if(localStorage){
- localStorage.removeItem("search_endtime");
- }
- SuperSearch.afterOnClear();
- })
- });
- //返回时 是否显示table的查看更多
- SuperSearch.isTable($(".select-show-type-group").hasClass('is-table'));
- },
- recoveryPage: function(){
- $("#searchIndex").addClass("hidden");
- $("#supersearchPage").removeClass("hidden");
- $("#supersearchPage #wrapper").removeClass("hidden");
- $("#supersearchPage .selLable").removeClass("hidden");
- SuperSearch.setUpLastPage();
- },
- searchKeyword: function(){
- if(searchWord != null && searchWord != ""){
- $("#supersearchPage input[name=super_searchinput]").val(searchWord);
- this.getIndustry();
- this.canSearch();
- SuperSearch.formSubmit("N");
- }
- },
- resetPage: function(flag){
- this.showNull = null;
- this.requesting = false;
- this.dyDiv = false;
- this.limitFlag = false;
- this.reqParam = {
- "searchvalue": "",
- "subtype": "",
- "scope": "",
- "publishtime": "thisyear",
- "selectType": getDefaultRangeForLocal(),
- "minprice":"",
- "maxprice":"",
- "industry":"",
- "pageNum": 1
- }
- resetTopSearch()
- $("#supersearchPage #list").text("");
- $("#supersearchPage .dropload-down").remove();
- $("#supersearchPage .nullcontent").addClass("hidden");
- $("#supersearchPage #super_search").addClass("hidden");
- $("#supersearchPage #wrapper").addClass("hidden");
- $("#supersearchPage .selLable").addClass("hidden");
- $("#supersearchPage input[name=super_searchinput]").val("");
- var thisClass = this;
- if(flag){
- if(mySysIsIos()){
- $("#supersearchPage input[name=super_searchinput]").focus();
- thisClass.afterFocus();
- }else{
- setTimeout(function(){
- $("#supersearchPage input[name=super_searchinput]").focus();
- thisClass.afterFocus();
- },100);
- }
- }
- this.getIndustry();
- this.resetSx();//重置筛选
- $("#supersearchPage .shaixIndustry").addClass("shaixcl");
- $("#supersearchPage .shaixIndustry").siblings().removeClass("shaixcl");
- $("#supersearchPage .industry-dialog").removeClass("hidden");
- $("#supersearchPage .jydq-dialog,.jytype-dialog,.jypt-dialog,.money-dialog").addClass("hidden");
- },
- afterFocus: function(){
- if($.trim($("#supersearchPage input[name=super_searchinput]").val()).length>0){
- $("#supersearchPage .clearInpt").removeClass("hidden");
- $("#supersearchPage .query").removeClass("hidden");
- }
- if(!!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)){ //处理ios输入框光标无法遮盖问题
- $("#supersearchPage .app-layout-content-b").scrollTop(0);
- $("#supersearchPage .app-layout-content-b").off("scroll", SuperSearch.SuperSearchInputblur).on("scroll",SuperSearch.SuperSearchInputblur);
- }
- },
- limitPaging: function(me){
- $("#supersearchPage #list>.tslist.hidden").each(function(i){
- if(i >= 50){
- return false;
- }
- $(this).removeClass("hidden");
- });
- $("#supersearchPage #table tr.hidden").each(function(i){
- if(i >= 50){
- return false;
- }
- $(this).removeClass("hidden");
- });
- if($("#supersearchPage #list>.tslist.hidden").length == 0){
- SuperSearch.noMoreData();
- return;
- }
- me.resetload();
- SuperSearch.reqParam["pageNum"]++;//翻页请求
- },
- initDropload: function(hasNextPage,pgNum){
- $("#supersearchPage .tabs-box").addClass("hidden")
- $("#supersearchPage #selLable").removeClass("hidden");
- $("#supersearchPage #selLable").show();
- $(".loading_").show();
- $("#wrapper").css('opacity', '0')
- $("#supersearchPage #working").removeClass("hidden");
- if(SuperSearch.limitFlag){
- if($("#supersearchPage #list>.tslist.hidden").length > 0){
- hasNextPage = true;
- }else{
- hasNextPage = false;
- }
- }
- SuperSearch.reqParam["pageNum"] = parseInt(pgNum);
- // 安卓获取高度异常临时处理方式
- setTimeout(function () {
- var isMaxHeight = $(".app-layout-content-b").height() - $(".selected-export-box").height()
- var defaultHeight = nowClientHeight - $(".app-layout-header").height()- $(".selected-export-box").height()
- if (isMaxHeight < defaultHeight) {
- isMaxHeight = defaultHeight
- }
- $("#supersearchPage .app-layout-content-b #wrapper").css({height: isMaxHeight - 44, 'overflow-y': 'auto'})
- $(".loading_").hide();
- $("#supersearchPage #working").addClass("hidden");
- $("#wrapper").css('opacity', 'unset')
- SuperSearch.dropload = $('#supersearchPage #wrapper').dropload({
- scrollArea: $("#supersearchPage .app-layout-content-b #wrapper"),
- loadDownFn: function(me){
- if(SuperSearch.dropload == null){
- SuperSearch.dropload = me;
- }
- if(!hasNextPage){
- SuperSearch.noMoreData();
- return;
- }
- // 免费用户搜索结果查看大于11页时弹窗提示
- // if (!vMainSearchComponent.checkNowPower() && SuperSearch.reqParam["pageNum"] > 10) {
- // vMainSearchComponent.showBuyTip('招标搜索结果', '免费用户最多可查看500条招标搜素结果,可前往购买超级订阅解锁查看更多信息')
- // SuperSearch.noMoreData();
- // return;
- // }
- if(SuperSearch.limitFlag){
- setTimeout(function(){
- SuperSearch.limitPaging(me);
- },500);
- return
- }
- //$(".loading_").show();
- if(SuperSearch.secondFlag=="T"&&SuperSearch.reqParam["pageNum"]==2){
- var html = SuperSearch.getHtml(SuperSearch.secondList,SuperSearch.reqParam["pageNum"]);
- // 每次数据插入,必须重置
- SuperSearch.appendListHtml(html);
- SuperSearch.noMoreData();
- return;
- }
- $.ajax({
- type: 'post',
- url: '/swordfish/searchlist/paging',
- data: SuperSearch.reqParam,
- dataType: 'json',
- success: function(data){
- if (vSwitch === 'f') {
- userReadnum += data.list.length
- if (userReadnum >= 500) {
- // 展示提示窗
- $('#UserTips').show()
- } else {
- $('#UserTips').hide()
- }
- }
- //没有数据
- if(data["list"] == null || data["list"].length == 0){
- SuperSearch.noMoreData();
- $(".loading_").hide();
- return;
- }
- var html = SuperSearch.getHtml(data["list"],SuperSearch.reqParam["pageNum"]);
- // 每次数据插入,必须重置
- SuperSearch.appendListHtml(html);
- //没有下一页了||跟pc端保持一致 最多显示500条
- if(!data.hasNextPage||SuperSearch.reqParam["pageNum"]==10){
- SuperSearch.noMoreData();
- return;
- }
- me.resetload();
- SuperSearch.reqParam["pageNum"]++;//翻页请求
- },
- error: function(xhr, type){
- SuperSearch.noMoreData();
- }
- });
- }
- });
- //判断是否是table (2.7.5table只显示20条数据)
- if(!sessionStorage.superSearch_showType){
- SuperSearch.isTable($(".select-show-type-group").hasClass('is-table'));
- }
- if(!hasNextPage){
- SuperSearch.noMoreData();
- return;
- }
- if ($(".dropload-refresh").length) {
- //SuperSearch.dropload.opts.loadDownFn(SuperSearch.dropload)
- }
- }, 50)
- },
- clearSessionStorage: function(){
- if(!sessionStorage){
- return;
- }
- // @data 2021/6/28 S-新版搜索缓存
- if (vMainSearchComponent && typeof temporaryStorageForPage === 'function') {
- temporaryStorageForPage(vMainSearchComponent, 'superSearch_newQueryParams', 'recover')
- }
- // @data 2021/6/28 E-新版搜索缓存
- sessionStorage.removeItem("superSearch_filterWin");
- sessionStorage.removeItem("superSearch_filterBuy");
- sessionStorage.removeItem("superSearch_noMoreCache");
- sessionStorage.removeItem("superSearch_listContent");
- sessionStorage.removeItem("superSearch_tableContent");
- sessionStorage.removeItem("superSearch_subtype");
- sessionStorage.removeItem("superSearch_scope");
- sessionStorage.removeItem("superSearch_buyerclass");
- sessionStorage.removeItem("superSearch_winner");
- sessionStorage.removeItem("superSearch_publishtime");
- sessionStorage.removeItem("superSearch_pageNum");
- sessionStorage.removeItem("superSearch_xScroll");
- sessionStorage.removeItem("superSearch_yScroll");
- sessionStorage.removeItem("superSearch_industry");
- sessionStorage.removeItem("searchpageName");
- sessionStorage.removeItem("superSearch_dyDiv");
- sessionStorage.removeItem("superSearch_advertIsClose");
- sessionStorage.removeItem("superSearch_shaxuan");
- sessionStorage.removeItem("superSearch_shaxuanFlag");
- sessionStorage.removeItem("superSearch_searchType");
- sessionStorage.removeItem("superSearch_showType");
- sessionStorage.removeItem("superSearch_interceptWord");
- sessionStorage.removeItem("superSearch_hasNoData_tiptext");
- sessionStorage.removeItem("superSearch_allSearchModel_isshow");
- sessionStorage.removeItem("superSearch_limitFlag");
- sessionStorage.removeItem("superSearch_maxprice");
- sessionStorage.removeItem("superSearch_minprice");
- sessionStorage.removeItem("superSearch_showNull");
- sessionStorage.removeItem("superSearch_currentkws");//当前搜索关键词
- },
- //js 方法
- resetSx: function(){ //清除筛选
- $("#supersearchPage .dialog-content.contentthree ul li:eq(0) button").trigger("tap");//清除行业
- $("#supersearchPage .money-dialog ul li:eq(0) .btn").trigger("tap");//清除金额
- $("#supersearchPage .jypt-dialog .jypt-pt .btn:eq(0)").trigger("tap");//清除时间
- $("#supersearchPage .jydq-dialog .btn:eq(0)").trigger("tap"); //清除地区
- $("#supersearchPage .jytype-dialog .btn:eq(0)").trigger("tap"); //清除类别
- // 清除中标企业
- $("#supersearchPage #select-win-list").html('')
- $("#supersearchPage #search-win-list").html('')
- $("#supersearchPage #search-win-input").val('')
- //console.log('没有筛选tab 01')
- $("#supersearchPage div[data-open='industry']").trigger('click')
- //console.log('清空 01', sessionStorage.superSearch_shaxuan)
- // 隐藏企业搜索
- if (vEntSearchComponent) {
- vEntSearchComponent.toggleEntShow(false)
- }
- if (vMainSearchComponent) {
- vMainSearchComponent.toggleEntShow(false)
- }
- SuperSearch.filterWin = {}
- SuperSearch.filterBuy = {}
- $('#supersearchPage .list').find('.industry_item').removeClass('active');
- $('#supersearchPage .update_tips').hide();
- $("#supersearchPage .industry_item.whole:not(.active)").trigger("click")
- },
- canSearch: function(){ //判断是否显示搜索按钮
- var len=$.trim($("#supersearchPage input[name=super_searchinput]").val()).length;
- if(len>0){
- $("#supersearchPage .clearInpt").removeClass("hidden");
- $("#supersearchPage .query").removeClass("hidden");
- $("#supersearchPage .jydqsure").addClass("on");
- }else{
- $("#supersearchPage .clearInpt").addClass("hidden");
- $("#supersearchPage .query").addClass("hidden");
- $("#supersearchPage .jydqsure").removeClass("on");
- }
- },
- beforeSubmit: function(){ //提交前,更新筛选内容至提交对象
- SuperSearch.s_words=$.trim($("#supersearchPage [name='super_searchinput']").val());
- SuperSearch.s_words=SuperSearch.s_words.replace(/\s+/g," ");
- if(SuperSearch.s_words == ""){
- return false;
- }
- SuperSearch.reqParam.searchvalue=SuperSearch.s_words;
- //信息范围
- var scope = [];
- $("#supersearchPage .contentone .btn.active").each(function(){
- var thisText = $(this).text();
- if(thisText == "全国"){
- scope.push("");
- return false;
- }else{
- scope.push(thisText);
- }
- });
- // SuperSearch.reqParam.scope=scope.join(",");
- //行业类型
- var industrySelect="";
- if($("#supersearchPage .contentthree .active").hasClass("btn")){
- if($("#supersearchPage .contentthree .active").text()=="全部"){
- industrySelect="";
- }else{
- industrySelect= $("#supersearchPage .contentthree .active").attr("data-value");
- }
- }else{
- $("#supersearchPage .contentthree .active").parent("li").find(".btn").each(function(){
- industrySelect+= $(this).attr("data-value")+",";
- });
- industrySelect=industrySelect.substring(0,industrySelect.length-1);
- }
- // SuperSearch.reqParam.industry=industrySelect;
- //信息类型
- var selectToptypes = "";
- $("#supersearchPage .contenttwo #dqbtn.active").each(function(){
- var thisText = $(this).attr("data-value");
- if(selectToptypes != ""){
- selectToptypes += ",";
- }
- selectToptypes += thisText;
- });
- var selectSubTypes = "";
- $("#supersearchPage .contenttwo .btn.active").each(function(){
- if($(this).parent().index() == 0){
- return true;
- }
- var thisText = $(this).text();
- if(selectSubTypes != ""){
- selectSubTypes += ",";
- }
- selectSubTypes += thisText;
- });
- // SuperSearch.reqParam.subtype=selectSubTypes;
- //金额
- var moneyRange=$("#supersearchPage .money-dialog .active").attr("data-value");
- // if(moneyRange!="all"){
- // //moneyRange=$("#supersearchPage .money-dialog .money-inp .minMrice").val()+"-"+$("#supersearchPage .money-dialog .money-inp .maxMrice").val()
- // SuperSearch.reqParam.minprice=$("#supersearchPage .money-dialog .money-inp .minMrice").val();
- // SuperSearch.reqParam.maxprice=$("#supersearchPage .money-dialog .money-inp .maxMrice").val()
- // }else{
- // SuperSearch.reqParam.minprice="";
- // SuperSearch.reqParam.maxprice="";
- // }
- //SuperSearch.reqParam.money=moneyRange;
- //日期
- // SuperSearch.reqParam.publishtime=SuperSearch.setPublishtime();
- //全文or标题
- // if($(".newdialog .tab-box .sub-search-title").find("li.active").attr('dataVal')=="searchtitle"){
- // SuperSearch.reqParam.selectType="title";
- // }else{
- // SuperSearch.reqParam.selectType="all";
- // }
- //采购单位行业
- var buyerclasstypes = "";
- $("#supersearchPage .choose_industry .industry_item.active").each(function(){
- if($(this).parent().index() == 0){
- return true;
- }
- var thisText = $(this).text();
- if(buyerclasstypes != ""){
- buyerclasstypes += ",";
- }
- buyerclasstypes += thisText;
- });
- // SuperSearch.reqParam.buyerclass=buyerclasstypes;
- //中标企业
- var winnertypes = "";
- $("#supersearchPage #select-win-list .select").each(function(){
- var thisText = $(this).text();
- if(winnertypes != ""){
- winnertypes += ",";
- }
- winnertypes += thisText;
- });
- SuperSearch.reqParam.winner=winnertypes;
- return true;
- },
- //行为采集 type=1 搜索、type=2 显示列表次数统计
- behaviorCollect: function (type) {
- if (s_openid && SuperSearch.reqParam.searchvalue) {
- var model = "lab_search";
- var s_url = "/jylab/mainSearch/";
- var s_model = "搜索";
- var s_industry = "";//行业-单选
- var s_key = "";//关键词
- var i_amount = 0;//中标金额 1-含 0-不含
- var i_area = 0;//地区
- var i_industry = 0;//行业
- var i_infotable = 0;//显示列表
- var i_infotype = 0;//信息类型
- var i_time = 0;//发布时间
- if(type==1){
- $("#supersearchPage .contentthree .btn.active").each(function(){
- var thisText = $(this).text();
- if(thisText != "全部"){
- if($(this).attr("data-value")){
- s_industry = $(this).attr("data-value").split("_")[0];
- }else{
- s_industry = thisText;
- }
- }
- });
- s_key = SuperSearch.reqParam.searchvalue;
- if(SuperSearch.reqParam.minprice || SuperSearch.reqParam.maxprice){
- i_amount = 1;
- }
- if(SuperSearch.reqParam.scope!=[]){
- i_area = 1;
- }
- if(s_industry){
- i_industry = 1;
- }
- if(SuperSearch.reqParam.subtype){
- i_infotype = 1;
- }
- if(SuperSearch.reqParam.publishtime){
- i_time = 1;
- }
- }else{
- i_infotable = 1;
- }
- var content = '{"encode":"' + encode + '","model":"' + model + '","s_url":"' + s_url + '","s_model":"' + s_model + '","s_openid":"' + s_openid + '","s_industry":"' + s_industry + '","s_key":"'+s_key+'","i_amount":'+i_amount+',"i_area":'+i_area+',"i_industry":'+i_industry+',"i_infotable":'+i_infotable+',"i_infotype":'+i_infotype+',"i_time":'+i_time+'}';
- $.post('/accesslog/byajax',{json:content},function(r){});
- }
- },
- show: function() { //筛选页面和内容展示替换显示
- if (SuperSearch.showNull) {
- $("#supersearchPage #wrapper").addClass("hidden");
- $("#supersearchPage .nullcontent").removeClass("hidden");
- } else {
- //判断显示信息方式 列表or表格 查询后都显示列表
- $("#supersearchPage #wrapper").removeClass("hidden");
- SuperSearch.showType();
- }
- },
- formSubmit: function (nw){ //提交表单,获取数据
- $(".loading_").show();
- if(!SuperSearch.beforeSubmit()){
- $(".loading_").hide();
- return;
- }
- $("#supersearchPage .app-layout-content-b #wrapper").css({height: nowClientHeight, 'overflow-y': 'auto'})
- // 切换显示
- $("#supersearchPage .tabs-box").addClass("hidden")
- $("#supersearchPage #clickFilter").text('搜索')
- // 隐藏table 查看更多
- $("#wrapper .shade_table").css("display","none");
- $("#supersearchPage #working").removeClass("hidden");
- $("#supersearchPage #intercept").addClass("hidden");
- $("#supersearchPage #table").addClass("hidden");
- $("#supersearchPage #list").addClass("hidden");
- // if(SuperSearch.showNull){
- // SuperSearch.showToOrder(false);
- // }
- $("#supersearchPage .nullcontent").addClass("hidden");
- $("#supersearchPage .selLable").removeClass("hidden");
- $("#supersearchPage #super_search").addClass("hidden");
- $("#supersearchPage #wrapper .dropload-down").remove();
- SuperSearch.behaviorCollect(1);
- $("#supersearchPage input[name=super_searchinput]").blur();
- $("#supersearchPage .clearInpt").addClass("hidden");
- $("#supersearchPage .query").addClass("hidden");
- var filter_winner = []
- var filter_buyerclass = []
- $("#select-win-list li.select").each(function(){
- filter_winner.push($(this).text())
- })
- var buttons = $('.select-area-box .list button.active:not(.whole)');
- buttons.each(function () {
- filter_buyerclass.push($(this).text())
- })
- SuperSearch.reqParam.pageNum=1;
- SuperSearch.reqParam.winner = filter_winner.join(',')
- // SuperSearch.reqParam.buyerclass = filter_buyerclass.join(',')
- SuperSearch.noMoreCache = false;
- SuperSearch.requesting = true;
- if(nw=="N"){
- // SuperSearch.reqParam.selectType ="title";
- $(".newdialog .sub-search-title").find("li").removeClass("active");
- $(".selected-export .options .search-title").find("em").text("标题搜索");
- $(".newdialog .sub-search-title").find("li[dataval='searchtitle']").addClass("active");
- $(".newdialog .sub-show-list").find("li").removeClass("active");
- $(".selected-export .show-list").find("em").text("列表显示");
- $(".newdialog .sub-show-list").find("li[dataval='showlist']").addClass("active");
- }
- var IframeOnClick = {
- resolution: 200,
- iframes: [],
- interval: null,
- Iframe: function() {
- this.element = arguments[0];
- this.cb = arguments[1];
- this.hasTracked = false;
- },
- track: function(element, cb) {
- this.iframes.push(new this.Iframe(element, cb));
- var _this = this;
- this.interval = setInterval(function() { _this.checkClick(); }, this.resolution);
- },
- checkClick: function() {
- if (document.activeElement) {
- var activeElement = document.activeElement;
- for (var i in this.iframes) {
- if (activeElement === this.iframes[i].element) { // user is in this Iframe
- if (this.iframes[i].hasTracked == false) {
- this.iframes[i].cb.apply(window, []);
- this.iframes[i].hasTracked = true;
- $.ajax({
- type: 'POST',
- url: '/publicapply/adLeague/click',
- data: {
- client: 'WX',
- id: 'ad5',
- position: '搜索列表页'
- },
- success: function(res) {
- console.log(res)
- }
- })
- }
- } else {
- this.iframes[i].hasTracked = false;
- }
- }
- }
- }
- };
- $.ajax({
- type: "post",
- url: "/swordfish/searchlist/paging",
- data: SuperSearch.reqParam,
- dataType: "json",
- success: function(data){
- if (vSwitch === 'f') {
- userReadnum += data.list.length
- if (userReadnum >= 500) {
- // 展示提示窗
- $('#UserTips').show()
- } else {
- $('#UserTips').hide()
- }
- }
- SuperSearch.secondList=data.secondList;
- SuperSearch.secondFlag=data.secondFlag;
- SuperSearch.secondKWS=data.secondKWS;
- $("#supersearchPage #working").addClass("hidden");
- SuperSearch.appendInterceptWord(data.interceptWord);
- if(data.keyWord!=""){
- SuperSearch.s_words = data.keyWord;
- }
- $("#supersearchPage input[name=super_searchinput]").val(SuperSearch.s_words);
- SuperSearch.requesting = false;
- //历史记录和我的订阅
- if(data.isLogin){
- if(localStorage && data["history"] != null && typeof(data["history"]) != "undefined"){
- localStorage.superSearch_history = data["history"].join(",");
- }
- SuperSearch.htmlTipMsg(data["history"]);
- }else{
- //搜索历史记录保存到本地
- if(localStorage){
- var l_history = localStorage.superSearch_history;
- var l_historys = [];
- if(typeof(l_history) != "undefined"){
- l_historys = l_history.split(",");
- //去重
- for(var i=0;i<l_historys.length;i++){
- if(l_historys[i] == $.trim(SuperSearch.s_words)){
- l_historys.splice(i,1);
- break;
- }
- }
- }
- l_historys.push(SuperSearch.s_words);
- if(l_historys.length > 5){
- l_historys.shift();
- }
- localStorage.superSearch_history = l_historys.join(",");
- SuperSearch.htmlTipMsg(l_historys,null);
- }
- }
- //查询后显示 展示方式
- $("#supersearchPage .selLable").removeClass("hidden");
- //铺查询信息
- $("#supersearchPage #wrapper .dropload-down").remove();
- if(data["list"] == null || data["list"].length == 0){
- $("#supersearchPage #hasNoData_tiptext>font").hide();
- if(data.status==-1){
- $("#supersearchPage #hasNoData_tiptext>font:eq(1)").show();
- }else if (data.status==-2){
- $("#supersearchPage #hasNoData_tiptext>font:eq(2)").show();
- }else{
- showSearchTipForTimeRange()
- }
- if($(".newdialog .tab-box .sub-search-title").find("li.active").attr('dataVal')=="searchtitle"){
- $("#supersearchPage #allSearchModel").show();
- }else{
- $("#supersearchPage #allSearchModel").hide();
- }
- $("#supersearchPage #list").text("");
- SuperSearch.hasNoData();
- SuperSearch.show();
- $(window).scrollTop(0);
- if (SuperSearch.reqParam.pageNum == '1') {
- $("#supersearchPage .app-layout-content-b #wrapper").scrollTop(0)
- }
- $(".loading_").hide();
- return
- }else{
- SuperSearch.showNull = false;
- SuperSearch.hasData();
- SuperSearch.limitFlag = data["limitFlag"]
- SuperSearch.replayListHtml(SuperSearch.getHtml(data["list"],1));
- SuperSearch.show();
- if (SuperSearch.reqParam.pageNum == '1') {
- $("#supersearchPage .app-layout-content-b #wrapper").scrollTop(0)
- }
- $(window).scrollTop(0);
- SuperSearch.initDropload(data.hasNextPage,2);
- }
- console.log(sessionStorage.getItem('powerStatus'), '1')
- var powerStatus = sessionStorage.getItem('powerStatus')
- if(powerStatus) {
- powerStatus = JSON.parse(powerStatus)
- if(!powerStatus.entniche && !powerStatus.member && powerStatus.vip <= 0) {
- (window.slotbydup = window.slotbydup || []).push({
- id: "u6603898",
- container: "_07p1kp030cz7",
- async: true
- });
- (window.slotbydup = window.slotbydup || []).push({
- id: "u6603898",
- container: "_fdvjfgztbn",
- async: true
- });
- setTimeout(() => {
- var frames = document.getElementById("iframeu6603898_0");
- console.log(frames, 'frames')
- IframeOnClick.track(frames, function() {
- jQuery(document).click();
- });
- },1000)
- $.ajax({
- type: 'POST',
- url: '/publicapply/adLeague/exposure',
- data: {
- client: 'WX',
- id: 'ad5',
- position: '搜索列表页'
- },
- success: function(res) {
- console.log(res)
- }
- })
- }
- }
- },
- error: function(xhr,type){
- $("#supersearchPage #wrapper .dropload-down").remove();
- SuperSearch.requesting = false;
- }
- });
- },
- getHtml: function (list,pageNum){//生成list表单 或 table表单
- // 获取收藏状态
- SuperSearch.checkStartKeepStatus(list.map(function(v) {
- return v._id
- }))
- var html ={};
- var ListHtml='';
- var TableHtml='';
- for(var i=0;i<list.length;i++){
- if(pageNum == 1 && i == 9) {
- // 百青藤广告插入
- ListHtml += '<div class="_07p1kp030cz7">'+'</div>'
- }
- if(pageNum == 1 && i == 24) {
- // 百青藤广告插入
- ListHtml += '<div class="_fdvjfgztbn">'+'</div>'
- }
- if(pageNum==1&&i==4&&!SuperSearch.advertIsClose){
- ListHtml+='<div class="adv-wxsearch-center" id="E1"></div>'
- }
- var index = (pageNum-1)*pageSize+i+1;
- var thisStyle = " style='padding-left: 15px;'";
- if(index >= 10 && index < 100){
- thisStyle = " style='padding-left: 26px;'";
- }else if(index >= 100 && index < 1000){
- thisStyle = " style='padding-left: 35px;'";
- }else if(index >= 1000){
- thisStyle = " style='padding-left: 45px;'";
- }
- var href = list[i].href;
- if(!href || href.indexOf("java") > -1){
- href = "";
- }
- var title = list[i].title;
- //项目名称
- var projectname=list[i].projectname==null?list[i].title:list[i].projectname;
- //关键词高亮
- var detail = "";
- var highlight = list[i].highlight;
- if(highlight){
- var details = highlight.detail;
- if(details && details.length > 0){
- detail = details[0];
- if(detail.length>100){
- detail = detail.substring(0,100)//.replace(/[^\{\u4e00-\u9fa5]{1,90}{[^\}\u4e00-\u9fa5]+?}/g,"");
- if (detail.indexOf("}")!=-1){
- detail = detail.substring(detail.indexOf("}")+1)
- }
- }
- }
- }
- if(SuperSearch.s_words != ""){
- if(SuperSearch.s_words.indexOf("+")>0){
- SuperSearch.s_words=SuperSearch.s_words.replace(/\+/g," ")
- }
- var wordsArray = SuperSearch.s_words.split(" ");
- if(SuperSearch.secondFlag=="T"&&SuperSearch.secondKWS!=""){
- wordsArray=wordsArray.concat(SuperSearch.secondKWS.split("+"))
- }
- title = keyWordHighlight(title,wordsArray,'<font class="keyword">$1</font>');
- projectname = keyWordHighlight(projectname,wordsArray,'<font class="keyword">$1</font>');
- if(detail != ""){
- try{
- $("#supersearchPage #tempDiv").html(detail);
- detail = $("#supersearchPage #tempDiv").text().replace(/[^\{\u4e00-\u9fa5]{1,90}{[^\}\u4e00-\u9fa5]+?}/g,"").replace(/</g,"<").replace(/>/g,">");
- }catch(e){
- detail = detail.replace(/[^\{\u4e00-\u9fa5]{1,90}{[^\}\u4e00-\u9fa5]+?}/g,"").replace(/</g,"<").replace(/>/g,">");
- }
- detail = keyWordHighlight(detail,wordsArray,'<font class="keyword">$1</font>');
- }
- }
- if(detail != ""){
- // detail = "<div class='detail'"+thisStyle+">"+detail+"...</div>";
- detail = "<div class='detail'>"+detail+"...</div>";
- }
- //
- var area = list[i].area;
- if(!area){
- area = "";
- }else{
- area = $.trim(area);
- area = area=="A"?"全国":area;
- }
- if(area != ""){
- area = '<span class="location">'+area+'</span>';
- }
- //行业
- var industry=list[i].industry;
- var buyerclass = list[i].buyerclass;
- if(!industry){
- industry="";
- }else{
- industry=$.trim(industry);
- }
- if (SuperSearch.isVip || jyUserPower.vip > 0 || jyUserPower.member || jyUserPower.entniche) {
- if (industry!=""){
- industry ='<span class="industry" style="display:none;">'+industry+'</span>'
- }
- if (buyerclass && buyerclass!="") {
- industry += '<span class="buyerclass">' + buyerclass + '</span>'
- }
- } else {
- if (industry!=""){
- industry ='<span class="industry">'+industry+'</span>'
- }
- }
- //时间
- var tdf = list[i].publishtime;
- var fullTime="";
- if(tdf){
- tdf = utils.dateFromNow(tdf * 1000)
- if(tdf != null){
- tdf='<span><i class="jyapp-icon jyapp-icon-bofangjilu" style="color:#7a7a7a;margin-right:2px;"></i>'+tdf+'</span>'
- }
- }else{
- tdf = '';
- }
- var datatype = "";
- if(list[i].subtype){
- datatype='<span class="type">'+list[i].subtype+'</span>'
- }else if(list[i].toptype){
- datatype='<span class="type">'+list[i].toptype+'</span>'
- }else if(list[i].type){
- if(list[i].type == "tender"){
- datatype='<span class="type">招标</span>'
- }else if(list[i].type == "bid"){
- datatype='<span class="type">中标</span>'
- }
- }
- //招标单位
- var buyer=list[i].buyer==null?"":list[i].buyer;
- //预算
- var budget=list[i].budget==null?"":((list[i].budget)/10000+"").substring(0,5);
- //开标时间
- var bidopentime=""
- var optim=list[i].bidopentime;
- if(optim){
- var openTime=new Date(Number(optim+"000"));
- bidopentime=openTime.getFullYear()+"-"+((openTime.getMonth()+1)>=10?(openTime.getMonth()+1):"0"+(openTime.getMonth()+1))+"-"
- +((openTime.getDate())>=10?(openTime.getDate()):"0"+(openTime.getDate()))+"<br>"+(openTime.getHours()>=10?openTime.getHours():"0"+openTime.getHours())+":"
- +(openTime.getMinutes()>=10?openTime.getMinutes():"0"+openTime.getMinutes());
- }
- //中标单位
- var winner=list[i].winner==null?"":list[i].winner;
- //中标金额
- var bidamount="";
- if(typeof(list[i].bidamount) != "undefined" && list[i].bidamount != null && list[i].bidamount != ""){
- bidamount = parseInt(list[i].bidamount)/10000;
- if(bidamount.toString().length>6){
- if(bidamount.toString().indexOf(".")==5){
- bidamount=bidamount.toString().substr(0,7);
- }else{
- bidamount=bidamount.toString().substr(0,6);
- }
- }
- }
- // 金额标签
- var moneyTag = '';
- if(typeof(list[i].budget) != "undefined" && list[i].budget != null && list[i].budget != ""){
- moneyTag = '<span class="bidamount">'+MoneyUnit.test(list[i].budget)+'</span>';
- }
- if(typeof(list[i].bidamount) != "undefined" && list[i].bidamount != null && list[i].bidamount != ""){
- moneyTag = '<span class="bidamount">'+MoneyUnit.test(list[i].bidamount)+'</span>';
- }
- if(i==3&&pageNum==1){
- ListHtml += '<div class="tslist" data-cl-event="c_wx_supsearch_linkclick" style="border-bottom-width:0px;">'
- }else{
- ListHtml += '<div class="tslist" data-cl-event="c_wx_supsearch_linkclick">'
- }
- ListHtml += '<div class="resnumb">'
- +'<div class="one">'
- +'<span class="xh">'+index+'.</span>'
- +'</div>'
- + '<div class="two-group">'
- +'<div class="two bt-parent"'+thisStyle+'>'
- +'<a class="bt" sid="'+list[i]._id+'" s="'+href+'" href="javascript:void(0);">'+title+'</a>'
- +'</div>'
- + '<div class="flow-start-box"><i class="icon-flow-start"></i></div>'
- +'</div>'
- +'</div>'
- +'<div style="clear:both;"></div>'
- +'<div class="restime time-diff">'
- +area+industry+datatype+moneyTag+tdf
- +'</div>'
- +'<div style="clear:both;"></div>'
- +detail
- +'</div>';
- if(i>=20||pageNum!=1){
- continue
- }
- var getDefaultLine = function (key) {
- if (key || key.length) {
- return key
- } else {
- return '<span class="one-line">-</span>'
- }
- }
- //拟建项目
- if(SuperSearch.subtype_proposed==SuperSearch.reqParam.subtype){
- var projectinfo = list[i].projectinfo;
- //if(projectinfo){
- var approvecode = "";
- if(projectinfo&&projectinfo.approvecode){
- approvecode = projectinfo.approvecode;
- }
- var approvecontent = "";
- if(projectinfo&&projectinfo.approvecontent){
- approvecontent = projectinfo.approvecontent;
- }
- var approvestatus = "";
- if(projectinfo&&projectinfo.approvestatus){
- approvestatus = projectinfo.approvestatus;
- }
- var approvetime = "";
- var diff = "";
- if(projectinfo&&projectinfo.approvetime){
- approvetime = projectinfo.approvetime.replace(/-/g,"/");
- diff = utils.dateFromNow(approvetime);
- }
- var industry = "";
- if(projectinfo&&projectinfo.industry){
- industry = projectinfo.industry;
- }
- TableHtml +='<tr s="'+href+'" sid="'+list[i]._id+'" i="'+industry+'">'+
- '<td><div>'+index+'</div></td>'+
- '<td><div style="width: 100px;text-align: center;">'+getDefaultLine(approvecode)+'</div></td>'+
- '<td><div style="width: 207px;text-align: left;">'+getDefaultLine(projectname)+'</div></td>'+
- '<td><div style="width: 200px;text-align: left;">'+getDefaultLine(approvecontent)+'</div></td>'+
- '<td><div style="width: 75px;text-align: left;">'+getDefaultLine(approvestatus)+'</div></td>'+
- '<td><div style="width: 75px;text-align: center;">'+getDefaultLine(approvetime)+'</div></td>'+
- '<td><div style="width: 75px;text-align: center;">'+getDefaultLine(diff)+'</div></td>'+
- '</tr>';
- //}
- }else{
- TableHtml +='<tr s="'+href+'" sid="'+list[i]._id+'" i="'+(list[i].industry?list[i].industry:"")+'">'+
- '<td><div>'+index+'</div></td>'+
- '<td><div>'+getDefaultLine(projectname)+'</div></td>'+
- '<td><div>'+getDefaultLine(datatype==""?"":datatype+"公告")+'</div></td>'+
- '<td><div>'+getDefaultLine(budget)+'</div></td>'+
- '<td><div>'+getDefaultLine(buyer)+'</div></td>'+
- '<td><div>'+getDefaultLine(bidopentime)+'</div></td>'+
- '<td><div>'+getDefaultLine(winner)+'</div></td>'+
- '<td><div>'+getDefaultLine(bidamount)+'</div></td>'+
- '<td><div>'+getDefaultLine(fullTime)+'</div></td>'+
- '</tr>';
- }
- }
- if(pageNum==1&&list.length<5&&!SuperSearch.advertIsClose){
- ListHtml+='<div onclick="adv_statistics(this)" class="adv-wxsearch-center" adv_name="微信搜索列表页-中部" id="E1">E1</div>'
- }
- html["ListHtml"]=ListHtml;
- html["TableHtml"]=TableHtml;
- return html;
- },
- hasNoData: function(){ //搜索信息为空
- SuperSearch.showNull = true;
- $("#supersearchPage .nullcontent").removeClass("hidden");
- $("#supersearchPage #wrapper").addClass("hidden");
- },
- hasData: function(){ //搜索信息不为空
- $("#supersearchPage .nullcontent").addClass("hidden");
- $("#supersearchPage #wrapper").removeClass("hidden");
- if(SuperSearch.dyDiv){
- SuperSearch.showToOrder(false)
- }else{
- SuperSearch.showToOrder(true);
- }
- },
- changeKeepStatus (id, type) {
- var aDom = $("p[sid='"+id+"'], a[sid='"+id+"']")
- if (aDom.length) {
- aDom.each(function () {
- var gDom = $(this).parents('.two-group').find('.flow-start-box')
- if (type) {
- gDom.addClass('fill')
- } else {
- gDom.removeClass('fill')
- }
- })
- }
- },
- checkStartKeepStatus: function (list) {
- $.ajax({
- url: '/publicapply/bidcoll/isColl',
- type: 'POST',
- data: {
- bids: list.join(',')
- }
- }).done(function (r) {
- if (r && r.error_msg == '' && r.data) {
- //console.log('start', r.data)
- r.data.forEach(function(v) {
- SuperSearch.changeKeepStatus(v, true)
- })
- }
- })
- },
- checkIsStartFn: function (event, attrData) {
- var isStart = $(event.target).hasClass('.flow-start-box') || $(event.target).parents('.flow-start-box').length
- //console.log(isStart, 'isStart')
- if (isStart) {
- event.preventDefault();
- event.stopPropagation();
- //console.log('收藏')
- var isStartStatus = $(event.target).hasClass('.flow-start-box.fill') || $(event.target).parents('.flow-start-box.fill').length
- if (vKeepComponent) {
- vKeepComponent.changeBid(attrData.sid, !isStartStatus)
- }
- return false
- }
- return true
- },
- appendListHtml: function (html){ //下拉时展示信息
- // 插入数据到页面,放到最后面
- var ListHtmlObj = $(html.ListHtml);
- ListHtmlObj.on("tap", function(event){
- var h = $(this).find("a.bt").attr("s");
- var sid = $(this).find("a.bt").attr("sid");
- var industry = $(this).find(".industry").text();
- if (SuperSearch.checkIsStartFn(event, { sid: sid })) {
- SuperSearch.myredirect(h,sid,industry);
- }
- });
- $('#supersearchPage #list').append(ListHtmlObj);
- $(".loading_").hide();
- // var TableHtmlobj=$(html.TableHtml);
- // TableHtmlobj.on("tap",function(event){
- // var h = $(this).attr("s");
- // var sid = $(this).attr("sid");
- // var industry = $(this).attr("i");
- // SuperSearch.myredirect(h,sid,industry);
- // });
- // $("#supersearchPage #table .content").append(TableHtmlobj);
- },
- replayListHtml: function(html){ //搜索时替换信息
- // 替换
- var ListHtmlObj = $(html.ListHtml);
- var TableHtmlobj=$(html.TableHtml);
- var showCount = 0;
- ListHtmlObj.each(function(i){
- if(this.id == "E1"){
- if(SuperSearch.advert == null){
- SuperSearch.advert = $("#advertscript").html();
- $("#advertscript").remove();
- }
- //$(this).html(SuperSearch.advert);
- if(SuperSearch.advert!=""){
- $(this).html(SuperSearch.advert);
- }else{
- $(this).hide();
- }
- }
- if(SuperSearch.limitFlag&&$(this).hasClass("tslist")){
- if(showCount >= 50){
- $(this).addClass("hidden");
- }else{
- showCount++;
- }
- }
- });
- showCount = 0;
- TableHtmlobj.each(function(i){
- if(SuperSearch.limitFlag){
- if(showCount >= 50){
- $(this).addClass("hidden");
- }else{
- showCount++;
- }
- }
- });
- ListHtmlObj.on("tap", function(event){
- var h = $(this).find("a.bt").attr("s");
- var sid = $(this).find("a.bt").attr("sid");
- var industry = $(this).find(".industry").text();
- if (SuperSearch.checkIsStartFn(event, { sid: sid })) {
- SuperSearch.myredirect(h,sid,industry);
- }
- });
- $('#supersearchPage #list').html(ListHtmlObj);
- TableHtmlobj.on("tap",function(event){
- var h = $(this).attr("s");
- var sid = $(this).attr("sid");
- var industry = $(this).attr("i");
- SuperSearch.myredirect(h,sid,industry);
- });
- if(SuperSearch.subtype_proposed==SuperSearch.reqParam.subtype){
- $("#supersearchPage #table .content").html("<tr><td><div>序号</div></td><td><div style='width: 100px;'>项目代码</div></td><td><div style='width: 207px;'>项目名称</div></td><td><div style='width: 200px;'>审批事项</div></td><td><div style='width: 75px;'>审批结果</div></td><td><div style='width: 75px;'>审批时间</div></td><td><div style='width: 75px;'>发布时间</div></td></tr>");
- }else{
- $("#supersearchPage #table .content").html("<tr><td><div>序号</div></td><td><div>项目名称</div></td><td><div>公告类型</div></td><td><div>预算(万元)</div></td><td><div>招标单位</div></td><td><div>开标时间</div></td><td><div>中标单位</div></td><td>中标金额<br>(万元)</td><td><div>发布时间</div></td></tr>");
- }
- $("#supersearchPage #table .content").append(TableHtmlobj);
- $(".loading_").hide();
- },
- myredirect_back: function(link, sid, industry) {
- if (typeof $.fn.checkShowPopPage === 'function') {
- $.fn.checkShowPopPage(function (result) {
- if (result.isBindStatus) {
- SuperSearch.myredirect_back(link, sid, industry)
- } else {
- result.showPop()
- }
- })
- }
- },
- myredirect: function (link,sid,industry){ //跳转三级页
- //保存当前页面至sessionStorage
- SuperSearch.setSessionStorage();
- if(sid!=undefined){
- var sds = SuperSearch.s_words;
- if(SuperSearch.secondFlag=="T"&&SuperSearch.secondKWS!=null&&SuperSearch.secondKWS!=""&&SuperSearch.secondKWS!=undefined){
- sds = SuperSearch.secondKWS;
- }
- //跳转
- link = link.replace(/\n/g,"");
- if(link!=""&&!/^http/.test(link)){
- link="http://"+link
- }
- if(sds){
- if(industry!=""){
- window.location.href = "/article/content/"+sid+".html?keywords="+encodeURIComponent(sds)+"&industry="+industry;
- }else{
- window.location.href = "/article/content/"+sid+".html?keywords="+encodeURIComponent(sds);
- }
- }else{
- if(industry!=""){
- window.location.href = "/article/content/"+sid+".html?industry="+industry;
- }else{
- window.location.href = "/article/content/"+sid+".html";
- }
- }
- }
- },
- noMoreData: function(){
- SuperSearch.noMoreCache = true;
- // 锁定
- try {
- SuperSearch.dropload.lock();
- } catch (e) {
- console.warn('获取dropload错误')
- }
- // 无数据
- SuperSearch.dropload.noData();
- SuperSearch.dropload.resetload();
- },
- loadTipMsg: function(){
- //从服务器端取
- var l_superSearch_history = ""
- if(localStorage.superSearch_history==null||localStorage.superSearch_history==undefined){
- $.post("/jylab/mainSearch/getHK?t="+new Date().getTime(),{},function(r){
- if(localStorage && r.history != null && typeof(r.history) != "undefined"){
- localStorage.superSearch_history = r.history.join(",");
- l_superSearch_history = localStorage.superSearch_history || '';
- SuperSearch.htmlTipMsg(l_superSearch_history.split(","),null);
- }
- });
- }
- l_superSearch_history = localStorage.superSearch_history || '';
- SuperSearch.htmlTipMsg(l_superSearch_history.split(","),null);
- },
- htmlTipMsg: function(history,msgset){
- //历史信息
- historyHtml = "";
- if(history != null){
- for(var i=history.length-1;i>=0;i--){
- var hy = $.trim(history[i]).replace(/\s+/," ");
- if(hy == ""){
- continue;
- }
- historyHtml+="<li class='hover-css--slide'>"+hy+"</li>"
- }
- }
- $("#supersearchPage .search-one-box ul.history-list-box").html(historyHtml);
- if(historyHtml == ""){
- $("#supersearchPage .tabs-box .tabs-content-page").eq(0).addClass("hidden");
- }else{
- $("#supersearchPage .tabs-box .tabs-content-page").eq(0).removeClass("hidden");
- }
- // 点击历史记录内容 进行搜索
- $("#supersearchPage .search-one-box .history-list-box").off("click", 'li').on("click", 'li', function () {
- $("#supersearchPage input[name=super_searchinput]").val($(this).text());
- SuperSearch.canSearch();
- SuperSearch.formSubmit("N");
- });
- },
- //全文搜索
- allSearch: function(){
- $(".newdialog .sub-search-title").find("li").removeClass("active");
- $(".selected-export .options .search-title").find("em").text("全文搜索");
- $(".newdialog .sub-search-title").find("li[dataval='searchall']").addClass("active");
- //全文检索 表格展示切换成列表展示
- $(".newdialog .sub-show-list").find("li").removeClass("active");
- $(".selected-export .show-list").find("em").text("列表显示");
- $(".newdialog .sub-show-list").find("li[dataval='showlist']").addClass("active");
- //记录
- if(localStorage){
- localStorage.selectType="all";
- }
- //将所选标签值作为参数传递
- SuperSearch.formSubmit();
- },
- //标题搜索
- titleSearch: function(){
- $(".newdialog .sub-search-title").find("li").removeClass("active");
- $(".selected-export .options .search-title").find("em").text("标题搜索");
- $(".newdialog .sub-search-title").find("li[dataval='searchtitle']").addClass("active");
- //
- $(".newdialog .sub-show-list").find("li").removeClass("active");
- $(".selected-export .show-list").find("em").text("列表显示");
- $(".newdialog .sub-show-list").find("li[dataval='showlist']").addClass("active");
- //记录
- if(localStorage){
- localStorage.selectType="title";
- }
- //将所选标签值作为参数传递
- SuperSearch.formSubmit();
- },
- //展示方式
- //1.列表展示数据
- showlist: function() {
- $("#supersearchPage .showlist").addClass("on").siblings().removeClass("on");
- $("#supersearchPage #wrapper #table").addClass("hidden");
- $("#supersearchPage #wrapper #list").removeClass("hidden");
- if(SuperSearch.dropload != null){
- SuperSearch.dropload.resetload();
- SuperSearch.isTable(false);
- }
- },
- //2.表格展示数据
- showTable: function() {
- if(!onceFlag_tablepro){
- $("#supersearchPage #TableTip").fadeIn();
- setTimeout(function(){
- var target = document.getElementById("TableTip");
- document.onclick = function(){
- onceFlag_tablepro = true;
- $(target).fadeOut("normal",function(){
- $.post('/jylab/changePro',function(r){});
- });
- };
- target.onclick = function(){
- if(document.all){
- window.event.cancelBubble = true;
- }else{
- event.stopPropagation();
- }
- }
- },1000);
- }
- checkIsOpen();
- setTimeout(function(){
- SuperSearch.behaviorCollect(2);
- $("#supersearchPage .showtable").addClass("on").siblings().removeClass("on");
- $("#supersearchPage #wrapper #table").removeClass("hidden");
- $("#supersearchPage #wrapper #list").addClass("hidden");
- SuperSearch.isTable(true);
- },300)
- },
- isTable:function(flag){
- if(flag){ //table
- if(SuperSearch.dropload){//表格只展示20条数据
- SuperSearch.dropload.lock();
- }
- if($("#table .content tr").length>20){
- $(".dropload-down").css("display","none");
- $("#wrapper .shade_table").css("display","");
- }else{
- $(".dropload-down").css("display","");
- $("#wrapper .shade_table").css("display","none");
- }
- }else{ //list
- if(SuperSearch.dropload){
- SuperSearch.dropload.unlock();
- }
- $(".dropload-down").css("display","");
- $("#wrapper .shade_table").css("display","none");
- }
- },
- goToFeedbackPage: function(){
- SuperSearch.setSessionStorage();
- window.location.href = '/swordfish/feedback';
- },
- setSessionStorage: function(){
- if(sessionStorage){
- // @data 2021/6/28 S-新版搜索缓存
- if (vMainSearchComponent && typeof temporaryStorageForPage === 'function') {
- temporaryStorageForPage(vMainSearchComponent, 'superSearch_newQueryParams', 'save')
- }
- // @data 2021/6/28 E-新版搜索缓存
- var filter_buyerclass = []
- var buttons = $('.select-area-box .list button.active:not(.whole)');
- buttons.each(function () {
- filter_buyerclass.push($(this).text())
- })
- SuperSearch.filterWin.html = $("#supersearchPage #select-win-list").html()
- SuperSearch.filterBuy.select = filter_buyerclass
- sessionStorage.superSearch_filterWin = JSON.stringify(SuperSearch.filterWin)
- sessionStorage.superSearch_filterBuy = JSON.stringify(SuperSearch.filterBuy)
- sessionStorage.superSearch_noMoreCache = SuperSearch.noMoreCache;
- sessionStorage.superSearch_listContent=$("#supersearchPage #list").html();
- sessionStorage.superSearch_tableContent=$("#supersearchPage #table .data .content").html();
- sessionStorage.superSearch_subtype=SuperSearch.reqParam.subtype;
- sessionStorage.superSearch_scope=SuperSearch.reqParam.scope;
- sessionStorage.superSearch_publishtime=SuperSearch.reqParam.publishtime;
- sessionStorage.superSearch_minprice=SuperSearch.reqParam.minprice;
- sessionStorage.superSearch_maxprice=SuperSearch.reqParam.maxprice;
- sessionStorage.superSearch_pageNum=SuperSearch.reqParam.pageNum;
- sessionStorage.superSearch_buyerclass=SuperSearch.reqParam.buyerclass;
- sessionStorage.superSearch_winner=SuperSearch.reqParam.winner;
- sessionStorage.superSearch_xScroll=$("#supersearchPage #table .data").scrollLeft();
- sessionStorage.superSearch_yScroll=$("#supersearchPage .app-layout-content-b #wrapper").scrollTop();
- sessionStorage.superSearch_industry=$("#supersearchPage .contentthree").html();
- sessionStorage.searchpageName="superSearch";
- sessionStorage.superSearch_dyDiv=SuperSearch.dyDiv;
- sessionStorage.superSearch_advertIsClose=SuperSearch.advertIsClose;
- // if($("#supersearchPage .on").hasClass("showlist")){
- // sessionStorage.superSearch_showType="showList";
- // }else if($("#supersearchPage .on").hasClass("showtable")){
- // sessionStorage.superSearch_showType="showTable";
- // }
- sessionStorage.superSearch_showType = $(".select-show-type-group").hasClass('is-table') ? 'showtable' : 'showlist'
- var shaxuanclass = $("#supersearchPage .jyshaxuan .icon-triangle-up").parent().attr("data-open");
- if(shaxuanclass){
- sessionStorage.superSearch_shaxuan=shaxuanclass;
- }
- sessionStorage.superSearch_shaxuanFlag=!$("#supersearchPage #super_search").hasClass("hidden");
- sessionStorage.superSearch_searchType=$(".newdialog .tab-box .sub-search-title").find("li.active").attr('dataVal');//$("#supersearchPage #selLable>.com-title>span.on").attr("id");
- sessionStorage.superSearch_interceptWord=SuperSearch.interceptWord;
- var hasNoData_tiptext_index = $("#supersearchPage #hasNoData_tiptext>font:visible").index();
- if(hasNoData_tiptext_index==1){
- sessionStorage.superSearch_hasNoData_tiptext="-1";
- }else if(hasNoData_tiptext_index==2){
- sessionStorage.superSearch_hasNoData_tiptext="-2"
- }
- sessionStorage.superSearch_allSearchModel_isshow=$("#supersearchPage #allSearchModel").is(":visible");
- sessionStorage.superSearch_limitFlag=SuperSearch.limitFlag;
- sessionStorage.superSearch_showNull=SuperSearch.showNull;
- sessionStorage.superSearch_currentkws=$("input[name='super_searchinput']").val();
- }
- },
- setUpLastPage: function() {
- if(!sessionStorage){
- return;
- }
- //console.log('win 01')
- SuperSearch.filterBuy = JSON.parse(sessionStorage.superSearch_filterBuy || '{}')
- SuperSearch.filterWin = JSON.parse(sessionStorage.superSearch_filterWin || '{}')
- initSearchHeader(true)
- $("input[name='super_searchinput']").val(sessionStorage.superSearch_currentkws)
- if(sessionStorage.superSearch_showNull == "null"){
- SuperSearch.showNull = null;
- $("#supersearchPage .selLable").addClass("hidden");
- SuperSearch.showToOrder(false);
- }else{
- $("#supersearchPage .clearInpt").addClass("hidden");
- if(sessionStorage.superSearch_limitFlag=="true"){
- SuperSearch.limitFlag = true;
- }else{
- SuperSearch.limitFlag = false;
- }
- //页面数据
- if(sessionStorage.superSearch_listContent==""){
- SuperSearch.hasNoData();
- $("#supersearchPage #hasNoData_tiptext>font").hide();
- if(sessionStorage.superSearch_hasNoData_tiptext=="-1"){
- $("#supersearchPage #hasNoData_tiptext>font:eq(1)").show();
- }else if(sessionStorage.superSearch_hasNoData_tiptext=="-2"){
- $("#supersearchPage #hasNoData_tiptext>font:eq(2)").show();
- }else{
- showSearchTipForTimeRange()
- }
- if(sessionStorage.superSearch_allSearchModel_isshow=="true"){
- $("#supersearchPage #allSearchModel").show();
- }else{
- $("#supersearchPage #allSearchModel").hide();
- }
- }else{
- if(sessionStorage.superSearch_dyDiv == "false"){
- SuperSearch.dyDiv = false;
- $("#supersearchPage .resbm").css("position","absolute");
- SuperSearch.showToOrder(true);
- setTimeout(function(){
- $("#supersearchPage .resbm").css("position","fixed");
- },200);
- }else{
- SuperSearch.dyDiv = true;
- SuperSearch.showToOrder(false);
- }
- SuperSearch.noMoreCache = sessionStorage.superSearch_noMoreCache;
- SuperSearch.showNull = false;
- var ListContent=$(sessionStorage.superSearch_listContent);
- ListContent.on("tap", function(event){
- var h = $(this).find("a.bt").attr("s");
- var sid = $(this).find("a.bt").attr("sid");
- var industry = $(this).find(".industry").text();
- if (SuperSearch.checkIsStartFn(event, { sid: sid })) {
- SuperSearch.myredirect(h,sid,industry);
- }
- });
- $("#supersearchPage #list").html(ListContent);
- //收藏处理
- var listCollSessionId = sessionStorage.getItem('listCollSessionId')
- if (listCollSessionId){
- var listCollSessionBool = sessionStorage.getItem('listCollSessionBool');
- if (listCollSessionBool=="1"){
- $("a[sid='"+listCollSessionId+"']").parent().next().addClass("fill");
- }else{
- $("a[sid='"+listCollSessionId+"']").parent().next().removeClass("fill");
- }
- sessionStorage.removeItem('listCollSessionId')
- sessionStorage.removeItem('listCollSessionBool')
- }
- //
- var TableContent=$(sessionStorage.superSearch_tableContent);
- TableContent.on("tap",function(event){
- var h = $(this).attr("s");
- var sid = $(this).attr("sid");
- var industry = $(this).attr("i");
- SuperSearch.myredirect(h,sid,industry);
- });
- $("#supersearchPage #table .data .content").html(TableContent);
- //
- SuperSearch.initDropload(SuperSearch.noMoreCache!="true",sessionStorage.superSearch_pageNum);
- }
- SuperSearch.appendInterceptWord(sessionStorage.superSearch_interceptWord);
- if(sessionStorage.superSearch_advertIsClose == "false"){
- SuperSearch.advertIsClose = false;
- }else{
- SuperSearch.advertIsClose = true;
- }
- var superSearch_yScroll = sessionStorage.superSearch_yScroll;
- var superSearch_xScroll = sessionStorage.superSearch_xScroll;
- setTimeout(function(){
- $("#supersearchPage .app-layout-content-b #wrapper").scrollTop(superSearch_yScroll);
- $("#supersearchPage #table .data").scrollLeft(superSearch_xScroll);
- },50);
- }
- //筛选时间
- var ptime= sessionStorage.superSearch_publishtime;
- if(typeof(ptime) != "undefined" && ptime != ""){
- $("#supersearchPage .jypt-pt .jypt-active").removeClass("jypt-active");
- if(ptime.indexOf("_") > -1){
- $("#supersearchPage .jypt-timeinputs").addClass("jypt-timeinputs-active");
- spTimeArray = ptime.split("_");
- if(spTimeArray[0] != ""){
- $("#supersearchPage #starttime").attr('data-value',new Date(new Number(spTimeArray[0]+"000")).getTime()).val(new Date(new Number(spTimeArray[0]+"000")).Format("yyyy年MM月dd日"));
- }
- if(spTimeArray[1] != ""){
- $("#supersearchPage #endtime").attr('data-value',new Date(new Number(spTimeArray[1]+"000")).getTime()).val(new Date(new Number(spTimeArray[1]+"000")).Format("yyyy年MM月dd日"));
- }
- }else{
- $("#supersearchPage .jypt-pt [data-value='"+ptime+"']").addClass("jypt-active");
- }
- }
- //信息类别
- var subtype=sessionStorage.superSearch_subtype;
- if(typeof(subtype) != "undefined" && subtype != "A"&&subtype != ""){
- $("#supersearchPage .contenttwo").find("ul:first li:first .btn").removeClass("active");
- subtype = subtype.split(",");
- for(var i=0;i<subtype.length;i++){
- $("#supersearchPage .contenttwo").find(".btn").each(function(){
- if($(this).text() == subtype[i]){
- $(this).addClass("active");
- if($(this).parent("li").find(".btn").length == $(this).parent("li").find(".btn.active").length){
- $(this).prevAll('div[id="dqbtn"]').addClass("active");
- };
- return false;
- }
- });
- }
- }
- //地区
- var scopes=sessionStorage.superSearch_scope;
- if(typeof(scopes) != "undefined" && scopes != "A"&&scopes != ""){
- $("#supersearchPage .contentone").find("ul:first li:first .btn").removeClass("active");
- scopes = scopes.split(",");
- for(var i=0;i<scopes.length;i++){
- $("#supersearchPage .contentone").find(".btn").each(function(){
- if($(this).text() == scopes[i]){
- $(this).addClass("active");
- return false;
- }
- });
- }
- }
- //行业
- var industry=sessionStorage.superSearch_industry;
- $("#supersearchPage .contentthree").html(industry);
- SuperSearch.industryAction();
- /*if(industry != "A"&&industry != ""){
- $("#supersearchPage .contentthree").find("ul:first li:first .btn").removeClass("active");
- industry = industry.split(",");
- if(industry.length>1){
- // alert(1)
- $("#supersearchPage [data-value='"+industry[0]+"']").parent("li").find("#dqbtn").addClass("active");
- }else{
- //alert(2)
- $("#supersearchPage [data-value='"+industry[0]+"']").addClass("active");
- }
- /!*for(var i=0;i<industry.length;i++){
- $("#supersearchPage .contentthree").find(".btn").each(function(){
- if($(this).attr("data-value") == industry[i]){
- $(this).addClass("active");
- if($(this).parent("li").find(".btn").length == $(this).parent("li").find(".btn.active").length){
- $(this).prevAll('div[id="dqbtn"]').addClass("active");
- };
- return false;
- }
- });
- }*!/
- }*/
- //金额
- var minprice = sessionStorage.superSearch_minprice;
- var maxprice = sessionStorage.superSearch_maxprice;
- if(minprice != "" || maxprice != ""){
- $("#supersearchPage .money-dialog .btn").removeClass("active");
- $("#supersearchPage .money-dialog .money-inp ").addClass("active");
- minprice != "" && $("#supersearchPage .money-dialog .minMrice").val(minprice);
- maxprice != "" && $("#supersearchPage .money-dialog .maxMrice").val(maxprice);
- }else{
- $("#supersearchPage .money-dialog .btn").addClass("active");
- }
- var shaxuanclass = sessionStorage.superSearch_shaxuan;
- var shaxuanFlag = sessionStorage.superSearch_shaxuanFlag;
- if(shaxuanFlag=="true"){
- $("#supersearchPage #selLable").addClass("hidden");
- $("#supersearchPage #wrapper").addClass("hidden");
- $("#supersearchPage .nullcontent").addClass("hidden");
- $("#supersearchPage #super_search").removeClass("hidden");
- $("#supersearchPage .jyshaxuan .j-icon").removeClass("icon-triangle-up");
- }
- if(shaxuanclass){
- //console.log('xxx', shaxuanclass)
- checkFilterButtonText()
- $("#supersearchPage div[data-open='"+shaxuanclass+"']").trigger('click')
- } else {
- //console.log('没有筛选tab')
- $("#supersearchPage div[data-open='industry']").trigger('click')
- }
- // $("#supersearchPage #selLable>.com-title>span.on").removeClass("on");
- // $("#supersearchPage #selLable>.com-title>#"+sessionStorage.superSearch_searchType).addClass("on");
- $(".newdialog .sub-search-title").find("li").removeClass("active");
- $(".newdialog .sub-show-list").find("li").removeClass("active");
- if(sessionStorage.superSearch_searchType=="searchtitle"){
- $(".selected-export .options .search-title").find("em").text("标题搜索");
- $(".newdialog .sub-search-title").find("li[dataval='searchtitle']").addClass("active");
- }else if(sessionStorage.superSearch_searchType=="searchall"){
- $(".selected-export .options .search-title").find("em").text("全文搜索");
- $(".newdialog .sub-search-title").find("li[dataval='searchall']").addClass("active");
- }
- SuperSearch.showType();
- SuperSearch.beforeSubmit();
- },
- showType: function(){
- if(sessionStorage.superSearch_showType=="showtable"){
- $(".select-show-type-group").addClass('is-table')
- $("#supersearchPage #wrapper #table").removeClass("hidden");
- $("#supersearchPage #wrapper #list").addClass("hidden");
- SuperSearch.isTable(true);
- }else{
- $(".select-show-type-group").removeClass('is-table')
- $("#supersearchPage #wrapper #table").addClass("hidden");
- $("#supersearchPage #wrapper #list").removeClass("hidden");
- SuperSearch.isTable(false);
- }
- },
- getIndustry: function(){
- //铺设行业信息
- var industryHtml="<ul><li><button class=\"btn active\">全部</button></li>";
- if(SuperSearch.sortArray!=""&&SuperSearch.industry!=""){
- for(var i in SuperSearch.sortArray){
- industryHtml+="<li><div id=\"dqbtn\" style=\"width:81px;\">"+SuperSearch.sortArray[i]+"</div>";
- var childnode=SuperSearch.industry[SuperSearch.sortArray[i]];
- for(var j in childnode){
- industryHtml+="<button class=\"btn\" data-value="+SuperSearch.sortArray[i]+"_"+childnode[j]+">"+childnode[j]+"</button>";
- }
- industryHtml+="</li>";
- }
- industryHtml+= "</ul>";
- $("#supersearchPage .industry-dialog .contentthree").html(industryHtml);
- }
- SuperSearch.industryAction();
- },
- industryAction: function(){
- //行业点击事件
- var dialogObjthree = $("#supersearchPage .contentthree");
- dialogObjthree.find(".btn").on("tap",function(){
- if($(this).parent().index() == 0){
- dialogObjthree.find('div[id="dqbtn"]').removeClass("active");
- dialogObjthree.find(".btn").removeClass("active");
- $(this).addClass("active");
- }else{
- if($(this).hasClass("active")){
- dialogObjthree.find(".btn").removeClass("active");
- dialogObjthree.find("div[id='dqbtn']").removeClass("active");
- dialogObjthree.find("ul:first li:first .btn").addClass("active");
- }else{
- dialogObjthree.find("ul:first li:first .btn").removeClass("active");
- dialogObjthree.find(".btn").removeClass("active");
- dialogObjthree.find("div[id='dqbtn']").removeClass("active");
- $(this).addClass("active");
- }
- };
- });
- dialogObjthree.find('div[id="dqbtn"]').on("tap",function(){
- if($(this).hasClass("active")){
- dialogObjthree.find(".btn").removeClass("active");
- dialogObjthree.find("div[id='dqbtn']").removeClass("active");
- dialogObjthree.find("ul:first li:first .btn").addClass("active");
- }else{
- dialogObjthree.find("div[id='dqbtn']").removeClass("active");
- dialogObjthree.find(".btn").removeClass("active");
- $(this).addClass("active");
- }
- });
- },
- afterSelect: function(){
- $("#supersearchPage .jypt-timeinputs").addClass("jypt-timeinputs-active");
- $("#supersearchPage .jypt-pt .jypt-active").removeClass("jypt-active");
- },
- afterOnClear: function(){
- if($("#supersearchPage #starttime").attr("data-value") == "" && $("#supersearchPage #endtime").attr("data-value") == ""){
- $("#supersearchPage .jypt-timeinputs").removeClass("jypt-timeinputs-active");
- if($("#supersearchPage .jypt-pt>button.jypt-active").length == 0){
- $("#supersearchPage .jypt-pt>button:first").addClass("jypt-active");
- }
- }
- },
- setPublishtime: function(){
- var publishtime = $("#supersearchPage .jypt-pt .jypt-active:not(#alltime)").attr("data-value");
- if(publishtime){
- return publishtime;
- }else{
- if(!$("#supersearchPage .jypt-timeinputs").hasClass("jypt-timeinputs-active")){
- return "";
- }
- publishtime = SuperSearch.getInputTime().join("_");
- if(publishtime != "_"){
- return publishtime;
- }else{
- return "";
- }
- }
- },
- getInputTime: function(){
- var starttime = $("#supersearchPage #starttime").attr("data-value");
- if(starttime){
- starttime = $.trim(starttime);
- starttime = starttime.substring(0,starttime.length - 3);
- }else{
- starttime = "";
- }
- var endtime = $("#supersearchPage #endtime").attr("data-value");
- if(endtime){
- endtime = $.trim(endtime);
- endtime = endtime.substring(0,endtime.length - 3);
- }else{
- endtime = "";
- }
- return [starttime,endtime]
- },
- closeadv: function(obj){
- SuperSearch.advertIsClose = true;
- $(obj).parent().prev().css("border-bottom-width","1px");
- $(obj).parent().remove();
- if(SuperSearch.dropload != null){
- SuperSearch.dropload.resetload();
- }
- //再html内点击都会存缓存 关闭广告后再刷新 会取缓存
- SuperSearch.clearSessionStorage();
- },
- appendInterceptWord: function(word){
- SuperSearch.interceptWord = word;
- if(word == ""){
- $("#supersearchPage #intercept").addClass("hidden");
- return;
- }
- $("#supersearchPage #intercept").removeClass("hidden");
- $("#supersearchPage #intercept>font").text("“"+word+"”");
- },
- inputBlur: function(){
- $("#supersearchPage input[name=super_searchinput]").blur();
- $("#supersearchPage .maxMrice").blur();
- $("#supersearchPage .minMrice").blur();
- },
- showToOrder:function(flag){
- if(flag){
- $("#wrapper").css("padding-bottom","132px");
- $("#supersearchPage .resbm").removeClass("hidden");
- }else{
- $("#wrapper").css("padding-bottom","52px");
- $("#supersearchPage .resbm").addClass("hidden");
- }
- },
- getHomeList:function(locationCity,nReq){
- SuperSearch.locationCity = locationCity;
- SuperSearch.initHomePage();
- $.ajax({
- type: "post",
- url: "/subscribepay/index/getIndexMessage",
- data: {city:SuperSearch.locationCity,nReq:nReq},
- dataType: "json",
- async: false,
- success: function(r){
- if(nReq==2){
- $(".loading_Top").hide();
- }
- if(r.success){
- SuperSearch.homePageShow(r.data);
- }
- },error: function(){
- console.log("请求报错...")
- }
- });
- },
- locationHomeData:function(){
- SuperSearch.locationCount=1;//定位只查一次
- wx.getLocation({
- type: 'wgs84', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
- success: function (res) {
- var latitude = res.latitude; // 纬度,浮点数,范围为90 ~ -90
- var longitude = res.longitude; // 经度,浮点数,范围为180 ~ -180。
- //生成地理位置
- var point = new BMap.Point(longitude, latitude);
- var geoc = new BMap.Geocoder();
- geoc.getLocation(point, function(rs) {
- var addComp = rs.addressComponents;
- //alert('您现在所处位置:'+addComp.province + ", "+addComp.city + ", "+addComp.district + ", "+addComp.street + ", "+addComp.streetNumber);
- SuperSearch.getHomeList(addComp.city,2);
- });
- },
- cancel:function(r){
- //拒绝定位 地区参数为-:空
- SuperSearch.getHomeList("",2);
- },
- fail:function(){
- //定位失败 地区参数为-:空
- SuperSearch.getHomeList("",2);
- }
- });
- },
- homePageShow:function(r){
- SuperSearch.hasHistory = r["hasHistory"]
- SuperSearch.hasSubscribe = r["hasSubscribe"]
- SuperSearch.isVip = r["isVip"]
- SuperSearch.listLength = r["listLength"]
- SuperSearch.myHistory = r["history"]
- var list = r["list"]
- if (list && list.length) {
- SuperSearch.checkStartKeepStatus(list.map(function(v) {
- return v._id
- }))
- }
- var homeListHtml = '';
- if(list!=null&&list.length>0){
- for(var i=0;i<list.length;i++){
- var _list = list[i];
- var title = _list["title"];
- if(SuperSearch.hasSubscribe){
- if(_list["matchkeys"]!=null&&typeof(_list["matchkeys"])!="undefined"){
- for(var n=0;n<_list["matchkeys"].length;n++){
- var matchkeys = _list["matchkeys"][n].split("+");
- for(var nn=0;nn<matchkeys.length;nn++){
- title = keyWordHighlight(title,matchkeys[nn],'<font class="keyword">$1</font>');
- }
- }
- }
- }else if(SuperSearch.myHistory!=null&&SuperSearch.myHistory.length>0){
- title = keyWordHighlight(title,SuperSearch.myHistory,'<font class="keyword">$1</font>');
- }
- homeListHtml +='<div data-cl-event="c_wx_newest_linkclick" class="list_item" onclick="SuperSearch.HomeToDetails(\''+_list["_id"]+'\', event)">'
- +'<div class="list_title">'
- +'<span class="serial_number">'+(i+1)+'. </span>'
- + '<div class="two-group">'
- +'<p sid="'+_list["_id"]+'">'+title+'</p>'
- + '<div class="flow-start-box"><i class="icon-flow-start"></i></div>'
- + '</div>'
- +'</div>'
- +'<div class="list_info">'
- +'<div class="tags">'
- var area = _list["area"];
- if(area==undefined||area==""){
- area='全国'
- }
- homeListHtml +='<div class="area">'+area+'</div>'
- var industry = _list["industry"];
- var subtype = _list["subtype"];
- var buyerclass = _list["buyerclass"] || '';
- if(SuperSearch.hasSubscribe||SuperSearch.isVip){
- industry = _list["s_subscopeclass"];
- subtype = _list["type"];
- }
- if(industry==undefined){
- industry=""
- }
- if(subtype==undefined){
- subtype = ""
- }
- if (SuperSearch.isVip || jyUserPower.vip > 0 || jyUserPower.member || jyUserPower.entniche) {
- if (buyerclass!="") {
- homeListHtml +='<div class="buyerclass">'+buyerclass+'</div>'
- } else {
- if (industry!=""){
- homeListHtml +='<div class="industry">'+industry+'</div>'
- }
- }
- } else {
- if (industry!=""){
- homeListHtml +='<div class="industry">'+industry+'</div>'
- }
- }
- if(subtype!=""){
- homeListHtml +='<div class="course">'+subtype+'</div>'
- }
- var moneyTag = ''
- // 金额标签
- if(typeof(_list.budget) != "undefined" && _list.budget != null && _list.budget != ""){
- moneyTag = '<div class="bidamount">'+MoneyUnit.test(_list.budget)+'</div>';
- }
- if(typeof(_list.bidamount) != "undefined" && _list.bidamount != null && _list.bidamount != ""){
- moneyTag = '<div class="bidamount">'+MoneyUnit.test(_list.bidamount)+'</div>';
- }
- homeListHtml += moneyTag
- //时间
- var publishtime = _list["publishtime"];
- if(publishtime){
- publishtime = utils.dateFromNow(Number(publishtime+"000"));
- }
- homeListHtml +='<div class="price hide"></div>'
- +'</div>'
- +'<div class="timer">'+publishtime+'</div>'
- +'</div>'
- +'</div>'
- }
- }else{
- if(!SuperSearch.isVip&&!SuperSearch.hasSubscribe&&SuperSearch.locationCount==0){
- var locatInterval = setInterval(function(){
- if(SuperSearch.localFalg){
- clearInterval(locatInterval);
- SuperSearch.locationHomeData();
- }
- },500)
- return
- }
- }
- SuperSearch.showHomeList(homeListHtml);
- },
- HomeToDetails:function(id, e){
- if (SuperSearch.checkIsStartFn(e, { sid: id })) {
- if(id!=""){
- window.location.href="/article/content/"+id+".html"
- }
- }
- },
- showHomeList:function(hh){
- SuperSearch.initHomeTip();
- if(hh!=""){
- $(".home_data .data_list").html(hh);
- }
- },
- initHomePage:function(){
- $(".home_toset").click(function(){
- if(SuperSearch.isVip){
- window.location.href="/front/vipsubscribe/toSubVipSetPage"
- }else{
- sessionStorage.removeItem("keysetindexToHistory");
- window.location.href="/swordfish/newhistorypush?msg=1"
- }
- })
- $(".tips_all .GetAll").click(function(){
- sessionStorage.removeItem("keysetindexToHistory");
- window.location.href="/swordfish/newhistorypush?msg=1"
- })
- $(".home_todetails").click(function(){
- window.location.href="/front/vipsubscribe/introducePage"
- })
- //直播活动
- $(".home_tolive").click(function(){
- window.location.href="/active/livePage/index"
- })
- },
- initHomeTip:function(){
- if(SuperSearch.listLength>0){
- if(!SuperSearch.isVip){
- if(SuperSearch.hasSubscribe){
- if(SuperSearch.listLength>=50){
- $(".home_4").show();
- $(".home_todetails").show();
- }else if(SuperSearch.listLength>0){
- $(".home_2").show();
- $(".home_toset").show();
- }
- }else{
- $(".home_1").show();
- $(".home_toset a").text("去订阅");
- $(".home_toset").show();
- }
- }else{
- if(SuperSearch.listLength>=50){
- $(".tips .tips_all").show();
- }else if(SuperSearch.listLength>0){
- if(!SuperSearch.hasSubscribe){
- $(".home_3").show();
- }else{
- $(".home_2").show();
- }
- $(".home_toset").show();
- }
- }
- }else{
- $(".no_data").show();
- }
- }
- };
|