<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">/**
 * Copyright (c) 2014, Xcar-newcar组
 * All rights reserved.
 * 文件名称： Jump.js
 * 摘　　要： 公共跳转类
 * 作　　者： li.shang
 * 版　　本： 1.0
 * 修改日期:　2014-3-06
 */
/*
&lt;script&gt;
try{
	var nuaLower = navigator.userAgent.toLowerCase().toLocaleLowerCase();
    if(nuaLower.match(/android|iphone|moblie/) &amp;&amp; !nuaLower.match(/pad/))
	{
		var oScript= document.createElement('script'); 
		oScript.src='https://newcar.xcar.com.cn/js/Jump.js';
		document.getElementsByTagName('HEAD').item(0).appendChild(oScript);
	}
}catch(e){}
&lt;/script&gt;
&lt;script type='text/javascript' src='https://newcar.xcar.com.cn/js/Jump.js'&gt; &lt;/script&gt;
*/
(function(){
	/* 设置cookie */
	function setCookie(name,value,expires,path,domain,secure){
		var cookieText = encodeURIComponent(name) + "=" + encodeURIComponent(value);
		if(expires instanceof Date){
			cookieText += ";expires=" + expires.toGMTString();
		}
		if(path){
			cookieText += ";path=" + path;
		}
		if(domain){
			cookieText += ";domain=" + domain;
		}
		if(secure){
			cookieText += ";secure";
		}
		document.cookie = cookieText;
	}

	/* 读取cookie */
	function getCookie(name){
		var cookieName  = encodeURIComponent(name) + "=",
			cookieStart = document.cookie.indexOf(cookieName),
			cookieValue = null;
		if(cookieStart&gt;-1){
			var cookieEnd = document.cookie.indexOf(";",cookieStart);
			if(cookieEnd == -1){
				cookieEnd = document.cookie.length;
			}
			cookieValue = decodeURIComponent(document.cookie.substring(cookieStart + cookieName.length,cookieEnd));
		}
		return cookieValue;
	}

	if(! window.setCookie || ! window.getCookie)
	{
		window.setCookie = setCookie;
		window.getCookie = getCookie;
	}
})();

(function(){
	var $ajaxUrl = "https://newcar.xcar.com.cn/auto/index.php?r=jump/touch/";
	function specialUrlRun($url)
	{
		var $para = {'url':$url};
		$.ajax({
			type: 'POST',
			url:$ajaxUrl+'&amp;callback=?',
			data:$para,
			dataType:'jsonp',
			success: function(data){
				if(data) self.to(data);
			}
		});
	}
    function getTouchUrl($nowUrl)
    {
        var $reWriteArray = {
			"https://www.xcar.com.cn":"https://a.xcar.com.cn",
			"https://info.xcar.com.cn/car":"https://a.xcar.com.cn/info/",
			"https://info.xcar.com.cn":"https://a.xcar.com.cn/info/newcar/",
			"https://info.xcar.com.cn/guide":"https://a.xcar.com.cn/info/guide/",
			"https://drive.xcar.com.cn":"https://a.xcar.com.cn/info/drive/",
			"https://dealer.xcar.com.cn/info":"https://a.xcar.com.cn/info/market/",
			"https://dealer.xcar.com.cn/info/1_475_0_0_0_0":"https://a.xcar.com.cn/info/market/1_475/",
			"https://dealer.xcar.com.cn/buy":"https://a.xcar.com.cn/buy/",
			"https://dealer.xcar.com.cn/buy/1-475-0":"https://a.xcar.com.cn/buy/1_475/",
			"https://dealer.xcar.com.cn/buy/tg-1-475-2.htm":"https://a.xcar.com.cn/buy/detail/475_2/",
			"https://dealer.xcar.com.cn/buy/mybuy":"https://a.xcar.com.cn/buy/myapply/",
			"https://info.xcar.com.cn/201401/news_1457988_1.html":"https://a.xcar.com.cn/info/201401/1457988-1.html",
			"https://bj.xcar.com.cn/201309/news_1229644_1.html":"https://a.xcar.com.cn/info/201309/1229644-1.html",
			"https://newcar.xcar.com.cn/dongguan/201401/market_1760972.html":"https://a.xcar.com.cn/dealer/d39260/1760972.html",
			"https://dealer.xcar.com.cn/39260/news_detail_3303307.htm":"https://a.xcar.com.cn/dealer/d39260/3303307.html",
			"https://newcar.xcar.com.cn/price":"https://a.xcar.com.cn/brand/",
			"https://newcar.xcar.com.cn":"https://a.xcar.com.cn/newcar/",
			"https://newcar.xcar.com.cn/car/10-7-6-5-0-0-9-0-0-0-0-0":"https://a.xcar.com.cn/newcar/10-9-5-7-6-0-true/",
			"https://newcar.xcar.com.cn/car/10-7-6-5-0-0-9-0-0-0-0-0-0-0":"https://a.xcar.com.cn/newcar/10-9-5-7-6-0-true/",
			"https://newcar.xcar.com.cn/172":"https://a.xcar.com.cn/172/",
			"https://newcar.xcar.com.cn/m5609":"https://a.xcar.com.cn/172/m5609/",
			"https://newcar.xcar.com.cn/price/pb19":"https://a.xcar.com.cn/brand/pb19/",
			"https://newcar.xcar.com.cn/price/b180":"https://a.xcar.com.cn/brand/b180/",
			"https://dealer.xcar.com.cn/d1_475/1_8.htm":"https://a.xcar.com.cn/dealer/8/",
			"https://dealer.xcar.com.cn/d1000/18.htm":"https://a.xcar.com.cn/dealer/18/",
			"https://dealer.xcar.com.cn/32602":"https://a.xcar.com.cn/dealer/d32602/",
			"https://dealer.xcar.com.cn/36886/market_35573556.htm":"https://a.xcar.com.cn/dealer/d36886/market_35573556.html",
			"https://dealer.xcar.com.cn/sale/":"https://a.xcar.com.cn/sale/",
			"https://price.xcar.com.cn/#zoneclick=101229":"https://a.xcar.com.cn/price/#zoneclick=101229",
            "https://price.xcar.com.cn/model33044/city0-1-1.htm#zoneclick=101229":"https://a.xcar.com.cn/price/model33044/",
            "https://price.xcar.com.cn/serise3/city0-1-1.htm#zoneclick=101229":"https://a.xcar.com.cn/price/serise3/",
			"https://dealer.xcar.com.cn/sale/475-0-0-0-0-0-0-0-0/":"https://a.xcar.com.cn/sale/c475/",
			"https://dealer.xcar.com.cn/sale/475-1-8-0-0-0-0-0-0/":"https://a.xcar.com.cn/sale/c475b1s8/",
			"https://dealer.xcar.com.cn/sale/475-1-8-32439-0-0-0-0-0/":"https://a.xcar.com.cn/sale/c475b1s8m32439/",
			"https://newcar.xcar.com.cn/photo/ps553":"https://a.xcar.com.cn/photo/553_0_0/",
			"https://newcar.xcar.com.cn/photo/m553":"https://a.xcar.com.cn/photo/m553_0_0/",
			"https://newcar.xcar.com.cn/photo/s3163_1":"https://a.xcar.com.cn/photo/3163-1/",
			"https://newcar.xcar.com.cn/photo/s2946_1/1508940.htm":"https://a.xcar.com.cn/photo/2946-1/1508940-1.html",
			"https://club.xcar.com.cn/selected":"https://a.xcar.com.cn/bbs/hotposts.html",
			"https://www.xcar.com.cn/bbs":"https://a.xcar.com.cn/bbs/",
			"https://www.xcar.com.cn/bbs/forumdisplay.php?fid=109":"https://a.xcar.com.cn/bbs/forum-c-109.html",
			"https://www.xcar.com.cn/bbs/viewthread.php?tid=19999139":"https://a.xcar.com.cn/bbs/thread-19999139-0.html",
			"https://yp.xcar.com.cn/book":"https://a.xcar.com.cn/info/usecar/",
			"https://newcar.xcar.com.cn/58/news.htm":"https://a.xcar.com.cn/58/article.html",
			"https://newcar.xcar.com.cn/58/news_1.htm":"https://a.xcar.com.cn/58/article.html",
			"https://newcar.xcar.com.cn/58/news_5_c0.htm":"https://a.xcar.com.cn/58_1_475/market.html",
			"https://newcar.xcar.com.cn/58/config.htm":"https://a.xcar.com.cn/58/config.html",
			"https://newcar.xcar.com.cn/58/baojia":"https://a.xcar.com.cn/dealer/58/",
			"https://newcar.xcar.com.cn/58/review.htm":"https://a.xcar.com.cn/58/review.html",
			"https://newcar.xcar.com.cn/58/video.htm":"https://a.xcar.com.cn/58/video.html",
			"https://newcar.xcar.com.cn/58/2019/detail":"https://a.xcar.com.cn/58/2019/detail/",
			"https://newcar.xcar.com.cn/58/2019/detail/index.htm":"https://a.xcar.com.cn/58/2019/detail/index.htm",
			"https://newcar.xcar.com.cn/58/2019/detail/1.htm":"https://a.xcar.com.cn/58/2019/detail/1.htm",
			"https://newcar.xcar.com.cn/1/2016/detail/3_76524.htm":"https://a.xcar.com.cn/1/2016/detail/3_76524.htm",
            "https://newcar.xcar.com.cn/photo":"https://a.xcar.com.cn/newcar/photo/",
			"https://newcar.xcar.com.cn/review/publish.html":"https://a.xcar.com.cn/koubei/publish.html",
			"https://aikahao.xcar.com.cn":"https://a.xcar.com.cn/aikahao/",
            "https://aikahao.xcar.com.cn/item/43.html":"https://a.xcar.com.cn/aikahao/item/43.html",
            "https://aikahao.xcar.com.cn/author/":"https://a.xcar.com.cn/aikahao/author/",
            "https://aikahao.xcar.com.cn/my/register.html":"https://a.xcar.com.cn/aikahao/my/register.php",
            "https://aikahao.xcar.com.cn/video/89306.html":"https://a.xcar.com.cn/aikahao/video/89306.html",
            "https://aikahao.xcar.com.cn":"https://a.xcar.com.cn/aikahao/",
            "https://aikahao.xcar.com.cn/item/43.html":"https://a.xcar.com.cn/aikahao/item/43.html",
            "https://aikahao.xcar.com.cn/author/":"https://a.xcar.com.cn/aikahao/author/",
            "https://aikahao.xcar.com.cn/my/register.html":"https://a.xcar.com.cn/aikahao/my/register.php",
            "https://aikahao.xcar.com.cn/video/89306.html":"https://a.xcar.com.cn/aikahao/video/89306.html",
            "https://club.xcar.com.cn":"https://a.xcar.com.cn/selected/",
            "https://club.xcar.com.cn/":"https://a.xcar.com.cn/bbs/myfollow.html",
            "https://club.xcar.com.cn":"https://a.xcar.com.cn/selected/",
            "https://club.xcar.com.cn/":"https://a.xcar.com.cn/bbs/myfollow.html",
            "https://www.xcar.com.cn/bbs/forumdisplay.php?fid=160":"https://a.xcar.com.cn/bbs/forum-d-467.html",
            "https://www.xcar.com.cn/bbs/f160digestp1.html":"https://a.xcar.com.cn/bbs/digest-d-467-36.html",
            "https://www.xcar.com.cn/bbs/viewthread.php?tid=13343812":"https://a.xcar.com.cn/bbs/thread-90930776-0.html",
            "https://club.xcar.com.cn/square/topic/182.html":"https://a.xcar.com.cn/club/square/topic/182.html",
            "https://www.xcar.com.cn/bbs/":"https://a.xcar.com.cn/bbs/life.html",
            "https://www.xcar.com.cn/bbs/forumdisplay.php?fid=160":"https://a.xcar.com.cn/bbs/forum-d-467.html",
            "https://www.xcar.com.cn/bbs/f160digestp1.html":"https://a.xcar.com.cn/bbs/digest-d-467-36.html",
            "https://www.xcar.com.cn/bbs/viewthread.php?tid=13343812":"https://a.xcar.com.cn/bbs/thread-90930776-0.html",
            "https://club.xcar.com.cn/square/topic/182.html":"https://a.xcar.com.cn/club/square/topic/182.html",
            "https://www.xcar.com.cn/bbs/":"https://a.xcar.com.cn/bbs/life.html",
            "https://motor.xcar.com.cn/m614":"https://a.xcar.com.cn/motor/m614/",
            "https://motor.xcar.com.cn/m614":"https://a.xcar.com.cn/motor/m614/",
            "https://photo.xcar.com.cn/xview/344463":"https://a.xcar.com.cn/photo/xview/344463/",
            "https://photo.xcar.com.cn/xview/344463":"https://a.xcar.com.cn/photo/xview/344463/",
			"https://yp.xcar.com.cn/wiki/2":"https://a.xcar.com.cn/wiki/2/",
            "https://yp.xcar.com.cn/wiki/detail_1.html":"https://a.xcar.com.cn/wiki/detail_1.html",
            "https://yp.xcar.com.cn/wiki/3":"https://a.xcar.com.cn/wiki/3/",
            "https://yp.xcar.com.cn/wiki/detail_4.html":"https://a.xcar.com.cn/wiki/detail_4.html",
            "https://mall.xcar.com.cn":"https://a.xcar.com.cn/mall/",
            "https://mall.xcar.com.cn":"https://a.xcar.com.cn/mall/",
            "https://motor.xcar.com.cn/m11/config.htm":"https://a.xcar.com.cn/motor/m11/config/",
            "https://motor.xcar.com.cn/m11/config.htm":"https://a.xcar.com.cn/motor/m11/config/",
            "https://yp.xcar.com.cn/etc/index":"https://a.xcar.com.cn/tool/etc/",
            "https://yp.xcar.com.cn/etc/index":"https://a.xcar.com.cn/tool/etc/",
            "https://aikahao.xcar.com.cn/user/18034828.html":"https://a.xcar.com.cn/aikahao/author/18034828.html",
            "https://aikahao.xcar.com.cn/user/18034828.html":"https://a.xcar.com.cn/aikahao/author/18034828.html"
		};
        var $reWrite = {};
        for(var $k in $reWriteArray)
        {
            var $reKey = $k.replace(/\d+/ig, "*");
            $reWrite[$reKey] = $k;
        }
        
        
        if(! $nowUrl) $nowUrl = document.location.href;
        $nowUrl = $nowUrl.replace(/\/{0,1}\?.*$|\W$/,"");
		$nowUrl = $nowUrl.replace(/\/{0,1}\#.*$|\W$/,"");//要调整的url参数中不能有#
        var $url = $nowUrl.replace(/\d+/ig, "*");
        var _photo_ps_flag = $nowUrl.indexOf('/photo/ps') &gt; -1 ? 1 : 0;
        var _photo_m_flag = $nowUrl.indexOf('/photo/m')  &gt; -1 ? 1 : 0;
        if($reWrite[$url] || 1 == _photo_ps_flag || 1== _photo_m_flag)
        {
        	var $key = $reWrite[$url];
            var $value = $reWriteArray[$key];
			var $mNow = $nowUrl.match(/\d+/g);
			var $mModel = $key.match(/\d+/g);
			var $mJump = $value.match(/\d+/g);
			
			//如果是车型添加此判断条件才可以跳转
        	if($url == "https://newcar.xcar.com.cn/m*"){
        		return "https://a.xcar.com.cn/"+pserid+"/m"+mid+"/";
            }else if($url == "https://newcar.xcar.com.cn/*/news_*.htm"){
            	if($mNow[1] == 1){	//分类1
            		return "https://a.xcar.com.cn/"+$mNow[0]+"/article.html";
            	}else if($mNow[1] == 2){
            		return "https://a.xcar.com.cn/"+$mNow[0]+"/news.html";
            	}else if($mNow[1] == 3){
            		return "https://a.xcar.com.cn/"+$mNow[0]+"/guide.html";
            	}else if($mNow[1] == 4 || $mNow[1] == 5){
            		return "https://a.xcar.com.cn/"+$mNow[0]+"/drive.html";
            	}
            }else if($url == "https://newcar.xcar.com.cn/*/news_*_c*.htm"){
            	return "https://a.xcar.com.cn/"+$mNow[0]+"/market.html";
            }
        	
            //车系车型图片
            if( 1 == _photo_ps_flag || 1== _photo_m_flag)
            {
                var $value = $reWriteArray[$reWrite[$url.substr(0, $url.indexOf('*')+1)]].replace(/(\d+)/g,"&lt;*&gt;");
                var $_psId = $nowUrl.match(/ps\d+/g) != null ? $nowUrl.match(/ps\d+/g) : $nowUrl.match(/m\d+/g);
                var $_psId = $_psId != null ? $_psId : 0;
                var $_t = $nowUrl.match(/_\d+_/g);
                var $_c = $nowUrl.match(/_c\d+/g);
                $value = $value.replace('&lt;*&gt;', $_psId != null ? $_psId[0].match(/\d+/g) : 0);
                $value = $value.replace('&lt;*&gt;', $_t != null  ? $_t[0].match(/\d+/g) : 0);
                $value = $value.replace('&lt;*&gt;', $_c != null ? $_c[0].match(/\d+/g) : 0);
                return $value;
            }
            
			//如果选车页品牌或者国别选项被选中则保持pc端，不要向手机端跳转 keli 2014-3-13 add
			//if($key == "https://newcarcar.xcar.com.cn/car/10-7-6-5-0-0-9-0-0-0-0-0" &amp;&amp; ($mNow[4]&gt;0 || $mNow[7]&gt;0)) return ;
			//如果选车页图片最终页类型为车展图片则不要向手机端跳转 keli 2014-3-13 add
			if($key == "https://newcar.xcar.com.cn/photo/s3163_1" &amp;&amp; $mNow[1] == 8 ) return;
			if($key == "https://newcar.xcar.com.cn/photo/s2946_1/1508940.htm" &amp;&amp; $mNow[1] == 8 ) return ;
			if($key == "https://newcar.xcar.com.cn/car/10-7-6-5-0-0-9-0-0-0-0-0" || $key == "https://newcar.xcar.com.cn/car/10-7-6-5-0-0-9-0-0-0-0-0-0-0"){
				if($mNow[0] &gt; 0 || $mNow[2] &gt; 0){//不跳转的 含有 级别和变速箱
				
					return '';
				}
				var tcar = {'p':1,'c':8,'pb':5,'g':-1,'j':4,'x':2,'m':-2,'b':3,'h':7,'a':13,'t':-9,'q':14}; //-1 -2对应不上 特殊的座
				var turl = '';
				for(var key in tcar){
					if($mNow[tcar[key]-1] &amp;&amp; $mNow[tcar[key]-1] &gt; 0){
						turl = turl + key + $mNow[tcar[key]-1];
					}
				}
				if(turl != ''){
					var tcar_sort = {0:'true',1:'w2',2:'false',3:'w1'};
					if(tcar_sort[$mNow[10]] &amp;&amp; tcar_sort[$mNow[10]] != ''){
						turl += "-" + tcar_sort[$mNow[10]];
					}else{
						turl += "-true";
					}
				}else{
					return 'https://a.xcar.com.cn/newcar/';
				}
				return 'https://a.xcar.com.cn/newcar/' + turl + '/';
			}else if($mJump){
				$value = $value.replace(/(\d+)/g,"&lt;$1&gt;");
				for(var i=0;i&lt;$mJump.length;i++)
				{
					var $num = $mJump[i];
					var $i = $mModel.indexOf($num);
					if($i==-1)
					{
						return self.specialUrlRun($nowUrl);
						//需要的数据没有存在于url中
					}
					var $reNum = ($i===false) ? 0 : $mNow[$i];
					$value = $value.replace(new RegExp("&lt;"+$num+"&gt;"),$reNum);
				}
			}
            return $value;
        }
    }
    
    function tryToTouch()
    {
			if(document.location.href.indexOf('a.xcar.com.cn')&gt;-1){
				setCookie("web_version","web",3600*3,'.xcar.com.cn');
				return;
			}
            
			var jump = getCookie("web_version");
			if(jump != 'web'){
                var $url = self.getTouchUrl();
                if(! $url) return ;
				self.to($url);
            }
    }
    
    function isFromTouch()
    {
		var ua = navigator.userAgent.toLowerCase();
		var uaLower = ua.toLocaleLowerCase();
		return uaLower.match(/android|iphone|moblie/i) &amp;&amp; !uaLower.match(/pad/i)
    }
    
    function to($url)
    {
		if($url)  window.location = $url;
    }

	var self ={
		specialUrlRun:specialUrlRun,
		getTouchUrl:getTouchUrl,
		tryToTouch:tryToTouch,
		isFromTouch:isFromTouch,
		to:to
	};
	window.Jump = self;
})();
if(Jump.isFromTouch()) Jump.tryToTouch();</pre></body></html>