我的UI接口对接
This commit is contained in:
@@ -694,6 +694,7 @@
|
|||||||
18FDEDCF2A50353A005EB21D /* DynamicSendLocationView.m in Sources */ = {isa = PBXBuildFile; fileRef = 18FDEDCE2A50353A005EB21D /* DynamicSendLocationView.m */; };
|
18FDEDCF2A50353A005EB21D /* DynamicSendLocationView.m in Sources */ = {isa = PBXBuildFile; fileRef = 18FDEDCE2A50353A005EB21D /* DynamicSendLocationView.m */; };
|
||||||
23A7F78B2B28795500288CAE /* Api+DDHomeApi.m in Sources */ = {isa = PBXBuildFile; fileRef = 23A7F7892B28795500288CAE /* Api+DDHomeApi.m */; };
|
23A7F78B2B28795500288CAE /* Api+DDHomeApi.m in Sources */ = {isa = PBXBuildFile; fileRef = 23A7F7892B28795500288CAE /* Api+DDHomeApi.m */; };
|
||||||
23A7F78F2B287E8C00288CAE /* Api+DDMineApi.m in Sources */ = {isa = PBXBuildFile; fileRef = 23A7F78E2B287E8C00288CAE /* Api+DDMineApi.m */; };
|
23A7F78F2B287E8C00288CAE /* Api+DDMineApi.m in Sources */ = {isa = PBXBuildFile; fileRef = 23A7F78E2B287E8C00288CAE /* Api+DDMineApi.m */; };
|
||||||
|
23A7F7932B29553E00288CAE /* DDApplePayManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23A7F7922B29553E00288CAE /* DDApplePayManager.swift */; };
|
||||||
23B2A7B02B283A76001C0913 /* DDAppColor.m in Sources */ = {isa = PBXBuildFile; fileRef = 23B2A7622B283A75001C0913 /* DDAppColor.m */; };
|
23B2A7B02B283A76001C0913 /* DDAppColor.m in Sources */ = {isa = PBXBuildFile; fileRef = 23B2A7622B283A75001C0913 /* DDAppColor.m */; };
|
||||||
23B2A7B12B283A76001C0913 /* DDBaseVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 23B2A7662B283A75001C0913 /* DDBaseVC.m */; };
|
23B2A7B12B283A76001C0913 /* DDBaseVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 23B2A7662B283A75001C0913 /* DDBaseVC.m */; };
|
||||||
23B2A7B22B283A76001C0913 /* DDHUDManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 23B2A7692B283A75001C0913 /* DDHUDManager.m */; };
|
23B2A7B22B283A76001C0913 /* DDHUDManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 23B2A7692B283A75001C0913 /* DDHUDManager.m */; };
|
||||||
@@ -2035,6 +2036,8 @@
|
|||||||
23A7F7892B28795500288CAE /* Api+DDHomeApi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "Api+DDHomeApi.m"; sourceTree = "<group>"; };
|
23A7F7892B28795500288CAE /* Api+DDHomeApi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "Api+DDHomeApi.m"; sourceTree = "<group>"; };
|
||||||
23A7F78D2B287E8C00288CAE /* Api+DDMineApi.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Api+DDMineApi.h"; sourceTree = "<group>"; };
|
23A7F78D2B287E8C00288CAE /* Api+DDMineApi.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Api+DDMineApi.h"; sourceTree = "<group>"; };
|
||||||
23A7F78E2B287E8C00288CAE /* Api+DDMineApi.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "Api+DDMineApi.m"; sourceTree = "<group>"; };
|
23A7F78E2B287E8C00288CAE /* Api+DDMineApi.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "Api+DDMineApi.m"; sourceTree = "<group>"; };
|
||||||
|
23A7F7912B29553D00288CAE /* DingDangApp-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "DingDangApp-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||||
|
23A7F7922B29553E00288CAE /* DDApplePayManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DDApplePayManager.swift; sourceTree = "<group>"; };
|
||||||
23B2A7622B283A75001C0913 /* DDAppColor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDAppColor.m; sourceTree = "<group>"; };
|
23B2A7622B283A75001C0913 /* DDAppColor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDAppColor.m; sourceTree = "<group>"; };
|
||||||
23B2A7632B283A75001C0913 /* DDAppColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDAppColor.h; sourceTree = "<group>"; };
|
23B2A7632B283A75001C0913 /* DDAppColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDAppColor.h; sourceTree = "<group>"; };
|
||||||
23B2A7652B283A75001C0913 /* DDBaseVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDBaseVC.h; sourceTree = "<group>"; };
|
23B2A7652B283A75001C0913 /* DDBaseVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDBaseVC.h; sourceTree = "<group>"; };
|
||||||
@@ -5157,6 +5160,15 @@
|
|||||||
path = DDMineApi;
|
path = DDMineApi;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
|
23A7F7902B29551D00288CAE /* DDApplePay */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
23A7F7922B29553E00288CAE /* DDApplePayManager.swift */,
|
||||||
|
23A7F7912B29553D00288CAE /* DingDangApp-Bridging-Header.h */,
|
||||||
|
);
|
||||||
|
path = DDApplePay;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
23B2A7612B283A75001C0913 /* DDAppColor */ = {
|
23B2A7612B283A75001C0913 /* DDAppColor */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
@@ -5460,6 +5472,7 @@
|
|||||||
23B2A8072B284A99001C0913 /* DDMain */ = {
|
23B2A8072B284A99001C0913 /* DDMain */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
23A7F7902B29551D00288CAE /* DDApplePay */,
|
||||||
23A7F7862B28795500288CAE /* DDHome */,
|
23A7F7862B28795500288CAE /* DDHome */,
|
||||||
23A7F78A2B28795500288CAE /* DDMine */,
|
23A7F78A2B28795500288CAE /* DDMine */,
|
||||||
);
|
);
|
||||||
@@ -5910,6 +5923,7 @@
|
|||||||
TargetAttributes = {
|
TargetAttributes = {
|
||||||
ECA531332A20EB60006E6D04 = {
|
ECA531332A20EB60006E6D04 = {
|
||||||
CreatedOnToolsVersion = 14.2;
|
CreatedOnToolsVersion = 14.2;
|
||||||
|
LastSwiftMigration = 1500;
|
||||||
};
|
};
|
||||||
ECA5314E2A20EB64006E6D04 = {
|
ECA5314E2A20EB64006E6D04 = {
|
||||||
CreatedOnToolsVersion = 14.2;
|
CreatedOnToolsVersion = 14.2;
|
||||||
@@ -6763,6 +6777,7 @@
|
|||||||
1826C5E92A2431CA00A5AFDB /* DDCellModel.m in Sources */,
|
1826C5E92A2431CA00A5AFDB /* DDCellModel.m in Sources */,
|
||||||
186A88E72A4152AA001DE99E /* DDMyLevelView.m in Sources */,
|
186A88E72A4152AA001DE99E /* DDMyLevelView.m in Sources */,
|
||||||
18F46D9D2A28409600CD2B7E /* RoomSendGiftTopView.m in Sources */,
|
18F46D9D2A28409600CD2B7E /* RoomSendGiftTopView.m in Sources */,
|
||||||
|
23A7F7932B29553E00288CAE /* DDApplePayManager.swift in Sources */,
|
||||||
18660D532A2193C50032D0C9 /* UIView+Common.m in Sources */,
|
18660D532A2193C50032D0C9 /* UIView+Common.m in Sources */,
|
||||||
18D348372A26144B0011D61C /* DDMyInfoSettingTableViewCell.m in Sources */,
|
18D348372A26144B0011D61C /* DDMyInfoSettingTableViewCell.m in Sources */,
|
||||||
186A890A2A4193B1001DE99E /* DDMyRoomHomeViewController.m in Sources */,
|
186A890A2A4193B1001DE99E /* DDMyRoomHomeViewController.m in Sources */,
|
||||||
@@ -7010,6 +7025,7 @@
|
|||||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_ENTITLEMENTS = DingDangApp/DingDangApp.entitlements;
|
CODE_SIGN_ENTITLEMENTS = DingDangApp/DingDangApp.entitlements;
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
@@ -7053,6 +7069,9 @@
|
|||||||
SUPPORTS_MACCATALYST = NO;
|
SUPPORTS_MACCATALYST = NO;
|
||||||
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
|
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
|
||||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||||
|
SWIFT_OBJC_BRIDGING_HEADER = "DingDangApp/YingMeng/DDMain/DDApplePay/DingDangApp-Bridging-Header.h";
|
||||||
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
TARGETED_DEVICE_FAMILY = 1;
|
TARGETED_DEVICE_FAMILY = 1;
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
@@ -7064,6 +7083,7 @@
|
|||||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_ENTITLEMENTS = DingDangApp/DingDangApp.entitlements;
|
CODE_SIGN_ENTITLEMENTS = DingDangApp/DingDangApp.entitlements;
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
@@ -7107,6 +7127,8 @@
|
|||||||
SUPPORTS_MACCATALYST = NO;
|
SUPPORTS_MACCATALYST = NO;
|
||||||
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
|
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
|
||||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||||
|
SWIFT_OBJC_BRIDGING_HEADER = "DingDangApp/YingMeng/DDMain/DDApplePay/DingDangApp-Bridging-Header.h";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
TARGETED_DEVICE_FAMILY = 1;
|
TARGETED_DEVICE_FAMILY = 1;
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
@@ -7115,6 +7137,7 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
baseConfigurationReference = D1D40500E156EDA751B2F2CE /* Pods-DingDangAppTests.debug.xcconfig */;
|
baseConfigurationReference = D1D40500E156EDA751B2F2CE /* Pods-DingDangAppTests.debug.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
|
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
@@ -7133,6 +7156,7 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
baseConfigurationReference = 688E5912F2E950A95FC1EE55 /* Pods-DingDangAppTests.release.xcconfig */;
|
baseConfigurationReference = 688E5912F2E950A95FC1EE55 /* Pods-DingDangAppTests.release.xcconfig */;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
|
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
|
@@ -876,7 +876,7 @@ static NSString *SAVEROOMCONFIG = @"ROOMCONFIG";
|
|||||||
}
|
}
|
||||||
+ (void)pushMyInformationViewController:(NSString *)user_id{
|
+ (void)pushMyInformationViewController:(NSString *)user_id{
|
||||||
DDMyInformationViewController * infoVC = [[DDMyInformationViewController alloc] init];
|
DDMyInformationViewController * infoVC = [[DDMyInformationViewController alloc] init];
|
||||||
infoVC.user_id = user_id;
|
infoVC.user_id = [[AccountInfoStorage instance]getUid];;
|
||||||
[[ToolsObject getCurrentViewController].navigationController pushViewController:infoVC animated:YES];
|
[[ToolsObject getCurrentViewController].navigationController pushViewController:infoVC animated:YES];
|
||||||
}
|
}
|
||||||
+ (NSString*)dd_timeAfterTarget:(NSString *)changeTime
|
+ (NSString*)dd_timeAfterTarget:(NSString *)changeTime
|
||||||
|
@@ -67,7 +67,22 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
@property (nonatomic, copy) NSString *invite_code;
|
@property (nonatomic, copy) NSString *invite_code;
|
||||||
@property (nonatomic, copy) NSString *code;
|
@property (nonatomic, copy) NSString *code;
|
||||||
|
|
||||||
|
/// 用户 uid
|
||||||
|
@property(nonatomic, assign) NSInteger uid;
|
||||||
|
/// 钻石数量
|
||||||
|
@property(nonatomic, copy)NSString *goldNum;
|
||||||
|
//钻石数量
|
||||||
|
@property(nonatomic, copy)NSString *diamonds;
|
||||||
|
|
||||||
|
@property(nonatomic, copy)NSString *chargeGoldNum;
|
||||||
|
|
||||||
|
@property(nonatomic, assign)NSInteger amount;
|
||||||
|
/// 钻石数量
|
||||||
|
@property(nonatomic, assign) double diamondNum;
|
||||||
|
|
||||||
|
@property(nonatomic, copy)NSString *depositNum;
|
||||||
|
/// 是否有钻石转增功能
|
||||||
|
@property (nonatomic, assign) BOOL sendGold;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
NS_ASSUME_NONNULL_END
|
||||||
|
@@ -64,6 +64,7 @@
|
|||||||
}
|
}
|
||||||
-(void)requestData
|
-(void)requestData
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
NSMutableDictionary *requestDict = [NSMutableDictionary dictionary];
|
NSMutableDictionary *requestDict = [NSMutableDictionary dictionary];
|
||||||
[requestDict setObject:@(20) forKey:@"current_page"];
|
[requestDict setObject:@(20) forKey:@"current_page"];
|
||||||
[requestDict setObject:@(self.pageNum) forKey:@"page_number"];
|
[requestDict setObject:@(self.pageNum) forKey:@"page_number"];
|
||||||
|
@@ -66,7 +66,6 @@
|
|||||||
[DDCellModel addDataWithName:@"账号与安全" icon:@"" cellType:DDCellModelType_Normal setType:(DDMyInfoModelType_Account) content:@""],
|
[DDCellModel addDataWithName:@"账号与安全" icon:@"" cellType:DDCellModelType_Normal setType:(DDMyInfoModelType_Account) content:@""],
|
||||||
[DDCellModel addDataWithName:@"青少年模式" icon:@"" cellType:DDCellModelType_Normal setType:(DDMyInfoModelType_YoungMode) content:@""],
|
[DDCellModel addDataWithName:@"青少年模式" icon:@"" cellType:DDCellModelType_Normal setType:(DDMyInfoModelType_YoungMode) content:@""],
|
||||||
[DDCellModel addDataWithName:@"黑名单" icon:@"" cellType:DDCellModelType_Normal setType:(DDMyInfoModelType_MyBlackList) content:@""],
|
[DDCellModel addDataWithName:@"黑名单" icon:@"" cellType:DDCellModelType_Normal setType:(DDMyInfoModelType_MyBlackList) content:@""],
|
||||||
[DDCellModel addDataWithName:@"联系我们" icon:@"" cellType:DDCellModelType_Normal setType:(DDMyInfoModelType_AboutUs) content:@""],
|
|
||||||
[DDCellModel addDataWithName:@"隐私协议" icon:@"" cellType:DDCellModelType_Normal setType:(DDMyInfoModelType_PrivacyAgreement) content:@""],
|
[DDCellModel addDataWithName:@"隐私协议" icon:@"" cellType:DDCellModelType_Normal setType:(DDMyInfoModelType_PrivacyAgreement) content:@""],
|
||||||
[DDCellModel addDataWithName:@"当前版本" icon:@"" cellType:DDCellModelType_Normal setType:(DDMyInfoModelType_CurrentVersion) content:[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]],
|
[DDCellModel addDataWithName:@"当前版本" icon:@"" cellType:DDCellModelType_Normal setType:(DDMyInfoModelType_CurrentVersion) content:[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]],
|
||||||
[DDCellModel addDataWithName:@"清除缓存" icon:@"" cellType:DDCellModelType_Normal setType:(DDMyInfoModelType_ClearCache) content:[NSString stringWithFormat:@"%.2fM",[self getAppCacheSize]]],
|
[DDCellModel addDataWithName:@"清除缓存" icon:@"" cellType:DDCellModelType_Normal setType:(DDMyInfoModelType_ClearCache) content:[NSString stringWithFormat:@"%.2fM",[self getAppCacheSize]]],
|
||||||
@@ -174,20 +173,20 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else if (model.setType == DDMyInfoModelType_Notification){
|
}else if (model.setType == DDMyInfoModelType_Notification){
|
||||||
WeakSelf(weakSelf)
|
// WeakSelf(weakSelf)
|
||||||
[NetworkRequest requestPOST:@"/home/set/notification" parameters:@{} block:^(BaseResponse * _Nonnull response) {
|
// [NetworkRequest requestPOST:@"/home/set/notification" parameters:@{} block:^(BaseResponse * _Nonnull response) {
|
||||||
if (response.code == 200) {
|
// if (response.code == 200) {
|
||||||
AppUserModel * model = [ToolsObject getUserModel];
|
// AppUserModel * model = [ToolsObject getUserModel];
|
||||||
model.is_notification = !model.is_notification;
|
// model.is_notification = !model.is_notification;
|
||||||
[ToolsObject saveUserModel:model];
|
// [ToolsObject saveUserModel:model];
|
||||||
DDCellModel * cellModel = weakSelf.listArr[weakSelf.listArr.count-1];
|
// DDCellModel * cellModel = weakSelf.listArr[weakSelf.listArr.count-1];
|
||||||
cellModel.content = [NSString stringWithFormat:@"%d",[ToolsObject getUserModel].is_notification];
|
// cellModel.content = [NSString stringWithFormat:@"%d",[ToolsObject getUserModel].is_notification];
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
// dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
NSIndexPath *index = [NSIndexPath indexPathForRow:weakSelf.listArr.count-1 inSection:0];
|
// NSIndexPath *index = [NSIndexPath indexPathForRow:weakSelf.listArr.count-1 inSection:0];
|
||||||
[weakSelf.myTableView reloadRowsAtIndexPaths:@[index] withRowAnimation:(UITableViewRowAnimationNone)];
|
// [weakSelf.myTableView reloadRowsAtIndexPaths:@[index] withRowAnimation:(UITableViewRowAnimationNone)];
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
}];
|
// }];
|
||||||
}else{}
|
}else{}
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -234,7 +233,7 @@
|
|||||||
case DDMyInfoModelType_PrivacyAgreement:
|
case DDMyInfoModelType_PrivacyAgreement:
|
||||||
{
|
{
|
||||||
/* 隐私协议 */
|
/* 隐私协议 */
|
||||||
DDWebViewController * webVC = [DDWebViewController webControlerWithUrlStr:[NSString stringWithFormat:@"%@#/publicpage?position=1009",KWebURL] isShowNavBar:YES navTitle:@"隐私协议"];
|
DDWebViewController * webVC = [DDWebViewController webControlerWithUrlStr:[NSString stringWithFormat:@"%@/yinmeng/modules/rule/privacy-wap.html",API_HOST_H5_URL] isShowNavBar:YES navTitle:@"隐私协议"];
|
||||||
webVC.view.backgroundColor = UIColor.whiteColor;
|
webVC.view.backgroundColor = UIColor.whiteColor;
|
||||||
[[ToolsObject getCurrentViewController].navigationController pushViewController:webVC animated:NO];
|
[[ToolsObject getCurrentViewController].navigationController pushViewController:webVC animated:NO];
|
||||||
}
|
}
|
||||||
|
@@ -9,6 +9,7 @@
|
|||||||
#import "DDMyInfoGiftWallView.h"
|
#import "DDMyInfoGiftWallView.h"
|
||||||
#import "DDMyInfoGiftWallCollectionViewCell.h"
|
#import "DDMyInfoGiftWallCollectionViewCell.h"
|
||||||
#import "DDGiftWallModel.h"
|
#import "DDGiftWallModel.h"
|
||||||
|
#import "Api+DDMineApi.h"
|
||||||
@interface DDMyInformationGiftWallViewController ()
|
@interface DDMyInformationGiftWallViewController ()
|
||||||
|
|
||||||
@end
|
@end
|
||||||
@@ -29,6 +30,29 @@
|
|||||||
|
|
||||||
-(void)requestGiftWall
|
-(void)requestGiftWall
|
||||||
{
|
{
|
||||||
|
WeakSelf(weakSelf)
|
||||||
|
[Api getUserGiftWall:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||||
|
[weakSelf.giftWallCollectionView.mj_header endRefreshing];
|
||||||
|
[weakSelf.giftWallCollectionView.mj_footer endRefreshing];
|
||||||
|
if(code == 200){
|
||||||
|
if (weakSelf.pageNum == 1) {
|
||||||
|
[weakSelf.giftListArr removeAllObjects];
|
||||||
|
}
|
||||||
|
NSArray *list = [DDGiftWallModel DD_ModelsWithArray:data.data];
|
||||||
|
[weakSelf.giftListArr addObjectsFromArray:list];
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
[weakSelf.giftWallCollectionView.mj_header endRefreshing];
|
||||||
|
[weakSelf.giftWallCollectionView.mj_footer endRefreshing];
|
||||||
|
[weakSelf.giftWallCollectionView reloadData];
|
||||||
|
|
||||||
|
weakSelf.giftCount =list.count;
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} uid:self.user_id giftType:@"1"];
|
||||||
|
|
||||||
|
return;
|
||||||
NSMutableDictionary *requestDict = [NSMutableDictionary dictionary];
|
NSMutableDictionary *requestDict = [NSMutableDictionary dictionary];
|
||||||
if ([ToolsObject IsNullWithObject:self.user_id]) {
|
if ([ToolsObject IsNullWithObject:self.user_id]) {
|
||||||
[requestDict setObject:[ToolsObject getUserModel].user_id forKey:@"user_id"];
|
[requestDict setObject:[ToolsObject getUserModel].user_id forKey:@"user_id"];
|
||||||
@@ -37,7 +61,7 @@
|
|||||||
}
|
}
|
||||||
[requestDict setObject:@(self.pageNum) forKey:@"page_number"];
|
[requestDict setObject:@(self.pageNum) forKey:@"page_number"];
|
||||||
[requestDict setObject:@(15) forKey:@"current_page"];
|
[requestDict setObject:@(15) forKey:@"current_page"];
|
||||||
WeakSelf(weakSelf)
|
|
||||||
[NetworkRequest requestPOST:@"/my/gift/list" parameters:requestDict block:^(BaseResponse * _Nonnull response) {
|
[NetworkRequest requestPOST:@"/my/gift/list" parameters:requestDict block:^(BaseResponse * _Nonnull response) {
|
||||||
if (response.code == 200) {
|
if (response.code == 200) {
|
||||||
if ([ToolsObject IsNullWithObject:response.data]) {
|
if ([ToolsObject IsNullWithObject:response.data]) {
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "DDBasePagerHomeListViewController.h"
|
#import "DDBasePagerHomeListViewController.h"
|
||||||
|
#import "UserInfoModel.h"
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface DDMyInformationProfileViewController : DDBasePagerHomeListViewController
|
@interface DDMyInformationProfileViewController : DDBasePagerHomeListViewController
|
||||||
@@ -17,7 +17,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
@property (nonatomic,strong) UILabel * titleLabel;
|
@property (nonatomic,strong) UILabel * titleLabel;
|
||||||
@property (nonatomic,strong) UILabel * myContentLabel;
|
@property (nonatomic,strong) UILabel * myContentLabel;
|
||||||
@property (nonatomic,copy) NSString * user_id;
|
@property (nonatomic,copy) NSString * user_id;
|
||||||
@property (nonatomic,strong) AppUserModel * personModel;
|
@property (nonatomic,strong) UserInfoModel * personModel;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
NS_ASSUME_NONNULL_END
|
||||||
|
@@ -124,22 +124,91 @@
|
|||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
- (void)myIDBtnClick{
|
- (void)myIDBtnClick{
|
||||||
if (![ToolsObject IsNullWithObject:self.personModel.user_number]) {
|
if (![ToolsObject IsNullWithObject:@(self.personModel.erbanNo).stringValue]) {
|
||||||
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
|
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
|
||||||
pasteboard.string = self.personModel.user_number;
|
pasteboard.string = @(self.personModel.erbanNo).stringValue;
|
||||||
[self.view jk_makeToast:@"已复制ID到剪切板!"];
|
[self.view jk_makeToast:@"已复制ID到剪切板!"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
- (void)setPersonModel:(AppUserModel *)personModel{
|
- (void)setPersonModel:(UserInfoModel *)personModel{
|
||||||
_personModel = personModel;
|
_personModel = personModel;
|
||||||
[self.myIDBtn setTitle:[NSString stringWithFormat:@"ID:%@",personModel.user_number] forState:UIControlStateNormal];
|
[self.myIDBtn setTitle:[NSString stringWithFormat:@"ID:%@",@(personModel.erbanNo)] forState:UIControlStateNormal];
|
||||||
[self.myIDBtn setImage:[UIImage imageNamed:@"myinfo_21"] forState:UIControlStateNormal];
|
[self.myIDBtn setImage:[UIImage imageNamed:@"myinfo_21"] forState:UIControlStateNormal];
|
||||||
[self.myIDBtn jk_setImagePosition:LXMImagePositionRight spacing:4];
|
[self.myIDBtn jk_setImagePosition:LXMImagePositionRight spacing:4];
|
||||||
[self.myAgeBtn setTitle:[NSString stringWithFormat:@"%ld岁",personModel.age] forState:UIControlStateNormal];
|
[self.myAgeBtn setTitle:[NSString stringWithFormat:@"%@岁",[self dd_getUserAge:_personModel.birth]] forState:UIControlStateNormal];
|
||||||
[self.myConsBtn setTitle:personModel.constellation forState:UIControlStateNormal];
|
[self.myConsBtn setTitle:[self dd_getConstellationWithMonth:_personModel.birth] forState:UIControlStateNormal];
|
||||||
self.myContentLabel.text = personModel.signature;
|
self.myContentLabel.text = personModel.userDesc ?:@"这个人很懒,没什么签名~";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
-(NSInteger) dd_getMonth:(long )time
|
||||||
|
{
|
||||||
|
NSDate *date = [NSDate dateWithTimeIntervalSince1970:time/1000];
|
||||||
|
NSCalendar* calendar = [NSCalendar currentCalendar];
|
||||||
|
NSDateComponents* components = [calendar components:NSCalendarUnitMonth fromDate:date];
|
||||||
|
NSInteger month = components.month;
|
||||||
|
return month;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSInteger) dd_getDay:(long) time
|
||||||
|
{
|
||||||
|
NSDate *date = [NSDate dateWithTimeIntervalSince1970:time/1000];
|
||||||
|
NSCalendar* calendar = [NSCalendar currentCalendar];
|
||||||
|
NSDateComponents* components = [calendar components:NSCalendarUnitDay fromDate:date];
|
||||||
|
NSInteger day = components.day;
|
||||||
|
return day;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *)dd_getConstellationWithMonth:(long)time
|
||||||
|
{
|
||||||
|
NSString *astroString = @"魔羯水瓶双鱼白羊金牛双子巨蟹狮子处女天秤天蝎射手魔羯";
|
||||||
|
NSString *astroFormat = @"102123444543";
|
||||||
|
NSString *result;
|
||||||
|
|
||||||
|
NSInteger month = [self dd_getMonth:time];
|
||||||
|
NSInteger day = [self dd_getDay:time];
|
||||||
|
|
||||||
|
if (month<1 || month>12 || day<1 || day>31){
|
||||||
|
return @"错误日期格式!";
|
||||||
|
}
|
||||||
|
|
||||||
|
if(month==2 && day>29)
|
||||||
|
{
|
||||||
|
return @"错误日期格式!!";
|
||||||
|
}else if(month==4 || month==6 || month==9 || month==11) {
|
||||||
|
if (day>30) {
|
||||||
|
return @"错误日期格式!!!";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
result=[NSString stringWithFormat:@"%@",[astroString substringWithRange:NSMakeRange(month*2-(day < [[astroFormat substringWithRange:NSMakeRange((month-1), 1)] intValue] - (-19))*2,2)]];
|
||||||
|
|
||||||
|
return [NSString stringWithFormat:@"%@座",result];
|
||||||
|
}
|
||||||
|
- (NSString *)dd_getUserAge:(long)time {
|
||||||
|
NSDate *date = [NSDate dateWithTimeIntervalSince1970:time/1000];
|
||||||
|
NSCalendar *birthCalendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierISO8601];
|
||||||
|
NSDateComponents *birthCompomemts = [birthCalendar components:NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitWeekday | NSCalendarUnitDay fromDate:date];
|
||||||
|
NSInteger year = birthCompomemts.year;
|
||||||
|
NSInteger month = birthCompomemts.month;
|
||||||
|
NSInteger day = birthCompomemts.day;
|
||||||
|
NSLog(@"出生于%ld年%ld月%ld日", year, month, day);
|
||||||
|
|
||||||
|
NSDate *nowDate = [NSDate date];
|
||||||
|
NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierISO8601];
|
||||||
|
NSDateComponents *compomemts = [calendar components:NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitWeekday | NSCalendarUnitDay fromDate:nowDate];
|
||||||
|
NSInteger nowYear = compomemts.year;
|
||||||
|
NSInteger nowMonth = compomemts.month;
|
||||||
|
NSInteger nowDay = compomemts.day;
|
||||||
|
NSLog(@"今天是%ld年%ld月%ld日", nowYear, nowMonth, nowDay);
|
||||||
|
|
||||||
|
// 计算年龄
|
||||||
|
NSInteger userAge = nowYear - year - 1;
|
||||||
|
if ((nowMonth > month) || (nowMonth == month && nowDay >= day)) {
|
||||||
|
userAge++;
|
||||||
|
}
|
||||||
|
NSLog(@"用户年龄是%ld",userAge);
|
||||||
|
return [NSString stringWithFormat:@"%ld", userAge];
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
#pragma mark - Navigation
|
#pragma mark - Navigation
|
||||||
|
|
||||||
|
@@ -16,6 +16,8 @@
|
|||||||
#import "DDMyInfoReportViewController.h"
|
#import "DDMyInfoReportViewController.h"
|
||||||
#import "DDMyInformationProfileViewController.h"
|
#import "DDMyInformationProfileViewController.h"
|
||||||
#import "DDDynamicSendViewController.h"
|
#import "DDDynamicSendViewController.h"
|
||||||
|
#import "Api.h"
|
||||||
|
#import "UserInfoModel.h"
|
||||||
@interface DDMyInformationViewController ()<UIGestureRecognizerDelegate>
|
@interface DDMyInformationViewController ()<UIGestureRecognizerDelegate>
|
||||||
@property (nonatomic, strong) UIImageView * topBgImageView;
|
@property (nonatomic, strong) UIImageView * topBgImageView;
|
||||||
@property (nonatomic, strong) UIView * topNavView;
|
@property (nonatomic, strong) UIView * topNavView;
|
||||||
@@ -30,6 +32,7 @@
|
|||||||
@property (nonatomic, strong) UIButton * editBtn;
|
@property (nonatomic, strong) UIButton * editBtn;
|
||||||
@property (nonatomic, strong) AppUserModel * personModel;
|
@property (nonatomic, strong) AppUserModel * personModel;
|
||||||
@property (nonatomic, strong) DDMyInformationProfileViewController * profileVC;
|
@property (nonatomic, strong) DDMyInformationProfileViewController * profileVC;
|
||||||
|
@property(nonatomic,strong) UserInfoModel *userModel;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation DDMyInformationViewController
|
@implementation DDMyInformationViewController
|
||||||
@@ -69,7 +72,6 @@
|
|||||||
self.categoryView.titleFont = [UIFont systemFontOfSize:14];
|
self.categoryView.titleFont = [UIFont systemFontOfSize:14];
|
||||||
self.categoryView.titleColorGradientEnabled = YES;
|
self.categoryView.titleColorGradientEnabled = YES;
|
||||||
[self.titlesArray addObject:@"资料"];
|
[self.titlesArray addObject:@"资料"];
|
||||||
[self.titlesArray addObject:@"动态"];
|
|
||||||
[self.titlesArray addObject:@"礼物墙"];
|
[self.titlesArray addObject:@"礼物墙"];
|
||||||
self.categoryView.titles = self.titlesArray;
|
self.categoryView.titles = self.titlesArray;
|
||||||
[self.view addSubview:self.topBgImageView];
|
[self.view addSubview:self.topBgImageView];
|
||||||
@@ -123,6 +125,19 @@
|
|||||||
-(void)getUserInfo
|
-(void)getUserInfo
|
||||||
{
|
{
|
||||||
WeakSelf(weakSelf)
|
WeakSelf(weakSelf)
|
||||||
|
|
||||||
|
[Api getUserInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||||
|
|
||||||
|
if(code == 200){
|
||||||
|
UserInfoModel *userModel = [UserInfoModel DD_ModelWithDict:data.data];
|
||||||
|
self.userModel = userModel;
|
||||||
|
weakSelf.profileVC.personModel = userModel;
|
||||||
|
weakSelf.titLabel.text = userModel.nick;
|
||||||
|
[weakSelf.headerView updataPersonInfoWithModel:userModel];
|
||||||
|
}
|
||||||
|
} uid:self.user_id];
|
||||||
|
return;
|
||||||
|
|
||||||
NSMutableDictionary *requestDict = [NSMutableDictionary dictionary];
|
NSMutableDictionary *requestDict = [NSMutableDictionary dictionary];
|
||||||
if (![ToolsObject IsNullWithObject:self.user_id]) {
|
if (![ToolsObject IsNullWithObject:self.user_id]) {
|
||||||
[requestDict setObject:self.user_id forKey:@"user_id"];
|
[requestDict setObject:self.user_id forKey:@"user_id"];
|
||||||
@@ -242,11 +257,6 @@
|
|||||||
- (id<JXPagerViewListViewDelegate>)pagerView:(JXPagerView *)pagerView initListAtIndex:(NSInteger)index {
|
- (id<JXPagerViewListViewDelegate>)pagerView:(JXPagerView *)pagerView initListAtIndex:(NSInteger)index {
|
||||||
if (index ==0){
|
if (index ==0){
|
||||||
return self.profileVC;
|
return self.profileVC;
|
||||||
}else if (index ==1){
|
|
||||||
DDMyInformationDynamicViewController *listVC = [[DDMyInformationDynamicViewController alloc] init];
|
|
||||||
listVC.user_id = self.user_id;
|
|
||||||
listVC.model = self.personModel;
|
|
||||||
return listVC;
|
|
||||||
}else{
|
}else{
|
||||||
DDMyInformationGiftWallViewController *list = [[DDMyInformationGiftWallViewController alloc] init];
|
DDMyInformationGiftWallViewController *list = [[DDMyInformationGiftWallViewController alloc] init];
|
||||||
list.user_id = self.user_id;
|
list.user_id = self.user_id;
|
||||||
|
@@ -25,6 +25,18 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
@property (nonatomic, copy) NSString * charm;
|
@property (nonatomic, copy) NSString * charm;
|
||||||
@property (nonatomic, copy) NSString * gift_name;
|
@property (nonatomic, copy) NSString * gift_name;
|
||||||
@property (nonatomic, copy) NSString *random_gift_name;
|
@property (nonatomic, copy) NSString *random_gift_name;
|
||||||
|
///目标用户的uid
|
||||||
|
@property (nonatomic,copy) NSString *uid;
|
||||||
|
///价格
|
||||||
|
@property (nonatomic,assign) NSInteger giftPrice;
|
||||||
|
///id
|
||||||
|
@property (nonatomic,assign) NSInteger giftId;
|
||||||
|
///名称
|
||||||
|
@property (nonatomic,copy) NSString *giftName;
|
||||||
|
///礼物
|
||||||
|
@property (nonatomic,copy) NSString *picUrl;
|
||||||
|
///个数
|
||||||
|
@property (nonatomic,assign) NSInteger reciveCount;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@@ -74,8 +74,8 @@
|
|||||||
}
|
}
|
||||||
- (void)setModel:(DDGiftWallModel *)model{
|
- (void)setModel:(DDGiftWallModel *)model{
|
||||||
_model = model;
|
_model = model;
|
||||||
[self.contentImg ddSetAnimatedImageView:[NSURL URLWithString:model.big_img] placeholderImage:DDPlaceholderGiftImage()];
|
[self.contentImg ddSetAnimatedImageView:[NSURL URLWithString:model.picUrl] placeholderImage:DDPlaceholderGiftImage()];
|
||||||
self.titLabel.text = model.title;
|
self.titLabel.text = model.giftName;
|
||||||
self.numLabel.text = [NSString stringWithFormat:@"x%@",model.gift_num];
|
self.numLabel.text = [NSString stringWithFormat:@"x%ld",model.reciveCount];
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
@@ -9,11 +9,12 @@
|
|||||||
#import "DDMyInfoGotoRoomView.h"
|
#import "DDMyInfoGotoRoomView.h"
|
||||||
#import "DDMyInfoInsertDynamicView.h"
|
#import "DDMyInfoInsertDynamicView.h"
|
||||||
#import "DDMyAgeView.h"
|
#import "DDMyAgeView.h"
|
||||||
|
#import "UserInfoModel.h"
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface DDMyInformationHeaderView : UIView
|
@interface DDMyInformationHeaderView : UIView
|
||||||
@property (nonatomic,strong) UIView *shadowView;
|
@property (nonatomic,strong) UIView *shadowView;
|
||||||
@property (nonatomic,strong) AppUserModel *model;
|
@property (nonatomic,strong) UserInfoModel *model;
|
||||||
@property (nonatomic,assign) float bgImageheight;
|
@property (nonatomic,assign) float bgImageheight;
|
||||||
@property (nonatomic,strong) UIImageView *bgImageView;
|
@property (nonatomic,strong) UIImageView *bgImageView;
|
||||||
@property (nonatomic,strong) UILabel *nameLabel;
|
@property (nonatomic,strong) UILabel *nameLabel;
|
||||||
@@ -30,7 +31,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
@property (nonatomic,strong) DDMyInfoInsertDynamicView *addDynamicView;
|
@property (nonatomic,strong) DDMyInfoInsertDynamicView *addDynamicView;
|
||||||
- (instancetype)initWithFrame:(CGRect)frame ;
|
- (instancetype)initWithFrame:(CGRect)frame ;
|
||||||
@property (nonatomic,copy) void (^didReleaseDynamic)(void);
|
@property (nonatomic,copy) void (^didReleaseDynamic)(void);
|
||||||
-(void)updataPersonInfoWithModel:(AppUserModel *)model;
|
-(void)updataPersonInfoWithModel:(UserInfoModel *)model;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
NS_ASSUME_NONNULL_END
|
||||||
|
@@ -19,25 +19,25 @@
|
|||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
-(void)updataPersonInfoWithModel:(AppUserModel *)model{
|
-(void)updataPersonInfoWithModel:(UserInfoModel *)model{
|
||||||
self.model = model;
|
self.model = model;
|
||||||
|
|
||||||
[self.bgImageView sd_setImageWithURL:[NSURL URLWithString:model.avatar] placeholderImage:DDPlaceholderHeadImage()];
|
[self.bgImageView sd_setImageWithURL:[NSURL URLWithString:model.avatar] placeholderImage:DDPlaceholderHeadImage()];
|
||||||
self.nameLabel.text = model.nickname;
|
self.nameLabel.text = model.nick;
|
||||||
NSString *fansText = [NSString stringWithFormat:@"%ld 粉丝",model.fans_num];
|
NSString *fansText = [NSString stringWithFormat:@"%ld 粉丝",model.fansNum];
|
||||||
self.fansLabel.text = fansText;
|
self.fansLabel.text = fansText;
|
||||||
[self fuwenLabel:self.fansLabel changeString:[NSString stringWithFormat:@"%ld ",model.fans_num] andAllColor:[UIColor whiteColor] andMarkColor:[UIColor whiteColor] andMarkFondSize:16];
|
[self fuwenLabel:self.fansLabel changeString:[NSString stringWithFormat:@"%ld ",model.fansNum] andAllColor:[UIColor whiteColor] andMarkColor:[UIColor whiteColor] andMarkFondSize:16];
|
||||||
NSString *followText = [NSString stringWithFormat:@"%ld 关注",model.attention_num];
|
NSString *followText = [NSString stringWithFormat:@"%ld 关注",model.followNum];
|
||||||
self.followLabel.text = followText;
|
self.followLabel.text = followText;
|
||||||
[self fuwenLabel:self.followLabel changeString:[NSString stringWithFormat:@"%ld ",model.attention_num] andAllColor:[UIColor whiteColor] andMarkColor:[UIColor whiteColor] andMarkFondSize:16];
|
[self fuwenLabel:self.followLabel changeString:[NSString stringWithFormat:@"%ld ",model.followNum] andAllColor:[UIColor whiteColor] andMarkColor:[UIColor whiteColor] andMarkFondSize:16];
|
||||||
// [self.idBtn setTitle:[NSString stringWithFormat:@"ID:%@",model.user_number] forState:UIControlStateNormal];
|
// [self.idBtn setTitle:[NSString stringWithFormat:@"ID:%@",model.user_number] forState:UIControlStateNormal];
|
||||||
// [self.idBtn setImage:[UIImage imageNamed:@"myinfo_21"] forState:UIControlStateNormal];
|
// [self.idBtn setImage:[UIImage imageNamed:@"myinfo_21"] forState:UIControlStateNormal];
|
||||||
// [self.idBtn setImagePositionWithType:SSImagePositionTypeRight spacing:5];
|
// [self.idBtn setImagePositionWithType:SSImagePositionTypeRight spacing:5];
|
||||||
[self.vipImage sd_setImageWithURL:[NSURL URLWithString:model.level_icon]];
|
// [self.vipImage sd_setImageWithURL:[NSURL URLWithString:model.level_icon]];
|
||||||
[self.ageView changeAge:[NSString stringWithFormat:@"%ld",model.age] andSex:model.sex andRadius:8];
|
[self.ageView changeAge:[NSString stringWithFormat:@"%d",model.gender] andSex:model.gender andRadius:8];
|
||||||
// self.contentLabel.text = model.signature;
|
// self.contentLabel.text = model.signature;
|
||||||
AppUserModel * myModel = [ToolsObject getUserModel];
|
AppUserModel * myModel = [ToolsObject getUserModel];
|
||||||
if ([model.user_id isEqualToString:myModel.user_id]) {
|
if ([@(model.uid).stringValue isEqualToString:myModel.user_id]) {
|
||||||
[self addSubview:self.addDynamicView];
|
[self addSubview:self.addDynamicView];
|
||||||
[self.addDynamicView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.addDynamicView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.top.mas_equalTo(self.bottomView.mas_top).mas_offset(20);
|
make.top.mas_equalTo(self.bottomView.mas_top).mas_offset(20);
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
make.height.mas_equalTo(40);
|
make.height.mas_equalTo(40);
|
||||||
}];
|
}];
|
||||||
}else{
|
}else{
|
||||||
if (model.in_live) {
|
if (model.roomUid > 0) {
|
||||||
[self addSubview:self.goLiveView];
|
[self addSubview:self.goLiveView];
|
||||||
[self.goLiveView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.goLiveView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.top.mas_equalTo(self.bottomView.mas_top).mas_offset(20);
|
make.top.mas_equalTo(self.bottomView.mas_top).mas_offset(20);
|
||||||
@@ -136,9 +136,9 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
- (void)idBtnClick{
|
- (void)idBtnClick{
|
||||||
if (![ToolsObject IsNullWithObject:self.model.user_number]) {
|
if (![ToolsObject IsNullWithObject:@(self.model.erbanNo).stringValue]) {
|
||||||
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
|
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
|
||||||
pasteboard.string = self.model.user_number;
|
pasteboard.string = @(self.model.erbanNo).stringValue;
|
||||||
[ToolsObject addPopVieToText:@"已复制ID到剪切板"];
|
[ToolsObject addPopVieToText:@"已复制ID到剪切板"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -209,7 +209,7 @@
|
|||||||
_goLiveView.backgroundColor = [UIColor whiteColor];
|
_goLiveView.backgroundColor = [UIColor whiteColor];
|
||||||
WeakSelf(weakSelf)
|
WeakSelf(weakSelf)
|
||||||
_goLiveView.goLive = ^{
|
_goLiveView.goLive = ^{
|
||||||
[[ToolsObject shareTools] jumpToRoomVC:weakSelf.model.in_live_room_id followUser:[RoomUserInfoModel new]];
|
[[ToolsObject shareTools] jumpToRoomVC:weakSelf.model.roomUid followUser:[RoomUserInfoModel new]];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return _goLiveView;
|
return _goLiveView;
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
#import "DDExchangeVC.h"
|
#import "DDExchangeVC.h"
|
||||||
#import "DDMyRechargeVC.h"
|
#import "DDMyRechargeVC.h"
|
||||||
#import "DDMyExchangeVC.h"
|
#import "DDMyExchangeVC.h"
|
||||||
|
#import "Api.h"
|
||||||
@interface DDMyWalletVC ()
|
@interface DDMyWalletVC ()
|
||||||
@property (weak, nonatomic) IBOutlet UIView *topView;
|
@property (weak, nonatomic) IBOutlet UIView *topView;
|
||||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *topView_Y;
|
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *topView_Y;
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
//获取砖石数量
|
//获取砖石数量
|
||||||
[self getDiamond];
|
[self getDiamond];
|
||||||
//获取个人收益
|
//获取个人收益
|
||||||
[self getIncome];
|
// [self getIncome];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)viewDidLoad {
|
- (void)viewDidLoad {
|
||||||
@@ -39,6 +39,20 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)getDiamond {
|
- (void)getDiamond {
|
||||||
|
@weakify(self);
|
||||||
|
NSString *uid = [[AccountInfoStorage instance]getUid];
|
||||||
|
NSString * ticket = [AccountInfoStorage instance].getTicket;
|
||||||
|
[Api getUserWalletInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||||
|
@strongify(self)
|
||||||
|
if(code == 200){
|
||||||
|
AppUserModel * myModel = [AppUserModel DD_ModelWithDict:data.data];
|
||||||
|
[ToolsObject saveUserModel:myModel];
|
||||||
|
self.diamondLabel.text = [NSString stringWithFormat:@"%@",myModel.diamonds];
|
||||||
|
}
|
||||||
|
|
||||||
|
} uid:uid ticket:ticket];
|
||||||
|
|
||||||
|
return;
|
||||||
[NetworkRequest requestPOST:@"/finance/diamond" parameters:@{} block:^(BaseResponse * _Nonnull response) {
|
[NetworkRequest requestPOST:@"/finance/diamond" parameters:@{} block:^(BaseResponse * _Nonnull response) {
|
||||||
if (response.isSuccess) {
|
if (response.isSuccess) {
|
||||||
|
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="22155" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||||
<device id="retina6_12" orientation="portrait" appearance="light"/>
|
<device id="retina6_12" orientation="portrait" appearance="light"/>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<deployment identifier="iOS"/>
|
<deployment identifier="iOS"/>
|
||||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
|
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22131"/>
|
||||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||||
<capability name="System colors in document resources" minToolsVersion="11.0"/>
|
<capability name="System colors in document resources" minToolsVersion="11.0"/>
|
||||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||||
@@ -145,7 +145,7 @@
|
|||||||
<color key="textColor" red="0.18823531269999999" green="0.18823531269999999" blue="0.18823531269999999" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
|
<color key="textColor" red="0.18823531269999999" green="0.18823531269999999" blue="0.18823531269999999" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
|
||||||
<nil key="highlightedColor"/>
|
<nil key="highlightedColor"/>
|
||||||
</label>
|
</label>
|
||||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Dsx-3U-lb0">
|
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Dsx-3U-lb0">
|
||||||
<rect key="frame" x="269" y="65" width="76" height="32"/>
|
<rect key="frame" x="269" y="65" width="76" height="32"/>
|
||||||
<color key="backgroundColor" red="0.93758797650000003" green="0.88859778639999998" blue="0.9921690822" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
|
<color key="backgroundColor" red="0.93758797650000003" green="0.88859778639999998" blue="0.9921690822" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
|
@@ -16,6 +16,13 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
@property (nonatomic, copy) NSString *endunit;//到账单位
|
@property (nonatomic, copy) NSString *endunit;//到账单位
|
||||||
@property (nonatomic, copy) NSString *pid;//商品id
|
@property (nonatomic, copy) NSString *pid;//商品id
|
||||||
@property (nonatomic, assign) BOOL isSelect;//是否选中
|
@property (nonatomic, assign) BOOL isSelect;//是否选中
|
||||||
|
|
||||||
|
@property(nonatomic, strong) NSString *chargeProdId;
|
||||||
|
@property(nonatomic, strong) NSString *prodName;
|
||||||
|
@property (copy, nonatomic) NSString *prodDesc;
|
||||||
|
@property(nonatomic, strong) NSNumber *money;
|
||||||
|
@property(nonatomic, strong) NSNumber *giftGoldNum;
|
||||||
|
@property(nonatomic, strong) NSString *channel;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
NS_ASSUME_NONNULL_END
|
||||||
|
@@ -18,4 +18,5 @@
|
|||||||
#import "DDUtility.h"
|
#import "DDUtility.h"
|
||||||
#import "DDMacroHeader.h"
|
#import "DDMacroHeader.h"
|
||||||
#import "AccountInfoStorage.h"
|
#import "AccountInfoStorage.h"
|
||||||
|
#import "ApiHost.h"
|
||||||
#endif /* PrefixHeader_pch */
|
#endif /* PrefixHeader_pch */
|
||||||
|
@@ -199,12 +199,22 @@
|
|||||||
} else if ([type isEqualToString:@"我要开播"]) {
|
} else if ([type isEqualToString:@"我要开播"]) {
|
||||||
[self broadcastClick];
|
[self broadcastClick];
|
||||||
} else if ([type isEqualToString:@"我的等级"]) {
|
} else if ([type isEqualToString:@"我的等级"]) {
|
||||||
DDMyLevelViewController *vc = [[DDMyLevelViewController alloc]init];
|
DDWebViewController * webVC = [DDWebViewController webControlerWithUrlStr:[NSString stringWithFormat:@"%@/yinmeng/modules/level/index.html",API_HOST_H5_URL] isShowNavBar:YES navTitle:@"我的等级"];
|
||||||
[self.navigationController pushViewController:vc animated:YES];
|
webVC.view.backgroundColor = UIColor.whiteColor;
|
||||||
|
[[ToolsObject getCurrentViewController].navigationController pushViewController:webVC animated:NO];
|
||||||
|
|
||||||
} else if ([type isEqualToString:@"官方客服"]) {
|
} else if ([type isEqualToString:@"官方客服"]) {
|
||||||
[self serviceClick];
|
DDCustomAlertView *alertView = [[DDCustomAlertView alloc]init:@[@"确认"] title:@"请添加微信客服询问:DingDang2022" content:@"" alertType:0];
|
||||||
|
alertView.alertViewClickBlock = ^(NSInteger index, NSString * _Nonnull title) {
|
||||||
|
|
||||||
|
};
|
||||||
|
[alertView showAlertView];
|
||||||
} else if ([type isEqualToString:@"帮助与反馈"]) {
|
} else if ([type isEqualToString:@"帮助与反馈"]) {
|
||||||
[self helpClick];
|
DDWebViewController * webVC = [DDWebViewController webControlerWithUrlStr:[NSString stringWithFormat:@"%@/yinmeng/modules/rule/guide.html",API_HOST_H5_URL] isShowNavBar:YES navTitle:@"帮助与反馈"];
|
||||||
|
webVC.view.backgroundColor = UIColor.whiteColor;
|
||||||
|
[[ToolsObject getCurrentViewController].navigationController pushViewController:webVC animated:NO];
|
||||||
|
|
||||||
|
// [self helpClick];
|
||||||
}else if ([type isEqualToString:@"我的邀请码"]) {
|
}else if ([type isEqualToString:@"我的邀请码"]) {
|
||||||
AppUserModel * model = [ToolsObject getUserModel];
|
AppUserModel * model = [ToolsObject getUserModel];
|
||||||
if ([ToolsObject IsNullWithObject:model.invite_code]) {
|
if ([ToolsObject IsNullWithObject:model.invite_code]) {
|
||||||
@@ -262,6 +272,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)authorClick{
|
- (void)authorClick{
|
||||||
|
|
||||||
|
|
||||||
|
DDWebViewController * webVC = [DDWebViewController webControlerWithUrlStr:[NSString stringWithFormat:@"%@/yinmeng/modules/identity/new.html",API_HOST_H5_URL] isShowNavBar:YES navTitle:@"实名认证"];
|
||||||
|
webVC.view.backgroundColor = UIColor.whiteColor;
|
||||||
|
[[ToolsObject getCurrentViewController].navigationController pushViewController:webVC animated:NO];
|
||||||
|
|
||||||
|
return;
|
||||||
WeakSelf(weakSelf)
|
WeakSelf(weakSelf)
|
||||||
[NetworkRequest requestPOST:@"/user/check/realname" parameters:@{}.mutableCopy block:^(BaseResponse * _Nonnull response) {
|
[NetworkRequest requestPOST:@"/user/check/realname" parameters:@{}.mutableCopy block:^(BaseResponse * _Nonnull response) {
|
||||||
if ([ToolsObject IsNullWithObject:response.data]) {
|
if ([ToolsObject IsNullWithObject:response.data]) {
|
||||||
|
@@ -10,9 +10,12 @@
|
|||||||
#import "IAPManager.h"
|
#import "IAPManager.h"
|
||||||
#import "DDSetUserView.h"
|
#import "DDSetUserView.h"
|
||||||
#import "DDMingXiPVC.h"
|
#import "DDMingXiPVC.h"
|
||||||
|
#import "DingDangApp-Swift.h"
|
||||||
|
#import "Api+DDMineApi.h"
|
||||||
|
#import "Api.h"
|
||||||
@interface DDMyRechargeVC () <UITableViewDelegate,UITableViewDataSource>
|
@interface DDMyRechargeVC () <UITableViewDelegate,UITableViewDataSource>
|
||||||
|
///订单编号
|
||||||
|
@property (nonatomic,copy) NSString *dd_getOrderId;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation DDMyRechargeVC
|
@implementation DDMyRechargeVC
|
||||||
@@ -28,13 +31,27 @@
|
|||||||
|
|
||||||
-(void)initRequest
|
-(void)initRequest
|
||||||
{
|
{
|
||||||
|
@weakify(self)
|
||||||
|
[Api dd_GetRechargeList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||||
|
if(code == 200){
|
||||||
|
[self.dataArr removeAllObjects];
|
||||||
|
NSArray *list = [DDExchangeModel DD_ModelsWithArray:data.data];
|
||||||
|
self.dataArr = [[NSMutableArray alloc]initWithArray:list];
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
[self.listTableView reloadData];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} channelType:@"8"];
|
||||||
|
|
||||||
|
return;
|
||||||
|
|
||||||
NSString *postStr = @"";
|
NSString *postStr = @"";
|
||||||
if (self.walletType == 1) {
|
if (self.walletType == 1) {
|
||||||
postStr = @"/finance/recharge/list";
|
postStr = @"/finance/recharge/list";
|
||||||
}else{
|
}else{
|
||||||
postStr = @"/finance/exchange/list";
|
postStr = @"/finance/exchange/list";
|
||||||
}
|
}
|
||||||
@weakify(self)
|
|
||||||
NSMutableDictionary *params = [[NSMutableDictionary alloc] init];
|
NSMutableDictionary *params = [[NSMutableDictionary alloc] init];
|
||||||
[NetworkRequest requestPOST:postStr parameters:params block:^(BaseResponse * _Nonnull response) {
|
[NetworkRequest requestPOST:postStr parameters:params block:^(BaseResponse * _Nonnull response) {
|
||||||
@strongify(self)
|
@strongify(self)
|
||||||
@@ -55,8 +72,21 @@
|
|||||||
}
|
}
|
||||||
-(void)getDiamond
|
-(void)getDiamond
|
||||||
{
|
{
|
||||||
//钻石
|
|
||||||
@weakify(self);
|
@weakify(self);
|
||||||
|
NSString *uid = [[AccountInfoStorage instance]getUid];
|
||||||
|
NSString * ticket = [AccountInfoStorage instance].getTicket;
|
||||||
|
[Api getUserWalletInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||||
|
@strongify(self)
|
||||||
|
if(code == 200){
|
||||||
|
AppUserModel * myModel = [AppUserModel DD_ModelWithDict:data.data];
|
||||||
|
[ToolsObject saveUserModel:myModel];
|
||||||
|
self.headerView.viewType = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
} uid:uid ticket:ticket];
|
||||||
|
return;
|
||||||
|
//钻石
|
||||||
|
|
||||||
[NetworkRequest requestPOST:@"/finance/diamond" parameters:@{} block:^(BaseResponse * _Nonnull response) {
|
[NetworkRequest requestPOST:@"/finance/diamond" parameters:@{} block:^(BaseResponse * _Nonnull response) {
|
||||||
@strongify(self)
|
@strongify(self)
|
||||||
if (response.isSuccess) {
|
if (response.isSuccess) {
|
||||||
@@ -121,13 +151,13 @@
|
|||||||
}
|
}
|
||||||
-(void)initNav
|
-(void)initNav
|
||||||
{
|
{
|
||||||
[self.customNavBar addSubview:self.rightBtn];
|
// [self.customNavBar addSubview:self.rightBtn];
|
||||||
[self.rightBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
// [self.rightBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.right.mas_equalTo(-16);
|
// make.right.mas_equalTo(-16);
|
||||||
make.centerY.equalTo(self.customNavBar.leftButton);
|
// make.centerY.equalTo(self.customNavBar.leftButton);
|
||||||
make.width.mas_equalTo(36);
|
// make.width.mas_equalTo(36);
|
||||||
make.height.mas_equalTo(32);
|
// make.height.mas_equalTo(32);
|
||||||
}];
|
// }];
|
||||||
switch (self.walletType) {
|
switch (self.walletType) {
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
@@ -365,11 +395,124 @@
|
|||||||
}
|
}
|
||||||
return _submitBtn;
|
return _submitBtn;
|
||||||
}
|
}
|
||||||
|
-(void)dd_pay:(NSString *)orderId chargeProdId:(NSString *)chargeProdId uuid:(nonnull NSString *)uuid{
|
||||||
|
if (orderId.length > 0) {
|
||||||
|
|
||||||
|
self.dd_getOrderId = orderId;
|
||||||
|
if (@available(iOS 15.0, *)) {
|
||||||
|
DDApplePayManager *iap = [DDApplePayManager applePayShared];
|
||||||
|
[iap DDApplePayDemandCommodityThingWithProductId:chargeProdId uuid:uuid completionHandler:^(NSError * _Nullable error) {
|
||||||
|
|
||||||
|
}];
|
||||||
|
@kWeakify(self);
|
||||||
|
iap.dd_ApplePayBlock = ^(enum DDApplePayResult state, NSDictionary<NSString *,id> * _Nullable result) {
|
||||||
|
@kStrongify(self);
|
||||||
|
|
||||||
|
[self setApplePayStatus:state];
|
||||||
|
switch (state) {
|
||||||
|
case DDApplePayResultDDApplePayVerifiedServer:
|
||||||
|
{
|
||||||
|
NSString *transactionId = result[@"transactionId"];
|
||||||
|
|
||||||
|
[self dd_paySuccess:transactionId];
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
[DDHUDManager dd_hideWait:kWindow];
|
||||||
|
[DDHUDManager dd_showErrorWithText:@"充值失败。当前仅支持运行iOS15及以上系统的手机进行充值,请升级系统版本后重试。"];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}else{
|
||||||
|
|
||||||
|
[DDHUDManager dd_hideWait:kWindow];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
- (void)dd_paySuccess:(NSString *)tId{
|
||||||
|
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||||
|
NSString * ticket = [AccountInfoStorage instance].getTicket;
|
||||||
|
[Api dd_CheckReceipt:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||||
|
[DDHUDManager dd_hideWait:kWindow];
|
||||||
|
if(code == 200){
|
||||||
|
|
||||||
|
if (@available(iOS 15.0, *)) {
|
||||||
|
DDApplePayManager *iap = [DDApplePayManager applePayShared];
|
||||||
|
[iap DDApplePay_verifyBusinessAccomplishWithTransaction:[NSString stringWithFormat:@"%@",tId] completionHandler:^{
|
||||||
|
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
|
self.dd_getOrderId = nil;
|
||||||
|
///刷新一下用户的信息
|
||||||
|
[DDHUDManager dd_showWaitViewInView:kWindow];
|
||||||
|
//5秒之后如果没有收到开通成功的云信消息,则请求一次用户信息
|
||||||
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||||
|
///刷新一下用户的信息
|
||||||
|
[Api getUserWalletInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||||
|
[DDHUDManager dd_hideWait:kWindow];
|
||||||
|
if(code == 200){
|
||||||
|
AppUserModel * myModel = [AppUserModel DD_ModelWithDict:data.data];
|
||||||
|
[ToolsObject saveUserModel:myModel];
|
||||||
|
self.headerView.viewType = 1;
|
||||||
|
}
|
||||||
|
} uid:uid ticket:ticket];
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} chooseEnv:@"true" chargeRecordId:self.dd_getOrderId transcationId:tId uid:uid ticket:ticket];
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
///当前充值的状态
|
||||||
|
- (void)setApplePayStatus:(DDApplePayResult)status {
|
||||||
|
|
||||||
|
|
||||||
|
if (status == DDApplePayResultDDApplePayPay || status == DDApplePayResultDDApplePayStart || status == DDApplePayResultDDApplePayVerifiedServer) {
|
||||||
|
|
||||||
|
}else if (status == DDApplePayResultDDApplePayUnowned) {
|
||||||
|
[DDHUDManager dd_hideWait:kWindow];
|
||||||
|
[DDHUDManager dd_showErrorWithText:@"出现未知错误,请重新尝试"];
|
||||||
|
}else{
|
||||||
|
[DDHUDManager dd_hideWait:kWindow];
|
||||||
|
[DDHUDManager dd_showErrorWithText:@"购买失败"];
|
||||||
|
}
|
||||||
|
}
|
||||||
-(void)topUpAc
|
-(void)topUpAc
|
||||||
{
|
{
|
||||||
|
[DDHUDManager dd_showWaitView];
|
||||||
DDMyRechargeCell *cell = (DDMyRechargeCell *)[self.listTableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:1]];
|
DDMyRechargeCell *cell = (DDMyRechargeCell *)[self.listTableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:1]];
|
||||||
NSLog(@"%@",cell.oldBtn.model);
|
NSLog(@"%@",cell.oldBtn.model);
|
||||||
@weakify(self);
|
@weakify(self);
|
||||||
|
NSString *uid = [[AccountInfoStorage instance]getUid];
|
||||||
|
NSString * ticket = [AccountInfoStorage instance].getTicket;
|
||||||
|
NSString * deviceInfo = [DDUtility DD_DeviceID];
|
||||||
|
NSString * clientIp= [DDUtility DD_IPAddress];
|
||||||
|
[Api dd_RequestIAPRecharge:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||||
|
if(code == 200){
|
||||||
|
NSString *orderId = (NSString *)data.data[@"recordId"];
|
||||||
|
NSString *dd_uuid = (NSString *)data.data[@"appAccountToken"];
|
||||||
|
[self dd_pay:orderId chargeProdId:cell.oldBtn.model.chargeProdId uuid:dd_uuid];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
[DDHUDManager dd_HideWaitView];
|
||||||
|
[DDHUDManager dd_showErrorWithText:@"购买失败"];
|
||||||
|
} chargeProdId:cell.oldBtn.model.chargeProdId uid:uid ticket:ticket deviceInfo:deviceInfo clientIp:clientIp];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return;
|
||||||
[[IAPManager shareIAPTool] startIAPWithProductID:cell.oldBtn.model.pid ProdutPrice:cell.oldBtn.model.base block:^(InternalPurchaseType type, NSData * _Nonnull data) {
|
[[IAPManager shareIAPTool] startIAPWithProductID:cell.oldBtn.model.pid ProdutPrice:cell.oldBtn.model.base block:^(InternalPurchaseType type, NSData * _Nonnull data) {
|
||||||
if (type == InternalPurchase_VerScuess) {
|
if (type == InternalPurchase_VerScuess) {
|
||||||
[ToolsObject addPopVieToText:@"购买成功"];
|
[ToolsObject addPopVieToText:@"购买成功"];
|
||||||
|
@@ -158,8 +158,8 @@
|
|||||||
if (type == 1) {
|
if (type == 1) {
|
||||||
self.iconImage.image = [UIImage imageNamed:@"mine_bg_icon_49"];
|
self.iconImage.image = [UIImage imageNamed:@"mine_bg_icon_49"];
|
||||||
self.iconImage1.hidden = YES;
|
self.iconImage1.hidden = YES;
|
||||||
self.priceLabel.text = [NSString stringWithFormat:@"¥%@",model.base];
|
self.priceLabel.text = [NSString stringWithFormat:@"¥%@",model.money];
|
||||||
self.numLabel.text = model.end;
|
self.numLabel.text = model.prodName;
|
||||||
self.textF.hidden = YES;
|
self.textF.hidden = YES;
|
||||||
self.bgView.hidden = YES;
|
self.bgView.hidden = YES;
|
||||||
}else if (type == 2 || type == 3) {
|
}else if (type == 2 || type == 3) {
|
||||||
@@ -465,14 +465,14 @@
|
|||||||
text.yy_alignment = NSTextAlignmentLeft;
|
text.yy_alignment = NSTextAlignmentLeft;
|
||||||
text.yy_color = DDHEXColor(0x999999);
|
text.yy_color = DDHEXColor(0x999999);
|
||||||
[text yy_setTextHighlightRange:[text.string rangeOfString:@"充值协议,"] color:DDHEXColor(0x0690FE) backgroundColor:[UIColor whiteColor] userInfo:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
|
[text yy_setTextHighlightRange:[text.string rangeOfString:@"充值协议,"] color:DDHEXColor(0x0690FE) backgroundColor:[UIColor whiteColor] userInfo:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
|
||||||
DDWebViewController * webVC = [DDWebViewController webControlerWithUrlStr:[NSString stringWithFormat:@"%@#/publicpage?position=1002",KWebURL] isShowNavBar:NO navTitle:@"充值协议"];
|
DDWebViewController * webVC = [DDWebViewController webControlerWithUrlStr:[NSString stringWithFormat:@"%@/yinmeng/modules/rule/rechargeAgreement.html",API_HOST_H5_URL] isShowNavBar:NO navTitle:@"充值协议"];
|
||||||
webVC.view.backgroundColor = UIColor.whiteColor;
|
webVC.view.backgroundColor = UIColor.whiteColor;
|
||||||
[[ToolsObject getCurrentViewController].navigationController pushViewController:webVC animated:NO];
|
[[ToolsObject getCurrentViewController].navigationController pushViewController:webVC animated:NO];
|
||||||
} longPressAction:nil];
|
} longPressAction:nil];
|
||||||
|
|
||||||
WeakSelf(ws)
|
WeakSelf(ws)
|
||||||
[text yy_setTextHighlightRange:[text.string rangeOfString:@"客服"] color:DDHEXColor(0x0690FE) backgroundColor:[UIColor whiteColor] userInfo:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
|
[text yy_setTextHighlightRange:[text.string rangeOfString:@"客服"] color:DDHEXColor(0x0690FE) backgroundColor:[UIColor whiteColor] userInfo:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
|
||||||
[ws serviceClick];
|
// [ws serviceClick];
|
||||||
} longPressAction:nil];
|
} longPressAction:nil];
|
||||||
_xieyiLabel.attributedText = text;
|
_xieyiLabel.attributedText = text;
|
||||||
}
|
}
|
||||||
|
@@ -30,7 +30,7 @@
|
|||||||
[self.titLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
|
[self.titLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.left.top.equalTo(self).offset(15);
|
make.left.top.equalTo(self).offset(15);
|
||||||
}];
|
}];
|
||||||
self.valueLabel.text = [NSString stringWithFormat:@"%ld",[ToolsObject getUserModel].diamond];
|
self.valueLabel.text = [NSString stringWithFormat:@"%@",[ToolsObject getUserModel].diamonds];
|
||||||
self.valueLabel.textColor = DDHEXColor(0xFF6173);
|
self.valueLabel.textColor = DDHEXColor(0xFF6173);
|
||||||
self.valueLabel.textAlignment = NSTextAlignmentLeft;
|
self.valueLabel.textAlignment = NSTextAlignmentLeft;
|
||||||
[self.valueLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
|
[self.valueLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
@@ -87,14 +87,12 @@
|
|||||||
}else{
|
}else{
|
||||||
self.discountImgV.hidden = YES;
|
self.discountImgV.hidden = YES;
|
||||||
}
|
}
|
||||||
if (model.is_permanent == 1) {
|
|
||||||
self.timeLabel.text = @"永久";
|
self.timeLabel.text = [NSString stringWithFormat:@"%ld天",model.dressDay];
|
||||||
}else{
|
|
||||||
self.timeLabel.text = [NSString stringWithFormat:@"%ld天",model.use_duration];
|
|
||||||
}
|
|
||||||
self.nameLabel.text = model.name;
|
self.nameLabel.text = model.name;
|
||||||
[_priceBtn setTitle:model.sell_price forState:(UIControlStateNormal)];
|
[_priceBtn setTitle:@(model.dressPrice).stringValue forState:(UIControlStateNormal)];
|
||||||
[self.iconImgV ddSetAnimatedImageView:[NSURL URLWithString:model.show_img]];
|
[self.iconImgV ddSetAnimatedImageView:[NSURL URLWithString:model.pic]];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (UIImageView *)discountImgV {
|
- (UIImageView *)discountImgV {
|
||||||
|
@@ -35,8 +35,8 @@
|
|||||||
- (void)updataModelWithData:(id)data {
|
- (void)updataModelWithData:(id)data {
|
||||||
if ([data isKindOfClass:DDCategoryModel.class]) {
|
if ([data isKindOfClass:DDCategoryModel.class]) {
|
||||||
DDCategoryModel *model = data;
|
DDCategoryModel *model = data;
|
||||||
[self.iconImgV sd_setImageWithURL:[NSURL URLWithString:model.class_img]];
|
[self.iconImgV sd_setImageWithURL:[NSURL URLWithString:model.pic]];
|
||||||
self.nameL.text = model.type_name;
|
self.nameL.text = model.name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -15,6 +15,7 @@
|
|||||||
#import "DDWebViewController.h"
|
#import "DDWebViewController.h"
|
||||||
#import "DDShoppingListVC.h"
|
#import "DDShoppingListVC.h"
|
||||||
#import "DDDecoratePVC.h"
|
#import "DDDecoratePVC.h"
|
||||||
|
#import "Api+DDMineApi.h"
|
||||||
|
|
||||||
@interface DDShoppingVC () <UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout>
|
@interface DDShoppingVC () <UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout>
|
||||||
@property (nonatomic, strong) NSMutableArray *listArr;
|
@property (nonatomic, strong) NSMutableArray *listArr;
|
||||||
@@ -46,7 +47,19 @@
|
|||||||
//分类
|
//分类
|
||||||
- (void)initRequest {
|
- (void)initRequest {
|
||||||
|
|
||||||
WeakSelf(ws)
|
WeakSelf(ws);
|
||||||
|
[Api requestDressUpShopList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||||
|
|
||||||
|
if(code == 200){
|
||||||
|
if (ws.listArr.count>0) {
|
||||||
|
[ws.listArr removeAllObjects];
|
||||||
|
}
|
||||||
|
NSArray *list = [DDCategoryModel DD_ModelsWithArray:data.data];
|
||||||
|
[ws.listArr addObjectsFromArray:list];
|
||||||
|
ws.headerView.dataArray = ws.listArr;
|
||||||
|
}
|
||||||
|
} dressType:@"1"];
|
||||||
|
return;
|
||||||
NSMutableDictionary *params = [[NSMutableDictionary alloc] init];
|
NSMutableDictionary *params = [[NSMutableDictionary alloc] init];
|
||||||
[NetworkRequest requestPOST:@"/goods/getGoodsClass" parameters:params block:^(BaseResponse * _Nonnull response) {
|
[NetworkRequest requestPOST:@"/goods/getGoodsClass" parameters:params block:^(BaseResponse * _Nonnull response) {
|
||||||
if (response.isSuccess) {
|
if (response.isSuccess) {
|
||||||
@@ -66,10 +79,25 @@
|
|||||||
|
|
||||||
- (void)initHotMall {
|
- (void)initHotMall {
|
||||||
|
|
||||||
|
WeakSelf(ws);
|
||||||
|
[Api requestDressUpShopList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||||
|
[ws.hotCollectionView.mj_header endRefreshing];
|
||||||
|
[ws.hotCollectionView.mj_footer endRefreshing];
|
||||||
|
if(code == 200){
|
||||||
|
if (ws.pageNum == 1) {
|
||||||
|
[ws.dataArr removeAllObjects];
|
||||||
|
}
|
||||||
|
NSArray *list = [DDShoppingModel DD_ModelsWithArray:data.data];
|
||||||
|
[ws.dataArr addObjectsFromArray:list];
|
||||||
|
[ws.hotCollectionView reloadData];
|
||||||
|
}
|
||||||
|
} dressType:@"0"];
|
||||||
|
|
||||||
|
return;
|
||||||
NSMutableDictionary *dic = [NSMutableDictionary dictionary];
|
NSMutableDictionary *dic = [NSMutableDictionary dictionary];
|
||||||
[dic setObject:@(20) forKey:@"current_page"];
|
[dic setObject:@(20) forKey:@"current_page"];
|
||||||
[dic setObject:@(self.pageNum) forKey:@"page_number"];
|
[dic setObject:@(self.pageNum) forKey:@"page_number"];
|
||||||
WeakSelf(ws);
|
|
||||||
[NetworkRequest requestPOST:@"/goods/getHotGoods" parameters:dic block:^(BaseResponse * _Nonnull response) {
|
[NetworkRequest requestPOST:@"/goods/getHotGoods" parameters:dic block:^(BaseResponse * _Nonnull response) {
|
||||||
[ws.hotCollectionView.mj_header endRefreshing];
|
[ws.hotCollectionView.mj_header endRefreshing];
|
||||||
[ws.hotCollectionView.mj_footer endRefreshing];
|
[ws.hotCollectionView.mj_footer endRefreshing];
|
||||||
@@ -110,7 +138,8 @@
|
|||||||
make.centerY.equalTo(self.customNavBar.leftButton);
|
make.centerY.equalTo(self.customNavBar.leftButton);
|
||||||
make.width.height.mas_equalTo(24);
|
make.width.height.mas_equalTo(24);
|
||||||
}];
|
}];
|
||||||
|
self.moreBtn.hidden = YES;
|
||||||
|
self.knapsackPageBtn.hidden = YES;
|
||||||
[self.customNavBar addSubview:self.knapsackPageBtn];
|
[self.customNavBar addSubview:self.knapsackPageBtn];
|
||||||
[self.knapsackPageBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.knapsackPageBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.right.equalTo(self.moreBtn.mas_left).offset(-10);
|
make.right.equalTo(self.moreBtn.mas_left).offset(-10);
|
||||||
@@ -150,6 +179,7 @@
|
|||||||
|
|
||||||
|
|
||||||
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
|
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||||
|
return;
|
||||||
if (indexPath.item < self.dataArr.count) {
|
if (indexPath.item < self.dataArr.count) {
|
||||||
DDShoppingModel *goodModel = self.dataArr[indexPath.row];
|
DDShoppingModel *goodModel = self.dataArr[indexPath.row];
|
||||||
NSMutableDictionary *dic = [NSMutableDictionary dictionary];
|
NSMutableDictionary *dic = [NSMutableDictionary dictionary];
|
||||||
@@ -302,10 +332,10 @@
|
|||||||
WeakSelf(ws)
|
WeakSelf(ws)
|
||||||
_headerView.didSelectBlockBlock = ^(id _Nonnull model) {
|
_headerView.didSelectBlockBlock = ^(id _Nonnull model) {
|
||||||
if ([model isKindOfClass:DDCategoryModel.class]) {
|
if ([model isKindOfClass:DDCategoryModel.class]) {
|
||||||
DDCategoryModel *cateModel = model;
|
// DDCategoryModel *cateModel = model;
|
||||||
DDShoppingListVC *vc = [[DDShoppingListVC alloc]init];
|
// DDShoppingListVC *vc = [[DDShoppingListVC alloc]init];
|
||||||
vc.cateModel = cateModel;
|
// vc.cateModel = cateModel;
|
||||||
[ws.navigationController pushViewController:vc animated:YES];
|
// [ws.navigationController pushViewController:vc animated:YES];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -18,7 +18,21 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
@property (nonatomic, copy) NSString *name;
|
@property (nonatomic, copy) NSString *name;
|
||||||
@property (nonatomic, copy) NSString *sell_price;
|
@property (nonatomic, copy) NSString *sell_price;
|
||||||
@property (nonatomic, assign) NSInteger use_duration;
|
@property (nonatomic, assign) NSInteger use_duration;
|
||||||
|
///座驾图片
|
||||||
|
@property (nonatomic, strong) NSString *pic;
|
||||||
|
///id
|
||||||
|
@property (nonatomic, strong) NSString *dressUpId;
|
||||||
|
///
|
||||||
|
@property (nonatomic, copy) NSString *dressId;
|
||||||
|
|
||||||
|
///天数
|
||||||
|
@property (nonatomic, assign) NSInteger dressDay;
|
||||||
|
///价格
|
||||||
|
@property (nonatomic, assign) NSInteger dressPrice;
|
||||||
|
///装扮类型
|
||||||
|
@property (nonatomic, assign) NSInteger dressType;
|
||||||
|
///是否限时 0:限时,1:不限时
|
||||||
|
@property (nonatomic, assign) NSInteger dressLimitStatus;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface DDDetailsModelListModel : NSObject
|
@interface DDDetailsModelListModel : NSObject
|
||||||
@@ -52,6 +66,21 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
@property (nonatomic, copy) NSString *class_img;
|
@property (nonatomic, copy) NSString *class_img;
|
||||||
///名字
|
///名字
|
||||||
@property (nonatomic,copy) NSString *name;
|
@property (nonatomic,copy) NSString *name;
|
||||||
|
///座驾图片
|
||||||
|
@property (nonatomic, strong) NSString *pic;
|
||||||
|
///id
|
||||||
|
@property (nonatomic, strong) NSString *dressUpId;
|
||||||
|
///
|
||||||
|
@property (nonatomic, copy) NSString *dressId;
|
||||||
|
|
||||||
|
///天数
|
||||||
|
@property (nonatomic, assign) NSInteger dressDay;
|
||||||
|
///价格
|
||||||
|
@property (nonatomic, assign) NSInteger dressPrice;
|
||||||
|
///装扮类型
|
||||||
|
@property (nonatomic, assign) NSInteger dressType;
|
||||||
|
///是否限时 0:限时,1:不限时
|
||||||
|
@property (nonatomic, assign) NSInteger dressLimitStatus;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
NS_ASSUME_NONNULL_END
|
||||||
|
@@ -0,0 +1,261 @@
|
|||||||
|
//
|
||||||
|
// DDApplePayManager.swift
|
||||||
|
// DingDangApp
|
||||||
|
//
|
||||||
|
// Created by duoban on 2023/12/13.
|
||||||
|
//
|
||||||
|
import UIKit
|
||||||
|
import StoreKit
|
||||||
|
|
||||||
|
@available(iOS 15.0, *)
|
||||||
|
typealias DDApplePayTransaction = StoreKit.Transaction
|
||||||
|
@available(iOS 15.0, *)
|
||||||
|
typealias DDApplePayRenewalInfo = StoreKit.Product.SubscriptionInfo.RenewalInfo
|
||||||
|
@available(iOS 15.0, *)
|
||||||
|
typealias DDApplePayRenewalState = StoreKit.Product.SubscriptionInfo.RenewalState
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
enum DDApplePayStoreError: Error {
|
||||||
|
|
||||||
|
|
||||||
|
// 错误回调枚举
|
||||||
|
case DDApplePayFailedVerification
|
||||||
|
case DDApplePayNoProduct
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@objc public enum DDApplePayResult: Int64 { // 支付状态
|
||||||
|
case DDApplePayStart // 开始
|
||||||
|
case DDApplePayPay // 进行苹果支付
|
||||||
|
case DDApplePayVerifiedServer // 服务器校验
|
||||||
|
case DDApplePayUserCancelled // 用户取消
|
||||||
|
case DDApplePayPending // 等待(家庭用户才有的状态)
|
||||||
|
case DDApplePayUnowned
|
||||||
|
case DDApplePayNoProduct //没有商品
|
||||||
|
case DDApplePayFailedVerification //验证失败
|
||||||
|
}
|
||||||
|
|
||||||
|
@available(iOS 15.0, *)
|
||||||
|
public class DDApplePayManager: NSObject {
|
||||||
|
public typealias DDApplePayBlock = (_ state :DDApplePayResult,_ param:Dictionary<String,Any>?) ->()
|
||||||
|
@objc public var dd_ApplePayBlock:DDApplePayBlock! // 状态回调
|
||||||
|
|
||||||
|
var DDApplePayPdateListenerTask: Task<Void, Error>? = nil // 支付事件监听
|
||||||
|
|
||||||
|
var DDApplePayRransactionMap :[String:Transaction] // 用于完成Id的缓存map
|
||||||
|
|
||||||
|
var MDDApplePayName: String = "DDApplePay_iosStore" // 单例的写法
|
||||||
|
|
||||||
|
@objc public static let applePayShared = {
|
||||||
|
let instance = DDApplePayManager()
|
||||||
|
return instance
|
||||||
|
}()
|
||||||
|
|
||||||
|
private override init() { // 单例需要保证private的私有性质
|
||||||
|
|
||||||
|
DDApplePayRransactionMap = [:] // 初始化
|
||||||
|
super.init()
|
||||||
|
Task {
|
||||||
|
DDApplePayPdateListenerTask = DDApplePay_listenForTransactions()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 退订
|
||||||
|
@objc public func DDApplePayRefunRequest(view: UIView,transactionId:UInt64) async{
|
||||||
|
do {
|
||||||
|
if let scene = await view.window?.windowScene{
|
||||||
|
try await Transaction.beginRefundRequest(for:transactionId , in: scene)
|
||||||
|
}
|
||||||
|
|
||||||
|
}catch{
|
||||||
|
print("iap error")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 购买某个产品
|
||||||
|
@objc public func DDApplePayDemandCommodityThing(productId:String, uuid: String) async throws {
|
||||||
|
if(dd_ApplePayBlock != nil ){
|
||||||
|
dd_ApplePayBlock(DDApplePayResult.DDApplePayStart,nil)
|
||||||
|
}
|
||||||
|
do {
|
||||||
|
let list:[String] = [productId]
|
||||||
|
let storeProducts = try await Product.products(for: Set.init(list))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if storeProducts.count > 0 {
|
||||||
|
try await DDApplePayPurchase(storeProducts[0],uuid)
|
||||||
|
}else {
|
||||||
|
print("iap: no found product")
|
||||||
|
if(dd_ApplePayBlock != nil ){
|
||||||
|
dd_ApplePayBlock(DDApplePayResult.DDApplePayNoProduct,nil)
|
||||||
|
}
|
||||||
|
throw DDApplePayStoreError.DDApplePayNoProduct // 没有该产品
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
print("Failed product request from the App Store server: \(error)")
|
||||||
|
if(dd_ApplePayBlock != nil ){
|
||||||
|
dd_ApplePayBlock(DDApplePayResult.DDApplePayNoProduct,nil)
|
||||||
|
}
|
||||||
|
throw DDApplePayStoreError.DDApplePayNoProduct // 没有该产品
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 购买
|
||||||
|
private func DDApplePayPurchase(_ product: Product, _ uuid: String) async throws -> Transaction? {
|
||||||
|
if(dd_ApplePayBlock != nil ){
|
||||||
|
dd_ApplePayBlock(DDApplePayResult.DDApplePayPay,nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
guard let curUUID = UUID.init(uuidString: uuid) else{
|
||||||
|
|
||||||
|
if(dd_ApplePayBlock != nil ){
|
||||||
|
dd_ApplePayBlock(DDApplePayResult.DDApplePayFailedVerification,nil)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
let getUUID = Product.PurchaseOption.appAccountToken(curUUID)
|
||||||
|
let result = try await product.purchase(options: [getUUID])
|
||||||
|
|
||||||
|
switch result {
|
||||||
|
case .success(let verification): // 用户购买完成
|
||||||
|
let transaction = try await DDApplePay_verifiedAndAccomplish(verification)
|
||||||
|
return transaction
|
||||||
|
case .userCancelled: // 用户取消
|
||||||
|
if(dd_ApplePayBlock != nil ){
|
||||||
|
dd_ApplePayBlock(DDApplePayResult.DDApplePayUserCancelled,nil)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
case .pending: // 此次购买被挂起
|
||||||
|
if(dd_ApplePayBlock != nil ){
|
||||||
|
dd_ApplePayBlock(DDApplePayResult.DDApplePayPending,nil)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
default:
|
||||||
|
if(dd_ApplePayBlock != nil ){
|
||||||
|
dd_ApplePayBlock(DDApplePayResult.DDApplePayUnowned,nil)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 校验
|
||||||
|
func DDApplePay_checkVerified<T>(_ result: VerificationResult<T>) throws -> T {
|
||||||
|
//Check whether the JWS passes StoreKit verification.
|
||||||
|
switch result {
|
||||||
|
case .unverified:
|
||||||
|
//StoreKit parses the JWS, but it fails verification.
|
||||||
|
if(dd_ApplePayBlock != nil ){
|
||||||
|
dd_ApplePayBlock(DDApplePayResult.DDApplePayFailedVerification,nil)
|
||||||
|
}
|
||||||
|
throw DDApplePayStoreError.DDApplePayFailedVerification
|
||||||
|
case .verified(let safe):
|
||||||
|
//The result is verified. Return the unwrapped value.
|
||||||
|
print("iap: verified success")
|
||||||
|
return safe
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 校验&完成后传给服务器
|
||||||
|
func DDApplePay_verifiedAndAccomplish(_ verification:VerificationResult<Transaction>) async throws -> Transaction?{
|
||||||
|
//Check whether the transaction is verified. If it isn't,
|
||||||
|
//this function rethrows the verification error.
|
||||||
|
let transaction = try DDApplePay_checkVerified(verification)
|
||||||
|
// 这里将订单提交给服务器进行验证 ~~~
|
||||||
|
let transactionId = try verification.payloadValue.id
|
||||||
|
|
||||||
|
// 添加进入待完成map
|
||||||
|
let key = String(transactionId)
|
||||||
|
DDApplePayRransactionMap[key] = transaction
|
||||||
|
await DDApplePay_uploadServer(for: transactionId)
|
||||||
|
|
||||||
|
// 这里不触发完成,等服务器验证再触发完成逻辑
|
||||||
|
await transaction.finish()
|
||||||
|
|
||||||
|
print("iap: finish")
|
||||||
|
return transaction
|
||||||
|
}
|
||||||
|
/*All transactions:全部的购买交易订单
|
||||||
|
Latest transactions:最新的购买交易订单。(分为订阅品项和除订阅品项外的所有类型二种)
|
||||||
|
Current entitlements:当前用户有购买的权限。(全部的订阅品项、和非消耗品项)
|
||||||
|
*/
|
||||||
|
func DDApplePay_getAllBusiness(transactionId:String) async {
|
||||||
|
|
||||||
|
let transactionIntId = UInt64(transactionId)
|
||||||
|
for await result in Transaction.all {
|
||||||
|
do {
|
||||||
|
let tran = try DDApplePay_checkVerified(result)
|
||||||
|
let resultId = try result.payloadValue.id
|
||||||
|
if transactionIntId == resultId {
|
||||||
|
await tran.finish()
|
||||||
|
break
|
||||||
|
}
|
||||||
|
} catch let error {
|
||||||
|
|
||||||
|
print("error:----\(error)")
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Transaction.latest(for: "pid")
|
||||||
|
|
||||||
|
}
|
||||||
|
// 事件完成处理
|
||||||
|
|
||||||
|
@objc public func DDApplePay_verifyBusinessAccomplish(transaction:String) async{
|
||||||
|
if(DDApplePayRransactionMap[transaction] != nil){
|
||||||
|
await DDApplePayRransactionMap[transaction]!.finish()
|
||||||
|
DDApplePayRransactionMap.removeValue(forKey: transaction)
|
||||||
|
print("verifyBusinessFinish end")
|
||||||
|
}else {
|
||||||
|
await DDApplePay_getAllBusiness(transactionId: transaction)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@MainActor
|
||||||
|
func DDApplePay_uploadServer(for transactionId:UInt64) async {
|
||||||
|
let dic :Dictionary<String,Any> = ["transactionId":transactionId]
|
||||||
|
if(dd_ApplePayBlock != nil ){
|
||||||
|
dd_ApplePayBlock(DDApplePayResult.DDApplePayVerifiedServer,dic)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 支付监听事件
|
||||||
|
func DDApplePay_listenForTransactions() -> Task<Void, Error> {
|
||||||
|
return Task.detached {
|
||||||
|
//Iterate through any transactions that don't come from a direct call to `purchase()`.
|
||||||
|
// 修改update 为 unfinished?
|
||||||
|
for await result in Transaction.updates { //会导致二次校验?
|
||||||
|
do {
|
||||||
|
print("iap: updates")
|
||||||
|
print("result:\(result)")
|
||||||
|
try await self.DDApplePay_verifiedAndAccomplish(result)
|
||||||
|
} catch {
|
||||||
|
//StoreKit has a transaction that fails verification. Don't deliver content to the user.
|
||||||
|
print("Transaction failed verification")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//获取推广内购商品
|
||||||
|
func DDApplePay_Promotion() async -> [SKProduct]?{
|
||||||
|
let promotion = SKProductStorePromotionController()
|
||||||
|
|
||||||
|
let prodicts = try? await promotion.promotionOrder()
|
||||||
|
return prodicts
|
||||||
|
}
|
||||||
|
// 销毁调用
|
||||||
|
deinit {
|
||||||
|
DDApplePayPdateListenerTask?.cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@@ -0,0 +1,4 @@
|
|||||||
|
//
|
||||||
|
// Use this file to import your target's public headers that you would like to expose to Swift.
|
||||||
|
//
|
||||||
|
|
@@ -15,6 +15,11 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
+ (void)getattentionListCompletion:(HttpRequestHelperCompletion)completion uid:(NSString *)uid pageNo:(NSString *)pageNo pageSize:(NSString *)pageSize;
|
+ (void)getattentionListCompletion:(HttpRequestHelperCompletion)completion uid:(NSString *)uid pageNo:(NSString *)pageNo pageSize:(NSString *)pageSize;
|
||||||
+ (void)requestFootPrint:(HttpRequestHelperCompletion)completion uid:(NSString *)uid page:(NSString *)page pageSize:(NSString *)pageSize;
|
+ (void)requestFootPrint:(HttpRequestHelperCompletion)completion uid:(NSString *)uid page:(NSString *)page pageSize:(NSString *)pageSize;
|
||||||
+ (void)getVisitorListCompletion:(HttpRequestHelperCompletion)completion pageNum:(NSString *)pageNum pageSize:(NSString *)pageSize;
|
+ (void)getVisitorListCompletion:(HttpRequestHelperCompletion)completion pageNum:(NSString *)pageNum pageSize:(NSString *)pageSize;
|
||||||
|
+ (void)dd_GetRechargeList:(HttpRequestHelperCompletion)completion channelType:(NSString *)channelType;
|
||||||
|
+ (void)dd_CheckReceipt:(HttpRequestHelperCompletion)completion chooseEnv:(NSString *)chooseEnv chargeRecordId:(NSString *)chargeRecordId transcationId:(NSString *)transcationId uid:(NSString *)uid ticket:(NSString *)ticket;
|
||||||
|
+ (void)dd_RequestIAPRecharge:(HttpRequestHelperCompletion)completion chargeProdId:(NSString *)chargeProdId uid:(NSString *)uid ticket:(NSString *)ticket deviceInfo:(NSString *)deviceInfo clientIp:(NSString *)clientIp;
|
||||||
|
+ (void)requestDressUpShopList:(HttpRequestHelperCompletion)completion dressType:(NSString *)dressType;
|
||||||
|
+ (void)getUserGiftWall:(HttpRequestHelperCompletion)comletion uid:(NSString *)uid giftType:(NSString *)giftType;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
NS_ASSUME_NONNULL_END
|
||||||
|
@@ -23,4 +23,22 @@
|
|||||||
+ (void)getVisitorListCompletion:(HttpRequestHelperCompletion)completion pageNum:(NSString *)pageNum pageSize:(NSString *)pageSize {
|
+ (void)getVisitorListCompletion:(HttpRequestHelperCompletion)completion pageNum:(NSString *)pageNum pageSize:(NSString *)pageSize {
|
||||||
[self makeRequest:@"uservisitrecord/visitUserList" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, pageNum, pageSize, nil];
|
[self makeRequest:@"uservisitrecord/visitUserList" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, pageNum, pageSize, nil];
|
||||||
}
|
}
|
||||||
|
+ (void)dd_GetRechargeList:(HttpRequestHelperCompletion)completion channelType:(NSString *)channelType {
|
||||||
|
NSString *getUrl =@"chargeprod/list";
|
||||||
|
[self makeRequest:getUrl method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__,channelType, nil];
|
||||||
|
}
|
||||||
|
+ (void)dd_CheckReceipt:(HttpRequestHelperCompletion)completion chooseEnv:(NSString *)chooseEnv chargeRecordId:(NSString *)chargeRecordId transcationId:(NSString *)transcationId uid:(NSString *)uid ticket:(NSString *)ticket {
|
||||||
|
NSString *getUrl = @"storeKitV2/verifyOrder";
|
||||||
|
[self makeRequest:getUrl method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, chooseEnv, chargeRecordId, transcationId, uid, ticket, nil];
|
||||||
|
}
|
||||||
|
+ (void)dd_RequestIAPRecharge:(HttpRequestHelperCompletion)completion chargeProdId:(NSString *)chargeProdId uid:(NSString *)uid ticket:(NSString *)ticket deviceInfo:(NSString *)deviceInfo clientIp:(NSString *)clientIp {
|
||||||
|
NSString *getUrl = @"storeKitV/placeOrder";//
|
||||||
|
[self makeRequest:getUrl method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__,chargeProdId, uid, ticket, deviceInfo, clientIp, nil];
|
||||||
|
}
|
||||||
|
+ (void)requestDressUpShopList:(HttpRequestHelperCompletion)completion dressType:(NSString *)dressType {
|
||||||
|
[self makeRequest:@"dress/shop/list" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, dressType, nil];
|
||||||
|
}
|
||||||
|
+ (void)getUserGiftWall:(HttpRequestHelperCompletion)comletion uid:(NSString *)uid giftType:(NSString *)giftType {
|
||||||
|
[self makeRequest:@"giftwall/getByGiftType" method:HttpRequestHelperMethodGET completion:comletion, __FUNCTION__, uid, giftType, nil];
|
||||||
|
}
|
||||||
@end
|
@end
|
||||||
|
Reference in New Issue
Block a user