Commit 01f32ebc authored by zhangshuai's avatar zhangshuai

修改福利中心为 原生

parent e8334ec9
......@@ -23,6 +23,16 @@
686352082563E0E400F7BAD3 /* WelfareCenterVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 686352062563E0E400F7BAD3 /* WelfareCenterVC.xib */; };
686352292563E26900F7BAD3 /* WelfareCenterCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 686352272563E26900F7BAD3 /* WelfareCenterCell.m */; };
6863522A2563E26900F7BAD3 /* WelfareCenterCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 686352282563E26900F7BAD3 /* WelfareCenterCell.xib */; };
6882AD002566A68A008CF1F3 /* ClockInVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 6882ACFE2566A68A008CF1F3 /* ClockInVC.m */; };
6882AD012566A68A008CF1F3 /* ClockInVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6882ACFF2566A68A008CF1F3 /* ClockInVC.xib */; };
68A81D192566461A003C1BF1 /* UIView+AdaptScreen.m in Sources */ = {isa = PBXBuildFile; fileRef = 68A81D102566461A003C1BF1 /* UIView+AdaptScreen.m */; };
68A81D1A2566461A003C1BF1 /* UIView+WHView.m in Sources */ = {isa = PBXBuildFile; fileRef = 68A81D112566461A003C1BF1 /* UIView+WHView.m */; };
68A81D1B2566461A003C1BF1 /* ESLyhXibView.m in Sources */ = {isa = PBXBuildFile; fileRef = 68A81D142566461A003C1BF1 /* ESLyhXibView.m */; };
68A81D1C2566461A003C1BF1 /* UIView+DHExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = 68A81D162566461A003C1BF1 /* UIView+DHExtension.m */; };
68A81D1D2566461A003C1BF1 /* UIColor+HExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = 68A81D172566461A003C1BF1 /* UIColor+HExtension.m */; };
68A81D1E2566461A003C1BF1 /* UIView+HExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = 68A81D182566461A003C1BF1 /* UIView+HExtension.m */; };
68A81D34256647AB003C1BF1 /* BaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 68A81D33256647AB003C1BF1 /* BaseViewController.m */; };
68A81D4E25664F29003C1BF1 /* WelfareCenterData.m in Sources */ = {isa = PBXBuildFile; fileRef = 68A81D4D25664F29003C1BF1 /* WelfareCenterData.m */; };
6E42AF336D54EF2C5073BB5C /* Pods_GYDemo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 917ED4A8EF1F82D94F8A8E38 /* Pods_GYDemo.framework */; };
A91A7879253EE56B00F9B216 /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = A91A7878253EE56B00F9B216 /* AppDelegate.mm */; };
A91A7882253EE56B00F9B216 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A91A7880253EE56B00F9B216 /* Main.storyboard */; };
......@@ -142,6 +152,25 @@
686352262563E26900F7BAD3 /* WelfareCenterCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WelfareCenterCell.h; sourceTree = "<group>"; };
686352272563E26900F7BAD3 /* WelfareCenterCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WelfareCenterCell.m; sourceTree = "<group>"; };
686352282563E26900F7BAD3 /* WelfareCenterCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WelfareCenterCell.xib; sourceTree = "<group>"; };
6882ACFD2566A68A008CF1F3 /* ClockInVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ClockInVC.h; sourceTree = "<group>"; };
6882ACFE2566A68A008CF1F3 /* ClockInVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ClockInVC.m; sourceTree = "<group>"; };
6882ACFF2566A68A008CF1F3 /* ClockInVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ClockInVC.xib; sourceTree = "<group>"; };
68A81D0C2566461A003C1BF1 /* UIView+HExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+HExtension.h"; sourceTree = "<group>"; };
68A81D0D2566461A003C1BF1 /* UIColor+HExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIColor+HExtension.h"; sourceTree = "<group>"; };
68A81D0E2566461A003C1BF1 /* UIView+DHExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+DHExtension.h"; sourceTree = "<group>"; };
68A81D102566461A003C1BF1 /* UIView+AdaptScreen.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+AdaptScreen.m"; sourceTree = "<group>"; };
68A81D112566461A003C1BF1 /* UIView+WHView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+WHView.m"; sourceTree = "<group>"; };
68A81D122566461A003C1BF1 /* ESLyhXibView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ESLyhXibView.h; sourceTree = "<group>"; };
68A81D132566461A003C1BF1 /* UIView+AdaptScreen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+AdaptScreen.h"; sourceTree = "<group>"; };
68A81D142566461A003C1BF1 /* ESLyhXibView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ESLyhXibView.m; sourceTree = "<group>"; };
68A81D152566461A003C1BF1 /* UIView+WHView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+WHView.h"; sourceTree = "<group>"; };
68A81D162566461A003C1BF1 /* UIView+DHExtension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+DHExtension.m"; sourceTree = "<group>"; };
68A81D172566461A003C1BF1 /* UIColor+HExtension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIColor+HExtension.m"; sourceTree = "<group>"; };
68A81D182566461A003C1BF1 /* UIView+HExtension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+HExtension.m"; sourceTree = "<group>"; };
68A81D32256647AB003C1BF1 /* BaseViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseViewController.h; sourceTree = "<group>"; };
68A81D33256647AB003C1BF1 /* BaseViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BaseViewController.m; sourceTree = "<group>"; };
68A81D4C25664F29003C1BF1 /* WelfareCenterData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WelfareCenterData.h; sourceTree = "<group>"; };
68A81D4D25664F29003C1BF1 /* WelfareCenterData.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WelfareCenterData.m; sourceTree = "<group>"; };
917ED4A8EF1F82D94F8A8E38 /* Pods_GYDemo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_GYDemo.framework; sourceTree = BUILT_PRODUCTS_DIR; };
A91A7874253EE56B00F9B216 /* GYDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GYDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
A91A7877253EE56B00F9B216 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
......@@ -312,6 +341,66 @@
path = model;
sourceTree = "<group>";
};
6882ACFB2566A61E008CF1F3 /* Welfare */ = {
isa = PBXGroup;
children = (
6882AD062566A6FD008CF1F3 /* model */,
686352042563E0E400F7BAD3 /* WelfareCenterVC.h */,
686352052563E0E400F7BAD3 /* WelfareCenterVC.m */,
686352062563E0E400F7BAD3 /* WelfareCenterVC.xib */,
686352262563E26900F7BAD3 /* WelfareCenterCell.h */,
686352272563E26900F7BAD3 /* WelfareCenterCell.m */,
686352282563E26900F7BAD3 /* WelfareCenterCell.xib */,
);
path = Welfare;
sourceTree = "<group>";
};
6882ACFC2566A63D008CF1F3 /* ClockIn */ = {
isa = PBXGroup;
children = (
6882ACFD2566A68A008CF1F3 /* ClockInVC.h */,
6882ACFE2566A68A008CF1F3 /* ClockInVC.m */,
6882ACFF2566A68A008CF1F3 /* ClockInVC.xib */,
);
path = ClockIn;
sourceTree = "<group>";
};
6882AD062566A6FD008CF1F3 /* model */ = {
isa = PBXGroup;
children = (
68A81D4C25664F29003C1BF1 /* WelfareCenterData.h */,
68A81D4D25664F29003C1BF1 /* WelfareCenterData.m */,
);
path = model;
sourceTree = "<group>";
};
68A81D0B2566461A003C1BF1 /* category */ = {
isa = PBXGroup;
children = (
68A81D0D2566461A003C1BF1 /* UIColor+HExtension.h */,
68A81D172566461A003C1BF1 /* UIColor+HExtension.m */,
68A81D0F2566461A003C1BF1 /* UIView */,
68A81D0E2566461A003C1BF1 /* UIView+DHExtension.h */,
68A81D162566461A003C1BF1 /* UIView+DHExtension.m */,
68A81D0C2566461A003C1BF1 /* UIView+HExtension.h */,
68A81D182566461A003C1BF1 /* UIView+HExtension.m */,
);
path = category;
sourceTree = "<group>";
};
68A81D0F2566461A003C1BF1 /* UIView */ = {
isa = PBXGroup;
children = (
68A81D102566461A003C1BF1 /* UIView+AdaptScreen.m */,
68A81D112566461A003C1BF1 /* UIView+WHView.m */,
68A81D122566461A003C1BF1 /* ESLyhXibView.h */,
68A81D132566461A003C1BF1 /* UIView+AdaptScreen.h */,
68A81D142566461A003C1BF1 /* ESLyhXibView.m */,
68A81D152566461A003C1BF1 /* UIView+WHView.h */,
);
path = UIView;
sourceTree = "<group>";
};
A3BE8AD6E326D640425E6E5A /* Frameworks */ = {
isa = PBXGroup;
children = (
......@@ -349,6 +438,7 @@
A91A7876253EE56B00F9B216 /* GYDemo */ = {
isa = PBXGroup;
children = (
68A81D0B2566461A003C1BF1 /* category */,
A9F5CF402546728E0035F17B /* GYDemo.entitlements */,
A91A7877253EE56B00F9B216 /* AppDelegate.h */,
A91A7878253EE56B00F9B216 /* AppDelegate.mm */,
......@@ -547,6 +637,10 @@
A9AB9DE22541CA3800F0D766 /* ViewController */ = {
isa = PBXGroup;
children = (
68A81D32256647AB003C1BF1 /* BaseViewController.h */,
68A81D33256647AB003C1BF1 /* BaseViewController.m */,
6882ACFC2566A63D008CF1F3 /* ClockIn */,
6882ACFB2566A61E008CF1F3 /* Welfare */,
A91A7917253EF26700F9B216 /* GYWheelSurfViewController.h */,
A91A7918253EF26700F9B216 /* GYWheelSurfViewController.m */,
A91A7995253FDEFD00F9B216 /* GYSettingViewController.h */,
......@@ -556,12 +650,6 @@
A9F5CFEF254850340035F17B /* GYLoginViewController.h */,
A9F5CFF0254850340035F17B /* GYLoginViewController.m */,
A91A791D253EF29B00F9B216 /* GYNative.storyboard */,
686352042563E0E400F7BAD3 /* WelfareCenterVC.h */,
686352052563E0E400F7BAD3 /* WelfareCenterVC.m */,
686352062563E0E400F7BAD3 /* WelfareCenterVC.xib */,
686352262563E26900F7BAD3 /* WelfareCenterCell.h */,
686352272563E26900F7BAD3 /* WelfareCenterCell.m */,
686352282563E26900F7BAD3 /* WelfareCenterCell.xib */,
);
path = ViewController;
sourceTree = "<group>";
......@@ -685,6 +773,7 @@
64022D60255D6B8700513333 /* GYCashSixAwardAlertView.xib in Resources */,
A91A7887253EE56D00F9B216 /* LaunchScreen.storyboard in Resources */,
A9AB9D7225403E6B00F0D766 /* GYTaskCell.xib in Resources */,
6882AD012566A68A008CF1F3 /* ClockInVC.xib in Resources */,
A9AB9D62254039FD00F0D766 /* GYTaskAlertView.xib in Resources */,
6863522A2563E26900F7BAD3 /* WelfareCenterCell.xib in Resources */,
A93AF227254AB23E002E8CBE /* GYCountDownTimeView.xib in Resources */,
......@@ -796,8 +885,12 @@
A91A7879253EE56B00F9B216 /* AppDelegate.mm in Sources */,
A9AB9D7B254046CB00F0D766 /* WTProgressView.m in Sources */,
A91A7944253F0BBA00F9B216 /* GYSignInModel.m in Sources */,
68A81D1A2566461A003C1BF1 /* UIView+WHView.m in Sources */,
A91A78F2253EE87500F9B216 /* AESCipher.m in Sources */,
A91A7997253FDEFD00F9B216 /* GYSettingViewController.m in Sources */,
68A81D192566461A003C1BF1 /* UIView+AdaptScreen.m in Sources */,
68A81D1C2566461A003C1BF1 /* UIView+DHExtension.m in Sources */,
6882AD002566A68A008CF1F3 /* ClockInVC.m in Sources */,
A91A794E253F14C300F9B216 /* LaunchScreenPlaceHolderVC.m in Sources */,
686352292563E26900F7BAD3 /* WelfareCenterCell.m in Sources */,
64F8967F255FABB800AF9AD7 /* AddCSJADManager.m in Sources */,
......@@ -805,14 +898,17 @@
64F89680255FABB800AF9AD7 /* AddRuiShiADManager.m in Sources */,
A9AB9D842540672D00F0D766 /* GYDayTaskModel.m in Sources */,
A91A7902253EE8E300F9B216 /* KeychainItemManager.m in Sources */,
68A81D1B2566461A003C1BF1 /* ESLyhXibView.m in Sources */,
A93AF23A254AD071002E8CBE /* RingView.m in Sources */,
A91A7903253EE8E300F9B216 /* Data.m in Sources */,
A9AB9D7A254046CB00F0D766 /* ProgressView.m in Sources */,
A91A78F3253EE87500F9B216 /* CGNetworkTools.m in Sources */,
A91A7963253F192A00F9B216 /* GYRedPacketView.m in Sources */,
A91A78D5253EE75500F9B216 /* CGUserManager.m in Sources */,
68A81D34256647AB003C1BF1 /* BaseViewController.m in Sources */,
A9AB9D7125403E6B00F0D766 /* GYTaskCell.m in Sources */,
A91A79A1253FE25A00F9B216 /* GYSettingCell.m in Sources */,
68A81D1D2566461A003C1BF1 /* UIColor+HExtension.m in Sources */,
A91A79C5254024A400F9B216 /* GYOrderInfoModel.m in Sources */,
A91A79B22540199800F9B216 /* GYOrderAlertView.m in Sources */,
A91A79AB25400BAD00F9B216 /* GYGiftCell.m in Sources */,
......@@ -827,11 +923,13 @@
A91A7988253F310D00F9B216 /* GYOpenBoxModel.m in Sources */,
A9AB9DCC2541C3AA00F0D766 /* GYBaseModel.m in Sources */,
A9AB9D5D254039EE00F0D766 /* GYTaskAlertView.m in Sources */,
68A81D1E2566461A003C1BF1 /* UIView+HExtension.m in Sources */,
64F89682255FABB800AF9AD7 /* IOSADManager.m in Sources */,
64F89683255FABB800AF9AD7 /* GYAdsTrackMode.m in Sources */,
A91A7913253EEF5100F9B216 /* GYWheelSurfModel.m in Sources */,
686352072563E0E400F7BAD3 /* WelfareCenterVC.m in Sources */,
64F8967E255FABB800AF9AD7 /* AddSigmobADManager.m in Sources */,
68A81D4E25664F29003C1BF1 /* WelfareCenterData.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......
......@@ -144,10 +144,10 @@ NSDictionary* appLaunchOpts;
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;
[[[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
}
}
......@@ -13,11 +13,16 @@
#ifndef GYPrefixHeader_pch
#define GYPrefixHeader_pch
//测试
#define ServerReport @"http://reporttest.zhangxinhulian.com"
#define ServerHost @"https://feedapitest.zhangxinhulian.com" // 服务端接口地址
#define ServerAds @"http://bstest.zhangxinhulian.com/v4/ads"
////正式
//#define ServerReport @"http://report.clouddistribute.net"
//#define ServerHost @"https://feedapi.clouddistribute.net" // 服务端接口地址
//#define ServerAds @"http://bs.clouddistribute.net/v4/ads"
//正式
#define ServerReport @"http://report.clouddistribute.net"
#define ServerHost @"https://feedapi.clouddistribute.net" // 服务端接口地址
#define ServerAds @"http://bs.clouddistribute.net/v4/ads"
#define WXAppId @"wxe7a03eb52cce1b51"
#define WXAppSecret @"6fa72a89ea188c4dff5729cff328b587"
......@@ -99,6 +104,14 @@
#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 红包
typedef enum : NSUInteger {
......
......@@ -24,6 +24,10 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, assign) NSInteger targetNum;
@property (nonatomic, copy) NSString * url;
@end
NS_ASSUME_NONNULL_END
......@@ -44,6 +44,9 @@ typedef enum : NSUInteger {
cloudCheck, //云朵加速校验
task_process,// 获取福利中心进度
taskListWithStat,//获取福利中心列表和状态
welfare_task_box,//打开宝箱 福利中心
ddcy_clock_list, //打卡提现-列表
//
......@@ -78,7 +81,11 @@ typedef enum : NSUInteger {
awardMultiple, //领取翻倍奖励v3
adForcePost, // 取消视频播放回调
welfareVideoReport, //福利任务--激励视频任务完成
cash2Coin
cash2Coin, //
complete_task, // 领取任务奖励 福利中心
clock_wd, //打卡提xian - tixian
} TQNetwortPostAction;
......
......@@ -88,11 +88,15 @@ static CGNetworkTools* _tools = nil;
return @"/app/v1/game/farm/rp_list";
case cloudCheck:
return @"/app/v1/game/farm/cloud_check";
case task_process:
return @"/app/v2/novel/taskListWithStat";
case taskListWithStat:
return @"/app/v2/novel/taskListWithStat";
case task_process:
return @"/app/v1/game/task_process";
case welfare_task_box:
return @"/app/v1/game/farm/welfare_task_box";
case ddcy_clock_list:
return @"/app/v1/game/ddcy/clock_list";
default:
return @"";
}
......@@ -151,6 +155,10 @@ static CGNetworkTools* _tools = nil;
return @"/app/v1/game/welfare_video_report";
case 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";
default:
return @"";
}
......@@ -161,8 +169,9 @@ static CGNetworkTools* _tools = nil;
// GET 请求
- (void)getWithAction: (TQNetwortGetAction)action parameters:(id)parameters success: (void(^)(id response))success failure:(void(^)(NSError * error)) failure{
// 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];
[self GET: urlString parameters: params headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
......
//
// 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];
}
[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
//
// WelfareCenterCell.h
// ClockInVC.h
// GYDemo
//
// Created by zhangshuai on 2020/11/17.
// 打卡页
// Created by zhangshuai on 2020/11/19.
//
#import <UIKit/UIKit.h>
#import "BaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface WelfareCenterCell : UITableViewCell
@interface ClockInVC : BaseViewController
@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"?>
<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="retina4_7" orientation="portrait" appearance="light"/>
<?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>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12042"/>
<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" customClass="WelfareCenterVC">
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ClockInVC">
<connections>
<outlet property="tableView" destination="cLQ-3z-U9W" id="lrz-YI-VgV"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
......@@ -19,30 +15,8 @@
<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"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="cLQ-3z-U9W">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<connections>
<outlet property="dataSource" destination="-1" id="YN3-rf-K4G"/>
<outlet property="delegate" destination="-1" id="ifg-sF-Ftu"/>
</connections>
</tableView>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<viewLayoutGuide key="safeArea" id="Q5M-cg-NOt"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="Q5M-cg-NOt" firstAttribute="trailing" secondItem="cLQ-3z-U9W" secondAttribute="trailing" id="028-KM-XZz"/>
<constraint firstItem="cLQ-3z-U9W" firstAttribute="leading" secondItem="Q5M-cg-NOt" secondAttribute="leading" id="7pf-5Q-Gok"/>
<constraint firstAttribute="bottom" secondItem="cLQ-3z-U9W" secondAttribute="bottom" id="8VV-5W-bB8"/>
<constraint firstItem="cLQ-3z-U9W" firstAttribute="top" secondItem="Q5M-cg-NOt" secondAttribute="top" id="kEn-qd-C6h"/>
</constraints>
<point key="canvasLocation" x="-146" y="69"/>
</view>
</objects>
<resources>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
//
// 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
......@@ -41,6 +41,9 @@
<state key="normal" title="立即领取" backgroundImage="GetItNow">
<color key="titleColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
</state>
<connections>
<action selector="stateButtonClick:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="aP1-iP-3jo"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="hkj-qT-nh4">
<rect key="frame" x="223.5" y="53" width="39" height="20"/>
......@@ -53,6 +56,7 @@
<color key="backgroundColor" red="0.99607843137254903" green="0.9882352941176471" blue="0.88627450980392153" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstItem="hkj-qT-nh4" firstAttribute="centerX" secondItem="dyx-aR-S4p" secondAttribute="centerX" id="8HW-1s-Wwg"/>
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="Go5-7x-zg8" secondAttribute="bottom" constant="14" id="9Yq-a9-JYg"/>
<constraint firstItem="Go5-7x-zg8" firstAttribute="leading" secondItem="1Hi-6u-Z8f" secondAttribute="leading" id="BQB-Lx-flj"/>
<constraint firstAttribute="bottom" secondItem="dyx-aR-S4p" secondAttribute="bottom" constant="7" id="Ghm-cq-BfQ"/>
<constraint firstItem="Go5-7x-zg8" firstAttribute="top" secondItem="1Hi-6u-Z8f" secondAttribute="bottom" constant="6" id="Nph-zt-FH0"/>
......@@ -69,7 +73,7 @@
</userDefinedRuntimeAttributes>
</view>
</subviews>
<color key="backgroundColor" red="0.96862745098039216" green="0.74117647058823533" blue="0.48627450980392156" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="nDA-SS-B2Z" firstAttribute="top" secondItem="pr8-hQ-LpE" secondAttribute="top" id="8fC-07-6l8"/>
<constraint firstAttribute="trailing" secondItem="nDA-SS-B2Z" secondAttribute="trailing" constant="10" id="HBU-ub-jyU"/>
......@@ -78,6 +82,7 @@
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="pr8-hQ-LpE" secondAttribute="trailing" id="IfP-kb-S0R"/>
<constraint firstItem="pr8-hQ-LpE" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="Ih7-S3-ByO"/>
......@@ -86,6 +91,13 @@
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<connections>
<outlet property="awardNum" destination="hkj-qT-nh4" id="xia-dl-dpr"/>
<outlet property="buttonState" destination="dyx-aR-S4p" id="CpN-7w-eAq"/>
<outlet property="subTitle" destination="Go5-7x-zg8" id="UZH-Pl-fPU"/>
<outlet property="title" destination="1Hi-6u-Z8f" id="LHG-Gl-5H3"/>
</connections>
<point key="canvasLocation" x="-343" y="69"/>
</tableViewCell>
</objects>
......
......@@ -9,7 +9,7 @@
NS_ASSUME_NONNULL_BEGIN
@interface WelfareCenterVC : UIViewController
@interface WelfareCenterVC : BaseViewController
@end
......
......@@ -6,13 +6,36 @@
//
#import "WelfareCenterVC.h"
#import "WelfareCenterData.h"
#import "WelfareCenterCell.h"
#define Identifier @"WelfareCenterCell"
#define MAXProcess (6)
@interface WelfareCenterVC ()
@property (nonatomic, strong) NSMutableArray * dataArray;
@property (weak, nonatomic) IBOutlet UITableView *tableView;
@property (strong, nonatomic) IBOutletCollection(UIImageView) NSArray *diamondimages;
@property (weak, nonatomic) IBOutlet UIStackView *stackProcess;
@property (weak, nonatomic) IBOutlet UIImageView *imageLine;
@property (weak, nonatomic) IBOutlet UIButton *treasureBox;
@property (weak, nonatomic) IBOutlet UILabel *currentText;
@property (nonatomic ,assign)NSInteger maxProcess;
@property (nonatomic ,assign)NSInteger coinsProcess;
@property (nonatomic ,assign)NSInteger showA;
@property (nonatomic ,retain)WelfareCenterData *currentData;
- (IBAction)treasureBoxClick:(UIButton *)sender;
@end
@implementation WelfareCenterVC
......@@ -30,9 +53,17 @@
}
- (void)viewDidLoad {
[super viewDidLoad];
[self addLeftItme:[UIImage imageNamed:@"arrow_left"] selecedImage:nil orText:@" " selectedText:nil];
self.title = @"福利中心";
[self loadData];
[self initTableView];
[self navbarClearShadow];
self.view.backgroundColor = [UIColor colorWithHexString:@"#F7BD7C"];
UIImage *image = [UIImage imageNamed:@"DottedLine"];
UIImage *newImage = [UIImage imageWithCGImage:[image CGImage] scale:image.scale orientation:image.imageOrientation];
[self.imageLine setBackgroundColor:[UIColor colorWithPatternImage:newImage]];
// Do any additional setup after loading the view from its nib.
......@@ -46,6 +77,18 @@
[self.tableView registerNib:nib forCellReuseIdentifier:Identifier];
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
}
#pragma - mark 返回
- (void)leftBarButtonItemAction:(UIButton *)btn{
[self dismissViewControllerAnimated:YES completion:^{
}];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
return 1;
......@@ -56,20 +99,34 @@
}
- (nonnull UITableViewCell *)tableView:(nonnull UITableView *)tableView cellForRowAtIndexPath:(nonnull NSIndexPath *)indexPath {
// ESMusicListData * data = [self.dataArray objectAtIndex:indexPath.row];
WelfareCenterData * data = [self.dataArray objectAtIndex:indexPath.row];
WelfareCenterCell * cell = [tableView dequeueReusableCellWithIdentifier:Identifier forIndexPath:indexPath];
// cell.cellType = self.cellType;
// cell.title.text = data.songName;
// cell.content.text = data.musicCategory;
//// [cell.musicImage setImageWithURL:[NSURL URLWithString:data.musicCover] placeholderImage:[UIImage imageNamed:@"home_top_bg"]];
// [cell.musicImage sd_setImageWithURL:[NSURL URLWithString:data.musicCover] placeholderImage:[UIImage imageNamed:@"home_top_bg"]];
//
// cell.isPlaying = [[MMusicManager shareManager]isPlayingWithModel:data listName:self.albumCategory];
// if (cell.isPlaying) {
// self.indexPath = indexPath;
// }
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.title.text = data.title;
cell.subTitle.text = data.description_Content;
cell.status = data.status;
[cell.awardNum setTitle:[NSString stringWithFormat:@"+%@",data.awardCoins] forState:UIControlStateNormal];
WEAKSELF;
cell.buttonBlock = ^(WelfareCenterCell * _Nonnull thisCell) {
NSInteger status = thisCell.status;
NSIndexPath * indexP = [weakSelf.tableView indexPathForCell:thisCell];
WelfareCenterData * data = [weakSelf.dataArray objectAtIndex:indexP.row];
if (status == 0) {
[weakSelf showAD:data];
}else if(status == 1){
[MBProgressHUD showMessage:@"明日再来"];
}else if (status == 2){ //立即领取
[weakSelf receiveThePrize:data];
}else{
[MBProgressHUD showMessage:@"明日再来"];
}
};
return cell;
}
......@@ -116,32 +173,140 @@
- (void)loadData{
WEAKSELF;
[MBProgressHUD showLoading:@"loading"];
NSMutableDictionary * dic = [[NSMutableDictionary alloc]init];
[dic setObject:@"1" forKey:@"type"];
//请求进度
[[CGNetworkTools shared] getWithAction:task_process parameters:@{} success:^(id _Nonnull response) {
[[CGNetworkTools shared] getWithAction:task_process parameters:dic success:^(id _Nonnull response) {
[MBProgressHUD hideHUD];
NSDictionary * dic = response[@"result"][@"data"];
if (dic.count) {
weakSelf.maxProcess = [[dic valueForKey:@"max"] integerValue];
weakSelf.coinsProcess = [[dic valueForKey:@"coins"] integerValue];
weakSelf.showA = [[dic valueForKey:@"show"] integerValue];
[weakSelf updateUI];
}
} failure:^(NSError * _Nonnull error) {
[MBProgressHUD hideHUD];
}];
NSMutableDictionary * dicStat = [[NSMutableDictionary alloc]init];
[dicStat setObject:@"welfare_center_task_list" forKey:@"slotName"];
// 请求列表
[[CGNetworkTools shared] getWithAction:taskListWithStat parameters:@{} success:^(id _Nonnull response) {
[[CGNetworkTools shared] getWithAction:taskListWithStat parameters:dicStat success:^(id _Nonnull response) {
[MBProgressHUD hideHUD];
if (response) {
NSArray * array = response[@"result"][@"data"][@"userTask"];
if (array) {
weakSelf.dataArray = [WelfareCenterData mj_objectArrayWithKeyValuesArray:array];
[weakSelf.tableView reloadData];
}
}
} failure:^(NSError * _Nonnull error) {
[MBProgressHUD hideHUD];
}];
}
//MARK: 更新UI
- (void)updateUI{
for (UIImageView *imageView in self.diamondimages) {
if (imageView.tag <= 1000 + self.coinsProcess) {
[imageView setImage:[UIImage imageNamed:@"FinishedDiamonds"]];
} else {
[imageView setImage:[UIImage imageNamed:@"UnfinishedDiamond"]];
}
if (imageView.tag <= 1000 + MAXProcess) { //[1,10]
imageView.hidden = NO;
}else{
imageView.hidden = YES;
}
}
if (self.coinsProcess >= 6) {
[self.treasureBox setBackgroundImage:[UIImage imageNamed:@"OpenTreasureChest"] forState:UIControlStateNormal];
}else{
[self.treasureBox setBackgroundImage:[UIImage imageNamed:@"TreasureChestClose"] forState:UIControlStateNormal];
}
self.currentText.text = [NSString stringWithFormat:@"%ld",self.coinsProcess];
}
//MARK: 看广告
- (void)showAD:( WelfareCenterData * ) data{
self.currentData = data;
WEAKSELF;
[IOSADManager shareADManager].advertisingSpace = @"play_adVideo_end_welfareTask";
[[IOSADManager shareADManager] showADType:ADType_Video resultBlock:^(BOOL success) {
if (success) {
//2462
[[CGUserManager shared] addLocCollection:@"play_adVideo_end_welfareTask" value:@""];
if (weakSelf.currentData.sid.length > 0) {
[MBProgressHUD showLoading:@"loading"];
[[CGNetworkTools shared] postWithAction:welfareVideoReport parameters:@{@"sid": weakSelf.currentData.sid} success:^(id _Nonnull response) {
[MBProgressHUD hideHUD];
if ([[response objectForKey:@"status"] integerValue] == 200) {
//
NSLog(@"welfare_video_report success");
weakSelf.currentData.status = 2;
[weakSelf.tableView reloadData];
}
} failure:^(NSError * _Nonnull error) {
[MBProgressHUD hideHUD];
}];
}
} else {
// [MBProgressHUD showError:@"抱歉, 请重试"];
}
}];
}
/*
#pragma mark - Navigation
//MARK: 获取奖励
- (void)receiveThePrize:(WelfareCenterData *) data{
self.currentData = data;
WEAKSELF;
[MBProgressHUD showLoading:@"loading"];
[[CGNetworkTools shared] postWithAction:complete_task parameters:@{@"id": weakSelf.currentData.sid} success:^(id _Nonnull response) {
[MBProgressHUD hideHUD];
if ([[response objectForKey:@"status"] integerValue] == 200) {
NSLog(@"welfare_video_report success");
weakSelf.currentData.status = 1;
[weakSelf.tableView reloadData];
}
} failure:^(NSError * _Nonnull error) {
[MBProgressHUD hideHUD];
// 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.
}];
}
*/
//MARK: 打开宝箱
- (IBAction)treasureBoxClick:(UIButton *)sender {
if (self.coinsProcess >= 6) {
[[CGNetworkTools shared] getWithAction:welfare_task_box parameters:@{} success:^(id _Nonnull response) {
} failure:^(NSError * _Nonnull error) {
}];
}
[[CGNetworkTools shared] getWithAction:welfare_task_box parameters:@{} success:^(id _Nonnull response) {
} failure:^(NSError * _Nonnull error) {
}];
}
@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="retina4_7" 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" customClass="WelfareCenterVC">
<connections>
<outlet property="currentText" destination="3ar-1p-GGl" id="FTa-d6-TLA"/>
<outlet property="imageLine" destination="eOX-rq-v0m" id="nQi-CD-Le5"/>
<outlet property="stackProcess" destination="S8p-gf-4z7" id="cFK-Aa-zoG"/>
<outlet property="tableView" destination="cLQ-3z-U9W" id="lrz-YI-VgV"/>
<outlet property="treasureBox" destination="PvX-s8-Pxm" id="CFC-be-Iwr"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
<outletCollection property="diamondimages" destination="kBi-Eb-3V8" id="275-Zc-bCZ"/>
<outletCollection property="diamondimages" destination="1z4-3O-sod" id="QnW-xd-fu7"/>
<outletCollection property="diamondimages" destination="bNv-QM-tgZ" id="79A-7j-6mc"/>
<outletCollection property="diamondimages" destination="Rvp-NU-SUN" id="ewG-56-kBw"/>
<outletCollection property="diamondimages" destination="hBp-he-bnq" id="kcd-7r-v3k"/>
<outletCollection property="diamondimages" destination="Jj2-BA-D4N" id="vgd-VO-AIQ"/>
<outletCollection property="diamondimages" destination="bwc-i7-rSf" id="Dyt-A2-bGp"/>
<outletCollection property="diamondimages" destination="H5W-Ga-MKH" id="Wtz-4Z-QhQ"/>
<outletCollection property="diamondimages" destination="Kx6-a8-hM2" id="7fD-hw-ReK"/>
<outletCollection property="diamondimages" destination="IZK-xN-ed9" id="GvK-gQ-bhe"/>
</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"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="BottomOfTheBackground" translatesAutoresizingMaskIntoConstraints="NO" id="Hz0-KR-A7M">
<rect key="frame" x="0.0" y="539" width="375" height="128"/>
</imageView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="D2D-AV-eup">
<rect key="frame" x="0.0" y="0.0" width="375" height="85"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="集齐6颗钻石可获得宝箱奖励" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="CdA-K9-h8P">
<rect key="frame" x="11" y="10" width="214.5" height="24"/>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="eOX-rq-v0m">
<rect key="frame" x="15" y="54.5" width="300" height="1"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="0Br-kg-Mkw"/>
</constraints>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="PvX-s8-Pxm">
<rect key="frame" x="315" y="35" width="50" height="40"/>
<constraints>
<constraint firstAttribute="width" constant="50" id="AqL-sD-MtI"/>
</constraints>
<state key="normal" image="TreasureChestClose"/>
<connections>
<action selector="treasureBoxClick:" destination="-1" eventType="touchUpInside" id="g16-Zg-dOx"/>
</connections>
</button>
<stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" alignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="S8p-gf-4z7">
<rect key="frame" x="15" y="35" width="280" height="40"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" tag="1001" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="UnfinishedDiamond" translatesAutoresizingMaskIntoConstraints="NO" id="1z4-3O-sod">
<rect key="frame" x="0.0" y="6.5" width="27" height="27"/>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" tag="1002" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="UnfinishedDiamond" translatesAutoresizingMaskIntoConstraints="NO" id="bNv-QM-tgZ">
<rect key="frame" x="28" y="6.5" width="27" height="27"/>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" tag="1003" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="UnfinishedDiamond" translatesAutoresizingMaskIntoConstraints="NO" id="Rvp-NU-SUN">
<rect key="frame" x="56" y="6.5" width="27" height="27"/>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" tag="1004" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="UnfinishedDiamond" translatesAutoresizingMaskIntoConstraints="NO" id="kBi-Eb-3V8">
<rect key="frame" x="84.5" y="6.5" width="27" height="27"/>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" tag="1005" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="UnfinishedDiamond" translatesAutoresizingMaskIntoConstraints="NO" id="hBp-he-bnq">
<rect key="frame" x="112.5" y="6.5" width="27" height="27"/>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" tag="1006" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="UnfinishedDiamond" translatesAutoresizingMaskIntoConstraints="NO" id="Jj2-BA-D4N">
<rect key="frame" x="140.5" y="6.5" width="27" height="27"/>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" tag="1007" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="UnfinishedDiamond" translatesAutoresizingMaskIntoConstraints="NO" id="bwc-i7-rSf">
<rect key="frame" x="168.5" y="6.5" width="27" height="27"/>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" tag="1008" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="UnfinishedDiamond" translatesAutoresizingMaskIntoConstraints="NO" id="H5W-Ga-MKH">
<rect key="frame" x="197" y="6.5" width="27" height="27"/>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" tag="1009" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="UnfinishedDiamond" translatesAutoresizingMaskIntoConstraints="NO" id="Kx6-a8-hM2">
<rect key="frame" x="225" y="6.5" width="27" height="27"/>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" tag="1010" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="UnfinishedDiamond" translatesAutoresizingMaskIntoConstraints="NO" id="IZK-xN-ed9">
<rect key="frame" x="253" y="6.5" width="27" height="27"/>
</imageView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="FH1-a1-QJK"/>
</constraints>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="RPC-kr-Miv">
<rect key="frame" x="316" y="6.5" width="48" height="20.5"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="MissionDiamond" translatesAutoresizingMaskIntoConstraints="NO" id="siR-JQ-5Ee">
<rect key="frame" x="0.0" y="0.0" width="17" height="20.5"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=":" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sAl-Iv-fIQ">
<rect key="frame" x="17" y="0.0" width="5" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="3" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3ar-1p-GGl">
<rect key="frame" x="22" y="0.0" width="10.5" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="1" green="0.35294117650000001" blue="0.2666666667" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="/6" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="8j4-7J-gwL">
<rect key="frame" x="32.5" y="0.0" width="15.5" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="PvX-s8-Pxm" firstAttribute="leading" secondItem="S8p-gf-4z7" secondAttribute="trailing" constant="20" id="89X-7k-ijZ"/>
<constraint firstItem="eOX-rq-v0m" firstAttribute="centerY" secondItem="S8p-gf-4z7" secondAttribute="centerY" id="FCp-gm-wYP"/>
<constraint firstItem="S8p-gf-4z7" firstAttribute="leading" secondItem="D2D-AV-eup" secondAttribute="leading" constant="15" id="Hob-ud-Gi2"/>
<constraint firstItem="S8p-gf-4z7" firstAttribute="centerY" secondItem="PvX-s8-Pxm" secondAttribute="centerY" id="J7o-Gj-r1w"/>
<constraint firstItem="PvX-s8-Pxm" firstAttribute="leading" secondItem="eOX-rq-v0m" secondAttribute="trailing" id="L1t-z1-uiU"/>
<constraint firstItem="PvX-s8-Pxm" firstAttribute="top" secondItem="RPC-kr-Miv" secondAttribute="bottom" constant="8" id="Q76-5G-gA0"/>
<constraint firstItem="RPC-kr-Miv" firstAttribute="centerX" secondItem="PvX-s8-Pxm" secondAttribute="centerX" id="ZnZ-nM-S50"/>
<constraint firstItem="CdA-K9-h8P" firstAttribute="top" secondItem="D2D-AV-eup" secondAttribute="top" constant="10" id="i4a-bl-9sN"/>
<constraint firstAttribute="bottom" secondItem="PvX-s8-Pxm" secondAttribute="bottom" constant="10" id="qm8-6b-fpD"/>
<constraint firstAttribute="height" constant="85" id="s0L-kX-UPf"/>
<constraint firstItem="eOX-rq-v0m" firstAttribute="leading" secondItem="S8p-gf-4z7" secondAttribute="leading" id="skH-3l-nIp"/>
<constraint firstItem="CdA-K9-h8P" firstAttribute="leading" secondItem="D2D-AV-eup" secondAttribute="leading" constant="11" id="w1v-b0-Oo6"/>
<constraint firstAttribute="trailing" secondItem="PvX-s8-Pxm" secondAttribute="trailing" constant="10" id="wDk-D9-G2s"/>
</constraints>
</view>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="cLQ-3z-U9W">
<rect key="frame" x="0.0" y="85" width="375" height="582"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<color key="sectionIndexBackgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<connections>
<outlet property="dataSource" destination="-1" id="YN3-rf-K4G"/>
<outlet property="delegate" destination="-1" id="ifg-sF-Ftu"/>
</connections>
</tableView>
</subviews>
<viewLayoutGuide key="safeArea" id="Q5M-cg-NOt"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="Q5M-cg-NOt" firstAttribute="trailing" secondItem="cLQ-3z-U9W" secondAttribute="trailing" id="028-KM-XZz"/>
<constraint firstItem="cLQ-3z-U9W" firstAttribute="top" secondItem="D2D-AV-eup" secondAttribute="bottom" id="5wn-Zp-bTJ"/>
<constraint firstItem="cLQ-3z-U9W" firstAttribute="leading" secondItem="Q5M-cg-NOt" secondAttribute="leading" id="7pf-5Q-Gok"/>
<constraint firstAttribute="bottom" secondItem="cLQ-3z-U9W" secondAttribute="bottom" id="8VV-5W-bB8"/>
<constraint firstItem="Hz0-KR-A7M" firstAttribute="leading" secondItem="Q5M-cg-NOt" secondAttribute="leading" id="RcL-5a-amf"/>
<constraint firstItem="Q5M-cg-NOt" firstAttribute="trailing" secondItem="Hz0-KR-A7M" secondAttribute="trailing" id="VHd-ye-32S"/>
<constraint firstItem="Q5M-cg-NOt" firstAttribute="bottom" secondItem="Hz0-KR-A7M" secondAttribute="bottom" id="dhz-m5-vd3"/>
<constraint firstItem="Q5M-cg-NOt" firstAttribute="trailing" secondItem="D2D-AV-eup" secondAttribute="trailing" id="dvA-wT-3C2"/>
<constraint firstItem="D2D-AV-eup" firstAttribute="leading" secondItem="Q5M-cg-NOt" secondAttribute="leading" id="jnl-OE-fh8"/>
<constraint firstItem="D2D-AV-eup" firstAttribute="top" secondItem="Q5M-cg-NOt" secondAttribute="top" id="xa4-d3-lOH"/>
</constraints>
<point key="canvasLocation" x="-143.19999999999999" y="62.518740629685162"/>
</view>
</objects>
<resources>
<image name="BottomOfTheBackground" width="375" height="128"/>
<image name="MissionDiamond" width="17" height="15"/>
<image name="TreasureChestClose" width="48" height="40"/>
<image name="UnfinishedDiamond" width="27" height="27"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
//
// 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
//
// 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
}
@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