分享房间

This commit is contained in:
fengshuo
2021-11-23 19:27:18 +08:00
committed by zu
parent e08629544e
commit 463175f4f4
43 changed files with 679 additions and 403 deletions

View File

@@ -36,9 +36,8 @@
186A534C26FC6ED900D67B2C /* TTAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = 186A533C26FC6ED900D67B2C /* TTAlertView.m */; };
186A534D26FC6ED900D67B2C /* TTActionSheetView.m in Sources */ = {isa = PBXBuildFile; fileRef = 186A533F26FC6ED900D67B2C /* TTActionSheetView.m */; };
186A534E26FC6ED900D67B2C /* TTPopupService.m in Sources */ = {isa = PBXBuildFile; fileRef = 186A534126FC6ED900D67B2C /* TTPopupService.m */; };
186A536926FC6F2E00D67B2C /* XCShareView.m in Sources */ = {isa = PBXBuildFile; fileRef = 186A536126FC6F2E00D67B2C /* XCShareView.m */; };
186A536A26FC6F2E00D67B2C /* XCShareItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 186A536426FC6F2E00D67B2C /* XCShareItem.m */; };
186A536B26FC6F2E00D67B2C /* XCShareItemCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 186A536726FC6F2E00D67B2C /* XCShareItemCell.m */; };
186A536926FC6F2E00D67B2C /* XPShareView.m in Sources */ = {isa = PBXBuildFile; fileRef = 186A536126FC6F2E00D67B2C /* XPShareView.m */; };
186A536B26FC6F2E00D67B2C /* XPShareItemCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 186A536726FC6F2E00D67B2C /* XPShareItemCell.m */; };
187EEEDC26E89B32002833B2 /* BaseModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 187EEEDB26E89B32002833B2 /* BaseModel.m */; };
187EEEE126E89BFB002833B2 /* AccountModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 187EEEE026E89BFB002833B2 /* AccountModel.m */; };
187EEEF026E89FE8002833B2 /* AccountInfoStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = 187EEEEE26E89FE8002833B2 /* AccountInfoStorage.m */; };
@@ -132,6 +131,8 @@
E81D58822720082A003063FE /* MicroWaveView.m in Sources */ = {isa = PBXBuildFile; fileRef = E81D58812720082A003063FE /* MicroWaveView.m */; };
E82109AD26F1C8A000FC3319 /* CountDownHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = E82109AC26F1C8A000FC3319 /* CountDownHelper.m */; };
E82109B026F1D83500FC3319 /* LoginBindPhonePresent.m in Sources */ = {isa = PBXBuildFile; fileRef = E82109AF26F1D83500FC3319 /* LoginBindPhonePresent.m */; };
E82325E6274CCAFA003A3332 /* XPShareInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E82325E5274CCAFA003A3332 /* XPShareInfoModel.m */; };
E82325E9274CE56A003A3332 /* XPShareItem.m in Sources */ = {isa = PBXBuildFile; fileRef = E82325E8274CE56A003A3332 /* XPShareItem.m */; };
E824543526F57D6E00BE8163 /* XPLoginVerifBindPhoneViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E824543426F57D6E00BE8163 /* XPLoginVerifBindPhoneViewController.m */; };
E824543826F5820A00BE8163 /* XPLoginVerifBindPhonePresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E824543726F5820A00BE8163 /* XPLoginVerifBindPhonePresenter.m */; };
E824543A26F5880E00BE8163 /* XPLoginVerifBindPhoneProtocol.h in Sources */ = {isa = PBXBuildFile; fileRef = E824543926F5822800BE8163 /* XPLoginVerifBindPhoneProtocol.h */; };
@@ -356,12 +357,10 @@
186A534226FC6ED900D67B2C /* TTPopupServiceProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TTPopupServiceProtocol.h; sourceTree = "<group>"; };
186A534326FC6ED900D67B2C /* TTPopupService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TTPopupService.h; sourceTree = "<group>"; };
186A534526FC6ED900D67B2C /* TTPopupConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TTPopupConstants.h; sourceTree = "<group>"; };
186A536126FC6F2E00D67B2C /* XCShareView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XCShareView.m; sourceTree = "<group>"; };
186A536226FC6F2E00D67B2C /* XCShareView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XCShareView.h; sourceTree = "<group>"; };
186A536426FC6F2E00D67B2C /* XCShareItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XCShareItem.m; sourceTree = "<group>"; };
186A536526FC6F2E00D67B2C /* XCShareItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XCShareItem.h; sourceTree = "<group>"; };
186A536726FC6F2E00D67B2C /* XCShareItemCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XCShareItemCell.m; sourceTree = "<group>"; };
186A536826FC6F2E00D67B2C /* XCShareItemCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XCShareItemCell.h; sourceTree = "<group>"; };
186A536126FC6F2E00D67B2C /* XPShareView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPShareView.m; sourceTree = "<group>"; };
186A536226FC6F2E00D67B2C /* XPShareView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPShareView.h; sourceTree = "<group>"; };
186A536726FC6F2E00D67B2C /* XPShareItemCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPShareItemCell.m; sourceTree = "<group>"; };
186A536826FC6F2E00D67B2C /* XPShareItemCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPShareItemCell.h; sourceTree = "<group>"; };
186F8B472733F2AE007A17BC /* MicroQueueProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MicroQueueProtocol.h; sourceTree = "<group>"; };
187EEEDA26E89B32002833B2 /* BaseModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BaseModel.h; sourceTree = "<group>"; };
187EEEDB26E89B32002833B2 /* BaseModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BaseModel.m; sourceTree = "<group>"; };
@@ -529,6 +528,10 @@
E82109AC26F1C8A000FC3319 /* CountDownHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CountDownHelper.m; sourceTree = "<group>"; };
E82109AE26F1D83500FC3319 /* LoginBindPhonePresent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoginBindPhonePresent.h; sourceTree = "<group>"; };
E82109AF26F1D83500FC3319 /* LoginBindPhonePresent.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LoginBindPhonePresent.m; sourceTree = "<group>"; };
E82325E4274CCAFA003A3332 /* XPShareInfoModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPShareInfoModel.h; sourceTree = "<group>"; };
E82325E5274CCAFA003A3332 /* XPShareInfoModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPShareInfoModel.m; sourceTree = "<group>"; };
E82325E7274CE56A003A3332 /* XPShareItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPShareItem.h; sourceTree = "<group>"; };
E82325E8274CE56A003A3332 /* XPShareItem.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPShareItem.m; sourceTree = "<group>"; };
E824543326F57D6E00BE8163 /* XPLoginVerifBindPhoneViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPLoginVerifBindPhoneViewController.h; sourceTree = "<group>"; };
E824543426F57D6E00BE8163 /* XPLoginVerifBindPhoneViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPLoginVerifBindPhoneViewController.m; sourceTree = "<group>"; };
E824543626F5820A00BE8163 /* XPLoginVerifBindPhonePresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPLoginVerifBindPhonePresenter.h; sourceTree = "<group>"; };
@@ -970,8 +973,8 @@
186A536026FC6F2E00D67B2C /* ShareView */ = {
isa = PBXGroup;
children = (
186A536226FC6F2E00D67B2C /* XCShareView.h */,
186A536126FC6F2E00D67B2C /* XCShareView.m */,
186A536226FC6F2E00D67B2C /* XPShareView.h */,
186A536126FC6F2E00D67B2C /* XPShareView.m */,
186A536326FC6F2E00D67B2C /* Model */,
186A536626FC6F2E00D67B2C /* View */,
);
@@ -981,8 +984,10 @@
186A536326FC6F2E00D67B2C /* Model */ = {
isa = PBXGroup;
children = (
186A536526FC6F2E00D67B2C /* XCShareItem.h */,
186A536426FC6F2E00D67B2C /* XCShareItem.m */,
E82325E4274CCAFA003A3332 /* XPShareInfoModel.h */,
E82325E5274CCAFA003A3332 /* XPShareInfoModel.m */,
E82325E7274CE56A003A3332 /* XPShareItem.h */,
E82325E8274CE56A003A3332 /* XPShareItem.m */,
);
path = Model;
sourceTree = "<group>";
@@ -990,8 +995,8 @@
186A536626FC6F2E00D67B2C /* View */ = {
isa = PBXGroup;
children = (
186A536826FC6F2E00D67B2C /* XCShareItemCell.h */,
186A536726FC6F2E00D67B2C /* XCShareItemCell.m */,
186A536826FC6F2E00D67B2C /* XPShareItemCell.h */,
186A536726FC6F2E00D67B2C /* XPShareItemCell.m */,
);
path = View;
sourceTree = "<group>";
@@ -2413,6 +2418,7 @@
189DD53426DE255300AB55B1 /* TabbarViewController.m in Sources */,
18EE401A2754BA9F00A452BF /* NIMMessageMaker.m in Sources */,
E8EEB91D26FC9D58007C6EBA /* XPMineUserInfoDateView.m in Sources */,
E82325E9274CE56A003A3332 /* XPShareItem.m in Sources */,
E890BC0D273D09A50007C46B /* XPGiftCountView.m in Sources */,
E8AC722F26F49610007D6E91 /* XPMineNotificationItemModel.m in Sources */,
E8E70D7A26F2F16600F03460 /* XPMinePresent.m in Sources */,
@@ -2425,6 +2431,7 @@
187EEEFE26E8A82C002833B2 /* NSObject+AutoCoding.m in Sources */,
E884C36F2743AAC800E1EBED /* AttachmentModel.m in Sources */,
E8AC721926F46E0B007D6E91 /* XPMineSettingItemModel.m in Sources */,
E82325E6274CCAFA003A3332 /* XPShareInfoModel.m in Sources */,
189DD55A26DE39D200AB55B1 /* BaseMvpPresenter.m in Sources */,
180806D827293794001FD836 /* NSObject+MJExtension.m in Sources */,
189DD6FF26E20E5900AB55B1 /* HttpRequestHelper.m in Sources */,
@@ -2458,7 +2465,6 @@
9B0E1C5926E77022005D4442 /* BaseNavigationController.m in Sources */,
E8EEB8F426FC2050007C6EBA /* SDBrowserImageView.m in Sources */,
E824544626F5934700BE8163 /* XPMinePayPwdPresenter.m in Sources */,
186A536A26FC6F2E00D67B2C /* XCShareItem.m in Sources */,
189DD54B26DE338800AB55B1 /* BaseViewController.m in Sources */,
E8B846C226FD82DC00A777FE /* XPMineUserInfoAlbumCollectionViewCell.m in Sources */,
E8EEB91726FC7B35007C6EBA /* XPMineUserInfoDesViewController.m in Sources */,
@@ -2529,14 +2535,14 @@
E89DA67527009ACD008483C1 /* XPMineRechargeNavView.m in Sources */,
1808072D2731598F001FD836 /* XPNetImageYYLabel.m in Sources */,
18486213271EA9DA005FC5DC /* RtcManager.m in Sources */,
186A536926FC6F2E00D67B2C /* XCShareView.m in Sources */,
186A536926FC6F2E00D67B2C /* XPShareView.m in Sources */,
186A534C26FC6ED900D67B2C /* TTAlertView.m in Sources */,
E8B825BF26E9E57D009E8E9F /* LoginTicketInfo.m in Sources */,
E8E7DAE82744F5EF00C631CC /* XPGiftStorage.m in Sources */,
E878894C273A607C00BF1D57 /* XPGiftUserCollectionViewCell.m in Sources */,
181D7F212727D9DB00B7C059 /* SocialStageView.m in Sources */,
187EEEF026E89FE8002833B2 /* AccountInfoStorage.m in Sources */,
186A536B26FC6F2E00D67B2C /* XCShareItemCell.m in Sources */,
186A536B26FC6F2E00D67B2C /* XPShareItemCell.m in Sources */,
E8B846C526FDB41A00A777FE /* XPMineUserInfolbumPresenter.m in Sources */,
E83DB47D2746372300D8CBD1 /* XPRoomGiftBannerView.m in Sources */,
E872309326E8D31500B90D4F /* LoginVerifCodeView.m in Sources */,

View File

@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "share_qq_disable@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "share_qq_disable@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 748 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "share_qq_normal@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "share_qq_normal@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 805 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "share_qqzone_disable@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "share_qqzone_disable@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 846 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "share_qqzone_normal@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "share_qqzone_normal@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 964 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "share_wechat_circle_disable@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "share_wechat_circle_disable@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 840 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "share_wechat_circle_normal@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "share_wechat_circle_normal@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 985 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "share_wechat_disable@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "share_wechat_disable@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 927 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "share_wechat_normal@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "share_wechat_normal@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -1,34 +0,0 @@
//
// XCShareItem.h
// XCRoomMoudle
//
// Created by KevinWang on 2018/9/2.
// Copyright © 2018年 YiZhuan. All rights reserved.
//
#import <Foundation/Foundation.h>
typedef enum : NSUInteger {
XCShareItemTagReport, //举报
XCShareItemTagAppFriends, //应用好友
XCShareItemTagWeChat, //微信好友
XCShareItemTagMoments, //微信朋友圈
XCShareItemTagQQ, //QQ好友
XCShareItemTagQQZone, //QQ空间
XCShareItemTagWeibo, //新浪微博
XCShareItemTagDelete,//删除
XCShareItemTagCopyright,//版权
XCShare_Platfrom_Type_FaceBook, //FaceBook
} XCShareItemTag;
@interface XCShareItem : NSObject
@property (nonatomic, copy) NSString *title;
@property (nonatomic, copy) NSString *imageName;
@property (nonatomic, copy) NSString *disableImageName;
@property (nonatomic, assign) BOOL disable;
@property (nonatomic, assign) XCShareItemTag itemTag;
+ (instancetype)itemWitTag:(XCShareItemTag)itemTag title:(NSString *)title imageName:(NSString *)imageName disableImageName:(NSString *)disableImageName disable:(BOOL)disable;
@end

View File

@@ -1,23 +0,0 @@
//
// XCShareItem.m
// XCRoomMoudle
//
// Created by KevinWang on 2018/9/2.
// Copyright © 2018 YiZhuan. All rights reserved.
//
#import "XCShareItem.h"
@implementation XCShareItem
+ (instancetype)itemWitTag:(XCShareItemTag)itemTag title:(NSString *)title imageName:(NSString *)imageName disableImageName:(NSString *)disableImageName disable:(BOOL)disable{
XCShareItem *item = [[self alloc] init];
item.itemTag = itemTag;
item.title = title;
item.imageName = imageName;
item.disableImageName = disableImageName;
item.disable = disable;
return item;
}
@end

View File

@@ -0,0 +1,34 @@
//
// XPShareModel.h
// xplan-ios
//
// Created by 冯硕 on 2021/11/23.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSUInteger, ShareType) {
///分享房间
ShareType_Room,
///分享h5
ShareType_H5,
};
@interface XPShareInfoModel : NSObject
///分享的标题
@property (nonatomic,copy) NSString *shareTitle;
///分享的内容
@property (nonatomic,copy) NSString *shareContent;
///分享的地址
@property (nonatomic,copy) NSString *shareUrl;
///分享图片
@property (nonatomic,copy) NSString *shareImageUrl;
///分享图片
@property (nonatomic,copy) UIImage *shareImage;
///分享的类型
@property (nonatomic,assign) ShareType type;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,12 @@
//
// XPShareModel.m
// xplan-ios
//
// Created by on 2021/11/23.
//
#import "XPShareInfoModel.h"
@implementation XPShareInfoModel
@end

View File

@@ -0,0 +1,30 @@
//
// XPShareItem.h
// xplan-ios
//
// Created by 冯硕 on 2021/11/23.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
typedef enum : NSUInteger {
XPShareItemTagAppFriends, //应用好友
XPShareItemTagWeChat, //微信好友
XPShareItemTagMoments, //微信朋友圈
XPShareItemTagQQ, //QQ好友
XPShareItemTagQQZone, //QQ空间
} XPShareItemTag;
@interface XPShareItem : NSObject
@property (nonatomic, copy) NSString *title;
@property (nonatomic, copy) NSString *imageName;
@property (nonatomic, copy) NSString *disableImageName;
@property (nonatomic, assign) BOOL disable;
@property (nonatomic, assign) XPShareItemTag type;
+ (instancetype)itemWitTag:(XPShareItemTag)itemTag title:(NSString *)title imageName:(NSString *)imageName disableImageName:(NSString *)disableImageName;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,23 @@
//
// XPShareItem.m
// xplan-ios
//
// Created by on 2021/11/23.
//
#import "XPShareItem.h"
@implementation XPShareItem
+ (instancetype)itemWitTag:(XPShareItemTag)itemTag title:(NSString *)title imageName:(NSString *)imageName disableImageName:(NSString *)disableImageName {
XPShareItem *item = [[self alloc] init];
item.type = itemTag;
item.title = title;
item.imageName = imageName;
item.disableImageName = disableImageName;
item.disable = NO;
return item;
}
@end

View File

@@ -7,10 +7,10 @@
//
#import <UIKit/UIKit.h>
#import "XCShareItem.h"
#import "XPShareItem.h"
@interface XCShareItemCell : UICollectionViewCell
@interface XPShareItemCell : UICollectionViewCell
@property (nonatomic, strong) XCShareItem *shareItem;
@property (nonatomic, strong) XPShareItem *shareItem;
@end

View File

@@ -6,54 +6,38 @@
// Copyright © 2018 YiZhuan. All rights reserved.
//
#import "XCShareItemCell.h"
#import "XPShareItemCell.h"
#import "ThemeColor.h"
#import <Masonry/Masonry.h>
@interface XCShareItemCell()
@interface XPShareItemCell()
@property (nonatomic, strong) UIImageView *iconImageView;
@property (nonatomic, strong) UILabel *titleLabel;
@end
@implementation XCShareItemCell
@implementation XPShareItemCell
#pragma mark - Life Style
- (instancetype)initWithFrame:(CGRect)frame{
if (self=[super initWithFrame:frame]) {
[self setupSubviews];
[self setupSubviewsConstraints];
[self initSubViews];
[self initSubViewConstraints];
}
return self;
}
#pragma mark - puble method
- (void)setShareItem:(XCShareItem *)shareItem{
_shareItem = shareItem;
self.userInteractionEnabled = !shareItem.disable;
if (shareItem.disable) {
self.iconImageView.image = [UIImage imageNamed:shareItem.disableImageName];
}else{
self.iconImageView.image = [UIImage imageNamed:shareItem.imageName];
}
self.titleLabel.text = shareItem.title;
}
#pragma mark - Private
- (void)setupSubviews{
#pragma mark - Private Method
- (void)initSubViews{
[self.contentView addSubview:self.iconImageView];
[self.contentView addSubview:self.titleLabel];
}
- (void)setupSubviewsConstraints{
CGFloat wh = 30;
- (void)initSubViewConstraints{
CGFloat wh = 40;
[self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.equalTo(@(wh));
make.bottom.equalTo(self.contentView.mas_centerY);
make.top.equalTo(self.contentView);
make.centerX.equalTo(self.contentView);
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -62,7 +46,19 @@
}];
}
#pragma mark - Getter
#pragma mark - Getters And Setters
- (void)setShareItem:(XPShareItem *)shareItem{
_shareItem = shareItem;
self.userInteractionEnabled = shareItem.disable;
if (!shareItem.disable) {
self.iconImageView.image = [UIImage imageNamed:shareItem.disableImageName];
}else{
self.iconImageView.image = [UIImage imageNamed:shareItem.imageName];
}
self.titleLabel.text = shareItem.title;
}
- (UIImageView *)iconImageView{
if (!_iconImageView) {
_iconImageView = [[UIImageView alloc] init];
@@ -72,8 +68,9 @@
- (UILabel *)titleLabel{
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.textColor = [ThemeColor mainTextColor];
_titleLabel.font = [UIFont systemFontOfSize:10.0];
_titleLabel.textColor = [ThemeColor alertMessageColor];
_titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:12];
_titleLabel.textAlignment = NSTextAlignmentCenter;
}
return _titleLabel;
}

View File

@@ -1,41 +0,0 @@
//
// XCShareView.h
// XCRoomMoudle
//
// Created by KevinWang on 2018/9/2.
// Copyright © 2018年 YiZhuan. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "XCShareItem.h"
typedef enum : NSUInteger {
XCShareViewStyleCenter,
XCShareViewStyleCenterAndBottom,
XCShareViewStyleAll,
} XCShareViewStyle;
@class XCShareView;
@protocol XCShareViewDelegate <NSObject>
- (void)shareView:(XCShareView *)shareView didSelected:(XCShareItemTag)itemTag;
- (void)shareViewDidClickCancle:(XCShareView *)shareView;
@end;
@interface XCShareView : UIView
@property (nonatomic, weak) id<XCShareViewDelegate> delegate;
- (instancetype)initWithItemSize:(CGSize)itemSize items:(NSArray<XCShareItem *> *)items margin:(CGFloat)margin;
/**
初始化XCShareView
@param itemSize 每个分享item的大小
@param items 分享的item数据源
@param edgeInsets 分享item距离容器的上下左右间距
@return XCShareView
*/
- (instancetype)initWithShareViewStyle:(XCShareViewStyle)style items:(NSArray<XCShareItem *> *)items itemSize:(CGSize)itemSize edgeInsets:(UIEdgeInsets)edgeInsets ;
@end

View File

@@ -1,204 +0,0 @@
//
// XCShareView.m
// XCRoomMoudle
//
// Created by KevinWang on 2018/9/2.
// Copyright © 2018 YiZhuan. All rights reserved.
//
#import "XCShareView.h"
#import "XCShareItemCell.h"
#import "XPMacro.h"
#import "ThemeColor.h"
@interface XCShareView()<UICollectionViewDataSource,UICollectionViewDelegate>
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *tipLabel;
@property (nonatomic, strong) UIButton *cancleButton;
@property (nonatomic, strong) UICollectionView *collectionView;
@property (nonatomic, strong) NSArray<XCShareItem *> *items;
@property (nonatomic, assign) CGSize itemSize;
@property (nonatomic, assign) CGFloat margin;
@property (nonatomic, assign) UIEdgeInsets edgeInsets;
@property (nonatomic, strong) UIView *contianterView;//
@property (nonatomic, assign) CGFloat collectionH;
@property (nonatomic, assign) XCShareViewStyle shareViewStyle;
@end
@implementation XCShareView
#pragma mark - Life Style
- (instancetype)initWithItemSize:(CGSize)itemSize items:(NSArray<XCShareItem *> *)items margin:(CGFloat)margin{
return [self initWithShareViewStyle:XCShareViewStyleCenter items:items itemSize:itemSize edgeInsets:UIEdgeInsetsMake(0, margin, 0, margin)];
}
- (instancetype)initWithShareViewStyle:(XCShareViewStyle)style items:(NSArray<XCShareItem *> *)items itemSize:(CGSize)itemSize edgeInsets:(UIEdgeInsets)edgeInsets{
_shareViewStyle = style;
_items = items;
_itemSize = itemSize;
_edgeInsets = edgeInsets;
if (self=[super init]) {
[self setupSubviews];
[self makeConstriants];
[self configASMRUI];
}
return self;
}
#pragma mark - UICollectionViewDelegate
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
return self.items.count;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
XCShareItemCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"XCShareItemCell" forIndexPath:indexPath];
cell.shareItem = self.items[indexPath.row];
return cell;
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
NSLog(@"%@",[self.items[indexPath.item] title]);
if (self.delegate && [self.delegate respondsToSelector:@selector(shareView:didSelected:)]) {
XCShareItem *item = self.items[indexPath.item];
[self.delegate shareView:self didSelected:item.itemTag];
}
}
#pragma mark - event response
- (void)cancleButtonDidClck:(UIButton *)button{
if (self.delegate && [self.delegate respondsToSelector:@selector(shareViewDidClickCancle:)]) {
[self.delegate shareViewDidClickCancle:self];
}
}
#pragma mark - Private
- (void)setupSubviews{
self.backgroundColor = [UIColor clearColor];
[self addSubview:self.contianterView];
if (self.shareViewStyle == XCShareViewStyleAll) {
[self.contianterView addSubview:self.titleLabel];
[self.contianterView addSubview:self.tipLabel];
}
[self.contianterView addSubview:self.collectionView];
if (self.shareViewStyle == XCShareViewStyleCenterAndBottom || self.shareViewStyle == XCShareViewStyleAll) {
[self.contianterView addSubview:self.cancleButton];
}
[self.collectionView registerClass:[XCShareItemCell class] forCellWithReuseIdentifier:@"XCShareItemCell"];
}
- (void)makeConstriants{
int collectionWidth = KScreenWidth-self.edgeInsets.left-self.edgeInsets.right;
int offset = (int)(self.items.count * self.itemSize.width) % collectionWidth;
int row = self.items.count * self.itemSize.width / collectionWidth ;
self.collectionH = (offset == 0 ? self.itemSize.height*row : self.itemSize.height*(row+1));
int cancleButtonH = 44;
if (self.shareViewStyle == XCShareViewStyleCenter) {
self.frame = CGRectMake(0, 0, KScreenWidth, self.collectionH + self.edgeInsets.top+self.edgeInsets.bottom + kSafeAreaBottomHeight);
self.collectionView.frame = CGRectMake(self.edgeInsets.left, self.edgeInsets.top, collectionWidth, self.collectionH);
}else if (self.shareViewStyle == XCShareViewStyleCenterAndBottom){
self.frame = CGRectMake(0, 0, KScreenWidth, self.collectionH + self.edgeInsets.top+self.edgeInsets.bottom + cancleButtonH + kSafeAreaBottomHeight);
self.collectionView.frame = CGRectMake(self.edgeInsets.left, self.edgeInsets.top, collectionWidth, self.collectionH);
self.cancleButton.frame = CGRectMake(0, CGRectGetMaxY(self.collectionView.frame)+self.edgeInsets.bottom, KScreenWidth, cancleButtonH);
}else if (self.shareViewStyle == XCShareViewStyleAll){
self.frame = CGRectMake(0, 0, KScreenWidth, self.collectionH + self.edgeInsets.top+self.edgeInsets.bottom + cancleButtonH + 55 + kSafeAreaBottomHeight);
self.titleLabel.frame =CGRectMake(0, 18, KScreenWidth, 14);
self.tipLabel.frame =CGRectMake(0, CGRectGetMaxY(self.titleLabel.frame)+10, KScreenWidth, 13);
self.collectionView.frame = CGRectMake(self.edgeInsets.left, CGRectGetMaxY(self.tipLabel.frame)+self.edgeInsets.top, collectionWidth, self.collectionH);
self.cancleButton.frame = CGRectMake(0, CGRectGetMaxY(self.collectionView.frame)+self.edgeInsets.bottom, KScreenWidth, cancleButtonH);
}
// iPhone X
self.contianterView.frame = CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height - kSafeAreaBottomHeight);
[self.collectionView reloadData];
}
- (void)configASMRUI{
self.titleLabel.text = @"分享到";
self.titleLabel.font = [UIFont systemFontOfSize:14.0];
self.titleLabel.textColor = [ThemeColor mainTextColor];
self.titleLabel.textAlignment = NSTextAlignmentCenter;
self.tipLabel.hidden = YES;
self.cancleButton.titleLabel.font = [UIFont systemFontOfSize:16.0];
[self.cancleButton setTitleColor:[ThemeColor mainTextColor] forState:UIControlStateNormal];
}
- (UIView *)contianterView {
if (!_contianterView) {
_contianterView = [[UIView alloc] init];
_contianterView.backgroundColor = [ThemeColor appCellBackgroundColor];
_contianterView.layer.cornerRadius = 14.0;
_contianterView.layer.masksToBounds = YES;
}
return _contianterView;
}
- (UILabel *)titleLabel{
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.font = [UIFont systemFontOfSize:14.0];
_titleLabel.textColor = [ThemeColor mainTextColor];
_titleLabel.textAlignment = NSTextAlignmentCenter;
_titleLabel.text = @"分享给好友";
}
return _titleLabel;
}
- (UILabel *)tipLabel{
if (!_tipLabel) {
_tipLabel = [[UILabel alloc] init];
_tipLabel.font = [UIFont systemFontOfSize:13.0];
_tipLabel.textColor = [ThemeColor mainTextColor];
_tipLabel.textAlignment = NSTextAlignmentCenter;
// _tipLabel.text = [NSString stringWithFormat:@"每天第一次分享免费领%@(不包含分享至%@好友)", [XCKeyWordTool sharedInstance].xcRedColor, MyAppName];
}
return _tipLabel;
}
- (UICollectionView *)collectionView{
if (!_collectionView) {
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.itemSize = self.itemSize;
layout.minimumInteritemSpacing = 0;
layout.minimumLineSpacing = 0;
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
_collectionView.backgroundColor = [ThemeColor appCellBackgroundColor];
_collectionView.dataSource = self;
_collectionView.delegate = self;
}
return _collectionView;
}
- (UIButton *)cancleButton{
if (!_cancleButton) {
_cancleButton = [[UIButton alloc] init];
[_cancleButton setBackgroundColor:[ThemeColor appBackgroundColor]];
[_cancleButton setTitle:@"取消" forState:UIControlStateNormal];
_cancleButton.titleLabel.font = [UIFont systemFontOfSize:14.0];
[_cancleButton setTitleColor:[ThemeColor mainTextColor] forState:UIControlStateNormal];
[_cancleButton addTarget:self action:@selector(cancleButtonDidClck:) forControlEvents:UIControlEventTouchUpInside];
}
return _cancleButton;
}
@end

View File

@@ -0,0 +1,29 @@
//
// XCShareView.h
// XCRoomMoudle
//
// Created by KevinWang on 2018/9/2.
// Copyright © 2018年 YiZhuan. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "XPShareItem.h"
#import "XPShareInfoModel.h"
@class XPShareView;
@protocol XCShareViewDelegate <NSObject>
///点了取消分享
- (void)shareViewDidClickCancel:(XPShareView *)shareView;
///分享成功
- (void)shareViewDidSuccess:(XPShareView *)shareView;
///分享失败
- (void)shareView:(XPShareView *)shareView shareFail:(NSString *)message;
@end;
@interface XPShareView : UIView
@property (nonatomic, weak) id<XCShareViewDelegate> delegate;
- (instancetype)initWithItems:(NSArray<XPShareItem *> *)items itemSize:(CGSize)itemSize shareInfo:(XPShareInfoModel *)shareInfo;
@end

View File

@@ -0,0 +1,200 @@
//
// XCShareView.m
// XCRoomMoudle
//
// Created by KevinWang on 2018/9/2.
// Copyright © 2018 YiZhuan. All rights reserved.
//
#import "XPShareView.h"
///Third
#import <Masonry/Masonry.h>
#import <ShareSDK/ShareSDK.h>
#import <ShareSDKExtension/ShareSDK+Extension.h>
///Tool
#import "XPMacro.h"
#import "ThemeColor.h"
///View
#import "XPShareItemCell.h"
@interface XPShareView()<UICollectionViewDataSource,UICollectionViewDelegate>
///
@property (nonatomic, strong) UIButton *cancleButton;
///
@property (nonatomic, strong) UICollectionView *collectionView;
///
@property (nonatomic, strong) NSArray<XPShareItem *> *items;
///item
@property (nonatomic,assign) CGSize itemSize;
///
@property (nonatomic,strong) XPShareInfoModel *shareInfo;
@end
@implementation XPShareView
#pragma mark - Life Style
- (instancetype)initWithItems:(NSArray<XPShareItem *> *)items itemSize:(CGSize)itemSize shareInfo:(XPShareInfoModel *)shareInfo {
if (self = [super init]) {
self.items = items;
self.itemSize =itemSize;
self.shareInfo = shareInfo;
[self initSubViews];
[self initSubViewConstraints];
}
return self;
}
#pragma mark - Private Method
- (void)initSubViews {
[self addSubview:self.collectionView];
[self addSubview:self.cancleButton];
}
- (void)initSubViewConstraints {
CGFloat collectionWidth = KScreenWidth - 15 * 2;
///
int numberLine = collectionWidth / self.itemSize.width;
int page = self.items.count % numberLine > 0 ? (int)self.items.count / numberLine + 1 : (int)self.items.count / numberLine;
CGFloat collectionHeight = page * self.itemSize.height + 20 + (page-1) * 10 + 10;
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self);
make.height.mas_equalTo(collectionHeight);
make.left.right.mas_equalTo(self).inset(15);
}];
[self.cancleButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(45);
make.left.right.mas_equalTo(self.collectionView);
make.top.mas_equalTo(self.collectionView.mas_bottom).offset(15);
}];
[self mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(KScreenWidth);
make.bottom.mas_equalTo(self.cancleButton.mas_bottom).offset(30);
}];
}
- (BOOL)isInstallClient:(SSDKPlatformType)platform {
return [ShareSDK isClientInstalled:platform];
}
- (SSDKPlatformType)getSharePlatformType:(XPShareItemTag)itemTag {
SSDKPlatformType type;
switch (itemTag) {
case XPShareItemTagQQ:
type = SSDKPlatformTypeQQ;
break;
case XPShareItemTagQQZone:
type = SSDKPlatformSubTypeQZone;
break;
case XPShareItemTagWeChat:
type = SSDKPlatformTypeWechat;
break;
case XPShareItemTagMoments:
type = SSDKPlatformSubTypeWechatTimeline;
break;
default:
type = SSDKPlatformTypeUnknown;
break;
}
return type;
}
#pragma mark - UICollectionViewDelegate
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
return self.items.count;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
XPShareItemCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPShareItemCell class]) forIndexPath:indexPath];
XPShareItem * item = [self.items objectAtIndex:indexPath.item];
item.disable = [self isInstallClient:[self getSharePlatformType:item.type]];
cell.shareItem = item;
return cell;
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
[collectionView deselectItemAtIndexPath:indexPath animated:YES];
XPShareItem * item = [self.items objectAtIndex:indexPath.item];
NSMutableDictionary *shareParams = [NSMutableDictionary dictionary];
NSString * title = [self.shareInfo shareTitle].length > 0 ? self.shareInfo.shareTitle : @"";
NSString * content = self.shareInfo.shareContent.length > 0 ? self.shareInfo.shareContent : @"";
NSString * urlString = self.shareInfo.shareUrl.length > 0 ?self.shareInfo.shareUrl : @"";
NSString * imageURL = self.shareInfo.shareImageUrl.length > 0 ? self.shareInfo.shareImageUrl : @"";
NSString *encodedUrl = [urlString stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
[shareParams SSDKSetupShareParamsByText:content
images:@[imageURL]
url:[NSURL URLWithString:encodedUrl]
title:title
type:SSDKContentTypeAuto];
[ShareSDK share:[self getSharePlatformType:item.type] parameters:shareParams onStateChanged:^(SSDKResponseState state, NSDictionary *userData, SSDKContentEntity *contentEntity, NSError *error) {
switch (state) {
case SSDKResponseStateSuccess:
{
if (self.delegate && [self.delegate respondsToSelector:@selector(shareViewDidSuccess:)]) {
[self.delegate shareViewDidSuccess:self];
}
}
break;
case SSDKResponseStateFail:
{
if (self.delegate && [self.delegate respondsToSelector:@selector(shareView:shareFail:)]) {
[self.delegate shareView:self shareFail:@"分享失败"];
}
}
break;
case SSDKResponseStateCancel:
{
if (self.delegate && [self.delegate respondsToSelector:@selector(shareView:shareFail:)]) {
[self.delegate shareView:self shareFail:@"取消分享"];
}
}
break;
default:
break;
}
}];
}
#pragma mark - Event Response
- (void)cancleButtonDidClck:(UIButton *)button{
if (self.delegate && [self.delegate respondsToSelector:@selector(shareViewDidSuccess:)]) {
[self.delegate shareViewDidSuccess:self];
}
}
#pragma mark - Getters And Setters
- (UICollectionView *)collectionView{
if (!_collectionView) {
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.itemSize = self.itemSize;
layout.minimumInteritemSpacing = 0;
layout.minimumLineSpacing = 10;
layout.sectionInset = UIEdgeInsetsMake(20, 0, 10, 0);
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
_collectionView.backgroundColor = [UIColor whiteColor];
_collectionView.dataSource = self;
_collectionView.delegate = self;
_collectionView.layer.masksToBounds = YES;
_collectionView.layer.cornerRadius = 15;
[_collectionView registerClass:[XPShareItemCell class] forCellWithReuseIdentifier:NSStringFromClass([XPShareItemCell class])];
}
return _collectionView;
}
- (UIButton *)cancleButton{
if (!_cancleButton) {
_cancleButton = [[UIButton alloc] init];
[_cancleButton setBackgroundColor:[UIColor whiteColor]];
[_cancleButton setTitle:@"取消" forState:UIControlStateNormal];
_cancleButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:15];
_cancleButton.layer.masksToBounds = YES;
_cancleButton.layer.cornerRadius = 45/2;
[_cancleButton setTitleColor:[ThemeColor textThirdColor] forState:UIControlStateNormal];
[_cancleButton addTarget:self action:@selector(cancleButtonDidClck:) forControlEvents:UIControlEventTouchUpInside];
}
return _cancleButton;
}
@end

View File

@@ -21,6 +21,8 @@ typedef NS_ENUM(NSUInteger, URLType) {
kNurseryURL,///护苗计划
kRechargePrivacyURL,////充值协议
kReportRoomURL,///举报房间
///分享房间
kShareRoomURL,
};
NSString * const URLWithType(URLType type);

View File

@@ -21,6 +21,7 @@ NSString * const URLWithType(URLType type) {
@(kNurseryURL):@"activity/cleanNet/index.html",
@(kRechargePrivacyURL) : @"modules/rule/rechargeAgreement.html",//
@(kReportRoomURL) : @"modules/inform/index.html",///
@(kShareRoomURL) : @"modules/share_room/index.html",///
};
NSString * url = [dic objectForKey:@(type)];

View File

@@ -10,6 +10,8 @@
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSUInteger, CustomMessageType) {
///房间提示
CustomMessageType_Room_Tip = 2,
///送礼物的接口
CustomMessageType_Gift = 3,
///全麦送
@@ -19,19 +21,37 @@ typedef NS_ENUM(NSUInteger, CustomMessageType) {
};
///first = CustomMessageType_Room_Tip
typedef NS_ENUM(NSUInteger, CustomMessageSubRoomTip) {
///分享房间
Custom_Message_Sub_Room_Tip_ShareRoom = 21,
///关注房主
Custom_Message_Sub_Room_Tip_Attention_Owner = 22,
};
///first = CustomMessageType_Gift
typedef NS_ENUM(NSUInteger, CustomMessageSubGift) {
Custom_Message_Sub_Gift_Send = 31,//发送礼物
Custom_Message_Sub_Gift_ChannelNotify = 32,//全服发送礼物
Custom_Message_Sub_Gift_LuckySend = 34,//发送 福袋 礼物
///发送礼物
Custom_Message_Sub_Gift_Send = 31,
///全服发送礼物
Custom_Message_Sub_Gift_ChannelNotify = 32,
///发送 福袋 礼物
Custom_Message_Sub_Gift_LuckySend = 34,
};
///first = CustomMessageType_ALLMicroSend
typedef NS_ENUM(NSUInteger, CustomMessageSubAllMicroSend) {
Custom_Message_Sub_AllMicroSend = 121, //全麦送礼物
Custom_Message_Sub_AllMicroLuckySend = 125, //全麦送 福袋 礼物 122老版本占用了
Custom_Message_Sub_AllBatchSend = 123, // 非全麦 多人送礼
Custom_Message_Sub_AllBatchMicroLuckySend = 124, // 非全麦 多人送福袋礼物
///全麦送礼物
Custom_Message_Sub_AllMicroSend = 121,
///非全麦 多人送礼
Custom_Message_Sub_AllBatchSend = 123,
///非全麦 多人送福袋礼物
Custom_Message_Sub_AllBatchMicroLuckySend = 124,
///全麦送 福袋 礼物 122老版本占用了
Custom_Message_Sub_AllMicroLuckySend = 125,
};
///first = CustomMessageType_LuckyBag
typedef NS_ENUM(NSUInteger, CustomMessageSubLuckyBag) {
/// 福袋礼物房间飘屏通知
Custom_Message_Sub_Room_Gift_LuckBag= 610,

View File

@@ -10,19 +10,29 @@
#import <Masonry/Masonry.h>
#import <MarqueeLabel.h>
#import <YYText/YYLabel.h>
#import "TTPopup.h"
///Tool
#import "UIImage+Utils.h"
#import "UIButton+EnlargeTouchArea.h"
#import "XPMacro.h"
#import "ThemeColor+Room.h"
#import "TTPopup.h"
#import "XCHUDTool.h"
#import "XPHtmlUrl.h"
#import "ApiHost.h"
#import "AccountInfoStorage.h"
#import "IMMessageHelper.h"
///Model
#import "RoomInfoModel.h"
#import "UserInfoModel.h"
#import "AttachMentModel.h"
///View
#import "XPShareView.h"
///VC
#import "XPWebViewcontroller.h"
@interface RoomHeaderView ()
@interface RoomHeaderView ()<XCShareViewDelegate, BaseViewControllerProtocol>
///
@property (nonatomic,strong) UIButton *backButton;
///
@@ -64,13 +74,13 @@
return self;
}
#pragma mark - Response
#pragma mark - Event Response
- (void)backButtonAction:(UIButton *)sender {
[self.hostDelegate exitRoom];
}
- (void)shareButtonAction:(UIButton *)sender{
[self showSharePanel];
}
- (void)settingButtonAction:(UIButton *)sender {
@@ -156,6 +166,59 @@
}
}
- (void)showSharePanel {
XPShareItem *cycle = [XPShareItem itemWitTag:XPShareItemTagMoments title:@"朋友圈" imageName:@"share_wechat_circle_normal" disableImageName:@"share_wechat_circle_disable"];
XPShareItem *wechat = [XPShareItem itemWitTag:XPShareItemTagWeChat title:@"微信好友" imageName:@"share_wechat_normal" disableImageName:@"share_wechat_disable"];
XPShareItem *qq = [XPShareItem itemWitTag:XPShareItemTagQQ title:@"QQ好友" imageName:@"share_qq_normal" disableImageName:@"share_qq_disable"];
XPShareItem *qqzone = [XPShareItem itemWitTag:XPShareItemTagQQZone title:@"QQ空间" imageName:@"share_qqzone_normal" disableImageName:@"share_qqzone_disable"];
NSArray * items = @[wechat,cycle, qq, qqzone];
RoomInfoModel * roomInfo = [self.hostDelegate getRoomInfo];
XPShareInfoModel * shareInfo = [[XPShareInfoModel alloc] init];
shareInfo.shareTitle = @"玩和平精英赢奖金";
shareInfo.shareContent = @"免费报名,奖金高,比赛多";
shareInfo.shareImageUrl = [self.hostDelegate getRoomInfo].avatar;
NSString * uid = [AccountInfoStorage instance].getUid;
NSString * urlString = [NSString stringWithFormat:@"%@/%@?shareUid=%@&uid=%ld&room_name=%@&room_id=%ld&room_avatar=%@&share_name=%@",API_HOST_URL,URLWithType(kShareRoomURL),uid,roomInfo.uid,roomInfo.title,roomInfo.erbanNo,roomInfo.avatar,roomInfo.nick];
shareInfo.shareUrl = urlString;
CGFloat margin = 15;
CGSize itemSize = CGSizeMake((KScreenWidth-2*margin)/4, 65);
XPShareView *shareView = [[XPShareView alloc] initWithItems:items itemSize:itemSize shareInfo:shareInfo];
shareView.delegate = self;
[TTPopup popupView:shareView style:TTPopupStyleActionSheet];
}
#pragma mark - XCShareViewDelegate
- (void)shareView:(XPShareView *)shareView shareFail:(NSString *)message {
[TTPopup dismiss];
[XCHUDTool showErrorWithMessage:message];
}
- (void)shareViewDidSuccess:(XPShareView *)shareView {
[TTPopup dismiss];
[XCHUDTool showErrorWithMessage:@"分享成功"];
AttachmentModel * attachMent = [[AttachmentModel alloc] init];
attachMent.first = CustomMessageType_Room_Tip;
attachMent.second = Custom_Message_Sub_Room_Tip_ShareRoom;
NSMutableDictionary * dic = [NSMutableDictionary dictionary];
NSString * uid = [AccountInfoStorage instance].getUid;
[dic setValue:uid forKey:@"uid"];
NSMutableDictionary * userDic = [NSMutableDictionary dictionary];
UserInfoModel * userInfo = [self.hostDelegate getUserInfo];
RoomInfoModel * roomInfo = [self.hostDelegate getRoomInfo];
[userDic setValue:roomInfo.nick.length > 0 ? roomInfo.nick : @"" forKey:@"targetNick"];
[userDic setValue:@(roomInfo.uid) forKey:@"targetUid"];
[userDic setValue:userInfo.nick.length > 0 ? userInfo.nick : @"" forKey:@"nick"];
[dic setValue:userDic forKey:@"data"];
attachMent.data = dic;
NSString *sessionID = [NSString stringWithFormat:@"%ld", [self.hostDelegate getRoomInfo].roomId];
[IMMessageHelper sendCustomMessage:attachMent sessionId:sessionID type:NIMSessionTypeChatroom userInfo:userInfo];
}
- (void)shareViewDidClickCancel:(XPShareView *)shareView {
[TTPopup dismiss];
}
#pragma mark - Getters And Setters
- (UIButton *)backButton{
if (!_backButton) {
_backButton = [[UIButton alloc] init];
@@ -172,7 +235,6 @@
[_shareButton setImage:[UIImage imageNamed:@"room_info_share"] forState:UIControlStateNormal];
[_shareButton addTarget:self action:@selector(shareButtonAction:) forControlEvents:UIControlEventTouchUpInside];
[_shareButton setEnlargeEdgeWithTop:8 right:8 bottom:8 left:8];
_shareButton.hidden = YES;
}
return _shareButton;
}

View File

@@ -11,14 +11,14 @@
#import "ApiHost.h"
#import "YYUtility.h"
#import "HttpRequestHelper.h"
#import "XCShareView.h"
#import "XPShareView.h"
#import "TTPopup.h"
#import "XPMacro.h"
#import <Masonry/Masonry.h>
#import <MJExtension/MJExtension.h>
#import <RPSDK/RPSDK.h>
@interface WeakWebViewScriptMessageDelegate : NSObject<WKScriptMessageHandler>
@interface WeakWebViewScriptMessageDelegate : NSObject<WKScriptMessageHandler, XCShareViewDelegate>
//WKScriptMessageHandler JavaScriptOC
@property (nonatomic, weak) id<WKScriptMessageHandler> scriptDelegate;
@@ -186,46 +186,26 @@ NSString * const kJSOpenFaceLiveness = @"openFaceLiveness";
}
- (void)showSharePanel {
XCShareItem *cycle = [[XCShareItem alloc]init];
cycle.title = @"朋友圈";
cycle.imageName = @"share_wxcircle";
cycle.disableImageName = @"share_wxcircle_disable";
cycle.disable = NO;
cycle.itemTag = XCShareItemTagMoments;
XCShareItem *wfriend = [[XCShareItem alloc]init];
wfriend.title = @"微信好友";
wfriend.imageName = @"share_wx";
wfriend.disableImageName = @"share_wx_disable";
wfriend.disable = NO;
wfriend.itemTag = XCShareItemTagWeChat;
XCShareItem *zone = [[XCShareItem alloc]init];
zone.title = @"QQ空间";
zone.imageName = @"share_qqzone";
zone.disableImageName = @"share_qqzone_disable";
zone.disable = NO;
zone.itemTag = XCShareItemTagQQZone;
XCShareItem *qfriend = [[XCShareItem alloc]init];
qfriend.title = @"QQ好友";
qfriend.imageName = @"share_qq";
qfriend.disableImageName = @"share_qq_disable";
qfriend.disable = NO;
qfriend.itemTag = XCShareItemTagQQ;
CGFloat margin = 9;
CGSize itemSize = CGSizeMake((KScreenWidth-2*margin)/4, 111);
XCShareView *shareView = [[XCShareView alloc]initWithItemSize:itemSize items:@[cycle,wfriend,zone,qfriend] margin:margin];
shareView.delegate = self;
[TTPopup popupView:shareView style:TTPopupStyleActionSheet];
XPShareItem *cycle = [XPShareItem itemWitTag:XPShareItemTagMoments title:@"朋友圈" imageName:@"share_wechat_circle_normal" disableImageName:@"share_wechat_circle_disable"];
XPShareItem *wechat = [XPShareItem itemWitTag:XPShareItemTagMoments title:@"微信好友" imageName:@"share_wechat_normal" disableImageName:@"share_wechat_disable"];
XPShareItem *qq = [XPShareItem itemWitTag:XPShareItemTagMoments title:@"QQ好友" imageName:@"share_qq_normal" disableImageName:@"share_qq_disable"];
XPShareItem *qqzone = [XPShareItem itemWitTag:XPShareItemTagMoments title:@"QQ空间" imageName:@"share_qqzone_normal" disableImageName:@"share_qqzone_disable"];
NSArray * items = @[wechat,cycle, qq, qqzone];
XPShareInfoModel * shareInfo = [[XPShareInfoModel alloc] init];
shareInfo.shareTitle = @"玩和平精英赢奖金";
shareInfo.shareContent = @"免费报名,奖金高,比赛多";
shareInfo.shareImageUrl = @"";
NSString * urlString = @"";
shareInfo.shareUrl = urlString;
CGFloat margin = 15;
CGSize itemSize = CGSizeMake((KScreenWidth-2*margin)/4, 65);
XPShareView *shareView = [[XPShareView alloc] initWithItems:items itemSize:itemSize shareInfo:shareInfo];
shareView.delegate = self;
[TTPopup popupView:shareView style:TTPopupStyleActionSheet];
}
- (void)shareView:(XCShareView *)shareView didSelected:(XCShareItemTag)itemTag {
}
- (void)shareViewDidClickCancle:(XCShareView *)shareView {
#pragma mark - XCShareViewDelegate
- (void)shareViewDidClickCancle:(XPShareView *)shareView {
}