Beispiel #1
0
 renderOne: function(name, data, odd) {
     return template(this.tpl, {
         data: data,
         name: name,
         odd: odd
     });
 },
Beispiel #2
0
 renderUi: function(res) {
     res = JSON.parse(res);
     var me = this;
     if (res.errno == 0) {
         var data = res.data;
         this.cacheData(data);
         var html = template(me.tpl, {
             data: data
         });
         this.$wrap.html(html);
         $(".newadd-count").html("最新上架" + data.length + "款");
         //触发cache到全局
         this.getCache(this._getCache());
     }
 },
Beispiel #3
0
 renderUi: function(res) {
     var me = this;
     var body = this.body;
     if (!$.isEmptyObject(res)) {
         for (var type in res) {
             var data = res[type];
             var html = [];
             $.each(data, function(i, item) {
                 if ((i + 1) % 3 == 0) {
                     item["hideBorder"] = true;
                 }
                 if (item.app_summary) {
                     item.app_summary = subbyte.subByte(item.app_summary, 56);
                 }
             });
             var _html = template(me.tpl, {
                 data: data
             });
             body[type].html(_html);
         }
         this.bindEvt();
     }
 },