...
|
...
|
@@ -21,6 +21,7 @@ var urlObj = { |
|
|
// 'getsort':'/goods/query/querySortBySmallSort',
|
|
|
|
|
|
'sortlist': '/product/class/queryAllProductSortList',
|
|
|
'sortSubList': '/product/class/queryProductSortList',
|
|
|
'productPool': '/runManage/subjectManage/queryBaseProductPoolListByName',
|
|
|
'firstCategory': '/operations/helpcategory/getCategoryListByPid',
|
|
|
'getByCategoryId': '/operations/helpcontent/getSecondCategoryList',
|
...
|
...
|
@@ -28,21 +29,21 @@ var urlObj = { |
|
|
'getHelpCategory': '/operations/helpcontent/getHelpCategory',
|
|
|
'queryAll4Select': '/goods/brandSeries/queryAll4Select', //品牌款型系列
|
|
|
|
|
|
'getSelectItems': '/meterManage/brand/getSelectItems',//品牌获取选择选项的枚举
|
|
|
'getSelectItems': '/meterManage/brand/getSelectItems', //品牌获取选择选项的枚举
|
|
|
|
|
|
// 逛
|
|
|
'guangGetAuthorList':'/guang/article/getAuthorList', // 逛-获取作者
|
|
|
'guangGetSortList':'/ajax/guang/article/getSortList', // 逛-获取作者
|
|
|
'guangGetTagCategoryByStatus':'/guang/tagSort/getTagItems',
|
|
|
'guangCommentGetFilterItems':'/guang/comment/getItems', // 逛-评论列表-获取筛选条件
|
|
|
'guangPlusSatrChannel':'/guang/plustarcategory/getCategoryNames', // 逛-plus star 频道
|
|
|
'guangGetAuthorList': '/guang/article/getAuthorList', // 逛-获取作者
|
|
|
'guangGetSortList': '/ajax/guang/article/getSortList', // 逛-获取作者
|
|
|
'guangGetTagCategoryByStatus': '/guang/tagSort/getTagItems',
|
|
|
'guangCommentGetFilterItems': '/guang/comment/getItems', // 逛-评论列表-获取筛选条件
|
|
|
'guangPlusSatrChannel': '/guang/plustarcategory/getCategoryNames', // 逛-plus star 频道
|
|
|
'queryBrandByShopId': '/query/brandByshopId', //查询店铺下关联品牌
|
|
|
'querySupplierByShopId': '/query/supplierByshopId', //查询店铺下关联供应商
|
|
|
|
|
|
'guangGetSort':'/guang/article/getSortList'//逛-分类
|
|
|
'guangGetSort': '/guang/article/getSortList' //逛-分类
|
|
|
};
|
|
|
|
|
|
var minimumResultsForSearch = ["sortbybrand", "getjitSup", "sortsize2","querySupplier"];
|
|
|
var minimumResultsForSearch = ["sortbybrand", "getjitSup", "sortsize2", "querySupplier"];
|
|
|
|
|
|
var dropDown = function(option) {
|
|
|
new dropDown.prototype.init(option);
|
...
|
...
|
@@ -64,42 +65,42 @@ dropDown.prototype = { |
|
|
option.minimumResultsForSearch = Infinity
|
|
|
}
|
|
|
if (option.ajax) {
|
|
|
var defaultName="请选择";
|
|
|
if($(option.el).val()==-1){
|
|
|
defaultName=$(option.el).find("option[value='-1']").text()
|
|
|
var defaultName = "请选择";
|
|
|
if ($(option.el).val() == -1) {
|
|
|
defaultName = $(option.el).find("option[value='-1']").text()
|
|
|
}
|
|
|
if(option.hash){
|
|
|
if($(option.el).val()==null){
|
|
|
|
|
|
var name=option.el.replace(/\.|#/g,'');
|
|
|
var arr=location.hash.replace(/^#/,'').split("&&");
|
|
|
var map={};
|
|
|
arr.forEach(function(item){
|
|
|
var _a=item.split('=');
|
|
|
if(_a&&_a[0]){
|
|
|
map[_a[0]]=_a[1];
|
|
|
if (option.hash) {
|
|
|
if ($(option.el).val() == null) {
|
|
|
|
|
|
var name = option.el.replace(/\.|#/g, '');
|
|
|
var arr = location.hash.replace(/^#/, '').split("&&");
|
|
|
var map = {};
|
|
|
arr.forEach(function(item) {
|
|
|
var _a = item.split('=');
|
|
|
if (_a && _a[0]) {
|
|
|
map[_a[0]] = _a[1];
|
|
|
}
|
|
|
});
|
|
|
|
|
|
var id=map[name];
|
|
|
var text=map[name+"Name"];
|
|
|
var id = map[name];
|
|
|
var text = map[name + "Name"];
|
|
|
$(option.el).html('');
|
|
|
$(option.el).append("<option value="+id+" >"+text+"</option>");
|
|
|
$(option.el).append("<option value=" + id + " >" + text + "</option>");
|
|
|
}
|
|
|
$(document).on("change",option.el,function(){
|
|
|
var name=option.el.replace(/\.|#/g,'');
|
|
|
var id=$(option.el).val();
|
|
|
var text=$(option.el).find("option[value='"+id+"']").text();
|
|
|
var arr=location.hash.replace(/^#/,'').split("&&");
|
|
|
var map={};
|
|
|
arr.forEach(function(item){
|
|
|
var _a=item.split('=');
|
|
|
if(_a&&_a[0]){
|
|
|
map[_a[0]]=_a[1];
|
|
|
$(document).on("change", option.el, function() {
|
|
|
var name = option.el.replace(/\.|#/g, '');
|
|
|
var id = $(option.el).val();
|
|
|
var text = $(option.el).find("option[value='" + id + "']").text();
|
|
|
var arr = location.hash.replace(/^#/, '').split("&&");
|
|
|
var map = {};
|
|
|
arr.forEach(function(item) {
|
|
|
var _a = item.split('=');
|
|
|
if (_a && _a[0]) {
|
|
|
map[_a[0]] = _a[1];
|
|
|
}
|
|
|
});
|
|
|
map[name]=id;
|
|
|
map[name+"Name"]=text;
|
|
|
map[name] = id;
|
|
|
map[name + "Name"] = text;
|
|
|
var urlHash = '';
|
|
|
$.each(map, function(key, value) {
|
|
|
if (value || value == '0') {
|
...
|
...
|
@@ -143,7 +144,7 @@ dropDown.prototype = { |
|
|
cache: true
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
$(option.el).select2();
|
...
|
...
|
|