Commit 417178a5 authored by Mazy's avatar Mazy

add ranking view

parents 02330ed2 ca3c6021
This diff is collapsed.
...@@ -153,10 +153,10 @@ NSDictionary* appLaunchOpts; ...@@ -153,10 +153,10 @@ NSDictionary* appLaunchOpts;
web.url = WelfareURL; web.url = WelfareURL;
} }
// WelfareCenterVC * vc = [[WelfareCenterVC alloc]init]; WelfareCenterVC * vc = [[WelfareCenterVC alloc]init];
UINavigationController * nav = [[UINavigationController alloc] initWithRootViewController:vc];
UINavigationController * nav = [[UINavigationController alloc] initWithRootViewController:web];
nav.modalPresentationStyle = UIModalPresentationFullScreen; nav.modalPresentationStyle = UIModalPresentationFullScreen;
[[[self ufw] appController].window.rootViewController presentViewController:nav [[[self ufw] appController].window.rootViewController presentViewController:nav
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "OpenTreasureChest@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "OpenTreasureChest@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "TreasureChestClose@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "TreasureChestClose@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "arrow_left@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "arrow_left@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
//
// UIColor+HExtension.h
// ExerciseAnimation
//
// Created by L.mac on 2019/5/10.
// Copyright © 2019 L.mac. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface UIColor (HExtension)
/**
使用 16 进制数字创建颜色,例如 0xFF0000 创建红色
@param hex 16 进制无符号32位整数
@return 颜色
*/
+ (instancetype)colorWithHex:(uint32_t)hex;
/**
产生随机色
@return 随机色
*/
+ (instancetype)randomColor;
/**
支持三种格式颜色字符串@"123456" @"0x123456" @"#123456"输入
@param color 十六进制颜色字符串
@param alpha 透明度
@return Color
*/
+ (UIColor *)colorWithHexString:(NSString *)color alpha:(CGFloat)alpha;
/**
支持三种格式颜色字符串@"123456" @"0x123456" @"#123456"输入
@param color 十六进制颜色字符串
@return Color
*/
+ (UIColor *)colorWithHexString:(NSString *)color;
@end
NS_ASSUME_NONNULL_END
//
// UIColor+HExtension.m
// ExerciseAnimation
//
// Created by L.mac on 2019/5/10.
// Copyright © 2019 L.mac. All rights reserved.
//
#import "UIColor+HExtension.h"
@implementation UIColor (HExtension)
+ (instancetype)colorWithHex:(uint32_t)hex {
int red, green, blue;
blue = hex & 0x000000FF;
green = ((hex & 0x0000FF00) >> 8);
red = ((hex & 0x00FF0000) >> 16);
return [UIColor colorWithRed:red/255.0f
green:green/255.0f
blue:blue/255.0f
alpha:1.0f];
}
+ (instancetype)randomColor {
return [UIColor colorWithRed:((float)arc4random_uniform(256) / 255.0) green:((float)arc4random_uniform(256) / 255.0) blue:((float)arc4random_uniform(256) / 255.0) alpha:1.0];
}
+ (UIColor *)colorWithHexString:(NSString *)color alpha:(CGFloat)alpha{
NSString *cString = [[color stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] uppercaseString];
// String should be 6 or 8 characters
if ([cString length] < 6)
{
return [UIColor clearColor];
}
// strip 0X if it appears
//如果是0x开头的,那么截取字符串,字符串从索引为2的位置开始,一直到末尾
if ([cString hasPrefix:@"0X"])
{
cString = [cString substringFromIndex:2];
}
//如果是#开头的,那么截取字符串,字符串从索引为1的位置开始,一直到末尾
if ([cString hasPrefix:@"#"])
{
cString = [cString substringFromIndex:1];
}
if ([cString length] != 6)
{
return [UIColor clearColor];
}
// Separate into r, g, b substrings
NSRange range;
range.location = 0;
range.length = 2;
//r
NSString *rString = [cString substringWithRange:range];
//g
range.location = 2;
NSString *gString = [cString substringWithRange:range];
//b
range.location = 4;
NSString *bString = [cString substringWithRange:range];
// Scan values
unsigned int r, g, b;
[[NSScanner scannerWithString:rString] scanHexInt:&r];
[[NSScanner scannerWithString:gString] scanHexInt:&g];
[[NSScanner scannerWithString:bString] scanHexInt:&b];
return [UIColor colorWithRed:((float)r / 255.0f) green:((float)g / 255.0f) blue:((float)b / 255.0f) alpha:alpha];
}
+ (UIColor *)colorWithHexString:(NSString *)color{
//默认alpha值为1
return [self colorWithHexString:color alpha:1.0f];
}
@end
...@@ -13,12 +13,17 @@ ...@@ -13,12 +13,17 @@
#ifndef GYPrefixHeader_pch #ifndef GYPrefixHeader_pch
#define GYPrefixHeader_pch #define GYPrefixHeader_pch
//测试
//正式 //#define ServerReport @"http://reporttest.zhangxinhulian.com"
//#define ServerHost @"http://feedapitest2.zhangxinhulian.com" // 服务端接口地址
//#define ServerAds @"http://bstest.zhangxinhulian.com/v4/ads"
////正式
#define ServerReport @"http://report.clouddistribute.net" #define ServerReport @"http://report.clouddistribute.net"
#define ServerHost @"https://feedapi.clouddistribute.net" // 服务端接口地址 #define ServerHost @"https://feedapi.clouddistribute.net" // 服务端接口地址
#define ServerAds @"http://bs.clouddistribute.net/v4/ads" #define ServerAds @"http://bs.clouddistribute.net/v4/ads"
#define WXAppId @"wxe7a03eb52cce1b51" #define WXAppId @"wxe7a03eb52cce1b51"
#define WXAppSecret @"6fa72a89ea188c4dff5729cff328b587" #define WXAppSecret @"6fa72a89ea188c4dff5729cff328b587"
#define WXUniversalLink @"https://feedapi.clouddistribute.net/LuckFarm/" #define WXUniversalLink @"https://feedapi.clouddistribute.net/LuckFarm/"
...@@ -100,6 +105,14 @@ ...@@ -100,6 +105,14 @@
#import "IOSADManager.h" //AD #import "IOSADManager.h" //AD
#pragma mark - base
#import "BaseViewController.h"
#pragma mark - pod
#import <Masonry/Masonry.h>
#pragma mark - 分类
#import "UIView+HExtension.h"
#import "UIColor+HExtension.h"
//奖励类型 1 水滴 2 果子 3 种子 4 金币 5 加速剂 6 红包 //奖励类型 1 水滴 2 果子 3 种子 4 金币 5 加速剂 6 红包
typedef enum : NSUInteger { typedef enum : NSUInteger {
......
...@@ -24,6 +24,10 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -24,6 +24,10 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, assign) NSInteger targetNum; @property (nonatomic, assign) NSInteger targetNum;
@property (nonatomic, copy) NSString * url; @property (nonatomic, copy) NSString * url;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
...@@ -45,10 +45,8 @@ typedef enum : NSUInteger { ...@@ -45,10 +45,8 @@ typedef enum : NSUInteger {
task_process,// 获取福利中心进度 task_process,// 获取福利中心进度
taskListWithStat,//获取福利中心列表和状态 taskListWithStat,//获取福利中心列表和状态
rank_list, //排行榜 rank_list, //排行榜
ddcy_clock_list, //打卡提现-列表
//
} TQNetwortGetAction; } TQNetwortGetAction;
// POST请求动作枚举 // POST请求动作枚举
...@@ -79,7 +77,12 @@ typedef enum : NSUInteger { ...@@ -79,7 +77,12 @@ typedef enum : NSUInteger {
awardMultiple, //领取翻倍奖励v3 awardMultiple, //领取翻倍奖励v3
adForcePost, // 取消视频播放回调 adForcePost, // 取消视频播放回调
welfareVideoReport, //福利任务--激励视频任务完成 welfareVideoReport, //福利任务--激励视频任务完成
cash2Coin cash2Coin, //
complete_task, // 领取任务奖励 福利中心
clock_wd, //打卡提xian - tixian
welfare_task_box,//打开宝箱 福利中心
} TQNetwortPostAction; } TQNetwortPostAction;
......
...@@ -88,12 +88,14 @@ static CGNetworkTools* _tools = nil; ...@@ -88,12 +88,14 @@ static CGNetworkTools* _tools = nil;
return @"/app/v1/game/farm/rp_list"; return @"/app/v1/game/farm/rp_list";
case cloudCheck: case cloudCheck:
return @"/app/v1/game/farm/cloud_check"; return @"/app/v1/game/farm/cloud_check";
case task_process:
return @"/app/v2/novel/taskListWithStat";
case taskListWithStat: case taskListWithStat:
return @"/app/v2/novel/taskListWithStat";
case task_process:
return @"/app/v1/game/task_process"; return @"/app/v1/game/task_process";
case rank_list: case rank_list:
return @"/app/v1/game/farm/rank_list"; return @"/app/v1/game/farm/rank_list";
case ddcy_clock_list:
return @"/app/v1/game/ddcy/clock_list";
default: default:
return @""; return @"";
} }
...@@ -152,6 +154,12 @@ static CGNetworkTools* _tools = nil; ...@@ -152,6 +154,12 @@ static CGNetworkTools* _tools = nil;
return @"/app/v1/game/welfare_video_report"; return @"/app/v1/game/welfare_video_report";
case cash2Coin: case cash2Coin:
return @"/app/v1/game/farm/cash2Coin"; return @"/app/v1/game/farm/cash2Coin";
case complete_task:
return @"/app/v1/game/complete-task";
case clock_wd:
return @"/app/v1/game/ddcy/clock_wd";
case welfare_task_box:
return @"/app/v1/game/farm/welfare_task_box";
default: default:
return @""; return @"";
} }
...@@ -162,8 +170,9 @@ static CGNetworkTools* _tools = nil; ...@@ -162,8 +170,9 @@ static CGNetworkTools* _tools = nil;
// GET 请求 // GET 请求
- (void)getWithAction: (TQNetwortGetAction)action parameters:(id)parameters success: (void(^)(id response))success failure:(void(^)(NSError * error)) failure{ - (void)getWithAction: (TQNetwortGetAction)action parameters:(id)parameters success: (void(^)(id response))success failure:(void(^)(NSError * error)) failure{
// get 请求 // get 请求
NSString *urlString = [ServerHost stringByAppendingPathComponent: [self convertGetActionToString:action]];
// NSString *urlString = [ServerHost stringByAppendingPathComponent: [self convertGetActionToString:action]];
NSString *urlString = [ServerHost stringByAppendingString:[self convertGetActionToString:action]];
NSDictionary *params = [self setRequestParams: parameters]; NSDictionary *params = [self setRequestParams: parameters];
[self GET: urlString parameters: params headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { [self GET: urlString parameters: params headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
......
//
// GYRankingFooterView.h
// GYDemo
//
// Created by Mazy on 2020/11/20.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface GYRankingFooterView : UIView
@end
NS_ASSUME_NONNULL_END
//
// GYRankingFooterView.m
// GYDemo
//
// Created by Mazy on 2020/11/20.
//
#import "GYRankingFooterView.h"
@implementation GYRankingFooterView
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="414" height="99"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="140.57971014492756" y="-173.10267857142856"/>
</view>
</objects>
<resources>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
...@@ -19,6 +19,8 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -19,6 +19,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (weak, nonatomic) IBOutlet UILabel *diamondLabel; @property (weak, nonatomic) IBOutlet UILabel *diamondLabel;
@property (weak, nonatomic) IBOutlet UIView *bottomView;
- (void)configWithRankingListModel: (GYRankingListModel *)model; - (void)configWithRankingListModel: (GYRankingListModel *)model;
@end @end
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#import "GYRankingViewCell.h" #import "GYRankingViewCell.h"
#import <AFNetworking/AFNetworking.h> #import <AFNetworking/AFNetworking.h>
#import <UIImageView+AFNetworking.h> #import <UIImageView+AFNetworking.h>
#import "UIView+DHExtension.h"
@implementation GYRankingViewCell @implementation GYRankingViewCell
- (void)configWithRankingListModel: (GYRankingListModel *)model { - (void)configWithRankingListModel: (GYRankingListModel *)model {
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
- (void)awakeFromNib { - (void)awakeFromNib {
[super awakeFromNib]; [super awakeFromNib];
// Initialization code // Initialization code
// [self.bottomView roundCorners: UIRectCornerBottomLeft | UIRectCornerBottomRight radius:15];
// self.bottomView.layer.bo
} }
- (void)setSelected:(BOOL)selected animated:(BOOL)animated { - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
......
This diff is collapsed.
//
// ESViewController.h
// easysleep
//
// Created by Mazy on 2020/9/8.
// Copyright © 2020 easy sleep. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface BaseViewController : UIViewController
@property (nonatomic,retain)UIImage * backImage;
@property (nonatomic ,assign)BOOL isMember;
//隐藏线
- (void)navbarClearShadow;
- (void)navbarHiddenAanimated:(BOOL)isAnimated;
- (void)navbarShowAanimated:(BOOL)isAnimated;
//添加左侧按钮
- (void)addLeftItme:(UIImage * __nullable)image selecedImage:(UIImage * __nullable)sImage orText:(NSString * __nullable)text selectedText:(NSString * __nullable)sText;
- (void)leftBarButtonItemAction:(UIButton *)btn;
//添加右侧按钮
- (void)addRightItme:(UIImage * __nullable)image selecedImage:(UIImage * __nullable)sImage orText:(NSString * __nullable)text selectedText:(NSString * __nullable)sText;
- (void)rightBarButtonItemAction:(UIButton *)btn;
@end
NS_ASSUME_NONNULL_END
//
// BaseViewController.m
// easysleep
//
// Created by Mazy on 2020/9/8.
// Copyright © 2020 easy sleep. All rights reserved.
//
#import "BaseViewController.h"
@interface BaseViewController ()
@property (nonatomic ,retain)UIButton * rightButton;
@property (nonatomic ,retain)UIButton * leftButton;
@end
@implementation BaseViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.navigationController.navigationBar.translucent=NO;
self.navigationController.navigationBar.barTintColor=[UIColor colorWithHexString:@"#F7BD7C"];
[self navbarSetWhiteTitle];
[self setStatusBarWhite];
[self.navigationController.navigationBar setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:20],NSForegroundColorAttributeName:[UIColor colorWithHexString:@"#333333"]}];
UIImageView * imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
imageView.layer.masksToBounds = YES;
imageView.image = [UIImage imageNamed:@"homebackImage"];
imageView.contentMode = UIViewContentModeScaleAspectFill;
[self.view addSubview:imageView];
[self.view sendSubviewToBack:imageView];
// self.view.backgroundColor = [UIColor colorWithPatternImage:imageView.image];
// 老版本scrollview自动下移(消除警告)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated"
self.automaticallyAdjustsScrollViewInsets = NO;
#pragma clang diagnostic pop
// 设置CGRectZero从导航栏下开始计算
if ([self respondsToSelector:@selector(setEdgesForExtendedLayout:)])
{
self.edgesForExtendedLayout = UIRectEdgeNone;
}
}
- (void)dealloc{
NSLog(@"%@ ----dealloc",self);
}
-(BOOL)isMember{
#ifdef DEBUG
return true;
#else
return true;
// return [[HKAccountManager shared] isMember];
#endif
}
- (void)setStatusBarWhite{
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
}
- (void)navbarSetWhiteTitle{
[self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
self.navigationController.navigationBar.tintColor=[UIColor whiteColor];
}
- (void)navbarClearShadow{
[self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
[self.navigationController.navigationBar setShadowImage:[UIImage new]];
}
- (void)navbarHiddenAanimated:(BOOL)isAnimated{
[self.navigationController setNavigationBarHidden:YES animated:isAnimated];
}
- (void)navbarShowAanimated:(BOOL)isAnimated{
[self.navigationController setNavigationBarHidden:NO animated:isAnimated];
}
//添加左侧按钮
- (void)addLeftItme:(UIImage * __nullable)image selecedImage:(UIImage * __nullable)sImage orText:(NSString * __nullable)text selectedText:(NSString * __nullable)sText{
self.leftButton = [[UIButton alloc] init];
if (image == nil) {
if (text == nil) {
text = @"传入文本";
}
if (sText == nil) {
sText = text;
}
[self.leftButton setTitle: text forState:UIControlStateNormal];
[self.leftButton setTitle: sText forState:UIControlStateSelected];
[self.leftButton setTitleColor:[UIColor whiteColor] forState: UIControlStateNormal];
self.leftButton.titleLabel.font = [UIFont systemFontOfSize:17];
}else{
if (sImage == nil) {
sImage = image;
}
[self.leftButton setImage:image forState:UIControlStateNormal];
[self.leftButton setImage: sImage forState:UIControlStateSelected];
if (text != nil) {
[self.leftButton setTitle: text forState:UIControlStateNormal];
}
}
[self.leftButton addTarget:self action: @selector(leftBarButtonItemAction:) forControlEvents:UIControlEventTouchUpInside];
[self.leftButton sizeToFit];
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView: self.leftButton];
}
- (void)leftBarButtonItemAction:(UIButton *)btn{
btn.selected = !btn.isSelected;
NSLog(@"leftButton click");
}
//添加右侧按钮
- (void)addRightItme:(UIImage * __nullable)image selecedImage:(UIImage * __nullable)sImage orText:(NSString * __nullable)text selectedText:(NSString * __nullable)sText{
self.rightButton = [[UIButton alloc] init];
if (image == nil) {
if (text == nil) {
text = @"传入文本";
}
if (sText == nil) {
sText = text;
}
[self.rightButton setTitle: text forState:UIControlStateNormal];
[self.rightButton setTitle: sText forState:UIControlStateSelected];
[self.rightButton setTitleColor:[UIColor whiteColor] forState: UIControlStateNormal];
self.rightButton.titleLabel.font = [UIFont systemFontOfSize:17];
}else{
if (sImage == nil) {
sImage = image;
}
[self.rightButton setImage:image forState:UIControlStateNormal];
[self.rightButton setImage: sImage forState:UIControlStateSelected];
}
[self.rightButton addTarget:self action: @selector(rightBarButtonItemAction:) forControlEvents:UIControlEventTouchUpInside];
[self.rightButton sizeToFit];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView: self.rightButton];
}
- (void)rightBarButtonItemAction:(UIButton *)btn{
btn.selected = !btn.isSelected;
NSLog(@"rightButton click");
}
@end
//
// ClockInVC.h
// GYDemo
// 打卡页
// Created by zhangshuai on 2020/11/19.
//
#import "BaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface ClockInVC : BaseViewController
@end
NS_ASSUME_NONNULL_END
//
// ClockInVC.m
// GYDemo
//
// Created by zhangshuai on 2020/11/19.
//
#import "ClockInVC.h"
@interface ClockInVC ()
@end
@implementation ClockInVC
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13142" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12042"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ClockInVC">
<connections>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<viewLayoutGuide key="safeArea" id="Q5M-cg-NOt"/>
</view>
</objects>
</document>
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
self.tableView.delegate = self; self.tableView.delegate = self;
self.tableView.dataSource = self; self.tableView.dataSource = self;
self.tableView.rowHeight = 70; self.tableView.rowHeight = 70;
self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 100, 0); self.tableView.contentInset = UIEdgeInsetsMake(0, 0, SafeAreaBottomHeight + 30.0, 0);
self.tableView.showsVerticalScrollIndicator = false; self.tableView.showsVerticalScrollIndicator = false;
self.tableView.backgroundColor = [UIColor colorWithHex:0xF7EAC5]; self.tableView.backgroundColor = [UIColor colorWithHex:0xF7EAC5];
self.tableView.separatorStyle = UITableViewCellSelectionStyleNone; self.tableView.separatorStyle = UITableViewCellSelectionStyleNone;
...@@ -102,6 +102,10 @@ ...@@ -102,6 +102,10 @@
return self.rankList.count; return self.rankList.count;
} }
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return indexPath.row == (self.rankList.count - 1) ? 120 : 70;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
return 50; return 50;
} }
...@@ -113,7 +117,7 @@ ...@@ -113,7 +117,7 @@
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
GYRankingViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"GYRankingViewCell"]; GYRankingViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"GYRankingViewCell"];
[cell configWithRankingListModel:self.rankList[indexPath.row]]; [cell configWithRankingListModel: self.rankList[indexPath.row]];
return cell; return cell;
} }
......
//
// WelfareCenterCell.h
// GYDemo
//
// Created by zhangshuai on 2020/11/17.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface WelfareCenterCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UILabel *title;
@property (weak, nonatomic) IBOutlet UILabel *subTitle;
@property (weak, nonatomic) IBOutlet UIButton *awardNum;
@property (weak, nonatomic) IBOutlet UIButton *buttonState;
- (IBAction)stateButtonClick:(UIButton *)sender;
@property (nonatomic ,copy) void (^buttonBlock)(WelfareCenterCell * thisCell);
@property (nonatomic ,assign)NSInteger status; // 按钮状态
@end
NS_ASSUME_NONNULL_END
//
// WelfareCenterCell.m
// GYDemo
//
// Created by zhangshuai on 2020/11/17.
//
#import "WelfareCenterCell.h"
@implementation WelfareCenterCell
- (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
}
- (void)setStatus:(NSInteger)status{
//0 : 去完成 1: 明日再来 2: 立即领取
_status = status;
if (status == 0) {
[self.buttonState setTitle:@"去完成" forState:UIControlStateNormal];
[self.buttonState setBackgroundImage:[UIImage imageNamed:@"ToFinishRed"] forState:UIControlStateNormal];
}else if(status == 1){
[self.buttonState setTitle:@"明日再来" forState:UIControlStateNormal];
[self.buttonState setBackgroundImage:[UIImage imageNamed:@"CollectedGrey"] forState:UIControlStateNormal];
}else if (status == 2){
[self.buttonState setTitle:@"立即领取" forState:UIControlStateNormal];
[self.buttonState setBackgroundImage:[UIImage imageNamed:@"GetItNow"] forState:UIControlStateNormal];
}else{
[self.buttonState setTitle:@"明日再来" forState:UIControlStateNormal];
[self.buttonState setBackgroundImage:[UIImage imageNamed:@"CollectedGrey"] forState:UIControlStateNormal];
}
}
- (IBAction)stateButtonClick:(UIButton *)sender {
if (self.buttonBlock) {
self.buttonBlock(self);
}
}
@end
This diff is collapsed.
//
// WelfareCenterVC.h
// GYDemo
//
// Created by zhangshuai on 2020/11/17.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface WelfareCenterVC : BaseViewController
@end
NS_ASSUME_NONNULL_END
This diff is collapsed.
This diff is collapsed.
//
// WelfareCenterData.h
// GYDemo
// 福利中心任务列表
// Created by zhangshuai on 2020/11/19.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface WelfareCenterData : NSObject
@property (nonatomic, copy) NSString * adType; // adType = 1;
@property (nonatomic, copy) NSString * alertRenderType;
@property (nonatomic, copy) NSString * awardCoins;
@property (nonatomic, copy) NSString * awardDesc;
@property (nonatomic, copy) NSString * awardLimit;
@property (nonatomic, copy) NSString * awardParticle;
@property (nonatomic, copy) NSString * awardRenderType;
@property (nonatomic, copy) NSString * awardType;
@property (nonatomic, retain) NSArray * big_images;
@property (nonatomic, copy) NSString * browserCore;
@property (nonatomic, copy) NSString * buttonText; // buttonText = "去观看";
@property (nonatomic, copy) NSString * coins;
@property (nonatomic, copy) NSString * cornerText;
@property (nonatomic, copy) NSString * cpmPrice;
@property (nonatomic, copy) NSString * current_nums;
@property (nonatomic, copy) NSString * desc; // desc = "总可得1金币";
@property (nonatomic, copy) NSString * description_Content; // description = "看完视频即可得金币";
@property (nonatomic, copy) NSString * explorerType;
@property (nonatomic, copy) NSString * ext;
@property (nonatomic, copy) NSString * ifTop;
@property (nonatomic, copy) NSString * image_render_type;
@property (nonatomic, copy) NSString * images;
@property (nonatomic, retain) NSArray * imp_tracking;
@property (nonatomic, retain) NSArray * clk_tracking;
@property (nonatomic, copy) NSString * incentive_level;
@property (nonatomic, copy) NSString * label; // label = "广告";
@property (nonatomic, copy) NSString * opentype;
@property (nonatomic, copy) NSString * pk;
@property (nonatomic, copy) NSString * redPacketFlag;
@property (nonatomic, copy) NSString * reqId;
@property (nonatomic, copy) NSString * sdkShowTimes;
@property (nonatomic, copy) NSString * shareType;
@property (nonatomic, copy) NSString * sid; // 应该是任务ID
@property (nonatomic, copy) NSString * slotName;
@property (nonatomic, copy) NSString * slot_ad_type;
@property (nonatomic, copy) NSString * slot_id;
@property (nonatomic, assign) NSInteger status; //0 : 去完成 1: 明日再来 2: 立即领取
@property (nonatomic, copy) NSString * timeTrigger;
@property (nonatomic, copy) NSString * title; // title = "领今日视频金币";
@property (nonatomic, copy) NSString * type;
@end
NS_ASSUME_NONNULL_END
//
// WelfareCenterData.m
// GYDemo
// 福利中心任务列表
// Created by zhangshuai on 2020/11/19.
//
#import "WelfareCenterData.h"
@implementation WelfareCenterData
+ (NSDictionary *)mj_replacedKeyFromPropertyName{
return @{
@"description_Content" : @"description"//前边的是你想用的key,后边的是返回的key
};
}
@end
...@@ -41,7 +41,7 @@ target 'GYDemo' do ...@@ -41,7 +41,7 @@ target 'GYDemo' do
# 3. 腾讯广告|优量汇(广点通) #"guangdiantong" //广点通 -- # 3. 腾讯广告|优量汇(广点通) #"guangdiantong" //广点通 --
pod 'GDTMobSDK' pod 'GDTMobSDK'
# 4.AD SDK - chuanshanjia" //穿山甲 -- # 4.AD SDK - chuanshanjia" //穿山甲 --头条
pod 'Bytedance-UnionAD' pod 'Bytedance-UnionAD'
end end
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