首次提交
This commit is contained in:
30
SweetParty/主类/音悦新增/房间榜&CP榜/YYRoomCPRankCell.h
Executable file
30
SweetParty/主类/音悦新增/房间榜&CP榜/YYRoomCPRankCell.h
Executable file
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// YYRoomCPRankCell.h
|
||||
// SweetParty
|
||||
//
|
||||
// Created by bj_szd on 2023/12/25.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "YYRoomCPRankModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YYRoomCPRankCell : UITableViewCell
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *bgImgView;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *orderImgV;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *orderLab;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *cpBorderImgV_1;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *cpBorderImgV_2;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *avatarImgV_1;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *nicknameLab_1;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *avatarImgV_2;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *nicknameLab_2;
|
||||
@property (weak, nonatomic) IBOutlet UIView *valueBgView;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *valueLab;
|
||||
|
||||
@property (nonatomic, strong) YYRoomCPRankModel *model;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
43
SweetParty/主类/音悦新增/房间榜&CP榜/YYRoomCPRankCell.m
Executable file
43
SweetParty/主类/音悦新增/房间榜&CP榜/YYRoomCPRankCell.m
Executable file
@@ -0,0 +1,43 @@
|
||||
//
|
||||
// YYRoomCPRankCell.m
|
||||
// SweetParty
|
||||
//
|
||||
// Created by bj_szd on 2023/12/25.
|
||||
//
|
||||
|
||||
#import "YYRoomCPRankCell.h"
|
||||
|
||||
@implementation YYRoomCPRankCell
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
|
||||
self.bgImgView.backgroundColor = [UIColor bm_colorGradientChangeWithSize:CGSizeMake(APPW-30, 120) direction:FXGradientChangeDirectionVertical startColor:HEXCOLOR(0xFFFFFF) endColor:HEXCOLOR(0xC9FFEF)];
|
||||
|
||||
WEAK_SELF
|
||||
[self.avatarImgV_1 dg_Tapped:^{
|
||||
[UIViewController goUserMainpageWith:weakSelf.model.uid withRid:@""];
|
||||
}];
|
||||
[self.avatarImgV_2 dg_Tapped:^{
|
||||
[UIViewController goUserMainpageWith:weakSelf.model.receive_uid withRid:@""];
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)setModel:(YYRoomCPRankModel *)model {
|
||||
_model = model;
|
||||
|
||||
[self.avatarImgV_1 sd_setImageWithURL:[NSURL URLWithString:model.head_pic] placeholderImage:kDefaultUserIcon];
|
||||
self.nicknameLab_1.text = model.nick_name;
|
||||
[self.cpBorderImgV_1 sd_setImageWithURL:[NSURL URLWithString:model.win_base_image]];
|
||||
|
||||
[self.avatarImgV_2 sd_setImageWithURL:[NSURL URLWithString:model.receive_head_pic] placeholderImage:kDefaultUserIcon];
|
||||
self.nicknameLab_2.text = model.receive_nick_name;
|
||||
[self.cpBorderImgV_2 sd_setImageWithURL:[NSURL URLWithString:model.receive_win_base_image]];
|
||||
|
||||
self.valueLab.text = model.total_amount;
|
||||
|
||||
[self.valueBgView layoutIfNeeded];
|
||||
// [self.valueBgView styleGradiBlueColor];
|
||||
}
|
||||
|
||||
@end
|
||||
193
SweetParty/主类/音悦新增/房间榜&CP榜/YYRoomCPRankCell.xib
Executable file
193
SweetParty/主类/音悦新增/房间榜&CP榜/YYRoomCPRankCell.xib
Executable file
@@ -0,0 +1,193 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="22505" 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="22504"/>
|
||||
<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="148" id="KGk-i7-Jjw" customClass="YYRoomCPRankCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="148"/>
|
||||
<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="375" height="148"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="RjH-5t-hgg">
|
||||
<rect key="frame" x="15" y="21" width="345" height="106"/>
|
||||
<subviews>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="hMV-1m-fQt">
|
||||
<rect key="frame" x="0.0" y="0.0" width="345" height="106"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
|
||||
<real key="value" value="16"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</imageView>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="oQI-yR-weZ">
|
||||
<rect key="frame" x="3.5" y="-6" width="100" height="100"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="100" id="61z-tY-oFL"/>
|
||||
<constraint firstAttribute="height" constant="100" id="rCi-bE-V1w"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="39C-49-AOO">
|
||||
<rect key="frame" x="241.5" y="-6" width="100" height="100"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="100" id="Trc-ac-2cl"/>
|
||||
<constraint firstAttribute="height" constant="100" id="wTw-js-dgG"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="4" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3pq-nW-xEQ">
|
||||
<rect key="frame" x="25" y="43" width="8" height="20"/>
|
||||
<fontDescription key="fontDescription" name="DINAlternate-Bold" family="DIN Alternate" pointSize="17"/>
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="default_userIcon" translatesAutoresizingMaskIntoConstraints="NO" id="ui0-ih-Q3t">
|
||||
<rect key="frame" x="51.5" y="18" width="52" height="52"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="52" id="GvE-Ig-iib"/>
|
||||
<constraint firstAttribute="height" constant="52" id="cfF-gM-f6a"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
|
||||
<real key="value" value="26"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
<userDefinedRuntimeAttribute type="color" keyPath="borderColor">
|
||||
<color key="value" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
|
||||
<real key="value" value="1"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="旺仔.牛奶" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="45o-XC-n8z">
|
||||
<rect key="frame" x="51" y="80" width="53.5" height="15"/>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="12"/>
|
||||
<color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="cp_rank_cell_heart" translatesAutoresizingMaskIntoConstraints="NO" id="Ec2-eb-CZk">
|
||||
<rect key="frame" x="133.5" y="5" width="78" height="78"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="78" id="OMi-zv-hMP"/>
|
||||
<constraint firstAttribute="width" constant="78" id="zr0-uA-iCj"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="default_userIcon" translatesAutoresizingMaskIntoConstraints="NO" id="gsR-W2-cAE">
|
||||
<rect key="frame" x="241.5" y="18" width="52" height="52"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="52" id="0el-zd-0bn"/>
|
||||
<constraint firstAttribute="height" constant="52" id="h3W-6e-muR"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
|
||||
<real key="value" value="26"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
<userDefinedRuntimeAttribute type="color" keyPath="borderColor">
|
||||
<color key="value" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
|
||||
<real key="value" value="1"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="旺仔.牛奶" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9R9-Oc-NqV">
|
||||
<rect key="frame" x="241" y="80" width="53.5" height="15"/>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="12"/>
|
||||
<color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="cLn-TO-HLe">
|
||||
<rect key="frame" x="147.5" y="78" width="50" height="18"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="6696" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="u63-Fl-ebH">
|
||||
<rect key="frame" x="8" y="2" width="34" height="14"/>
|
||||
<fontDescription key="fontDescription" name="DINAlternate-Bold" family="DIN Alternate" pointSize="12"/>
|
||||
<color key="textColor" red="0.94901960784313721" green="0.46666666666666667" blue="0.74117647058823533" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="0.5" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="u63-Fl-ebH" secondAttribute="trailing" constant="8" id="T3R-cf-sCd"/>
|
||||
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="50" id="cvX-4r-ycx"/>
|
||||
<constraint firstItem="u63-Fl-ebH" firstAttribute="leading" secondItem="cLn-TO-HLe" secondAttribute="leading" constant="8" id="lef-Kw-0wi"/>
|
||||
<constraint firstAttribute="height" constant="18" id="ua3-Ht-VI1"/>
|
||||
<constraint firstItem="u63-Fl-ebH" firstAttribute="centerY" secondItem="cLn-TO-HLe" secondAttribute="centerY" id="vFa-4R-8Y5"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="color" keyPath="borderColor">
|
||||
<color key="value" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
|
||||
<real key="value" value="9"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstItem="39C-49-AOO" firstAttribute="centerY" secondItem="gsR-W2-cAE" secondAttribute="centerY" id="3b2-kZ-igu"/>
|
||||
<constraint firstItem="Ec2-eb-CZk" firstAttribute="leading" secondItem="ui0-ih-Q3t" secondAttribute="trailing" constant="30" id="EC9-DT-MCV"/>
|
||||
<constraint firstItem="oQI-yR-weZ" firstAttribute="trailing" secondItem="ui0-ih-Q3t" secondAttribute="trailing" id="F1N-Ou-p8S"/>
|
||||
<constraint firstItem="9R9-Oc-NqV" firstAttribute="top" secondItem="gsR-W2-cAE" secondAttribute="bottom" constant="10" id="HXv-FK-cBu"/>
|
||||
<constraint firstItem="gsR-W2-cAE" firstAttribute="leading" secondItem="Ec2-eb-CZk" secondAttribute="trailing" constant="30" id="O0a-wv-RqP"/>
|
||||
<constraint firstItem="39C-49-AOO" firstAttribute="leading" secondItem="gsR-W2-cAE" secondAttribute="leading" id="Pya-mZ-0VB"/>
|
||||
<constraint firstItem="cLn-TO-HLe" firstAttribute="top" secondItem="Ec2-eb-CZk" secondAttribute="bottom" constant="-5" id="Qck-eh-Waq"/>
|
||||
<constraint firstAttribute="bottom" secondItem="hMV-1m-fQt" secondAttribute="bottom" id="TBz-Kx-z1k"/>
|
||||
<constraint firstItem="Ec2-eb-CZk" firstAttribute="top" secondItem="RjH-5t-hgg" secondAttribute="top" constant="5" id="V4D-Ll-rLz"/>
|
||||
<constraint firstItem="gsR-W2-cAE" firstAttribute="centerY" secondItem="ui0-ih-Q3t" secondAttribute="centerY" id="WQK-HG-neb"/>
|
||||
<constraint firstAttribute="height" constant="106" id="art-qs-1oH"/>
|
||||
<constraint firstItem="Ec2-eb-CZk" firstAttribute="centerX" secondItem="RjH-5t-hgg" secondAttribute="centerX" id="cI2-bz-JJC"/>
|
||||
<constraint firstItem="3pq-nW-xEQ" firstAttribute="centerY" secondItem="RjH-5t-hgg" secondAttribute="centerY" id="g2h-WJ-GMJ"/>
|
||||
<constraint firstItem="hMV-1m-fQt" firstAttribute="top" secondItem="RjH-5t-hgg" secondAttribute="top" id="g8h-WX-67p"/>
|
||||
<constraint firstAttribute="trailing" secondItem="hMV-1m-fQt" secondAttribute="trailing" id="kOg-Eb-Vww"/>
|
||||
<constraint firstItem="45o-XC-n8z" firstAttribute="top" secondItem="ui0-ih-Q3t" secondAttribute="bottom" constant="10" id="lXv-H0-DRh"/>
|
||||
<constraint firstItem="3pq-nW-xEQ" firstAttribute="leading" secondItem="RjH-5t-hgg" secondAttribute="leading" constant="25" id="qMP-sk-dBJ"/>
|
||||
<constraint firstItem="ui0-ih-Q3t" firstAttribute="top" secondItem="RjH-5t-hgg" secondAttribute="top" constant="18" id="sDs-Iv-RkT"/>
|
||||
<constraint firstItem="9R9-Oc-NqV" firstAttribute="centerX" secondItem="gsR-W2-cAE" secondAttribute="centerX" id="sc6-vw-HYu"/>
|
||||
<constraint firstItem="45o-XC-n8z" firstAttribute="centerX" secondItem="ui0-ih-Q3t" secondAttribute="centerX" id="xnu-uh-FcV"/>
|
||||
<constraint firstItem="oQI-yR-weZ" firstAttribute="centerY" secondItem="ui0-ih-Q3t" secondAttribute="centerY" id="ydx-Hl-nnV"/>
|
||||
<constraint firstItem="hMV-1m-fQt" firstAttribute="leading" secondItem="RjH-5t-hgg" secondAttribute="leading" id="yjy-KB-a8F"/>
|
||||
<constraint firstItem="cLn-TO-HLe" firstAttribute="centerX" secondItem="Ec2-eb-CZk" secondAttribute="centerX" id="zA6-Y8-iGc"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
|
||||
<real key="value" value="16"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="RjH-5t-hgg" secondAttribute="trailing" constant="15" id="ESs-xE-o1k"/>
|
||||
<constraint firstItem="RjH-5t-hgg" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="e1o-SM-rEZ"/>
|
||||
<constraint firstItem="RjH-5t-hgg" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="pZt-nC-osi"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<connections>
|
||||
<outlet property="avatarImgV_1" destination="ui0-ih-Q3t" id="mr9-6z-3Wv"/>
|
||||
<outlet property="avatarImgV_2" destination="gsR-W2-cAE" id="3jR-pj-yqI"/>
|
||||
<outlet property="bgImgView" destination="hMV-1m-fQt" id="eqJ-E0-Vkq"/>
|
||||
<outlet property="cpBorderImgV_1" destination="oQI-yR-weZ" id="V4g-gq-8ZM"/>
|
||||
<outlet property="cpBorderImgV_2" destination="39C-49-AOO" id="sEP-gd-aYc"/>
|
||||
<outlet property="nicknameLab_1" destination="45o-XC-n8z" id="heA-8x-ufq"/>
|
||||
<outlet property="nicknameLab_2" destination="9R9-Oc-NqV" id="vS1-y0-0RF"/>
|
||||
<outlet property="orderLab" destination="3pq-nW-xEQ" id="K59-WN-ikx"/>
|
||||
<outlet property="valueBgView" destination="cLn-TO-HLe" id="tod-gj-mhL"/>
|
||||
<outlet property="valueLab" destination="u63-Fl-ebH" id="YaN-sP-GF5"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="157" y="99"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="cp_rank_cell_heart" width="78" height="78"/>
|
||||
<image name="default_userIcon" width="512" height="512"/>
|
||||
</resources>
|
||||
</document>
|
||||
27
SweetParty/主类/音悦新增/房间榜&CP榜/YYRoomCPRankModel.h
Executable file
27
SweetParty/主类/音悦新增/房间榜&CP榜/YYRoomCPRankModel.h
Executable file
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// YYRoomCPRankModel.h
|
||||
// SweetParty
|
||||
//
|
||||
// Created by bj_szd on 2024/1/10.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YYRoomCPRankModel : NSObject
|
||||
|
||||
@property(nonatomic, copy) NSString *uid;
|
||||
@property(nonatomic, copy) NSString *head_pic;
|
||||
@property(nonatomic, copy) NSString *nick_name;
|
||||
@property(nonatomic, copy) NSString *receive_uid;
|
||||
@property(nonatomic, copy) NSString *receive_head_pic;
|
||||
@property(nonatomic, copy) NSString *receive_nick_name;
|
||||
@property(nonatomic, copy) NSString *total_amount;
|
||||
|
||||
@property(nonatomic, copy) NSString *win_base_image;
|
||||
@property(nonatomic, copy) NSString *receive_win_base_image;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
12
SweetParty/主类/音悦新增/房间榜&CP榜/YYRoomCPRankModel.m
Executable file
12
SweetParty/主类/音悦新增/房间榜&CP榜/YYRoomCPRankModel.m
Executable file
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// YYRoomCPRankModel.m
|
||||
// SweetParty
|
||||
//
|
||||
// Created by bj_szd on 2024/1/10.
|
||||
//
|
||||
|
||||
#import "YYRoomCPRankModel.h"
|
||||
|
||||
@implementation YYRoomCPRankModel
|
||||
|
||||
@end
|
||||
20
SweetParty/主类/音悦新增/房间榜&CP榜/YYRoomCPRankView.h
Executable file
20
SweetParty/主类/音悦新增/房间榜&CP榜/YYRoomCPRankView.h
Executable file
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// YYRoomCPRankView.h
|
||||
// SweetParty
|
||||
//
|
||||
// Created by bj_szd on 2023/12/25.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YYRoomCPRankView : UIView
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *touchImgV;
|
||||
@property (weak, nonatomic) IBOutlet UITableView *tableView;
|
||||
@property (weak, nonatomic) IBOutlet UIView *titleBgView;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
185
SweetParty/主类/音悦新增/房间榜&CP榜/YYRoomCPRankView.m
Executable file
185
SweetParty/主类/音悦新增/房间榜&CP榜/YYRoomCPRankView.m
Executable file
@@ -0,0 +1,185 @@
|
||||
//
|
||||
// YYRoomCPRankView.m
|
||||
// SweetParty
|
||||
//
|
||||
// Created by bj_szd on 2023/12/25.
|
||||
//
|
||||
|
||||
#import "YYRoomCPRankView.h"
|
||||
#import "YYRoomCPRankCell.h"
|
||||
|
||||
@interface YYRoomCPRankView () <UITableViewDataSource, UITableViewDelegate, JXCategoryViewDelegate>
|
||||
|
||||
@property (nonatomic, strong) NSArray *titles;
|
||||
@property (nonatomic, strong) JXCategoryTitleView *categoryView;
|
||||
|
||||
@property (nonatomic, assign) NSInteger currentIndex;
|
||||
@property (nonatomic, strong) NSMutableArray *dataArray;
|
||||
@property (nonatomic, assign) NSInteger page;
|
||||
|
||||
@end
|
||||
|
||||
@implementation YYRoomCPRankView
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
|
||||
self.titles = @[@"日榜", @"周榜", @"月榜"];
|
||||
self.dataArray = [[NSMutableArray alloc] init];
|
||||
self.page = 1;
|
||||
|
||||
[self createUI];
|
||||
|
||||
[self fetchData];
|
||||
}
|
||||
|
||||
- (void)createUI {
|
||||
WEAK_SELF
|
||||
[self.touchImgV dg_Tapped:^{
|
||||
[weakSelf removeFromSuperview];
|
||||
}];
|
||||
|
||||
[self.titleBgView addSubview:self.categoryView];
|
||||
[self.categoryView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(0);
|
||||
}];
|
||||
|
||||
self.tableView.separatorStyle = NO;
|
||||
self.tableView.delegate = self;
|
||||
self.tableView.dataSource = self;
|
||||
[self.tableView registerNib:[UINib nibWithNibName:@"YYRoomCPRankCell" bundle:nil] forCellReuseIdentifier:@"YYRoomCPRankCell"];
|
||||
self.tableView.rowHeight = 110;
|
||||
//刷新加载
|
||||
self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(refreshFetchData)];
|
||||
self.tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(fetchMoreData)];
|
||||
}
|
||||
|
||||
- (void)fetchData {
|
||||
NSDictionary *params = @{@"time":@(self.currentIndex+1), @"page":@(self.page), @"page_limit":@(10)};
|
||||
[AFNetworkRequset.shared postRequestWithParams:params Path:@"/api/coupling/get_cp_rank" Loading:NO Hud:NO Success:^(id _Nonnull responseDic) {
|
||||
if (self.page == 1) {
|
||||
[self.dataArray removeAllObjects];
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
[self endRefresh];
|
||||
|
||||
NSArray *arr = [YYRoomCPRankModel mj_objectArrayWithKeyValuesArray:responseDic[@"data"][@"list"]];
|
||||
[self.dataArray addObjectsFromArray:arr];
|
||||
|
||||
[self.tableView reloadData];
|
||||
|
||||
if (arr.count > 0) {
|
||||
[self endFooterRefreshWithMore];
|
||||
}else {
|
||||
[self endFooterRefreshWithNoMore];
|
||||
}
|
||||
|
||||
} Failure:^(id _Nonnull errorData) {
|
||||
[self endRefresh];
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)refreshFetchData {
|
||||
self.page = 1;
|
||||
[self fetchData];
|
||||
}
|
||||
|
||||
- (void)fetchMoreData {
|
||||
self.page ++;
|
||||
[self fetchData];
|
||||
}
|
||||
|
||||
- (void)endRefresh {
|
||||
if ([self.tableView.mj_header isRefreshing]) {
|
||||
[self.tableView.mj_header endRefreshing];
|
||||
} else if ([self.tableView.mj_footer isRefreshing]) {
|
||||
[self.tableView.mj_footer endRefreshing];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)endFooterRefreshWithMore{
|
||||
self.tableView.mj_footer.hidden = NO;
|
||||
[self.tableView.mj_footer endRefreshing];
|
||||
}
|
||||
|
||||
-(void)endFooterRefreshWithNoMore{
|
||||
self.tableView.mj_footer.hidden = NO;
|
||||
[self.tableView.mj_footer endRefreshingWithNoMoreData];
|
||||
}
|
||||
|
||||
- (IBAction)onDismiss:(id)sender {
|
||||
[self removeFromSuperview];
|
||||
}
|
||||
|
||||
#pragma mark - Table view data source
|
||||
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
|
||||
return 1;
|
||||
}
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||
return self.dataArray.count;
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
YYRoomCPRankCell *cell = [tableView dequeueReusableCellWithIdentifier:@"YYRoomCPRankCell" forIndexPath:indexPath];
|
||||
cell.selectionStyle = NO;
|
||||
|
||||
YYRoomCPRankModel *model = self.dataArray[indexPath.row];
|
||||
cell.model = model;
|
||||
|
||||
// if (indexPath.row < 3) {
|
||||
// cell.orderImgV.hidden = YES;
|
||||
// cell.orderLab.hidden = YES;
|
||||
// cell.orderImgV.image = [UIImage imageNamed:[NSString stringWithFormat:@"cp_rank_%ld", indexPath.row+1]];
|
||||
// }else {
|
||||
// cell.orderImgV.hidden = YES;
|
||||
// cell.orderLab.hidden = NO;
|
||||
// cell.orderLab.text = [NSString stringWithFormat:@"%ld", indexPath.row+1];
|
||||
// }
|
||||
cell.orderLab.text = [NSString stringWithFormat:@"%02ld", indexPath.row+1];
|
||||
|
||||
|
||||
return cell;
|
||||
}
|
||||
|
||||
- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index {
|
||||
self.currentIndex = index;
|
||||
[self refreshFetchData];
|
||||
}
|
||||
|
||||
// 分页菜单视图
|
||||
- (JXCategoryTitleView *)categoryView {
|
||||
if (!_categoryView) {
|
||||
_categoryView = [[JXCategoryTitleView alloc] init];
|
||||
_categoryView.delegate = self;
|
||||
_categoryView.titleFont = YBMediumFont(14);
|
||||
_categoryView.titleSelectedFont = YBBoldFont(14);
|
||||
_categoryView.titleColor = HEXCOLORA(0xFFFFFF, 1);
|
||||
_categoryView.titleSelectedColor = HEXCOLOR(0xE100E1);
|
||||
_categoryView.cellWidth = 240/3;
|
||||
_categoryView.cellSpacing = 0;
|
||||
_categoryView.contentEdgeInsetLeft = 0;
|
||||
_categoryView.contentEdgeInsetRight = 0;
|
||||
_categoryView.averageCellSpacingEnabled = NO;
|
||||
_categoryView.backgroundColor = HEXCOLORA(0x000000, 0.15);
|
||||
_categoryView.layer.cornerRadius =34/2;
|
||||
_categoryView.layer.masksToBounds = YES;
|
||||
|
||||
_categoryView.titles = self.titles;
|
||||
|
||||
JXCategoryIndicatorBackgroundView *backgroundView = [[JXCategoryIndicatorBackgroundView alloc] init];
|
||||
backgroundView.indicatorHeight = 34;
|
||||
backgroundView.indicatorWidthIncrement = 0;
|
||||
backgroundView.indicatorCornerRadius = 17;
|
||||
// backgroundView.indicatorColor = [UIColor bm_colorGradientChangeWithSize:CGSizeMake(240/3, 34) direction:FXGradientChangeDirectionHorizontal startColor:mainLightColor endColor:mainDeepColor];
|
||||
backgroundView.indicatorColor = kWhiteColor;
|
||||
// backgroundView.layer.borderWidth = 1;
|
||||
// backgroundView.layer.borderColor = HEXCOLOR(0xFFFFFF).CGColor;
|
||||
|
||||
_categoryView.indicators = @[backgroundView];
|
||||
}
|
||||
return _categoryView;
|
||||
}
|
||||
|
||||
@end
|
||||
92
SweetParty/主类/音悦新增/房间榜&CP榜/YYRoomCPRankView.xib
Executable file
92
SweetParty/主类/音悦新增/房间榜&CP榜/YYRoomCPRankView.xib
Executable file
@@ -0,0 +1,92 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="22505" 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="22504"/>
|
||||
<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="YYRoomCPRankView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<imageView clipsSubviews="YES" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="iOi-zt-Uy5">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.29999999999999999" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</imageView>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="PzA-fC-a6k">
|
||||
<rect key="frame" x="0.0" y="312" width="375" height="500"/>
|
||||
<subviews>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="cp_rank_bg" translatesAutoresizingMaskIntoConstraints="NO" id="spi-fw-0TT">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="500"/>
|
||||
</imageView>
|
||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="HLR-ha-zFy">
|
||||
<rect key="frame" x="0.0" y="134" width="375" height="366"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</tableView>
|
||||
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Pro-bV-rEz">
|
||||
<rect key="frame" x="7" y="21" width="30" height="30"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="30" id="1iE-KY-Fxg"/>
|
||||
<constraint firstAttribute="height" constant="30" id="RR4-H2-8ic"/>
|
||||
</constraints>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
||||
<state key="normal" image="whiteBack"/>
|
||||
<connections>
|
||||
<action selector="onDismiss:" destination="iN0-l3-epB" eventType="touchUpInside" id="esP-XN-u1c"/>
|
||||
</connections>
|
||||
</button>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="NVV-r9-dgw">
|
||||
<rect key="frame" x="67.5" y="90" width="240" height="34"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="34" id="61r-as-2hC"/>
|
||||
<constraint firstAttribute="width" constant="240" id="tYG-It-Row"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="HLR-ha-zFy" secondAttribute="bottom" id="428-WV-AXp"/>
|
||||
<constraint firstItem="spi-fw-0TT" firstAttribute="top" secondItem="PzA-fC-a6k" secondAttribute="top" id="5DF-0X-SX5"/>
|
||||
<constraint firstItem="Pro-bV-rEz" firstAttribute="leading" secondItem="PzA-fC-a6k" secondAttribute="leading" constant="7" id="9Ui-UW-vzG"/>
|
||||
<constraint firstItem="Pro-bV-rEz" firstAttribute="top" secondItem="PzA-fC-a6k" secondAttribute="top" constant="21" id="N1M-y7-9Ln"/>
|
||||
<constraint firstItem="spi-fw-0TT" firstAttribute="leading" secondItem="PzA-fC-a6k" secondAttribute="leading" id="V4H-0g-x5k"/>
|
||||
<constraint firstAttribute="trailing" secondItem="HLR-ha-zFy" secondAttribute="trailing" id="WXx-Yx-Oq7"/>
|
||||
<constraint firstItem="NVV-r9-dgw" firstAttribute="top" secondItem="PzA-fC-a6k" secondAttribute="top" constant="90" id="dAT-pc-EpO"/>
|
||||
<constraint firstItem="HLR-ha-zFy" firstAttribute="leading" secondItem="PzA-fC-a6k" secondAttribute="leading" id="iuI-zX-IDy"/>
|
||||
<constraint firstAttribute="bottom" secondItem="spi-fw-0TT" secondAttribute="bottom" id="jcq-og-Vfg"/>
|
||||
<constraint firstItem="NVV-r9-dgw" firstAttribute="centerX" secondItem="PzA-fC-a6k" secondAttribute="centerX" id="k26-of-CTc"/>
|
||||
<constraint firstAttribute="height" constant="500" id="sdD-kW-q9q"/>
|
||||
<constraint firstAttribute="trailing" secondItem="spi-fw-0TT" secondAttribute="trailing" id="uQV-rG-Aew"/>
|
||||
<constraint firstItem="HLR-ha-zFy" firstAttribute="top" secondItem="NVV-r9-dgw" secondAttribute="bottom" constant="10" id="uuW-eh-Pwp"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="PzA-fC-a6k" secondAttribute="bottom" id="9Qz-br-nwq"/>
|
||||
<constraint firstAttribute="trailing" secondItem="PzA-fC-a6k" secondAttribute="trailing" id="CMa-9H-ZNA"/>
|
||||
<constraint firstItem="PzA-fC-a6k" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="QrX-RW-SNp"/>
|
||||
<constraint firstAttribute="trailing" secondItem="iOi-zt-Uy5" secondAttribute="trailing" id="auO-5z-Ce6"/>
|
||||
<constraint firstItem="iOi-zt-Uy5" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="k2y-8M-4VZ"/>
|
||||
<constraint firstAttribute="bottom" secondItem="iOi-zt-Uy5" secondAttribute="bottom" id="mdX-U3-TGT"/>
|
||||
<constraint firstItem="iOi-zt-Uy5" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="wI1-hD-BeC"/>
|
||||
</constraints>
|
||||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
|
||||
<connections>
|
||||
<outlet property="tableView" destination="HLR-ha-zFy" id="8h1-dS-jyE"/>
|
||||
<outlet property="titleBgView" destination="NVV-r9-dgw" id="hL0-Pn-EOb"/>
|
||||
<outlet property="touchImgV" destination="iOi-zt-Uy5" id="9H4-Zl-aAc"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="75" y="-17"/>
|
||||
</view>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="cp_rank_bg" width="375" height="500"/>
|
||||
<image name="whiteBack" width="8.5" height="15"/>
|
||||
</resources>
|
||||
</document>
|
||||
20
SweetParty/主类/音悦新增/房间榜&CP榜/YYRoomRankVC.h
Executable file
20
SweetParty/主类/音悦新增/房间榜&CP榜/YYRoomRankVC.h
Executable file
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// YYRoomRankVC.h
|
||||
// SweetParty
|
||||
//
|
||||
// Created by bj_szd on 2022/6/8.
|
||||
//
|
||||
|
||||
#import "BaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YYRoomRankVC : BaseViewController
|
||||
|
||||
@property(nonatomic, copy) NSString *rid;
|
||||
|
||||
@property(nonatomic, copy) void (^onDismissBlock)(void);
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
132
SweetParty/主类/音悦新增/房间榜&CP榜/YYRoomRankVC.m
Executable file
132
SweetParty/主类/音悦新增/房间榜&CP榜/YYRoomRankVC.m
Executable file
@@ -0,0 +1,132 @@
|
||||
//
|
||||
// YYRoomRankVC.m
|
||||
// SweetParty
|
||||
//
|
||||
// Created by bj_szd on 2022/6/8.
|
||||
//
|
||||
|
||||
#import "YYRoomRankVC.h"
|
||||
#import "SPBangDanDateVC.h"
|
||||
|
||||
@interface YYRoomRankVC ()<JXCategoryListContainerViewDelegate, JXCategoryViewDelegate>
|
||||
|
||||
@property (nonatomic, strong) NSArray *titles;
|
||||
@property (nonatomic, strong) JXCategoryTitleView *categoryView;
|
||||
@property (nonatomic, strong) JXCategoryListContainerView *listContainerView;
|
||||
|
||||
@property (nonatomic, strong) UIImageView *bgImgV;
|
||||
|
||||
@end
|
||||
|
||||
@implementation YYRoomRankVC
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
self.titles = @[@"贡献榜", @"魅力榜"];
|
||||
|
||||
[self createUI];
|
||||
}
|
||||
|
||||
- (void)createUI {
|
||||
self.view.backgroundColor = [kBlackColor colorWithAlphaComponent:0.5];
|
||||
|
||||
UIImageView *imgV = [[UIImageView alloc] initWithImage:ImageNamed(@"room_rank_gx")];
|
||||
[self.view addSubview:imgV];
|
||||
[self.view sendSubviewToBack:imgV];
|
||||
self.bgImgV = imgV;
|
||||
[imgV mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.top.right.mas_equalTo(0);
|
||||
make.height.mas_equalTo(APPW/375.0*360);
|
||||
}];
|
||||
|
||||
[self.view addSubview:self.categoryView];
|
||||
[self.view addSubview:self.listContainerView];
|
||||
|
||||
[self.categoryView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.view).offset(10);
|
||||
make.centerX.equalTo(self.view);
|
||||
make.width.mas_equalTo(200);
|
||||
make.height.mas_equalTo(44);
|
||||
}];
|
||||
[self.listContainerView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.categoryView.mas_bottom);
|
||||
make.left.right.bottom.equalTo(self.view);
|
||||
}];
|
||||
|
||||
// UIButton *backBtn = [ControlCreator createButton:self.view rect:CGRectZero text:nil font:nil color:nil backguoundColor:nil imageName:@"whiteBack" target:self action:@selector(onDismiss)];
|
||||
// [backBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
// make.left.mas_equalTo(7);
|
||||
// make.centerY.equalTo(self.categoryView);
|
||||
// make.width.height.mas_equalTo(30);
|
||||
// }];
|
||||
}
|
||||
|
||||
- (void)onDismiss {
|
||||
if (self.onDismissBlock) {
|
||||
self.onDismissBlock();
|
||||
}
|
||||
}
|
||||
|
||||
// 分页菜单视图
|
||||
- (JXCategoryTitleView *)categoryView {
|
||||
if (!_categoryView) {
|
||||
_categoryView = [[JXCategoryTitleView alloc] init];
|
||||
_categoryView.delegate = self;
|
||||
_categoryView.titleFont = YBMediumFont(14);
|
||||
_categoryView.titleSelectedFont = YBBoldFont(16);
|
||||
_categoryView.titleColor = HEXCOLORA(0x999999, 1);
|
||||
_categoryView.titleSelectedColor = HEXCOLOR(0x333333);
|
||||
|
||||
_categoryView.contentEdgeInsetLeft = 15;
|
||||
_categoryView.contentEdgeInsetRight = 15;
|
||||
|
||||
_categoryView.listContainer = self.listContainerView;
|
||||
_categoryView.titles = self.titles;
|
||||
|
||||
// JXCategoryIndicatorLineView *lineView = [[JXCategoryIndicatorLineView alloc] init];
|
||||
// lineView.indicatorWidth = 11;
|
||||
// lineView.indicatorHeight = 3.5;
|
||||
// lineView.indicatorCornerRadius = 1.75;
|
||||
// lineView.indicatorColor = HEXCOLOR(0xFFFFFF);
|
||||
// lineView.verticalMargin = 2;
|
||||
// lineView.lineStyle = JXCategoryIndicatorLineStyle_Lengthen;
|
||||
// _categoryView.indicators = @[lineView];
|
||||
}
|
||||
return _categoryView;
|
||||
}
|
||||
|
||||
// 列表容器视图
|
||||
- (JXCategoryListContainerView *)listContainerView {
|
||||
if (!_listContainerView) {
|
||||
_listContainerView = [[JXCategoryListContainerView alloc] initWithType:JXCategoryListContainerType_ScrollView delegate:self];
|
||||
}
|
||||
return _listContainerView;
|
||||
}
|
||||
|
||||
- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index {
|
||||
if (index == 0) {
|
||||
self.bgImgV.image = ImageNamed(@"room_rank_gx");
|
||||
}else if (index == 1) {
|
||||
self.bgImgV.image = ImageNamed(@"room_rank_ml");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - JXCategoryListContainerViewDelegate
|
||||
|
||||
// 返回列表的数量
|
||||
- (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView {
|
||||
return self.titles.count;
|
||||
}
|
||||
|
||||
// 返回各个列表菜单下的实例,该实例需要遵守并实现 <JXCategoryListContentViewDelegate> 协议
|
||||
- (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index {
|
||||
SPBangDanDateVC *list = [[SPBangDanDateVC alloc] init];
|
||||
list.rid = self.rid;
|
||||
list.type = index+1;
|
||||
return list;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user