|
|
'use strict';
|
|
|
|
|
|
import React, {Component} from 'react';
|
|
|
import ReactNative, {Platform, StyleSheet, View,Dimensions,} from 'react-native'
|
|
|
import ReactNative, {Platform, StyleSheet, View, Dimensions, NativeAppEventEmitter} from 'react-native'
|
|
|
|
|
|
import {bindActionCreators} from 'redux';
|
|
|
import {connect} from 'react-redux';
|
...
|
...
|
@@ -42,6 +42,7 @@ class GroupPurchaseDetailContainer extends Component { |
|
|
constructor(props) {
|
|
|
super(props);
|
|
|
this._onEndReached = this._onEndReached.bind(this);
|
|
|
this._didTouchBanner = this._didTouchBanner.bind(this);
|
|
|
this.updateTime = this.updateTime.bind(this);
|
|
|
this.didTouchProduct = this.didTouchProduct.bind(this);
|
|
|
this.goComment = this.goComment.bind(this);
|
...
|
...
|
@@ -51,15 +52,22 @@ class GroupPurchaseDetailContainer extends Component { |
|
|
this.showSnapshootShare = this.showSnapshootShare.bind(this);
|
|
|
this.shareSnapshootAction = this.shareSnapshootAction.bind(this);
|
|
|
|
|
|
this.subscription = NativeAppEventEmitter.addListener(
|
|
|
'ShareCollageDetailEvent',
|
|
|
() => {
|
|
|
this.props.actions.showShareView(true);
|
|
|
}
|
|
|
);
|
|
|
}
|
|
|
|
|
|
async componentDidMount() {
|
|
|
this.props.actions.getProductList();
|
|
|
this.props.actions.fetchActivityGroupDetail();
|
|
|
this.props.actions.fetchResourceInfo();
|
|
|
}
|
|
|
|
|
|
componentWillUnmount() {
|
|
|
|
|
|
this.subscription && this.subscription.remove();
|
|
|
}
|
|
|
|
|
|
updateTime(leftTime) {
|
...
|
...
|
@@ -74,7 +82,7 @@ class GroupPurchaseDetailContainer extends Component { |
|
|
let { activityId, groupNo, groupDetail } = this.props.groupPurchaseDetail;
|
|
|
if(pageGo == 1) {
|
|
|
this.props.actions.showShareView(true);
|
|
|
}else if (pageGo == 2) {
|
|
|
}else if (pageGo == 2 || pageGo == 5) {
|
|
|
let membershipItems = groupDetail.get('membershipItems');
|
|
|
let productDetail = membershipItems.size > 0 ? membershipItems.get(0) : new Map();
|
|
|
let productSkn = productDetail.get('productSkn');
|
...
|
...
|
@@ -91,7 +99,7 @@ class GroupPurchaseDetailContainer extends Component { |
|
|
ReactNative.NativeModules.YH_CommonHelper.showBuyPicker(params);
|
|
|
}else if (pageGo == 3) {
|
|
|
this.props.actions.showShareView(true);
|
|
|
}else if (pageGo == 4 || pageGo == 5 || pageGo == 7 || pageGo == 6) {
|
|
|
}else if (pageGo == 4 || pageGo == 7 || pageGo == 6) {
|
|
|
let url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.activitytemplate","params":{"type":"2", "activityId":"${activityId}"}}`;
|
|
|
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
|
|
|
}
|
...
|
...
|
@@ -109,6 +117,10 @@ class GroupPurchaseDetailContainer extends Component { |
|
|
this.props.actions.showSnapshootShare(false);
|
|
|
}
|
|
|
|
|
|
showShareView(show){
|
|
|
this.props.actions.showShareView(show);
|
|
|
}
|
|
|
|
|
|
didTouchProduct(productSkn,activityId,newSrc) {
|
|
|
if(newSrc){
|
|
|
let arr=newSrc.split("?");
|
...
|
...
|
@@ -123,8 +135,15 @@ class GroupPurchaseDetailContainer extends Component { |
|
|
ReactNative.NativeModules.YH_CommonHelper.goLinkUrl(url);
|
|
|
}
|
|
|
|
|
|
showShareView(show){
|
|
|
this.props.actions.showShareView(show);
|
|
|
_didTouchBanner(url) {
|
|
|
if (!url) {
|
|
|
return;
|
|
|
}
|
|
|
let params = {
|
|
|
URL: url,
|
|
|
};
|
|
|
ReactNative.NativeModules.YH_CommonHelper.logEvent('YB_GROUP_DEATIL_BANNER_C', params);
|
|
|
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
|
|
|
}
|
|
|
|
|
|
async shareMiniApp(){
|
...
|
...
|
@@ -182,6 +201,7 @@ class GroupPurchaseDetailContainer extends Component { |
|
|
showSnapshootShare,
|
|
|
groupDetail,
|
|
|
productList,
|
|
|
resourceInfo
|
|
|
} = this.props.groupPurchaseDetail;
|
|
|
|
|
|
let {
|
...
|
...
|
@@ -211,11 +231,13 @@ class GroupPurchaseDetailContainer extends Component { |
|
|
activityId={activityId}
|
|
|
productList={productList}
|
|
|
groupDetail={groupDetail}
|
|
|
resource={resourceInfo}
|
|
|
onEndReached={this._onEndReached}
|
|
|
updateTime={this.updateTime}
|
|
|
didTouchButton={this.didTouchButton}
|
|
|
didTouchProduct={this.didTouchProduct}
|
|
|
goComment={this.goComment}
|
|
|
didTouchBanner={this._didTouchBanner}
|
|
|
/>
|
|
|
</View>
|
|
|
);
|
...
|
...
|
|