Authored by 孙凯

Add share review by chenlin

... ... @@ -37,6 +37,7 @@ export default class ShareViewModal extends React.Component {
<View style={styles.topView}/>
</TouchableWithoutFeedback>
<View style={styles.shareView}>
<View style={styles.buttonViews}>
<View style={styles.buttons}>
<TouchableOpacity activeOpacity={0.5} style={styles.button1} onPress={() => {
this.props.shareMiniApp && this.props.shareMiniApp();
... ... @@ -63,6 +64,20 @@ export default class ShareViewModal extends React.Component {
<Text style={styles.text}>微博</Text>
</TouchableOpacity>
</View>
<View style={styles.buttons}>
<TouchableOpacity activeOpacity={0.5} style={styles.button1} onPress={() => {
this.props.shareWXSceneTimeline && this.props.shareWXSceneTimeline();
}}>
<Image source={unionType ? require('../images/unionShare_timeline_icon.png') : require('../images/weixin.png')} style={styles.icon} />
<Text style={styles.text}>朋友圈</Text>
</TouchableOpacity>
<View style={styles.button1}/>
<View style={styles.button1}/>
<View style={styles.button1}/>
</View>
</View>
<View style={styles.line}/>
<TouchableOpacity activeOpacity={0.5} style={styles.cancel} onPress={() => {
this.props.showShareView && this.props.showShareView(false);
... ... @@ -92,7 +107,7 @@ let styles = StyleSheet.create({
},
shareView: {
width,
height: 171*DEVICE_WIDTH_RATIO,
height: 256*DEVICE_WIDTH_RATIO,
backgroundColor: 'white',
alignItems: 'center',
},
... ... @@ -101,13 +116,18 @@ let styles = StyleSheet.create({
height: 88*DEVICE_WIDTH_RATIO,
marginTop: 25*DEVICE_WIDTH_RATIO,
},
buttons: {
buttonViews: {
width,
height: 115*DEVICE_WIDTH_RATIO,
alignItems: 'center',
justifyContent: 'center',
flexDirection: 'row',
height: 200*DEVICE_WIDTH_RATIO,
},
buttons: {
width,
height: 100*DEVICE_WIDTH_RATIO,
alignItems: 'center',
justifyContent: 'center',
flexDirection: 'row',
},
button1: {
width: 90*DEVICE_WIDTH_RATIO,
alignItems: 'center',
... ...
... ... @@ -50,6 +50,7 @@ class GroupPurchaseContainer extends Component {
this.shareMiniApp = this.shareMiniApp.bind(this);
this.shareWeiBoApp = this.shareWeiBoApp.bind(this);
this.shareQQApp = this.shareQQApp.bind(this);
this.shareWXSceneTimeline = this.shareWXSceneTimeline.bind(this);
this.showSnapshootShare = this.showSnapshootShare.bind(this);
this.shareSnapshootAction = this.shareSnapshootAction.bind(this);
this.jumpToMinePurchaseOrder = this.jumpToMinePurchaseOrder.bind(this);
... ... @@ -150,6 +151,32 @@ class GroupPurchaseContainer extends Component {
ReactNative.NativeModules.YH_CommonHelper.shareWXMiniProgram(param);
}
shareWXSceneTimeline() {
this.props.actions.showShareView(false);
let fromPage = 'GroupPurchase';
let {
activityId,
shareCodeInfo,
} = this.props.groupPurchase;
let { unionType } = this.props.app;
let bigImage = shareCodeInfo.get('bigImage');
let productIcon = bigImage ? getSlicedUrl(bigImage,150*DEVICE_WIDTH_RATIO, 120*DEVICE_WIDTH_RATIO, 2) : '';
let shareUrl = `https://m.yohobuy.com/activity/group/list?productPool="${activityId}"&type=2&title=&groupPurchase=&union_type="${unionType}"`;
InteractionManager.runAfterInteractions(()=>{
let param = {
isText: 'text',
shareType: 'WXSceneTimeline',
imageUrl: productIcon,
title: shareUrl,
fromPage,
}
ReactNative.NativeModules.YH_CommonHelper.shareImageToWXMini(param);
});
}
shareWeiBoApp() {
this.props.actions.showShareView(false);
... ... @@ -157,10 +184,11 @@ class GroupPurchaseContainer extends Component {
activityId,
shareCodeInfo,
} = this.props.groupPurchase;
let { unionType } = this.props.app;
let bigImage = shareCodeInfo.get('bigImage');
let productIcon = bigImage ? getSlicedUrl(bigImage,150*DEVICE_WIDTH_RATIO, 120*DEVICE_WIDTH_RATIO, 2) : '';
let shareUrl = `https://m.yohobuy.com/activity/group/list?productPool="${activityId}"&type=2&title=&groupPurchase=`;
let shareUrl = `https://m.yohobuy.com/activity/group/list?productPool="${activityId}"&type=2&title=&groupPurchase=&union_type="${unionType}"`;
InteractionManager.runAfterInteractions(()=>{
let param = {
... ... @@ -180,10 +208,11 @@ class GroupPurchaseContainer extends Component {
activityId,
shareCodeInfo,
} = this.props.groupPurchase;
let { unionType } = this.props.app;
let bigImage = shareCodeInfo.get('bigImage');
let productIcon = bigImage ? getSlicedUrl(bigImage,150*DEVICE_WIDTH_RATIO, 120*DEVICE_WIDTH_RATIO, 2) : '';
let shareUrl = `https://m.yohobuy.com/activity/group/list?productPool="${activityId}"&type=2&title=&groupPurchase=`;
let shareUrl = `https://m.yohobuy.com/activity/group/list?productPool="${activityId}"&type=2&title=&groupPurchase=&union_type="${unionType}"`;
InteractionManager.runAfterInteractions(()=>{
let param = {
... ... @@ -232,7 +261,7 @@ class GroupPurchaseContainer extends Component {
return (
<View style={styles.container}>
<ShareViewModal show={showShareView} unionType={unionType} showShareView={this.showShareView} shareMiniApp={this.shareMiniApp} shareWeiBoApp={this.shareWeiBoApp} shareQQApp={this.shareQQApp} showSnapshootShare={this.showSnapshootShare}/>
<ShareViewModal show={showShareView} unionType={unionType} showShareView={this.showShareView} shareMiniApp={this.shareMiniApp} shareWeiBoApp={this.shareWeiBoApp} shareQQApp={this.shareQQApp} shareWXSceneTimeline={this.shareWXSceneTimeline} showSnapshootShare={this.showSnapshootShare}/>
<ListSnapshootShare
show={showSnapshootShare}
unionType={unionType}
... ...
... ... @@ -51,6 +51,7 @@ class GroupPurchaseDetailContainer extends Component {
this.shareMiniApp = this.shareMiniApp.bind(this);
this.shareWeiBoApp = this.shareWeiBoApp.bind(this);
this.shareQQApp = this.shareQQApp.bind(this);
this.shareWXSceneTimeline = this.shareWXSceneTimeline.bind(this);
this.showSnapshootShare = this.showSnapshootShare.bind(this);
this.shareSnapshootAction = this.shareSnapshootAction.bind(this);
... ... @@ -186,6 +187,43 @@ class GroupPurchaseDetailContainer extends Component {
ReactNative.NativeModules.YH_CommonHelper.shareWXMiniProgram(param);
}
shareWXSceneTimeline() {
this.props.actions.showShareView(false);
let {
activityId,
groupNo,
groupDetail,
} = this.props.groupPurchaseDetail;
let { unionType } = this.props.app;
let productDetail = groupDetail ? groupDetail.toJS():null;
if(!productDetail){
return;
}
let membershipItems = productDetail.membershipItems;
let resource = membershipItems ? membershipItems[0]: null;
let lackNum = productDetail ? productDetail.lackNum : 0;
if (!resource) {
return;
}
let productIcon = resource.productIcon ? getSlicedUrl(resource.productIcon,150*DEVICE_WIDTH_RATIO, 120*DEVICE_WIDTH_RATIO, 2) : '';
let productGroupPrice = resource.productGroupPrice;
let productName = resource.productName;
let title = '【还差' + lackNum + '人】' + productGroupPrice + '拼' + productName;
let shareUrl = `http://m.yohobuy.com/activity/group/progress?groupNo="${groupNo}"&activityId="${activityId}"&union_type="${unionType}"`;
InteractionManager.runAfterInteractions(()=>{
let param = {
isText: 'text',
shareType: 'WXSceneTimeline',
imageUrl: productIcon,
title: shareUrl,
}
ReactNative.NativeModules.YH_CommonHelper.shareImageToWXMini(param);
});
}
shareWeiBoApp() {
this.props.actions.showShareView(false);
... ... @@ -210,7 +248,7 @@ class GroupPurchaseDetailContainer extends Component {
let productName = resource.productName;
let title = '【还差' + lackNum + '人】' + productGroupPrice + '拼' + productName;
let shareUrl = `http://m.yohobuy.com/activity/group/progress?groupNo="${groupNo}"&activityId="${activityId}"`;
let shareUrl = `http://m.yohobuy.com/activity/group/progress?groupNo="${groupNo}"&activityId="${activityId}"&union_type="${unionType}"`;
InteractionManager.runAfterInteractions(()=>{
let param = {
title,
... ... @@ -246,7 +284,7 @@ class GroupPurchaseDetailContainer extends Component {
let productName = resource.productName;
let title = '【还差' + lackNum + '人】' + productGroupPrice + '拼' + productName;
let shareUrl = `http://m.yohobuy.com/activity/group/progress?groupNo="${groupNo}"&activityId="${activityId}"`;
let shareUrl = `http://m.yohobuy.com/activity/group/progress?groupNo="${groupNo}"&activityId="${activityId}"&union_type="${unionType}"`;
InteractionManager.runAfterInteractions(()=>{
let param = {
... ... @@ -293,7 +331,7 @@ class GroupPurchaseDetailContainer extends Component {
return (
<View style={styles.container}>
<ShareViewModal show={showShareView} unionType={unionType} showShareView={this.showShareView} shareMiniApp={this.shareMiniApp} shareWeiBoApp={this.shareWeiBoApp} shareQQApp={this.shareQQApp} showSnapshootShare={this.showSnapshootShare}/>
<ShareViewModal show={showShareView} unionType={unionType} showShareView={this.showShareView} shareMiniApp={this.shareMiniApp} shareWeiBoApp={this.shareWeiBoApp} shareWXSceneTimeline={this.shareWXSceneTimeline} shareQQApp={this.shareQQApp} showSnapshootShare={this.showSnapshootShare}/>
<SnapshootShare
show={showSnapshootShare}
unionType={unionType}
... ...