...
|
...
|
@@ -420,7 +420,6 @@ define('yohood', function(require, exports) { |
|
|
// }
|
|
|
|
|
|
//所有品牌
|
|
|
console.log($(".all_brand"));
|
|
|
$(".all_brand").on("click", function() {
|
|
|
$("input[type=text]").val("");
|
|
|
$(".search-btn").click();
|
...
|
...
|
@@ -450,6 +449,32 @@ define('yohood', function(require, exports) { |
|
|
}
|
|
|
return s;
|
|
|
}
|
|
|
|
|
|
({
|
|
|
brandSort: function(brands, sortBase) {
|
|
|
var brandName = "",
|
|
|
i = 0,
|
|
|
len = 0;
|
|
|
|
|
|
if (brands === null || brands === undefined) {
|
|
|
return brands;
|
|
|
}
|
|
|
if (typeof sortBase !== "string" || sortBase === "") {
|
|
|
return brands;
|
|
|
}
|
|
|
|
|
|
for (i = 0, len = brands.length; i < len; i++) {
|
|
|
brandName = brands[i].name;
|
|
|
console.log(brand[i]);
|
|
|
if (brandName.indexOf(sortBase) === 0) {
|
|
|
brands.splice(i, 1).concat(brands);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return brands;
|
|
|
},
|
|
|
init: function() {
|
|
|
var that = this;
|
|
|
//搜素品牌
|
|
|
$('.search-wrap').find('input').on('keyup', function() {
|
|
|
$(".search-btn").trigger("click.search");
|
...
|
...
|
@@ -468,6 +493,7 @@ define('yohood', function(require, exports) { |
|
|
success: function(data) {
|
|
|
var brands = data.data;
|
|
|
if (data.code == 200 && brands != "") {
|
|
|
// brands = that.brandSort(brands, brand);
|
|
|
$.each(brands, function(k, v) {
|
|
|
html += '<li><a href="javascript:;" target="_blank" title="' + v.name + '"><div class="img-box" brand_id="' + v.id + '">' +
|
|
|
'<img class="grey-brand-logo" width="145" height="97" src="' + common.getImages(v.logo, 'source', 'blogimg', 'primary') + '" alt="" alt="' + v.name + '"></div>' +
|
...
|
...
|
@@ -486,6 +512,13 @@ define('yohood', function(require, exports) { |
|
|
}
|
|
|
});
|
|
|
});
|
|
|
|
|
|
console.log(1);
|
|
|
|
|
|
}
|
|
|
}).init();
|
|
|
|
|
|
|
|
|
//品牌列表
|
|
|
$(".brand-list li .img-box").live("click", function(event) {
|
|
|
var brand_id = $(this).attr("brand_id");
|
...
|
...
|
|