Authored by microTT

首页自动加载传值增加

... ... @@ -436,10 +436,6 @@ define('channel', function(require, exports) {
}
}).init();
var ajaxCount = 0;
/**
* 通过ajax获取更多信息并渲染
* @param {Object} ajaxOption Ajax配置
... ... @@ -524,7 +520,7 @@ define('channel', function(require, exports) {
text += $.trim(childNodes[i].nodeValue);
} else if (childNodes[i].nodeType === 1) {
elemName = childNodes[i].nodeName.toUpperCase();
if (elemName.indexOf(searchElem) > -1){
if (elemName.indexOf(searchElem) > -1) {
text += method.searchTextNode(childNodes[i], text, maxLen);
}
}
... ... @@ -735,9 +731,7 @@ define('channel', function(require, exports) {
return;
}
ajaxOption.data = {
type: status.loadCount
}
ajaxOption.data.type = status.loadCount;
getMoreData(ajaxOption, domOption, template, callback);
... ... @@ -754,6 +748,18 @@ define('channel', function(require, exports) {
ajaxOption: {
url: "/default/LoadNews",
type: "post",
data: {
page: (function() {
var pathname = window.location.pathname.split("/");
pos = Array.prototype.indexOf.call(pathname, "page") + 1;
if (pos < 1) {
return 1;
} else {
return pathname[pos];
}
}())
}
},
domOption: {
... ...
... ... @@ -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");
... ...