完善首页

This commit is contained in:
chenshuanglin
2023-03-07 20:14:49 +08:00
parent 54cbbbbad0
commit 561bdf07e3
15 changed files with 446 additions and 187 deletions

View File

@@ -18,13 +18,14 @@
14EDBBBC29B6034C001D3E16 /* XPMomentListCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 14EDBBBA29B6034B001D3E16 /* XPMomentListCollectionViewCell.m */; };
14EDBBBF29B60A52001D3E16 /* XPMomentTopicHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 14EDBBBE29B60A52001D3E16 /* XPMomentTopicHeaderView.m */; };
14EDBBC229B60FFE001D3E16 /* XPPartyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 14EDBBC129B60FFE001D3E16 /* XPPartyViewController.m */; };
14F9795E29B6D03B004BBFEB /* ZBCycleVerticalView.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F9795A29B6D03B004BBFEB /* ZBCycleVerticalView.m */; };
14F9795F29B6D03B004BBFEB /* ZBCycleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F9795D29B6D03B004BBFEB /* ZBCycleView.m */; };
14F9796229B6E1DE004BBFEB /* XPMomentTopicHeaderCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F9796129B6E1DE004BBFEB /* XPMomentTopicHeaderCell.m */; };
14F9796529B71189004BBFEB /* XPMonentsEmptyCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F9796429B71189004BBFEB /* XPMonentsEmptyCollectionViewCell.m */; };
14F9796829B71E94004BBFEB /* XPPartyListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F9796729B71E94004BBFEB /* XPPartyListViewController.m */; };
14F9796B29B71EC9004BBFEB /* XPPartyListCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F9796A29B71EC9004BBFEB /* XPPartyListCollectionViewCell.m */; };
14F9796E29B72810004BBFEB /* XPPartyHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F9796D29B72810004BBFEB /* XPPartyHeaderView.m */; };
14F9797129B75B8C004BBFEB /* XPCycleVerticalView.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F9797029B75B8C004BBFEB /* XPCycleVerticalView.m */; };
14F9797429B75C5F004BBFEB /* XPCycleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F9797329B75C5F004BBFEB /* XPCycleView.m */; };
14F9797729B75DF4004BBFEB /* XPHomeMessageScrollModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F9797629B75DF4004BBFEB /* XPHomeMessageScrollModel.m */; };
180116F9279E8C4C00F2CBC0 /* PLTimeUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 180116F8279E8C4C00F2CBC0 /* PLTimeUtil.m */; };
180116FC279E8CCE00F2CBC0 /* NVDate.m in Sources */ = {isa = PBXBuildFile; fileRef = 180116FA279E8CCE00F2CBC0 /* NVDate.m */; };
180806D827293794001FD836 /* NSObject+MJExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = 180806D727293794001FD836 /* NSObject+MJExtension.m */; };
@@ -1307,10 +1308,6 @@
14EDBBBE29B60A52001D3E16 /* XPMomentTopicHeaderView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMomentTopicHeaderView.m; sourceTree = "<group>"; };
14EDBBC029B60FFE001D3E16 /* XPPartyViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPPartyViewController.h; sourceTree = "<group>"; };
14EDBBC129B60FFE001D3E16 /* XPPartyViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPPartyViewController.m; sourceTree = "<group>"; };
14F9795A29B6D03B004BBFEB /* ZBCycleVerticalView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZBCycleVerticalView.m; sourceTree = "<group>"; };
14F9795B29B6D03B004BBFEB /* ZBCycleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZBCycleView.h; sourceTree = "<group>"; };
14F9795C29B6D03B004BBFEB /* ZBCycleVerticalView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZBCycleVerticalView.h; sourceTree = "<group>"; };
14F9795D29B6D03B004BBFEB /* ZBCycleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZBCycleView.m; sourceTree = "<group>"; };
14F9796029B6E1DE004BBFEB /* XPMomentTopicHeaderCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMomentTopicHeaderCell.h; sourceTree = "<group>"; };
14F9796129B6E1DE004BBFEB /* XPMomentTopicHeaderCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMomentTopicHeaderCell.m; sourceTree = "<group>"; };
14F9796329B71189004BBFEB /* XPMonentsEmptyCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMonentsEmptyCollectionViewCell.h; sourceTree = "<group>"; };
@@ -1321,6 +1318,12 @@
14F9796A29B71EC9004BBFEB /* XPPartyListCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPPartyListCollectionViewCell.m; sourceTree = "<group>"; };
14F9796C29B72810004BBFEB /* XPPartyHeaderView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPPartyHeaderView.h; sourceTree = "<group>"; };
14F9796D29B72810004BBFEB /* XPPartyHeaderView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPPartyHeaderView.m; sourceTree = "<group>"; };
14F9796F29B75B8C004BBFEB /* XPCycleVerticalView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPCycleVerticalView.h; sourceTree = "<group>"; };
14F9797029B75B8C004BBFEB /* XPCycleVerticalView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPCycleVerticalView.m; sourceTree = "<group>"; };
14F9797229B75C5F004BBFEB /* XPCycleView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPCycleView.h; sourceTree = "<group>"; };
14F9797329B75C5F004BBFEB /* XPCycleView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPCycleView.m; sourceTree = "<group>"; };
14F9797529B75DF4004BBFEB /* XPHomeMessageScrollModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeMessageScrollModel.h; sourceTree = "<group>"; };
14F9797629B75DF4004BBFEB /* XPHomeMessageScrollModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeMessageScrollModel.m; sourceTree = "<group>"; };
180116F7279E8C4C00F2CBC0 /* PLTimeUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PLTimeUtil.h; sourceTree = "<group>"; };
180116F8279E8C4C00F2CBC0 /* PLTimeUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PLTimeUtil.m; sourceTree = "<group>"; };
180116FA279E8CCE00F2CBC0 /* NVDate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NVDate.m; sourceTree = "<group>"; };
@@ -3664,10 +3667,12 @@
14F9795929B6D020004BBFEB /* CycleVerticalView */ = {
isa = PBXGroup;
children = (
14F9795C29B6D03B004BBFEB /* ZBCycleVerticalView.h */,
14F9795A29B6D03B004BBFEB /* ZBCycleVerticalView.m */,
14F9795B29B6D03B004BBFEB /* ZBCycleView.h */,
14F9795D29B6D03B004BBFEB /* ZBCycleView.m */,
14F9796F29B75B8C004BBFEB /* XPCycleVerticalView.h */,
14F9797029B75B8C004BBFEB /* XPCycleVerticalView.m */,
14F9797229B75C5F004BBFEB /* XPCycleView.h */,
14F9797329B75C5F004BBFEB /* XPCycleView.m */,
14F9797529B75DF4004BBFEB /* XPHomeMessageScrollModel.h */,
14F9797629B75DF4004BBFEB /* XPHomeMessageScrollModel.m */,
);
path = CycleVerticalView;
sourceTree = "<group>";
@@ -4006,7 +4011,6 @@
189DD56C26DF5B5400AB55B1 /* UI */ = {
isa = PBXGroup;
children = (
14F9795929B6D020004BBFEB /* CycleVerticalView */,
E81E09C6290F719C00A1F410 /* Adbvertise */,
E80EC74A28ACD84000D133C5 /* InputView */,
E8998D932859DD3F00C68558 /* UIViewCorner */,
@@ -8497,6 +8501,7 @@
E8C6FFD12754AA6A004DC9F0 /* SubViews */ = {
isa = PBXGroup;
children = (
14F9795929B6D020004BBFEB /* CycleVerticalView */,
9BFC32122924DA930002D5A4 /* HomeSearchHijack */,
9BFC320B2924C0410002D5A4 /* HomeSearchRelateView */,
E8C6FFD22754AA87004DC9F0 /* XPNoteView.h */,
@@ -9863,6 +9868,7 @@
E83ABEF6280E9AD800322EE4 /* MessageContentUnSupportView.m in Sources */,
E8AC721326F46ADD007D6E91 /* XPMineSettingViewController.m in Sources */,
18E7B32126F098650064BC9B /* UserInfoSkillVo.m in Sources */,
14F9797429B75C5F004BBFEB /* XPCycleView.m in Sources */,
E8AC722726F482A4007D6E91 /* XPMineFeedbackPresenter.m in Sources */,
14F9796829B71E94004BBFEB /* XPPartyListViewController.m in Sources */,
E86B911A28102AF90007DEE7 /* SessionToolbarView.m in Sources */,
@@ -9883,6 +9889,7 @@
9B044D9D282D2A6400DE4859 /* XPRoomAnchorRankEnterView.m in Sources */,
E8950180282CAC49007E459A /* XPMonentsUserInfoView.m in Sources */,
9B92C02227E0BD040044C5EA /* XPNobleTrumpetModel.m in Sources */,
14F9797129B75B8C004BBFEB /* XPCycleVerticalView.m in Sources */,
18F404C927609A4300A6C548 /* MessagePresenter.m in Sources */,
9BC9DAEF27E33B3F009EE409 /* XPRoomGiftAnimationParser.m in Sources */,
E8E859CB28264C2300EE4857 /* MultipartMessageHeaderField.m in Sources */,
@@ -9933,7 +9940,6 @@
E816C11527608A7500C84014 /* XPRoomMiniManager.m in Sources */,
E8EEB91726FC7B35007C6EBA /* XPMineUserInfoDesViewController.m in Sources */,
9B1B72AC280031DB003FACE9 /* XPAnchorPKViewController.m in Sources */,
14F9795F29B6D03B004BBFEB /* ZBCycleView.m in Sources */,
E80CBDED27D0D899001E1EC2 /* XPHomeLikeEmptyTableViewCell.m in Sources */,
9BEBBF4329384BB20024E0B4 /* HomeSearchHijackBaseModel.m in Sources */,
180806FB2729A354001FD836 /* ThemeColor+Room.m in Sources */,
@@ -10172,6 +10178,7 @@
E8A1E4512762082A00B294CA /* Api+CandyTree.m in Sources */,
E839533C276A0CCD00CF2F24 /* XPMineCarTableViewCell.m in Sources */,
E8751E7128A6541B0056EF44 /* RoomSailingRankModel.m in Sources */,
14F9797729B75DF4004BBFEB /* XPHomeMessageScrollModel.m in Sources */,
E8E859D928264C2300EE4857 /* DDFileLogger.m in Sources */,
E8EEB8FE26FC2DF8007C6EBA /* XPMineUserInfoCustomNavView.m in Sources */,
E839532A276A002800CF2F24 /* XPMineDressUpViewController.m in Sources */,
@@ -10227,7 +10234,6 @@
E81AF32527F1D5B8003B9E43 /* XPRoomPKProgressView.m in Sources */,
E8DEC99527648FA50078CB70 /* ClientConfig.m in Sources */,
9B6E8577281ABECC0041A321 /* XPRoomInsideRecommendEmptyCell.m in Sources */,
14F9795E29B6D03B004BBFEB /* ZBCycleVerticalView.m in Sources */,
E8E859D628264C2300EE4857 /* DispatchQueueLogFormatter.m in Sources */,
E880B3A6278BD69900A83B0D /* XPAcrossRoomPKTableViewCell.m in Sources */,
E8EEB90926FC579A007C6EBA /* XPMineUserInfoEditTableViewCell.m in Sources */,

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "home_message_arrow@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "home_message_arrow@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 587 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 490 B

View File

@@ -1,33 +0,0 @@
//
// ZBCycleVerticalView.h
// DeRong
//
// Created by 周博 on 2019/1/7.
// Copyright © 2019 周博. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSInteger, ZBCycleVerticalViewScrollDirection) {
ZBCycleVerticalViewScrollDirectionUp = 0,
ZBCycleVerticalViewScrollDirectionDown
};
typedef void(^ClickBlock)(NSInteger index);
@interface ZBCycleVerticalView : UIView
@property (assign, nonatomic) ZBCycleVerticalViewScrollDirection direction;
@property (strong, nonatomic) NSArray *dataArray; // 数据源
@property (copy, nonatomic) ClickBlock block;
// 开启动画(默认是开启的)
- (void)startAnimation;
// 关闭动画
- (void)stopAnimation;
@end
NS_ASSUME_NONNULL_END

View File

@@ -1,19 +0,0 @@
//
// ZBCycleView.h
// CycleVerticalView
//
// Created by 周博 on 2019/1/8.
// Copyright © 2019 EL. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface ZBCycleView : UIView
@property (strong, nonatomic) NSDictionary *dicData;
@end
NS_ASSUME_NONNULL_END

View File

@@ -1,39 +0,0 @@
//
// ZBCycleView.m
// CycleVerticalView
//
// Created by on 2019/1/8.
// Copyright © 2019 EL. All rights reserved.
//
#import "ZBCycleView.h"
@interface ZBCycleView ()
@property (strong, nonatomic) UILabel *titleLabel;
@end
@implementation ZBCycleView
- (instancetype)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame];
if (self) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.font = [UIFont systemFontOfSize:15];
_titleLabel.textColor = [UIColor blackColor];
[self addSubview:_titleLabel];
}
return self;
}
- (void)layoutSubviews{
[super layoutSubviews];
_titleLabel.frame = CGRectMake(15, 0, CGRectGetWidth(self.frame)-30, CGRectGetHeight(self.frame));
}
- (void)setDicData:(NSDictionary *)dicData{
_dicData = dicData;
_titleLabel.text = dicData[@"TITLE"];
}
@end

View File

@@ -0,0 +1,34 @@
//
// XPCycleVerticalView.h
// xplan-ios
//
// Created by XY on 2023/3/7.
//
#import <UIKit/UIKit.h>
@class XPHomeMessageScrollModel;
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSInteger, XPCycleVerticalViewScrollDirection) {
XPCycleVerticalViewScrollDirectionUp = 0,
XPCycleVerticalViewScrollDirectionDown
};
typedef void(^ClickBlock)(NSInteger index);
@interface XPCycleVerticalView : UIView
@property (assign, nonatomic) XPCycleVerticalViewScrollDirection direction;
@property (strong, nonatomic) NSArray<XPHomeMessageScrollModel*> *dataArray; // 数据源
@property (copy, nonatomic) ClickBlock block;
// 开启动画(默认是开启的)
- (void)startAnimation;
// 关闭动画
- (void)stopAnimation;
@end
NS_ASSUME_NONNULL_END

View File

@@ -1,39 +1,36 @@
//
// ZBCycleVerticalView.m
// DeRong
// XPCycleVerticalView.m
// xplan-ios
//
// Created by on 2019/1/7.
// Copyright © 2019 . All rights reserved.
// Created by XY on 2023/3/7.
//
#import "ZBCycleVerticalView.h"
#import "ZBCycleView.h"
#import "XPCycleVerticalView.h"
#import "XPCycleView.h"
@interface ZBCycleVerticalView ()
{
@interface XPCycleVerticalView () {
CGRect _topRect; //View
CGRect _middleRect;//View
CGRect _btmRect; //View
double _showTime; //timer
double _animationTime;//
UIButton *_button; //
NSTimer *_timer; //
NSInteger _indexNow; //
}
@property (strong, nonatomic) ZBCycleView *view1;
@property (strong, nonatomic) ZBCycleView *view2;
@property (strong, nonatomic) XPCycleView *view1;
@property (strong, nonatomic) XPCycleView *view2;
@property (strong, nonatomic) ZBCycleView *tmpTopView;
@property (strong, nonatomic) ZBCycleView *tmpMiddleView;
@property (strong, nonatomic) ZBCycleView *tmpBtmView;
@property (strong, nonatomic) XPCycleView *tmpTopView;
@property (strong, nonatomic) XPCycleView *tmpMiddleView;
@property (strong, nonatomic) XPCycleView *tmpBtmView;
@end
@implementation ZBCycleVerticalView
- (instancetype)initWithFrame:(CGRect)frame{
@implementation XPCycleVerticalView
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
_showTime = 3;
@@ -43,7 +40,7 @@
return self;
}
- (instancetype)initWithCoder:(NSCoder *)aDecoder{
- (instancetype)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
if (self) {
_showTime = 3;
@@ -53,7 +50,7 @@
return self;
}
- (void)layoutSubviews{
- (void)layoutSubviews {
[super layoutSubviews];
_middleRect = self.bounds;
@@ -61,16 +58,16 @@
_btmRect = CGRectMake(0, CGRectGetHeight(self.frame), CGRectGetWidth(self.frame), CGRectGetHeight(self.frame));
self.view1.frame = _middleRect;
self.view2.frame = self.direction == ZBCycleVerticalViewScrollDirectionDown ? self->_topRect : self->_btmRect;
self.view2.frame = self.direction == XPCycleVerticalViewScrollDirectionDown ? self->_topRect : self->_btmRect;
_button.frame = _middleRect;
}
- (void)initUI{
self.view1 = [[ZBCycleView alloc]init];
// self.view1.backgroundColor = [UIColor clearColor];
- (void)initUI {
self.view1 = [[XPCycleView alloc]init];
// self.view1.backgroundColor = [UIColor clearColor];
self.view2 = [[ZBCycleView alloc]init];
// self.view2.backgroundColor = [UIColor clearColor];
self.view2 = [[XPCycleView alloc]init];
// self.view2.backgroundColor = [UIColor clearColor];
[self addSubview:self.view1];
[self addSubview:self.view2];
@@ -84,17 +81,17 @@
}
//
- (void)executeAnimation{
- (void)executeAnimation {
[self setViewInfo];
[UIView animateWithDuration:_animationTime delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
self.tmpMiddleView.frame = self.direction == ZBCycleVerticalViewScrollDirectionDown ? self->_btmRect : self->_topRect;
if (self->_direction == ZBCycleVerticalViewScrollDirectionDown) {
self.tmpMiddleView.frame = self.direction == XPCycleVerticalViewScrollDirectionDown ? self->_btmRect : self->_topRect;
if (self->_direction == XPCycleVerticalViewScrollDirectionDown) {
self.tmpTopView.frame = self->_middleRect;
} else {
self.tmpBtmView.frame = self->_middleRect;
}
}completion:^(BOOL finished) {
self.tmpMiddleView.frame = self->_direction == ZBCycleVerticalViewScrollDirectionDown ? self->_topRect : self->_btmRect;
self.tmpMiddleView.frame = self->_direction == XPCycleVerticalViewScrollDirectionDown ? self->_topRect : self->_btmRect;
if (self->_indexNow < self.dataArray.count - 1) {
self->_indexNow ++;
}else{
@@ -104,12 +101,12 @@
}
#pragma mark - set
- (void)setDirection:(ZBCycleVerticalViewScrollDirection)direction{
- (void)setDirection:(XPCycleVerticalViewScrollDirection)direction {
_direction = direction;
self.view2.frame = _direction == ZBCycleVerticalViewScrollDirectionDown ? _topRect : _btmRect;
self.view2.frame = _direction == XPCycleVerticalViewScrollDirectionDown ? _topRect : _btmRect;
}
- (void)setDataArray:(NSArray *)dataArray{
- (void)setDataArray:(NSArray *)dataArray {
_dataArray = dataArray;
if (![_timer isValid]) {
_indexNow = 0;
@@ -117,8 +114,8 @@
}
}
- (void)setViewInfo{
if (_direction == ZBCycleVerticalViewScrollDirectionDown) {
- (void)setViewInfo {
if (_direction == XPCycleVerticalViewScrollDirectionDown) {
if (self.view1.frame.origin.y == 0) {
_tmpMiddleView = self.view1;
_tmpTopView = self.view2;
@@ -135,17 +132,17 @@
_tmpBtmView = self.view1;
}
}
_tmpMiddleView.dicData = _dataArray[_indexNow%(_dataArray.count)];
_tmpMiddleView.infoModel = _dataArray[_indexNow%(_dataArray.count)];
if(_dataArray.count > 1){
if (_direction == ZBCycleVerticalViewScrollDirectionDown) {
_tmpTopView.dicData = _dataArray[(_indexNow+1)%(_dataArray.count)];
if (_direction == XPCycleVerticalViewScrollDirectionDown) {
_tmpTopView.infoModel = _dataArray[(_indexNow+1)%(_dataArray.count)];
} else {
_tmpBtmView.dicData = _dataArray[(_indexNow+1)%(_dataArray.count)];
_tmpBtmView.infoModel = _dataArray[(_indexNow+1)%(_dataArray.count)];
}
}
}
- (void)startAnimation{
- (void)startAnimation {
[self setViewInfo];
if (_dataArray.count > 1) {
[self stopTimer];
@@ -154,14 +151,14 @@
}
}
- (void)stopAnimation{
- (void)stopAnimation {
[self stopTimer];
[self.layer removeAllAnimations];
[NSObject cancelPreviousPerformRequestsWithTarget:self];
}
#pragma mark -
- (void)stopTimer{
- (void)stopTimer {
if(_timer){
if([_timer isValid]){
[_timer invalidate];
@@ -170,10 +167,11 @@
}
}
- (void)btnClick{
- (void)btnClick {
if (self.block) {
self.block(_indexNow);
}
}
@end

View File

@@ -0,0 +1,20 @@
//
// XPCycleView.h
// xplan-ios
//
// Created by XY on 2023/3/7.
//
#import <UIKit/UIKit.h>
@class XPHomeMessageScrollModel;
NS_ASSUME_NONNULL_BEGIN
@interface XPCycleView : UIView
@property (nonatomic, strong) XPHomeMessageScrollModel *infoModel;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,186 @@
//
// XPCycleView.m
// xplan-ios
//
// Created by XY on 2023/3/7.
//
#import "XPCycleView.h"
#import "NetImageView.h"
#import "ThemeColor.h"
#import <Masonry.h>
#import "XPHomeMessageScrollModel.h"
@interface XPCycleView ()
@property (nonatomic, strong) UIStackView *stackView;
///
@property (nonatomic, strong) NetImageView *senderAvatarImageView;
///
@property (nonatomic, strong) UILabel *senderNameLabel;
///
@property (nonatomic, strong) UILabel *senderTextLabel;
///
@property (nonatomic, strong) NetImageView *receiverAvatarImageView;
///
@property (nonatomic, strong) UILabel *receiverNameLabel;
///
@property (nonatomic, strong) UILabel *giftNameLabel;
///
@property (nonatomic, strong) NetImageView *giftImageView;
///
@property (nonatomic, strong) UILabel *numLabel;
@end
@implementation XPCycleView
- (instancetype)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame];
if (self) {
[self initSubViews];
}
return self;
}
- (void)initSubViews {
[self addSubview:self.stackView];
[self.stackView addArrangedSubview:self.senderAvatarImageView];
[self.stackView addArrangedSubview:self.senderNameLabel];
[self.stackView addArrangedSubview:self.senderTextLabel];
[self.stackView addArrangedSubview:self.receiverAvatarImageView];
[self.stackView addArrangedSubview:self.receiverNameLabel];
[self.stackView addArrangedSubview:self.giftNameLabel];
[self.stackView addArrangedSubview:self.giftImageView];
[self.stackView addArrangedSubview:self.numLabel];
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(15);
make.top.bottom.mas_equalTo(0);
make.right.mas_lessThanOrEqualTo(0);
}];
[self.senderAvatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(24, 24));
}];
[self.receiverAvatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(24, 24));
}];
[self.giftImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(24, 24));
}];
}
- (void)setInfoModel:(XPHomeMessageScrollModel *)infoModel {
_infoModel = infoModel;
self.senderAvatarImageView.imageUrl = infoModel.senderAvatar;
self.senderNameLabel.text = infoModel.senderName;
self.receiverAvatarImageView.imageUrl = infoModel.receiverAvatar;
self.receiverNameLabel.text = infoModel.receiverName;
self.giftNameLabel.text = infoModel.giftName;
self.giftImageView.imageUrl = infoModel.giftUrl;
self.numLabel.text = [NSString stringWithFormat:@"x%@",infoModel.num];
}
- (UIStackView *)stackView {
if (!_stackView) {
_stackView = [[UIStackView alloc] init];
_stackView.axis = UILayoutConstraintAxisHorizontal;
_stackView.distribution = UIStackViewDistributionFill;
_stackView.alignment = UIStackViewAlignmentCenter;
_stackView.spacing = 5;
}
return _stackView;
}
- (NetImageView *)senderAvatarImageView {
if (!_senderAvatarImageView) {
NetImageConfig * config = [[NetImageConfig alloc] init];
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
config.imageType = ImageTypeUserIcon;
_senderAvatarImageView = [[NetImageView alloc] initWithConfig:config];
_senderAvatarImageView.userInteractionEnabled = YES;
_senderAvatarImageView.layer.masksToBounds = YES;
_senderAvatarImageView.layer.cornerRadius = 12;
_senderAvatarImageView.contentMode = UIViewContentModeScaleAspectFill;
}
return _senderAvatarImageView;
}
- (UILabel *)senderNameLabel {
if (!_senderNameLabel) {
_senderNameLabel = [[UILabel alloc] init];
_senderNameLabel.textColor = [ThemeColor mainTextColor];
_senderNameLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
}
return _senderNameLabel;
}
- (UILabel *)senderTextLabel {
if (!_senderTextLabel) {
_senderTextLabel = [[UILabel alloc] init];
_senderTextLabel.text = @"赠送";
_senderTextLabel.textColor = [ThemeColor colorWithHexString:@"#FFC061"];
_senderTextLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
}
return _senderTextLabel;
}
- (NetImageView *)receiverAvatarImageView {
if (!_receiverAvatarImageView) {
NetImageConfig * config = [[NetImageConfig alloc] init];
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
config.imageType = ImageTypeUserIcon;
_receiverAvatarImageView = [[NetImageView alloc] initWithConfig:config];
_receiverAvatarImageView.userInteractionEnabled = YES;
_receiverAvatarImageView.layer.masksToBounds = YES;
_receiverAvatarImageView.layer.cornerRadius = 12;
_receiverAvatarImageView.contentMode = UIViewContentModeScaleAspectFill;
}
return _receiverAvatarImageView;
}
- (UILabel *)receiverNameLabel {
if (!_receiverNameLabel) {
_receiverNameLabel = [[UILabel alloc] init];
_receiverNameLabel.textColor = [ThemeColor mainTextColor];
_receiverNameLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
}
return _receiverNameLabel;
}
- (UILabel *)giftNameLabel {
if (!_giftNameLabel) {
_giftNameLabel = [[UILabel alloc] init];
_giftNameLabel.textColor = [ThemeColor colorWithHexString:@"#FFC061"];
_giftNameLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
}
return _giftNameLabel;
}
- (NetImageView *)giftImageView {
if (!_giftImageView) {
NetImageConfig * config = [[NetImageConfig alloc] init];
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
config.imageType = ImageTypeRoomGift;
_giftImageView = [[NetImageView alloc] initWithConfig:config];
_giftImageView.userInteractionEnabled = YES;
_giftImageView.layer.masksToBounds = YES;
_giftImageView.layer.cornerRadius = 12;
_giftImageView.contentMode = UIViewContentModeScaleAspectFill;
}
return _giftImageView;
}
- (UILabel *)numLabel {
if (!_numLabel) {
_numLabel = [[UILabel alloc] init];
_numLabel.textColor = [ThemeColor textThirdColor];
_numLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
}
return _numLabel;
}
@end

View File

@@ -0,0 +1,31 @@
//
// XPHomeMessageScrollModel.h
// xplan-ios
//
// Created by XY on 2023/3/7.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface XPHomeMessageScrollModel : NSObject
/// 赠送者头像
@property (nonatomic, copy) NSString *senderAvatar;
/// 赠送者昵称
@property (nonatomic, copy) NSString *senderName;
/// 接收者头像
@property (nonatomic, copy) NSString *receiverAvatar;
/// 接收者昵称
@property (nonatomic, copy) NSString *receiverName;
/// 礼物名称
@property (nonatomic, copy) NSString *giftName;
/// 礼物图片
@property (nonatomic, copy) NSString *giftUrl;
/// 礼物数量
@property (nonatomic, copy) NSString *num;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,12 @@
//
// XPHomeMessageScrollModel.m
// xplan-ios
//
// Created by XY on 2023/3/7.
//
#import "XPHomeMessageScrollModel.h"
@implementation XPHomeMessageScrollModel
@end

View File

@@ -8,10 +8,12 @@
#import "XPNewHomeHeaderView.h"
///Third
#import <Masonry.h>
#import "ZBCycleVerticalView.h"
#import "XPCycleVerticalView.h"
///Tool
#import "XPMacro.h"
#import "ThemeColor.h"
///Model
#import "XPHomeMessageScrollModel.h"
@interface XPNewHomeHeaderView()
@@ -27,7 +29,8 @@
///
@property (nonatomic, strong) UIImageView *hotView;
@property (nonatomic, strong) UILabel *hotTextLabel;
@property (nonatomic, strong) ZBCycleVerticalView *messageView;
@property (nonatomic, strong) XPCycleVerticalView *messageView;
@property (nonatomic, strong) UIImageView *arrowImageView;
@end
@@ -54,6 +57,7 @@
[self addSubview:self.hotView];
[self.hotView addSubview:self.hotTextLabel];
[self.hotView addSubview:self.messageView];
[self.hotView addSubview:self.arrowImageView];
}
- (void)initSubViewConstraints {
@@ -102,12 +106,19 @@
[self.hotTextLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.mas_equalTo(0);
make.width.mas_equalTo(70);
make.height.mas_equalTo(self.hotView.mas_height).multipliedBy(0.5);
make.height.mas_equalTo(self.hotView.mas_height).multipliedBy(0.34);
}];
[self.messageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.bottom.mas_equalTo(0);
make.height.mas_equalTo(self.hotView.mas_height).multipliedBy(0.5);
make.left.bottom.mas_equalTo(0);
make.height.mas_equalTo(self.hotView.mas_height).multipliedBy(0.66);
make.right.mas_equalTo(self.arrowImageView.mas_left).offset(-10);
}];
[self.arrowImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-10);
make.centerY.mas_equalTo(self.messageView);
make.size.mas_equalTo(CGSizeMake(18, 18));
}];
}
@@ -155,20 +166,24 @@
- (void)setMessageScroll {
//
NSArray *array = @[
@{
@"TITLE" : @"1华为冀今年香港手机市场占有率提高至24 7月开首间旗舰店",
},
@{
@"TITLE" : @"2北京大兴国际机场迎来第一架飞机",
},
@{
@"TITLE" : @"3春运首日 零陵汽车站客运平稳有序",
},
@{
@"TITLE" : @"4吴秀波出轨风波后和白百何主演的《情圣2》突然提档",
}
];
XPHomeMessageScrollModel *model1 = [[XPHomeMessageScrollModel alloc] init];
model1.senderName = @"小半";
model1.receiverName = @"大半";
model1.giftName = @"星语星愿";
model1.num = @"1";
XPHomeMessageScrollModel *model2 = [[XPHomeMessageScrollModel alloc] init];
model2.senderName = @"小老弟";
model2.receiverName = @"大老弟";
model2.giftName = @"宇宙飞船";
model2.num = @"1";
XPHomeMessageScrollModel *model3 = [[XPHomeMessageScrollModel alloc] init];
model3.senderName = @"心心念念";
model3.receiverName = @"乔碧萝";
model3.giftName = @"大火箭";
model3.num = @"1";
NSArray *array = @[model1, model2, model3];
self.messageView.dataArray = array;
}
@@ -229,12 +244,21 @@
return _hotTextLabel;
}
- (ZBCycleVerticalView *)messageView {
- (XPCycleVerticalView *)messageView {
if (!_messageView) {
_messageView = [[ZBCycleVerticalView alloc] init];
_messageView.direction = ZBCycleVerticalViewScrollDirectionUp;
_messageView = [[XPCycleVerticalView alloc] init];
_messageView.direction = XPCycleVerticalViewScrollDirectionUp;
}
return _messageView;
}
- (UIImageView *)arrowImageView {
if (!_arrowImageView) {
_arrowImageView = [[UIImageView alloc] init];
_arrowImageView.image = [UIImage imageNamed:@"home_message_arrow"];
_arrowImageView.contentMode = UIViewContentModeScaleAspectFit;
}
return _arrowImageView;
}
@end

View File

@@ -63,6 +63,7 @@
@property (nonatomic, strong) JXPagerView *pagingView;
@property (nonatomic, strong) NSArray<NSString *> *titles;
@property (nonatomic, strong) UIView *pageHeaderView;
@property (nonatomic, strong) UIStackView *stackView;
///
@property (nonatomic, strong) XPButton *filterBtn;
///
@@ -160,9 +161,10 @@
[self.view addSubview:self.topGradientImageView];
[self.view addSubview:self.homeNavView];
[self.view addSubview:self.pagingView];
[self.pageHeaderView addSubview:self.titleView];
[self.pageHeaderView addSubview:self.filterBtn];
[self.pageHeaderView addSubview:self.refreshBtn];
[self.pageHeaderView addSubview:self.stackView];
[self.stackView addArrangedSubview:self.titleView];
[self.stackView addArrangedSubview:self.refreshBtn];
[self.stackView addArrangedSubview:self.filterBtn];
///tab
[RACObserve([ClientConfig shareConfig], configInfo) subscribeNext:^(id _Nullable x) {
ClientDataModel * model = x;
@@ -188,20 +190,19 @@
make.left.top.right.mas_equalTo(0);
make.height.mas_equalTo(kNavigationHeight);
}];
[self.filterBtn mas_makeConstraints:^(MASConstraintMaker *make) {
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(15);
make.right.mas_equalTo(-15);
make.top.bottom.mas_equalTo(0);
}];
[self.filterBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(54, 24));
make.centerY.mas_equalTo(self.pageHeaderView);
}];
[self.refreshBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(self.filterBtn.mas_left).offset(-6);
make.centerY.mas_equalTo(self.pageHeaderView);
make.size.mas_equalTo(CGSizeMake(65, 24));
}];
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(15);
make.top.bottom.mas_equalTo(0);
make.right.mas_equalTo(self.refreshBtn.mas_left).offset(-15);
make.height.mas_equalTo(50);
}];
}
@@ -320,7 +321,12 @@
- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index {
if (index == 0) {
[self.presenter getHomePersonalRoomList];
// UI
self.refreshBtn.hidden = NO;
self.filterBtn.hidden = NO;
}else{
self.refreshBtn.hidden = YES;
self.filterBtn.hidden = YES;
NSString * title = [self.titles safeObjectAtIndex1:index];
if ([title isEqualToString:@"开黑畅聊"]) {
[self.presenter getPlayGameWithTeam:1];
@@ -411,6 +417,17 @@
return _pageHeaderView;
}
- (UIStackView *)stackView {
if (!_stackView) {
_stackView = [[UIStackView alloc] init];
_stackView.axis = UILayoutConstraintAxisHorizontal;
_stackView.distribution = UIStackViewDistributionFill;
_stackView.alignment = UIStackViewAlignmentCenter;
_stackView.spacing = 6;
}
return _stackView;
}
- (XPButton *)filterBtn {
if (!_filterBtn) {
_filterBtn = [XPButton buttonWithType:UIButtonTypeCustom];