... ... @@ -24,6 +24,7 @@ import {
setPlatform,
setHost,
setServiceHost,
setChannel,
} from './reducers/app/appActions';
... ... @@ -44,6 +45,7 @@ export default function native(platform) {
const store = configureStore(getInitialState());
store.dispatch(setPlatform(platform));
store.dispatch(setHost(this.props.host));
store.dispatch(setChannel(this.props.channel));
store.dispatch(setServiceHost(this.props.serviceHost));
if (type == 'recForYou' ) {
return (
... ...
... ... @@ -22,13 +22,14 @@ export default class ProductListCell extends Component {
render() {
let {data, sourceType, rowID, style} = this.props;
let {data, sourceType, index, style} = this.props;
let url = data.get('url');
let title = data.get('title');
let publish_time = data.get('publish_time');
let browse = data.get('browse');
let src = data.get('src');
let article_id = data.get('id');
if (browse>10000) {
browse = browse/10000.0;
... ... @@ -41,7 +42,7 @@ export default class ProductListCell extends Component {
style={[styles.container, style]}
activeOpacity={1}
onPress={() => {
this.props.onPressArticle && this.props.onPressArticle(url);
this.props.onPressArticle && this.props.onPressArticle(url, index, article_id);
}}
>
<View style={{flex:1}}>
... ...
... ... @@ -23,13 +23,13 @@ export default class BrandCell extends Component {
}
render() {
let {data}=this.props;
let {data, index}=this.props;
let shop_logo = data.get('shop_logo');
let shops_id = data.get('shops_id');
let new_product_num = data.get('new_product_num');
shop_logo = shop_logo.replace('{width}', 83).replace('{height}', 34).replace('{mode}',2);
return (
<TouchableOpacity style={styles.container} onPress={()=>{this.props.onPressShop&&this.props.onPressShop(data);}}>
<TouchableOpacity style={styles.container} onPress={()=>{this.props.onPressShop&&this.props.onPressShop(data, index);}}>
<View style={{flex:1}}>
<Image style={styles.image} source={{uri:shop_logo}}/>
<View style={styles.footerContainer}>
... ...
... ... @@ -146,6 +146,7 @@ export default class NewArrival extends Component {
style={[styles.listContainer, customStyle]}
recommend_type={recommend_type}
data={data}
index={rowID}
onPressCategory={this.props.onPressCategory}
onPressHotSearch={this.props.onPressHotSearch}
/>
... ... @@ -154,12 +155,12 @@ export default class NewArrival extends Component {
if (recommend_type == 'hotShop') {
return (
<ShopCell style={[styles.listContainer, customStyle]} data={data} onPressShop={this.props.onPressShop}/>
<ShopCell style={[styles.listContainer, customStyle]} data={data} onPressShop={this.props.onPressProductListShop}/>
)
}
if (recommend_type == 'fashionArticle') {
return (
<ArticleCell style={[styles.listContainer, customStyle]} data={data} onPressArticle={this.props.onPressArticle}/>
<ArticleCell index={rowID} style={[styles.listContainer, customStyle]} data={data} onPressArticle={this.props.onPressArticle}/>
)
}
if (!recommend_type) {
... ...
... ... @@ -27,7 +27,7 @@ export default class RecommendCell extends Component {
_renderRow(rowData, rowID) {
return (
<BrandCell data={rowData} onPressShop={this.props.onPressShop}/>
<BrandCell index={rowID} data={rowData} onPressShop={this.props.onPressShop}/>
)
}
render() {
... ...
... ... @@ -38,7 +38,7 @@ export default class ProductListCell extends Component {
}
render() {
let {data, recommend_type, style} = this.props;
let {data, index, recommend_type, style} = this.props;
return (
<TouchableOpacity
style={[styles.container, style]}
... ... @@ -62,10 +62,10 @@ export default class ProductListCell extends Component {
<View style={styles.tag} key={i}>
<TouchableOpacity style={styles.button} onPress={()=>{
if (recommend_type == 'seasonSort') {
this.props.onPressCategory&&this.props.onPressCategory(item);
this.props.onPressCategory&&this.props.onPressCategory(item, i ,index);
}
if (recommend_type == 'hotSearchTerm') {
this.props.onPressHotSearch&&this.props.onPressHotSearch(item);
this.props.onPressHotSearch&&this.props.onPressHotSearch(item, i, index);
}
}}>
<Text style={styles.tagName}>{str}</Text>
... ...
... ... @@ -61,6 +61,7 @@ class NewArrivalContainer extends Component {
this._onPressArticle = this._onPressArticle.bind(this);
this._onPressBanner = this._onPressBanner.bind(this);
this._onPressCarouselItem = this._onPressCarouselItem.bind(this);
this._onPressProductListShop = this._onPressProductListShop.bind(this);
}
componentDidMount() {
... ... @@ -115,6 +116,22 @@ class NewArrivalContainer extends Component {
return;
}
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
let I_INDEX = parseInt(index) + 1;
let F_INDEX = 1;
if (this.props.newArrival.topPart.topList.size) {
F_INDEX ++;
}
if (this.props.newArrival.topPart.brandList.size) {
F_INDEX ++;
}
let param = {
F_ID: 1,
F_NM: '精选抢先看',
F_INDEX: 1,
I_INDEX,
F_URL: url,
}
ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_NEW_ARRIVAL_FLR_C', param);
}
_onPressBanner(url, index) {
... ... @@ -134,14 +151,37 @@ class NewArrivalContainer extends Component {
ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_NEW_ARRIVAL_FLR_C', param);
}
_onPressArticle(url) {
_onPressArticle(url, index, article_id) {
if (!url) {
return;
}
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
let I_INDEX = parseInt(index) + 1;
let F_INDEX = 1;
if (this.props.newArrival.topPart.topList.size) {
F_INDEX ++;
}
if (this.props.newArrival.topPart.brandList.size) {
F_INDEX ++;
}
if (this.props.newArrival.topPart.featuredList.size) {
F_INDEX ++;
}
let param = {
F_ID: 1,
F_NM: '最新上架',
F_INDEX,
I_INDEX,
F_URL: url,
SORT_NM: this.props.newArrival.productList.order,
FILTER_VALUE: this.props.newArrival.filterFactors.toJS(),
RECOMMEND_TYPE: 'fashionArticle',
ARTICLE_ID: article_id,
}
ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_NEW_ARRIVAL_FLR_C', param);
}
_onPressCategory(data) {
_onPressCategory(data, l_index, index) {
let categoryId = data.get('categoryId');
let categoryName = data.get('categoryName');
let parentId = data.get('parentId');
... ... @@ -163,19 +203,68 @@ class NewArrivalContainer extends Component {
}
ReactNative.NativeModules.YH_CommonHelper.jumpToCategory(value, 0, this.props.app.channel);
let I_INDEX = parseInt(index) + 1;
let F_INDEX = 1;
if (this.props.newArrival.topPart.topList.size) {
F_INDEX ++;
}
if (this.props.newArrival.topPart.brandList.size) {
F_INDEX ++;
}
if (this.props.newArrival.topPart.featuredList.size) {
F_INDEX ++;
}
let param = {
F_ID: 1,
F_NM: '最新上架',
F_INDEX,
I_INDEX,
SORT_NM: this.props.newArrival.productList.order,
FILTER_VALUE: this.props.newArrival.filterFactors.toJS(),
RECOMMEND_TYPE: 'seasonSort',
CATE_ID: categoryId,
L_INDEX: l_index,
}
ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_NEW_ARRIVAL_FLR_C', param);
}
_onPressHotSearch(data) {
_onPressHotSearch(data, l_index, index) {
if (!data) {
return;
}
ReactNative.NativeModules.YH_CommonHelper.hotSearchWithKeyword(data);
let I_INDEX = parseInt(index) + 1;
let F_INDEX = 1;
if (this.props.newArrival.topPart.topList.size) {
F_INDEX ++;
}
if (this.props.newArrival.topPart.brandList.size) {
F_INDEX ++;
}
if (this.props.newArrival.topPart.featuredList.size) {
F_INDEX ++;
}
let param = {
F_ID: 1,
F_NM: '最新上架',
F_INDEX,
I_INDEX,
SORT_NM: this.props.newArrival.productList.order,
FILTER_VALUE: this.props.newArrival.filterFactors.toJS(),
RECOMMEND_TYPE: 'hotSearchTerm',
KEYWORD_WORD: data,
L_INDEX: l_index,
}
ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_NEW_ARRIVAL_FLR_C', param);
}
_onPressShop(data) {
_onPressProductListShop(data, index) {
let {
shop_name,
shops_id,
brand_id,
} = data.toJS();
if (!shops_id||!shop_name) {
... ... @@ -183,6 +272,60 @@ class NewArrivalContainer extends Component {
}
let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.shop","params":{"shop_id":"${shops_id}","shop_template_type":"1","shop_name":"${shop_name}"}}`;
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
let I_INDEX = parseInt(index) + 1;
let F_INDEX = 1;
if (this.props.newArrival.topPart.topList.size) {
F_INDEX ++;
}
if (this.props.newArrival.topPart.brandList.size) {
F_INDEX ++;
}
if (this.props.newArrival.topPart.featuredList.size) {
F_INDEX ++;
}
let param = {
F_ID: 1,
F_NM: '最新上架',
F_INDEX,
I_INDEX,
F_URL: url,
SORT_NM: this.props.newArrival.productList.order,
FILTER_VALUE: this.props.newArrival.filterFactors.toJS(),
RECOMMEND_TYPE: 'hotShop',
BRAND_ID: brand_id,
SHOP_ID: shops_id,
}
ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_NEW_ARRIVAL_FLR_C', param);
}
_onPressShop(data, index) {
let {
shop_name,
shops_id,
brand_id,
} = data.toJS();
if (!shops_id||!shop_name) {
return;
}
let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.shop","params":{"shop_id":"${shops_id}","shop_template_type":"1","shop_name":"${shop_name}"}}`;
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
let I_INDEX = parseInt(index) + 1;
let F_INDEX = 1;
if (this.props.newArrival.topPart.topList.size) {
F_INDEX = 2;
}
let param = {
F_ID: 2,
F_NM: '为您推荐',
F_INDEX,
I_INDEX,
BRAND_ID: brand_id,
SHOP_ID: shops_id,
}
ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_NEW_ARRIVAL_FLR_C', param);
}
_onPressProductListProduct(product, rowId=0) {
... ... @@ -194,6 +337,29 @@ class NewArrivalContainer extends Component {
let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"${productSkn}"}}`;
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
let I_INDEX = parseInt(rowId) + 1;
let F_INDEX = 1;
if (this.props.newArrival.topPart.topList.size) {
F_INDEX ++;
}
if (this.props.newArrival.topPart.brandList.size) {
F_INDEX ++;
}
if (this.props.newArrival.topPart.featuredList.size) {
F_INDEX ++;
}
let param = {
F_ID: 1,
F_NM: '最新上架',
F_INDEX,
I_INDEX,
F_URL: url,
SORT_NM: this.props.newArrival.productList.order,
FILTER_VALUE: this.props.newArrival.filterFactors.toJS(),
PRD_SKN: productSkn,
}
ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_NEW_ARRIVAL_FLR_C', param);
}
_goToRecommendForYou() {
... ... @@ -236,6 +402,7 @@ class NewArrivalContainer extends Component {
onPressArticle={this._onPressArticle}
onPressBanner={this._onPressBanner}
onPressCarouselItem={this._onPressCarouselItem}
onPressProductListShop={this._onPressProductListShop}
/>
</View>
);
... ...