Authored by 孙凯

Add share review by chenlin

@@ -37,6 +37,7 @@ export default class ShareViewModal extends React.Component { @@ -37,6 +37,7 @@ export default class ShareViewModal extends React.Component {
37 <View style={styles.topView}/> 37 <View style={styles.topView}/>
38 </TouchableWithoutFeedback> 38 </TouchableWithoutFeedback>
39 <View style={styles.shareView}> 39 <View style={styles.shareView}>
  40 + <View style={styles.buttonViews}>
40 <View style={styles.buttons}> 41 <View style={styles.buttons}>
41 <TouchableOpacity activeOpacity={0.5} style={styles.button1} onPress={() => { 42 <TouchableOpacity activeOpacity={0.5} style={styles.button1} onPress={() => {
42 this.props.shareMiniApp && this.props.shareMiniApp(); 43 this.props.shareMiniApp && this.props.shareMiniApp();
@@ -63,6 +64,20 @@ export default class ShareViewModal extends React.Component { @@ -63,6 +64,20 @@ export default class ShareViewModal extends React.Component {
63 <Text style={styles.text}>微博</Text> 64 <Text style={styles.text}>微博</Text>
64 </TouchableOpacity> 65 </TouchableOpacity>
65 </View> 66 </View>
  67 + <View style={styles.buttons}>
  68 + <TouchableOpacity activeOpacity={0.5} style={styles.button1} onPress={() => {
  69 + this.props.shareWXSceneTimeline && this.props.shareWXSceneTimeline();
  70 + }}>
  71 + <Image source={unionType ? require('../images/unionShare_timeline_icon.png') : require('../images/weixin.png')} style={styles.icon} />
  72 + <Text style={styles.text}>朋友圈</Text>
  73 + </TouchableOpacity>
  74 +
  75 + <View style={styles.button1}/>
  76 + <View style={styles.button1}/>
  77 + <View style={styles.button1}/>
  78 +
  79 + </View>
  80 + </View>
66 <View style={styles.line}/> 81 <View style={styles.line}/>
67 <TouchableOpacity activeOpacity={0.5} style={styles.cancel} onPress={() => { 82 <TouchableOpacity activeOpacity={0.5} style={styles.cancel} onPress={() => {
68 this.props.showShareView && this.props.showShareView(false); 83 this.props.showShareView && this.props.showShareView(false);
@@ -92,7 +107,7 @@ let styles = StyleSheet.create({ @@ -92,7 +107,7 @@ let styles = StyleSheet.create({
92 }, 107 },
93 shareView: { 108 shareView: {
94 width, 109 width,
95 - height: 171*DEVICE_WIDTH_RATIO, 110 + height: 256*DEVICE_WIDTH_RATIO,
96 backgroundColor: 'white', 111 backgroundColor: 'white',
97 alignItems: 'center', 112 alignItems: 'center',
98 }, 113 },
@@ -101,13 +116,18 @@ let styles = StyleSheet.create({ @@ -101,13 +116,18 @@ let styles = StyleSheet.create({
101 height: 88*DEVICE_WIDTH_RATIO, 116 height: 88*DEVICE_WIDTH_RATIO,
102 marginTop: 25*DEVICE_WIDTH_RATIO, 117 marginTop: 25*DEVICE_WIDTH_RATIO,
103 }, 118 },
104 - buttons: { 119 + buttonViews: {
105 width, 120 width,
106 - height: 115*DEVICE_WIDTH_RATIO,  
107 - alignItems: 'center',  
108 - justifyContent: 'center',  
109 - flexDirection: 'row', 121 + height: 200*DEVICE_WIDTH_RATIO,
110 }, 122 },
  123 + buttons: {
  124 + width,
  125 + height: 100*DEVICE_WIDTH_RATIO,
  126 + alignItems: 'center',
  127 + justifyContent: 'center',
  128 + flexDirection: 'row',
  129 + },
  130 +
111 button1: { 131 button1: {
112 width: 90*DEVICE_WIDTH_RATIO, 132 width: 90*DEVICE_WIDTH_RATIO,
113 alignItems: 'center', 133 alignItems: 'center',
@@ -50,6 +50,7 @@ class GroupPurchaseContainer extends Component { @@ -50,6 +50,7 @@ class GroupPurchaseContainer extends Component {
50 this.shareMiniApp = this.shareMiniApp.bind(this); 50 this.shareMiniApp = this.shareMiniApp.bind(this);
51 this.shareWeiBoApp = this.shareWeiBoApp.bind(this); 51 this.shareWeiBoApp = this.shareWeiBoApp.bind(this);
52 this.shareQQApp = this.shareQQApp.bind(this); 52 this.shareQQApp = this.shareQQApp.bind(this);
  53 + this.shareWXSceneTimeline = this.shareWXSceneTimeline.bind(this);
53 this.showSnapshootShare = this.showSnapshootShare.bind(this); 54 this.showSnapshootShare = this.showSnapshootShare.bind(this);
54 this.shareSnapshootAction = this.shareSnapshootAction.bind(this); 55 this.shareSnapshootAction = this.shareSnapshootAction.bind(this);
55 this.jumpToMinePurchaseOrder = this.jumpToMinePurchaseOrder.bind(this); 56 this.jumpToMinePurchaseOrder = this.jumpToMinePurchaseOrder.bind(this);
@@ -150,6 +151,32 @@ class GroupPurchaseContainer extends Component { @@ -150,6 +151,32 @@ class GroupPurchaseContainer extends Component {
150 ReactNative.NativeModules.YH_CommonHelper.shareWXMiniProgram(param); 151 ReactNative.NativeModules.YH_CommonHelper.shareWXMiniProgram(param);
151 } 152 }
152 153
  154 + shareWXSceneTimeline() {
  155 + this.props.actions.showShareView(false);
  156 +
  157 + let fromPage = 'GroupPurchase';
  158 + let {
  159 + activityId,
  160 + shareCodeInfo,
  161 + } = this.props.groupPurchase;
  162 + let { unionType } = this.props.app;
  163 +
  164 + let bigImage = shareCodeInfo.get('bigImage');
  165 + let productIcon = bigImage ? getSlicedUrl(bigImage,150*DEVICE_WIDTH_RATIO, 120*DEVICE_WIDTH_RATIO, 2) : '';
  166 + let shareUrl = `https://m.yohobuy.com/activity/group/list?productPool="${activityId}"&type=2&title=&groupPurchase=&union_type="${unionType}"`;
  167 +
  168 + InteractionManager.runAfterInteractions(()=>{
  169 + let param = {
  170 + isText: 'text',
  171 + shareType: 'WXSceneTimeline',
  172 + imageUrl: productIcon,
  173 + title: shareUrl,
  174 + fromPage,
  175 + }
  176 + ReactNative.NativeModules.YH_CommonHelper.shareImageToWXMini(param);
  177 + });
  178 + }
  179 +
153 shareWeiBoApp() { 180 shareWeiBoApp() {
154 this.props.actions.showShareView(false); 181 this.props.actions.showShareView(false);
155 182
@@ -157,10 +184,11 @@ class GroupPurchaseContainer extends Component { @@ -157,10 +184,11 @@ class GroupPurchaseContainer extends Component {
157 activityId, 184 activityId,
158 shareCodeInfo, 185 shareCodeInfo,
159 } = this.props.groupPurchase; 186 } = this.props.groupPurchase;
  187 + let { unionType } = this.props.app;
160 188
161 let bigImage = shareCodeInfo.get('bigImage'); 189 let bigImage = shareCodeInfo.get('bigImage');
162 let productIcon = bigImage ? getSlicedUrl(bigImage,150*DEVICE_WIDTH_RATIO, 120*DEVICE_WIDTH_RATIO, 2) : ''; 190 let productIcon = bigImage ? getSlicedUrl(bigImage,150*DEVICE_WIDTH_RATIO, 120*DEVICE_WIDTH_RATIO, 2) : '';
163 - let shareUrl = `https://m.yohobuy.com/activity/group/list?productPool="${activityId}"&type=2&title=&groupPurchase=`; 191 + let shareUrl = `https://m.yohobuy.com/activity/group/list?productPool="${activityId}"&type=2&title=&groupPurchase=&union_type="${unionType}"`;
164 192
165 InteractionManager.runAfterInteractions(()=>{ 193 InteractionManager.runAfterInteractions(()=>{
166 let param = { 194 let param = {
@@ -180,10 +208,11 @@ class GroupPurchaseContainer extends Component { @@ -180,10 +208,11 @@ class GroupPurchaseContainer extends Component {
180 activityId, 208 activityId,
181 shareCodeInfo, 209 shareCodeInfo,
182 } = this.props.groupPurchase; 210 } = this.props.groupPurchase;
  211 + let { unionType } = this.props.app;
183 212
184 let bigImage = shareCodeInfo.get('bigImage'); 213 let bigImage = shareCodeInfo.get('bigImage');
185 let productIcon = bigImage ? getSlicedUrl(bigImage,150*DEVICE_WIDTH_RATIO, 120*DEVICE_WIDTH_RATIO, 2) : ''; 214 let productIcon = bigImage ? getSlicedUrl(bigImage,150*DEVICE_WIDTH_RATIO, 120*DEVICE_WIDTH_RATIO, 2) : '';
186 - let shareUrl = `https://m.yohobuy.com/activity/group/list?productPool="${activityId}"&type=2&title=&groupPurchase=`; 215 + let shareUrl = `https://m.yohobuy.com/activity/group/list?productPool="${activityId}"&type=2&title=&groupPurchase=&union_type="${unionType}"`;
187 216
188 InteractionManager.runAfterInteractions(()=>{ 217 InteractionManager.runAfterInteractions(()=>{
189 let param = { 218 let param = {
@@ -232,7 +261,7 @@ class GroupPurchaseContainer extends Component { @@ -232,7 +261,7 @@ class GroupPurchaseContainer extends Component {
232 261
233 return ( 262 return (
234 <View style={styles.container}> 263 <View style={styles.container}>
235 - <ShareViewModal show={showShareView} unionType={unionType} showShareView={this.showShareView} shareMiniApp={this.shareMiniApp} shareWeiBoApp={this.shareWeiBoApp} shareQQApp={this.shareQQApp} showSnapshootShare={this.showSnapshootShare}/> 264 + <ShareViewModal show={showShareView} unionType={unionType} showShareView={this.showShareView} shareMiniApp={this.shareMiniApp} shareWeiBoApp={this.shareWeiBoApp} shareQQApp={this.shareQQApp} shareWXSceneTimeline={this.shareWXSceneTimeline} showSnapshootShare={this.showSnapshootShare}/>
236 <ListSnapshootShare 265 <ListSnapshootShare
237 show={showSnapshootShare} 266 show={showSnapshootShare}
238 unionType={unionType} 267 unionType={unionType}
@@ -51,6 +51,7 @@ class GroupPurchaseDetailContainer extends Component { @@ -51,6 +51,7 @@ class GroupPurchaseDetailContainer extends Component {
51 this.shareMiniApp = this.shareMiniApp.bind(this); 51 this.shareMiniApp = this.shareMiniApp.bind(this);
52 this.shareWeiBoApp = this.shareWeiBoApp.bind(this); 52 this.shareWeiBoApp = this.shareWeiBoApp.bind(this);
53 this.shareQQApp = this.shareQQApp.bind(this); 53 this.shareQQApp = this.shareQQApp.bind(this);
  54 + this.shareWXSceneTimeline = this.shareWXSceneTimeline.bind(this);
54 this.showSnapshootShare = this.showSnapshootShare.bind(this); 55 this.showSnapshootShare = this.showSnapshootShare.bind(this);
55 this.shareSnapshootAction = this.shareSnapshootAction.bind(this); 56 this.shareSnapshootAction = this.shareSnapshootAction.bind(this);
56 57
@@ -186,6 +187,43 @@ class GroupPurchaseDetailContainer extends Component { @@ -186,6 +187,43 @@ class GroupPurchaseDetailContainer extends Component {
186 ReactNative.NativeModules.YH_CommonHelper.shareWXMiniProgram(param); 187 ReactNative.NativeModules.YH_CommonHelper.shareWXMiniProgram(param);
187 } 188 }
188 189
  190 + shareWXSceneTimeline() {
  191 +
  192 + this.props.actions.showShareView(false);
  193 +
  194 + let {
  195 + activityId,
  196 + groupNo,
  197 + groupDetail,
  198 + } = this.props.groupPurchaseDetail;
  199 + let { unionType } = this.props.app;
  200 + let productDetail = groupDetail ? groupDetail.toJS():null;
  201 + if(!productDetail){
  202 + return;
  203 + }
  204 + let membershipItems = productDetail.membershipItems;
  205 + let resource = membershipItems ? membershipItems[0]: null;
  206 + let lackNum = productDetail ? productDetail.lackNum : 0;
  207 + if (!resource) {
  208 + return;
  209 + }
  210 + let productIcon = resource.productIcon ? getSlicedUrl(resource.productIcon,150*DEVICE_WIDTH_RATIO, 120*DEVICE_WIDTH_RATIO, 2) : '';
  211 + let productGroupPrice = resource.productGroupPrice;
  212 + let productName = resource.productName;
  213 + let title = '【还差' + lackNum + '人】' + productGroupPrice + '拼' + productName;
  214 +
  215 + let shareUrl = `http://m.yohobuy.com/activity/group/progress?groupNo="${groupNo}"&activityId="${activityId}"&union_type="${unionType}"`;
  216 + InteractionManager.runAfterInteractions(()=>{
  217 + let param = {
  218 + isText: 'text',
  219 + shareType: 'WXSceneTimeline',
  220 + imageUrl: productIcon,
  221 + title: shareUrl,
  222 + }
  223 + ReactNative.NativeModules.YH_CommonHelper.shareImageToWXMini(param);
  224 + });
  225 + }
  226 +
189 shareWeiBoApp() { 227 shareWeiBoApp() {
190 this.props.actions.showShareView(false); 228 this.props.actions.showShareView(false);
191 229
@@ -210,7 +248,7 @@ class GroupPurchaseDetailContainer extends Component { @@ -210,7 +248,7 @@ class GroupPurchaseDetailContainer extends Component {
210 let productName = resource.productName; 248 let productName = resource.productName;
211 let title = '【还差' + lackNum + '人】' + productGroupPrice + '拼' + productName; 249 let title = '【还差' + lackNum + '人】' + productGroupPrice + '拼' + productName;
212 250
213 - let shareUrl = `http://m.yohobuy.com/activity/group/progress?groupNo="${groupNo}"&activityId="${activityId}"`; 251 + let shareUrl = `http://m.yohobuy.com/activity/group/progress?groupNo="${groupNo}"&activityId="${activityId}"&union_type="${unionType}"`;
214 InteractionManager.runAfterInteractions(()=>{ 252 InteractionManager.runAfterInteractions(()=>{
215 let param = { 253 let param = {
216 title, 254 title,
@@ -246,7 +284,7 @@ class GroupPurchaseDetailContainer extends Component { @@ -246,7 +284,7 @@ class GroupPurchaseDetailContainer extends Component {
246 let productName = resource.productName; 284 let productName = resource.productName;
247 let title = '【还差' + lackNum + '人】' + productGroupPrice + '拼' + productName; 285 let title = '【还差' + lackNum + '人】' + productGroupPrice + '拼' + productName;
248 286
249 - let shareUrl = `http://m.yohobuy.com/activity/group/progress?groupNo="${groupNo}"&activityId="${activityId}"`; 287 + let shareUrl = `http://m.yohobuy.com/activity/group/progress?groupNo="${groupNo}"&activityId="${activityId}"&union_type="${unionType}"`;
250 288
251 InteractionManager.runAfterInteractions(()=>{ 289 InteractionManager.runAfterInteractions(()=>{
252 let param = { 290 let param = {
@@ -293,7 +331,7 @@ class GroupPurchaseDetailContainer extends Component { @@ -293,7 +331,7 @@ class GroupPurchaseDetailContainer extends Component {
293 331
294 return ( 332 return (
295 <View style={styles.container}> 333 <View style={styles.container}>
296 - <ShareViewModal show={showShareView} unionType={unionType} showShareView={this.showShareView} shareMiniApp={this.shareMiniApp} shareWeiBoApp={this.shareWeiBoApp} shareQQApp={this.shareQQApp} showSnapshootShare={this.showSnapshootShare}/> 334 + <ShareViewModal show={showShareView} unionType={unionType} showShareView={this.showShareView} shareMiniApp={this.shareMiniApp} shareWeiBoApp={this.shareWeiBoApp} shareWXSceneTimeline={this.shareWXSceneTimeline} shareQQApp={this.shareQQApp} showSnapshootShare={this.showSnapshootShare}/>
297 <SnapshootShare 335 <SnapshootShare
298 show={showSnapshootShare} 336 show={showSnapshootShare}
299 unionType={unionType} 337 unionType={unionType}