...
|
...
|
@@ -52,6 +52,8 @@ class SearchContainer extends Component { |
|
|
this._onPressClearHistory = this._onPressClearHistory.bind(this);
|
|
|
this._onPressFilter = this._onPressFilter.bind(this);
|
|
|
this._onEndReached = this._onEndReached.bind(this);
|
|
|
this._onPressShop = this._onPressShop.bind(this);
|
|
|
this._onPressProduct = this._onPressProduct.bind(this);
|
|
|
|
|
|
this.subscription = NativeAppEventEmitter.addListener(
|
|
|
"SearchKeywordDidChangeEvent",
|
...
|
...
|
@@ -99,6 +101,15 @@ class SearchContainer extends Component { |
|
|
this.props.actions.searchProductList(this.props.search.keyword);
|
|
|
}
|
|
|
|
|
|
_onPressShop(data) {
|
|
|
ReactNative.NativeModules.YH_SearchHelper.goToBrandShop(data.toJS());
|
|
|
}
|
|
|
|
|
|
_onPressProduct(data, index='0') {
|
|
|
console.log(index)
|
|
|
ReactNative.NativeModules.YH_SearchHelper.goToProductDetail(data.toJS(), index, this.props.search.productList.filter);
|
|
|
}
|
|
|
|
|
|
_renderSearch() {
|
|
|
let {status, keyword, placeholder, searchHistory, hotKeyword, fuzzySearch, jumpUrl, productList} = this.props.search;
|
|
|
if (status == 0) {
|
...
|
...
|
@@ -118,8 +129,6 @@ class SearchContainer extends Component { |
|
|
/>
|
|
|
);
|
|
|
} else if (status == 2) {
|
|
|
console.log('currentPage: ' + productList.currentPage)
|
|
|
console.log('isFetching: ' + productList.isFetching)
|
|
|
let isLoadingMore = productList.isFetching && productList.currentPage > 0;
|
|
|
return (
|
|
|
<ProductList
|
...
|
...
|
@@ -130,6 +139,8 @@ class SearchContainer extends Component { |
|
|
endReached={productList.endReached}
|
|
|
onPressFilter={this._onPressFilter}
|
|
|
onEndReached={this._onEndReached}
|
|
|
onPressShop={this._onPressShop}
|
|
|
onPressProduct={this._onPressProduct}
|
|
|
/>
|
|
|
);
|
|
|
}
|
...
|
...
|
|