Authored by 李犇

Merge remote-tracking branch 'origin/5.4.1' into 5.4.1

@@ -80,6 +80,11 @@ class BrandContainer extends Component { @@ -80,6 +80,11 @@ class BrandContainer extends Component {
80 80
81 //原生跳转 81 //原生跳转
82 _onPressBrandItem(data, fromSearch=false){ 82 _onPressBrandItem(data, fromSearch=false){
  83 + //blk品牌跳转需要:如果发现是店铺,全部跳基础店铺。----顺老板。
  84 + if (data&&data.type == '2') {
  85 + data.is_red_shop == '0';
  86 + data.shop_template_type = '1';
  87 + }
83 ReactNative.NativeModules.YH_CommonHelper.blkPushBrandVC(data); 88 ReactNative.NativeModules.YH_CommonHelper.blkPushBrandVC(data);
84 // let eventName = ''; 89 // let eventName = '';
85 // let params = {}; 90 // let params = {};
@@ -84,9 +84,19 @@ export default class Home extends Component { @@ -84,9 +84,19 @@ export default class Home extends Component {
84 } 84 }
85 } 85 }
86 86
87 - trigggePullToRefresh() { 87 + trigggePullToRefresh(changeChannel=false) {
88 let data = this._currentChannelData(); 88 let data = this._currentChannelData();
89 - if (data.isFirstLoad) { 89 + if (changeChannel) {
  90 + if (data.isFirstLoad) {
  91 + if (Platform.OS === 'ios') {
  92 + InteractionManager.runAfterInteractions(() => {
  93 + this.listView && this.listView.getScrollResponder().startPullToRefresh();
  94 + });
  95 + } else {
  96 + this.props.onRefresh && this.props.onRefresh();
  97 + }
  98 + }
  99 + }else {
90 if (Platform.OS === 'ios') { 100 if (Platform.OS === 'ios') {
91 InteractionManager.runAfterInteractions(() => { 101 InteractionManager.runAfterInteractions(() => {
92 this.listView && this.listView.getScrollResponder().startPullToRefresh(); 102 this.listView && this.listView.getScrollResponder().startPullToRefresh();
@@ -422,7 +432,7 @@ export default class Home extends Component { @@ -422,7 +432,7 @@ export default class Home extends Component {
422 } 432 }
423 433
424 //因为android下拉刷新控件与swiper的滑动事件会引起冲突,所以将listview滚动位置加1以阻止下拉刷新 434 //因为android下拉刷新控件与swiper的滑动事件会引起冲突,所以将listview滚动位置加1以阻止下拉刷新
425 - _onChildScrollToPreventRefresh() { 435 + _onChildScrollToPreventRefresh() {
426 if(Platform.OS === 'android' && this.state.currentY == 0 && this.listView){ 436 if(Platform.OS === 'android' && this.state.currentY == 0 && this.listView){
427 this.listView.scrollTo({x: 0, y: 1, animated: false}); 437 this.listView.scrollTo({x: 0, y: 1, animated: false});
428 } 438 }
@@ -83,10 +83,37 @@ class HomeContainer extends Component { @@ -83,10 +83,37 @@ class HomeContainer extends Component {
83 //增加了IOS的判断,Android不需要此方法,因为Android首页的四个频道为四个不同的原生界面,调用此方法会导致重复渲染数据 83 //增加了IOS的判断,Android不需要此方法,因为Android首页的四个频道为四个不同的原生界面,调用此方法会导致重复渲染数据
84 if (Platform.OS === 'ios') { 84 if (Platform.OS === 'ios') {
85 this.props.actions.setChannel(reminder.channel); 85 this.props.actions.setChannel(reminder.channel);
86 - this.home && this.home.trigggePullToRefresh(); 86 + this.home && this.home.trigggePullToRefresh(true);
87 } 87 }
88 } 88 }
89 ); 89 );
  90 + this.subscription2 = NativeAppEventEmitter.addListener(
  91 + 'UserDidLoginEvent',
  92 + (reminder) => {
  93 + this.home && this.home.trigggePullToRefresh();
  94 + }
  95 + );
  96 +
  97 + this.subscription3 = NativeAppEventEmitter.addListener(
  98 + 'UserDidLogoutEvent',
  99 + (reminder) => {
  100 + this.home && this.home.trigggePullToRefresh();
  101 + }
  102 + );
  103 +
  104 + this.subscription4 = NativeAppEventEmitter.addListener(
  105 + 'ABTestDidChangeEvent',
  106 + (reminder) => {
  107 + this.home && this.home.trigggePullToRefresh();
  108 + }
  109 + );
  110 +
  111 + this.subscription5 = NativeAppEventEmitter.addListener(
  112 + 'UserDidRegisterEvent',
  113 + (reminder) => {
  114 + this.home && this.home.trigggePullToRefresh();
  115 + }
  116 + );
90 } 117 }
91 118
92 componentDidMount() { 119 componentDidMount() {
@@ -96,6 +123,10 @@ class HomeContainer extends Component { @@ -96,6 +123,10 @@ class HomeContainer extends Component {
96 123
97 componentWillUnmount() { 124 componentWillUnmount() {
98 this.subscription && this.subscription.remove(); 125 this.subscription && this.subscription.remove();
  126 + this.subscription2 && this.subscription2.remove();
  127 + this.subscription3 && this.subscription3.remove();
  128 + this.subscription4 && this.subscription4.remove();
  129 + this.subscription5 && this.subscription5.remove();
99 } 130 }
100 131
101 onLongPressProduct(rowID) { 132 onLongPressProduct(rowID) {
@@ -139,7 +170,6 @@ class HomeContainer extends Component { @@ -139,7 +170,6 @@ class HomeContainer extends Component {
139 this.props.actions.selectedRecommendProduct(); 170 this.props.actions.selectedRecommendProduct();
140 } 171 }
141 172
142 -  
143 onEndReached() { 173 onEndReached() {
144 InteractionManager.runAfterInteractions(() => { 174 InteractionManager.runAfterInteractions(() => {
145 this.props.actions.fetchHomeFavoriteList(); 175 this.props.actions.fetchHomeFavoriteList();
@@ -626,7 +626,7 @@ export function getRecommendPop() { @@ -626,7 +626,7 @@ export function getRecommendPop() {
626 } 626 }
627 dispatch(recommendPopRequest(channelStr)); 627 dispatch(recommendPopRequest(channelStr));
628 let fetchRecommendPop = (fromPage, rec_pos) =>{ 628 let fetchRecommendPop = (fromPage, rec_pos) =>{
629 - return new HomeService('http://dev-api.yohops.com:9999').recommendPop(fromPage, rec_pos) 629 + return new HomeService(app.host).recommendPop(fromPage, rec_pos)
630 .then(json =>{ 630 .then(json =>{
631 let payload = floorParser.parseRecommendPop(json); 631 let payload = floorParser.parseRecommendPop(json);
632 dispatch(recommendPopSuccess(payload, channelStr)); 632 dispatch(recommendPopSuccess(payload, channelStr));
@@ -115,7 +115,7 @@ export default class ActivityCell extends React.Component { @@ -115,7 +115,7 @@ export default class ActivityCell extends React.Component {
115 115
116 render() { 116 render() {
117 117
118 - let {resource} = this.props; 118 + let {resource ,row_ID} = this.props;
119 if (!resource) { 119 if (!resource) {
120 return null; 120 return null;
121 } 121 }
@@ -150,7 +150,7 @@ export default class ActivityCell extends React.Component { @@ -150,7 +150,7 @@ export default class ActivityCell extends React.Component {
150 this.props.showToast && this.props.showToast('活动已结束,敬请期待。'); 150 this.props.showToast && this.props.showToast('活动已结束,敬请期待。');
151 }else { 151 }else {
152 let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.outletactivity","params":{"activity_id":"${id}"}}`; 152 let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.outletactivity","params":{"activity_id":"${id}"}}`;
153 - this.props.onPressProduct && this.props.onPressProduct(url); 153 + this.props.onPressProduct && this.props.onPressProduct(url,row_ID,1,'','');
154 } 154 }
155 }else { 155 }else {
156 this.props.showToast && this.props.showToast('活动还未开始,敬请期待'); 156 this.props.showToast && this.props.showToast('活动还未开始,敬请期待');
@@ -66,13 +66,13 @@ let styles = StyleSheet.create({ @@ -66,13 +66,13 @@ let styles = StyleSheet.create({
66 }, 66 },
67 textV: { 67 textV: {
68 width: textWidth, 68 width: textWidth,
69 - height: 40, 69 + height: 50,
70 alignSelf: 'center', 70 alignSelf: 'center',
71 marginTop: 10, 71 marginTop: 10,
72 }, 72 },
73 text: { 73 text: {
74 width: textWidth, 74 width: textWidth,
75 - height: 40, 75 + height: 50,
76 textAlign: 'center', 76 textAlign: 'center',
77 } 77 }
78 }); 78 });
@@ -18,6 +18,18 @@ import OutletSrollableBar from './OutletSrollableBar'; @@ -18,6 +18,18 @@ import OutletSrollableBar from './OutletSrollableBar';
18 export default class Outlet extends Component { 18 export default class Outlet extends Component {
19 constructor(props) { 19 constructor(props) {
20 super(props); 20 super(props);
  21 + this._onPressProductListProduct = this._onPressProductListProduct.bind(this);
  22 +
  23 + }
  24 +
  25 + _onPressProductListProduct(product,rowId=0,tabLabel) {
  26 + let {
  27 + categoryList,
  28 + } = this.props;
  29 +
  30 + let initialPage = categoryList?categoryList.get('initialPage'):0;
  31 +
  32 + this.props.onPressProductListProduct && this.props.onPressProductListProduct(product,rowId,tabLabel,initialPage)
21 } 33 }
22 34
23 render() { 35 render() {
@@ -41,6 +53,9 @@ export default class Outlet extends Component { @@ -41,6 +53,9 @@ export default class Outlet extends Component {
41 {!isFetching?<ScrollableTabView 53 {!isFetching?<ScrollableTabView
42 initialPage={initialPage} 54 initialPage={initialPage}
43 renderTabBar={() => <OutletSrollableBar />} 55 renderTabBar={() => <OutletSrollableBar />}
  56 + onChangeTab={(obj) => {
  57 + this.props.onChangeTab && this.props.onChangeTab(list?list[obj.i].get('sort_name'):'');
  58 + }}
44 > 59 >
45 {list.map((item, i) => { 60 {list.map((item, i) => {
46 let name = item.get('sort_name'); 61 let name = item.get('sort_name');
@@ -54,7 +69,7 @@ export default class Outlet extends Component { @@ -54,7 +69,7 @@ export default class Outlet extends Component {
54 getOutletHomeResource = {this.props.getOutletHomeResource} 69 getOutletHomeResource = {this.props.getOutletHomeResource}
55 getOutletActivityList = {this.props.getOutletActivityList} 70 getOutletActivityList = {this.props.getOutletActivityList}
56 onPressProduct = {this.props.onPressProduct} 71 onPressProduct = {this.props.onPressProduct}
57 - onPressProductListProduct={this.props.onPressProductListProduct} 72 + onPressProductListProduct={this._onPressProductListProduct}
58 setActivityFliter = {this.props.setActivityFliter} 73 setActivityFliter = {this.props.setActivityFliter}
59 onPressFilter = {this.props.onPressFilter} 74 onPressFilter = {this.props.onPressFilter}
60 onEndReached = {this.props.onEndReached} 75 onEndReached = {this.props.onEndReached}
@@ -31,7 +31,7 @@ export default class OutletDoubleImage extends React.Component { @@ -31,7 +31,7 @@ export default class OutletDoubleImage extends React.Component {
31 31
32 render() { 32 render() {
33 33
34 - let {resource} = this.props; 34 + let {resource ,row_ID} = this.props;
35 if (!resource) { 35 if (!resource) {
36 return null; 36 return null;
37 } 37 }
@@ -42,16 +42,20 @@ export default class OutletDoubleImage extends React.Component { @@ -42,16 +42,20 @@ export default class OutletDoubleImage extends React.Component {
42 let url0 = data[0].url; 42 let url0 = data[0].url;
43 let src1 = getSlicedUrl(data[1].src, backgroundWidth, backgroundHeight); 43 let src1 = getSlicedUrl(data[1].src, backgroundWidth, backgroundHeight);
44 let url1 = data[1].url; 44 let url1 = data[1].url;
  45 +
  46 + let template_name = resource.get('template_name');
  47 + let template_id = resource.get('template_id');
  48 +
45 return ( 49 return (
46 <View style={styles.viewStyle}> 50 <View style={styles.viewStyle}>
47 - <TouchableOpacity onPress={() => {this.props.onPressProduct&&this.props.onPressProduct(url0)}} > 51 + <TouchableOpacity onPress={() => {this.props.onPressProduct && this.props.onPressProduct(url0,row_ID,1,template_name,template_id)}} >
48 <YH_Image 52 <YH_Image
49 url={src0} 53 url={src0}
50 style={styles.thumbnail} 54 style={styles.thumbnail}
51 /> 55 />
52 </TouchableOpacity> 56 </TouchableOpacity>
53 57
54 - <TouchableOpacity onPress={() => {this.props.onPressProduct&&this.props.onPressProduct(url1)}} > 58 + <TouchableOpacity onPress={() => {this.props.onPressProduct && this.props.onPressProduct(url1,row_ID,1,template_name,template_id)}} >
55 <YH_Image 59 <YH_Image
56 url={src1} 60 url={src1}
57 style={styles.thumbnail} 61 style={styles.thumbnail}
@@ -37,25 +37,44 @@ export default class OutletPageListView extends Component { @@ -37,25 +37,44 @@ export default class OutletPageListView extends Component {
37 this._onRefresh = this._onRefresh.bind(this); 37 this._onRefresh = this._onRefresh.bind(this);
38 this.setActivityFliter = this.setActivityFliter.bind(this); 38 this.setActivityFliter = this.setActivityFliter.bind(this);
39 this._onPressFilter = this._onPressFilter.bind(this); 39 this._onPressFilter = this._onPressFilter.bind(this);
  40 + this._onPressProductListProduct = this._onPressProductListProduct.bind(this);
  41 + this._onPressProduct = this._onPressProduct.bind(this);
  42 +
40 } 43 }
41 44
42 componentDidMount() { 45 componentDidMount() {
43 this._onRefresh && this._onRefresh(false); 46 this._onRefresh && this._onRefresh(false);
44 } 47 }
45 48
  49 + _onPressProduct (url,rowId,sectionId,templateName,template_id){
  50 + let {
  51 + tabLabel,
  52 + } = this.props;
  53 + this.props.onPressProduct && this.props.onPressProduct(url,tabLabel,rowId,sectionId,templateName,template_id)
  54 + }
  55 +
  56 +
  57 + _onPressProductListProduct(product,rowId=0) {
  58 + let {
  59 + tabLabel,
  60 + } = this.props;
  61 +
  62 + this.props.onPressProductListProduct && this.props.onPressProductListProduct(product,rowId,tabLabel)
  63 + }
46 64
47 _onRefresh(ptr) { 65 _onRefresh(ptr) {
48 let { 66 let {
49 resource, 67 resource,
  68 + tabLabel,
50 } = this.props; 69 } = this.props;
51 70
52 if (resource.get('sort_name')=='即将开始') { 71 if (resource.get('sort_name')=='即将开始') {
53 - this.props.getOutletActivityList && this.props.getOutletActivityList(resource.get('content_code'),resource.get('yh_channel'),resource.get('type')); 72 + this.props.getOutletActivityList && this.props.getOutletActivityList(resource.get('content_code'),resource.get('yh_channel'),resource.get('type'),tabLabel);
54 }else if (resource.get('sort_name') == '即将结束') { 73 }else if (resource.get('sort_name') == '即将结束') {
55 - this.props.getOutletActivityList && this.props.getOutletActivityList(resource.get('content_code'),resource.get('yh_channel'),resource.get('type')); 74 + this.props.getOutletActivityList && this.props.getOutletActivityList(resource.get('content_code'),resource.get('yh_channel'),resource.get('type'),tabLabel);
56 }else { 75 }else {
57 this.props.getOutletHomeResource && this.props.getOutletHomeResource(resource.get('content_code'),ptr); 76 this.props.getOutletHomeResource && this.props.getOutletHomeResource(resource.get('content_code'),ptr);
58 - this.props.getOutletActivityList && this.props.getOutletActivityList(resource.get('content_code'),resource.get('yh_channel'),resource.get('type')); 77 + this.props.getOutletActivityList && this.props.getOutletActivityList(resource.get('content_code'),resource.get('yh_channel'),resource.get('type'),tabLabel);
59 } 78 }
60 } 79 }
61 80
@@ -104,22 +123,22 @@ export default class OutletPageListView extends Component { @@ -104,22 +123,22 @@ export default class OutletPageListView extends Component {
104 renderRow(rowData, sectionID, rowID, highlightRow) { 123 renderRow(rowData, sectionID, rowID, highlightRow) {
105 if (sectionID == 'outletHomeReource') { 124 if (sectionID == 'outletHomeReource') {
106 if (rowData.get('template_name') == 'NL2R') { 125 if (rowData.get('template_name') == 'NL2R') {
107 - return(<OutletThreeImage resource={rowData} onPressProduct={this.props.onPressProduct}/>); 126 + return(<OutletThreeImage resource={rowData} row_ID={rowID} onPressProduct={this._onPressProduct}/>);
108 }else if (rowData.get('template_name') == 'focus') { 127 }else if (rowData.get('template_name') == 'focus') {
109 - return(<OutletSwiper resource={rowData} onPressProduct={this.props.onPressProduct}/>); 128 + return(<OutletSwiper resource={rowData} row_ID={rowID} onPressProduct={this._onPressProduct}/>);
110 }else if (rowData.get('template_name') == 'single_image') { 129 }else if (rowData.get('template_name') == 'single_image') {
111 - return(<OutletSingleImage resource={rowData} onPressProduct={this.props.onPressProduct}/>); 130 + return(<OutletSingleImage resource={rowData} row_ID={rowID} onPressProduct={this._onPressProduct}/>);
112 }else if (rowData.get('template_name') == 'small_pic') { 131 }else if (rowData.get('template_name') == 'small_pic') {
113 - return(<OutletDoubleImage resource={rowData} onPressProduct={this.props.onPressProduct}/>); 132 + return(<OutletDoubleImage resource={rowData} row_ID={rowID} onPressProduct={this._onPressProduct}/>);
114 }else if (rowData.get('template_name') == 'recommend_content_five') { 133 }else if (rowData.get('template_name') == 'recommend_content_five') {
115 - return(<OutletRecommendFive resource={rowData} onPressProduct={this.props.onPressProduct}/>); 134 + return(<OutletRecommendFive resource={rowData} row_ID={rowID} onPressProduct={this._onPressProduct}/>);
116 }else if (rowData.get('template_name') == 'app_hot_brands') { 135 }else if (rowData.get('template_name') == 'app_hot_brands') {
117 - return(<OutletRecommendFive resource={rowData} onPressProduct={this.props.onPressProduct}/>); 136 + return(<OutletRecommendFive resource={rowData} row_ID={rowID} onPressProduct={this._onPressProduct}/>);
118 }else if (rowData.get('template_name') == '文字广告') { 137 }else if (rowData.get('template_name') == '文字广告') {
119 // return(<TripleImage resource={rowData} onPressProduct={this.props.onPressProduct}/>); 138 // return(<TripleImage resource={rowData} onPressProduct={this.props.onPressProduct}/>);
120 } 139 }
121 }else if (sectionID == 'activityList') { 140 }else if (sectionID == 'activityList') {
122 - return(<ActivityCell resource={rowData} key = {rowID + 'activityList'} showToast={this.props.showToast} onPressProduct={this.props.onPressProduct}/>); 141 + return(<ActivityCell resource={rowData} key = {rowID + 'activityList'} showToast={this.props.showToast} row_ID={rowID} onPressProduct={this._onPressProduct}/>);
123 }else if (sectionID == 'activityMore') { 142 }else if (sectionID == 'activityMore') {
124 if (rowData == 'more') { 143 if (rowData == 'more') {
125 let sourceIcon = require('../../../brandStore/image/filter/brandstore_filter_arrow_down_normal.png'); 144 let sourceIcon = require('../../../brandStore/image/filter/brandstore_filter_arrow_down_normal.png');
@@ -142,7 +161,7 @@ export default class OutletPageListView extends Component { @@ -142,7 +161,7 @@ export default class OutletPageListView extends Component {
142 key={'row' + rowID} 161 key={'row' + rowID}
143 rowID={rowID} 162 rowID={rowID}
144 data={rowData} 163 data={rowData}
145 - onPressProduct={this.props.onPressProductListProduct}/> 164 + onPressProduct={this._onPressProductListProduct}/>
146 ); 165 );
147 } 166 }
148 return null; 167 return null;
@@ -41,11 +41,14 @@ export default class OutletRecommendFive extends React.Component { @@ -41,11 +41,14 @@ export default class OutletRecommendFive extends React.Component {
41 41
42 renderRow(rowData, sectionID, rowID, highlightRow) { 42 renderRow(rowData, sectionID, rowID, highlightRow) {
43 43
  44 + let {resource ,row_ID} = this.props;
  45 + let template_name = resource?resource.get('template_name'):'';
  46 + let template_id = resource?resource.get('template_id'):0;
44 let newSrc = getSlicedUrl(rowData.get('src'), 80, 80, 2); 47 let newSrc = getSlicedUrl(rowData.get('src'), 80, 80, 2);
45 48
46 return ( 49 return (
47 <TouchableOpacity activeOpacity={0.5} onPress={() => { 50 <TouchableOpacity activeOpacity={0.5} onPress={() => {
48 - this.props.onPressProduct && this.props.onPressProduct(rowData.get('url')); 51 + this.props.onPressProduct && this.props.onPressProduct(rowData.get('url'),row_ID,1,template_name,template_id)
49 }}> 52 }}>
50 <View style={styles.rowContainer}> 53 <View style={styles.rowContainer}>
51 <Image 54 <Image
@@ -84,9 +87,11 @@ export default class OutletRecommendFive extends React.Component { @@ -84,9 +87,11 @@ export default class OutletRecommendFive extends React.Component {
84 } 87 }
85 88
86 render() { 89 render() {
87 - let data = this.props.resource.get('data'); 90 + let {resource ,sectionID ,rowID} = this.props;
  91 +
  92 + let data = resource?resource.get('data'):null;
88 93
89 - let list = data.get('list')?data.get('list').toArray():null; 94 + let list = data&&data.get('list')?data.get('list').toArray():null;
90 if (!list || list.length == 0) { 95 if (!list || list.length == 0) {
91 return null; 96 return null;
92 } 97 }
@@ -31,10 +31,12 @@ export default class OutletSingleImage extends React.Component { @@ -31,10 +31,12 @@ export default class OutletSingleImage extends React.Component {
31 31
32 render() { 32 render() {
33 33
34 - let {resource} = this.props; 34 + let {resource ,row_ID} = this.props;
35 if (!resource) { 35 if (!resource) {
36 return null; 36 return null;
37 } 37 }
  38 + let template_name = resource?resource.get('template_name'):'';
  39 + let template_id = resource?resource.get('template_id'):0;
38 40
39 let data = resource.get('data').toJS(); 41 let data = resource.get('data').toJS();
40 42
@@ -46,7 +48,7 @@ export default class OutletSingleImage extends React.Component { @@ -46,7 +48,7 @@ export default class OutletSingleImage extends React.Component {
46 activeOpacity={1} 48 activeOpacity={1}
47 style={{width: width, height: backgroundHeight}} 49 style={{width: width, height: backgroundHeight}}
48 onPress={() => { 50 onPress={() => {
49 - this.props.onPressProduct && this.props.onPressProduct(data[0].url); 51 + this.props.onPressProduct && this.props.onPressProduct(data[0].url,row_ID,1,template_name,template_id)
50 }} 52 }}
51 > 53 >
52 <YH_Image 54 <YH_Image
@@ -57,11 +57,12 @@ export default class OutletSwiper extends React.Component { @@ -57,11 +57,12 @@ export default class OutletSwiper extends React.Component {
57 57
58 render() { 58 render() {
59 59
60 - let {resource} = this.props; 60 + let {resource ,row_ID} = this.props;
61 if (!resource) { 61 if (!resource) {
62 return null; 62 return null;
63 } 63 }
64 - 64 + let template_name = resource?resource.get('template_name'):'';
  65 + let template_id = resource?resource.get('template_id'):0;
65 let data = resource.get('data').toJS(); 66 let data = resource.get('data').toJS();
66 67
67 if (data.length == 1) { 68 if (data.length == 1) {
@@ -72,7 +73,7 @@ export default class OutletSwiper extends React.Component { @@ -72,7 +73,7 @@ export default class OutletSwiper extends React.Component {
72 activeOpacity={1} 73 activeOpacity={1}
73 style={{width: width, height: swiperHeight}} 74 style={{width: width, height: swiperHeight}}
74 onPress={() => { 75 onPress={() => {
75 - this.props.onPressProduct && this.props.onPressProduct(data[0].url); 76 + this.props.onPressProduct && this.props.onPressProduct(data[0].url,row_ID,1,template_name,template_id)
76 }} 77 }}
77 > 78 >
78 <YH_Image 79 <YH_Image
@@ -105,7 +106,7 @@ export default class OutletSwiper extends React.Component { @@ -105,7 +106,7 @@ export default class OutletSwiper extends React.Component {
105 key={i} 106 key={i}
106 activeOpacity={1} 107 activeOpacity={1}
107 onPress={() => { 108 onPress={() => {
108 - this.props.onPressProduct && this.props.onPressProduct(item.url); 109 + this.props.onPressProduct && this.props.onPressProduct(item.url,row_ID,1,template_name,template_id)
109 }} 110 }}
110 > 111 >
111 <YH_Image 112 <YH_Image
@@ -19,10 +19,12 @@ export default class OutletThreeImage extends Component{ @@ -19,10 +19,12 @@ export default class OutletThreeImage extends Component{
19 19
20 render() { 20 render() {
21 21
22 - let {resource} = this.props; 22 + let {resource ,row_ID} = this.props;
23 if (!resource) { 23 if (!resource) {
24 return null; 24 return null;
25 } 25 }
  26 + let template_name = resource?resource.get('template_name'):'';
  27 + let template_id = resource?resource.get('template_id'):0;
26 28
27 let data = resource.get('data').toJS(); 29 let data = resource.get('data').toJS();
28 30
@@ -36,20 +38,21 @@ export default class OutletThreeImage extends Component{ @@ -36,20 +38,21 @@ export default class OutletThreeImage extends Component{
36 let url3 = data.right[1].url; 38 let url3 = data.right[1].url;
37 39
38 40
  41 +
39 return ( 42 return (
40 <View style={styles.container}> 43 <View style={styles.container}>
41 <View style={styles.leftView}> 44 <View style={styles.leftView}>
42 - <TouchableOpacity onPress={() => {this.props.onPressProduct && this.props.onPressProduct(url1)}} > 45 + <TouchableOpacity onPress={() => {this.props.onPressProduct && this.props.onPressProduct(url1,row_ID,1,template_name,template_id)}} >
43 <View style={styles.leftImage}> 46 <View style={styles.leftImage}>
44 <YH_Image url={src1} style={styles.leftImage}></YH_Image> 47 <YH_Image url={src1} style={styles.leftImage}></YH_Image>
45 </View> 48 </View>
46 </TouchableOpacity> 49 </TouchableOpacity>
47 </View> 50 </View>
48 <View style={styles.rightView}> 51 <View style={styles.rightView}>
49 - <TouchableOpacity onPress={() => {this.props.onPressProduct && this.props.onPressProduct(url2)}} > 52 + <TouchableOpacity onPress={() => {this.props.onPressProduct && this.props.onPressProduct(url2,row_ID,1,template_name,template_id)}} >
50 <YH_Image url={src2} style={styles.rightImage1}></YH_Image> 53 <YH_Image url={src2} style={styles.rightImage1}></YH_Image>
51 </TouchableOpacity> 54 </TouchableOpacity>
52 - <TouchableOpacity onPress={() => {this.props.onPressProduct && this.props.onPressProduct(url3)}} > 55 + <TouchableOpacity onPress={() => {this.props.onPressProduct && this.props.onPressProduct(url3,row_ID,1,template_name,template_id)}} >
53 <YH_Image url={src3} style={styles.rightImage2}></YH_Image> 56 <YH_Image url={src3} style={styles.rightImage2}></YH_Image>
54 </TouchableOpacity> 57 </TouchableOpacity>
55 </View> 58 </View>
@@ -50,6 +50,8 @@ class OutletContainer extends Component { @@ -50,6 +50,8 @@ class OutletContainer extends Component {
50 this._showToast = this._showToast.bind(this); 50 this._showToast = this._showToast.bind(this);
51 this._hideToastMessage = this._hideToastMessage.bind(this); 51 this._hideToastMessage = this._hideToastMessage.bind(this);
52 this._onSelectChannel = this._onSelectChannel.bind(this); 52 this._onSelectChannel = this._onSelectChannel.bind(this);
  53 + this._onChangeTab = this._onChangeTab.bind(this);
  54 +
53 this.subscription = NativeAppEventEmitter.addListener( 55 this.subscription = NativeAppEventEmitter.addListener(
54 'ChannelDidChangeEvent', 56 'ChannelDidChangeEvent',
55 (reminder) => { 57 (reminder) => {
@@ -66,6 +68,12 @@ class OutletContainer extends Component { @@ -66,6 +68,12 @@ class OutletContainer extends Component {
66 this.subscription && this.subscription.remove(); 68 this.subscription && this.subscription.remove();
67 } 69 }
68 70
  71 + _onChangeTab(sort_name){
  72 + let params = {
  73 + TAB_ID: sort_name,
  74 + }
  75 + ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_OUTLET_TAB_C', params);
  76 + }
69 _onSelectChannel(channel){ 77 _onSelectChannel(channel){
70 this.props.actions.setChannel(channel); 78 this.props.actions.setChannel(channel);
71 } 79 }
@@ -81,25 +89,49 @@ class OutletContainer extends Component { @@ -81,25 +89,49 @@ class OutletContainer extends Component {
81 this.props.actions.getOutletHomeResource(content_code,ptr); 89 this.props.actions.getOutletHomeResource(content_code,ptr);
82 } 90 }
83 91
84 - _getOutletActivityList(content_code,yh_channel,type){ 92 + _getOutletActivityList(content_code,yh_channel,type,tabLabel){
85 this.props.actions.getOutletActivityList(content_code,yh_channel,type); 93 this.props.actions.getOutletActivityList(content_code,yh_channel,type);
  94 + let params = {
  95 + TAB_ID: tabLabel,
  96 + }
  97 + ReactNative.NativeModules.YH_CommonHelper.logEvent('kAnalyticsYB_OUTLET_HOME_PAGE_L', params);
86 } 98 }
87 99
88 _setActivityFliter(content_code,activityMore) { 100 _setActivityFliter(content_code,activityMore) {
89 this.props.actions.setActivityFliter(content_code,activityMore); 101 this.props.actions.setActivityFliter(content_code,activityMore);
90 } 102 }
91 103
92 - _onPressProduct(url){ 104 + _onPressProduct(url,tabLabel,rowId=0,sectionId=0,templateName,template_id){
93 ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url); 105 ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
  106 + if (templateName) {
  107 + let params = {
  108 + TAB_ID: tabLabel,
  109 + F_ID: template_id,
  110 + F_NAME: templateName,
  111 + F_URL: url,
  112 + F_INDEX: parseInt(sectionId),
  113 + I_INDEX: parseInt(rowId)+1,
  114 + }
  115 + ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_OUTLET_FLR_C', params);
  116 + }
94 } 117 }
95 118
96 - _onPressProductListProduct(product) { 119 + _onPressProductListProduct(product,rowId=0,tabLabel,initialPage) {
97 let productSkn = product && product.get('product_skn', 0); 120 let productSkn = product && product.get('product_skn', 0);
98 if (!productSkn) { 121 if (!productSkn) {
99 return; 122 return;
100 } 123 }
101 let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"${productSkn}"}}`; 124 let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"${productSkn}"}}`;
102 ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url); 125 ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
  126 +
  127 + let productId = product && product.get('product_id', 0);
  128 + let params = {
  129 + TAB_ID: tabLabel,
  130 + SORT_TYPE: initialPage,
  131 + PRD_ID: productId,
  132 + PRD_NUM: parseInt(rowId)+1,
  133 + }
  134 + ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_OUTLET_GOODS_LIST_C', params);
103 } 135 }
104 136
105 _showToast(value){ 137 _showToast(value){
@@ -140,6 +172,7 @@ class OutletContainer extends Component { @@ -140,6 +172,7 @@ class OutletContainer extends Component {
140 onEndReached = {this._onEndReached} 172 onEndReached = {this._onEndReached}
141 showToast = {this._showToast} 173 showToast = {this._showToast}
142 hideToastMessage = {this._hideToastMessage} 174 hideToastMessage = {this._hideToastMessage}
  175 + onChangeTab = {this._onChangeTab}
143 /> 176 />
144 ); 177 );
145 } 178 }