修复bug

This commit is contained in:
liyuhua
2023-10-31 18:54:47 +08:00
parent edff4262a6
commit c4d8fc4e38
3 changed files with 21 additions and 11 deletions

View File

@@ -20,6 +20,7 @@
///View
#import "XPShareItemCell.h"
#import "XPMineShareViewController.h"
#import "ClientConfig.h"
@interface XPShareView()<UICollectionViewDataSource,UICollectionViewDelegate,FBSDKSharingDelegate>
///
@@ -51,7 +52,12 @@
[itemList addObject:item];
}
}
self.items = itemList;
if([ClientConfig shareConfig].canOpen){
self.items = [NSMutableArray arrayWithArray:items];
}else{
self.items = itemList;
}
self.itemSize =itemSize;
self.shareInfo = shareInfo;
[self initSubViews];
@@ -119,14 +125,8 @@
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
XPShareItemCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPShareItemCell class]) forIndexPath:indexPath];
XPShareItem * item = [self.items safeObjectAtIndex1:indexPath.item];
if(item != nil){
if (item.type == XPShareItemTagAppFriends || item.type == XPShareItemTagCopyLink) {
item.disable = YES;
} else {
item.disable = [self isInstallClient:[self getSharePlatformType:item.type]];
}
cell.shareItem = item;
}
item.disable = YES;
cell.shareItem = item;
return cell;
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
@@ -136,11 +136,19 @@
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]];
XPShareItem * item = [self.items safeObjectAtIndex1:indexPath.item];
if (item == nil)return;
if (item == nil){
[TTPopup dismiss];
return;
};
if([self isInstallClient:[self getSharePlatformType:item.type]] == NO){
[XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPShareView9")];
[TTPopup dismiss];
return;
}
if (item.type == XPShareItemTagAppFriends) {
[TTPopup dismiss];
XPMineShareViewController * shareVC = [[XPMineShareViewController alloc] init];

View File

@@ -59,6 +59,7 @@
"XPShareView6" = "取消分享";
"XPShareView7" = "取消";
"XPShareView8" = "来piko邂逅你的专属声音";
"XPShareView9" = "未安装相关App分享失败";
///XPFirstRechargeViewController.m
"XPFirstRechargeViewController0" = "1.每人仅可获得1次首充福利\n2.每个ID、设备仅能参加一次。";
"XPFirstRechargeViewController1" = "立即充值";

View File

@@ -59,6 +59,7 @@
"XPShareView6" = "取消分享";
"XPShareView7" = "取消";
"XPShareView8" = "來piko邂逅你的專屬聲音";
"XPShareView9" = "未安装相关App分享失败";
///XPFirstRechargeViewController.m
"XPFirstRechargeViewController0" = "1.每人僅可獲得1次首充福利\n2.每個ID、設備僅能參加一次。";
"XPFirstRechargeViewController1" = "立即充值";