From c4d8fc4e386313eea15b35f427700fa8de3f7a9a Mon Sep 17 00:00:00 2001 From: liyuhua <15626451870@163.com> Date: Tue, 31 Oct 2023 18:54:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YuMi/CustomUI/ShareView/XPShareView.m | 30 ++++++++++++++++---------- YuMi/zh-Hans.lproj/Localizable.strings | 1 + YuMi/zh-Hant.lproj/Localizable.strings | 1 + 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/YuMi/CustomUI/ShareView/XPShareView.m b/YuMi/CustomUI/ShareView/XPShareView.m index c78f8e74..8e35ca1b 100644 --- a/YuMi/CustomUI/ShareView/XPShareView.m +++ b/YuMi/CustomUI/ShareView/XPShareView.m @@ -20,6 +20,7 @@ ///View #import "XPShareItemCell.h" #import "XPMineShareViewController.h" +#import "ClientConfig.h" @interface XPShareView() ///取消 @@ -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]; diff --git a/YuMi/zh-Hans.lproj/Localizable.strings b/YuMi/zh-Hans.lproj/Localizable.strings index 37de2e2e..e2865a49 100644 --- a/YuMi/zh-Hans.lproj/Localizable.strings +++ b/YuMi/zh-Hans.lproj/Localizable.strings @@ -59,6 +59,7 @@ "XPShareView6" = "取消分享"; "XPShareView7" = "取消"; "XPShareView8" = "来piko,邂逅你的专属声音"; +"XPShareView9" = "未安装相关App,分享失败"; ///XPFirstRechargeViewController.m "XPFirstRechargeViewController0" = "1.每人仅可获得1次首充福利\n2.每个ID、设备仅能参加一次。"; "XPFirstRechargeViewController1" = "立即充值"; diff --git a/YuMi/zh-Hant.lproj/Localizable.strings b/YuMi/zh-Hant.lproj/Localizable.strings index 6901d509..8f9a09b4 100644 --- a/YuMi/zh-Hant.lproj/Localizable.strings +++ b/YuMi/zh-Hant.lproj/Localizable.strings @@ -59,6 +59,7 @@ "XPShareView6" = "取消分享"; "XPShareView7" = "取消"; "XPShareView8" = "來piko,邂逅你的專屬聲音"; +"XPShareView9" = "未安装相关App,分享失败"; ///XPFirstRechargeViewController.m "XPFirstRechargeViewController0" = "1.每人僅可獲得1次首充福利\n2.每個ID、設備僅能參加一次。"; "XPFirstRechargeViewController1" = "立即充值";