goods-sort.js 1.01 KB
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() {
		
	});

			
});