Commit 85bff1f1 authored by Mazy's avatar Mazy

Merge remote-tracking branch 'refs/remotes/origin/master'

parents c4ced2ab bd403b89
This diff is collapsed.
//
// 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 @@
#import "GYLoginViewController.h"
#import "GYCashSixAwardAlertView.h"
#import "WelfareCenterVC.h"
#import "ClockInVC.h"
#import "GYRankingViewController.h"
UnityFramework* UnityFrameworkLoad()
......@@ -145,24 +146,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
}
}
......@@ -15,13 +15,13 @@
#define GYPrefixHeader_pch
//测试
//#define ServerReport @"http://reporttest.zhangxinhulian.com"
//#define ServerHost @"http://feedapitest2.zhangxinhulian.com" // 服务端接口地址
//#define ServerAds @"http://bstest.zhangxinhulian.com/v4/ads"
#define ServerReport @"http://reporttest.zhangxinhulian.com"
#define ServerHost @"http://feedapitest2.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"
......
......@@ -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"]; }
......
//
// 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
<?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="tableView" destination="cLQ-3z-U9W" id="lrz-YI-VgV"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<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>
<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>
......@@ -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"/>
......
......@@ -10,6 +10,15 @@
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
......
//
// 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
......
This diff is collapsed.
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