Authored by 孙凯

Add share to QQ and Weibo review by chenlin

... ... @@ -53,13 +53,13 @@ export default class ShareViewModal extends React.Component {
<TouchableOpacity activeOpacity={0.5} style={styles.button1} onPress={() => {
this.props.shareQQApp && this.props.shareQQApp();
}}>
<Image source={unionType ? require('../images/unionShare_qr_icon.png') : require('../images/pengyou.png')} style={styles.icon} />
<Image source={unionType ? require('../images/unionShare_qq_icon.png') : require('../images/pengyou.png')} style={styles.icon} />
<Text style={styles.text}>QQ</Text>
</TouchableOpacity>
<TouchableOpacity activeOpacity={0.5} style={styles.button1} onPress={() => {
this.props.shareWeiBoApp && this.props.shareWeiBoApp();
}}>
<Image source={unionType ? require('../images/unionShare_qr_icon.png') : require('../images/pengyou.png')} style={styles.icon} />
<Image source={unionType ? require('../images/unionShare_sina_icon.png') : require('../images/pengyou.png')} style={styles.icon} />
<Text style={styles.text}>微博</Text>
</TouchableOpacity>
</View>
... ...
'use strict';
import React, {Component} from 'react';
import ReactNative, {Dimensions, NativeAppEventEmitter, Platform, StyleSheet, View} from 'react-native'
import ReactNative, {Dimensions, NativeAppEventEmitter, InteractionManager, StyleSheet, View} from 'react-native'
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
... ... @@ -151,15 +151,51 @@ class GroupPurchaseContainer extends Component {
}
shareWeiBoApp() {
console.log('shareWeiBoApp');
this.props.actions.showShareView(false);
}
let {
activityId,
shareCodeInfo,
} = this.props.groupPurchase;
shareQQApp() {
console.log('shareQQApp');
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=`;
InteractionManager.runAfterInteractions(()=>{
let param = {
title: shareCodeInfo.get('title'),
shareImageUrl: productIcon,
content: '',
shareUrl,
}
ReactNative.NativeModules.YH_CommonHelper.shareToSina(param);
});
}
shareQQApp() {
this.props.actions.showShareView(false);
}
let {
activityId,
shareCodeInfo,
} = this.props.groupPurchase;
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=`;
InteractionManager.runAfterInteractions(()=>{
let param = {
title: shareCodeInfo.get('title'),
shareImageUrl: productIcon,
content: '',
shareUrl,
}
ReactNative.NativeModules.YH_CommonHelper.sendQQChat(param);
});
}
showSnapshootShare(show){
this.props.actions.showShareView(false);
this.props.actions.showSnapshootShare(show);
... ...
'use strict';
import React, {Component} from 'react';
import ReactNative, {Platform, StyleSheet, View, Dimensions, NativeAppEventEmitter} from 'react-native'
import ReactNative, {InteractionManager, StyleSheet, View, Dimensions, NativeAppEventEmitter} from 'react-native'
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
... ... @@ -187,13 +187,76 @@ class GroupPurchaseDetailContainer extends Component {
}
shareWeiBoApp() {
console.log('shareWeiBoApp');
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}"`;
InteractionManager.runAfterInteractions(()=>{
let param = {
title,
shareImageUrl: productIcon,
content: '',
shareUrl,
}
ReactNative.NativeModules.YH_CommonHelper.shareToSina(param);
});
}
shareQQApp() {
console.log('shareQQApp');
this.props.actions.showShareView(false);
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}"`;
InteractionManager.runAfterInteractions(()=>{
let param = {
title,
shareImageUrl: productIcon,
content: '',
shareUrl,
}
ReactNative.NativeModules.YH_CommonHelper.sendQQChat(param);
});
}
showSnapshootShare(show){
... ...