Commit e20e4dbb authored by zhangshuai's avatar zhangshuai

Merge branch 'master' of gitlab.huolea.com:lmi/luckfarm

# Conflicts:
#	GYDemo/GYDemo.xcodeproj/project.pbxproj
#	GYDemo/GYDemo/AppDelegate.mm
parents 6353e428 417178a5
This diff is collapsed.
......@@ -25,6 +25,7 @@
#import "GYCashSixAwardAlertView.h"
#import "WelfareCenterVC.h"
#import "ClockInVC.h"
#import "GYRankingViewController.h"
UnityFramework* UnityFrameworkLoad()
{
......@@ -118,8 +119,16 @@ NSDictionary* appLaunchOpts;
// 跳转上榜
- (void)ios_ranklistClick {
[[CGUserManager shared] addLocCollection:@"show_Leaderboard" value:@""];
[self unityVideo:false];
GYRankingViewController *rankingVC = [[GYRankingViewController alloc] init];
UINavigationController * navc = [[UINavigationController alloc] initWithRootViewController:rankingVC];
navc.modalPresentationStyle = UIModalPresentationFullScreen;
[[[self ufw] appController].window.rootViewController presentViewController:navc animated:YES completion:nil];
return;
GYWebViewController * web = [[GYWebViewController alloc] init];
web.url = [[CGUserManager shared].h5_url objectForKey:@"rankingurl"];
if (web.url == nil || web.url.length == 0) {
......
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ranking_1_icon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ranking_1_icon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ranking_2_icon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ranking_2_icon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ranking_3_icon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ranking_3_icon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ranking_back_icon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ranking_back_icon@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"
......@@ -101,6 +101,7 @@
#import "GYBaseModel.h"
#import <MJExtension/MJExtension.h>
#import <UMCommon/MobClick.h>
#import "UIColor+HExtension.h"
#import "IOSADManager.h" //AD
......
//
// GYRankingListModel.h
// GYDemo
//
// Created by Mazy on 2020/11/20.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface GYRankingListModel : GYBaseModel
@property (nonatomic, assign) NSInteger award;
@property (nonatomic, copy ) NSString * datadate;
@property (nonatomic, assign) NSInteger drip;
@property (nonatomic, copy ) NSString * headImg;
@property (nonatomic, copy ) NSString * nickname;
//@property (nonatomic, assign) NSInteger id;
//@property (nonatomic, assign) NSInteger uid;
@property (nonatomic, assign) NSInteger userRank;
@end
NS_ASSUME_NONNULL_END
//
// GYRankingListModel.m
// GYDemo
//
// Created by Mazy on 2020/11/20.
//
#import "GYRankingListModel.h"
@implementation GYRankingListModel
@end
......@@ -44,12 +44,9 @@ typedef enum : NSUInteger {
cloudCheck, //云朵加速校验
task_process,// 获取福利中心进度
taskListWithStat,//获取福利中心列表和状态
rank_list, //排行榜
ddcy_clock_list, //打卡提现-列表
//
} TQNetwortGetAction;
// POST请求动作枚举
......
......@@ -92,10 +92,10 @@ static CGNetworkTools* _tools = nil;
return @"/app/v2/novel/taskListWithStat";
case task_process:
return @"/app/v1/game/task_process";
case rank_list:
return @"/app/v1/game/farm/rank_list";
case ddcy_clock_list:
return @"/app/v1/game/ddcy/clock_list";
default:
return @"";
}
......
//
// GYRankingFooterView.h
// GYDemo
//
// Created by Mazy on 2020/11/20.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface GYRankingFooterView : UIView
@end
NS_ASSUME_NONNULL_END
//
// GYRankingFooterView.m
// GYDemo
//
// Created by Mazy on 2020/11/20.
//
#import "GYRankingFooterView.h"
@implementation GYRankingFooterView
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="414" height="99"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="140.57971014492756" y="-173.10267857142856"/>
</view>
</objects>
<resources>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
//
// GYRankingHeaderView.h
// GYDemo
//
// Created by Mazy on 2020/11/20.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface GYRankingHeaderView : UIView
+(GYRankingHeaderView *)loadFromNib;
@property (weak, nonatomic) IBOutlet UIView *mainContentView;
@end
NS_ASSUME_NONNULL_END
//
// GYRankingHeaderView.m
// GYDemo
//
// Created by Mazy on 2020/11/20.
//
#import "GYRankingHeaderView.h"
@implementation GYRankingHeaderView
+(GYRankingHeaderView *)loadFromNib {
return [[UINib nibWithNibName:@"GYRankingHeaderView" bundle:nil] instantiateWithOwner:self options:nil].firstObject;
}
- (void)awakeFromNib {
[super awakeFromNib];
self.mainContentView.layer.cornerRadius = 15;
self.mainContentView.layer.borderWidth = 2;
self.mainContentView.layer.borderColor = [UIColor colorWithHex:0x904E1A].CGColor;
}
@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" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
<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 clipsSubviews="YES" contentMode="scaleToFill" id="iN0-l3-epB" customClass="GYRankingHeaderView">
<rect key="frame" x="0.0" y="0.0" width="414" height="50"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="LdK-dh-ill">
<rect key="frame" x="10" y="10" width="394" height="55"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="钻石" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="oZ2-Ql-o18">
<rect key="frame" x="334" y="10" width="60" height="18"/>
<constraints>
<constraint firstAttribute="width" constant="60" id="S2N-O7-A1J"/>
</constraints>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="15"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="今日金币" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hf1-vM-OIO">
<rect key="frame" x="254" y="10" width="70" height="18"/>
<constraints>
<constraint firstAttribute="width" constant="70" id="U3R-Ha-3fv"/>
</constraints>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="15"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="排名" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ITS-e8-Zbr">
<rect key="frame" x="10" y="10" width="120" height="18"/>
<constraints>
<constraint firstAttribute="width" constant="120" id="7D9-wG-NqC"/>
</constraints>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="15"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="用户" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="IKN-ba-AMy">
<rect key="frame" x="130" y="10" width="31" height="18"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="15"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="0.8784313725490196" green="0.56862745098039214" blue="0.30196078431372547" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstItem="ITS-e8-Zbr" firstAttribute="centerY" secondItem="oZ2-Ql-o18" secondAttribute="centerY" id="1Zs-yA-IRG"/>
<constraint firstAttribute="trailing" secondItem="oZ2-Ql-o18" secondAttribute="trailing" id="3wB-uF-Ju5"/>
<constraint firstItem="oZ2-Ql-o18" firstAttribute="leading" secondItem="hf1-vM-OIO" secondAttribute="trailing" constant="10" id="Aha-91-vgx"/>
<constraint firstItem="hf1-vM-OIO" firstAttribute="centerY" secondItem="oZ2-Ql-o18" secondAttribute="centerY" id="X21-Au-sxi"/>
<constraint firstItem="oZ2-Ql-o18" firstAttribute="top" secondItem="LdK-dh-ill" secondAttribute="top" constant="10" id="fSj-Yb-Iwp"/>
<constraint firstItem="IKN-ba-AMy" firstAttribute="centerY" secondItem="ITS-e8-Zbr" secondAttribute="centerY" id="fgz-UW-X7I"/>
<constraint firstItem="IKN-ba-AMy" firstAttribute="leading" secondItem="ITS-e8-Zbr" secondAttribute="trailing" id="h14-JT-y5s"/>
<constraint firstItem="ITS-e8-Zbr" firstAttribute="leading" secondItem="LdK-dh-ill" secondAttribute="leading" constant="10" id="jpg-tH-Jhh"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="HGu-fH-3kS">
<rect key="frame" x="10" y="48" width="394" height="2"/>
<color key="backgroundColor" red="0.56470588235294117" green="0.30588235294117649" blue="0.10196078431372549" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="2" id="WNl-jk-hyg"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" red="0.96862745100000003" green="0.91764705879999997" blue="0.7725490196" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstItem="LdK-dh-ill" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="10" id="4e6-QB-GeO"/>
<constraint firstAttribute="trailing" secondItem="LdK-dh-ill" secondAttribute="trailing" constant="10" id="FLt-W8-evb"/>
<constraint firstItem="LdK-dh-ill" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="10" id="JD7-R1-sGA"/>
<constraint firstItem="HGu-fH-3kS" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="10" id="XhE-dS-ysc"/>
<constraint firstAttribute="bottom" secondItem="LdK-dh-ill" secondAttribute="bottom" constant="-15" id="ZQG-FK-0Uk"/>
<constraint firstAttribute="bottom" secondItem="HGu-fH-3kS" secondAttribute="bottom" id="cft-HW-mBJ"/>
<constraint firstAttribute="trailing" secondItem="HGu-fH-3kS" secondAttribute="trailing" constant="10" id="rIH-dF-lrY"/>
</constraints>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<connections>
<outlet property="mainContentView" destination="LdK-dh-ill" id="9xL-wc-8KM"/>
</connections>
<point key="canvasLocation" x="140.57971014492756" y="-174.77678571428569"/>
</view>
</objects>
</document>
//
// GYRankingUserInfoView.h
// GYDemo
//
// Created by Mazy on 2020/11/20.
//
#import <UIKit/UIKit.h>
#import "GYRankingListModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface GYRankingUserInfoView : UIView
+(GYRankingUserInfoView *)loadFromNib;
@property (weak, nonatomic) IBOutlet UIButton *rankingNumberButton;
@property (weak, nonatomic) IBOutlet UIImageView *userProfileView;
@property (weak, nonatomic) IBOutlet UILabel *nickNameLabel;
@property (weak, nonatomic) IBOutlet UILabel *coinCountLabel;
- (void)configWithRankingListModel: (GYRankingListModel *)model;
@end
NS_ASSUME_NONNULL_END
//
// GYRankingUserInfoView.m
// GYDemo
//
// Created by Mazy on 2020/11/20.
//
#import "GYRankingUserInfoView.h"
#import <UIImageView+AFNetworking.h>
@implementation GYRankingUserInfoView
+(GYRankingUserInfoView *)loadFromNib {
return [[UINib nibWithNibName:@"GYRankingUserInfoView" bundle:nil] instantiateWithOwner:self options:nil].firstObject;
}
- (void)configWithRankingListModel: (GYRankingListModel *)model {
if (model.userRank < 100) {
[self.rankingNumberButton setTitle:[NSString stringWithFormat:@"%ld", model.userRank] forState:UIControlStateNormal];
} else {
[self.rankingNumberButton setTitle: @"99+" forState:UIControlStateNormal];
}
self.nickNameLabel.text = model.nickname;
self.coinCountLabel.text = [NSString stringWithFormat:@"%ld", model.drip];
[self.userProfileView setImageWithURL:[NSURL URLWithString:model.headImg]];
}
@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" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="GYRankingUserInfoView">
<rect key="frame" x="0.0" y="0.0" width="414" height="108"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ycr-kd-pdF">
<rect key="frame" x="10" y="10" width="394" height="60"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="eVz-of-Rjc">
<rect key="frame" x="20" y="15" width="30" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="LI1-rJ-XqK"/>
<constraint firstAttribute="width" constant="30" id="kK9-yW-AsV"/>
</constraints>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="15"/>
<state key="normal" title="99+">
<color key="titleColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
</state>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="今日金币" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="5vI-Wi-aak">
<rect key="frame" x="320.5" y="32" width="53.5" height="16"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" red="0.56470588235294117" green="0.30588235294117649" blue="0.10196078431372549" alpha="0.84705882352941175" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="永树" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Kyo-Nh-yI8">
<rect key="frame" x="120" y="19.5" width="160" height="21.5"/>
<constraints>
<constraint firstAttribute="width" constant="160" id="HeT-Gy-Z5t"/>
</constraints>
<fontDescription key="fontDescription" type="boldSystem" pointSize="18"/>
<color key="textColor" red="0.40000000000000002" green="0.30980392159999998" blue="0.19215686269999999" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="mWb-Pe-9dx">
<rect key="frame" x="60" y="10" width="40" height="40"/>
<color key="backgroundColor" systemColor="systemGroupedBackgroundColor"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="6k0-jr-V0o"/>
<constraint firstAttribute="width" constant="40" id="cgb-Wd-R6i"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<integer key="value" value="20"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="oLF-fm-Xlw">
<rect key="frame" x="364" y="11" width="10" height="18"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="15"/>
<color key="textColor" red="0.56470588239999997" green="0.30588235289999999" blue="0.1019607843" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="1" green="0.93725490196078431" blue="0.78431372549019607" alpha="0.84705882352941175" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="oLF-fm-Xlw" secondAttribute="trailing" constant="20" id="3t7-FB-NXn"/>
<constraint firstItem="oLF-fm-Xlw" firstAttribute="centerY" secondItem="Ycr-kd-pdF" secondAttribute="centerY" constant="-10" id="E9L-ed-wfr"/>
<constraint firstItem="Kyo-Nh-yI8" firstAttribute="centerY" secondItem="Ycr-kd-pdF" secondAttribute="centerY" id="IoJ-LG-DNd"/>
<constraint firstItem="mWb-Pe-9dx" firstAttribute="leading" secondItem="eVz-of-Rjc" secondAttribute="trailing" constant="10" id="Ng5-15-7wD"/>
<constraint firstAttribute="height" constant="60" id="Oms-8Q-ASQ"/>
<constraint firstItem="mWb-Pe-9dx" firstAttribute="centerY" secondItem="Ycr-kd-pdF" secondAttribute="centerY" id="Vs6-8I-A3t"/>
<constraint firstItem="eVz-of-Rjc" firstAttribute="leading" secondItem="Ycr-kd-pdF" secondAttribute="leading" constant="20" id="ZK0-ab-mEu"/>
<constraint firstItem="5vI-Wi-aak" firstAttribute="trailing" secondItem="oLF-fm-Xlw" secondAttribute="trailing" id="dpg-Xy-uI5"/>
<constraint firstItem="Kyo-Nh-yI8" firstAttribute="leading" secondItem="mWb-Pe-9dx" secondAttribute="trailing" constant="20" id="kjN-13-Y9D"/>
<constraint firstItem="5vI-Wi-aak" firstAttribute="centerY" secondItem="Ycr-kd-pdF" secondAttribute="centerY" constant="10" id="mGP-r3-GJk"/>
<constraint firstItem="eVz-of-Rjc" firstAttribute="centerY" secondItem="Ycr-kd-pdF" secondAttribute="centerY" id="pjX-km-1Ne"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<integer key="value" value="5"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="Ycr-kd-pdF" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="10" id="Mqt-Nr-zsg"/>
<constraint firstItem="Ycr-kd-pdF" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="10" id="NmQ-fR-B7k"/>
<constraint firstAttribute="trailing" secondItem="Ycr-kd-pdF" secondAttribute="trailing" constant="10" id="Sgd-9R-L4O"/>
</constraints>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<connections>
<outlet property="coinCountLabel" destination="oLF-fm-Xlw" id="58T-Cx-V5n"/>
<outlet property="nickNameLabel" destination="Kyo-Nh-yI8" id="Rri-ia-QMa"/>
<outlet property="rankingNumberButton" destination="eVz-of-Rjc" id="UZ9-gv-VO5"/>
<outlet property="userProfileView" destination="mWb-Pe-9dx" id="bWp-Hu-qOx"/>
</connections>
<point key="canvasLocation" x="140.57971014492756" y="-160.04464285714286"/>
</view>
</objects>
<resources>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="systemGroupedBackgroundColor">
<color red="0.94901960784313721" green="0.94901960784313721" blue="0.96862745098039216" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>
</document>
//
// GYRankingViewCell.h
// GYDemo
//
// Created by Mazy on 2020/11/20.
//
#import <UIKit/UIKit.h>
#import "GYRankingListModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface GYRankingViewCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UIButton *rankingNumberBtn;
@property (weak, nonatomic) IBOutlet UIImageView *userProfileView;
@property (weak, nonatomic) IBOutlet UILabel *nicknameLabel;
@property (weak, nonatomic) IBOutlet UILabel *coinNumberLabel;
@property (weak, nonatomic) IBOutlet UILabel *diamondLabel;
@property (weak, nonatomic) IBOutlet UIView *bottomView;
- (void)configWithRankingListModel: (GYRankingListModel *)model;
@end
NS_ASSUME_NONNULL_END
//
// GYRankingViewCell.m
// GYDemo
//
// Created by Mazy on 2020/11/20.
//
#import "GYRankingViewCell.h"
#import <AFNetworking/AFNetworking.h>
#import <UIImageView+AFNetworking.h>
#import "UIView+DHExtension.h"
@implementation GYRankingViewCell
- (void)configWithRankingListModel: (GYRankingListModel *)model {
if (model.userRank <= 3) {
[self.rankingNumberBtn setImage:[UIImage imageNamed: [NSString stringWithFormat:@"ranking_%ld_icon", (long)model.userRank]] forState:UIControlStateNormal];
} else {
[self.rankingNumberBtn setImage:nil forState:UIControlStateNormal];
[self.rankingNumberBtn setTitle:[NSString stringWithFormat:@"%ld", model.userRank] forState:UIControlStateNormal];
}
self.nicknameLabel.text = model.nickname;
self.coinNumberLabel.text = [NSString stringWithFormat:@"%ld", model.drip];
self.diamondLabel.text = [NSString stringWithFormat:@"%ld钻", model.award];
[self.userProfileView setImageWithURL:[NSURL URLWithString:model.headImg]];
}
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
// [self.bottomView roundCorners: UIRectCornerBottomLeft | UIRectCornerBottomRight radius:15];
// self.bottomView.layer.bo
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
This diff is collapsed.
//
// WelfareCenterCell.h
// GYDemo
//
// Created by zhangshuai on 2020/11/17.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface WelfareCenterCell : UITableViewCell
@end
NS_ASSUME_NONNULL_END
//
// WelfareCenterCell.m
// GYDemo
//
// Created by zhangshuai on 2020/11/17.
//
#import "WelfareCenterCell.h"
@implementation WelfareCenterCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@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"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="126" id="KGk-i7-Jjw" customClass="WelfareCenterCell">
<rect key="frame" x="0.0" y="0.0" width="320" height="126"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="320" height="126"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="pr8-hQ-LpE">
<rect key="frame" x="0.0" y="0.0" width="320" height="126"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="nDA-SS-B2Z">
<rect key="frame" x="10" y="0.0" width="300" height="114"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="红包赢不停" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1Hi-6u-Z8f">
<rect key="frame" x="14" y="14" width="91" height="26"/>
<fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="18"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="浏览60秒领取奖励" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Go5-7x-zg8">
<rect key="frame" x="14" y="46" width="118" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.59215686274509804" green="0.32941176470588235" blue="0.13725490196078433" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="dyx-aR-S4p">
<rect key="frame" x="200" y="73" width="86" height="34"/>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="16"/>
<state key="normal" title="立即领取" backgroundImage="GetItNow">
<color key="titleColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
</state>
</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"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<state key="normal" title=" +1" image="MissionDiamond">
<color key="titleColor" red="1" green="0.3529411764705882" blue="0.26666666666666666" alpha="1" colorSpace="calibratedRGB"/>
</state>
</button>
</subviews>
<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 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"/>
<constraint firstAttribute="trailing" secondItem="dyx-aR-S4p" secondAttribute="trailing" constant="14" id="RAT-h5-XPA"/>
<constraint firstItem="1Hi-6u-Z8f" firstAttribute="top" secondItem="nDA-SS-B2Z" secondAttribute="top" constant="14" id="ffd-c9-ZHj"/>
<constraint firstItem="dyx-aR-S4p" firstAttribute="top" secondItem="hkj-qT-nh4" secondAttribute="bottom" id="mf8-KH-zK4"/>
<constraint firstItem="1Hi-6u-Z8f" firstAttribute="leading" secondItem="nDA-SS-B2Z" secondAttribute="leading" constant="14" id="qLo-LC-ZZ0"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="masksToBounds" value="YES"/>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<integer key="value" value="8"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
</subviews>
<color key="backgroundColor" red="0.96862745098039216" green="0.74117647058823533" blue="0.48627450980392156" alpha="1" colorSpace="calibratedRGB"/>
<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"/>
<constraint firstItem="nDA-SS-B2Z" firstAttribute="leading" secondItem="pr8-hQ-LpE" secondAttribute="leading" constant="10" id="bZF-4f-w2W"/>
<constraint firstAttribute="bottom" secondItem="nDA-SS-B2Z" secondAttribute="bottom" constant="12" id="zmj-Lz-4EQ"/>
</constraints>
</view>
</subviews>
<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"/>
<constraint firstAttribute="bottom" secondItem="pr8-hQ-LpE" secondAttribute="bottom" id="T5W-Hc-m07"/>
<constraint firstItem="pr8-hQ-LpE" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="tc0-qz-yHg"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
<point key="canvasLocation" x="-343" y="69"/>
</tableViewCell>
</objects>
<resources>
<image name="GetItNow" width="86" height="34"/>
<image name="MissionDiamond" width="17" height="15"/>
</resources>
</document>
//
// WelfareCenterVC.h
// GYDemo
//
// Created by zhangshuai on 2020/11/17.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface WelfareCenterVC : UIViewController
@end
NS_ASSUME_NONNULL_END
//
// WelfareCenterVC.m
// GYDemo
//
// Created by zhangshuai on 2020/11/17.
//
#import "WelfareCenterVC.h"
#import "WelfareCenterCell.h"
#define Identifier @"WelfareCenterCell"
@interface WelfareCenterVC ()
@property (nonatomic, strong) NSMutableArray * dataArray;
@property (weak, nonatomic) IBOutlet UITableView *tableView;
@end
@implementation WelfareCenterVC
- (void)dealloc{
[[NSNotificationCenter defaultCenter]removeObserver:self.tableView];
}
- (NSMutableArray * )dataArray{
if (_dataArray == nil) {
_dataArray = [[NSMutableArray alloc]init];
}
return _dataArray;
}
- (void)viewDidLoad {
[super viewDidLoad];
[self loadData];
[self initTableView];
// Do any additional setup after loading the view from its nib.
}
- (void)initTableView{
self.tableView.rowHeight = UITableViewAutomaticDimension;
self.tableView.estimatedRowHeight = UITableViewAutomaticDimension;
self.tableView.backgroundColor = UIColor.clearColor;//kColorFromHex(0xFAFAFA);
UINib * nib = [UINib nibWithNibName:Identifier bundle:nil];
[self.tableView registerNib:nib forCellReuseIdentifier:Identifier];
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
return 1;
}
- (NSInteger)tableView:(nonnull UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.dataArray.count;
}
- (nonnull UITableViewCell *)tableView:(nonnull UITableView *)tableView cellForRowAtIndexPath:(nonnull NSIndexPath *)indexPath {
// ESMusicListData * data = [self.dataArray objectAtIndex:indexPath.row];
WelfareCenterCell * cell = [tableView dequeueReusableCellWithIdentifier:Identifier forIndexPath:indexPath];
// cell.cellType = self.cellType;
// cell.title.text = data.songName;
// cell.content.text = data.musicCategory;
//// [cell.musicImage setImageWithURL:[NSURL URLWithString:data.musicCover] placeholderImage:[UIImage imageNamed:@"home_top_bg"]];
// [cell.musicImage sd_setImageWithURL:[NSURL URLWithString:data.musicCover] placeholderImage:[UIImage imageNamed:@"home_top_bg"]];
//
// cell.isPlaying = [[MMusicManager shareManager]isPlayingWithModel:data listName:self.albumCategory];
// if (cell.isPlaying) {
// self.indexPath = indexPath;
// }
return cell;
}
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableView *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
return 0;
}
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
UIView*header = [[UIView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, 40)];
UILabel * label = [[UILabel alloc]initWithFrame:CGRectMake(20, 12, KScreenWidth, 20)];
label.text = @"Explore Meditation";
label.textColor = UIColor.whiteColor;
label.font = [UIFont fontWithName:PF_SC_M size:20];
[header addSubview:label];
return header;
}
-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
UIView * sectionView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth,4 )];
return sectionView;
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
return 0;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
[tableView deselectRowAtIndexPath:indexPath animated:NO];
[tableView reloadData];
}
- (void)loadData{
WEAKSELF;
[MBProgressHUD showLoading:@"loading"];
//请求进度
[[CGNetworkTools shared] getWithAction:task_process parameters:@{} success:^(id _Nonnull response) {
} failure:^(NSError * _Nonnull error) {
}];
// 请求列表
[[CGNetworkTools shared] getWithAction:taskListWithStat parameters:@{} success:^(id _Nonnull response) {
} failure:^(NSError * _Nonnull error) {
}];
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<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>
//
// GYRankingViewController.h
// GYDemo
//
// Created by Mazy on 2020/11/20.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface GYRankingViewController : UIViewController
@end
NS_ASSUME_NONNULL_END
//
// GYRankingViewController.m
// GYDemo
//
// Created by Mazy on 2020/11/20.
//
#import "GYRankingViewController.h"
#import "GYRankingViewCell.h"
#import "GYRankingHeaderView.h"
#import "GYRankingListModel.h"
#import "GYRankingUserInfoView.h"
@interface GYRankingViewController ()<UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) NSMutableArray<GYRankingListModel *> *rankList;
@property (nonatomic, strong) GYRankingListModel *userInfo;
@property (nonatomic, strong) GYRankingUserInfoView *infoView;
@end
@implementation GYRankingViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self setupUI];
[self loadRankingList];
}
- (void)setupUI {
self.navigationItem.title = @"排行榜";
self.navigationController.navigationBar.barTintColor = [UIColor colorWithHex:0xE0914D];
self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName:[UIColor whiteColor], NSFontAttributeName: [UIFont systemFontOfSize:20 weight: UIFontWeightBold]};
self.view.backgroundColor = [UIColor colorWithHex:0xF7EAC5];
UIButton *backButton = [UIButton buttonWithType:UIButtonTypeCustom];
backButton.frame = CGRectMake(0, 0, 50, 44);
backButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
[backButton addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];
[backButton setImage:[UIImage imageNamed:@"ranking_back_icon"] forState:UIControlStateNormal];
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:backButton];
self.tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:(UITableViewStylePlain)];
[self.view addSubview:self.tableView];
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.view);
}];
self.tableView.delegate = self;
self.tableView.dataSource = self;
self.tableView.rowHeight = 70;
self.tableView.contentInset = UIEdgeInsetsMake(0, 0, SafeAreaBottomHeight + 30.0, 0);
self.tableView.showsVerticalScrollIndicator = false;
self.tableView.backgroundColor = [UIColor colorWithHex:0xF7EAC5];
self.tableView.separatorStyle = UITableViewCellSelectionStyleNone;
[self.tableView registerNib:[UINib nibWithNibName:@"GYRankingViewCell" bundle:nil] forCellReuseIdentifier:@"GYRankingViewCell"];
[self.tableView registerClass:UITableViewCell.self forCellReuseIdentifier:@"cellid"];
GYRankingUserInfoView *infoView = [GYRankingUserInfoView loadFromNib];
[self.view addSubview:infoView];
[infoView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.bottom.equalTo(self.view);
make.height.mas_equalTo(SafeAreaBottomHeight + 70.0);
}];
self.infoView = infoView;
}
- (void)backAction {
[self.navigationController dismissViewControllerAnimated:true completion:nil];
}
- (void)loadRankingList {
self.rankList = [NSMutableArray array];
WEAKSELF
[[CGNetworkTools shared] getWithAction:rank_list parameters:@{} success:^(id _Nonnull response) {
NSLog(@"%@", response);
if ([[response objectForKey:@"status"] integerValue] == 200) {
NSDictionary *data = [[response objectForKey:@"result"] objectForKey:@"data"];
NSArray *dripList = [data objectForKey:@"dripLeaderboardList"];
for (NSDictionary *dict in dripList) {
GYRankingListModel *model = [[GYRankingListModel alloc] init];
[model setValuesForKeysWithDictionary:dict];
[weakSelf.rankList addObject:model];
}
NSDictionary *userInfo = [data objectForKey:@"userInfo"];
GYRankingListModel *infoModel = [[GYRankingListModel alloc] init];
[infoModel setValuesForKeysWithDictionary:userInfo];
weakSelf.userInfo = infoModel;
[weakSelf.infoView configWithRankingListModel:infoModel];
[weakSelf.tableView reloadData];
}
} failure:^(NSError * _Nonnull error) {
}];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.rankList.count;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return indexPath.row == (self.rankList.count - 1) ? 120 : 70;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
return 50;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
GYRankingHeaderView *headerView = [GYRankingHeaderView loadFromNib];
return headerView;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
GYRankingViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"GYRankingViewCell"];
[cell configWithRankingListModel: self.rankList[indexPath.row]];
return cell;
}
@end
......@@ -326,7 +326,7 @@
// DGUniversalAlertView * alertView = [DGUniversalAlertView loadFromNib];
// [alertView configWithWelfareBoxModel:array];
// [alertView showAlertToView:[(AppDelegate *)[UIApplication sharedApplication].delegate getMainWindow]];
//
//
// return;
WEAKSELF;
......
......@@ -14,17 +14,17 @@
<key>BaiduMobAd_SDK.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>11</integer>
<integer>14</integer>
</dict>
<key>Bytedance-UnionAD.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>7</integer>
<integer>11</integer>
</dict>
<key>GDTMobSDK.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>13</integer>
<integer>12</integer>
</dict>
<key>KSAdSDK.xcscheme_^#shared#^_</key>
<dict>
......@@ -46,7 +46,7 @@
<key>MJRefresh.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>9</integer>
<integer>13</integer>
</dict>
<key>Masonry.xcscheme</key>
<dict>
......@@ -65,12 +65,12 @@
<key>RSPodKSAdaper.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>12</integer>
<integer>7</integer>
</dict>
<key>SigmobAd-iOS.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>8</integer>
<integer>17</integer>
</dict>
<key>SwiftyStoreKit.xcscheme</key>
<dict>
......@@ -82,17 +82,17 @@
<key>UMCCommon.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>6</integer>
<integer>9</integer>
</dict>
<key>VLionAdSDKPoly.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>14</integer>
<integer>15</integer>
</dict>
<key>WechatOpenSDK.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>15</integer>
<integer>16</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
......
......@@ -7,12 +7,12 @@
<key>Unity-iPhone.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>16</integer>
<integer>6</integer>
</dict>
<key>UnityFramework.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>17</integer>
<integer>8</integer>
</dict>
</dict>
</dict>
......
......@@ -5,16 +5,15 @@
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.SymbolicBreakpoint">
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
<BreakpointContent
uuid = "7B3C53C4-533A-4CD7-ADFC-DF88D23DFB13"
uuid = "1E41E607-21A5-45B9-BFEC-2D03EA17A998"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = ""
moduleName = "">
<Locations>
</Locations>
breakpointStackSelectionBehavior = "1"
scope = "1"
stopOnStyle = "0">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
......
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