...
|
...
|
@@ -15,11 +15,11 @@ function getRanToken() { |
|
|
/**
|
|
|
* 增加单条记录
|
|
|
*/
|
|
|
function addHistory(brandId) {
|
|
|
function addHistory(brandName) {
|
|
|
$.ajax({
|
|
|
type: 'GET',
|
|
|
url: '/category/brand/addBrandSearch',
|
|
|
data: 'brandId=' + brandId,
|
|
|
data: 'brandName=' + brandName,
|
|
|
success: function(data) {
|
|
|
},
|
|
|
error: function() {
|
...
|
...
|
@@ -30,20 +30,24 @@ function addHistory(brandId) { |
|
|
//绑定提交前的存local操作
|
|
|
function bindWirteLocal($brandList) {
|
|
|
$brandList.on('click', 'p', function(e) {
|
|
|
var a,brandName,brandId,url;
|
|
|
var query = brandName + url,
|
|
|
var brandName,brandId,url;
|
|
|
var a = $(this).find('a');
|
|
|
var query = a.attr('brandName') + a.attr('href'),
|
|
|
historys;
|
|
|
|
|
|
e.preventDefault();
|
|
|
a = $(this).find('a');
|
|
|
|
|
|
brandName = a.attr('brandName');
|
|
|
|
|
|
brandId = a.attr('brandId');
|
|
|
|
|
|
url = a.attr('href');
|
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
|
if ($('.net-search').length > 0) {
|
|
|
addHistory(brandName);
|
|
|
location.href = url;
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (localStorage) {
|
|
|
historys = localStorage.getItem('historys-brand');
|
...
|
...
|
@@ -64,9 +68,7 @@ function bindWirteLocal($brandList) { |
|
|
localStorage.setItem('historys-brand', historys);
|
|
|
}
|
|
|
|
|
|
if ($('.net-search').length > 0) {
|
|
|
addHistory(brandId);
|
|
|
}
|
|
|
|
|
|
|
|
|
location.href = url;
|
|
|
});
|
...
|
...
|
|