UNPKG

fd-gulp-convert-encoding

Version:

convert file to assigned charset

78 lines (58 loc) 1.95 kB
/** * 评价 组件 */ define('detail.modules.offerRemark.View', ['jQuery', 'Class','detail.core.Wing','detail.core.Event'], function($, Class,Wing,Event) { return Class({ init: function(view, config) { this.onEvent = $.os.supportsTouch ? 'tap' : 'click'; this.div = view; this.config = config; this.bindEvent(); this.getRemarkList(); this.initImpression(); }, //事件绑定 bindEvent:function(){ var self = this; this.div.on(this.onEvent,'div.satisfaction',function(){ $(this).toggleClass('showmore'); }).on(this.onEvent,'div.level-filter li',function(){ var level = $(this).data('level')-0; $(this).parent().find('li').removeClass('curr'); $(this).addClass('curr'); self.getRemarkList({"starLevel":level}); Event.trigger('refreshScroll');//触发Scroll刷新 }); }, //获取评价列表 getRemarkList:function(data){ var params ={ "receiveUserId":this.config.userId-0, "starLevel":0, "itemId":this.config.offerId-0, "bizType":"trade", "page":1, "pageSize":5 }; $.extend(params,data); Wing.load('offerRemarkList', { data: params }).done(function(elm, next) { $('#remark-list-container').html('').append(elm); next(); }); }, //初始化印象列表 initImpression:function(){ var impression = $('div.buyer-impression li',this.div), width; for (var i = 0; i < impression.length; i++) { width = impression.eq(i).data('percent'); impression.eq(i).css('width',width+'%'); }; }, end:0 }); });