chore: Initial clean commit

- Removed YuMi/Library/ (138 MB, not tracked)
- Removed YuMi/Resources/ (23 MB, not tracked)
- Removed old version assets (566 files, not tracked)
- Excluded Pods/, xcuserdata/ and other build artifacts
- Clean repository optimized for company server deployment
This commit is contained in:
edwinQQQ
2025-10-09 16:19:14 +08:00
commit a35a711be6
5582 changed files with 408913 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
//
// YMShareModel.h
// YUMI
//
// Created by YUMI on 2021/11/23.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSUInteger, ShareType) {
///分享房间
ShareType_Room = 1,
///分享h5
ShareType_H5 = 2,
///大转盘 目前没用到
ShareType_User_Draw = 888,
};
@interface XPShareInfoModel : PIBaseModel
///分享的标题
@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;
///分享类型1微信好友2微信朋友圈3QQ好友4QQ空间
@property (nonatomic,assign) NSInteger shareType;
///分享房间的uid
@property (nonatomic,assign) NSInteger roomUid;
#pragma mark - 动态分享
///被分享动态的那个人
@property (nonatomic,copy) NSString *uid;
///动态分享
@property (nonatomic,copy) NSString *dynamicId;
///话题id
@property (nonatomic,copy) NSString *worldId;
///封面
@property (nonatomic,copy) NSString *imageUrl;
///名称
@property (nonatomic,copy) NSString *nick;
///发布者的uid
@property (nonatomic,copy) NSString *publishUid;
///内容
@property (nonatomic,copy) NSString *content;
@end
NS_ASSUME_NONNULL_END

View File

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

View File

@@ -0,0 +1,45 @@
//
// YMShareItem.h
// YUMI
//
// Created by YUMI on 2021/11/23.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
typedef enum : NSUInteger {
///微信好友
XPShareItemTagWeChat = 1,
///微信朋友圈
XPShareItemTagMoments,
///QQ好友
XPShareItemTagQQ,
///QQ空间
XPShareItemTagQQZone,
///LIne
XPShareItemTagLine,
///FaceBook
XPShareItemTagFaceBook,
///复制链接
XPShareItemTagCopyLink,
///应用好友
XPShareItemTagAppFriends,
///保存到相册
XPShareItemTagAppSaveAlbum,
} XPShareItemTag;
@interface XPShareItem : NSObject
@property(nonatomic,assign) BOOL isShareInvite;
@property (nonatomic, copy) NSString *inviteTitle;
@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 @@
//
// YMShareItem.m
// YUMI
//
// Created by YUMI 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

@@ -0,0 +1,16 @@
//
// YMShareItemCell.h
// YMRoomMoudle
//
// Created by YUMI on 2022/9/2.
// Copyright © 2023 YUMI. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "XPShareItem.h"
@interface XPShareItemCell : UICollectionViewCell
@property (nonatomic, strong) XPShareItem *shareItem;
@end

View File

@@ -0,0 +1,78 @@
//
// YMShareItemCell.m
// YMRoomMoudle
//
// Created by YUMI on 2022/9/2.
// Copyright © 2023 YUMI. All rights reserved.
//
#import "XPShareItemCell.h"
#import "DJDKMIMOMColor.h"
#import <Masonry/Masonry.h>
@interface XPShareItemCell()
@property (nonatomic, strong) UIImageView *iconImageView;
@property (nonatomic, strong) UILabel *titleLabel;
@end
@implementation XPShareItemCell
#pragma mark - Life Style
- (instancetype)initWithFrame:(CGRect)frame{
if (self=[super initWithFrame:frame]) {
[self initSubViews];
[self initSubViewConstraints];
}
return self;
}
#pragma mark - Private Method
- (void)initSubViews{
[self.contentView addSubview:self.iconImageView];
[self.contentView addSubview:self.titleLabel];
}
- (void)initSubViewConstraints{
CGFloat wh = 30;
[self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.equalTo(@(wh));
make.top.equalTo(self.contentView);
make.centerX.equalTo(self.contentView);
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.trailing.leading.equalTo(self.contentView).inset(5);
make.top.equalTo(self.iconImageView.mas_bottom).offset(10);
}];
}
#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];
}
return _iconImageView;
}
- (UILabel *)titleLabel{
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.textColor = [DJDKMIMOMColor alertMessageColor];
_titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:12];
_titleLabel.numberOfLines = 2;
_titleLabel.textAlignment = NSTextAlignmentCenter;
}
return _titleLabel;
}
@end

View File

@@ -0,0 +1,34 @@
//
// 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>
@optional
///点击保存图片到相册
- (void)shareView:(XPShareView *)shareView savePhoto:(XPShareInfoModel *)shareInfo;
///点了取消分享
- (void)shareViewDidClickCancel:(XPShareView *)shareView;
///分享成功
- (void)shareView:(XPShareView *)shareView didSuccess:(XPShareInfoModel *)shareInfo;
///分享失败
- (void)shareView:(XPShareView *)shareView shareFail:(NSString *)message;
@end;
@interface XPShareView : UIView
@property (nonatomic, weak) id<XCShareViewDelegate> delegate;
@property (nonatomic,assign) BOOL isFromWebVeiw;
- (instancetype)initWithItems:(NSArray<XPShareItem *> *)items itemSize:(CGSize)itemSize shareInfo:(XPShareInfoModel *)shareInfo;
@end

View File

@@ -0,0 +1,329 @@
//
// 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>
#import <FBSDKShareKit/FBSDKShareKit.h>
#import "XCCurrentVCStackManager.h"
///Tool
#import "TTPopup.h"
///View
#import "XPShareItemCell.h"
#import "XPMineShareViewController.h"
#import "ClientConfig.h"
@interface XPShareView()<UICollectionViewDataSource,UICollectionViewDelegate,FBSDKSharingDelegate>
///
@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]) {
for (XPShareItem * item in items) {
if (item.type == XPShareItemTagAppFriends || item.type == XPShareItemTagCopyLink) {
item.disable = YES;
} else {
item.disable = [self isInstallClient:[self getSharePlatformType:item.type]];
}
}
self.items = [NSMutableArray arrayWithArray: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.leading.trailing.mas_equalTo(self).inset(15);
}];
[self.cancleButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(45);
make.leading.trailing.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 XPShareItemTagFaceBook:
type = SSDKPlatformTypeFacebook;
break;
case XPShareItemTagLine:
type = SSDKPlatformTypeLine;
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 xpSafeObjectAtIndex:indexPath.item];
item.disable = YES;
cell.shareItem = item;
return cell;
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
[collectionView deselectItemAtIndexPath:indexPath animated:YES];
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 : @"";
if ([urlString containsString:@"?"]){
urlString = [NSString stringWithFormat:@"%@&lang=%@",urlString,[NSBundle uploadLanguageText]];
}else{
urlString = [NSString stringWithFormat:@"%@?lang=%@",urlString,[NSBundle uploadLanguageText]];
}
NSString *encodedUrl = [urlString stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
XPShareItem * item = [self.items xpSafeObjectAtIndex:indexPath.item];
if (item == nil){
[TTPopup dismiss];
return;
};
if (item.type == XPShareItemTagAppSaveAlbum){
[TTPopup dismiss];
if (self.delegate && [self.delegate respondsToSelector:@selector(shareView:savePhoto:)]){
[self.delegate shareView:self savePhoto:self.shareInfo];
}
return;
}
if (item.type == XPShareItemTagAppFriends) {
[TTPopup dismiss];
XPMineShareViewController * shareVC = [[XPMineShareViewController alloc] init];
shareVC.shareType = MineShareType_Monents;
shareVC.shareInfo = self.shareInfo;
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:shareVC animated:YES];
return;
} else if(item.type == XPShareItemTagCopyLink) {
NSString * urlString = self.shareInfo.shareUrl;
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
[pasteboard setString:urlString];
[XNDJTDDLoadingTool showSuccessWithMessage:YMLocalizedString(@"XPShareView0")];
[TTPopup dismiss];
return;
}
if([self isInstallClient:[self getSharePlatformType:item.type]] == NO){
[XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPShareView9")];
[TTPopup dismiss];
return;
}
// NSTaggedPointerString
if ([self.shareInfo isKindOfClass:[XPShareInfoModel class]] && [item isKindOfClass:[XPShareItem class]]) {
self.shareInfo.shareType = item.type;
} else {
NSLog(@"警告self.shareInfo不是XPShareInfoModel类型而是%@类型", NSStringFromClass([self.shareInfo class]));
[TTPopup dismiss];
return;
}
SSDKPlatformType platformType = SSDKPlatformTypeCopy;
if (item.type == XPShareItemTagLine) {
title = YMLocalizedString(@"XPShareView1");
platformType = SSDKPlatformTypeLine;
if (![ShareSDK isClientInstalled:platformType]) {
[XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPShareView2")];
return;
}
NSString*contentKey= [encodedUrl stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"`#%^{}\"[]|\\<> "].invertedSet];
NSString*contentType =@"text";
NSString*urlString = [NSString stringWithFormat:@"line://msg/%@/%@",contentType, contentKey];
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:urlString] options:@{} completionHandler:^(BOOL success) {
}];
if (self.delegate && [self.delegate respondsToSelector:@selector(shareView:didSuccess:)]) {
[self.delegate shareView:self didSuccess:self.shareInfo];
}
return;
}
if(item.type == XPShareItemTagFaceBook){
FBSDKShareLinkContent*linkContent = [[FBSDKShareLinkContent alloc]init];
urlString = [urlString stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLFragmentAllowedCharacterSet]];
linkContent.contentURL= [NSURL URLWithString:urlString];
linkContent.quote = content;
FBSDKShareDialog *shareDialog = [[FBSDKShareDialog alloc]initWithViewController:[XCCurrentVCStackManager shareManager].getCurrentVC content:linkContent delegate:self];
// web
shareDialog.mode = FBSDKShareDialogModeNative;
if (![shareDialog canShow]) {
shareDialog.mode = FBSDKShareDialogModeWeb;
}
[shareDialog show];
return;
}
[ShareSDK share:platformType parameters:shareParams onStateChanged:^(SSDKResponseState state, NSDictionary *userData, SSDKContentEntity *contentEntity, NSError *error) {
switch (state) {
case SSDKResponseStateSuccess:
{
if (self.delegate && [self.delegate respondsToSelector:@selector(shareView:didSuccess:)]) {
[self.delegate shareView:self didSuccess:self.shareInfo];
}
}
break;
case SSDKResponseStateFail:
{
if (self.delegate && [self.delegate respondsToSelector:@selector(shareView:shareFail:)]) {
[self.delegate shareView:self shareFail:YMLocalizedString(@"XPShareView5")];
}
}
break;
case SSDKResponseStateCancel:
{
if (self.delegate && [self.delegate respondsToSelector:@selector(shareView:shareFail:)]) {
[self.delegate shareView:self shareFail:YMLocalizedString(@"XPShareView6")];
}
}
break;
default:
break;
}
}];
}
#pragma mark - FBSDKSharingDelegate
/// Sent to the delegate when sharing completes without error or cancellation.
/// @param sharer The sharer that completed.
/// @param results The results from the sharer. This may be nil or empty.
- (void)sharer:(id <FBSDKSharing> _Nonnull)sharer didCompleteWithResults:(NSDictionary<NSString *, id> * _Nonnull)results{
NSString *postId = results[@"postId"];
FBSDKShareDialog *dialog = (FBSDKShareDialog *)sharer;
if (dialog.mode == FBSDKShareDialogModeBrowser && (postId == nil || [postId isEqualToString:@""])) {
// 使webviewpostId
//
if (self.delegate && [self.delegate respondsToSelector:@selector(shareView:shareFail:)]) {
[self.delegate shareView:self shareFail:YMLocalizedString(@"XPShareView6")];
}
} else {
if (self.delegate && [self.delegate respondsToSelector:@selector(shareView:didSuccess:)]) {
[self.delegate shareView:self didSuccess:self.shareInfo];
}
}
}
/// Sent to the delegate when the sharer encounters an error.
/// @param sharer The sharer that completed.
/// @param error The error.
- (void)sharer:(id <FBSDKSharing> _Nonnull)sharer didFailWithError:(NSError * _Nonnull)error{
FBSDKShareDialog *dialog = (FBSDKShareDialog *)sharer;
if (error == nil && dialog.mode == FBSDKShareDialogModeNative) {
// 使errorFacebook app
// dialogmode
dialog.mode = FBSDKShareDialogModeBrowser;
[dialog show];
} else {
if (self.delegate && [self.delegate respondsToSelector:@selector(shareView:shareFail:)]) {
[self.delegate shareView:self shareFail:YMLocalizedString(@"XPShareView5")];
}
}
}
/// Sent to the delegate when the sharer is cancelled.
/// @param sharer The sharer that completed.
- (void)sharerDidCancel:(id <FBSDKSharing> _Nonnull)sharer{
if (self.delegate && [self.delegate respondsToSelector:@selector(shareView:shareFail:)]) {
[self.delegate shareView:self shareFail:YMLocalizedString(@"XPShareView6")];
}
}
#pragma mark - Event Response
- (void)cancleButtonDidClck:(UIButton *)button{
if (self.delegate && [self.delegate respondsToSelector:@selector(shareViewDidClickCancel:)]) {
[self.delegate shareViewDidClickCancel:self];
}
}
#pragma mark - Getters And Setters
- (UICollectionView *)collectionView{
if (!_collectionView) {
MSBaseRTLFlowLayout *layout = [[MSBaseRTLFlowLayout 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:YMLocalizedString(@"XPShareView7") forState:UIControlStateNormal];
_cancleButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:15];
_cancleButton.layer.masksToBounds = YES;
_cancleButton.layer.cornerRadius = 45/2;
[_cancleButton setTitleColor:[DJDKMIMOMColor textThirdColor] forState:UIControlStateNormal];
[_cancleButton addTarget:self action:@selector(cancleButtonDidClck:) forControlEvents:UIControlEventTouchUpInside];
}
return _cancleButton;
}
@end