@@ -274,31 +274,31 @@ - (void)p_doShareToSnsName:(NSString *)snsName{
274274 }else if ([snsName isEqualToString: @" coding" ]){
275275 PrivateMessage *curMsg = [PrivateMessage privateMessageWithObj: [self p_shareLinkStr ] andFriend: nil ];
276276 [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+ // }];
302302 }else if ([snsName isEqualToString: @" evernote" ]){
303303 ENNote *noteToSave = [ENNote new ];
304304 noteToSave.title = [self p_shareTitle ];
@@ -383,7 +383,9 @@ - (NSString *)p_imageUrlSquare:(BOOL)needSquare{
383383 }else {
384384 imageUrl = obj.src ;
385385 }
386- *stop = YES ;
386+ *stop = YES ;// 结束查询
387+ }else if (!needSquare && obj.type == HtmlMediaItemType_EmotionMonkey){
388+ imageUrl = obj.src ;// 赋值为猴子,继续查询
387389 }
388390 }];
389391 }
@@ -413,7 +415,7 @@ -(void)didFinishGetUMSocialDataInViewController:(UMSocialResponseEntity *)respon
413415 if (response.responseCode == UMSResponseCodeSuccess){
414416 NSString *snsName = [[response.data allKeys ] firstObject ];
415417 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 ];
417419 }
418420}
419421
@@ -422,7 +424,7 @@ -(void)didSelectSocialPlatform:(NSString *)platformName withSocialData:(UMSocial
422424 {
423425 socialData.shareText = [self p_shareText ];
424426 socialData.shareImage = [UIImage imageNamed: @" logo_about" ];
425- NSString *imageUrl = [self p_imageUrlSquare: YES ];
427+ NSString *imageUrl = [self p_imageUrlSquare: ![platformName isEqualToString: @" sina " ] ];
426428 socialData.urlResource .url = imageUrl;
427429 socialData.urlResource .resourceType = imageUrl.length > 0 ? UMSocialUrlResourceTypeImage: UMSocialUrlResourceTypeDefault;
428430 }
@@ -449,7 +451,22 @@ -(void)didSelectSocialPlatform:(NSString *)platformName withSocialData:(UMSocial
449451 qzoneData.title = [self p_shareTitle ];
450452 qzoneData.url = [self p_shareLinkStr ];
451453 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 ;
452468 }
469+
453470 NSLog (@" %@ : %@ " , platformName, socialData);
454471}
455472
0 commit comments