(function(){
if(!window.$){
return;
}
(function() {
var _version_ = "20170215";
var CreateBinder = function(o) {
return function(method, func) {
o[method] = function() {
return func.apply(o, arguments);
};
return func;
};
},
IsArray = function(o) {
return Object.prototype["toString"].call(Object(o)) == "[object Array]";
},
IsEmpty = function(o) {
return ((undefined == o) || ("-" == o) || ("" == o));
},
Encode = function(uri, isAll) {
var _encode = encodeURIComponent;
if (_encode instanceof Function) {
return isAll ? encodeURI(uri) : encodeURIComponent(uri);
} else {
return escape(uri);
}
};
var Tracker = function(name) {
var oThis = this,
bind = CreateBinder(oThis),
config = new Config();
oThis.name = name;
oThis.ahAjax = new AHAjax();
oThis.getSign = function() {
if (IsEmpty(window.pageLoadId)) {
return "noloadid";
}
return [window.pageLoadId.substring(2, 10) >> 3, Math.random().toString().substring(2, 5)].join("");
};
oThis.getNessInfo = function() {
return "ahpvers=" + _version_ + "&ahpplid=" + window.pageLoadId + "&ahpprlid=" + window.rPageLoadId + "&ahpsign=" + oThis.getSign();
};
oThis.getPageInfo = function() {
var scene_type = oThis.ahUtil.parseUri(window.location)['queryKey']["scene_type"] || "0";
var show_id = oThis.ahUtil.parseUri(window.location)['queryKey']["show_id"] || "0";
return "&ref=" + Encode(document.referrer) + "&cur=" + Encode(document.URL) + "&scene_type=" + scene_type + "&show_id=" + show_id;
};
oThis.getRefAndCur = function() {
return "&ref=" + Encode(document.referrer) + "&cur=" + Encode(document.URL);
};
oThis.getSiteInfo = function() {
if (!IsEmpty(window.pvTrack)) {
var t = window.pvTrack;
return (t.site != null ? "&site=" + t.site : "") +
(t.category != null ? "&category=" + t.category : "") +
(t.subcategory != null ? "&subcategory=" + t.subcategory : "") +
(t.object != null ? "&object=" + t.object : (t.objectid != null ? "&object=" + t.objectid : ""));
}
return "";
};
oThis.trackerEvent = bind("_trackEvent", function() {
var _arguments = arguments;
var _category = arguments[0];
var _params = arguments[1];
var eventPath = _category + "?" + oThis.getNessInfo() + oThis.getSiteInfo();
if (!IsEmpty(_params)) {
for (var _key in _params) {
eventPath += "&" + _key + "=" + _params[_key];
}
}
eventPath += oThis.getRefAndCur();
oThis.ahAjax.sendByImage(config.alPath + eventPath);
});
};
var AHAjax = function() {
var oThis = this;
oThis.sendByImage = function(src) {
var image = new Image(1, 1);
image.onload = image.onerror = function() {
image.onload = image.onerror = null;
image = null;
};
image.src = src;
};
};
var Config = function() {
var oThis = this;
oThis.alPath = "//al.autohome.com.cn/";
};
var AsyncTrackerFactory = function() {
var oThis = this,
bind = CreateBinder(oThis);
oThis.defaultTracker = new Tracker("default");
oThis.push = function(commandArray) {
for (var _arguments = arguments, err = 0, i = 0; i < _arguments.length; i++) {
try {
if (typeof _arguments[i] === "function") {
_arguments[i]();
} else {
var o = _arguments[i][0],
func = o;
var oTracker = oThis.defaultTracker;
oTracker[func].apply(oTracker, _arguments[i].slice(1));
};
} catch (ex) {
err++;
}
}
return err;
};
};
var _AsyncTrackerFactory = new AsyncTrackerFactory;
_tracker_: {
var ahas = window._simple_ahas,
isArray = false;
if (ahas && typeof ahas["push"] == "function") {
isArray = IsArray(ahas);
if (!isArray) {
break _tracker_;
}
}
window._simple_ahas = _AsyncTrackerFactory;
isArray && _AsyncTrackerFactory["push"].apply(_AsyncTrackerFactory, ahas);
}
})();
function isEleShow(ele){
if( $(ele).length>0 && $(ele).height()>0 ){
return true
};
return false
};
var _isSharePage = (typeof pvTrack) == 'object' && pvTrack.site == 1211173;
var _isPlatform = (function(){
var ua = navigator.userAgent.toLowerCase(),_referrer = document.referrer.toLowerCase();;
return {
mobile: !!ua.match(/AppleWebKit.*Mobile.*/), //???????
ios: !!ua.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios??
android: ua.indexOf('Android') > -1 || ua.indexOf('Adr') > -1,
isHuaweiBrowser:ua.indexOf('huawei')>-1,
isQQBrowser:ua.indexOf('mqqbrowser')>-1,
isBaiDuApp:ua.indexOf('baiduboxapp')>-1,
isAppSearch:ua.indexOf('appsearch')>-1,
isQuickApp:ua.indexOf('com.autohome.quickapp') > -1,
isFromBaiduSearch:(function(){
if( _referrer.indexOf('baidu')>-1){
$.setCookie('isFromBaiDuSearch','1', { domain: 'autohome.com.cn', expireHours: 12 });
return true;
}else if( !(_referrer.indexOf('autohome') > -1 || _referrer.indexOf('che168') > -1) ){
$.setCookie('isFromBaiDuSearch','', { domain: 'autohome.com.cn', expireHours: 0 });
return false;
}else{
if( $.getCookie('isFromBaiDuSearch', '') || _referrer.indexOf('//www.autohome.com.cn')>-1 ){
return true;
};
return false;
};
})(),
isFromQQSearch:(function(){
if( _referrer.indexOf('soso.com')>-1){
$.setCookie('isFromQQSearch','1', { domain: 'autohome.com.cn', expireHours: 12 });
return true;
}else if( !(_referrer.indexOf('autohome') > -1 || _referrer.indexOf('che168') > -1) ){
$.setCookie('isFromQQSearch','', { domain: 'autohome.com.cn', expireHours: 0 });
return false;
}else{
if( $.getCookie('isFromQQSearch', '') || _referrer.indexOf('//www.autohome.com.cn')>-1 ){
return true;
};
return false;
};
})()
}
})();
function loadJS(url, callback, loadCondition) {
if(loadCondition){
callback()
return;
}
var script = document.createElement("script");
script.id = url;
script.src = url;
script.onload = function() {
callback()
};
script.onerror = function(){
document.body.removeChild(script)
}
document.body.appendChild(script)
};
function getUrlParam(localUrl) {
var url = localUrl || window.location.search
var urlQuest = {};
if (url.indexOf('?') != -1) {
var str = url.substr(url.indexOf('?') + 1)
var arrStr = str.split('&')
for (var i = 0; i < arrStr.length; i++) {
urlQuest[arrStr[i].split('=')[0]] = decodeURIComponent(arrStr[i].split('=')[1])
}
}
return urlQuest
}
var callApp = null,
layerDate = '{"recommendid":0,"rchannelid":75,"rorderid":75,"randroidappname":"????","randroidapphref":"https://www.athmapp.com/downapp/m_zb_1_a/","randroidappimg":"[{\u0027src\u0027:\u0027//app2.autoimg.cn/appdfs/g13/M00/48/23/autohomecar__ChxkrmDdkHSAM6wtAAEDc2uWtLs659.png\u0027}]","riphoneappname":"????","riphoneapphref":"https://itunes.apple.com/cn/app/qi-che-zhi-jia/id385919493?mt\u003d8","riphoneappimg":"[{\u0027src\u0027:\u0027//app2.autoimg.cn/appdfs/g13/M00/48/23/autohomecar__ChxkrmDdkHSAM6wtAAEDc2uWtLs659.png\u0027}]","randroidappcomment":"{title:\u0027?????App\u0027,info:\u0027????????\u0026gt;\u0026gt;\u0027}","riphoneappcomment":"{title:\u0027?????App\u0027,info:\u0027????????\u0026gt;\u0026gt;\u0027}","randroidappcomment2":"0","riphoneappcomment2":"0","riphoneapptype":1,"randroidapptype":1,"randroidappcomment3":"????","riphoneappcomment3":"????","randroidwxhref":"{YybPackage:\u0027com.cubic.autohome\u0027,YybCkey:\u0027CK1369845954527\u0027}","riphonewxhref":"{YybPackage:\u0027com.cubic.autohome\u0027,YybCkey:\u0027CK1369845954527\u0027}","randroideid":"","riphoneeid":""}',
_SchemeKey = "3243468",
_Scheme = "";
if(layerDate){
layerDate = JSON.parse(layerDate);
}else{
return;
};
var openScheme = window[_SchemeKey] ? decodeURIComponent(window[_SchemeKey]) : (_Scheme ? decodeURIComponent(_Scheme) : 'autohome://apphomepage?src=m_index');
var openSchemeConfig = (layerDate.randroideid || layerDate.riphoneeid) ? (layerDate.randroideid || layerDate.riphoneeid) : ''
var wxYingYongBaoConfig = {}
if(layerDate.randroidwxhref || layerDate.riphonewxhref){
var wxhref = layerDate.randroidwxhref || layerDate.riphonewxhref;
if( wxhref.indexOf('YybCkey')>-1 && wxhref.indexOf('YybPackage')>-1){
try {
var wxDownConfig = eval('(' + wxhref + ')')
wxYingYongBaoConfig.YybCkey = wxDownConfig.YybCkey
wxYingYongBaoConfig.YybPackage = wxDownConfig.YybPackage
} catch(e) {
console.log(e);
}
}
}
var URLScheme = openSchemeConfig ? openSchemeConfig : openScheme
var schemeParams = getUrlParam(URLScheme)
loadJS('https://activity.app.autohome.com.cn/static/autocallapp/main-v2.0.0.js',function(){
callApp = new window.AutoCallApp({
AdrDown:layerDate.randroidapphref,
IosDown:layerDate.riphoneapphref,
URLScheme:URLScheme,
YybCkey:wxYingYongBaoConfig.YybCkey ? wxYingYongBaoConfig.YybCkey : "CK1369851686066",
YybPackage:wxYingYongBaoConfig.YybPackage ? wxYingYongBaoConfig.YybPackage : "com.cubic.autohome",
openDpLink: URLScheme.indexOf('autohome://') === 0 ? 1 : 0,
platform: schemeParams.sharefrom ? schemeParams.sharefrom : '',
businessType: schemeParams.sharesource ? schemeParams.sharesource : '',
e_position:'2_1_1'
})
},window.AutoCallApp)
var MySlide = function(el,opt){
this.$element = el,
this.$eparnet = el.parent();
//????
this.defaults = {
/*???*/
childTag:'div',
/*?????????1??*/
startIndex:1,
/*?????*/
viewWidth:window.innerWidth,
/*?????????ms?;*/
dur:800,
/*??????*/
prog:false,
/*????*/
loop:true,
/*??????(??????????ture)*/
autoplay:{play:false,time:1000},
/*???(????/????)*/
process:{show:false,processBox:null},
/*????*/
curIndex:0
};
this.options = $.extend({},this.defaults,opt);
this.run();
};
MySlide.prototype = {
init:function(){
var _this = this;
/*??cur*/
this.curIndex = 0;
/*????*/
if(_this.options.viewWidth == window.innerWidth){
var t;
$(window).on('resize',function(){
clearTimeout(t);
t = setTimeout(function(){_this.options.viewWidth = window.innerWidth;},100)
})
};
if(this.options.loop){
var frist = this.$element.children(this.options.childTag+':first-child');
var last = this.$element.children(this.options.childTag+':last-child');
var clonefirst = frist.clone(),cloneLast = last.clone();
/*????????*/
this.$element.append(clonefirst);
this.$element.prepend(cloneLast);
this.curIndex = this.options.startIndex - 1;
}else{
this.options.startIndex --;
this.curIndex = this.options.startIndex;
};
var posiX = this.options.viewWidth*this.options.startIndex;
this.startPosiX(posiX);
this.oX = {
startX:0,
endX:0,
disX:0
};
this.cantouch = true;
this.len = this.$element.children(this.options.childTag).length;
if(this.options.process.show){
this.createProcess();
this.processCur(this.curIndex)
};
},
startPosiX:function(posiX){
this.$element.css({
"transform":"translate3d("+(-posiX)+"px, 0px, 0px)",
"-webkit-transform":"translate3d("+(-posiX)+"px, 0px, 0px)",
"transition-duration":"0ms",
"-webkit-transition-duration":"0ms"
});
},
startFn:function(e){
var _this = this;
window.clearInterval(_this.mytimer);
window.clearTimeout(_this._t);
if(this.cantouch){
var touchs = e.changedTouches[0] || touches[0];
this.oX.startX = touchs.pageX;
e.stopPropagation();
$(this.$element).on('touchmove.mymove',function(e){
_this.moveFn(e);
e.stopPropagation();
});
};
},
moveFn:function(e){
if(this.cantouch){
var _this = this;
var touchs = e.changedTouches[0] || touches[0];
this.oX.endX = touchs.pageX;
this.oX.disX = this.oX.endX - this.oX.startX;
if(this.options.loop){
if(this.options.startIndex == 0){
this.options.startIndex = this.len - 2;
}else if(this.options.startIndex == this.len -1 ){
this.options.startIndex = 1;
};
}
this.animateFn(-this.options.startIndex*this.options.viewWidth+this.oX.disX,0);
}
e.stopPropagation();
e.preventDefault();
},
endFn:function(e){
if(this.cantouch){
var goX = -this.options.startIndex*this.options.viewWidth;
if(Math.abs(this.oX.disX)>=parseInt(this.options.viewWidth/8)){
if(this.options.loop){
if(this.oX.disX>0){
this.options.startIndex--;
if(this.options.startIndex <= 0){
this.curIndex = this.len - 3;
}else{
this.curIndex = this.options.startIndex - 1;
};
}else{
this.options.startIndex++;
if(this.options.startIndex<=this.len - 2){
this.curIndex = this.options.startIndex - 1;
}else{
this.curIndex = 0;
}
}
if(this.options.process.show){
this.processCur(this.curIndex);
}
}else{
if((this.options.startIndex == 0 && this.oX.disX > 0) || (this.options.startIndex == this.len-1 && this.oX.disX < 0)){
/*???*/
}else{
if(this.oX.disX>0){
this.options.startIndex--;
}else{
this.options.startIndex++;
}
this.curIndex = this.options.startIndex;
}
if(_this.options.process.show){
_this.processCur(_this.curIndex);
}
}
this.oX.disX = 0;
}
goX = -this.options.startIndex*this.options.viewWidth;
this.animateFn(goX,this.options.dur);
var _this = this;
if(this.options.loop == true && this.options.autoplay.play == true){
this._t = setTimeout(function(){
_this.mytimer = _this.timer();
},_this.options.autoplay.time+_this.options.dur)
}
};
$(this.$element).off('touchmove.mymove');
},
animateFn:function(value,time){
this.$element.css({
"transform":"translate3d("+value+"px, 0px, 0px)",
"-webkit-transform":"translate3d("+value+"px, 0px, 0px)",
"transition-duration":time+'ms',
"-webkit-transition-duration":time+'ms'
})
},
timer:function(){
var _this = this;
var goX = 0;
return window.setInterval(function(){
/*??????????*/
_this.cantouch = false;
setTimeout(function(){
_this.cantouch = true;
},_this.options.dur+100);
_this.options.startIndex++;
if(_this.options.startIndex == _this.len -1 ){
_this.options.startIndex = 1;
_this.animateFn(0,0);
};
if(_this.options.startIndex == _this.len){
_this.animateFn(-_this.options.viewWidth,0);
_this.options.startIndex = 2;
};
_this.curIndex = _this.options.startIndex - 1;
goX = -_this.options.startIndex*_this.options.viewWidth;
setTimeout(function(){
_this.animateFn(goX,_this.options.dur);
if(_this.options.process.show){
_this.processCur(_this.curIndex);
}
},100);
},_this.options.autoplay.time);
},
createProcess:function(){
var eleNum = this.options.loop?this.len-2:this.len;
var str = "";
for(var i=0;i < eleNum;i++){
str+=""
}
$(this.options.process.processBox).append(str);
},
processCur:function(idx){
$(this.options.process.processBox).find('span').eq(idx).addClass('cur').siblings().removeClass('cur');
},
run:function(){
var _this = this;
this.init();
this.$eparnet.on('touchstart',function(e){
_this.startFn(e);
});
this.$eparnet.on('touchend',function(e){
_this.endFn(e);
});
if(this.options.loop == true && this.options.autoplay.play == true){
this.mytimer = this.timer();
}
}
};
$.fn.myslide = function(options){
var _this = $(this);
var slide = new MySlide(_this,options);
};
function _tj(_tag,name,type){
type = type || 1;
var _mark = _isPlatform.ios ? 'auto_ios' : 'auto_android'
if(type==1){
setTimeout(function(){
var isShow = isEleShow(_tag);
if(isShow){
window._simple_ahas = window._simple_ahas || [];
window._simple_ahas.push(['_trackEvent','mda_app_downbox_show',{'mark':_mark,'type':name,'extends':'1'}]);
};
},4000);
}else{
window._simple_ahas = window._simple_ahas || [];
window._simple_ahas.push(['_trackEvent','mda_app_downbox_show',{'mark':_mark,'type':name,'extends':'2'}]);
}
}
var GlobalClassList = [],AutoClassMaped={};
var createClass = function(len){
len = len || (Math.floor(Math.random()*10) + 6);
var $str = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz123456789';
var max = $str.length;
var classname = '',s;
for (i = 0; i < len; i++) {
var _str = $str.charAt(Math.floor(Math.random() * max));
if(i==0 && !isNaN(_str)){
i--;
}else{
classname += _str;
};
};
if(GlobalClassList.indexOf(classname)==-1){
GlobalClassList.push(classname);
return classname;
}else{
return createClass();
};
};
function insert(config){
function InserAd(config){
this.loca = $(config.l).eq(0);
this.e = $(config.e);
this.w = config.w;
this.s = config.s;
this.classname = this.classname ? this.classname + ' ' + this.createClassName() : this.createClassName();
};
InserAd.prototype.init = function(){
if(!this.loca.length){
return false;
};
return this.insertEle();
};
InserAd.prototype.createClassName = createClass;
InserAd.prototype.createStyle = function(){
var that = this;
if(!this.s){
return;
};
var reg = new RegExp("_myTag","g");
this.s = (this.s).replace(reg,'.' + that.classname);
var style = document.createElement("style");
style.type = "text/css";
style.appendChild(document.createTextNode(that.s));
var head = document.getElementsByTagName("head")[0];
head.appendChild(style);
return true;
};
InserAd.prototype.insertEle = function(){
var that = this;
this.createStyle();
if(!this.e){
return false;
};
this.e.addClass(this.classname);
switch(that.w){
case 'append':
this.loca.append(that.e);
break;
case 'prepend':
this.loca.prepend(that.e);
break;
case 'after':
this.loca.after(that.e);
break;
case 'before':
this.loca.before(that.e);
break;
};
return that.e;
};
var ins = new InserAd(config);
return ins.init();
};
(function(){
if(_isPlatform.isQQBrowser && _isPlatform.ios){
return;
};
if(typeof pvTrack != 'object'){
return;
};
var findCar=null;
if( pvTrack.subcategory == 3282 && pvTrack.category == 572 && pvTrack.site == 1211002){
var _mystyle = "_myTag{height:55px;background-color:#FFF;overflow:hidden;padding:5px 10px 5px 20px;box-sizing:border-box;-webkit-box-sizing:border-box;margin-top:8px;} _myTag>div{padding:0 70px 0 50px;position:relative;height:45px;} _myTag>div>img{position: absolute;width: 45px;height:45px;left:0;top:0;}_myTag>div>p{font-size: 14px;color: #1B1B1B;line-height: 45px;height: 45px;overflow: hidden;text-overflow: ellipsis;-webkit-text-overflow: ellipsis;white-space:nowrap;}_myTag>div>a{ position: absolute;width: 68px;height: 28px;border-radius: 14px;-webkit-border-radius: 14px;text-align: center;line-height: 28px;font-size: 12px;color: #FFF;background: #2873FF;right:0;top:8px;}";
findCar = insert({
l:'#div_ListBrand',
e:' ?App,????????
'+txtArr[i].info+'
' } }else{ return; } if(!imgArr[i].type){ if(i==0){ islink = imgArr[i].link ? imgArr[i].link : ''; _h += '