优化项目

This commit is contained in:
liyuhua
2023-09-28 16:48:57 +08:00
parent 1f7d6e472b
commit 15c4fc3871
10 changed files with 101 additions and 115 deletions

View File

@@ -277,6 +277,7 @@
23B2AEC42A6516C200543D17 /* LoginForgetPasswordViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 23B2AEC22A6516C200543D17 /* LoginForgetPasswordViewController.m */; };
23BA165B2A5D2ACF0030C5A3 /* PIBaseAnimationViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 23BA165A2A5D2ACF0030C5A3 /* PIBaseAnimationViewModel.m */; };
23C7C0B72A7CD7B000802205 /* XPNewMineGuildItemView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23C7C0B62A7CD7B000802205 /* XPNewMineGuildItemView.m */; };
23D8DEF22AC5633300644637 /* PIIAPRegulate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23D8DEF12AC5633300644637 /* PIIAPRegulate.swift */; };
23E45C052AC2B0A200D88BCA /* SessionDiscoverNewTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 23E45C042AC2B0A200D88BCA /* SessionDiscoverNewTableViewCell.m */; };
23E9E9972A80C3A100B792F2 /* XPMineGuildPersonalBillRecordVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 23E9E9942A80C39F00B792F2 /* XPMineGuildPersonalBillRecordVC.m */; };
23E9E9982A80C3A100B792F2 /* XPMineGuildPersonalBillStatisVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 23E9E9962A80C3A100B792F2 /* XPMineGuildPersonalBillStatisVC.m */; };
@@ -322,7 +323,6 @@
23E9EB312A85E5D100B792F2 /* pi_app_logo_new_bg.png in Resources */ = {isa = PBXBuildFile; fileRef = 23E9EB302A85E5D100B792F2 /* pi_app_logo_new_bg.png */; };
23E9EB332A85E97C00B792F2 /* pi_login_new_logo.png in Resources */ = {isa = PBXBuildFile; fileRef = 23E9EB322A85E97B00B792F2 /* pi_login_new_logo.png */; };
23FF255B2AB956D50064E904 /* pi_home_new_pk.svga in Resources */ = {isa = PBXBuildFile; fileRef = 23FF255A2AB956D50064E904 /* pi_home_new_pk.svga */; };
23FF25602ABA932D0064E904 /* PIIAPManagers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23FF255F2ABA932D0064E904 /* PIIAPManagers.swift */; };
23FF25622ABAE6310064E904 /* pi_room_game_fine_love.svga in Resources */ = {isa = PBXBuildFile; fileRef = 23FF25612ABAE6310064E904 /* pi_room_game_fine_love.svga */; };
23FF25652ABC3B3C0064E904 /* XPHomeGameView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23FF25642ABC3B3B0064E904 /* XPHomeGameView.m */; };
23FF25682ABC3BC00064E904 /* XPHomeGameCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 23FF25672ABC3BC00064E904 /* XPHomeGameCell.m */; };
@@ -1949,6 +1949,7 @@
23BA165A2A5D2ACF0030C5A3 /* PIBaseAnimationViewModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIBaseAnimationViewModel.m; sourceTree = "<group>"; };
23C7C0B52A7CD7B000802205 /* XPNewMineGuildItemView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPNewMineGuildItemView.h; sourceTree = "<group>"; };
23C7C0B62A7CD7B000802205 /* XPNewMineGuildItemView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNewMineGuildItemView.m; sourceTree = "<group>"; };
23D8DEF12AC5633300644637 /* PIIAPRegulate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PIIAPRegulate.swift; sourceTree = "<group>"; };
23E45C032AC2B0A200D88BCA /* SessionDiscoverNewTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SessionDiscoverNewTableViewCell.h; sourceTree = "<group>"; };
23E45C042AC2B0A200D88BCA /* SessionDiscoverNewTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SessionDiscoverNewTableViewCell.m; sourceTree = "<group>"; };
23E9E9932A80C39E00B792F2 /* XPMineGuildPersonalBillStatisVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPMineGuildPersonalBillStatisVC.h; sourceTree = "<group>"; };
@@ -2033,7 +2034,6 @@
23E9EB302A85E5D100B792F2 /* pi_app_logo_new_bg.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pi_app_logo_new_bg.png; sourceTree = "<group>"; };
23E9EB322A85E97B00B792F2 /* pi_login_new_logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pi_login_new_logo.png; sourceTree = "<group>"; };
23FF255A2AB956D50064E904 /* pi_home_new_pk.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = pi_home_new_pk.svga; sourceTree = "<group>"; };
23FF255F2ABA932D0064E904 /* PIIAPManagers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PIIAPManagers.swift; sourceTree = "<group>"; };
23FF25612ABAE6310064E904 /* pi_room_game_fine_love.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = pi_room_game_fine_love.svga; sourceTree = "<group>"; };
23FF25632ABC3B3B0064E904 /* XPHomeGameView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPHomeGameView.h; sourceTree = "<group>"; };
23FF25642ABC3B3B0064E904 /* XPHomeGameView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPHomeGameView.m; sourceTree = "<group>"; };
@@ -5432,7 +5432,7 @@
23FF255C2ABA8EEE0064E904 /* PIIAPTool */ = {
isa = PBXGroup;
children = (
23FF255F2ABA932D0064E904 /* PIIAPManagers.swift */,
23D8DEF12AC5633300644637 /* PIIAPRegulate.swift */,
);
path = PIIAPTool;
sourceTree = "<group>";
@@ -10683,7 +10683,6 @@
E8B846CF26FDD96100A777FE /* XPMineRechageHeadView.m in Sources */,
E852D74728633E92001465ED /* MonentsCommentReplyModel.m in Sources */,
186A534926FC6ED900D67B2C /* TTAlertMessageAttributedConfig.m in Sources */,
23FF25602ABA932D0064E904 /* PIIAPManagers.swift in Sources */,
E8B3E80C2848BA40009746AB /* NewUserGreetModel.m in Sources */,
E85E7B4D2A4EB0D300B6D00A /* XPMineGuildRemoveMemberViewController.m in Sources */,
9BCB99A028F571B500466D64 /* XPMineCollectPartyRoomViewController.m in Sources */,
@@ -10916,6 +10915,7 @@
23E9EA912A84BD5B00B792F2 /* XPMineUserInfoIndividualTagView.m in Sources */,
E8B846D626FDE01B00A777FE /* XPMineRechargePresenter.m in Sources */,
E8A30BF628534B35003B4873 /* FindNewUserInfoModel.m in Sources */,
23D8DEF22AC5633300644637 /* PIIAPRegulate.swift in Sources */,
E801274027E323C800BAC3F2 /* XPRoomPKViewController.m in Sources */,
E8EEB91426FC7786007C6EBA /* XPMineUserInfoNickViewController.m in Sources */,
18E7B31B26F0982E0064BC9B /* UserExpand.m in Sources */,
@@ -11609,7 +11609,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 20.00.0;
MARKETING_VERSION = 20.00.1;
PRODUCT_BUNDLE_IDENTIFIER = com.peko.enterprise.ios;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -11644,7 +11644,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 20.00.0;
MARKETING_VERSION = 20.00.1;
PRODUCT_BUNDLE_IDENTIFIER = com.peko.enterprise.ios;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";

View File

@@ -31,7 +31,7 @@
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"

View File

@@ -72,7 +72,7 @@
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.avatarImageView.mas_right).offset((10));
make.right.mas_lessThanOrEqualTo(self.findButton.mas_left).mas_offset(-(10));
make.right.mas_lessThanOrEqualTo(self.findButton.mas_left).mas_offset(-0);
make.height.mas_equalTo(((20)));
make.top.equalTo(self.avatarImageView.mas_top).mas_offset((3));
}];
@@ -111,6 +111,9 @@
_fansInfo = fansInfo;
if (_fansInfo) {
self.avatarImageView.imageUrl = _fansInfo.avatar;
if(_fansInfo.nick.length > 5){
_fansInfo.nick = [NSString stringWithFormat:@"%@...",[_fansInfo.nick substringToIndex:5]];
}
self.nickLabel.text = _fansInfo.nick;
self.signLabel.text = _fansInfo.userDesc && _fansInfo.userDesc.length > 0? _fansInfo.userDesc : YMLocalizedString(@"XPMineAttentionTableViewCell0");
if (_fansInfo.useingType != ContactUseingType_In_Room && _fansInfo.useingType != ContactUseingType_Share) {

View File

@@ -73,7 +73,7 @@
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.avatarImageView.mas_right).offset((10));
make.right.mas_lessThanOrEqualTo(self.attentionButton.mas_left).mas_offset(-(10));
make.right.mas_lessThanOrEqualTo(self.attentionButton.mas_left).mas_offset(-0);
make.height.mas_equalTo(20);
make.top.equalTo(self.avatarImageView.mas_top).mas_offset((3));
}];
@@ -112,7 +112,9 @@
_fansInfo = fansInfo;
if (_fansInfo) {
self.avatarImageView.imageUrl = _fansInfo.avatar;
if(_fansInfo.nick.length > 5){
_fansInfo.nick = [NSString stringWithFormat:@"%@...",[_fansInfo.nick substringToIndex:5]];
}
self.nickLabel.text = _fansInfo.nick;
self.signLabel.text = _fansInfo.userDesc && _fansInfo.userDesc.length > 0? _fansInfo.userDesc : YMLocalizedString(@"XPMineFansTableViewCell0");
if (_fansInfo.useingType != ContactUseingType_In_Room && _fansInfo.useingType != ContactUseingType_Share) {

View File

@@ -104,19 +104,19 @@
make.width.mas_equalTo(28);
}];
[self.experImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(28);
make.height.mas_equalTo(14);
}];
CGFloat width = 28 * 20 / 14;
[self.experImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(20);
make.width.mas_equalTo(width);
}];
[self.charmImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(28);
make.height.mas_equalTo(14);
make.height.mas_equalTo(20);
make.width.mas_equalTo(width);
}];
[self.nickStackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.avatarImageView.mas_right).offset(6);
make.height.mas_equalTo(14);
make.height.mas_equalTo(20);
make.bottom.mas_equalTo(self.avatarImageView.mas_centerY).offset(-3);
}];
@@ -163,21 +163,13 @@
if (_memberInfo.experUrl) {
if (self.experImageView.state == NetImageStateLoaded) {
self.experImageView.imageUrl = _memberInfo.experUrl;
CGFloat kImageScale = self.experImageView.image.size.width / self.experImageView.image.size.height;
CGFloat imageWidth = 20 * kImageScale;
[self.experImageView mas_updateConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(imageWidth);
}];
} else {
@kWeakify(self);
[self.experImageView loadImageWithUrl:_memberInfo.experUrl completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) {
@kStrongify(self);
self.experImageView.image = image;
CGFloat kImageScale = image.size.width / image.size.height;
CGFloat imageWidth = 20 * kImageScale;
[self.experImageView mas_updateConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(imageWidth);
}];
}];
}
}
@@ -186,21 +178,13 @@
if (_memberInfo.charmUrl) {
if (self.charmImageView.state == NetImageStateLoaded) {
self.charmImageView.imageUrl = _memberInfo.charmUrl;
CGFloat kImageScale = self.charmImageView.image.size.width / self.charmImageView.image.size.height;
CGFloat imageWidth = 20 * kImageScale;
[self.charmImageView mas_updateConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(imageWidth);
}];
} else {
@kWeakify(self);
[self.charmImageView loadImageWithUrl:_memberInfo.charmUrl completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) {
@kStrongify(self);
self.charmImageView.image = image;
CGFloat kImageScale = image.size.width / image.size.height;
CGFloat imageWidth = 20 * kImageScale;
[self.charmImageView mas_updateConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(imageWidth);
}];
}];
}
}
@@ -391,7 +375,7 @@
_nickStackView = [[UIStackView alloc] init];
_nickStackView.axis = UILayoutConstraintAxisHorizontal;
_nickStackView.distribution = UIStackViewDistributionFill;
_nickStackView.alignment = UIStackViewAlignmentFill;
_nickStackView.alignment = UIStackViewAlignmentCenter;
_nickStackView.spacing = 2;
}
return _nickStackView;
@@ -429,7 +413,7 @@
_experImageView = [[NetImageView alloc] initWithConfig:config];
_experImageView.userInteractionEnabled = YES;
_experImageView.hidden = YES;
_experImageView.contentMode = UIViewContentModeScaleAspectFit;
}
return _experImageView;
}
@@ -442,7 +426,7 @@
_charmImageView = [[NetImageView alloc] initWithConfig:config];
_charmImageView.userInteractionEnabled = YES;
_charmImageView.hidden = YES;
_charmImageView.contentMode = UIViewContentModeScaleAspectFit;
}
return _charmImageView;
}

View File

@@ -326,17 +326,17 @@
self.orderId = orderId;
if (@available(iOS 15.0, *)) {
PIIAPManagers *iap = [PIIAPManagers shared];
[iap requestBuyProductWithProductId:chargeProdId uuid:uuid completionHandler:^(NSError * _Nullable error) {
PIIAPRegulate *iap = [PIIAPRegulate shared];
[iap demandShopedThingWithProductId:chargeProdId uuid:uuid completionHandler:^(NSError * _Nullable error) {
}];
@kWeakify(self);
iap.stateBlock = ^(enum StoreStateResult state, NSDictionary<NSString *,id> * _Nullable result) {
iap.ConditionBlock = ^(enum StoreConditionResult state, NSDictionary<NSString *,id> * _Nullable result) {
@kStrongify(self);
[self rechargeNewProcessStatus:state];
switch (state) {
case StoreStateResultVerifiedServer:
case StoreConditionResultVerifiedServer:
{
NSString *transactionId = result[@"transactionId"];
@@ -405,8 +405,8 @@
- (void)checkReceiptSuccess:(NSString *)transcationId {
[XNDJTDDLoadingTool hideOnlyView:kWindow];
if (@available(iOS 15.0, *)) {
PIIAPManagers *iap = [PIIAPManagers shared];
[iap transactionFinishWithTransaction:[NSString stringWithFormat:@"%@",transcationId] completionHandler:^{
PIIAPRegulate *iap = [PIIAPRegulate shared];
[iap verifyBusinessFinishWithTransaction:[NSString stringWithFormat:@"%@",transcationId] completionHandler:^{
}];
}
@@ -424,8 +424,8 @@
[XNDJTDDLoadingTool hideOnlyView:kWindow];
if(code == 1444){
if (@available(iOS 15.0, *)) {
PIIAPManagers *iap = [PIIAPManagers shared];
[iap transactionFinishWithTransaction:[NSString stringWithFormat:@"%@",transcationId] completionHandler:^{
PIIAPRegulate *iap = [PIIAPRegulate shared];
[iap verifyBusinessFinishWithTransaction:[NSString stringWithFormat:@"%@",transcationId] completionHandler:^{
}];
}
@@ -452,12 +452,12 @@
}
#pragma mark - XPIAPHelperDelegate
///
- (void)rechargeNewProcessStatus:(StoreStateResult)status {
- (void)rechargeNewProcessStatus:(StoreConditionResult)status {
if (status == StoreStateResultPay || status == StoreStateResultStart || status == StoreStateResultVerifiedServer) {
if (status == StoreConditionResultPay || status == StoreConditionResultStart || status == StoreConditionResultVerifiedServer) {
}else if (status == StoreStateResultUnowned) {
}else if (status == StoreConditionResultUnowned) {
[XNDJTDDLoadingTool hideOnlyView:kWindow];
[self showErrorToast:YMLocalizedString(@"XPIAPRechargeViewController1")];
}else{

View File

@@ -263,7 +263,7 @@
// }
// if(list.count > 0){
// if (@available(iOS 15.0, *)) {
// PIIAPManagers *iap = [PIIAPManagers shared];
// PIIAPRegulate *iap = [PIIAPRegulate shared];
// [iap allTransactionWithList:list completionHandler:^{
//
// }];
@@ -312,12 +312,12 @@
#pragma mark - XPIAPHelperDelegate
///
- (void)rechargeNewProcessStatus:(StoreStateResult)status {
- (void)rechargeNewProcessStatus:(StoreConditionResult)status {
if (status == StoreStateResultPay || status == StoreStateResultStart || status == StoreStateResultVerifiedServer) {
if (status == StoreConditionResultPay || status == StoreConditionResultStart || status == StoreConditionResultVerifiedServer) {
}else if (status == StoreStateResultUnowned) {
}else if (status == StoreConditionResultUnowned) {
[XNDJTDDLoadingTool hideHUDInView:kWindow];
[self showErrorToast:YMLocalizedString(@"XPIAPRechargeViewController1")];
}else{
@@ -347,17 +347,17 @@
self.orderId = orderId;
if (@available(iOS 15.0, *)) {
PIIAPManagers *iap = [PIIAPManagers shared];
[iap requestBuyProductWithProductId:chargeProdId uuid:uuid completionHandler:^(NSError * _Nullable error) {
PIIAPRegulate *iap = [PIIAPRegulate shared];
[iap demandShopedThingWithProductId:chargeProdId uuid:uuid completionHandler:^(NSError * _Nullable error) {
}];
@kWeakify(self);
iap.stateBlock = ^(enum StoreStateResult state, NSDictionary<NSString *,id> * _Nullable result) {
iap.ConditionBlock = ^(enum StoreConditionResult state, NSDictionary<NSString *,id> * _Nullable result) {
@kStrongify(self);
[self rechargeNewProcessStatus:state];
switch (state) {
case StoreStateResultVerifiedServer:
case StoreConditionResultVerifiedServer:
{
NSString *transactionId = result[@"transactionId"];
@@ -422,8 +422,8 @@
- (void)checkReceiptSuccess:(NSString *)transcationId {
[XNDJTDDLoadingTool hideHUDInView:kWindow];
if (@available(iOS 15.0, *)) {
PIIAPManagers *iap = [PIIAPManagers shared];
[iap transactionFinishWithTransaction:[NSString stringWithFormat:@"%@",transcationId] completionHandler:^{
PIIAPRegulate *iap = [PIIAPRegulate shared];
[iap verifyBusinessFinishWithTransaction:[NSString stringWithFormat:@"%@",transcationId] completionHandler:^{
}];
}
@@ -440,8 +440,8 @@
[XNDJTDDLoadingTool hideHUDInView:kWindow];
if(code == 1444){
if (@available(iOS 15.0, *)) {
PIIAPManagers *iap = [PIIAPManagers shared];
[iap transactionFinishWithTransaction:[NSString stringWithFormat:@"%@",transcationId] completionHandler:^{
PIIAPRegulate *iap = [PIIAPRegulate shared];
[iap verifyBusinessFinishWithTransaction:[NSString stringWithFormat:@"%@",transcationId] completionHandler:^{
}];
}

View File

@@ -316,17 +316,17 @@
if (@available(iOS 15.0, *)) {
PIIAPManagers *iap = [PIIAPManagers shared];
[iap requestBuyProductWithProductId:chargeProdId uuid:uuid completionHandler:^(NSError * _Nullable error) {
PIIAPRegulate *iap = [PIIAPRegulate shared];
[iap demandShopedThingWithProductId:chargeProdId uuid:uuid completionHandler:^(NSError * _Nullable error) {
}];
@kWeakify(self);
iap.stateBlock = ^(enum StoreStateResult state, NSDictionary<NSString *,id> * _Nullable result) {
iap.ConditionBlock = ^(enum StoreConditionResult state, NSDictionary<NSString *,id> * _Nullable result) {
@kStrongify(self);
[self rechargeNewProcessStatus:state];
switch (state) {
case StoreStateResultVerifiedServer:
case StoreConditionResultVerifiedServer:
{
NSString *transactionId = result[@"transactionId"];
@@ -357,12 +357,12 @@
#pragma mark - XPIAPHelperDelegate
///
- (void)rechargeNewProcessStatus:(StoreStateResult)status {
- (void)rechargeNewProcessStatus:(StoreConditionResult)status {
if (status == StoreStateResultPay || status == StoreStateResultStart || status == StoreStateResultVerifiedServer) {
if (status == StoreConditionResultPay || status == StoreConditionResultStart || status == StoreConditionResultVerifiedServer) {
}else if (status == StoreStateResultUnowned) {
}else if (status == StoreConditionResultUnowned) {
[XNDJTDDLoadingTool hideOnlyView:kWindow];
[XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPIAPRechargeViewController1")];
}else{
@@ -419,7 +419,7 @@
// }
// if(list.count > 0){
// if (@available(iOS 15.0, *)) {
// PIIAPManagers *iap = [PIIAPManagers shared];
// PIIAPRegulate *iap = [PIIAPRegulate shared];
// [iap allTransactionWithList:list completionHandler:^{
//
// }];
@@ -446,8 +446,8 @@
} else {
if(code == 1444){
if (@available(iOS 15.0, *)) {
PIIAPManagers *iap = [PIIAPManagers shared];
[iap transactionFinishWithTransaction:[NSString stringWithFormat:@"%@",transcationId] completionHandler:^{
PIIAPRegulate *iap = [PIIAPRegulate shared];
[iap verifyBusinessFinishWithTransaction:[NSString stringWithFormat:@"%@",transcationId] completionHandler:^{
}];
}
@@ -465,8 +465,8 @@
///
- (void)checkReceiptSuccess:(NSString *)transcationId {
if (@available(iOS 15.0, *)) {
PIIAPManagers *iap = [PIIAPManagers shared];
[iap transactionFinishWithTransaction:[NSString stringWithFormat:@"%@",transcationId] completionHandler:^{
PIIAPRegulate *iap = [PIIAPRegulate shared];
[iap verifyBusinessFinishWithTransaction:[NSString stringWithFormat:@"%@",transcationId] completionHandler:^{
}];
}

View File

@@ -100,13 +100,15 @@
[self.roleButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(38, 15));
}];
CGFloat width = 28 * 20 / 14;
[self.experImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(25);
make.height.mas_equalTo(20);
make.width.mas_equalTo(width);
}];
[self.charmImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(25);
make.height.mas_equalTo(25);
make.width.mas_equalTo(width);
}];
[self.namePlateView mas_makeConstraints:^(MASConstraintMaker *make) {

View File

@@ -1,9 +1,4 @@
//
// PIIAPPayment.swift
// YuMi
//
// Created by duoban on 2023/9/14.
//
import UIKit
import StoreKit
@@ -26,7 +21,7 @@ enum PIStoreError: Error {
}
@objc public enum StoreStateResult: Int64 { //
@objc public enum StoreConditionResult: Int64 { //
case start //
case pay //
case verifiedServer //
@@ -40,9 +35,9 @@ enum PIStoreError: Error {
@available(iOS 15.0, *)
public class PIIAPManagers: NSObject {
public typealias KStateBlock = (_ state :StoreStateResult,_ param:Dictionary<String,Any>?) ->()
@objc public var stateBlock: KStateBlock! //
public class PIIAPRegulate: NSObject {
public typealias KConditionBlock = (_ state :StoreConditionResult,_ param:Dictionary<String,Any>?) ->()
@objc public var ConditionBlock: KConditionBlock! //
var updateListenerTask: Task<Void, Error>? = nil //
@@ -51,7 +46,7 @@ public class PIIAPManagers: NSObject {
var name: String = "iosStore" //
@objc public static let shared = {
let instance = PIIAPManagers()
let instance = PIIAPRegulate()
return instance
}()
@@ -81,9 +76,9 @@ public class PIIAPManagers: NSObject {
//
@objc public func requestBuyProduct(productId:String, uuid: String) async throws {
if(stateBlock != nil ){
stateBlock(StoreStateResult.start,nil)
@objc public func demandShopedThing(productId:String, uuid: String) async throws {
if(ConditionBlock != nil ){
ConditionBlock(StoreConditionResult.start,nil)
}
do {
let list:[String] = [productId]
@@ -96,15 +91,15 @@ public class PIIAPManagers: NSObject {
try await purchase(storeProducts[0],uuid)
}else {
print("iap: no found product")
if(stateBlock != nil ){
stateBlock(StoreStateResult.noProduct,nil)
if(ConditionBlock != nil ){
ConditionBlock(StoreConditionResult.noProduct,nil)
}
throw PIStoreError.noProduct //
}
} catch {
print("Failed product request from the App Store server: \(error)")
if(stateBlock != nil ){
stateBlock(StoreStateResult.noProduct,nil)
if(ConditionBlock != nil ){
ConditionBlock(StoreConditionResult.noProduct,nil)
}
throw PIStoreError.noProduct //
}
@@ -112,14 +107,14 @@ public class PIIAPManagers: NSObject {
//
private func purchase(_ product: Product, _ uuid: String) async throws -> Transaction? {
if(stateBlock != nil ){
stateBlock(StoreStateResult.pay,nil)
if(ConditionBlock != nil ){
ConditionBlock(StoreConditionResult.pay,nil)
}
guard let curUUID = UUID.init(uuidString: uuid) else{
if(stateBlock != nil ){
stateBlock(StoreStateResult.failedVerification,nil)
if(ConditionBlock != nil ){
ConditionBlock(StoreConditionResult.failedVerification,nil)
}
return nil
}
@@ -131,18 +126,18 @@ public class PIIAPManagers: NSObject {
let transaction = try await verifiedAndFinish(verification)
return transaction
case .userCancelled: //
if(stateBlock != nil ){
stateBlock(StoreStateResult.userCancelled,nil)
if(ConditionBlock != nil ){
ConditionBlock(StoreConditionResult.userCancelled,nil)
}
return nil
case .pending: //
if(stateBlock != nil ){
stateBlock(StoreStateResult.pending,nil)
if(ConditionBlock != nil ){
ConditionBlock(StoreConditionResult.pending,nil)
}
return nil
default:
if(stateBlock != nil ){
stateBlock(StoreStateResult.unowned,nil)
if(ConditionBlock != nil ){
ConditionBlock(StoreConditionResult.unowned,nil)
}
return nil
}
@@ -154,8 +149,8 @@ public class PIIAPManagers: NSObject {
switch result {
case .unverified:
//StoreKit parses the JWS, but it fails verification.
if(stateBlock != nil ){
stateBlock(StoreStateResult.failedVerification,nil)
if(ConditionBlock != nil ){
ConditionBlock(StoreConditionResult.failedVerification,nil)
}
throw PIStoreError.failedVerification
case .verified(let safe):
@@ -188,7 +183,7 @@ public class PIIAPManagers: NSObject {
Latest transactions
Current entitlements
*/
func allTransaction(transactionId:String) async {
func getAllBusiness(transactionId:String) async {
let transactionIntId = UInt64(transactionId)
for await result in Transaction.all {
@@ -212,21 +207,21 @@ public class PIIAPManagers: NSObject {
}
//
@objc public func transactionFinish(transaction:String) async{
@objc public func verifyBusinessFinish(transaction:String) async{
if(transactionMap[transaction] != nil){
await transactionMap[transaction]!.finish()
transactionMap.removeValue(forKey: transaction)
print("transactionFinish end")
print("verifyBusinessFinish end")
}else {
await allTransaction(transactionId: transaction)
await getAllBusiness(transactionId: transaction)
}
}
@MainActor
func uploadServer(for transactionId:UInt64) async {
let dic :Dictionary<String,Any> = ["transactionId":transactionId]
if(stateBlock != nil ){
stateBlock(StoreStateResult.verifiedServer,dic)
if(ConditionBlock != nil ){
ConditionBlock(StoreConditionResult.verifiedServer,dic)
}
}