Commit 6c8072cc authored by Sandy's avatar Sandy

自定义分享界面

parent 4607f7d4
...@@ -51,6 +51,9 @@ ...@@ -51,6 +51,9 @@
192860FF1CBF708C00FA6E85 /* MBProgressHUD+Javen.m in Sources */ = {isa = PBXBuildFile; fileRef = 192860FE1CBF708C00FA6E85 /* MBProgressHUD+Javen.m */; }; 192860FF1CBF708C00FA6E85 /* MBProgressHUD+Javen.m in Sources */ = {isa = PBXBuildFile; fileRef = 192860FE1CBF708C00FA6E85 /* MBProgressHUD+Javen.m */; };
192861041CBF825100FA6E85 /* JavenOwner.m in Sources */ = {isa = PBXBuildFile; fileRef = 192861011CBF825100FA6E85 /* JavenOwner.m */; }; 192861041CBF825100FA6E85 /* JavenOwner.m in Sources */ = {isa = PBXBuildFile; fileRef = 192861011CBF825100FA6E85 /* JavenOwner.m */; };
192861051CBF825100FA6E85 /* JavenShop.m in Sources */ = {isa = PBXBuildFile; fileRef = 192861031CBF825100FA6E85 /* JavenShop.m */; }; 192861051CBF825100FA6E85 /* JavenShop.m in Sources */ = {isa = PBXBuildFile; fileRef = 192861031CBF825100FA6E85 /* JavenShop.m */; };
192900741CD0B7AE00D226E7 /* ShareContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 192900731CD0B7AE00D226E7 /* ShareContentView.m */; };
192900761CD0B7C000D226E7 /* ShareContentView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 192900751CD0B7C000D226E7 /* ShareContentView.xib */; };
192900811CD1AECB00D226E7 /* ShareInstance.m in Sources */ = {isa = PBXBuildFile; fileRef = 192900801CD1AECB00D226E7 /* ShareInstance.m */; };
1929401F1CC8DA5B00E377EE /* InvitePartnerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1929401D1CC8DA5B00E377EE /* InvitePartnerViewController.m */; }; 1929401F1CC8DA5B00E377EE /* InvitePartnerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1929401D1CC8DA5B00E377EE /* InvitePartnerViewController.m */; };
192940201CC8DA5B00E377EE /* InvitePartnerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1929401E1CC8DA5B00E377EE /* InvitePartnerViewController.xib */; }; 192940201CC8DA5B00E377EE /* InvitePartnerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1929401E1CC8DA5B00E377EE /* InvitePartnerViewController.xib */; };
1929F16D1C9FCB62000E9B26 /* NSDictionary+Category.m in Sources */ = {isa = PBXBuildFile; fileRef = 1929F16C1C9FCB62000E9B26 /* NSDictionary+Category.m */; }; 1929F16D1C9FCB62000E9B26 /* NSDictionary+Category.m in Sources */ = {isa = PBXBuildFile; fileRef = 1929F16C1C9FCB62000E9B26 /* NSDictionary+Category.m */; };
...@@ -338,6 +341,11 @@ ...@@ -338,6 +341,11 @@
192861011CBF825100FA6E85 /* JavenOwner.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JavenOwner.m; sourceTree = "<group>"; }; 192861011CBF825100FA6E85 /* JavenOwner.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JavenOwner.m; sourceTree = "<group>"; };
192861021CBF825100FA6E85 /* JavenShop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavenShop.h; sourceTree = "<group>"; }; 192861021CBF825100FA6E85 /* JavenShop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavenShop.h; sourceTree = "<group>"; };
192861031CBF825100FA6E85 /* JavenShop.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JavenShop.m; sourceTree = "<group>"; }; 192861031CBF825100FA6E85 /* JavenShop.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JavenShop.m; sourceTree = "<group>"; };
192900721CD0B7AE00D226E7 /* ShareContentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShareContentView.h; sourceTree = "<group>"; };
192900731CD0B7AE00D226E7 /* ShareContentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShareContentView.m; sourceTree = "<group>"; };
192900751CD0B7C000D226E7 /* ShareContentView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ShareContentView.xib; sourceTree = "<group>"; };
1929007F1CD1AECB00D226E7 /* ShareInstance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShareInstance.h; sourceTree = "<group>"; };
192900801CD1AECB00D226E7 /* ShareInstance.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShareInstance.m; sourceTree = "<group>"; };
1929401C1CC8DA5B00E377EE /* InvitePartnerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InvitePartnerViewController.h; sourceTree = "<group>"; }; 1929401C1CC8DA5B00E377EE /* InvitePartnerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InvitePartnerViewController.h; sourceTree = "<group>"; };
1929401D1CC8DA5B00E377EE /* InvitePartnerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InvitePartnerViewController.m; sourceTree = "<group>"; }; 1929401D1CC8DA5B00E377EE /* InvitePartnerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InvitePartnerViewController.m; sourceTree = "<group>"; };
1929401E1CC8DA5B00E377EE /* InvitePartnerViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = InvitePartnerViewController.xib; sourceTree = "<group>"; }; 1929401E1CC8DA5B00E377EE /* InvitePartnerViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = InvitePartnerViewController.xib; sourceTree = "<group>"; };
...@@ -882,6 +890,18 @@ ...@@ -882,6 +890,18 @@
path = ModelsFiles; path = ModelsFiles;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
192900691CD0A86500D226E7 /* ShareView */ = {
isa = PBXGroup;
children = (
192900721CD0B7AE00D226E7 /* ShareContentView.h */,
192900731CD0B7AE00D226E7 /* ShareContentView.m */,
192900751CD0B7C000D226E7 /* ShareContentView.xib */,
1929007F1CD1AECB00D226E7 /* ShareInstance.h */,
192900801CD1AECB00D226E7 /* ShareInstance.m */,
);
path = ShareView;
sourceTree = "<group>";
};
192940191CC8D9D500E377EE /* InviteParterner */ = { 192940191CC8D9D500E377EE /* InviteParterner */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -1223,6 +1243,7 @@ ...@@ -1223,6 +1243,7 @@
19A1C83E1CA27403003E5DD9 /* Global */ = { 19A1C83E1CA27403003E5DD9 /* Global */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
192900691CD0A86500D226E7 /* ShareView */,
191AEE651CBCEB7B00F5E535 /* ModelsFiles */, 191AEE651CBCEB7B00F5E535 /* ModelsFiles */,
191AEE481CBCC6D100F5E535 /* RequestModels */, 191AEE481CBCC6D100F5E535 /* RequestModels */,
191AEDFD1CBB818600F5E535 /* UserInfoModel */, 191AEDFD1CBB818600F5E535 /* UserInfoModel */,
...@@ -1901,6 +1922,7 @@ ...@@ -1901,6 +1922,7 @@
199BC7BF1C9B045B00E4E0B8 /* RigistViewController.xib in Resources */, 199BC7BF1C9B045B00E4E0B8 /* RigistViewController.xib in Resources */,
19D906B71CC86DA300CD42DC /* SettingViewController.xib in Resources */, 19D906B71CC86DA300CD42DC /* SettingViewController.xib in Resources */,
195EB1DC1CA516CE00E298BB /* HotCommodityCell.xib in Resources */, 195EB1DC1CA516CE00E298BB /* HotCommodityCell.xib in Resources */,
192900761CD0B7C000D226E7 /* ShareContentView.xib in Resources */,
199B4D891CAE67C600451E0E /* SeeLogistics.xib in Resources */, 199B4D891CAE67C600451E0E /* SeeLogistics.xib in Resources */,
199BC7B21C9AD4FD00E4E0B8 /* LoginViewController.xib in Resources */, 199BC7B21C9AD4FD00E4E0B8 /* LoginViewController.xib in Resources */,
19ADD38F1CA4EC1000EE6E5A /* AddCommodityHeaderCollectionReusableView.xib in Resources */, 19ADD38F1CA4EC1000EE6E5A /* AddCommodityHeaderCollectionReusableView.xib in Resources */,
...@@ -2058,6 +2080,7 @@ ...@@ -2058,6 +2080,7 @@
191AEE161CBB818600F5E535 /* UserInfoShop.m in Sources */, 191AEE161CBB818600F5E535 /* UserInfoShop.m in Sources */,
19DC6B191CC0B5690064A9FD /* MyTeamCollectionViewCell.m in Sources */, 19DC6B191CC0B5690064A9FD /* MyTeamCollectionViewCell.m in Sources */,
19DCCB691C9A9EB30072C3BF /* IBTObject.m in Sources */, 19DCCB691C9A9EB30072C3BF /* IBTObject.m in Sources */,
192900811CD1AECB00D226E7 /* ShareInstance.m in Sources */,
19DCCBDD1C9AA0450072C3BF /* IBTFileManager.m in Sources */, 19DCCBDD1C9AA0450072C3BF /* IBTFileManager.m in Sources */,
1900A3411CB6059000B2B7C4 /* introductionViewController.m in Sources */, 1900A3411CB6059000B2B7C4 /* introductionViewController.m in Sources */,
19D906C61CC8A21700CD42DC /* OrderDetailBottomView.m in Sources */, 19D906C61CC8A21700CD42DC /* OrderDetailBottomView.m in Sources */,
...@@ -2158,6 +2181,7 @@ ...@@ -2158,6 +2181,7 @@
1929401F1CC8DA5B00E377EE /* InvitePartnerViewController.m in Sources */, 1929401F1CC8DA5B00E377EE /* InvitePartnerViewController.m in Sources */,
19632DA81CB356050024A8A1 /* UIImage+QRCode.m in Sources */, 19632DA81CB356050024A8A1 /* UIImage+QRCode.m in Sources */,
19DC6B2B1CC0CEDD0064A9FD /* MBTextFieldWithFontAdapter.m in Sources */, 19DC6B2B1CC0CEDD0064A9FD /* MBTextFieldWithFontAdapter.m in Sources */,
192900741CD0B7AE00D226E7 /* ShareContentView.m in Sources */,
19DC6B2D1CC0CEDD0064A9FD /* MBFontAdapter.m in Sources */, 19DC6B2D1CC0CEDD0064A9FD /* MBFontAdapter.m in Sources */,
19DCCB6E1C9A9EB30072C3BF /* IBTTableViewCell.m in Sources */, 19DCCB6E1C9A9EB30072C3BF /* IBTTableViewCell.m in Sources */,
1929F16D1C9FCB62000E9B26 /* NSDictionary+Category.m in Sources */, 1929F16D1C9FCB62000E9B26 /* NSDictionary+Category.m in Sources */,
......
{ {
"images" : [ "images" : [
{ {
"idiom" : "iphone",
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-Small@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"idiom" : "iphone",
"size" : "29x29", "size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-Small@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"idiom" : "iphone",
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-Spotlight-40@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"idiom" : "iphone",
"size" : "40x40", "size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-Spotlight-40@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"idiom" : "iphone",
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-60@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"idiom" : "iphone",
"size" : "60x60", "size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-60@3x.png",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"idiom" : "ipad",
"size" : "29x29", "size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-Small.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"idiom" : "ipad",
"size" : "29x29", "size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-Small@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"idiom" : "ipad",
"size" : "40x40", "size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-Spotlight-40.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"idiom" : "ipad",
"size" : "40x40", "size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-Spotlight-40@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"idiom" : "ipad",
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-76.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"idiom" : "ipad",
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-76@2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"idiom" : "ipad",
"size" : "83.5x83.5", "size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "Icon-83.5@2x.png",
"scale" : "2x" "scale" : "2x"
} }
], ],
......
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "share_copyurl.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "share_copyurl@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "share_qrcode.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "share_qrcode@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "share_weichat.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "share_weichat@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "share_weitimeline.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "share_weitimeline@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
...@@ -138,12 +138,8 @@ ...@@ -138,12 +138,8 @@
} }
- (IBAction)actionShare:(id)sender { - (IBAction)actionShare:(id)sender {
[UMSocialWechatHandler setWXAppId:@"wx2e218a9fb84928fa" appSecret:@"400c1925383f36f7768de707c69035e2" url:@"http://www.baidu.com"]; [[ShareInstance shareInstace] showWithTitle:@"" content:@"" url:@""];
[[UMSocialDataService defaultDataService] postSNSWithTypes:@[UMShareToWechatSession] content:@"share" image:[UIImage imageNamed:@"add_commodityIcon0"] location:nil urlResource:nil presentedController:self completion:^(UMSocialResponseEntity *response){
if (response.responseCode == UMSResponseCodeSuccess) {
NSLog(@"分享成功!");
}
}];
} }
......
...@@ -44,9 +44,9 @@ ...@@ -44,9 +44,9 @@
//本地已有密码时登录 //本地已有密码时登录
- (void)defaultLoginAction { - (void)defaultLoginAction {
// BaseViewController *baseVC = [[BaseViewController alloc] init]; BaseViewController *baseVC = [[BaseViewController alloc] init];
// baseVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; baseVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
// [self presentViewController:baseVC animated:YES completion:nil]; [self presentViewController:baseVC animated:YES completion:nil];
if ([[NSUserDefaults standardUserDefaults] objectForKey:@"passWord"]) { if ([[NSUserDefaults standardUserDefaults] objectForKey:@"passWord"]) {
......
//
// ShareContentView.h
// ALand
//
// Created by Z on 16/4/27.
// Copyright © 2016年 Z. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ShareContentView : UIView
@property (nonatomic, copy) NSString *title;
@property (nonatomic, copy) NSString *url;
@property (nonatomic, copy) NSString *content;
@end
//
// ShareContentView.m
// ALand
//
// Created by Z on 16/4/27.
// Copyright © 2016年 Z. All rights reserved.
//
#import "ShareContentView.h"
#import "UMSocial.h"
@implementation ShareContentView
- (IBAction)shareToWeiChatSession:(id)sender {
[UMSocialData defaultData].extConfig.wechatSessionData.url = self.url;
[UMSocialData defaultData].extConfig.wechatSessionData.title = self.title;
[[UMSocialDataService defaultDataService] postSNSWithTypes:@[UMShareToWechatSession] content:self.content image:[UIImage imageNamed:@"add_commodityIcon0"] location:nil urlResource:nil presentedController:nil completion:^(UMSocialResponseEntity *response){
if (response.responseCode == UMSResponseCodeSuccess) {
NSLog(@"分享成功!");
}
}];
}
- (IBAction)shareToWeiChatTimeLine:(id)sender {
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end
This diff is collapsed.
//
// ShareInstance.h
// ALand
//
// Created by Z on 16/4/28.
// Copyright © 2016年 Z. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface ShareInstance : NSObject
+ (ShareInstance *)shareInstace;
- (void)showWithTitle:(NSString *)title content:(NSString *)content url:(NSString *)url;
@end
//
// ShareInstance.m
// ALand
//
// Created by Z on 16/4/28.
// Copyright © 2016年 Z. All rights reserved.
//
#import "ShareInstance.h"
#import "CoverShadowView.h"
#import "ShareContentView.h"
#define kWindow [UIApplication sharedApplication].keyWindow
@interface ShareInstance ()
@property (nonatomic, strong) CoverShadowView *cover;
@property (nonatomic, strong) ShareContentView *shareContentView;
@end
@implementation ShareInstance
+ (ShareInstance *)shareInstace
{
static ShareInstance *instance;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
instance = [[ShareInstance alloc] init];
});
return instance;
}
- (void)showWithTitle:(NSString *)title content:(NSString *)content url:(NSString *)url {
[self.cover show];
WS(weakSelf)
self.cover.tapAction = ^{
[UIView animateWithDuration:0.3 animations:^{
CLog(@"animate");
weakSelf.shareContentView.frame = CGRectMake(0, kHeight, kWidth, 140);
}];
};
self.shareContentView.title = title;
self.shareContentView.content = content;
self.shareContentView.url = url;
[MyTools animateFromBottomDuration:0.5 view:self.shareContentView viewHeight:140];
}
- (CoverShadowView *)cover {
if (!_cover) {
_cover = [[CoverShadowView alloc] initOnTopWithHeight:kHeight];
[kWindow addSubview:_cover];
}
return _cover;
}
- (ShareContentView *)shareContentView {
if (!_shareContentView) {
_shareContentView = [ShareContentView viewWithNibName:@"ShareContentView"];
_shareContentView.frame = CGRectMake(0, kHeight, kWidth, 140);
[kWindow addSubview:_shareContentView];
}
return _shareContentView;
}
@end
...@@ -18,4 +18,5 @@ ...@@ -18,4 +18,5 @@
#import "HTTPCilent.h" #import "HTTPCilent.h"
#import "MJExtension.h" #import "MJExtension.h"
#import "MBProgressHUD+Javen.h" #import "MBProgressHUD+Javen.h"
#import "ShareInstance.h"
#endif /* IMPHeader_h */ #endif /* IMPHeader_h */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment