Commit 3382edac by 刘卓鑫

任务部分优化为金币

parent c96fdd02
......@@ -64,6 +64,9 @@
1C58AAA423CEA0EF00D037E0 /* ZXScanRechargePop.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C58AAA323CEA0EF00D037E0 /* ZXScanRechargePop.m */; };
1C58AAA923CEB8A000D037E0 /* ScanLoadingButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C58AAA523CEB89F00D037E0 /* ScanLoadingButton.m */; };
1C58AAAA23CEB8A000D037E0 /* JFButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C58AAA623CEB89F00D037E0 /* JFButton.m */; };
1C5B002F23ED941200DD911F /* ZXTaskTop10View.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C5B002E23ED941200DD911F /* ZXTaskTop10View.m */; };
1C5B003223ED9C8900DD911F /* ZXTaskTop10TableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C5B003123ED9C8900DD911F /* ZXTaskTop10TableViewCell.m */; };
1C5B003823EDAA5100DD911F /* ZXTaskChooseView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C5B003723EDAA5100DD911F /* ZXTaskChooseView.m */; };
1C5B26B8225B3B7B001B0E1B /* ZXSettingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C5B26B7225B3B7B001B0E1B /* ZXSettingViewController.m */; };
1C5B26BB225B3B85001B0E1B /* ZXUserSettingTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C5B26B9225B3B83001B0E1B /* ZXUserSettingTableViewCell.m */; };
1C5B26BE225B3B8F001B0E1B /* ZXUserSettingModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C5B26BC225B3B8E001B0E1B /* ZXUserSettingModel.m */; };
......@@ -846,6 +849,12 @@
1C58AAA623CEB89F00D037E0 /* JFButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JFButton.m; sourceTree = "<group>"; };
1C58AAA723CEB89F00D037E0 /* ScanLoadingButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScanLoadingButton.h; sourceTree = "<group>"; };
1C58AAA823CEB8A000D037E0 /* JFButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JFButton.h; sourceTree = "<group>"; };
1C5B002D23ED941200DD911F /* ZXTaskTop10View.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ZXTaskTop10View.h; sourceTree = "<group>"; };
1C5B002E23ED941200DD911F /* ZXTaskTop10View.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ZXTaskTop10View.m; sourceTree = "<group>"; };
1C5B003023ED9C8900DD911F /* ZXTaskTop10TableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ZXTaskTop10TableViewCell.h; sourceTree = "<group>"; };
1C5B003123ED9C8900DD911F /* ZXTaskTop10TableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ZXTaskTop10TableViewCell.m; sourceTree = "<group>"; };
1C5B003623EDAA5100DD911F /* ZXTaskChooseView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ZXTaskChooseView.h; sourceTree = "<group>"; };
1C5B003723EDAA5100DD911F /* ZXTaskChooseView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ZXTaskChooseView.m; sourceTree = "<group>"; };
1C5B26B6225B3B7B001B0E1B /* ZXSettingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZXSettingViewController.h; sourceTree = "<group>"; };
1C5B26B7225B3B7B001B0E1B /* ZXSettingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZXSettingViewController.m; sourceTree = "<group>"; };
1C5B26B9225B3B83001B0E1B /* ZXUserSettingTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZXUserSettingTableViewCell.m; sourceTree = "<group>"; };
......@@ -2580,6 +2589,12 @@
1CBDE2C5238D0435006DA46E /* ZXTaskManager.m */,
1C18F6FC23A7516C00389B42 /* ZXPlayAdViewController.h */,
1C18F6FD23A7516C00389B42 /* ZXPlayAdViewController.m */,
1C5B002D23ED941200DD911F /* ZXTaskTop10View.h */,
1C5B002E23ED941200DD911F /* ZXTaskTop10View.m */,
1C5B003023ED9C8900DD911F /* ZXTaskTop10TableViewCell.h */,
1C5B003123ED9C8900DD911F /* ZXTaskTop10TableViewCell.m */,
1C5B003623EDAA5100DD911F /* ZXTaskChooseView.h */,
1C5B003723EDAA5100DD911F /* ZXTaskChooseView.m */,
);
path = "Task(任务)";
sourceTree = "<group>";
......@@ -5413,6 +5428,7 @@
A7B0589C211A80EC00304B38 /* ZXDrinkViewController.m in Sources */,
A7AB5FFB20AC31050066950A /* JXLayoutButton.m in Sources */,
1C9D29C82396339D00E240EB /* PYSearchViewController.m in Sources */,
1C5B002F23ED941200DD911F /* ZXTaskTop10View.m in Sources */,
A7F3E17321B5330F00010E23 /* HTTPConnection.m in Sources */,
1C3AE7C422F0482D0045C969 /* ZXScannerViewController.m in Sources */,
A745DBFA210089BC00D0C648 /* ZXPutMenuTimeCell.m in Sources */,
......@@ -5524,6 +5540,7 @@
1C3AE7DD22F131810045C969 /* ZXHomePageFouction.m in Sources */,
A77040E020ABDC1C00EF6913 /* CustomerTabbar.m in Sources */,
A7236972209AD2960048E978 /* NSString+MD5.m in Sources */,
1C5B003223ED9C8900DD911F /* ZXTaskTop10TableViewCell.m in Sources */,
1C3AE7C522F0482D0045C969 /* SGQRCodeObtain.m in Sources */,
1CD9C41522C3191300C04683 /* ZXAppointForbbidenModel.m in Sources */,
A756C5A821F9B5960006E418 /* ZXNewPayTypeActivityTableViewCell.m in Sources */,
......@@ -5726,6 +5743,7 @@
1C39411F230BC9D5005048EB /* ZXContentViewController.m in Sources */,
A77097E52237A7A4002D9D97 /* ZX_recharge_item.m in Sources */,
A7F3E1C321B5350600010E23 /* unzip.c in Sources */,
1C5B003823EDAA5100DD911F /* ZXTaskChooseView.m in Sources */,
A7265BF420CA45690084B814 /* GYRollingNoticeView.m in Sources */,
1C5B26BB225B3B85001B0E1B /* ZXUserSettingTableViewCell.m in Sources */,
A77DE2D720DB7BCC002FB903 /* ZXWashMyInvitorCell.m in Sources */,
......
......@@ -70,6 +70,13 @@
ReferencedContainer = "container:ColorfulSchool.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<EnvironmentVariables>
<EnvironmentVariable
key = "OS_ACTIVITY_MODE"
value = "disable"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
......
......@@ -73,8 +73,8 @@
_isPlaying = NO;
//启动环境
[APIManager sharedAPIManager].lauchEnvironment = ZXColorfulSchoolEnvironmentDevelop;
[APIManager sharedAPIManager].lauchEnvironment = ZXColorfulSchoolEnvironmentTest;
NSLog(@"%@", CachePath);
//极光推送
[self initPushWithOptions:launchOptions isProduct:YES];
......
//
//
......@@ -21,4 +21,10 @@
@property CGFloat xmg_centerX;
@property CGFloat xmg_centerY;
@property CGFloat xmg_bottom;
@property (nonatomic) CGFloat left; ///< Shortcut for frame.origin.x.
@property (nonatomic) CGFloat top; ///< Shortcut for frame.origin.y
@property (nonatomic) CGFloat right; ///< Shortcut for frame.origin.x + frame.size.width
@property (nonatomic) CGFloat bottom;
@property (nonatomic) CGFloat width; ///< Shortcut for frame.size.width.
@property (nonatomic) CGFloat height;
@end
//
//
......@@ -92,4 +92,63 @@
frame.origin.y = xmg_bottom - frame.size.height;
self.frame = frame;
}
- (CGFloat)left {
return self.frame.origin.x;
}
- (void)setLeft:(CGFloat)x {
CGRect frame = self.frame;
frame.origin.x = x;
self.frame = frame;
}
- (CGFloat)top {
return self.frame.origin.y;
}
- (void)setTop:(CGFloat)y {
CGRect frame = self.frame;
frame.origin.y = y;
self.frame = frame;
}
- (CGFloat)right {
return self.frame.origin.x + self.frame.size.width;
}
- (void)setRight:(CGFloat)right {
CGRect frame = self.frame;
frame.origin.x = right - frame.size.width;
self.frame = frame;
}
- (CGFloat)bottom {
return self.frame.origin.y + self.frame.size.height;
}
- (void)setBottom:(CGFloat)bottom {
CGRect frame = self.frame;
frame.origin.y = bottom - frame.size.height;
self.frame = frame;
}
- (CGFloat)width {
return self.frame.size.width;
}
- (void)setWidth:(CGFloat)width {
CGRect frame = self.frame;
frame.size.width = width;
self.frame = frame;
}
- (CGFloat)height {
return self.frame.size.height;
}
- (void)setHeight:(CGFloat)height {
CGRect frame = self.frame;
frame.size.height = height;
self.frame = frame;
}
@end
//
//
......@@ -100,14 +100,16 @@
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeUserNameAction:) name:@"changeUserNameNotification" object:nil];
//// //测试按钮
// //测试按钮
// UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(50, kScreenHeight - 150, 80, 80)];
// [self.view addSubview:btn];
// btn.backgroundColor = [UIColor orangeColor];
// [[btn rac_signalForControlEvents:UIControlEventTouchDown] subscribeNext:^(id x) {
//
// UIView *v = NSClassFromString(@"ZXTaskTop10View").new;
// v.frame = UIScreen.mainScreen.bounds;
// [self.view addSubview:v];
// }];
//
if ([[kUserDefaults objectForKey:@"kAPP_IS_OPENB_TASK"] isEqualToString:@"yes"]) {
//查看任务相关内容
......
//
//
......@@ -529,6 +529,7 @@ typedef void(^isCanChange)(BOOL iCan);
if (indexPath.section) {
switch (indexPath.row) {
case 0:{
[XMGFileTool removeDirectoryPath:CachePath];
[self.myTableView reloadData];
[SVProgressHUD showSuccessWithStatus:@"清除缓存成功"];
......
//
//
// ZXTaskChooseView.h
// ColorfulSchool
//
// Created by 刘卓鑫 on 2020/2/7.
// Copyright © 2020 Colorful Any Door. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface ZXTaskChooseView : UIView
- (instancetype) initWithFrame:(CGRect) frame
selectType:(NSInteger)selectType
selectFirstAction:(dispatch_block_t) seletcFirst
selectSecondAction:(dispatch_block_t) selectSecond;
@end
NS_ASSUME_NONNULL_END
//
//
// ZXTaskChooseView.m
// ColorfulSchool
//
// Created by 刘卓鑫 on 2020/2/7.
// Copyright © 2020 Colorful Any Door. All rights reserved.
//
#import "ZXTaskChooseView.h"
@implementation ZXTaskChooseView
- (instancetype) initWithFrame:(CGRect) frame
selectType:(NSInteger)selectType
selectFirstAction:(dispatch_block_t) seletcFirst
selectSecondAction:(dispatch_block_t) selectSecond {
if (self = [super initWithFrame:frame]) {
UIView *top = [[UIView alloc] init];
[self addSubview:top];
[top mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.equalTo(self);
make.height.mas_equalTo(40 * k6Scale);
}];
top.backgroundColor = RGB(235, 235, 235);
UIButton *middle = [[UIButton alloc] init];
[self addSubview:middle];
[middle mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self);
make.height.mas_equalTo(40 * k6Scale);
make.top.equalTo(top.mas_bottom);
}];
middle.backgroundColor = UIColor.whiteColor;
UIView *line = [[UIView alloc] init];
[middle addSubview:line];
[line mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(middle);
make.left.equalTo(middle.mas_left).offset(15 * k6Scale);
make.right.equalTo(middle.mas_right).offset(-15 * k6Scale);
make.height.mas_equalTo(1);
}];
line.backgroundColor = RGB(235, 235, 235);
UIButton *bottom = [[UIButton alloc] init];
[self addSubview:bottom];
[bottom mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self);
make.height.mas_equalTo(40 * k6Scale);
make.top.equalTo(middle.mas_bottom);
}];
bottom.backgroundColor = UIColor.whiteColor;
UILabel *topLabel = [[UILabel alloc] init];
topLabel.font = kFontSize(15 * k6Scale);
topLabel.textColor = [UIColor colorWithHexString:@"#666666"];
[top addSubview:topLabel];
topLabel.text = selectType==1?@"累计金币数":@"累计任务数";
[topLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(top.mas_left).offset(15 * k6Scale);
make.centerY.equalTo(top);
}];
UIImageView *mark = [[UIImageView alloc] init];
[top addSubview:mark];
mark.image = [UIImage imageNamed:@"ic_jiage_nor"];
[mark mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(top.mas_right).offset(-15 * k6Scale);
make.centerY.equalTo(top);
make.width.height.mas_equalTo(12 * k6Scale);
}];
UILabel *middleLabel = [[UILabel alloc] init];
middleLabel.font = kFontSize(15 * k6Scale);
middleLabel.textColor = [UIColor colorWithHexString:@"#666666"];
[middle addSubview:middleLabel];
middleLabel.text = @"累计金币数";
[middleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(middle.mas_left).offset(15 * k6Scale);
make.centerY.equalTo(middle);
}];
UILabel *bottomLabel = [[UILabel alloc] init];
bottomLabel.font = kFontSize(15 * k6Scale);
bottomLabel.textColor = [UIColor colorWithHexString:@"#666666"];
[bottom addSubview:bottomLabel];
bottomLabel.text = @"累计任务数";
[bottomLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(bottom.mas_left).offset(15 * k6Scale);
make.centerY.equalTo(bottom);
}];
[[middle rac_signalForControlEvents:UIControlEventTouchDown] subscribeNext:^(id x) {
seletcFirst();
}];
[[bottom rac_signalForControlEvents:UIControlEventTouchDown] subscribeNext:^(id x) {
selectSecond();
}];
}
return self;
}
@end
//
//
// ZXTaskTop10TableViewCell.h
// ColorfulSchool
//
// Created by 刘卓鑫 on 2020/2/7.
// Copyright © 2020 Colorful Any Door. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface ZXTaskTop10TableViewCell : UITableViewCell
/** */
@property (nonatomic, strong) NSDictionary *rankInfo;
@end
NS_ASSUME_NONNULL_END
//
//
// ZXTaskTop10TableViewCell.m
// ColorfulSchool
//
// Created by 刘卓鑫 on 2020/2/7.
// Copyright © 2020 Colorful Any Door. All rights reserved.
//
#import "ZXTaskTop10TableViewCell.h"
@interface ZXTaskTop10TableViewCell()
@property (nonatomic, strong) UILabel *nameLabel;
/** 排名 */
@property (nonatomic, strong) UILabel *topLabel;
/** */
@property (nonatomic, strong) UILabel *numberLabel;
/** 前三名的图标*/
@property (nonatomic, strong) UIImageView *markImageView;
@end
@implementation ZXTaskTop10TableViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
self.backgroundColor = UIColor.whiteColor;
// self.contentView.backgroundColor = RGB(235, 235, 235);
self.selectionStyle = UITableViewCellSelectionStyleNone;
[self.contentView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self).insets(UIEdgeInsetsMake(0, 16 * k6Scale, 5 * k6Scale, 16 * k6Scale));
}];
kViewRadius(self.contentView, 10 * k6Scale);
self.markImageView = [[UIImageView alloc] init];
[self.contentView addSubview:self.markImageView];
[self.markImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(29 * k6Scale);
make.centerY.equalTo(self.contentView);
make.left.equalTo(self.contentView).offset(13 * k6Scale);
}];
self.topLabel = [[UILabel alloc] init];
[self.contentView addSubview:self.topLabel];
self.topLabel.textColor = [UIColor colorWithHexString:@"#666666"];
self.topLabel.font = [UIFont boldSystemFontOfSize:16 * k6Scale];
[self.topLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.top.bottom.equalTo(self.contentView);
make.width.mas_equalTo(55 * k6Scale);
}];
self.topLabel.textAlignment = NSTextAlignmentCenter;
self.nameLabel = [[UILabel alloc] init];
[self.contentView addSubview:self.nameLabel];
self.nameLabel.textColor = [UIColor colorWithHexString:@"#666666"];
self.nameLabel.font = [UIFont boldSystemFontOfSize:18 * k6Scale];
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.bottom.equalTo(self.contentView);
make.left.equalTo(self.contentView.mas_left).offset(75 * k6Scale);
make.right.equalTo(self.contentView.mas_right).offset(-85 * k6Scale);
}];
self.numberLabel = [[UILabel alloc] init];
[self.contentView addSubview:self.numberLabel];
self.numberLabel.textColor = [UIColor colorWithHexString:@"#ff5628"];
self.numberLabel.font = [UIFont boldSystemFontOfSize:18 * k6Scale];
[self.numberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.top.bottom.equalTo(self.contentView);
make.width.mas_equalTo(60 * k6Scale);
}];
self.numberLabel.textAlignment = NSTextAlignmentCenter;
}
return self;
}
- (void)setRankInfo:(NSDictionary *)rankInfo {
_rankInfo = rankInfo;
NSInteger index = [_rankInfo[@"ranking"] integerValue];
if (index == 1) {
self.markImageView.hidden = NO;
self.topLabel.hidden = YES;
self.markImageView.image = [UIImage imageNamed:@"第一名"];
} else if (index == 2) {
self.markImageView.hidden = NO;
self.topLabel.hidden = YES;
self.markImageView.image = [UIImage imageNamed:@"第二名"];
} else if (index == 3) {
self.markImageView.hidden = NO;
self.topLabel.hidden = YES;
self.markImageView.image = [UIImage imageNamed:@"第三名"];
} else {
self.markImageView.hidden = YES;
self.topLabel.hidden = NO;
self.topLabel.text = [NSString stringWithFormat:@"%ld", index];
}
self.nameLabel.text = _rankInfo[@"name"];
self.numberLabel.text = _rankInfo[@"score"];
}
@end
//
//
// ZXTaskTop10View.h
// ColorfulSchool
//
// Created by 刘卓鑫 on 2020/2/7.
// Copyright © 2020 Colorful Any Door. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface ZXTaskTop10View : UIView
@end
NS_ASSUME_NONNULL_END
//
//
// ZXTaskTop10View.m
// ColorfulSchool
//
// Created by 刘卓鑫 on 2020/2/7.
// Copyright © 2020 Colorful Any Door. All rights reserved.
//
#import "ZXTaskTop10View.h"
#import "ZXTaskTop10TableViewCell.h"
#import "ZXTaskChooseView.h"
@interface ZXTaskTop10View()<UITableViewDelegate, UITableViewDataSource>
/** */
@property (nonatomic, strong) UIView *bgView;
/** */
@property (nonatomic, strong) UITableView *myTableView;
/** 排名label */
@property (nonatomic, strong) UILabel *topLabel;
/** 提升排名按钮 */
@property (nonatomic, strong) UILabel *raiseTopLabel;
/** 当前e类型 */
@property (nonatomic, strong) UILabel *currentCategoryLabel;
/** 筛选类型按钮 */
@property (nonatomic, strong) UIButton *chooseCatecoryButton;
/** */
@property (nonatomic, strong) ZXTaskChooseView *categoryView;
/** */
@property (nonatomic, copy) NSString *categoryString;
/** 累计金币数页码 */
@property (nonatomic, assign) NSInteger goldPage;
/** 累计任务数页码 */
@property (nonatomic, assign) NSInteger taskPage;
/** 排行榜列表 */
@property (nonatomic, strong) NSMutableArray *topList;
@end
@implementation ZXTaskTop10View
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
CGPoint point = [[touches anyObject] locationInView:self];
point = [self.bgView.layer convertPoint:point fromLayer:self.layer]; //get layer using containsPoint:
if (![self.bgView.layer containsPoint:point]) {
self.hidden = YES;
[self removeFromSuperview];
}
}
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
self.goldPage = 1;
self.taskPage = 1;
self.categoryString = @"1";
self.backgroundColor = kRGBColor(0, 0, 0, 0.5);
UIView *bgView = [[UIView alloc] init];
[self addSubview:bgView];
bgView.backgroundColor = UIColor.whiteColor;
[bgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.equalTo(self);
make.width.mas_equalTo(332 * k6Scale);
make.height.mas_equalTo(460 * k6Scale);
}];
kViewRadius(bgView, 15 * k6Scale);
self.bgView = bgView;
UIImageView *topBg = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"排行榜"]];
[bgView addSubview:topBg];
[topBg mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.equalTo(bgView);
make.height.mas_equalTo(142 * k6Scale);
}];
topBg.userInteractionEnabled = YES;
self.chooseCatecoryButton = [[UIButton alloc] init];
[topBg addSubview:self.chooseCatecoryButton];
self.chooseCatecoryButton.backgroundColor = UIColor.whiteColor;
[self.chooseCatecoryButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(topBg.mas_left).offset(16 * k6Scale);
make.bottom.equalTo(topBg.mas_bottom).offset(-6 * k6Scale);
make.width.mas_equalTo(205 * k6Scale);
make.height.mas_equalTo(40 * k6Scale);
}];
kViewRadius(self.chooseCatecoryButton, 8 * k6Scale);
[self.chooseCatecoryButton addTarget:self action:@selector(chooseCategory:) forControlEvents:UIControlEventTouchDown];
self.currentCategoryLabel = [[UILabel alloc] init];
self.currentCategoryLabel.font = kFontSize(15 * k6Scale);
self.currentCategoryLabel.textColor = [UIColor colorWithHexString:@"#666666"];
[self.chooseCatecoryButton addSubview:self.currentCategoryLabel];
self.currentCategoryLabel.text = @"累计金币数";
[self.currentCategoryLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.chooseCatecoryButton.mas_left).offset(15 * k6Scale);
make.centerY.equalTo(self.chooseCatecoryButton);
}];
UIImageView *mark = [[UIImageView alloc] init];
[self.chooseCatecoryButton addSubview:mark];
mark.image = [UIImage imageNamed:@"ic_jiage_nor"];
[mark mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.chooseCatecoryButton.mas_right).offset(-15 * k6Scale);
make.centerY.equalTo(self.chooseCatecoryButton);
make.width.height.mas_equalTo(12 * k6Scale);
}];
[bgView addSubview:self.categoryView];
kViewRadius(self.categoryView, 8 * k6Scale);
self.categoryView.hidden = YES;
[self.categoryView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(topBg.mas_left).offset(16 * k6Scale);
make.top.equalTo(topBg.mas_bottom).offset(-46 * k6Scale);
make.width.mas_equalTo(205 * k6Scale);
make.height.mas_equalTo(120 * k6Scale);
}];
self.myTableView = [[UITableView alloc] init];
[bgView insertSubview:self.myTableView belowSubview:topBg];
self.myTableView.tableFooterView = UIView.new;
self.myTableView.delegate = self;
self.myTableView.dataSource = self;
self.myTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
//下拉刷新
self.myTableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(loadNewData)];
//上拉加载
self.myTableView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(loadMoreData)];
[self.myTableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(topBg.mas_bottom).offset(15 * k6Scale);
make.bottom.equalTo(bgView.mas_bottom).offset(-80 * k6Scale);
make.left.right.equalTo(bgView);
}];
self.topLabel = [[UILabel alloc] init];
[bgView addSubview:self.topLabel];
self.topLabel.font = [UIFont boldSystemFontOfSize:18 * k6Scale];
self.topLabel.text = @"您的当前排名: 156";
self.topLabel.textColor = [UIColor colorWithHexString:@"#666666"];
[self.topLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(bgView.mas_left).offset(16 * k6Scale);
make.bottom.equalTo(bgView.mas_bottom).offset(-22 * k6Scale);
}];
self.raiseTopLabel = [[UILabel alloc] init];
[bgView addSubview:self.raiseTopLabel];
self.raiseTopLabel.font = [UIFont boldSystemFontOfSize:15 * k6Scale];
self.raiseTopLabel.text = @"去提升排名>";
self.raiseTopLabel.textColor = [UIColor colorWithHexString:@"#ffc934"];
[self.raiseTopLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(bgView.mas_right).offset(-16 * k6Scale);
make.centerY.equalTo(self.topLabel);
}];
self.raiseTopLabel.userInteractionEnabled = YES;
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(removeSelf)];
[self.raiseTopLabel addGestureRecognizer:tap];
[self loadNewData];
}
return self;
}
- (void) removeSelf {
self.hidden = YES;
[self removeFromSuperview];
}
- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.topList.count;
}
- (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 45 * k6Scale;
}
- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
ZXTaskTop10TableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ZXTaskTop10TableViewCell"];
if (cell == nil) {
cell = [[ZXTaskTop10TableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"ZXTaskTop10TableViewCell"];
}
cell.rankInfo = self.topList[indexPath.row];
return cell;
}
#pragma mark - 筛选类型
- (void) chooseCategory:(UIButton *) sender {
self.categoryView.hidden = NO;
}
- (ZXTaskChooseView *)categoryView {
if (_categoryView == nil) {
@weakify(self);
_categoryView = [[ZXTaskChooseView alloc] initWithFrame:CGRectMake(0, 0, 205 * k6Scale, 120 * k6Scale)
selectType:1 selectFirstAction:^{
@strongify(self);
self.categoryString = @"1";
self.categoryView.hidden = YES;
self.currentCategoryLabel.text = @"累计金币数";
[self loadNewData];
} selectSecondAction:^{
@strongify(self);
self.categoryString = @"2";
self.categoryView.hidden = YES;
self.currentCategoryLabel.text = @"累计任务数";
[self loadNewData];
}];
}
return _categoryView;
}
- (void) loadNewData {
if ([self.categoryString isEqualToString:@"1"]) {
self.goldPage = 1;
} else {
self.taskPage = 1;
}
[self loadDataWithPageIndex:1];
}
- (void) loadMoreData {
NSInteger index = 0;
if ([self.categoryString isEqualToString:@"1"]) {
self.goldPage ++;
index = self.goldPage;
} else {
self.taskPage ++;
index = self.taskPage;
}
[self loadDataWithPageIndex:index];
}
- (void) loadDataWithPageIndex:(NSInteger) index {
@weakify(self);
[ZXTool requestDataWithType:kXMHTTPMethodGET url:[NSString stringWithFormat:@"%@/dcxy/api/rankingList?rankingListType=%@&pageNum=%ld&pageSize=10", [kUserDefaults objectForKey:@"Task"], self.categoryString, index] para:nil completed:^(CommonModel *common, NSString *error) {
@strongify(self);
if (index == 1) {
[self.topList removeAllObjects];
}
[self.topList addObjectsFromArray:common.data[@"rankingList"]];
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
//当前排名
self.topLabel.text = [NSString stringWithFormat:@"您的当前排名: %@", common.data[@"currentRanking"]];
[self.myTableView.mj_header endRefreshing];
if ([common.data[@"rankingList"] count] == 10) {
[self.myTableView.mj_footer endRefreshing];
} else {
[self.myTableView.mj_footer endRefreshingWithNoMoreData];
}
[self.myTableView reloadData];
});
}];
}
- (NSMutableArray *)topList {
if (!_topList) {
_topList = [[NSMutableArray alloc] init];
}
return _topList;
}
@end
//
//
......@@ -28,6 +28,7 @@
#import "GDTNativeExpressAdView.h"
#import "GDTUnifiedBannerView.h"
#import "GDTUnifiedInterstitialAd.h"
#import "ZXTaskTop10View.h"
@interface ZXTaskViewController ()<WKNavigationDelegate, WKUIDelegate, WKScriptMessageHandler, BUNativeExpressRewardedVideoAdDelegate, BaiduMobAdRewardVideoDelegate, BUNativeExpresInterstitialAdDelegate, BUNativeExpressFullscreenVideoAdDelegate, BUNativeExpressAdViewDelegate, BUNativeExpressBannerViewDelegate, GDTNativeExpressAdDelegete, GDTUnifiedBannerViewDelegate, GDTUnifiedInterstitialAdDelegate, GDTRewardedVideoAdDelegate>
/** */
@property (nonatomic, strong) WKWebView *webView;
......@@ -306,6 +307,7 @@
@"loginOut",//登出
@"getUserInfoH5ToAPPNative",//获取用户信息
@"pageCallback",//新交互 预留
@"showRankList",//显示排行榜
];
}
return _indentifierList;
......@@ -341,9 +343,13 @@
} else if ([message.name isEqualToString:self.indentifierList[1]]) {
/*后退*/
[self.webView goBack];
[self.navigationController popViewControllerAnimated:YES];
if ([message.body[0] isEqualToString:@"drawIndex"]) {
if ([message.body[0] isEqualToString:@"drawIndex"] || [message.body[0] isEqualToString:@"missionCompleted"]) {
[[NSNotificationCenter defaultCenter] postNotificationName:@"kPageCallBackNotification" object:@[@"home_reload", @"refreshAccount", @""]];
[self.navigationController popToRootViewControllerAnimated:YES];
} else {
[self.navigationController popViewControllerAnimated:YES];
}
} else if ([message.name isEqualToString:self.indentifierList[2]]) {
/*开始任务 missionStart(callbackName: 'missonDoneCallback', type: 1,taskCode:'',address:'',thirdId:'' ) 任务类型 1:视频; 2:自编内容; 3:内部跳转; 4: 外部跳转; 5:呼起第三方*/
......@@ -448,6 +454,9 @@
//发送广播
[[NSNotificationCenter defaultCenter] postNotificationName:@"kPageCallBackNotification" object:message.body];
} else if ([message.name isEqualToString:self.indentifierList[10]]) {//显示排行榜
UIView *taskTop10View = [[ZXTaskTop10View alloc] initWithFrame:UIScreen.mainScreen.bounds];
[self.tabBarController.view addSubview:taskTop10View];
}
}
......@@ -490,6 +499,7 @@
#pragma mark - 任务获取接口------(全屏视频--激励视频--插屏)
- (void) taskAdWithAdvertType:(NSInteger) advertType {
//请求接口 获取广告类型
[ZXTool requestDataWithType:kXMHTTPMethodGET url:[NSString stringWithFormat:@"%@/dcxy/api/incentiveVideo/least?advertType=%ld", [kUserDefaults objectForKey:@"Task"], (long)advertType] para:nil completed:^(CommonModel *common, NSString *error) {
......@@ -562,7 +572,7 @@
[ZXTool hideLoadingAnimation];
if (error == nil) {
//直接弹
[self callBackToH5WithSuccess:YES promptMsg:common.data[@"promptMsg"]];
[self callBackToH5WithSuccess:YES promptMsg:common.data];
}
});
......@@ -570,9 +580,16 @@
}
#pragma mark - 回调前端已经任务完成
- (void) callBackToH5WithSuccess:(BOOL) isSuccess promptMsg:(NSString *) promptMsg {
- (void) callBackToH5WithSuccess:(BOOL) isSuccess promptMsg:(NSDictionary *) promptDic {
//异常情况处理
[self.webView evaluateJavaScript:[NSString stringWithFormat:@"%@('%d', '%@', '%@')", self.jsFuncName, isSuccess, [ZXTaskManager sharedZXTaskManager].taskCode, promptMsg] completionHandler:^(id _Nullable res, NSError * _Nullable error) {
NSString *taskCode = promptDic[@"additionalTaskCode"]?promptDic[@"additionalTaskCode"]:@"";
NSString *coinAmount = promptDic[@"coinAmount"]?promptDic[@"coinAmount"]:@"";
NSString *isAdditionalVideo = promptDic[@"isAdditionalVideo"]?promptDic[@"isAdditionalVideo"]:@"";
NSString *isPrompt = promptDic[@"isPrompt"]?promptDic[@"isPrompt"]:@"";
NSString *jsStr = [NSString stringWithFormat:@"%@('%d', '%@', '%@', '%@', '%@', '%@', '%@')", self.jsFuncName, isSuccess, [ZXTaskManager sharedZXTaskManager].taskCode, promptDic[@"promptMsg"], taskCode, coinAmount, isAdditionalVideo, isPrompt];
[self.webView evaluateJavaScript:jsStr completionHandler:^(id _Nullable res, NSError * _Nullable error) {
//清空taskid
ZXTaskManager.sharedZXTaskManager.taskCode = @"";
}];
......@@ -1357,15 +1374,11 @@
NSLog(@"%s",__FUNCTION__);
}
#pragma mark - ============腾讯激励视频广告=====================
- (GDTRewardVideoAd *)txRewardVideoAd {
if (!_txRewardVideoAd) {
_txRewardVideoAd = [[GDTRewardVideoAd alloc] initWithAppId:kTXAdAPPID placementId:@"6070699523363484"];
_txRewardVideoAd.delegate = self;
}
return _txRewardVideoAd;
}
#pragma mark - ============显示腾讯激励视频广告=====================
-(void) showTXRewardVideo {
self.txRewardVideoAd = [[GDTRewardVideoAd alloc] initWithAppId:kTXAdAPPID placementId:@"6070699523363484"];
self.txRewardVideoAd.delegate = self;
[self.txRewardVideoAd loadAd];
[ZXTool showLoadingAnimation];
}
......@@ -1412,8 +1425,10 @@
- (void)gdt_rewardVideoAdDidClose:(GDTRewardVideoAd *)rewardedVideoAd
{
NSLog(@"%s",__FUNCTION__);
NSLog(@"广告已关闭");
NSLog(@"腾讯激励视频广告已关闭");
self.txRewardVideoAd.delegate = nil;
self.txRewardVideoAd = nil;
}
......
//
//
......@@ -31,11 +31,14 @@
NSArray *subPaths = [mgr contentsOfDirectoryAtPath:directoryPath error:nil];
for (NSString *subPath in subPaths) {
// 拼接完成全路径
NSString *filePath = [directoryPath stringByAppendingPathComponent:subPath];
// 删除路径
[mgr removeItemAtPath:filePath error:nil];
if (![subPath isEqualToString:@"default"]) {
// 拼接完成全路径
NSString *filePath = [directoryPath stringByAppendingPathComponent:subPath];
// 删除路径
[mgr removeItemAtPath:filePath error:nil];
}
}
}
......@@ -71,6 +74,8 @@
// 判断隐藏文件
if ([filePath containsString:@".DS"]) continue;
//这儿不处理default的内容 (叶敏要请不清理图片)
if ([filePath containsString:@"/Caches/default"]) continue;
// 判断是否文件夹
BOOL isDirectory;
......
{
{
"images" : [
{
"idiom" : "universal",
"filename" : "任务成功.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "任务成功@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "任务成功@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
{
"images" : [
{
"idiom" : "universal",
"filename" : "去提现.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "去提现@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "去提现@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
{
"images" : [
{
"idiom" : "universal",
"filename" : "微信.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "微信@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "微信@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
{
"images" : [
{
"idiom" : "universal",
"filename" : "排行榜.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "排行榜@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "排行榜@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
{
"images" : [
{
"idiom" : "universal",
"filename" : "提现成功.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "提现成功@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "提现成功@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
{
"images" : [
{
"idiom" : "universal",
"filename" : "提示.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "提示@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "提示@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
{
"images" : [
{
"idiom" : "universal",
"filename" : "活动内容.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "活动内容@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "活动内容@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
{
"images" : [
{
"idiom" : "universal",
"filename" : "活动时间.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "活动时间@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "活动时间@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
{
"images" : [
{
"idiom" : "universal",
"filename" : "活动规则.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "活动规则@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "活动规则@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
{
"images" : [
{
"idiom" : "universal",
"filename" : "清除金额.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "清除金额@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "清除金额@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
{
"images" : [
{
"idiom" : "universal",
"filename" : "第一名.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "第一名@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "第一名@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
{
"images" : [
{
"idiom" : "universal",
"filename" : "第三名.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "第三名@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "第三名@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
{
"images" : [
{
"idiom" : "universal",
"filename" : "第二名.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "第二名@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "第二名@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
{
"images" : [
{
"idiom" : "universal",
"filename" : "金币.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "金币@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "金币@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
{
"images" : [
{
"idiom" : "universal",
"filename" : "金币数量.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "金币数量@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "金币数量@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment