fd-gulp-encodingfilter
Version:
filt the assigned encoding file
138 lines (106 loc) • 3.62 kB
JavaScript
/**
* һЩȫ�ֵģ��;���ģ���صĺ������Է��ڴ�����
* @author terence.wangt
* date:2012.05.24
*/
jQuery.namespace(
'Qingguo',
'Qingguo.Business', // ҵ��ģ��
'Qingguo.Config' // �����Ͳ�������
);
!(function($) {
/**
* Events
* ģ��佻�����¼����ƶ�ͳһ��������������У����ڹ���
*/
Qingguo.Config.Events = {
CallMeInit:"callme/callMeForExternal",
BigRender:"bigrender/enableDom",
OfferAsyncOffer:"offerAsync/offerload",
OfferAsyncPage:"offerAsync/pagechange",
end:0
};
$.logger.setErrorUri("http://110.75.196.102/page/logError?appkey=767e6f01bebd2e7b4f41a2e0a04d9d78");
})(jQuery);
!(function($){
var Sandbox,
iPageConfig,
SUtil = Qingguo.Utility,
configs = {
end:0
};
function SearchPV(sb) {
Sandbox = sb;
return SearchPV;
}
$.extend(SearchPV,{
init:function(cfg){
this.config = $.extend(false, {}, configs, cfg);
iPageConfig = this.config.global ? this.config.global:window.iPageConfig;
this.ctr();
this.exposure();
var self = this;
Sandbox.on( Qingguo.Config.Events.OfferAsyncOffer,this.ctr, this);
//�첽��ҳʱ��Ҫ�ø���ģ������ȫ���ع�һ��
Sandbox.on( Qingguo.Config.Events.OfferAsyncPage, this.exposure, this);
},
/*ȫ���ع⺯��*/
exposure:function(){
var searchType = 'selloffer',searchPattern="search",searchKey='',iType='sale';
var categoryId = 0;
//window.iSearchPV����Դ��ҳ���Լ��һ��ȫ�ֱ���
if(typeof(iSearchPV) === "object"){
/*SN3.0������Ŀid�ع�������*/
var exposureStr ='_'+'{pvkey}';
var pvItems = iSearchPV.iSubject;
//�������
for(var i=0;i<pvItems.length;i++){
if(typeof(pvItems[i]) === "string" && $.trim(pvItems[i]) != ''){
SUtil.exposureClick(exposureStr.replace(/\{pvkey\}/g,pvItems[i]));
}
}
}
},
//ctr���ͳ�ƺ���
ctr:function(){
if(typeof window.coaseParam !== 'object')
return;
window.coaseParam.page_id = SUtil.getSearchPageId();
window.coaseParam.refer = escape(window.location.href);
var CTR_HREF = 'http://ctr.1688.com/ctr.html?ctr_type={ctr_type}&page_area={page_area}&page_id={page_id}&category_id={category_id}&object_type={object_type}&object_ids={object_ids}&keyword={keyword}&page_size={page_size}&page_no={page_no}&refer={refer}',
object_type = 'offer';
if(window.coaseParam.fnType=='company') object_type = 'company';
if (window.coaseParam.object_ids&&window.coaseParam.object_ids != "") {
var param = $.extend(true, {}, {
'object_type':object_type,
'ctr_type':'2',
'page_area':'1',
'object_ids':window.coaseParam.object_ids
},window.coaseParam);
var s = $.util.substitute(CTR_HREF,param);
stat(s);
}
if(window.coaseParam.gold_ad_ids&&window.coaseParam.gold_ad_ids!=""){
var paramGold = $.extend(true, {}, {
'page_area':3,
'object_ids':window.coaseParam.gold_ad_ids,
'ctr_type':2,
'object_type':'company',
'page_size':'',
'page_no':''
},window.coaseParam);
var s = $.util.substitute(CTR_HREF,paramGold);
stat(s);
}
function stat(s){
var d = new Date().getTime();
if(document.images){
(new Image()).src = s+"&time="+d;
}
}
},
end:0
});
Qingguo.Business.SearchPV = SearchPV;
AppCore.register("sw_mod_searchpv", Qingguo.Business.SearchPV);
})(jQuery);