Authored by weiqingting

自动获取品牌

... ... @@ -412,7 +412,11 @@ var goodsgird = new common.grid({
if (common.util.__input('endPrice')) {
endPrice = common.util.__input('endPrice')
}
return {
return {//status=1&sales=Y&stocknumber=1&attribute_not=2
status:1,
sales:"Y",
stocknumber:"1",
attribute_not:"2",
query: common.util.__input('skns'),
price: beginPrice + "," + endPrice
};
... ... @@ -656,6 +660,19 @@ $(document).on("change", "#maxSortId", function () {
});
});
var Unique = function(Array) {
var res = [], hash = {};
for(var i=0, elem; (elem = Array[i]) != null; i++) {
if (!hash[elem.id])
{
res.push(elem);
hash[elem.id] = true;
}
}
return res;
}
$(document).on("click", "#brandAutoBtn", function () {
var product_skc = [];
Bll.contentDatas.forEach(function (item, index) {
... ... @@ -700,7 +717,9 @@ $(document).on("click", "#brandAutoBtn", function () {
b.push(map[item]);
}
});
Bll.Brdata = (ViewModel.brandList || []).concat(b);
Bll.Brdata = (Bll.Brdata||ViewModel.brandList || []).concat(b);
Bll.Brdata=Unique(Bll.Brdata);
// Bll.Brdata=Bll.Brdata.unique5()
// var map2={};
// Bll.Brdata.forEach(function(item){
// map2[item.id]=item;
... ...