返回顶部
- 选择分类:不限
工程异形灯系列(84)欧式水晶灯系列(29)现代美规系列(55)新简美系列(43)新中式系列(31)智能照明系列(18)光纤灯系列(21)户外亮化灯系列(31)户外亮化工程案例(14)商照灯系列(30)
var param = url.split('?')[1];
var newparam = getNewSearchParam(param);
newurl = '{M:G3InstallDir}shop/listshow.aspx?' + newparam;
} else { //启用伪静态
var parr = url.split('/');
var qparam = parr[parr.length - 1];
var ext = ".aspx";
if (ext == "/") {
qparam = parr[parr.length - 2];
}
var preurl = url.replace(qparam, '');
var param = qparam.replace(ext, '');
var newparam = getNewSearchParam(param);
if (preurl.substr(preurl.length - 2) == "//") {
preurl = preurl.substr(0, preurl.length - 1);
}
newparam = newparam.replace(/\/\//g, "/");
newurl = preurl + newparam + ext;
newurl = newurl.replace(/\/key/g, ",key");
}
location.href = newurl;
}
function getNewSearchParam(param) {
var key = jQuery("#keyword").val();
var parr = param.split(',');
var newparam = '';
for (var i = 0; i < parr.length; i++) {
var pparr = parr[i].split('-');
if (pparr[0] == 'key') {
if (newparam == '') {
newparam = 'key-' + (key);
} else {
newparam += ',key-' + (key);
}
} else {
if (newparam == '') {
newparam = parr[i];
} else {
newparam += ',' + parr[i];
}
}
}
if (newparam.indexOf('key-') == -1 && key != '') {
if (newparam == '') {
newparam = 'key-' + key;
} else {
newparam += ',key-' + (key);
}
}
return newparam;
}