Commit 6353e428 authored by zhangshuai's avatar zhangshuai

修改福利中心

parent ca3c6021
......@@ -25,6 +25,9 @@
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 */; };
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 */; };
68A81D1A2566461A003C1BF1 /* UIView+WHView.m in Sources */ = {isa = PBXBuildFile; fileRef = 68A81D112566461A003C1BF1 /* UIView+WHView.m */; };
68A81D1B2566461A003C1BF1 /* ESLyhXibView.m in Sources */ = {isa = PBXBuildFile; fileRef = 68A81D142566461A003C1BF1 /* ESLyhXibView.m */; };
......@@ -155,6 +158,11 @@
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>"; };
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>"; };
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>"; };
......@@ -547,6 +555,8 @@
A91A79C4254024A400F9B216 /* GYOrderInfoModel.m */,
A9AB9D822540672D00F0D766 /* GYDayTaskModel.h */,
A9AB9D832540672D00F0D766 /* GYDayTaskModel.m */,
6882AD1D2567CDEF008CF1F3 /* WelfareBoxData.h */,
6882AD1E2567CDEF008CF1F3 /* WelfareBoxData.m */,
);
path = Model;
sourceTree = "<group>";
......@@ -566,6 +576,9 @@
A91A7960253F188D00F9B216 /* Alert */ = {
isa = PBXGroup;
children = (
6882AD232567CEC1008CF1F3 /* DGUniversalAlertView.h */,
6882AD222567CEC1008CF1F3 /* DGUniversalAlertView.m */,
6882AD242567CEC1008CF1F3 /* DGUniversalAlertView.xib */,
A91A797B253F244F00F9B216 /* GYGiftAlertView.h */,
A91A797C253F244F00F9B216 /* GYGiftAlertView.m */,
A91A7981253F248E00F9B216 /* GYGiftAlertView.xib */,
......@@ -793,6 +806,7 @@
A9AB9D8C25407BBB00F0D766 /* GYSignInCell.xib in Resources */,
A91A79BF25401E3500F9B216 /* GYOrderInfoCell.xib in Resources */,
A91A79AC25400BAD00F9B216 /* GYGiftCell.xib in Resources */,
6882AD262567CEC1008CF1F3 /* DGUniversalAlertView.xib in Resources */,
A9AB9D6A25403E3500F0D766 /* GYTaskAlertCollectionHeaderView.xib in Resources */,
A91A78C8253EE70600F9B216 /* LaunchScreen.storyboard in Resources */,
A91A7884253EE56D00F9B216 /* Assets.xcassets in Resources */,
......@@ -890,6 +904,7 @@
A9AB9D6925403E3500F0D766 /* GYTaskAlertCollectionHeaderView.m in Sources */,
A9AB9D932541222A00F0D766 /* GYWebViewController.m in Sources */,
A91A7950253F14C300F9B216 /* ZJGuideConfig.m in Sources */,
6882AD252567CEC1008CF1F3 /* DGUniversalAlertView.m in Sources */,
A91A7879253EE56B00F9B216 /* AppDelegate.mm in Sources */,
A9AB9D7B254046CB00F0D766 /* WTProgressView.m in Sources */,
A91A7944253F0BBA00F9B216 /* GYSignInModel.m in Sources */,
......@@ -911,6 +926,7 @@
A91A7903253EE8E300F9B216 /* Data.m in Sources */,
A9AB9D7A254046CB00F0D766 /* ProgressView.m in Sources */,
A91A78F3253EE87500F9B216 /* CGNetworkTools.m in Sources */,
6882AD1F2567CDEF008CF1F3 /* WelfareBoxData.m in Sources */,
A91A7963253F192A00F9B216 /* GYRedPacketView.m in Sources */,
A91A78D5253EE75500F9B216 /* CGUserManager.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
//
// DGUniversalAlertView.m
// DodoGarden
//
// Created by Mazy on 2020/11/7.
//
#import "DGUniversalAlertView.h"
@interface DGUniversalAlertView ()
@property (nonatomic, strong) NSMutableArray * dataSource;
@property (weak, nonatomic) IBOutlet UIButton *bottomStatusButton;
@property (weak, nonatomic) IBOutlet UIImageView *topTitleButton;
@end
@implementation DGUniversalAlertView
+(DGUniversalAlertView *)loadFromNib {
return [[UINib nibWithNibName:@"DGUniversalAlertView" bundle:nil] instantiateWithOwner:self options:nil].firstObject;
}
- (void)awakeFromNib {
[super awakeFromNib];
self.mainContentView.transform = CGAffineTransformMakeScale(0.01, 0.01);
}
// 开心收下
- (IBAction)gainRewardAction:(UIButton *)sender {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.30 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
if(self.closeCallBack){
self.closeCallBack();
}
[self hideAlert];
});
}
- (IBAction)dismissAction {
[self hideAlert];
}
- (void)layoutSubviews {
[super layoutSubviews];
self.frame = UIScreen.mainScreen.bounds;
}
- (void)showAlertToView: (UIView *)toView {
[toView addSubview:self];
// [self mas_makeConstraints:^(MASConstraintMaker *make) {
// make.edges.equalTo(self);
// }];
[UIView animateWithDuration:0.15 animations:^{
self.mainContentView.transform = CGAffineTransformMakeScale(1, 1);
} completion:^(BOOL finished) {
}];
}
- (void)hideAlert {
[UIView animateWithDuration:0.15 animations:^{
self.mainContentView.transform = CGAffineTransformMakeScale(0.01, 0.01);
} completion:^(BOOL finished) {
[self removeFromSuperview];
// if (self.dismissedClosure) {
// self.dismissedClosure(false);
// }
}];
}
//- (void)configWithWdResultModel:(DGWdResultModel *)resultModel {
// self.contentStackView.hidden = true;
//
// self.contentLabel.hidden = false;
// self.contentLabel.text = resultModel.reason;
//
// if (resultModel.buttonStatus == 1) {
// self.topTitleButton.image = [UIImage imageNamed:@"title_withdraw_success"];
// } else {
// self.topTitleButton.image = [UIImage imageNamed:@"title_base_alert"];
// }
//
// [self.bottomStatusButton setImage:[UIImage imageNamed:@"convert_continue_get_bg"] forState:UIControlStateNormal];
//
//}
//
////DGWheelSurfModel
//// NSInteger awardType;//奖励类型 1 水滴 2 果子 3 种子 4 金币 5 加速剂 6 现金红包 7钻石
//- (void)configWithSurfModel:(DGWheelSurfModel *)surfModel {
// //奖励类型 1 水滴 2 果子 3 种子 4 金币 5 加速剂 6 现金红包 7钻石
// // _wheelSurfModel = wheelSurfModel;
// // self.topTypeImageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"gift_header_%ld", (long)surfModel.awardType]];
// self.dataSource = [NSMutableArray new];
// switch (surfModel.awardType) {
// case 3:
// self.topTypeImageView.image = [UIImage imageNamed:@"title_gain_seed"];
// self.dataSource = surfModel.extModels;
// break;
// case 4:
// self.topTypeImageView.image = [UIImage imageNamed:@"title_gain_coin"];
// [self.dataSource addObject:[DGExtModel new]];
// break;
// case 5:
// self.topTypeImageView.image = [UIImage imageNamed:@"title_gain_accelerator"];
// [self.dataSource addObject:[DGExtModel new]];
// break;
// case 7:
// self.topTypeImageView.image = [UIImage imageNamed:@"title_gain_diamond"];
// [self.dataSource addObject:[DGExtModel new]];
// break;
// default:
// break;
// }
//
// if (self.dataSource.count == 1) {
// self.firstStackView.hidden = false;
// self.secondStackView.hidden = true;
// self.thirdStackView.hidden = true;
// self.lightImageView.hidden = false;
// } else if (self.dataSource.count == 2) {
// self.firstStackView.hidden = false;
// self.secondStackView.hidden = false;
// self.thirdStackView.hidden = true;
// self.lightImageView.hidden = true;
// } else if (self.dataSource.count == 3) {
// self.firstStackView.hidden = false;
// self.secondStackView.hidden = false;
// self.thirdStackView.hidden = false;
// self.lightImageView.hidden = true;
// }
//
// // NSInteger awardType;//奖励类型 1 水滴 2 果子 3 种子 4 金币 5 加速剂 6 现金红包 7钻石
// for (DGExtModel *model in self.dataSource) {
// if (surfModel.awardType == 4) {
// self.topTypeImageView.image = [UIImage imageNamed:@"title_gain_coin"];
// for (UIImageView *imageV in self.centerGainImageViews) {
// imageV.image = [UIImage imageNamed:@"gift_gold"];
// }
//
// for (UILabel *label in self.gainCountLabels) {
// label.text = [NSString stringWithFormat:@"+%@", surfModel.awardNum];
// }
//
// } else if (surfModel.awardType == 3) {
// self.topTypeImageView.image = [UIImage imageNamed:@"title_gain_seed"];
// for (UIImageView *imageV in self.centerGainImageViews) {
// if (imageV.tag - 1000 == model.id) {
// imageV.image = [UIImage imageNamed:[NSString stringWithFormat:@"gift_seed_%ld", model.id]];
// }
// }
//
// for (UILabel *label in self.gainCountLabels) {
// if (label.tag - 2000 == model.id) {
// label.text = [NSString stringWithFormat:@"+%ld", model.num];
// }
// }
//
// } else { // awardType = 5 加速剂
// self.topTypeImageView.image = [UIImage imageNamed:@"title_gain_accelerator"];
// for (UIImageView *imageV in self.centerGainImageViews) {
// imageV.image = [UIImage imageNamed:@"gift_accelerator"];
// }
//
// for (UILabel *label in self.gainCountLabels) {
// label.text = [NSString stringWithFormat:@"+%@", surfModel.awardNum];
// }
// }
// }
//}
//
//- (void)configWithBoxModel:(DGOpenBoxModel *)boxModel {
// self.boxModel = boxModel;
//
// self.dataSource = [NSMutableArray new];
// switch (_boxModel.type) {
// case 1:
// self.dataSource = _boxModel.seeds;
// break;
// case 2:
// [self.dataSource addObject:[DGExtModel new]];
// break;
// case 3:
// [self.dataSource addObject:[DGExtModel new]];
// break;
// default:
// break;
// }
//
// if (self.dataSource.count == 1) {
// self.firstStackView.hidden = false;
// self.secondStackView.hidden = true;
// self.thirdStackView.hidden = true;
// self.lightImageView.hidden = false;
// } else if (self.dataSource.count == 2) {
// self.firstStackView.hidden = false;
// self.secondStackView.hidden = false;
// self.thirdStackView.hidden = true;
// self.lightImageView.hidden = true;
// } else if (self.dataSource.count == 3) {
// self.firstStackView.hidden = false;
// self.secondStackView.hidden = false;
// self.thirdStackView.hidden = false;
// self.lightImageView.hidden = true;
// }
//
// for (DGExtModel *model in self.dataSource) {
// if (self.boxModel.type == 2) {
// self.topTypeImageView.image = [UIImage imageNamed:@"title_gain_coin"];
// for (UIImageView *imageV in self.centerGainImageViews) {
// // if (imageV.tag - 1000 == model.id) {
// imageV.image = [UIImage imageNamed:@"gift_gold"];
// // }
// }
//
// for (UILabel *label in self.gainCountLabels) {
// // if (label.tag - 2000 == model.id) {
// label.text = [NSString stringWithFormat:@"+%ld", (long)_boxModel.awardNum];
// // }
// }
//
// }else if (_boxModel.type == 1){
// // title_gain_box/
// self.topTypeImageView.image = [UIImage imageNamed:@"title_gain_seed"];
// for (UIImageView *imageV in self.centerGainImageViews) {
// if (imageV.tag - 1000 == model.id) {
// imageV.image = [UIImage imageNamed:[NSString stringWithFormat:@"gift_seed_%ld", model.id]];
// }
// }
//
// for (UILabel *label in self.gainCountLabels) {
// if (label.tag - 2000 == model.id) {
// label.text = [NSString stringWithFormat:@"+%ld", model.num];
// }
// }
//
// }else{ // type = 3 加速剂
// self.topTypeImageView.image = [UIImage imageNamed:@"title_gain_accelerator"];
// for (UIImageView *imageV in self.centerGainImageViews) {
// // if (imageV.tag - 1000 == model.id) {
// imageV.image = [UIImage imageNamed:@"gift_accelerator"];
// // }
// }
//
// for (UILabel *label in self.gainCountLabels) {
// // if (label.tag - 2000 == model.id) {
// label.text = [NSString stringWithFormat:@"+%ld", (long)_boxModel.awardNum];
// // }
// }
// }
// }
//
//}
//显示每日福利宝箱奖励
- (void)configWithWelfareBoxModel:(NSArray *)boxModels;{
self.firstStackView.hidden = false;
self.secondStackView.hidden = false;
self.thirdStackView.hidden = false;
// self.lightImageView.hidden = false;
self.topTypeImageView.image = [UIImage imageNamed:@"title_gain_box"];
self.topTypeImageView.hidden = NO;
NSInteger index = 0;
for (WelfareBoxData * data in boxModels) {
//value = "奖励类型", notes = "1 种子 2 金币 3 加速剂"
UIImageView *imageV = self.centerGainImageViews[index];
UILabel *label = self.gainCountLabels[index];
index += 1;
if (data.awardType == 1) {
imageV.image = [UIImage imageNamed:[NSString stringWithFormat:@"gift_seed_%ld",data.subType]];
label.text = [NSString stringWithFormat:@"+%ld", (long)data.awardNum];
}else if (data.awardType == 2){
imageV.image = [UIImage imageNamed:@"gift_gold"];
label.text = [NSString stringWithFormat:@"+%ld", (long)data.awardNum];
}else if (data.awardType == 3){
imageV.image = [UIImage imageNamed:@"gift_accelerator"];
label.text = [NSString stringWithFormat:@"+%ld", (long)data.awardNum];
}
}
}
@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="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" customClass="DGUniversalAlertView">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="S0K-eJ-Pw8">
<rect key="frame" x="37" y="275.5" width="340" height="355"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="universal_alert_bg_1" translatesAutoresizingMaskIntoConstraints="NO" id="MNk-jL-twi">
<rect key="frame" x="0.0" y="54.5" width="340" height="300.5"/>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="cri-CQ-Md6">
<rect key="frame" x="283.5" y="59.5" width="51.5" height="50.5"/>
<state key="normal" image="universal_alert_cancel_icon"/>
<connections>
<action selector="dismissAction" destination="iN0-l3-epB" eventType="touchUpInside" id="az4-bX-EdD"/>
</connections>
</button>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="universal_alert_bg_2" translatesAutoresizingMaskIntoConstraints="NO" id="5Rj-ay-A2g">
<rect key="frame" x="0.0" y="0.0" width="340" height="342"/>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="title_gain_box" translatesAutoresizingMaskIntoConstraints="NO" id="35R-vx-ECx">
<rect key="frame" x="70" y="30" width="200" height="44"/>
<constraints>
<constraint firstAttribute="width" constant="200" id="VED-Xe-Cf6"/>
<constraint firstAttribute="height" constant="44" id="WfV-0l-UwB"/>
</constraints>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="N4w-cO-H6a">
<rect key="frame" x="56" y="284" width="228" height="41"/>
<state key="normal" image="universal_alert_get_bg"/>
<connections>
<action selector="gainRewardAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="5la-b1-lMF"/>
</connections>
</button>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="7dU-TM-xZl">
<rect key="frame" x="30" y="104" width="280" height="170"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="sws-xe-s8D">
<rect key="frame" x="0.0" y="0.0" width="93.5" height="170"/>
<subviews>
<imageView hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="universal_alert_light_icon" translatesAutoresizingMaskIntoConstraints="NO" id="sjX-c2-RUm">
<rect key="frame" x="0.0" y="0.0" width="93.5" height="160"/>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" tag="1001" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="task_center_coin_icon" translatesAutoresizingMaskIntoConstraints="NO" id="AKw-V6-tAE">
<rect key="frame" x="14.5" y="53" width="64" height="64"/>
<constraints>
<constraint firstAttribute="width" constant="64" id="A5h-fA-GQA"/>
<constraint firstAttribute="height" constant="64" id="bx9-9i-In7"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" tag="2001" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="+1" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="y5Q-rc-eix">
<rect key="frame" x="36" y="136" width="21.5" height="24"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="20"/>
<color key="textColor" red="0.41568627450980389" green="0.13725490196078433" blue="0.10196078431372549" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="y5Q-rc-eix" firstAttribute="centerX" secondItem="sws-xe-s8D" secondAttribute="centerX" id="0Ez-wl-dcu"/>
<constraint firstAttribute="bottom" secondItem="y5Q-rc-eix" secondAttribute="bottom" constant="10" id="9Ur-yN-fXI"/>
<constraint firstItem="AKw-V6-tAE" firstAttribute="centerY" secondItem="sws-xe-s8D" secondAttribute="centerY" id="LCR-BW-Wvk"/>
<constraint firstAttribute="bottom" secondItem="sjX-c2-RUm" secondAttribute="bottom" constant="10" id="Rix-xd-2Ja"/>
<constraint firstAttribute="trailing" secondItem="sjX-c2-RUm" secondAttribute="trailing" id="glo-Eq-cfw"/>
<constraint firstItem="sjX-c2-RUm" firstAttribute="leading" secondItem="sws-xe-s8D" secondAttribute="leading" id="kEb-A7-HcZ"/>
<constraint firstItem="AKw-V6-tAE" firstAttribute="centerX" secondItem="sws-xe-s8D" secondAttribute="centerX" id="ldo-ZL-751"/>
<constraint firstItem="sjX-c2-RUm" firstAttribute="top" secondItem="sws-xe-s8D" secondAttribute="top" id="qLF-yf-LG0"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="LUz-5L-L6l">
<rect key="frame" x="93.5" y="0.0" width="93" height="170"/>
<subviews>
<imageView hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="universal_alert_light_icon" translatesAutoresizingMaskIntoConstraints="NO" id="MCb-xf-3P8">
<rect key="frame" x="0.0" y="0.0" width="93" height="160"/>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" tag="1002" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="task_center_coin_icon" translatesAutoresizingMaskIntoConstraints="NO" id="FBa-xJ-Ddx">
<rect key="frame" x="14.5" y="53" width="64" height="64"/>
<constraints>
<constraint firstAttribute="height" constant="64" id="MGL-B2-R8h"/>
<constraint firstAttribute="width" constant="64" id="lp3-Yy-Ose"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" tag="2002" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="+1" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cjF-fN-3kH">
<rect key="frame" x="36" y="136" width="21.5" height="24"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="20"/>
<color key="textColor" red="0.41568627450000001" green="0.13725490200000001" blue="0.1019607843" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="cjF-fN-3kH" firstAttribute="centerX" secondItem="LUz-5L-L6l" secondAttribute="centerX" id="HYs-05-SPJ"/>
<constraint firstAttribute="bottom" secondItem="cjF-fN-3kH" secondAttribute="bottom" constant="10" id="TEc-qr-HZj"/>
<constraint firstItem="FBa-xJ-Ddx" firstAttribute="centerX" secondItem="LUz-5L-L6l" secondAttribute="centerX" id="ZGz-el-j6D"/>
<constraint firstAttribute="bottom" secondItem="MCb-xf-3P8" secondAttribute="bottom" constant="10" id="epE-E7-8yi"/>
<constraint firstItem="MCb-xf-3P8" firstAttribute="top" secondItem="LUz-5L-L6l" secondAttribute="top" id="jMd-wC-0q6"/>
<constraint firstItem="FBa-xJ-Ddx" firstAttribute="centerY" secondItem="LUz-5L-L6l" secondAttribute="centerY" id="mPF-LO-7UW"/>
<constraint firstItem="MCb-xf-3P8" firstAttribute="leading" secondItem="LUz-5L-L6l" secondAttribute="leading" id="nBL-Bv-nSe"/>
<constraint firstAttribute="trailing" secondItem="MCb-xf-3P8" secondAttribute="trailing" id="zrO-Vm-t4Q"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="PPo-Nc-hS2">
<rect key="frame" x="186.5" y="0.0" width="93.5" height="170"/>
<subviews>
<imageView hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="universal_alert_light_icon" translatesAutoresizingMaskIntoConstraints="NO" id="qBt-eV-cBl">
<rect key="frame" x="0.0" y="0.0" width="93.5" height="160"/>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" tag="1003" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="task_center_coin_icon" translatesAutoresizingMaskIntoConstraints="NO" id="3BQ-2B-80E">
<rect key="frame" x="15" y="53" width="64" height="64"/>
<constraints>
<constraint firstAttribute="width" constant="64" id="5K7-AE-8PB"/>
<constraint firstAttribute="height" constant="64" id="RQX-h3-pxL"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" tag="2003" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="+1" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7ED-I3-oZF">
<rect key="frame" x="36" y="136" width="21.5" height="24"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="20"/>
<color key="textColor" red="0.41568627450000001" green="0.13725490200000001" blue="0.1019607843" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="qBt-eV-cBl" firstAttribute="top" secondItem="PPo-Nc-hS2" secondAttribute="top" id="2zE-HD-QeQ"/>
<constraint firstItem="7ED-I3-oZF" firstAttribute="centerX" secondItem="PPo-Nc-hS2" secondAttribute="centerX" id="AgF-a6-zCu"/>
<constraint firstItem="3BQ-2B-80E" firstAttribute="centerY" secondItem="PPo-Nc-hS2" secondAttribute="centerY" id="B9o-Ie-joe"/>
<constraint firstAttribute="bottom" secondItem="7ED-I3-oZF" secondAttribute="bottom" constant="10" id="GSD-C2-GvP"/>
<constraint firstItem="qBt-eV-cBl" firstAttribute="leading" secondItem="PPo-Nc-hS2" secondAttribute="leading" id="a1u-9Z-Zwt"/>
<constraint firstAttribute="trailing" secondItem="qBt-eV-cBl" secondAttribute="trailing" id="mLf-gt-pRf"/>
<constraint firstItem="3BQ-2B-80E" firstAttribute="centerX" secondItem="PPo-Nc-hS2" secondAttribute="centerX" id="r8n-zp-CcS"/>
<constraint firstAttribute="bottom" secondItem="qBt-eV-cBl" secondAttribute="bottom" constant="10" id="rQB-by-L4R"/>
</constraints>
</view>
</subviews>
</stackView>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="恭喜您成功兑换0.3元红包,您 可以前往微信钱包查看到账情况~" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ykG-Gi-xEC">
<rect key="frame" x="40" y="114" width="260" height="160"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="17"/>
<color key="textColor" red="0.41568627450980389" green="0.13725490196078433" blue="0.10196078431372549" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="cri-CQ-Md6" firstAttribute="top" secondItem="MNk-jL-twi" secondAttribute="top" constant="5" id="6cw-AU-FdR"/>
<constraint firstItem="7dU-TM-xZl" firstAttribute="leading" secondItem="S0K-eJ-Pw8" secondAttribute="leading" constant="30" id="97O-Zr-r9e"/>
<constraint firstAttribute="width" constant="340" id="9jW-1X-ByW"/>
<constraint firstItem="35R-vx-ECx" firstAttribute="top" secondItem="S0K-eJ-Pw8" secondAttribute="top" constant="30" id="APM-r5-cYO"/>
<constraint firstItem="N4w-cO-H6a" firstAttribute="top" secondItem="ykG-Gi-xEC" secondAttribute="bottom" constant="10" id="F3C-5c-5Yd"/>
<constraint firstAttribute="trailing" secondItem="7dU-TM-xZl" secondAttribute="trailing" constant="30" id="Gqz-LX-oRB"/>
<constraint firstAttribute="bottom" secondItem="N4w-cO-H6a" secondAttribute="bottom" constant="30" id="INj-7W-0Kr"/>
<constraint firstItem="N4w-cO-H6a" firstAttribute="centerX" secondItem="S0K-eJ-Pw8" secondAttribute="centerX" id="LVz-tP-tbC"/>
<constraint firstAttribute="trailing" secondItem="ykG-Gi-xEC" secondAttribute="trailing" constant="40" id="WIA-lW-aOO"/>
<constraint firstItem="35R-vx-ECx" firstAttribute="centerX" secondItem="S0K-eJ-Pw8" secondAttribute="centerX" id="aYR-yu-I2Y"/>
<constraint firstItem="ykG-Gi-xEC" firstAttribute="top" secondItem="7dU-TM-xZl" secondAttribute="top" constant="10" id="grP-bP-VUC"/>
<constraint firstItem="5Rj-ay-A2g" firstAttribute="leading" secondItem="S0K-eJ-Pw8" secondAttribute="leading" id="kUn-EW-xtC"/>
<constraint firstAttribute="trailing" secondItem="MNk-jL-twi" secondAttribute="trailing" id="kg5-nc-NAu"/>
<constraint firstAttribute="trailing" secondItem="5Rj-ay-A2g" secondAttribute="trailing" id="m5D-SN-JUx"/>
<constraint firstAttribute="bottom" secondItem="MNk-jL-twi" secondAttribute="bottom" id="pZr-8a-MBs"/>
<constraint firstItem="cri-CQ-Md6" firstAttribute="trailing" secondItem="MNk-jL-twi" secondAttribute="trailing" constant="-5" id="sOI-hv-52a"/>
<constraint firstAttribute="height" constant="355" id="swy-FJ-WSv"/>
<constraint firstItem="MNk-jL-twi" firstAttribute="leading" secondItem="S0K-eJ-Pw8" secondAttribute="leading" id="uJb-V2-QdQ"/>
<constraint firstItem="N4w-cO-H6a" firstAttribute="top" secondItem="7dU-TM-xZl" secondAttribute="bottom" constant="10" id="vjj-H2-QWm"/>
<constraint firstItem="7dU-TM-xZl" firstAttribute="top" secondItem="35R-vx-ECx" secondAttribute="bottom" constant="30" id="vlM-et-p1c"/>
<constraint firstItem="5Rj-ay-A2g" firstAttribute="top" secondItem="S0K-eJ-Pw8" secondAttribute="top" id="yci-vw-x8D"/>
<constraint firstItem="ykG-Gi-xEC" firstAttribute="leading" secondItem="S0K-eJ-Pw8" secondAttribute="leading" constant="40" id="zsY-U5-yZK"/>
</constraints>
</view>
</subviews>
<viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.80000000000000004" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="S0K-eJ-Pw8" firstAttribute="centerX" secondItem="vUN-kp-3ea" secondAttribute="centerX" id="Wxd-gh-i6L"/>
<constraint firstItem="S0K-eJ-Pw8" firstAttribute="centerY" secondItem="vUN-kp-3ea" secondAttribute="centerY" id="yMD-xC-XmL"/>
</constraints>
<connections>
<outlet property="bottomStatusButton" destination="N4w-cO-H6a" id="oCP-qo-sxF"/>
<outlet property="contentLabel" destination="ykG-Gi-xEC" id="geC-Tz-7bB"/>
<outlet property="contentStackView" destination="7dU-TM-xZl" id="2mc-sq-VMS"/>
<outlet property="firstStackView" destination="sws-xe-s8D" id="p0V-Vr-bPG"/>
<outlet property="lightImageView" destination="sjX-c2-RUm" id="qJJ-j1-eJp"/>
<outlet property="mainContentView" destination="S0K-eJ-Pw8" id="GGc-BB-ZNT"/>
<outlet property="secondStackView" destination="LUz-5L-L6l" id="9Qk-1B-xJg"/>
<outlet property="thirdStackView" destination="PPo-Nc-hS2" id="NYZ-4r-u9c"/>
<outlet property="topTitleButton" destination="35R-vx-ECx" id="uoK-gp-Q5H"/>
<outlet property="topTypeImageView" destination="35R-vx-ECx" id="Jj4-NS-Zxe"/>
<outletCollection property="centerGainImageViews" destination="AKw-V6-tAE" id="i0h-vm-Kuo"/>
<outletCollection property="centerGainImageViews" destination="FBa-xJ-Ddx" id="eGp-rW-USC"/>
<outletCollection property="centerGainImageViews" destination="3BQ-2B-80E" id="BuC-g7-gYg"/>
<outletCollection property="gainCountLabels" destination="y5Q-rc-eix" id="Dbc-Jc-mTA"/>
<outletCollection property="gainCountLabels" destination="cjF-fN-3kH" id="IWG-cp-kgJ"/>
<outletCollection property="gainCountLabels" destination="7ED-I3-oZF" id="pso-7V-SsM"/>
</connections>
<point key="canvasLocation" x="140.57971014492756" y="136.60714285714286"/>
</view>
</objects>
<resources>
<image name="task_center_coin_icon" width="18" height="19"/>
<image name="title_gain_box" width="460" height="99"/>
<image name="universal_alert_bg_1" width="340.5" height="300.5"/>
<image name="universal_alert_bg_2" width="310.5" height="342"/>
<image name="universal_alert_cancel_icon" width="51.5" height="50.5"/>
<image name="universal_alert_get_bg" width="228" height="51"/>
<image name="universal_alert_light_icon" width="147.5" height="150"/>
</resources>
</document>
......@@ -24,6 +24,7 @@
#import "GYLoginViewController.h"
#import "GYCashSixAwardAlertView.h"
#import "WelfareCenterVC.h"
#import "ClockInVC.h"
UnityFramework* UnityFrameworkLoad()
{
......@@ -136,24 +137,33 @@ NSDictionary* appLaunchOpts;
// 跳转每日福利
- (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];
web.url = [[CGUserManager shared].h5_url objectForKey:@"welfareurl"];
if (web.url == nil || web.url.length == 0) {
web.url = WelfareURL;
}
WelfareCenterVC * vc = [[WelfareCenterVC alloc]init];
UINavigationController * nav = [[UINavigationController alloc] initWithRootViewController:vc];
nav.modalPresentationStyle = UIModalPresentationFullScreen;
[[[self ufw] appController].window.rootViewController presentViewController:nav
animated:YES
completion:nil];
WEAKSELF
[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
@interface GYWheelSurfModel : GYBaseModel
@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, copy) NSString * countDownSecond;
@property (nonatomic, strong) NSDictionary * extJson;
......@@ -20,6 +20,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, copy) NSString * lotteryNum;
@property (nonatomic, copy) NSString * showVideo;
@property (nonatomic, assign)NSInteger subType; //
@property (nonatomic, strong) NSMutableArray * extModels;
@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;
//Ads请求
- (void)getWithAdsAction: (TQNetwortGetAction)action parameters:(id)parameters success: (void(^)(id response))success failure:(void(^)(NSError * error)) failure {
// get 请求
NSString *urlString = [ServerAds stringByAppendingPathComponent: [self convertGetActionToString:action]];
NSString *urlString = [ServerAds stringByAppendingString: [self convertGetActionToString:action]];
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) {
success(responseObject);
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
......@@ -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 {
// post 请求
NSString *urlString = [ServerReport stringByAppendingPathComponent: [self convertPostActionToString:action]];
NSString *urlString = [ServerReport stringByAppendingString: [self convertPostActionToString:action]];
NSDictionary *dic= parameters;
NSData *data = [NSJSONSerialization dataWithJSONObject:dic options:NSJSONWritingFragmentsAllowed error:nil];
......@@ -316,7 +316,7 @@ static CGNetworkTools* _tools = nil;
} else {
[dict setValue: @"AppStore" forKey: @"source"];
}
// [dict setValue: @"common" forKey: @"source"];
[dict setValue: @"toutiao" forKey: @"source"];
NSString *uid = [[data Read] objectForKey:@"uid"];
if (uid != nil) { [dict setValue: uid forKey: @"uid"]; }
......
......@@ -15,9 +15,24 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"打卡领奖";
[self loadData];
// 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
......
<?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">
<?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>
<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"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
</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="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ClockInVC"/>
<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>
......@@ -8,11 +8,15 @@
#import "WelfareCenterVC.h"
#import "WelfareCenterData.h"
#import "WelfareBoxData.h"
#import "DGUniversalAlertView.h"
#import "WelfareCenterCell.h"
#define Identifier @"WelfareCenterCell"
#import "AppDelegate.h"
#define MAXProcess (6)
@interface WelfareCenterVC ()
......@@ -234,13 +238,14 @@
}
if (self.coinsProcess >= 6) {
[self.treasureBox setBackgroundImage:[UIImage imageNamed:@"OpenTreasureChest"] forState:UIControlStateNormal];
[self.treasureBox setImage:[UIImage imageNamed:@"OpenTreasureChest"] forState:UIControlStateNormal];
}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.tableView reloadData];
}
//MARK: 看广告
......@@ -284,7 +289,8 @@
if ([[response objectForKey:@"status"] integerValue] == 200) {
NSLog(@"welfare_video_report success");
weakSelf.currentData.status = 1;
[weakSelf.tableView reloadData];
weakSelf.coinsProcess += 1;
[weakSelf updateUI];
}
} failure:^(NSError * _Nonnull error) {
[MBProgressHUD hideHUD];
......@@ -295,9 +301,48 @@
- (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) {
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) {
......
......@@ -52,10 +52,19 @@
<constraint firstAttribute="height" constant="1" id="0Br-kg-Mkw"/>
</constraints>
</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">
<rect key="frame" x="315" y="35" width="50" height="40"/>
<constraints>
<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>
<state key="normal" image="TreasureChestClose"/>
<connections>
......@@ -136,8 +145,10 @@
<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="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="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="height" constant="85" id="s0L-kX-UPf"/>
<constraint firstItem="eOX-rq-v0m" firstAttribute="leading" secondItem="S8p-gf-4z7" secondAttribute="leading" id="skH-3l-nIp"/>
......@@ -145,8 +156,8 @@
<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"/>
<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="74" width="375" height="582"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<color key="sectionIndexBackgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<connections>
......@@ -173,6 +184,7 @@
</view>
</objects>
<resources>
<image name="BackgroundLight" width="147.5" height="150"/>
<image name="BottomOfTheBackground" width="375" height="128"/>
<image name="MissionDiamond" width="17" height="15"/>
<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