|
|
'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){
|
...
|
...
|
|