fd-gulp-convert-encoding
Version:
convert file to assigned charset
104 lines (84 loc) • 3.02 kB
JavaScript
define('detail.pages.index.View',
['jQuery', 'Class', 'lofty.ui.Swipe', 'detail.core.Wing'],
function($, Class, Swipe, Wing) {
return Class({
init: function(view, config) {
this.onEvent = $.os.supportsTouch ? 'tap' : 'click';
this.div = view;
this.config = config;
this.initSwipe();
// this._initTracelog();
},
initSwipe: function(){
var $swipeFeature = $('#d-swipe-feature', this.div),
swipeFeature,
that = this;
swipeFeature = new Swipe({
tpl: '#d-swipe-feature',
pane: '.widget-custom',
// startSlide: 1,
auto: 0,
callback: function(index, elm){
that._triggerTabEvent(index);
}
});
},
_triggerTabEvent: function(index){
var $regionFeature = $('div.region-detail-mobile-feature', this.div),
$widgets = $('div.widget-custom-container', $regionFeature),
module = '', id = '', params= {};
switch(index){
case 1:
module = 'offerRemark';
params ={
"receiveUserId":"2057366640",
"starLevel":"",
"itemId":this.config.offerId,
"bizType":"trade",
"page":"1",
"pageSize":"10"
}
break;
case 2:
module = 'commendOffer';
params = {
'recid': this.config.recid,
'offerids': this.config.offerId,
'memberid': this.config.memberId,
'uid': this.config.uid || '',
'catids': this.config.catids || '',
'pageid': this.config.pageid || ''
}
break;
default:
// dosomething
}
if (!module){
return;
}
id = module.replace(/([a-z])([A-Z])/g, function(s, m1, m2) {
return m1 + '-' + m2;
}).toLowerCase();
module = 'modules/' + module;
if ($('div.m-detail-' + id).length){
return;
}
Wing.load(module, {
data: params
}).done(function(elm, next) {
$widgets.eq(index).append(elm);
next();
});
},
_initTracelog: function(){
var offerId = this.config.offerId;
var tPC = Wing.navigator.uthandler.pageCreate('Page_Detail_' + offerId);
var tPE = Wing.navigator.uthandler.pageEnter('Page_Detail_' + offerId);
this.div.on(this.onEvent, '[data-trace]', function(){
var elm = $(this),
tl = elm.data('trace');
Wing.navigator.uthandler.btnClick('m.offer.detail.' + tl);
});
}
});
});