PageSourceSearch

https://mstatic.jiwu.com/v7.0/dist/new-version/js/navigationPcH5.js?v=2026082916

js jiwu.com collected 2026-10-03 21:20:10 UTC 9,416 bytes, 196 lines download raw bytes

1
2let pcWWW = "https://www.jiwu.com/"
3let h5 = "https://m.jiwu.com/"
4let jiaH5 = "https://mjia.jiwu.com/"
5
6 // changePcOrH5()
7
8
9function changePcOrH5(){
10    var userAgent = navigator.userAgent; //获取用户代理字符串
11    var location = window.location.href
12    // console.log("==location==", location);
13    let href = ""
14    if (/(Windows|Macintosh)/.test(userAgent)) {
15        href = getPcUrl(location)
16        // console.log("== pc to == ", href);
17    } else if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent)) {
18        href = getH5Url(location)
19        // console.log("== h5 to == ", href);
20    }
21    if(href && href != location){
22        window.location.href = href
23    }
24
25}
26
27function changeCityHrefToPc(href, cityRemark){
28    href = href.split(cityRemark)
29    let hrefback =  `https://${cityRemark}.jiwu.com${href[1]}`
30    if(hrefback.indexOf("news1") > 0){
31        hrefback = hrefback.replace("news1", "news")
32    }
33    return hrefback;
34
35}
36
37//PC设备 输入了 H5网址 ,转PC 网址
38function getPcUrl(href){
39    let city = $("#domain").val()
40
41    if(href.indexOf(h5) >= 0 || href.indexOf(jiaH5) >= 0){
42        if(href.indexOf("https://m.jiwu.com/?") >= 0 || href == "https://m.jiwu.com/" || href == "https://m.jiwu.com"){
43            href =  pcWWW
44        }else if(href.indexOf("www/news") > 0){
45            href = href.replace("https://m.jiwu.com/www/news/", "https://www.jiwu.com/news/")
46        }else if(href.indexOf("m.jiwu.com/zhuanti") > 0){
47            href = href.replace("https://m.jiwu.com/zhuanti/", "https://www.jiwu.com/zhuanti/")
48        }else if(href.indexOf("m.jiwu.com/wenda") > 0){
49            href = href.replace("https://m.jiwu.com/wenda/", "https://www.jiwu.com/wenda/")
50        }else if(href.indexOf("m.jiwu.com/baike") > 0){
51            href = href.replace("https://m.jiwu.com/baike/", "https://www.jiwu.com/baike/")
52        }else if(href.indexOf("calculator/property/") > 0){
53            href = href.replace("https://m.jiwu.com/calculator/property/", "https://www.jiwu.com/calculator/property/")
54        }else if(href.indexOf("calculator/tax/") > 0){
55            href = href.replace("https://m.jiwu.com/calculator/tax/", "https://www.jiwu.com/calculator/tax/")
56        }else if(href.indexOf("calculator/prepayment/") > 0){
57            href = href.replace("https://m.jiwu.com/calculator/prepayment/", "https://www.jiwu.com/calculator/prepayment/")
58        }else if(href.indexOf("calculator/house/") > 0){
59            href = href.replace("https://m.jiwu.com/calculator/house/", "https://www.jiwu.com/calculator/house/")
60        }else if(href.indexOf("calculator/house/") > 0){
61            href = href.replace("https://m.jiwu.com/calculator/house/", "https://www.jiwu.com/calculator/house/")
62        }else if(href.indexOf(city) > 0){
63            href = changeCityHrefToPc(href, city)
64            // console.log("==changeCityHrefToPc==", href, city);
65        }else if(href.indexOf("mjia") > 0){
66            href = href.replace("mjia", "jia")
67            // console.log("==jia href==", href);
68        }else{
69            href = ""
70        }
71    }else{
72        href = ""
73    }
74    // console.log("==prehref==", href);
75    return href
76}
77
78//H5设备 输入了 pc网址 ,转h5 网址
79function getH5Url(href){
80    let city = $("#domain").val()
81    let preUrl = ""
82    if(city){
83        preUrl = `https://${city}.jiwu.com/`
84    }else{
85        let delHref = href.split(".jiwu.")
86        city = delHref[0].replace("https://", "")
87        if(city == "www" || city == "jia" || city == "m" || city == "mjia"){
88            city = ""
89        }
90        if(city){
91            preUrl = `https://${city}.jiwu.com/`
92        }
93    }
94    if(href.indexOf(pcWWW) >= 0 || (preUrl && href.indexOf(preUrl) >= 0)){
95        if(href == "https://www.jiwu.com" || href == "https://www.jiwu.com/"){
96            // href = h5
97            delCookie("st")
98            setCookie("st", "1", 3650),
99                href = "https://m.jiwu.com/"
100        }else if(href.indexOf('www.jiwu.com/news') > 0){
101            href = href.replace("https://www.jiwu.com/news/", "https://m.jiwu.com/www/news/")
102            if(href.indexOf("list-page") > 0){
103                href = "https://m.jiwu.com/www/news/"
104            }
105        }else if(href.indexOf("www.jiwu.com/zhuanti") > 0){
106            href = href.replace("https://www.jiwu.com/zhuanti/", "https://m.jiwu.com/zhuanti/")
107        }else if(href.indexOf("www.jiwu.com/wenda") > 0){
108            href = href.replace("https://www.jiwu.com/wenda/", "https://m.jiwu.com/wenda/")
109        }else if(href.indexOf("www.jiwu.com/baike") > 0){
110            href = href.replace("https://www.jiwu.com/baike/", "https://m.jiwu.com/baike/")
111        }else if(href.indexOf("www.jiwu.com/calculator/property") > 0){
112            href = href.replace("www.jiwu.com/calculator/property", "m.jiwu.com/calculator/property")
113        }else if(href.indexOf("www.jiwu.com/calculator/tax") > 0){
114            href = href.replace("www.jiwu.com/calculator/tax", "m.jiwu.com/calculator/tax")
115        }else if(href.indexOf("www.jiwu.com/calculator/prepayment") > 0){
116            href = href.replace("www.jiwu.com/calculator/prepayment", "m.jiwu.com/calculator/prepayment")
117        }else if(href.indexOf("www.jiwu.com/calculator/house") > 0){
118            href = href.replace("www.jiwu.com/calculator/house", "m.jiwu.com/calculator/house")
119        }else if(href.indexOf(city) > 0){ // https://sz.jiwu.com/xiaoqu/jiaotong/827887.html
120            href = href.replace(preUrl, `https://m.jiwu.com/${city}/`)
121            //news  列表的  list-page2.html  ->  https://m.jiwu.com/yushu/news1/
122            if(href == `https://m.jiwu.com/${city}/news/`){
123                href = `https://m.jiwu.com/${city}/news1/`
124            }
125            if(href.indexOf("/news/") > 0 && href.indexOf("list-page") > 0){
126                href = `https://m.jiwu.com/${city}/news1/`
127            }
128            if(href.indexOf("/info/") > 0 && href.indexOf("list-page") > 0){
129                href = `https://m.jiwu.com/${city}/info/`
130            }
131            if(href.indexOf("/zygj/") > 0 && href.indexOf("list-page") > 0){
132                href = `https://m.jiwu.com/${city}/zygj/`
133            }
134            // console.log("==h5 city href==", href, city);
135        }else{
136            href = ""
137        }
138    }else if(href.indexOf("jia.jiwu.com") > 0){
139        if(href.indexOf("mjia.jiwu.com") < 0){
140            href = href.replace("jia.jiwu.com", "mjia.jiwu.com")
141        }
142        // console.log("==有链接不替换", href);
143    }else{
144        href = ""
145    }
146    // console.log("==pre h5 href==", href);
147    return href
148}
149function setCookie(name, value, days) {
150    var exp = new Date();
151    exp.setTime(exp.getTime() + days * 24 * 60 * 60 * 1000);
152    // document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString() + ";path=/;domain=.jiwu.com";
153    document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString() + ";path=/";
154}
155function delCookie(name) {
156    var exp = new Date(); //当前时间
157    exp.setTime(exp.getTime() - 1000);
158    var cval = getCookie(name);
159    if (cval != null) document.cookie = name + "='';expires=" + exp.toGMTString() + ";path=/;domain=jiwu.com";
160}
161
162
163// https://www.jiwu.com/	https://m.jiwu.com/
164// https://www.jiwu.com/news/*	https://m.jiwu.com/www/news/*
165// https://www.jiwu.com/zhuanti/*	https://m.jiwu.com/zhuanti/*
166// https://www.jiwu.com/wenda/*	https://m.jiwu.com/wenda/*
167// https://www.jiwu.com/baike/*	https://m.jiwu.com/baike/*
168// https://www.jiwu.com/calculator/property/	https://m.jiwu.com/calculator/property/
169// https://www.jiwu.com/calculator/tax/	https://m.jiwu.com/calculator/tax/
170// https://www.jiwu.com/calculator/prepayment/	https://m.jiwu.com/calculator/prepayment/
171// https://www.jiwu.com/calculator/house/	https://m.jiwu.com/calculator/house/
172
173// https://{city}.jiwu.com/	            https://m.jiwu.com/{city}/
174// https://{city}.jiwu.com/loupan/*	    https://m.jiwu.com/{city}/loupan/*
175// https://{city}.jiwu.com/detail/*	    https://m.jiwu.com/{city}/detail/*
176// https://{city}.jiwu.com/huxing/*	    https://m.jiwu.com/{city}/huxing/*
177// https://{city}.jiwu.com/tu/*	        https://m.jiwu.com/{city}/tu/*
178// https://{city}.jiwu.com/info/*	    https://m.jiwu.com/{city}/info/*
179// https://{city}.jiwu.com/news/	    https://m.jiwu.com/{city}/news1/
180// https://{city}.jiwu.com/news/*	    https://m.jiwu.com/{city}/news/*
181// https://{city}.jiwu.com/jiaotong/*	https://m.jiwu.com/{city}/jiaotong/*
182// https://{city}.jiwu.com/guwen/*	    https://m.jiwu.com/{city}/guwen/*
183// https://{city}.jiwu.com/fangjia/*	https://m.jiwu.com/{city}/fangjia/*
184// https://{city}.jiwu.com/video/*	    https://m.jiwu.com/{city}/video/*
185// https://{city}.jiwu.com/lpcp/*	    https://m.jiwu.com/{city}/lpcp/*
186// https://{city}.jiwu.com/xqjd/*	    https://m.jiwu.com/{city}/xqjd/*
187// https://{city}.jiwu.com/lpjd/*	    https://m.jiwu.com/{city}/lpjd/*
188// https://{city}.jiwu.com/esf/*	    https://m.jiwu.com/{city}/esf/*
189// https://{city}.jiwu.com/xiaoqu/*	    https://m.jiwu.com/{city}/xiaoqu/*
190// https://{city}.jiwu.com/gongjijin/*	https://m.jiwu.com/{city}/gongjijin/*
191// https://{city}.jiwu.com/zygj/*	    https://m.jiwu.com/{city}/zygj/*
192// https://{city}.jiwu.com/gonglve/*	https://m.jiwu.com/{city}/gonglve/*
193// https://{city}.jiwu.com/help/*	    https://m.jiwu.com/{city}/help/*
194
195// https://jia.jiwu.com/*	https://mjia.jiwu.com/*
196

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.