goods-sort.js
1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
var $ = require('jquery'),
common = require('../../common/common');
var searchSortList = window.NETSALEDATA.searchSortList;
for(var i = 0; i < searchSortList.length; i++) {
if(searchSortList[i].modelId == 1)
$("#brand-sort").val(searchSortList[i].intValue);
else if(searchSortList[i].modelId == 2)
$("#aolai-sort").val(searchSortList[i].intValue);
else if(searchSortList[i].modelId == 3)
$("#search-sort").val(searchSortList[i].intValue);
}
$('#sort-save').on('click', function () {
var item = window.NETSALEDATA.searchSortList;
console.log(item);
for(var i = 0; i < searchSortList.length; i++) {
if(searchSortList[i].modelId == 1)
searchSortList[i].intValue = $("#brand-sort").val();
else if(searchSortList[i].modelId == 2)
searchSortList[i].intValue = $("#aolai-sort").val();
else if(searchSortList[i].modelId == 3)
searchSortList[i].intValue = $("#search-sort").val();
}
common.util.__ajax({
url:'/netSale/saveSearchSort',
data:{"searchSortList":searchSortList}
},function() {
});
});