...
|
...
|
@@ -2,12 +2,15 @@ |
|
|
var $ = require('yoho-jquery');
|
|
|
var common = require('../common');
|
|
|
|
|
|
var query = common.queryString();
|
|
|
|
|
|
var YohoListPage = {
|
|
|
rootDoc: $('.yoho-product-list'),
|
|
|
brandsDoc: $('.yoho-product-list .brand-list'),
|
|
|
mulitBrand: false,
|
|
|
goodsWrapper: $('.goods-area .goods-wrapper'),
|
|
|
goodsWrapperState: false,
|
|
|
page: query.page || 1,
|
|
|
init: function() {
|
|
|
require('yoho-jquery-accordion');
|
|
|
require('../plugins/check');
|
...
|
...
|
@@ -135,6 +138,47 @@ var YohoListPage = { |
|
|
|
|
|
YohoListPage.go(data);
|
|
|
});
|
|
|
|
|
|
$('.order-area .page').click(function() {
|
|
|
if (!$(this).hasClass('disable')) {
|
|
|
if ($(this).hasClass('page-pre')) {
|
|
|
YohoListPage.go({
|
|
|
page: YohoListPage.page - 1
|
|
|
});
|
|
|
} else {
|
|
|
YohoListPage.go({
|
|
|
page: YohoListPage.page + 1
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
$('.order-area .order').click(function() {
|
|
|
var order = $(this).data('order');
|
|
|
var target = $(this).data('target');
|
|
|
var orders = order.split(',');
|
|
|
var newOrder = '';
|
|
|
|
|
|
if (query.order === orders[0]) {
|
|
|
newOrder = orders[1] || '';
|
|
|
} else {
|
|
|
newOrder = orders[0];
|
|
|
}
|
|
|
|
|
|
$('.order-area .order').removeClass('selected');
|
|
|
$(this).addClass('selected');
|
|
|
$('.' + target).find('.iconfont').each(function() {
|
|
|
if ($(this).hasClass(newOrder)) {
|
|
|
$(this).addClass('selected');
|
|
|
} else {
|
|
|
$(this).removeClass('selected');
|
|
|
}
|
|
|
});
|
|
|
|
|
|
YohoListPage.go({
|
|
|
order: newOrder
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
openBrandMulitChoose: function() {
|
|
|
$('.yoho-product-list .mulit-choose').hide();
|
...
|
...
|
|