Authored by 肖亚东

bug fix

... ... @@ -75,8 +75,17 @@ Component({
result: {},
})
}
},
brandItemTapped: function(event) {
let that = this;
let brandItem = event.currentTarget.dataset.brandItem;
wx.navigateTo({
url: './brandDetail?brandId=' + brandItem.id + '&brandName=' + brandItem.name,
success: function(res) {
that.triggerEvent('dismissSearchView', {});
}
})
},
//搜索框获取焦点焦点
... ... @@ -90,69 +99,8 @@ Component({
},
//热门搜索点击
hotKeywordItemTapped: function (event) {
let brandItem = event.currentTarget.dataset.item;
this.triggerEvent('dismissSearchView', {});
// console.log(event.currentTarget.dataset)
wx.navigateTo({
url: '../goodsList/brand?brandId=' + brandItem.brandId + '&brandName=' + brandItem.brandName + '&page_name=' + 'brands' + '&page_param=' + ''
});
},
historyKeywordItemTapped: function (event) {
let brandItem = event.currentTarget.dataset.item;
this.triggerEvent('dismissSearchView', {});
// console.log(event.currentTarget.dataset)
wx.navigateTo({
url: '../goodsList/brandStore?shop_id=' + brandItem.shop_id + '&shop_name' + brandItem.brand_name + '&page_name=' + 'brands' + '&page_param=' + ''
});
},
cancelSearch: function (event) {
this.triggerEvent('dismissSearchView', {});
},
clearSearchHistory: function (e) {
try {
let searchHistory = [];
this.setData({
searchHistory,
});
wx.removeStorageSync('searchHistory');
} catch (e) { }
},
search_brandItemTapped: function (e) {
let brandItem = e.currentTarget.dataset.brandItem;
let searchHistory = this.data.searchHistory;
let isHistory = false;
for (var i = 0; i < searchHistory.length; i++) {
let item = searchHistory[i];
if (item.brand_name == brandItem.brand_name) {
isHistory = true;
}
}
if (!isHistory) {
searchHistory.push(brandItem);
this.setData({
searchHistory,
});
try {
wx.setStorageSync('searchHistory', searchHistory);
} catch (e) {
};
}
this.triggerEvent('dismissSearchView', {});
wx.navigateTo({
url: '../goodsList/brandStore?shop_id=' + brandItem.shop_id + '&shop_name' + brandItem.brand_name
});
},
}
})
... ...
... ... @@ -44,7 +44,6 @@ Page({
scrollHeight,
});
this.fetchBrandList();
// this.fetchHotKeyword();
},
/**
... ... @@ -79,27 +78,6 @@ Page({
});
},
fetchHotKeyword: function () {
let app = getApp();
let that = this;
let param = {
method: 'app.search.hotBrands',
uid: app.getUid(),
sourcePage: 'iFP_SearchProList',
}
GET(API_HOST, param)
.then(data => {
let hotKeyword = data;
that.setData({
hotKeyword,
});
})
.catch(error => {
});
},
activityItemTapped: function (event) {
let brandItem = event.currentTarget.dataset.brandItem;
let jumpUrl = brandItem.url;
... ...
... ... @@ -17,16 +17,6 @@
<text class='sessionText'>{{brand.letter}}</text>
</view>
<block wx:for="{{brand.list}}" wx:key="{{unique}}" wx:for-item="brand">
<!-- <view class='row' bindtap="brandItemTapped" data-brand-item="{{item}}">
<view class="content">
<image class="brand-icon" src="{{item.logo}}" mode="aspectFill"></image>
<view class='rowContent'>
<text class='title'>{{item.name}}</text>
<text class='location'>展位号:A578</text>
</view>
</view>
<view class='spaceLine'/>
</view> -->
<template is="brand-list-item" data="{{item:brand}}"/>
</block>
</block>
... ...