@@ -274,31 +274,31 @@ - (void)p_doShareToSnsName:(NSString *)snsName{
274
274
}else if ([snsName isEqualToString: @" coding" ]){
275
275
PrivateMessage *curMsg = [PrivateMessage privateMessageWithObj: [self p_shareLinkStr ] andFriend: nil ];
276
276
[self willTranspondMessage: curMsg];
277
- }else if ([snsName isEqualToString: @" sina" ]){
278
- NSString *shareTitle, *shareText, *shareTail;
279
- shareTitle = [NSString stringWithFormat: @" 「%@ 」" , [self p_shareTitle ]];
280
- shareText = [self p_shareText ];
281
- shareTail = [NSString stringWithFormat: @" %@ (分享自@Coding)" , [self p_shareLinkStr ]];
282
- NSInteger maxShareLength = 140 ;
283
- NSInteger maxTextLength = maxShareLength - shareTitle.length - shareTail.length ;
284
- if (shareText.length > maxTextLength) {
285
- shareText = [shareText stringByReplacingCharactersInRange: NSMakeRange (maxTextLength - 3 , shareText.length - (maxTextLength - 3 )) withString: @" ..." ];
286
- }
287
- NSString *shareContent = [NSString stringWithFormat: @" %@%@%@ " , shareTitle, shareText, shareTail];
288
- [self showStatusBarQueryStr: @" 正在分享到新浪微博" ];
289
-
290
- UMSocialUrlResource *urlResource = nil ;
291
- NSString *imageUrl = [self p_imageUrlSquare: NO ];
292
- if (imageUrl.length > 0 ) {
293
- urlResource = [[UMSocialUrlResource alloc ] initWithSnsResourceType: UMSocialUrlResourceTypeImage url: imageUrl];
294
- }
295
- [[UMSocialDataService defaultDataService ] postSNSWithTypes: @[UMShareToSina] content: shareContent image: nil location: nil urlResource: urlResource presentedController: [BaseViewController presentingVC ] completion: ^(UMSocialResponseEntity *response) {
296
- if (response.responseCode == UMSResponseCodeSuccess) {
297
- [self showStatusBarSuccessStr: @" 分享成功" ];
298
- }else {
299
- [self showStatusBarErrorStr: @" 分享失败" ];
300
- }
301
- }];
277
+ // }else if ([snsName isEqualToString:@"sina"]){
278
+ // NSString *shareTitle, *shareText, *shareTail;
279
+ // shareTitle = [NSString stringWithFormat:@"「%@」", [self p_shareTitle]];
280
+ // shareText = [self p_shareText];
281
+ // shareTail = [NSString stringWithFormat:@"%@(分享自@Coding)", [self p_shareLinkStr]];
282
+ // NSInteger maxShareLength = 140;
283
+ // NSInteger maxTextLength = maxShareLength - shareTitle.length - shareTail.length;
284
+ // if (shareText.length > maxTextLength) {
285
+ // shareText = [shareText stringByReplacingCharactersInRange:NSMakeRange(maxTextLength - 3, shareText.length - (maxTextLength - 3)) withString:@"..."];
286
+ // }
287
+ // NSString *shareContent = [NSString stringWithFormat:@"%@%@%@", shareTitle, shareText, shareTail];
288
+ // [self showStatusBarQueryStr:@"正在分享到新浪微博"];
289
+ //
290
+ // UMSocialUrlResource *urlResource = nil;
291
+ // NSString *imageUrl = [self p_imageUrlSquare:NO];
292
+ // if (imageUrl.length > 0) {
293
+ // urlResource = [[UMSocialUrlResource alloc] initWithSnsResourceType:UMSocialUrlResourceTypeImage url:imageUrl];
294
+ // }
295
+ // [[UMSocialDataService defaultDataService] postSNSWithTypes:@[UMShareToSina] content:shareContent image:nil location:nil urlResource:urlResource presentedController:[BaseViewController presentingVC] completion:^(UMSocialResponseEntity *response) {
296
+ // if (response.responseCode == UMSResponseCodeSuccess) {
297
+ // [self showStatusBarSuccessStr:@"分享成功"];
298
+ // }else{
299
+ // [self showStatusBarErrorStr:@"分享失败"];
300
+ // }
301
+ // }];
302
302
}else if ([snsName isEqualToString: @" evernote" ]){
303
303
ENNote *noteToSave = [ENNote new ];
304
304
noteToSave.title = [self p_shareTitle ];
@@ -383,7 +383,9 @@ - (NSString *)p_imageUrlSquare:(BOOL)needSquare{
383
383
}else {
384
384
imageUrl = obj.src ;
385
385
}
386
- *stop = YES ;
386
+ *stop = YES ;// 结束查询
387
+ }else if (!needSquare && obj.type == HtmlMediaItemType_EmotionMonkey){
388
+ imageUrl = obj.src ;// 赋值为猴子,继续查询
387
389
}
388
390
}];
389
391
}
@@ -413,7 +415,7 @@ -(void)didFinishGetUMSocialDataInViewController:(UMSocialResponseEntity *)respon
413
415
if (response.responseCode == UMSResponseCodeSuccess){
414
416
NSString *snsName = [[response.data allKeys ] firstObject ];
415
417
NSLog (@" share to sns name is %@ " ,snsName);
416
- [self performSelector: @selector (showHudTipStr : ) withObject: @" 分享成功" afterDelay: 0.3 ];
418
+ [self performSelector: @selector (showStatusBarSuccessStr : ) withObject: @" 分享成功" afterDelay: 0.3 ];
417
419
}
418
420
}
419
421
@@ -422,7 +424,7 @@ -(void)didSelectSocialPlatform:(NSString *)platformName withSocialData:(UMSocial
422
424
{
423
425
socialData.shareText = [self p_shareText ];
424
426
socialData.shareImage = [UIImage imageNamed: @" logo_about" ];
425
- NSString *imageUrl = [self p_imageUrlSquare: YES ];
427
+ NSString *imageUrl = [self p_imageUrlSquare: ![platformName isEqualToString: @" sina " ] ];
426
428
socialData.urlResource .url = imageUrl;
427
429
socialData.urlResource .resourceType = imageUrl.length > 0 ? UMSocialUrlResourceTypeImage: UMSocialUrlResourceTypeDefault;
428
430
}
@@ -449,7 +451,22 @@ -(void)didSelectSocialPlatform:(NSString *)platformName withSocialData:(UMSocial
449
451
qzoneData.title = [self p_shareTitle ];
450
452
qzoneData.url = [self p_shareLinkStr ];
451
453
socialData.extConfig .qzoneData = qzoneData;
454
+ }else if ([platformName isEqualToString: @" sina" ]){
455
+ NSString *shareTitle, *shareText, *shareTail;
456
+ shareTitle = [NSString stringWithFormat: @" 「%@ 」" , [self p_shareTitle ]];
457
+ shareText = [self p_shareText ];
458
+ shareTail = [NSString stringWithFormat: @" %@ (分享自@Coding)" , [self p_shareLinkStr ]];
459
+ NSInteger maxShareLength = 140 ;
460
+ NSInteger maxTextLength = maxShareLength - shareTitle.length - shareTail.length ;
461
+ if (shareText.length > maxTextLength) {
462
+ shareText = [shareText stringByReplacingCharactersInRange: NSMakeRange (maxTextLength - 3 , shareText.length - (maxTextLength - 3 )) withString: @" ..." ];
463
+ }
464
+ NSString *shareContent = [NSString stringWithFormat: @" %@%@%@ " , shareTitle, shareText, shareTail];
465
+
466
+ socialData.shareText = shareContent;
467
+ socialData.shareImage = nil ;
452
468
}
469
+
453
470
NSLog (@" %@ : %@ " , platformName, socialData);
454
471
}
455
472
0 commit comments