充值列表的添加

This commit is contained in:
fengshuo
2021-09-24 19:17:19 +08:00
parent dc02767594
commit d3e26de656
25 changed files with 710 additions and 2 deletions

View File

@@ -165,6 +165,12 @@
E8B846C226FD82DC00A777FE /* XPMineUserInfoAlbumCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B846C126FD82DC00A777FE /* XPMineUserInfoAlbumCollectionViewCell.m */; };
E8B846C526FDB41A00A777FE /* XPMineUserInfolbumPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B846C426FDB41A00A777FE /* XPMineUserInfolbumPresenter.m */; };
E8B846C726FDB45000A777FE /* XPMineUserInfoAlbumProtocol.h in Sources */ = {isa = PBXBuildFile; fileRef = E8B846C626FDB44100A777FE /* XPMineUserInfoAlbumProtocol.h */; };
E8B846CB26FDD7CD00A777FE /* XPMineRechargeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B846CA26FDD7CD00A777FE /* XPMineRechargeViewController.m */; };
E8B846CF26FDD96100A777FE /* XPMineRechageHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B846CE26FDD96100A777FE /* XPMineRechageHeadView.m */; };
E8B846D326FDDBE600A777FE /* XPMineRechargeTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B846D226FDDBE600A777FE /* XPMineRechargeTableViewCell.m */; };
E8B846D626FDE01B00A777FE /* XPMineRechargePresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B846D526FDE01B00A777FE /* XPMineRechargePresenter.m */; };
E8B846D826FDE17300A777FE /* XPMineRechargeProtocol.h in Sources */ = {isa = PBXBuildFile; fileRef = E8B846D726FDE16300A777FE /* XPMineRechargeProtocol.h */; };
E8B846DC26FDE24300A777FE /* RechargeListModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B846DB26FDE24300A777FE /* RechargeListModel.m */; };
E8CEA03D26EA3DE500644B44 /* LoginPasswordPresent.m in Sources */ = {isa = PBXBuildFile; fileRef = E8CEA03C26EA3DE500644B44 /* LoginPasswordPresent.m */; };
E8E70D7726F2F15100F03460 /* XPMineViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E70D7626F2F15100F03460 /* XPMineViewController.m */; };
E8E70D7A26F2F16600F03460 /* XPMinePresent.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E70D7926F2F16600F03460 /* XPMinePresent.m */; };
@@ -491,6 +497,17 @@
E8B846C326FDB41A00A777FE /* XPMineUserInfolbumPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineUserInfolbumPresenter.h; sourceTree = "<group>"; };
E8B846C426FDB41A00A777FE /* XPMineUserInfolbumPresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineUserInfolbumPresenter.m; sourceTree = "<group>"; };
E8B846C626FDB44100A777FE /* XPMineUserInfoAlbumProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineUserInfoAlbumProtocol.h; sourceTree = "<group>"; };
E8B846C926FDD7CD00A777FE /* XPMineRechargeViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineRechargeViewController.h; sourceTree = "<group>"; };
E8B846CA26FDD7CD00A777FE /* XPMineRechargeViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineRechargeViewController.m; sourceTree = "<group>"; };
E8B846CD26FDD96100A777FE /* XPMineRechageHeadView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineRechageHeadView.h; sourceTree = "<group>"; };
E8B846CE26FDD96100A777FE /* XPMineRechageHeadView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineRechageHeadView.m; sourceTree = "<group>"; };
E8B846D126FDDBE600A777FE /* XPMineRechargeTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineRechargeTableViewCell.h; sourceTree = "<group>"; };
E8B846D226FDDBE600A777FE /* XPMineRechargeTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineRechargeTableViewCell.m; sourceTree = "<group>"; };
E8B846D426FDE01B00A777FE /* XPMineRechargePresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineRechargePresenter.h; sourceTree = "<group>"; };
E8B846D526FDE01B00A777FE /* XPMineRechargePresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineRechargePresenter.m; sourceTree = "<group>"; };
E8B846D726FDE16300A777FE /* XPMineRechargeProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineRechargeProtocol.h; sourceTree = "<group>"; };
E8B846DA26FDE24300A777FE /* RechargeListModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RechargeListModel.h; sourceTree = "<group>"; };
E8B846DB26FDE24300A777FE /* RechargeListModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RechargeListModel.m; sourceTree = "<group>"; };
E8CEA03B26EA3DE500644B44 /* LoginPasswordPresent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoginPasswordPresent.h; sourceTree = "<group>"; };
E8CEA03C26EA3DE500644B44 /* LoginPasswordPresent.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LoginPasswordPresent.m; sourceTree = "<group>"; };
E8CEA03E26EA3E0200644B44 /* LoginPasswordProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoginPasswordProtocol.h; sourceTree = "<group>"; };
@@ -1226,6 +1243,42 @@
path = UploadImage;
sourceTree = "<group>";
};
E8B846C826FDD79700A777FE /* Recharge */ = {
isa = PBXGroup;
children = (
E8B846C926FDD7CD00A777FE /* XPMineRechargeViewController.h */,
E8B846CA26FDD7CD00A777FE /* XPMineRechargeViewController.m */,
);
path = Recharge;
sourceTree = "<group>";
};
E8B846CC26FDD93D00A777FE /* Recharge */ = {
isa = PBXGroup;
children = (
E8B846CD26FDD96100A777FE /* XPMineRechageHeadView.h */,
E8B846CE26FDD96100A777FE /* XPMineRechageHeadView.m */,
);
path = Recharge;
sourceTree = "<group>";
};
E8B846D026FDDBCD00A777FE /* Recharge */ = {
isa = PBXGroup;
children = (
E8B846D126FDDBE600A777FE /* XPMineRechargeTableViewCell.h */,
E8B846D226FDDBE600A777FE /* XPMineRechargeTableViewCell.m */,
);
path = Recharge;
sourceTree = "<group>";
};
E8B846D926FDE21900A777FE /* Recharge */ = {
isa = PBXGroup;
children = (
E8B846DA26FDE24300A777FE /* RechargeListModel.h */,
E8B846DB26FDE24300A777FE /* RechargeListModel.m */,
);
path = Recharge;
sourceTree = "<group>";
};
E8E70D6E26F2EB1200F03460 /* Mine */ = {
isa = PBXGroup;
children = (
@@ -1250,6 +1303,7 @@
E8E70D7026F2EB3800F03460 /* Model */ = {
isa = PBXGroup;
children = (
E8B846D926FDE21900A777FE /* Recharge */,
E8E70D9026F2F60C00F03460 /* XPMineItemModel.h */,
E8E70D9126F2F60C00F03460 /* XPMineItemModel.m */,
E8AC721726F46E0B007D6E91 /* XPMineSettingItemModel.h */,
@@ -1287,6 +1341,7 @@
E824545526F5E51900BE8163 /* XPMineVerifIdentityViewController.m */,
E824545F26F5F4E400BE8163 /* XPMineResetPayPwdViewController.h */,
E824546026F5F4E400BE8163 /* XPMineResetPayPwdViewController.m */,
E8B846C826FDD79700A777FE /* Recharge */,
E88B5CBE26FB404800DA9178 /* MineInfo */,
E88B5CA926FB15B900DA9178 /* Teenager */,
);
@@ -1322,6 +1377,8 @@
E8EEB90E26FC6AB8007C6EBA /* XPMineUserInfoEditPresenter.m */,
E8B846C326FDB41A00A777FE /* XPMineUserInfolbumPresenter.h */,
E8B846C426FDB41A00A777FE /* XPMineUserInfolbumPresenter.m */,
E8B846D426FDE01B00A777FE /* XPMineRechargePresenter.h */,
E8B846D526FDE01B00A777FE /* XPMineRechargePresenter.m */,
);
path = Presenter;
sourceTree = "<group>";
@@ -1342,6 +1399,7 @@
E8EEB90226FC31CE007C6EBA /* XPMineUserInfoProtocol.h */,
E8EEB91026FC6AD3007C6EBA /* XPMineUserInfoEditProtocol.h */,
E8B846C626FDB44100A777FE /* XPMineUserInfoAlbumProtocol.h */,
E8B846D726FDE16300A777FE /* XPMineRechargeProtocol.h */,
);
path = Protocol;
sourceTree = "<group>";
@@ -1349,6 +1407,7 @@
E8E70D7F26F2F39000F03460 /* SubViews */ = {
isa = PBXGroup;
children = (
E8B846CC26FDD93D00A777FE /* Recharge */,
E88B5CC226FB429C00DA9178 /* MineInfo */,
E88B5CAA26FB168200DA9178 /* Teenager */,
E8E70D8126F2F51A00F03460 /* XPMineHeadView.h */,
@@ -1368,6 +1427,7 @@
E8E70D8026F2F3C500F03460 /* Cell */ = {
isa = PBXGroup;
children = (
E8B846D026FDDBCD00A777FE /* Recharge */,
E8EEB8F826FC285B007C6EBA /* MineInfo */,
E8E70D8726F2F58F00F03460 /* XPMineMatchTableViewCell.h */,
E8E70D8826F2F58F00F03460 /* XPMineMatchTableViewCell.m */,
@@ -1545,6 +1605,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
E8B846D826FDE17300A777FE /* XPMineRechargeProtocol.h in Sources */,
E8B846C726FDB45000A777FE /* XPMineUserInfoAlbumProtocol.h in Sources */,
E8EEB91126FC6AE2007C6EBA /* XPMineUserInfoEditProtocol.h in Sources */,
E8EEB90326FC31DC007C6EBA /* XPMineUserInfoProtocol.h in Sources */,
@@ -1576,6 +1637,7 @@
189DD76226E60DDC00AB55B1 /* Api+Login.m in Sources */,
18E7B22626E8CDCF0064BC9B /* XplanFlutterBoostDelegate.m in Sources */,
E8EEB8F326FC2050007C6EBA /* SDWaitingView.m in Sources */,
E8B846CB26FDD7CD00A777FE /* XPMineRechargeViewController.m in Sources */,
E824544026F58F9400BE8163 /* XPMinePayPwdViewController.m in Sources */,
E8AC723D26F4B6AA007D6E91 /* XPLoginBindPhoneResultViewController.m in Sources */,
189DD73E26E21C3F00AB55B1 /* YYUtility.m in Sources */,
@@ -1597,6 +1659,7 @@
189DD6FF26E20E5900AB55B1 /* HttpRequestHelper.m in Sources */,
E8E70D9226F2F60C00F03460 /* XPMineItemModel.m in Sources */,
189DD74A26E21D8400AB55B1 /* SSKeychain.m in Sources */,
E8B846CF26FDD96100A777FE /* XPMineRechageHeadView.m in Sources */,
186A534926FC6ED900D67B2C /* TTAlertMessageAttributedConfig.m in Sources */,
E81C27AE26EF39AB0031E639 /* AppDelegate+ThirdConfig.m in Sources */,
E8E70D8326F2F51A00F03460 /* XPMineHeadView.m in Sources */,
@@ -1625,6 +1688,7 @@
E8AC721026F43955007D6E91 /* UIImageConstant.m in Sources */,
E81C27A026EEF83D0031E639 /* XPHtmlUrl.m in Sources */,
18E7B1B726E8B2D10064BC9B /* Api+Main.m in Sources */,
E8B846D326FDDBE600A777FE /* XPMineRechargeTableViewCell.m in Sources */,
E824546126F5F4E400BE8163 /* XPMineResetPayPwdViewController.m in Sources */,
E8B825C226EA00DF009E8E9F /* LoginVerifCodePresent.m in Sources */,
E88B5CB026FB1C6500DA9178 /* XPMineTeenagerPresenter.m in Sources */,
@@ -1636,6 +1700,7 @@
186A534726FC6ED900D67B2C /* TTAlertConfig.m in Sources */,
18E7B31E26F0984C0064BC9B /* UserLevelVo.m in Sources */,
E8EEB90626FC5772007C6EBA /* XPMineUserInfoEditViewController.m in Sources */,
E8B846D626FDE01B00A777FE /* XPMineRechargePresenter.m in Sources */,
E8EEB91426FC7786007C6EBA /* XPMineUserInfoNickViewController.m in Sources */,
18E7B31B26F0982E0064BC9B /* UserExpand.m in Sources */,
E824543526F57D6E00BE8163 /* XPLoginVerifBindPhoneViewController.m in Sources */,
@@ -1694,6 +1759,7 @@
186A534826FC6ED900D67B2C /* TTAlertButtonConfig.m in Sources */,
E872308926E89BE000B90D4F /* LoginPhoneViewController.m in Sources */,
18E7B29026EA0E6B0064BC9B /* FlutterBoost+Xplan.m in Sources */,
E8B846DC26FDE24300A777FE /* RechargeListModel.m in Sources */,
189DD75926E6003C00AB55B1 /* Api.m in Sources */,
E88B5CB826FB325200DA9178 /* XPMineTeenagerPwdPresenter.m in Sources */,
189DD53F26DE255600AB55B1 /* main.m in Sources */,

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "common_diamond@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "common_diamond@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "mine_recharge_coin_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "mine_recharge_coin_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "mine_recharge_header_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "mine_recharge_header_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

View File

@@ -68,7 +68,6 @@
+ (void)complementInfoWithComplection:(HttpRequestHelperCompletion)complection
userInfo:(NSDictionary *)userInfo {
[HttpRequestHelper request:@"user/v2/update" method:HttpRequestHelperMethodPOST params:userInfo completion:complection];
}
@end

View File

@@ -93,6 +93,12 @@ NS_ASSUME_NONNULL_BEGIN
pid:(NSString *)pid
uid:(NSString *)uid
ticket:(NSString *)ticket;
/// 请求充值列表
/// @param complection 完成
/// @param channelType channel
+ (void)getRechargeListWithComplection:(HttpRequestHelperCompletion)complection
channelType:(NSString *)channelType;
@end
NS_ASSUME_NONNULL_END

View File

@@ -97,4 +97,12 @@
+ (void)deleteImageFromServerWithComplection:(HttpRequestHelperCompletion)complection pid:(NSString *)pid uid:(NSString *)uid ticket:(NSString *)ticket {
[self makeRequest:@"photo/delPhoto" method:HttpRequestHelperMethodPOST completion:complection, __FUNCTION__,pid, uid, ticket, nil];
}
///
/// @param complection
/// @param channelType channel
+ (void)getRechargeListWithComplection:(HttpRequestHelperCompletion)complection channelType:(NSString *)channelType {
[self makeRequest:@"chargeprod/list" method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__,channelType, nil];
}
@end

View File

@@ -0,0 +1,22 @@
//
// RechargeListModel.h
// xplan-ios
//
// Created by 冯硕 on 2021/9/24.
//
#import "BaseObject.h"
NS_ASSUME_NONNULL_BEGIN
@interface RechargeListModel : BaseObject
///充值的id
@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
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,12 @@
//
// RechargeListModel.m
// xplan-ios
//
// Created by on 2021/9/24.
//
#import "RechargeListModel.h"
@implementation RechargeListModel
@end

View File

@@ -0,0 +1,18 @@
//
// XPMineRechargePresenter.h
// xplan-ios
//
// Created by 冯硕 on 2021/9/24.
//
#import "BaseMvpPresenter.h"
NS_ASSUME_NONNULL_BEGIN
@interface XPMineRechargePresenter : BaseMvpPresenter
/// 请求内购列表
/// @param channel 目前是8
- (void)requestRechargeListWithChannel:(NSString *)channel;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,28 @@
//
// XPMineRechargePresenter.m
// xplan-ios
//
// Created by on 2021/9/24.
//
#import "XPMineRechargePresenter.h"
///Api
#import "Api+Mine.h"
///P
#import "XPMineRechargeProtocol.h"
///Model
#import "RechargeListModel.h"
@implementation XPMineRechargePresenter
///
/// @param channel 8
- (void)requestRechargeListWithChannel:(NSString *)channel {
[Api getRechargeListWithComplection:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
NSArray * array = [RechargeListModel modelsWithArray:data.data];
[[self getView] requestRechargeListSucccess:array];
}] channelType:channel];
}
@end

View File

@@ -0,0 +1,19 @@
//
// XPMineRechargeProtocol.h
// xplan-ios
//
// Created by 冯硕 on 2021/9/24.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@protocol XPMineRechargeProtocol <NSObject>
///请求充值列表成功
- (void)requestRechargeListSucccess:(NSArray *)list;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,17 @@
//
// XPMineRechargeTableViewCell.h
// xplan-ios
//
// Created by 冯硕 on 2021/9/24.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@class RechargeListModel;
@interface XPMineRechargeTableViewCell : UITableViewCell
///
@property (nonatomic,strong) RechargeListModel *listModel;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,144 @@
//
// XPMineRechargeTableViewCell.m
// xplan-ios
//
// Created by on 2021/9/24.
//
#import "XPMineRechargeTableViewCell.h"
///Third
#import <Masonry/Masonry.h>
///Tool
#import "ThemeColor.h"
///Model
#import "RechargeListModel.h"
@interface XPMineRechargeTableViewCell ()
///
@property (nonatomic,strong) UIView * backView;
///💎
@property (nonatomic,strong) UIImageView *coinImageView;
///
@property (nonatomic,strong) UILabel *numberLabel;
///
@property (nonatomic,strong) UILabel *unitLabel;
///
@property (nonatomic,strong) UIButton *rechargeButton;
@end
@implementation XPMineRechargeTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
[self initSubViews];
[self initSubViewConstraints];
}
return self;
}
#pragma mark - Response
- (void)rechargeButtonAction:(UIButton *)sender {
}
#pragma mark - Private Method
- (void)initSubViews {
self.backgroundColor = [UIColor clearColor];
self.selectionStyle = UITableViewCellSelectionStyleNone;
[self.contentView addSubview:self.backView];
[self.backView addSubview:self.coinImageView];
[self.backView addSubview:self.numberLabel];
[self.backView addSubview:self.unitLabel];
[self.backView addSubview:self.rechargeButton];
}
- (void)initSubViewConstraints {
[self.backView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(self.contentView).inset(15);
make.top.mas_equalTo(self.contentView).offset(15);
make.bottom.mas_equalTo(self.contentView);
}];
[self.coinImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(21, 21));
make.centerY.mas_equalTo(self.backView);
make.left.mas_equalTo(self.backView).offset(19);
}];
[self.numberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.coinImageView);
make.left.mas_equalTo(self.coinImageView.mas_right).offset(6);
}];
[self.unitLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.numberLabel);
make.left.mas_equalTo(self.numberLabel.mas_right).offset(6);
}];
[self.rechargeButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(54, 24));
make.centerY.mas_equalTo(self.backView);
make.right.mas_equalTo(self.backView).offset(-15);
}];
}
#pragma mark - Getters And Setters
- (void)setListModel:(RechargeListModel *)listModel {
_listModel = listModel;
if (_listModel) {
NSCharacterSet* nonDigits =[[NSCharacterSet decimalDigitCharacterSet] invertedSet];
int remainSecond = [[_listModel.prodName stringByTrimmingCharactersInSet:nonDigits] intValue];
self.numberLabel.text = [NSString stringWithFormat:@"%d",remainSecond];
[self.rechargeButton setTitle:[NSString stringWithFormat:@"¥%@",[_listModel.money stringValue]] forState:UIControlStateNormal];
}
}
- (UIView *)backView {
if (!_backView) {
_backView = [[UIView alloc] init];
_backView.backgroundColor = [ThemeColor appCellBackgroundColor];
_backView.layer.masksToBounds = YES;
_backView.layer.cornerRadius = 8;
}
return _backView;
}
- (UIImageView *)coinImageView {
if (!_coinImageView) {
_coinImageView = [[UIImageView alloc] init];
_coinImageView.userInteractionEnabled = YES;
_coinImageView.image = [UIImage imageNamed:@""];
}
return _coinImageView;
}
- (UILabel *)numberLabel {
if (!_numberLabel) {
_numberLabel = [[UILabel alloc] init];
_numberLabel.font = [UIFont fontWithName:@"PingFang-SC-Bold" size:18];
_numberLabel.textColor = [ThemeColor mainTextColor];
}
return _numberLabel;
}
- (UILabel *)unitLabel {
if (!_unitLabel) {
_unitLabel = [[UILabel alloc] init];
_unitLabel.text = @"钻石";
_unitLabel.font = [UIFont systemFontOfSize:11];
_unitLabel.textColor = [ThemeColor secondTextColor];
}
return _unitLabel;
}
- (UIButton *)rechargeButton {
if (!_rechargeButton) {
_rechargeButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_rechargeButton setTitleColor:[ThemeColor mainTextColor] forState:UIControlStateNormal];
_rechargeButton.titleLabel.font = [UIFont systemFontOfSize:15];
_rechargeButton.layer.masksToBounds = YES;
_rechargeButton.layer.cornerRadius = 12;
_rechargeButton.layer.borderWidth = 1;
_rechargeButton.layer.borderColor = [ThemeColor mainTextColor].CGColor;
[_rechargeButton addTarget:self action:@selector(rechargeButtonAction:) forControlEvents:UIControlEventTouchUpInside];
}
return _rechargeButton;
}
@end

View File

@@ -0,0 +1,16 @@
//
// XPMineRechargeViewController.h
// xplan-ios
//
// Created by 冯硕 on 2021/9/24.
//
#import "MvpViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface XPMineRechargeViewController : MvpViewController
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,134 @@
//
// XPMineRechargeViewController.m
// xplan-ios
//
// Created by on 2021/9/24.
//
#import "XPMineRechargeViewController.h"
///Third
#import <Masonry/Masonry.h>
#import <YYText/YYLabel.h>
///Tool
#import "ThemeColor.h"
#import "XPMacro.h"
///Model
#import "RechargeListModel.h"
///View
#import "XPMineRechageHeadView.h"
#import "XPMineRechargeTableViewCell.h"
///P
#import "XPMineRechargePresenter.h"
#import "XPMineRechargeProtocol.h"
@interface XPMineRechargeViewController ()<XPMineRechargeProtocol, UITableViewDelegate, UITableViewDataSource>
///
@property (nonatomic,strong) NSArray *datasource;
///
@property (nonatomic,strong) UITableView *tableView;
///
@property (nonatomic,strong) XPMineRechageHeadView *headeView;
///
@property (nonatomic,strong) YYLabel *rechargeProtocolLabel;
@end
@implementation XPMineRechargeViewController
- (XPMineRechargePresenter *)createPresenter {
return [[XPMineRechargePresenter alloc] init];
}
- (void)viewDidLoad {
[super viewDidLoad];
[self getRechargeList];
[self initSubViews];
[self initSubViewConstraints];
}
#pragma mark - Private Method
- (void)initSubViews {
[self.view addSubview:self.tableView];
[self.view addSubview:self.rechargeProtocolLabel];
self.tableView.tableHeaderView = self.headeView;
}
- (void)initSubViewConstraints {
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.view);
}];
[self.rechargeProtocolLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.view);
make.bottom.mas_equalTo(self.view).offset(-20 - kSafeAreaBottomHeight);
}];
}
- (void)getRechargeList {
[self.presenter requestRechargeListWithChannel:@"8"];
}
#pragma mark - UITableViewDelegate And UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.datasource.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
XPMineRechargeTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineRechargeTableViewCell class]) forIndexPath:indexPath];
cell.listModel = self.datasource[indexPath.row];
return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 65;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
[tableView deselectRowAtIndexPath:indexPath animated:true];
}
#pragma mark - XPMineRechargeProtocol
- (void)requestRechargeListSucccess:(NSArray *)list {
self.datasource = list;
[self.tableView reloadData];
}
- (UITableView *)tableView {
if (!_tableView) {
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
_tableView.delegate = self;
_tableView.dataSource = self;
_tableView.tableFooterView = [UIView new];
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
_tableView.backgroundColor = [UIColor clearColor];
if (@available(iOS 11.0, *)) {
_tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}
[_tableView registerClass:[XPMineRechargeTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineRechargeTableViewCell class])];
}
return _tableView;
}
- (XPMineRechageHeadView *)headeView {
if (!_headeView) {
_headeView = [[XPMineRechageHeadView alloc] init];
}
return _headeView;
}
- (YYLabel *)rechargeProtocolLabel {
if (!_rechargeProtocolLabel) {
_rechargeProtocolLabel = [[YYLabel alloc] init];
_rechargeProtocolLabel.font = [UIFont systemFontOfSize:12];
NSString * name = [NSString stringWithFormat:@"《用户充值协议》"];
NSString *str = [NSString stringWithFormat:@"%@%@", @"已阅读并同意", name];
NSRange range1 = [str rangeOfString:@"已阅读并同意"];
NSRange range = [str rangeOfString:name];
NSMutableAttributedString *attStr = [[NSMutableAttributedString alloc] initWithString:str];
[attStr addAttribute:NSForegroundColorAttributeName value:[ThemeColor appMainColor] range:range];
[attStr addAttribute:NSForegroundColorAttributeName value:[ThemeColor textThirdColor] range:range1];
_rechargeProtocolLabel.attributedText = attStr;
_rechargeProtocolLabel.textAlignment = NSTextAlignmentCenter;
}
return _rechargeProtocolLabel;
}
@end

View File

@@ -0,0 +1,16 @@
//
// XPMineRechageHeadView.h
// xplan-ios
//
// Created by 冯硕 on 2021/9/24.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface XPMineRechageHeadView : UIView
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,133 @@
//
// XPMineRechageHeadView.m
// xplan-ios
//
// Created by on 2021/9/24.
//
#import "XPMineRechageHeadView.h"
///Third
#import <Masonry/Masonry.h>
///Tool
#import "ThemeColor.h"
#import "XPMacro.h"
@interface XPMineRechageHeadView ()
///
@property (nonatomic,strong) UIImageView *backImageView;
///
@property (nonatomic,strong) UIImageView *bottomBackImg;
///
@property (nonatomic,strong) UIImageView *coinImageView;
///
@property (nonatomic,strong) UILabel *coinLabel;
///
@property (nonatomic,strong) UILabel *amountLabel;
@end
@implementation XPMineRechageHeadView
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self initView];
[self initContrations];
}
return self;
}
#pragma mark - Private Method
- (void)initView {
[self addSubview:self.backImageView];
[self.backImageView addSubview:self.bottomBackImg];
[self.bottomBackImg addSubview:self.coinImageView];
[self.bottomBackImg addSubview:self.coinLabel];
[self.bottomBackImg addSubview:self.amountLabel];
}
- (void)initContrations {
[self mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(KScreenWidth);
make.height.mas_equalTo(kSafeAreaTopHeight + 190);
}];
[self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self);
}];
[self.bottomBackImg mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.bottom.mas_equalTo(self.backImageView);
make.height.mas_equalTo(110);
}];
[self.coinImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(21, 21));
make.top.mas_equalTo(self.bottomBackImg).offset(23);
make.right.mas_equalTo(self.coinLabel.mas_left).offset(-4);
}];
[self.coinLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.coinImageView);
make.centerX.mas_equalTo(self.bottomBackImg.mas_centerX).offset(12);
}];
[self.amountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.bottomBackImg);
make.top.mas_equalTo(self.coinImageView.mas_bottom).offset(1);
}];
}
#pragma mark - Getters And Setters
- (UIImageView *)backImageView {
if (!_backImageView) {
_backImageView = [[UIImageView alloc] init];
_backImageView.userInteractionEnabled = YES;
_backImageView.image = [UIImage imageNamed:@"mine_recharge_header_bg"];
_backImageView.contentMode = UIViewContentModeScaleAspectFill;
}
return _backImageView;
}
- (UIImageView *)bottomBackImg {
if (!_bottomBackImg) {
_bottomBackImg = [[UIImageView alloc] init];
_bottomBackImg.userInteractionEnabled = YES;
_bottomBackImg.image = [UIImage imageNamed:@"mine_recharge_coin_bg"];
_bottomBackImg.layer.masksToBounds = YES;
_bottomBackImg.contentMode = UIViewContentModeScaleAspectFit;
}
return _bottomBackImg;
}
- (UIImageView *)coinImageView {
if (!_coinImageView) {
_coinImageView = [[UIImageView alloc] init];
_coinImageView.userInteractionEnabled = YES;
_coinImageView.image = [UIImage imageNamed:@"common_diamond"];
}
return _coinImageView;
}
- (UILabel *)coinLabel {
if (!_coinLabel) {
_coinLabel = [[UILabel alloc] init];
_coinLabel.text = @"我的钻石";
_coinLabel.font = [UIFont systemFontOfSize:13];
_coinLabel.textColor = [ThemeColor mainTextColor];
}
return _coinLabel;
}
- (UILabel *)amountLabel {
if (!_amountLabel) {
_amountLabel = [[UILabel alloc] init];
_amountLabel.font = [UIFont boldSystemFontOfSize:36];
_amountLabel.textColor = [ThemeColor appMainColor];
_amountLabel.textAlignment = NSTextAlignmentCenter;
}
return _amountLabel;
}
@end

View File

@@ -27,6 +27,7 @@
#import "XPMineSettingViewController.h"
#import "XPMineTeenagerViewController.h"
#import "XPMineUserInfoViewController.h"
#import "XPMineRechargeViewController.h"
#import "XPWebViewController.h"
@@ -124,7 +125,10 @@
[self pushWebViewWIthUrl:URLWithType(kIdentityURL)];
break;
case XPMineItemType_Account:
#warning to do
{
XPMineRechargeViewController * rechargeVC = [[XPMineRechargeViewController alloc] init];
[self.navigationController pushViewController:rechargeVC animated:YES];
}
break;
case XPMineItemType_Invite_Friend:
[self pushWebViewWIthUrl:URLWithType(kUserInviteFriendURL)];