...
|
...
|
@@ -17,6 +17,8 @@ var seckillObj = {}; |
|
|
lazyload('img.lazy');
|
|
|
seckillObj = {
|
|
|
$productList: null, // DOMContentLoaded的时候 赋值,即init
|
|
|
pageTemplate: require('product/seckill/index.hbs'),
|
|
|
listTemplate: require('product/product-list.hbs'),
|
|
|
|
|
|
el: {
|
|
|
// doms
|
...
|
...
|
@@ -36,25 +38,29 @@ seckillObj = { |
|
|
* [初始化界面]
|
|
|
*/
|
|
|
init: function() {
|
|
|
var $el = this.el, that = this;
|
|
|
var focus = $el.$navUl.find('>li.focus');
|
|
|
this.pageLoad()
|
|
|
.then(function() {
|
|
|
console.log('hi')
|
|
|
var $el = this.el, that = this;
|
|
|
var focus = $el.$navUl.find('>li.focus');
|
|
|
|
|
|
this.$productList = $('.product-list');
|
|
|
$el.$navUl.find('>li').click(function() {
|
|
|
that.selectTime(this);
|
|
|
});
|
|
|
|
|
|
this.$productList = $('.product-list');
|
|
|
$el.$navUl.find('>li').click(function() {
|
|
|
that.selectTime(this);
|
|
|
});
|
|
|
$(window).resize(function() {
|
|
|
that.initNav();
|
|
|
});
|
|
|
|
|
|
$(window).resize(function() {
|
|
|
that.initNav();
|
|
|
});
|
|
|
that.initNav();
|
|
|
|
|
|
that.initNav();
|
|
|
|
|
|
if (focus.length && (focus.hasClass('now') || focus.hasClass('wait'))) {
|
|
|
that.initTick($el.$navUl.find('>li.focus'));
|
|
|
}
|
|
|
if (focus.length && (focus.hasClass('now') || focus.hasClass('wait'))) {
|
|
|
that.initTick($el.$navUl.find('>li.focus'));
|
|
|
}
|
|
|
|
|
|
this.bindEvents();
|
|
|
this.bindEvents();
|
|
|
});
|
|
|
},
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -344,6 +350,20 @@ seckillObj = { |
|
|
yoho.invokeMethod(action, params, onsuccess, function() {
|
|
|
tip.show(failTip);
|
|
|
});
|
|
|
},
|
|
|
|
|
|
pageLoad: function() {
|
|
|
loading.show();
|
|
|
return $.get('/product/seckill')
|
|
|
.done(function(result) {
|
|
|
console.log(result);
|
|
|
})
|
|
|
.error(function() {
|
|
|
console.log('TODO');
|
|
|
})
|
|
|
.always(function() {
|
|
|
loading.hide();
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
|
...
|
...
|
|