Commit 6353e428 authored by zhangshuai's avatar zhangshuai

修改福利中心

parent ca3c6021
...@@ -25,6 +25,9 @@ ...@@ -25,6 +25,9 @@
6863522A2563E26900F7BAD3 /* WelfareCenterCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 686352282563E26900F7BAD3 /* WelfareCenterCell.xib */; }; 6863522A2563E26900F7BAD3 /* WelfareCenterCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 686352282563E26900F7BAD3 /* WelfareCenterCell.xib */; };
6882AD002566A68A008CF1F3 /* ClockInVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 6882ACFE2566A68A008CF1F3 /* ClockInVC.m */; }; 6882AD002566A68A008CF1F3 /* ClockInVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 6882ACFE2566A68A008CF1F3 /* ClockInVC.m */; };
6882AD012566A68A008CF1F3 /* ClockInVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6882ACFF2566A68A008CF1F3 /* ClockInVC.xib */; }; 6882AD012566A68A008CF1F3 /* ClockInVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6882ACFF2566A68A008CF1F3 /* ClockInVC.xib */; };
6882AD1F2567CDEF008CF1F3 /* WelfareBoxData.m in Sources */ = {isa = PBXBuildFile; fileRef = 6882AD1E2567CDEF008CF1F3 /* WelfareBoxData.m */; };
6882AD252567CEC1008CF1F3 /* DGUniversalAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6882AD222567CEC1008CF1F3 /* DGUniversalAlertView.m */; };
6882AD262567CEC1008CF1F3 /* DGUniversalAlertView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6882AD242567CEC1008CF1F3 /* DGUniversalAlertView.xib */; };
68A81D192566461A003C1BF1 /* UIView+AdaptScreen.m in Sources */ = {isa = PBXBuildFile; fileRef = 68A81D102566461A003C1BF1 /* UIView+AdaptScreen.m */; }; 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 */; }; 68A81D1A2566461A003C1BF1 /* UIView+WHView.m in Sources */ = {isa = PBXBuildFile; fileRef = 68A81D112566461A003C1BF1 /* UIView+WHView.m */; };
68A81D1B2566461A003C1BF1 /* ESLyhXibView.m in Sources */ = {isa = PBXBuildFile; fileRef = 68A81D142566461A003C1BF1 /* ESLyhXibView.m */; }; 68A81D1B2566461A003C1BF1 /* ESLyhXibView.m in Sources */ = {isa = PBXBuildFile; fileRef = 68A81D142566461A003C1BF1 /* ESLyhXibView.m */; };
...@@ -155,6 +158,11 @@ ...@@ -155,6 +158,11 @@
6882ACFD2566A68A008CF1F3 /* ClockInVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ClockInVC.h; 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>"; }; 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>"; }; 6882ACFF2566A68A008CF1F3 /* ClockInVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ClockInVC.xib; sourceTree = "<group>"; };
6882AD1D2567CDEF008CF1F3 /* WelfareBoxData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WelfareBoxData.h; sourceTree = "<group>"; };
6882AD1E2567CDEF008CF1F3 /* WelfareBoxData.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WelfareBoxData.m; sourceTree = "<group>"; };
6882AD222567CEC1008CF1F3 /* DGUniversalAlertView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DGUniversalAlertView.m; sourceTree = "<group>"; };
6882AD232567CEC1008CF1F3 /* DGUniversalAlertView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DGUniversalAlertView.h; sourceTree = "<group>"; };
6882AD242567CEC1008CF1F3 /* DGUniversalAlertView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DGUniversalAlertView.xib; sourceTree = "<group>"; };
68A81D0C2566461A003C1BF1 /* UIView+HExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+HExtension.h"; 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>"; }; 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>"; }; 68A81D0E2566461A003C1BF1 /* UIView+DHExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+DHExtension.h"; sourceTree = "<group>"; };
...@@ -547,6 +555,8 @@ ...@@ -547,6 +555,8 @@
A91A79C4254024A400F9B216 /* GYOrderInfoModel.m */, A91A79C4254024A400F9B216 /* GYOrderInfoModel.m */,
A9AB9D822540672D00F0D766 /* GYDayTaskModel.h */, A9AB9D822540672D00F0D766 /* GYDayTaskModel.h */,
A9AB9D832540672D00F0D766 /* GYDayTaskModel.m */, A9AB9D832540672D00F0D766 /* GYDayTaskModel.m */,
6882AD1D2567CDEF008CF1F3 /* WelfareBoxData.h */,
6882AD1E2567CDEF008CF1F3 /* WelfareBoxData.m */,
); );
path = Model; path = Model;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -566,6 +576,9 @@ ...@@ -566,6 +576,9 @@
A91A7960253F188D00F9B216 /* Alert */ = { A91A7960253F188D00F9B216 /* Alert */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
6882AD232567CEC1008CF1F3 /* DGUniversalAlertView.h */,
6882AD222567CEC1008CF1F3 /* DGUniversalAlertView.m */,
6882AD242567CEC1008CF1F3 /* DGUniversalAlertView.xib */,
A91A797B253F244F00F9B216 /* GYGiftAlertView.h */, A91A797B253F244F00F9B216 /* GYGiftAlertView.h */,
A91A797C253F244F00F9B216 /* GYGiftAlertView.m */, A91A797C253F244F00F9B216 /* GYGiftAlertView.m */,
A91A7981253F248E00F9B216 /* GYGiftAlertView.xib */, A91A7981253F248E00F9B216 /* GYGiftAlertView.xib */,
...@@ -793,6 +806,7 @@ ...@@ -793,6 +806,7 @@
A9AB9D8C25407BBB00F0D766 /* GYSignInCell.xib in Resources */, A9AB9D8C25407BBB00F0D766 /* GYSignInCell.xib in Resources */,
A91A79BF25401E3500F9B216 /* GYOrderInfoCell.xib in Resources */, A91A79BF25401E3500F9B216 /* GYOrderInfoCell.xib in Resources */,
A91A79AC25400BAD00F9B216 /* GYGiftCell.xib in Resources */, A91A79AC25400BAD00F9B216 /* GYGiftCell.xib in Resources */,
6882AD262567CEC1008CF1F3 /* DGUniversalAlertView.xib in Resources */,
A9AB9D6A25403E3500F0D766 /* GYTaskAlertCollectionHeaderView.xib in Resources */, A9AB9D6A25403E3500F0D766 /* GYTaskAlertCollectionHeaderView.xib in Resources */,
A91A78C8253EE70600F9B216 /* LaunchScreen.storyboard in Resources */, A91A78C8253EE70600F9B216 /* LaunchScreen.storyboard in Resources */,
A91A7884253EE56D00F9B216 /* Assets.xcassets in Resources */, A91A7884253EE56D00F9B216 /* Assets.xcassets in Resources */,
...@@ -890,6 +904,7 @@ ...@@ -890,6 +904,7 @@
A9AB9D6925403E3500F0D766 /* GYTaskAlertCollectionHeaderView.m in Sources */, A9AB9D6925403E3500F0D766 /* GYTaskAlertCollectionHeaderView.m in Sources */,
A9AB9D932541222A00F0D766 /* GYWebViewController.m in Sources */, A9AB9D932541222A00F0D766 /* GYWebViewController.m in Sources */,
A91A7950253F14C300F9B216 /* ZJGuideConfig.m in Sources */, A91A7950253F14C300F9B216 /* ZJGuideConfig.m in Sources */,
6882AD252567CEC1008CF1F3 /* DGUniversalAlertView.m in Sources */,
A91A7879253EE56B00F9B216 /* AppDelegate.mm in Sources */, A91A7879253EE56B00F9B216 /* AppDelegate.mm in Sources */,
A9AB9D7B254046CB00F0D766 /* WTProgressView.m in Sources */, A9AB9D7B254046CB00F0D766 /* WTProgressView.m in Sources */,
A91A7944253F0BBA00F9B216 /* GYSignInModel.m in Sources */, A91A7944253F0BBA00F9B216 /* GYSignInModel.m in Sources */,
...@@ -911,6 +926,7 @@ ...@@ -911,6 +926,7 @@
A91A7903253EE8E300F9B216 /* Data.m in Sources */, A91A7903253EE8E300F9B216 /* Data.m in Sources */,
A9AB9D7A254046CB00F0D766 /* ProgressView.m in Sources */, A9AB9D7A254046CB00F0D766 /* ProgressView.m in Sources */,
A91A78F3253EE87500F9B216 /* CGNetworkTools.m in Sources */, A91A78F3253EE87500F9B216 /* CGNetworkTools.m in Sources */,
6882AD1F2567CDEF008CF1F3 /* WelfareBoxData.m in Sources */,
A91A7963253F192A00F9B216 /* GYRedPacketView.m in Sources */, A91A7963253F192A00F9B216 /* GYRedPacketView.m in Sources */,
A91A78D5253EE75500F9B216 /* CGUserManager.m in Sources */, A91A78D5253EE75500F9B216 /* CGUserManager.m in Sources */,
68A81D34256647AB003C1BF1 /* BaseViewController.m in Sources */, 68A81D34256647AB003C1BF1 /* BaseViewController.m in Sources */,
......
//
// DGUniversalAlertView.h
// DodoGarden
//
// Created by Mazy on 2020/11/7.
//
#import <UIKit/UIKit.h>
//#import "DGOpenBoxModel.h"
//#import "DGWheelSurfModel.h"
//#import "DGWdHistoryModel.h"
#import "WelfareBoxData.h"
NS_ASSUME_NONNULL_BEGIN
@interface DGUniversalAlertView : UIView
@property (weak, nonatomic) IBOutlet UIView *mainContentView;
@property (weak, nonatomic) IBOutlet UIImageView *topTypeImageView;
@property (weak, nonatomic) IBOutlet UIView *firstStackView;
@property (weak, nonatomic) IBOutlet UIView *secondStackView;
@property (weak, nonatomic) IBOutlet UIView *thirdStackView;
@property (weak, nonatomic) IBOutlet UIImageView *lightImageView;
@property (strong, nonatomic) IBOutletCollection(UIImageView) NSArray *centerGainImageViews;
@property (strong, nonatomic) IBOutletCollection(UILabel) NSArray *gainCountLabels;
@property (weak, nonatomic) IBOutlet UILabel *contentLabel;
@property (weak, nonatomic) IBOutlet UIStackView *contentStackView;
//@property (nonatomic, strong) DGOpenBoxModel *boxModel;
+(DGUniversalAlertView *)loadFromNib;
- (void)showAlertToView: (UIView *)toView;
- (void)hideAlert;
//- (void)configWithSurfModel:(DGWheelSurfModel *)surfModel;
//
//- (void)configWithBoxModel:(DGOpenBoxModel *)boxModel;
////DGWdHistoryModel
//- (void)configWithWdResultModel:(DGWdResultModel *)resultModel;
//显示每日福利宝箱奖励
- (void)configWithWelfareBoxModel:(NSArray *)boxModels;
@property(nonatomic, copy) void(^closeCallBack)(void);
@end
NS_ASSUME_NONNULL_END
This diff is collapsed.
This diff is collapsed.
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#import "GYLoginViewController.h" #import "GYLoginViewController.h"
#import "GYCashSixAwardAlertView.h" #import "GYCashSixAwardAlertView.h"
#import "WelfareCenterVC.h" #import "WelfareCenterVC.h"
#import "ClockInVC.h"
UnityFramework* UnityFrameworkLoad() UnityFramework* UnityFrameworkLoad()
{ {
...@@ -136,24 +137,33 @@ NSDictionary* appLaunchOpts; ...@@ -136,24 +137,33 @@ NSDictionary* appLaunchOpts;
// 跳转每日福利 // 跳转每日福利
- (void)ios_oneveryDayWelfareClick { - (void)ios_oneveryDayWelfareClick {
[[CGUserManager shared] addLocCollection:@"show_welfare_center_page" value:@""]; // ClockInVC * vc = [[ClockInVC alloc]init];
// UINavigationController * nav = [[UINavigationController alloc] initWithRootViewController:vc];
//
// nav.modalPresentationStyle = UIModalPresentationFullScreen;
// [[[self ufw] appController].window.rootViewController presentViewController:nav
// animated:YES
// completion:nil];
[[CGUserManager shared] addLocCollection:@"show_welfare_center_page" value:@""];
GYWebViewController * web = [[GYWebViewController alloc] init]; GYWebViewController * web = [[GYWebViewController alloc] init];
web.url = [[CGUserManager shared].h5_url objectForKey:@"welfareurl"]; web.url = [[CGUserManager shared].h5_url objectForKey:@"welfareurl"];
if (web.url == nil || web.url.length == 0) { if (web.url == nil || web.url.length == 0) {
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:vc];
nav.modalPresentationStyle = UIModalPresentationFullScreen; nav.modalPresentationStyle = UIModalPresentationFullScreen;
[[[self ufw] appController].window.rootViewController presentViewController:nav [[[self ufw] appController].window.rootViewController presentViewController:nav
animated:YES animated:YES
completion:nil]; completion:nil];
WEAKSELF WEAKSELF
[self unityVideo:false]; //关闭背景音乐 [self unityVideo:false]; //关闭背景音乐
......
{
"images" : [
{
"filename" : "title_gain_box.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "universal_alert_bg_1@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "universal_alert_bg_1@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "universal_alert_bg_2@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "universal_alert_bg_2@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "universal_alert_cancel_icon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "universal_alert_cancel_icon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "universal_alert_get_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "universal_alert_get_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "universal_alert_light_icon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "universal_alert_light_icon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "BackgroundLight@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "BackgroundLight@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
...@@ -12,7 +12,7 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -12,7 +12,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface GYWheelSurfModel : GYBaseModel @interface GYWheelSurfModel : GYBaseModel
@property (nonatomic, copy) NSString * name; @property (nonatomic, copy) NSString * name;
@property (nonatomic, copy) NSString * awardNum; @property (nonatomic, copy) NSString * awardNum; //奖品数量
@property (nonatomic, assign) NSInteger awardType; //奖励类型 1 水滴 2 果子 3 种子 4 金币 5 加速剂 6 红包 7钻石 @property (nonatomic, assign) NSInteger awardType; //奖励类型 1 水滴 2 果子 3 种子 4 金币 5 加速剂 6 红包 7钻石
@property (nonatomic, copy) NSString * countDownSecond; @property (nonatomic, copy) NSString * countDownSecond;
@property (nonatomic, strong) NSDictionary * extJson; @property (nonatomic, strong) NSDictionary * extJson;
...@@ -20,6 +20,8 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -20,6 +20,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, copy) NSString * lotteryNum; @property (nonatomic, copy) NSString * lotteryNum;
@property (nonatomic, copy) NSString * showVideo; @property (nonatomic, copy) NSString * showVideo;
@property (nonatomic, assign)NSInteger subType; //
@property (nonatomic, strong) NSMutableArray * extModels; @property (nonatomic, strong) NSMutableArray * extModels;
@end @end
......
//
// WelfareBoxData.h
// GYDemo
//
// Created by zhangshuai on 2020/11/20.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface WelfareBoxData : NSObject
@property (nonatomic ,assign)NSInteger awardNum; //奖励数值
@property (nonatomic ,assign)NSInteger awardType; //value = "奖励类型", notes = "1 种子 2 金币 3 加速剂"
@property (nonatomic ,assign)NSInteger boxID;
@property (nonatomic ,assign)NSInteger subType; // 奖励子类型
@end
NS_ASSUME_NONNULL_END
//
// WelfareBoxData.m
// GYDemo
//
// Created by zhangshuai on 2020/11/20.
//
#import "WelfareBoxData.h"
@implementation WelfareBoxData
+ (NSDictionary *)mj_replacedKeyFromPropertyName{
return @{
@"boxID" : @"id"//前边的是你想用的key,后边的是返回的key
};
}
@end
...@@ -234,10 +234,10 @@ static CGNetworkTools* _tools = nil; ...@@ -234,10 +234,10 @@ static CGNetworkTools* _tools = nil;
//Ads请求 //Ads请求
- (void)getWithAdsAction: (TQNetwortGetAction)action parameters:(id)parameters success: (void(^)(id response))success failure:(void(^)(NSError * error)) failure { - (void)getWithAdsAction: (TQNetwortGetAction)action parameters:(id)parameters success: (void(^)(id response))success failure:(void(^)(NSError * error)) failure {
// get 请求 // get 请求
NSString *urlString = [ServerAds stringByAppendingPathComponent: [self convertGetActionToString:action]]; NSString *urlString = [ServerAds stringByAppendingString: [self convertGetActionToString:action]];
NSDictionary * params = [self setRequestParams: parameters]; NSDictionary * params = [self setRequestParams: parameters];
NSLog(@"%@->\n%@",urlString,params)
[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) {
success(responseObject); success(responseObject);
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
...@@ -258,7 +258,7 @@ static CGNetworkTools* _tools = nil; ...@@ -258,7 +258,7 @@ static CGNetworkTools* _tools = nil;
- (void)postWithLogCollection: (TQNetwortPostAction)action parameters:(id) parameters success: (void(^)(id *response))success failure:(void(^)(NSError * error)) failure { - (void)postWithLogCollection: (TQNetwortPostAction)action parameters:(id) parameters success: (void(^)(id *response))success failure:(void(^)(NSError * error)) failure {
// post 请求 // post 请求
NSString *urlString = [ServerReport stringByAppendingPathComponent: [self convertPostActionToString:action]]; NSString *urlString = [ServerReport stringByAppendingString: [self convertPostActionToString:action]];
NSDictionary *dic= parameters; NSDictionary *dic= parameters;
NSData *data = [NSJSONSerialization dataWithJSONObject:dic options:NSJSONWritingFragmentsAllowed error:nil]; NSData *data = [NSJSONSerialization dataWithJSONObject:dic options:NSJSONWritingFragmentsAllowed error:nil];
...@@ -316,7 +316,7 @@ static CGNetworkTools* _tools = nil; ...@@ -316,7 +316,7 @@ static CGNetworkTools* _tools = nil;
} else { } else {
[dict setValue: @"AppStore" forKey: @"source"]; [dict setValue: @"AppStore" forKey: @"source"];
} }
// [dict setValue: @"common" forKey: @"source"]; [dict setValue: @"toutiao" forKey: @"source"];
NSString *uid = [[data Read] objectForKey:@"uid"]; NSString *uid = [[data Read] objectForKey:@"uid"];
if (uid != nil) { [dict setValue: uid forKey: @"uid"]; } if (uid != nil) { [dict setValue: uid forKey: @"uid"]; }
......
...@@ -15,9 +15,24 @@ ...@@ -15,9 +15,24 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
self.title = @"打卡领奖";
[self loadData];
// Do any additional setup after loading the view from its nib. // Do any additional setup after loading the view from its nib.
} }
- (void)loadData{
[[CGNetworkTools shared] getWithAction:ddcy_clock_list parameters:@{} success:^(id _Nonnull response) {
} failure:^(NSError * _Nonnull error) {
}];
}
/* /*
#pragma mark - Navigation #pragma mark - Navigation
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8"?>
<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"> <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> <dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12042"/> <deployment identifier="iOS"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies> </dependencies>
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ClockInVC"> <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"/> <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> </objects>
</document> </document>
...@@ -8,11 +8,15 @@ ...@@ -8,11 +8,15 @@
#import "WelfareCenterVC.h" #import "WelfareCenterVC.h"
#import "WelfareCenterData.h" #import "WelfareCenterData.h"
#import "WelfareBoxData.h"
#import "DGUniversalAlertView.h"
#import "WelfareCenterCell.h" #import "WelfareCenterCell.h"
#define Identifier @"WelfareCenterCell" #define Identifier @"WelfareCenterCell"
#import "AppDelegate.h"
#define MAXProcess (6) #define MAXProcess (6)
@interface WelfareCenterVC () @interface WelfareCenterVC ()
...@@ -234,13 +238,14 @@ ...@@ -234,13 +238,14 @@
} }
if (self.coinsProcess >= 6) { if (self.coinsProcess >= 6) {
[self.treasureBox setBackgroundImage:[UIImage imageNamed:@"OpenTreasureChest"] forState:UIControlStateNormal]; [self.treasureBox setImage:[UIImage imageNamed:@"OpenTreasureChest"] forState:UIControlStateNormal];
}else{ }else{
[self.treasureBox setBackgroundImage:[UIImage imageNamed:@"TreasureChestClose"] forState:UIControlStateNormal]; [self.treasureBox setImage:[UIImage imageNamed:@"TreasureChestClose"] forState:UIControlStateNormal];
} }
self.currentText.text = [NSString stringWithFormat:@"%ld",self.coinsProcess]; self.currentText.text = [NSString stringWithFormat:@"%ld",self.coinsProcess];
[self.tableView reloadData];
} }
//MARK: 看广告 //MARK: 看广告
...@@ -284,7 +289,8 @@ ...@@ -284,7 +289,8 @@
if ([[response objectForKey:@"status"] integerValue] == 200) { if ([[response objectForKey:@"status"] integerValue] == 200) {
NSLog(@"welfare_video_report success"); NSLog(@"welfare_video_report success");
weakSelf.currentData.status = 1; weakSelf.currentData.status = 1;
[weakSelf.tableView reloadData]; weakSelf.coinsProcess += 1;
[weakSelf updateUI];
} }
} failure:^(NSError * _Nonnull error) { } failure:^(NSError * _Nonnull error) {
[MBProgressHUD hideHUD]; [MBProgressHUD hideHUD];
...@@ -295,9 +301,48 @@ ...@@ -295,9 +301,48 @@
- (IBAction)treasureBoxClick:(UIButton *)sender { - (IBAction)treasureBoxClick:(UIButton *)sender {
// NSMutableArray * array = [NSMutableArray new];
// WelfareBoxData * data = [[WelfareBoxData alloc]init];
// data.awardNum = 1;
// data.awardType = 1;
// data.boxID = 1;
// data.subType = 2;
// [array addObject:data];
//
// data = [[WelfareBoxData alloc]init];
// data.awardNum = 154;
// data.awardType = 2;
// data.boxID = 2;
// data.subType = 0;
// [array addObject:data];
//
// data = [[WelfareBoxData alloc]init];
// data.awardNum = 8;
// data.awardType = 3;
// data.boxID = 3;
// data.subType = 0;
// [array addObject:data];
//
// DGUniversalAlertView * alertView = [DGUniversalAlertView loadFromNib];
// [alertView configWithWelfareBoxModel:array];
// [alertView showAlertToView:[(AppDelegate *)[UIApplication sharedApplication].delegate getMainWindow]];
//
// return;
WEAKSELF;
[[CGNetworkTools shared] postWithAction:welfare_task_box parameters:@{} success:^(id _Nonnull response) { [[CGNetworkTools shared] postWithAction:welfare_task_box parameters:@{} success:^(id _Nonnull response) {
if (response) { if (response) {
if(weakSelf.coinsProcess >= 6){
weakSelf.coinsProcess -= 6;
}
[weakSelf updateUI];
NSArray * array = response[@"result"][@"data"];
NSMutableArray * dataArray = [WelfareBoxData mj_objectArrayWithKeyValuesArray:array];
DGUniversalAlertView * alertView = [DGUniversalAlertView loadFromNib];
[alertView configWithWelfareBoxModel:dataArray];
[alertView showAlertToView:weakSelf.view];
} }
} failure:^(NSError * _Nonnull error) { } failure:^(NSError * _Nonnull error) {
......
...@@ -52,10 +52,19 @@ ...@@ -52,10 +52,19 @@
<constraint firstAttribute="height" constant="1" id="0Br-kg-Mkw"/> <constraint firstAttribute="height" constant="1" id="0Br-kg-Mkw"/>
</constraints> </constraints>
</imageView> </imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="BackgroundLight" translatesAutoresizingMaskIntoConstraints="NO" id="CTR-NW-hAk">
<rect key="frame" x="297.5" y="12.5" width="85" height="85"/>
<constraints>
<constraint firstAttribute="height" constant="85" id="isH-zN-fKh"/>
<constraint firstAttribute="width" secondItem="CTR-NW-hAk" secondAttribute="height" multiplier="1:1" id="z6A-10-2ER"/>
</constraints>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="PvX-s8-Pxm"> <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"/> <rect key="frame" x="315" y="35" width="50" height="40"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="50" id="AqL-sD-MtI"/> <constraint firstAttribute="width" constant="50" id="AqL-sD-MtI"/>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="50" id="EQP-m9-4dB"/>
<constraint firstAttribute="height" constant="40" id="pK3-VH-oEx"/>
</constraints> </constraints>
<state key="normal" image="TreasureChestClose"/> <state key="normal" image="TreasureChestClose"/>
<connections> <connections>
...@@ -136,8 +145,10 @@ ...@@ -136,8 +145,10 @@
<constraint firstItem="S8p-gf-4z7" firstAttribute="centerY" secondItem="PvX-s8-Pxm" secondAttribute="centerY" id="J7o-Gj-r1w"/> <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="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="PvX-s8-Pxm" firstAttribute="top" secondItem="RPC-kr-Miv" secondAttribute="bottom" constant="8" id="Q76-5G-gA0"/>
<constraint firstItem="CTR-NW-hAk" firstAttribute="centerY" secondItem="PvX-s8-Pxm" secondAttribute="centerY" id="WfN-EX-VKW"/>
<constraint firstItem="RPC-kr-Miv" firstAttribute="centerX" secondItem="PvX-s8-Pxm" secondAttribute="centerX" id="ZnZ-nM-S50"/> <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 firstItem="CdA-K9-h8P" firstAttribute="top" secondItem="D2D-AV-eup" secondAttribute="top" constant="10" id="i4a-bl-9sN"/>
<constraint firstItem="CTR-NW-hAk" firstAttribute="centerX" secondItem="PvX-s8-Pxm" secondAttribute="centerX" id="ptb-gv-XiT"/>
<constraint firstAttribute="bottom" secondItem="PvX-s8-Pxm" secondAttribute="bottom" constant="10" id="qm8-6b-fpD"/> <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 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="eOX-rq-v0m" firstAttribute="leading" secondItem="S8p-gf-4z7" secondAttribute="leading" id="skH-3l-nIp"/>
...@@ -145,8 +156,8 @@ ...@@ -145,8 +156,8 @@
<constraint firstAttribute="trailing" secondItem="PvX-s8-Pxm" secondAttribute="trailing" constant="10" id="wDk-D9-G2s"/> <constraint firstAttribute="trailing" secondItem="PvX-s8-Pxm" secondAttribute="trailing" constant="10" id="wDk-D9-G2s"/>
</constraints> </constraints>
</view> </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"> <tableView clipsSubviews="YES" contentMode="scaleToFill" misplaced="YES" 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"/> <rect key="frame" x="0.0" y="74" width="375" height="582"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor"/>
<color key="sectionIndexBackgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="sectionIndexBackgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<connections> <connections>
...@@ -173,6 +184,7 @@ ...@@ -173,6 +184,7 @@
</view> </view>
</objects> </objects>
<resources> <resources>
<image name="BackgroundLight" width="147.5" height="150"/>
<image name="BottomOfTheBackground" width="375" height="128"/> <image name="BottomOfTheBackground" width="375" height="128"/>
<image name="MissionDiamond" width="17" height="15"/> <image name="MissionDiamond" width="17" height="15"/>
<image name="TreasureChestClose" width="48" height="40"/> <image name="TreasureChestClose" width="48" height="40"/>
......
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