我的页面新增访客列表
This commit is contained in:
@@ -133,7 +133,8 @@
|
||||
9B7B605B27BB53060070BB72 /* XPAnchorAudienceUpMicView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B7B605A27BB53060070BB72 /* XPAnchorAudienceUpMicView.m */; };
|
||||
9B7B606227BB96E40070BB72 /* XPRoomAnchorInfoCardView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B7B606127BB96E40070BB72 /* XPRoomAnchorInfoCardView.m */; };
|
||||
9B7B606627BBA0EE0070BB72 /* XPAnchorAttentSendInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B7B606527BBA0EE0070BB72 /* XPAnchorAttentSendInfo.m */; };
|
||||
9B7D804A2753783D003DAC0C /* SessionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B7D80492753783D003DAC0C /* SessionViewController.m */; };
|
||||
9B2489BC27C4C056006CFB85 /* XPMineVisitorEmptyTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B2489BB27C4C056006CFB85 /* XPMineVisitorEmptyTableViewCell.m */; };
|
||||
9B7D804A2753783D003DAC0C /* SessionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B7D80492753783D003DAC0C /* SessionViewController.m */; };
|
||||
9B7D804D27537950003DAC0C /* MessageCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B7D804C27537950003DAC0C /* MessageCell.m */; };
|
||||
9B7D80502753AA9D003DAC0C /* UITableView+NIMScrollToBottom.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B7D804E2753AA9D003DAC0C /* UITableView+NIMScrollToBottom.m */; };
|
||||
9B7D80562753C595003DAC0C /* SendMessageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B7D80552753C595003DAC0C /* SendMessageView.m */; };
|
||||
@@ -199,6 +200,10 @@
|
||||
9BEE3D11278584FE00C83219 /* XPNobleCenterEmptyView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BEE3D10278584FE00C83219 /* XPNobleCenterEmptyView.m */; };
|
||||
9BEE3D142785884A00C83219 /* XPNobleCenterResidueView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BEE3D132785884A00C83219 /* XPNobleCenterResidueView.m */; };
|
||||
9BEE3D1727858E5700C83219 /* XPNobleAuthorityDescView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BEE3D1627858E5700C83219 /* XPNobleAuthorityDescView.m */; };
|
||||
9BD9A17927A0EC57004186FE /* XPMineVisitorPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BD9A17827A0EC57004186FE /* XPMineVisitorPresenter.m */; };
|
||||
9BD9A17C27A0EE24004186FE /* XPMineVisitorViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BD9A17B27A0EE24004186FE /* XPMineVisitorViewController.m */; };
|
||||
9BD9A18027A0EFC7004186FE /* XPMineVisitorTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BD9A17F27A0EFC7004186FE /* XPMineVisitorTableViewCell.m */; };
|
||||
9BD9A18427A0F128004186FE /* XPMineVisitorItemModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BD9A18327A0F128004186FE /* XPMineVisitorItemModel.m */; };
|
||||
E80487652717DDD9008595F2 /* XPRoomMenuItem.m in Sources */ = {isa = PBXBuildFile; fileRef = E80487642717DDD9008595F2 /* XPRoomMenuItem.m */; };
|
||||
E80CBDE627D0C1CF001E1EC2 /* HomeMenuSourceModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E80CBDE527D0C1CF001E1EC2 /* HomeMenuSourceModel.m */; };
|
||||
E80CBDEA27D0C53F001E1EC2 /* XPWeakTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = E80CBDE927D0C53F001E1EC2 /* XPWeakTimer.m */; };
|
||||
@@ -793,6 +798,8 @@
|
||||
9B7B606127BB96E40070BB72 /* XPRoomAnchorInfoCardView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPRoomAnchorInfoCardView.m; sourceTree = "<group>"; };
|
||||
9B7B606427BBA0EE0070BB72 /* XPAnchorAttentSendInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPAnchorAttentSendInfo.h; sourceTree = "<group>"; };
|
||||
9B7B606527BBA0EE0070BB72 /* XPAnchorAttentSendInfo.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPAnchorAttentSendInfo.m; sourceTree = "<group>"; };
|
||||
9B2489BA27C4C056006CFB85 /* XPMineVisitorEmptyTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineVisitorEmptyTableViewCell.h; sourceTree = "<group>"; };
|
||||
9B2489BB27C4C056006CFB85 /* XPMineVisitorEmptyTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineVisitorEmptyTableViewCell.m; sourceTree = "<group>"; };
|
||||
9B7D80482753783D003DAC0C /* SessionViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SessionViewController.h; sourceTree = "<group>"; };
|
||||
9B7D80492753783D003DAC0C /* SessionViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SessionViewController.m; sourceTree = "<group>"; };
|
||||
9B7D804B27537950003DAC0C /* MessageCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MessageCell.h; sourceTree = "<group>"; };
|
||||
@@ -926,6 +933,15 @@
|
||||
9BEE3D132785884A00C83219 /* XPNobleCenterResidueView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNobleCenterResidueView.m; sourceTree = "<group>"; };
|
||||
9BEE3D1527858E5700C83219 /* XPNobleAuthorityDescView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPNobleAuthorityDescView.h; sourceTree = "<group>"; };
|
||||
9BEE3D1627858E5700C83219 /* XPNobleAuthorityDescView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNobleAuthorityDescView.m; sourceTree = "<group>"; };
|
||||
9BD9A17627A0E953004186FE /* XPMineVisitorProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineVisitorProtocol.h; sourceTree = "<group>"; };
|
||||
9BD9A17727A0EC57004186FE /* XPMineVisitorPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineVisitorPresenter.h; sourceTree = "<group>"; };
|
||||
9BD9A17827A0EC57004186FE /* XPMineVisitorPresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineVisitorPresenter.m; sourceTree = "<group>"; };
|
||||
9BD9A17A27A0EE24004186FE /* XPMineVisitorViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineVisitorViewController.h; sourceTree = "<group>"; };
|
||||
9BD9A17B27A0EE24004186FE /* XPMineVisitorViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineVisitorViewController.m; sourceTree = "<group>"; };
|
||||
9BD9A17E27A0EFC7004186FE /* XPMineVisitorTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineVisitorTableViewCell.h; sourceTree = "<group>"; };
|
||||
9BD9A17F27A0EFC7004186FE /* XPMineVisitorTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineVisitorTableViewCell.m; sourceTree = "<group>"; };
|
||||
9BD9A18227A0F128004186FE /* XPMineVisitorItemModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineVisitorItemModel.h; sourceTree = "<group>"; };
|
||||
9BD9A18327A0F128004186FE /* XPMineVisitorItemModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineVisitorItemModel.m; sourceTree = "<group>"; };
|
||||
B66633E061B1B34177CD011C /* Pods-xplan-ios.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-xplan-ios.release.xcconfig"; path = "Target Support Files/Pods-xplan-ios/Pods-xplan-ios.release.xcconfig"; sourceTree = "<group>"; };
|
||||
CACF623970097D653132D69A /* Pods_xplan_ios.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_xplan_ios.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
E80487632717DDD9008595F2 /* XPRoomMenuItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomMenuItem.h; sourceTree = "<group>"; };
|
||||
@@ -2836,7 +2852,37 @@
|
||||
path = Protocol;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E81C1B1527705F130020D1E4 /* Presenter */ = {
|
||||
9BD9A17D27A0EFB1004186FE /* Visitor */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
9BD9A17E27A0EFC7004186FE /* XPMineVisitorTableViewCell.h */,
|
||||
9BD9A17F27A0EFC7004186FE /* XPMineVisitorTableViewCell.m */,
|
||||
9B2489BA27C4C056006CFB85 /* XPMineVisitorEmptyTableViewCell.h */,
|
||||
9B2489BB27C4C056006CFB85 /* XPMineVisitorEmptyTableViewCell.m */,
|
||||
);
|
||||
path = Visitor;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9BD9A18127A0F110004186FE /* Visitor */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
9BD9A18227A0F128004186FE /* XPMineVisitorItemModel.h */,
|
||||
9BD9A18327A0F128004186FE /* XPMineVisitorItemModel.m */,
|
||||
);
|
||||
path = Visitor;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
BFB922F5D81845AC32D1E1ED /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E87888F32738C30E00BF1D57 /* StoreKit.framework */,
|
||||
186A531826FC591100D67B2C /* libresolv.tbd */,
|
||||
CACF623970097D653132D69A /* Pods_xplan_ios.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E81C1B1527705F130020D1E4 /* Presenter */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E81C1B1A27705F6B0020D1E4 /* XPArrangeMicPresenter.h */,
|
||||
@@ -4268,6 +4314,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E896EFB32771D53500AD2CC1 /* Friend */,
|
||||
9BD9A18127A0F110004186FE /* Visitor */,
|
||||
E8B846D926FDE21900A777FE /* Recharge */,
|
||||
E8E70D9026F2F60C00F03460 /* XPMineItemModel.h */,
|
||||
E8E70D9126F2F60C00F03460 /* XPMineItemModel.m */,
|
||||
@@ -4311,6 +4358,8 @@
|
||||
E824545526F5E51900BE8163 /* XPMineVerifIdentityViewController.m */,
|
||||
E824545F26F5F4E400BE8163 /* XPMineResetPayPwdViewController.h */,
|
||||
E824546026F5F4E400BE8163 /* XPMineResetPayPwdViewController.m */,
|
||||
9BD9A17A27A0EE24004186FE /* XPMineVisitorViewController.h */,
|
||||
9BD9A17B27A0EE24004186FE /* XPMineVisitorViewController.m */,
|
||||
E8B846C826FDD79700A777FE /* Recharge */,
|
||||
E88B5CBE26FB404800DA9178 /* MineInfo */,
|
||||
E88B5CA926FB15B900DA9178 /* Teenager */,
|
||||
@@ -4357,6 +4406,8 @@
|
||||
E896EF932771AAC100AD2CC1 /* XPMineFansPresenter.m */,
|
||||
E896EF952771AAE400AD2CC1 /* XPMineAttentionPresenter.h */,
|
||||
E896EF962771AAE400AD2CC1 /* XPMineAttentionPresenter.m */,
|
||||
9BD9A17727A0EC57004186FE /* XPMineVisitorPresenter.h */,
|
||||
9BD9A17827A0EC57004186FE /* XPMineVisitorPresenter.m */,
|
||||
);
|
||||
path = Presenter;
|
||||
sourceTree = "<group>";
|
||||
@@ -4380,6 +4431,7 @@
|
||||
E8B846D726FDE16300A777FE /* XPMineRechargeProtocol.h */,
|
||||
E896EF982771AB0000AD2CC1 /* XPMineFansProtocol.h */,
|
||||
E896EF992771AB1800AD2CC1 /* XPMineAttentionProtocol.h */,
|
||||
9BD9A17627A0E953004186FE /* XPMineVisitorProtocol.h */,
|
||||
);
|
||||
path = Protocol;
|
||||
sourceTree = "<group>";
|
||||
@@ -4411,6 +4463,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E896EFA32771AEC500AD2CC1 /* Friend */,
|
||||
9BD9A17D27A0EFB1004186FE /* Visitor */,
|
||||
E8B846D026FDDBCD00A777FE /* Recharge */,
|
||||
E8EEB8F826FC285B007C6EBA /* MineInfo */,
|
||||
E8E70D8A26F2F5A500F03460 /* XPMineHeadItemCollectionViewCell.h */,
|
||||
@@ -4632,6 +4685,7 @@
|
||||
E83953222769F33B00CF2F24 /* XPRoomFunctionContainerView.m in Sources */,
|
||||
E87C0AA027D9DE6400CB2241 /* RoomFaceSendInfoModel.m in Sources */,
|
||||
E88B5CB226FB1CFF00DA9178 /* XPMineTeenagerProtocol.h in Sources */,
|
||||
9BD9A18027A0EFC7004186FE /* XPMineVisitorTableViewCell.m in Sources */,
|
||||
E824546626F5FF6000BE8163 /* XPMineResetPayPasswordProtocol.h in Sources */,
|
||||
E89DA66427005932008483C1 /* XPIAPHelper.m in Sources */,
|
||||
E824545E26F5EF2200BE8163 /* XPMineVerifIdentityProtocol.h in Sources */,
|
||||
@@ -4676,6 +4730,7 @@
|
||||
E84150BB27747BAF00A7F548 /* XPFirstRechargePresenter.m in Sources */,
|
||||
9BEE3D1727858E5700C83219 /* XPNobleAuthorityDescView.m in Sources */,
|
||||
E82325F9274E2E42003A3332 /* Api+UserCard.m in Sources */,
|
||||
9BD9A17C27A0EE24004186FE /* XPMineVisitorViewController.m in Sources */,
|
||||
E82109B026F1D83500FC3319 /* LoginBindPhonePresent.m in Sources */,
|
||||
E81C1B1F27705F7A0020D1E4 /* XPArrangeMicViewController.m in Sources */,
|
||||
E8B825C726EA0D9A009E8E9F /* LoginVerifCodeProtocol.h in Sources */,
|
||||
@@ -4690,11 +4745,13 @@
|
||||
9B7D80502753AA9D003DAC0C /* UITableView+NIMScrollToBottom.m in Sources */,
|
||||
9BEE3D0E27853BD000C83219 /* ThemeColor+NobleCenter.m in Sources */,
|
||||
18E7B22626E8CDCF0064BC9B /* XplanFlutterBoostDelegate.m in Sources */,
|
||||
9BD9A18427A0F128004186FE /* XPMineVisitorItemModel.m in Sources */,
|
||||
E8EEB8F326FC2050007C6EBA /* SDWaitingView.m in Sources */,
|
||||
E8DEC9A12764A5D20078CB70 /* XPRoomMoreItemModel.m in Sources */,
|
||||
18F404B7276095D700A6C548 /* SessionChatLimitView.m in Sources */,
|
||||
E8788942273A55AD00BF1D57 /* XPGiftUsersView.m in Sources */,
|
||||
9B8585D3278837CE00D7D5C6 /* NobleLevelUpModel.m in Sources */,
|
||||
9BD9A17927A0EC57004186FE /* XPMineVisitorPresenter.m in Sources */,
|
||||
E8659909273E800D00EE349D /* XPGiftCollectionViewFlowLayout.m in Sources */,
|
||||
E8B846CB26FDD7CD00A777FE /* XPMineRechargeViewController.m in Sources */,
|
||||
E86596512701A1C000846EBD /* StatisticsService.m in Sources */,
|
||||
@@ -5001,6 +5058,7 @@
|
||||
9B7D8857279C099C00785A25 /* XPSkillCardListPropCell.m in Sources */,
|
||||
E83DB481274649FB00D8CBD1 /* XPGiftBannerUserInfoModel.m in Sources */,
|
||||
9B33E3CE27D8540C003B0E62 /* XPVoiceCardViewController.m in Sources */,
|
||||
9B2489BC27C4C056006CFB85 /* XPMineVisitorEmptyTableViewCell.m in Sources */,
|
||||
E878893F273A54F500BF1D57 /* XPGiftPresenter.m in Sources */,
|
||||
E8A03DF62763367F0098D9EA /* XPCandyTreeEmptyableViewCell.m in Sources */,
|
||||
E8AEAEED27141AE20017FCE0 /* XPRoomBackContainerView.m in Sources */,
|
||||
|
6
xplan-ios/Assets.xcassets/Mine/Visitor/Contents.json
Normal file
6
xplan-ios/Assets.xcassets/Mine/Visitor/Contents.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
22
xplan-ios/Assets.xcassets/Mine/Visitor/visitor_record_letter.imageset/Contents.json
vendored
Normal file
22
xplan-ios/Assets.xcassets/Mine/Visitor/visitor_record_letter.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "visitor_record_letter@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "visitor_record_letter@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
xplan-ios/Assets.xcassets/Mine/Visitor/visitor_record_letter.imageset/visitor_record_letter@2x.png
vendored
Normal file
BIN
xplan-ios/Assets.xcassets/Mine/Visitor/visitor_record_letter.imageset/visitor_record_letter@2x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 505 B |
BIN
xplan-ios/Assets.xcassets/Mine/Visitor/visitor_record_letter.imageset/visitor_record_letter@3x.png
vendored
Normal file
BIN
xplan-ios/Assets.xcassets/Mine/Visitor/visitor_record_letter.imageset/visitor_record_letter@3x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 817 B |
@@ -170,6 +170,12 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @param pageSize 一页多少个
|
||||
+ (void)getFansListCompletion:(HttpRequestHelperCompletion)completion uid:(NSString *)uid pageNo:(NSString *)pageNo pageSize:(NSString *)pageSize;
|
||||
|
||||
/// 获取访客列表
|
||||
/// @param completion 完成
|
||||
/// @param pageNum 当前页数
|
||||
/// @param pageSize 一页多少个
|
||||
+ (void)getVisitorListCompletion:(HttpRequestHelperCompletion)completion pageNum:(NSString *)pageNum pageSize:(NSString *)pageSize;
|
||||
|
||||
/// 获取关注列表
|
||||
/// @param completion 完成
|
||||
/// @param uid 用户的uid
|
||||
|
@@ -183,4 +183,12 @@
|
||||
[self makeRequest:@"fans/following" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, uid, pageNo, pageSize, nil];
|
||||
}
|
||||
|
||||
/// 获取访客列表
|
||||
/// @param completion 完成
|
||||
/// @param pageNum 当前页数
|
||||
/// @param pageSize 一页多少个
|
||||
+ (void)getVisitorListCompletion:(HttpRequestHelperCompletion)completion pageNum:(NSString *)pageNum pageSize:(NSString *)pageSize {
|
||||
[self makeRequest:@"uservisitrecord/visitUserList" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, pageNum, pageSize, nil];
|
||||
}
|
||||
|
||||
@end
|
||||
|
23
xplan-ios/Main/Mine/Model/Visitor/XPMineVisitorItemModel.h
Normal file
23
xplan-ios/Main/Mine/Model/Visitor/XPMineVisitorItemModel.h
Normal file
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// XPMineVisitorItemModel.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/1/26.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPMineVisitorItemModel : NSObject
|
||||
|
||||
@property (nonatomic, copy) NSString *avatar;
|
||||
@property (nonatomic, assign) NSInteger erbanNo;
|
||||
@property (nonatomic, assign) NSInteger gender;
|
||||
@property (nonatomic, copy) NSString *nick;
|
||||
@property (nonatomic, assign) long long uid;
|
||||
@property (nonatomic, copy) NSString *visitTimeDesc;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
12
xplan-ios/Main/Mine/Model/Visitor/XPMineVisitorItemModel.m
Normal file
12
xplan-ios/Main/Mine/Model/Visitor/XPMineVisitorItemModel.m
Normal file
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// XPMineVisitorItemModel.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/1/26.
|
||||
//
|
||||
|
||||
#import "XPMineVisitorItemModel.h"
|
||||
|
||||
@implementation XPMineVisitorItemModel
|
||||
|
||||
@end
|
@@ -29,6 +29,7 @@ typedef NS_ENUM(NSInteger, XPMineItemType) {
|
||||
XPMineItemType_Noble_Center,///贵族中心
|
||||
XPMineItemType_Match_Manage, ///赛程管理
|
||||
XPMineItemType_Skill_Card, ///技能卡
|
||||
XPMineItemType_Visitor,///访客记录
|
||||
};
|
||||
|
||||
|
||||
|
@@ -74,7 +74,14 @@
|
||||
realNameItem.itemImageName = @"mine_normal_real_name_authentic";
|
||||
realNameItem.type = XPMineItemType_Real_Name_Authentic;
|
||||
realNameItem.cornerType = UIRectCornerBottomLeft | UIRectCornerBottomRight;
|
||||
NSArray * array = @[myRoomItem,teenagerItem, myDressUp, inviteFriend, realNameItem];
|
||||
|
||||
XPMineItemModel * visitorItem = [[XPMineItemModel alloc] init];
|
||||
visitorItem.itemName = @"访客记录";
|
||||
visitorItem.itemImageName = @"mine_normal_visitor";
|
||||
visitorItem.type = XPMineItemType_Visitor;
|
||||
|
||||
NSArray * array = @[myRoomItem,teenagerItem, myDressUp, inviteFriend, visitorItem, realNameItem];
|
||||
|
||||
[[self getView] onGetNormalItemsSuccess:array];
|
||||
}
|
||||
|
||||
|
21
xplan-ios/Main/Mine/Presenter/XPMineVisitorPresenter.h
Normal file
21
xplan-ios/Main/Mine/Presenter/XPMineVisitorPresenter.h
Normal file
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// XPMineVisitorPresenter.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/1/26.
|
||||
//
|
||||
|
||||
#import "BaseMvpPresenter.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPMineVisitorPresenter : BaseMvpPresenter
|
||||
|
||||
/// 获取访客列表
|
||||
/// @param page 当前的页数
|
||||
/// @param pageSize 一页多少个
|
||||
- (void)getVisitorList:(int)page pageSize:(int)pageSize state:(int)state;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
29
xplan-ios/Main/Mine/Presenter/XPMineVisitorPresenter.m
Normal file
29
xplan-ios/Main/Mine/Presenter/XPMineVisitorPresenter.m
Normal file
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// XPMineVisitorPresenter.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/1/26.
|
||||
//
|
||||
|
||||
#import "XPMineVisitorPresenter.h"
|
||||
#import "Api+Mine.h"
|
||||
#import "XPMineVisitorProtocol.h"
|
||||
#import "AccountInfoStorage.h"
|
||||
#import "XPMineVisitorItemModel.h"
|
||||
|
||||
@implementation XPMineVisitorPresenter
|
||||
|
||||
/// 访客列表
|
||||
/// @param page 当前的页数
|
||||
/// @param pageSize 一页多少个
|
||||
- (void)getVisitorList:(int)page pageSize:(int)pageSize state:(int)state {
|
||||
[Api getVisitorListCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
NSArray *array = [XPMineVisitorItemModel modelsWithArray:data.data];
|
||||
[[self getView] onGetVisitorListSuccess:array state:state];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
[[self getView] getVisitorListFail:state];
|
||||
}] pageNum:[NSString stringWithFormat:@"%d", page] pageSize:[NSString stringWithFormat:@"%d", pageSize]];
|
||||
|
||||
}
|
||||
|
||||
@end
|
22
xplan-ios/Main/Mine/Protocol/XPMineVisitorProtocol.h
Normal file
22
xplan-ios/Main/Mine/Protocol/XPMineVisitorProtocol.h
Normal file
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// XPMineVisitorProtocol.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/1/26.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol XPMineVisitorProtocol <NSObject>
|
||||
|
||||
///获取访客列表成功
|
||||
- (void)onGetVisitorListSuccess:(NSArray *)array state:(int)state;
|
||||
|
||||
///获取访客列表失败
|
||||
- (void)getVisitorListFail:(int)state;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// XPMineVisitorEmptyTableViewCell.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/2/22.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPMineVisitorEmptyTableViewCell : UITableViewCell
|
||||
|
||||
///空白的文字
|
||||
@property (nonatomic,copy) NSString *emptyTitle;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,82 @@
|
||||
//
|
||||
// XPMineVisitorEmptyTableViewCell.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/2/22.
|
||||
//
|
||||
|
||||
#import "XPMineVisitorEmptyTableViewCell.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
///Tool
|
||||
#import "ThemeColor.h"
|
||||
#import "UIImageConstant.h"
|
||||
|
||||
@interface XPMineVisitorEmptyTableViewCell ()
|
||||
@property (nonatomic,strong) UIImageView *emptyImageView;
|
||||
@property (nonatomic,strong) UILabel *titleLabel;
|
||||
@end
|
||||
|
||||
|
||||
@implementation XPMineVisitorEmptyTableViewCell
|
||||
|
||||
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
|
||||
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
self.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
[self.contentView addSubview:self.emptyImageView];
|
||||
[self.contentView addSubview:self.titleLabel];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.emptyImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.contentView);
|
||||
make.top.mas_equalTo(self.contentView).offset(250);
|
||||
make.size.mas_equalTo(CGSizeMake(100, 100));
|
||||
}];
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.emptyImageView.mas_bottom).offset(20);
|
||||
make.left.right.mas_equalTo(self.contentView);
|
||||
}];
|
||||
}
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setEmptyTitle:(NSString *)emptyTitle {
|
||||
_emptyTitle = emptyTitle;
|
||||
if (_emptyTitle.length > 0) {
|
||||
self.titleLabel.text = _emptyTitle;
|
||||
}
|
||||
}
|
||||
|
||||
- (UIImageView *)emptyImageView {
|
||||
if (!_emptyImageView) {
|
||||
_emptyImageView = [[UIImageView alloc] init];
|
||||
_emptyImageView.userInteractionEnabled = YES;
|
||||
_emptyImageView.image = [UIImageConstant defalutEmptyPlaceholder];
|
||||
_emptyImageView.layer.masksToBounds = YES;
|
||||
_emptyImageView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
}
|
||||
return _emptyImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.text = @"暂无数据";
|
||||
_titleLabel.numberOfLines = 2;
|
||||
_titleLabel.font = [UIFont systemFontOfSize:16];
|
||||
_titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
_titleLabel.textColor = [ThemeColor secondTextColor];
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
@end
|
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// XPMineVisitorTableViewCell.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/1/26.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class XPMineVisitorTableViewCell, XPMineVisitorItemModel;
|
||||
|
||||
@protocol XPMineVisitorTableViewCellDelegate <NSObject>
|
||||
|
||||
///点击了私聊
|
||||
- (void)onChatClick:(XPMineVisitorTableViewCell *)cell;
|
||||
|
||||
///点击了头像
|
||||
- (void)onAvatarClick:(XPMineVisitorTableViewCell *)cell;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface XPMineVisitorTableViewCell : UITableViewCell
|
||||
|
||||
@property (nonatomic, assign) BOOL isFirstItem;
|
||||
@property (nonatomic, assign) BOOL isLastItem;
|
||||
@property (nonatomic, strong) XPMineVisitorItemModel *item;
|
||||
|
||||
@property (nonatomic, weak) id<XPMineVisitorTableViewCellDelegate> delegate;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,249 @@
|
||||
//
|
||||
// XPMineVisitorTableViewCell.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/1/26.
|
||||
//
|
||||
|
||||
#import "XPMineVisitorTableViewCell.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
///Tool
|
||||
#import "ThemeColor.h"
|
||||
#import "NetImageView.h"
|
||||
#import "XPMineVisitorItemModel.h"
|
||||
|
||||
@interface XPMineVisitorTableViewCell()
|
||||
|
||||
@property (nonatomic, strong) UIView *bgView;
|
||||
@property (nonatomic ,strong) NetImageView *avaterImgView;
|
||||
@property (nonatomic, strong) UIImageView *genderImageView;
|
||||
@property (nonatomic, strong) UILabel *nickLabel;
|
||||
@property (nonatomic ,strong) UILabel *memberIdLabel;
|
||||
@property (nonatomic ,strong) UIButton *tagPic;
|
||||
@property (nonatomic ,strong) UILabel *timeLabel;
|
||||
@property (nonatomic, strong) UIView *lineView;
|
||||
|
||||
@end
|
||||
|
||||
@implementation XPMineVisitorTableViewCell
|
||||
|
||||
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
|
||||
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
|
||||
[self setUpUI];
|
||||
[self setUpConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)drawRect:(CGRect)rect {
|
||||
if (self.isFirstItem) {
|
||||
UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:self.bgView.bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(12, 12)];
|
||||
CAShapeLayer *maskLayer = [CAShapeLayer layer];
|
||||
maskLayer.path = path.CGPath;
|
||||
self.bgView.layer.mask = maskLayer;
|
||||
}
|
||||
if (self.isLastItem) {
|
||||
UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:self.bgView.bounds byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight cornerRadii:CGSizeMake(12, 12)];
|
||||
CAShapeLayer *maskLayer = [CAShapeLayer layer];
|
||||
maskLayer.path = path.CGPath;
|
||||
self.bgView.layer.mask = maskLayer;
|
||||
}
|
||||
if (self.isLastItem && self.isFirstItem) {
|
||||
UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:self.bgView.bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight | UIRectCornerBottomLeft | UIRectCornerBottomRight cornerRadii:CGSizeMake(12, 12)];
|
||||
CAShapeLayer *maskLayer = [CAShapeLayer layer];
|
||||
maskLayer.path = path.CGPath;
|
||||
self.bgView.layer.mask = maskLayer;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)layoutSubviews {
|
||||
[super layoutSubviews];
|
||||
if (self.isFirstItem) {
|
||||
[self updateBgViewConstraints];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - lifeCycle
|
||||
- (void)setUpUI {
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
self.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
[self.contentView addSubview:self.bgView];
|
||||
[self.bgView addSubview:self.avaterImgView];
|
||||
[self.bgView addSubview:self.nickLabel];
|
||||
[self.bgView addSubview:self.genderImageView];
|
||||
[self.bgView addSubview:self.memberIdLabel];
|
||||
[self.bgView addSubview:self.tagPic];
|
||||
[self.bgView addSubview:self.timeLabel];
|
||||
[self.bgView addSubview:self.lineView];
|
||||
|
||||
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onCliekAvatar:)];
|
||||
[self.avaterImgView addGestureRecognizer:tap];
|
||||
}
|
||||
|
||||
#pragma mark - Constraints
|
||||
- (void)setUpConstraints {
|
||||
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(0);
|
||||
make.right.mas_equalTo(-15);
|
||||
make.left.mas_equalTo(15);
|
||||
make.height.mas_equalTo(70);
|
||||
make.bottom.mas_equalTo(0);
|
||||
}];
|
||||
[self.avaterImgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(15);
|
||||
make.width.height.mas_equalTo(40);
|
||||
make.centerY.mas_equalTo(self.bgView.mas_centerY);
|
||||
}];
|
||||
|
||||
[self.nickLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.avaterImgView.mas_right).mas_offset(10);
|
||||
make.bottom.mas_equalTo(self.avaterImgView.mas_centerY).mas_offset(-4);
|
||||
}];
|
||||
[self.genderImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(self.nickLabel.mas_centerY);
|
||||
make.width.height.mas_equalTo(14);
|
||||
make.left.mas_equalTo(self.nickLabel.mas_right).mas_offset(5);
|
||||
make.right.mas_lessThanOrEqualTo(self.tagPic.mas_left).mas_offset(-5);
|
||||
}];
|
||||
|
||||
[self.tagPic mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.timeLabel.mas_top).mas_offset((-1));
|
||||
make.right.mas_equalTo(-15);
|
||||
make.width.height.mas_equalTo(22);
|
||||
}];
|
||||
|
||||
[self.memberIdLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.avaterImgView.mas_centerY).mas_offset(4);
|
||||
make.left.mas_equalTo(self.nickLabel);
|
||||
}];
|
||||
|
||||
[self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(-15);
|
||||
make.centerY.mas_equalTo(self.memberIdLabel.mas_centerY);
|
||||
make.height.mas_equalTo(11);
|
||||
}];
|
||||
[self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(0);
|
||||
make.left.mas_equalTo(self.avaterImgView);
|
||||
make.right.mas_equalTo(-15);
|
||||
make.height.mas_equalTo(0.5);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)updateBgViewConstraints {
|
||||
[self.bgView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(10);
|
||||
make.right.mas_equalTo(-15);
|
||||
make.left.mas_equalTo(15);
|
||||
make.height.mas_equalTo(70);
|
||||
make.bottom.mas_equalTo(0);
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - event
|
||||
- (void)onChatButtonClick:(UIButton *)sender {
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(onChatClick:)]) {
|
||||
[self.delegate onChatClick:self];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)onCliekAvatar:(UITapGestureRecognizer *)ges {
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(onAvatarClick:)]) {
|
||||
[self.delegate onAvatarClick:self];
|
||||
}
|
||||
}
|
||||
|
||||
/** 最后一个数据 配置圆角 */
|
||||
- (void)setIsFirstItem:(BOOL)isFirstItem{
|
||||
_isFirstItem = isFirstItem;
|
||||
}
|
||||
|
||||
- (void)setIsLastItem:(BOOL)isLastItem {
|
||||
_isLastItem = isLastItem;
|
||||
}
|
||||
|
||||
- (void)setItem:(XPMineVisitorItemModel *)item {
|
||||
_item = item;
|
||||
self.nickLabel.text = item.nick;
|
||||
self.avaterImgView.imageUrl = item.avatar;
|
||||
self.memberIdLabel.text = [NSString stringWithFormat:@"大鹅号:%zd", item.erbanNo];
|
||||
self.timeLabel.text = item.visitTimeDesc;
|
||||
self.genderImageView.image = [UIImage imageNamed:item.gender == 1 ? @"common_male" : @"common_female"];
|
||||
}
|
||||
|
||||
- (NetImageView *)avaterImgView {
|
||||
if (!_avaterImgView) {
|
||||
_avaterImgView = [[NetImageView alloc] init];
|
||||
_avaterImgView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
_avaterImgView.layer.cornerRadius = 20;
|
||||
_avaterImgView.layer.masksToBounds = YES;
|
||||
_avaterImgView.userInteractionEnabled = YES;
|
||||
}
|
||||
return _avaterImgView;
|
||||
}
|
||||
|
||||
- (UIView *)bgView {
|
||||
if (!_bgView) {
|
||||
_bgView = [[UIView alloc] init];
|
||||
_bgView.backgroundColor = UIColorFromRGB(0xFFFFFF);
|
||||
}
|
||||
return _bgView;
|
||||
}
|
||||
|
||||
- (UILabel *)nickLabel {
|
||||
if (!_nickLabel) {
|
||||
_nickLabel = [[UILabel alloc] init];
|
||||
_nickLabel.textColor = UIColorFromRGB(0x333333);
|
||||
_nickLabel.font = [UIFont systemFontOfSize:13];
|
||||
_nickLabel.text = @"用户昵称";
|
||||
}
|
||||
return _nickLabel;
|
||||
}
|
||||
|
||||
- (UIImageView *)genderImageView {
|
||||
if (!_genderImageView) {
|
||||
_genderImageView = [[UIImageView alloc] init];
|
||||
_genderImageView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
}
|
||||
return _genderImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)memberIdLabel {
|
||||
if (!_memberIdLabel) {
|
||||
_memberIdLabel = [[UILabel alloc] init];
|
||||
_memberIdLabel.textColor = UIColorFromRGB(0x999999);
|
||||
_memberIdLabel.font = [UIFont systemFontOfSize:13];
|
||||
_memberIdLabel.text = @"";
|
||||
}
|
||||
return _memberIdLabel;
|
||||
}
|
||||
|
||||
- (UIButton *)tagPic {
|
||||
if (!_tagPic) {
|
||||
_tagPic = [[UIButton alloc] init];
|
||||
[_tagPic setImage:[UIImage imageNamed:@"visitor_record_letter"] forState:UIControlStateNormal];
|
||||
[_tagPic addTarget:self action:@selector(onChatButtonClick:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _tagPic;
|
||||
}
|
||||
|
||||
- (UILabel *)timeLabel {
|
||||
if (!_timeLabel) {
|
||||
_timeLabel = [[UILabel alloc] init];
|
||||
_timeLabel.text = @"0";
|
||||
_timeLabel.textColor = UIColorFromRGB(0x999999);
|
||||
_timeLabel.font = [UIFont boldSystemFontOfSize:10];
|
||||
}
|
||||
return _timeLabel;
|
||||
}
|
||||
|
||||
- (UIView *)lineView {
|
||||
if (!_lineView) {
|
||||
_lineView = [[UIView alloc] init];
|
||||
_lineView.backgroundColor = UIColorFromRGB(0xf5f5f5);
|
||||
}
|
||||
return _lineView;
|
||||
}
|
||||
|
||||
@end
|
@@ -38,6 +38,7 @@
|
||||
#import "XPNobleCenterViewController.h"
|
||||
#import "XPMatchManageViewController.h"
|
||||
#import "XPSkillCardViewController.h"
|
||||
#import "XPMineVisitorViewController.h"
|
||||
|
||||
@interface XPMineViewController ()<UITableViewDelegate, UITableViewDataSource, XPMineProtocol, XPMineHeadItemTableViewCellDelegate, XPMineHeadViewDelegate>
|
||||
///顶部背景
|
||||
@@ -216,6 +217,12 @@
|
||||
XPSkillCardViewController *skillCardVC = [[XPSkillCardViewController alloc] init];
|
||||
skillCardVC.uid = self.userInfo.uid;
|
||||
[self.navigationController pushViewController:skillCardVC animated:YES];
|
||||
}
|
||||
break;
|
||||
case XPMineItemType_Visitor:
|
||||
{
|
||||
XPMineVisitorViewController *visitorVC = [[XPMineVisitorViewController alloc] init];
|
||||
[self.navigationController pushViewController:visitorVC animated:YES];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
16
xplan-ios/Main/Mine/View/XPMineVisitorViewController.h
Normal file
16
xplan-ios/Main/Mine/View/XPMineVisitorViewController.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// XPMineVisitorViewController.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/1/26.
|
||||
//
|
||||
|
||||
#import "MvpViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPMineVisitorViewController : MvpViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
202
xplan-ios/Main/Mine/View/XPMineVisitorViewController.m
Normal file
202
xplan-ios/Main/Mine/View/XPMineVisitorViewController.m
Normal file
@@ -0,0 +1,202 @@
|
||||
//
|
||||
// XPMineVisitorViewController.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/1/26.
|
||||
//
|
||||
|
||||
#import "XPMineVisitorViewController.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <MJRefresh/MJRefresh.h>
|
||||
///Tool
|
||||
#import "ThemeColor.h"
|
||||
///Model
|
||||
#import "XPMineVisitorItemModel.h"
|
||||
///View
|
||||
#import "XPMineVisitorTableViewCell.h"
|
||||
#import "XPMineVisitorEmptyTableViewCell.h"
|
||||
///P
|
||||
#import "XPMineVisitorPresenter.h"
|
||||
#import "XPMineVisitorProtocol.h"
|
||||
///VC
|
||||
#import "XPMineUserInfoViewController.h"
|
||||
#import "SessionViewController.h"
|
||||
|
||||
@interface XPMineVisitorViewController ()<UITableViewDelegate,UITableViewDataSource, XPMineVisitorProtocol, XPMineVisitorTableViewCellDelegate>
|
||||
///列表
|
||||
@property (nonatomic,strong) UITableView *tableView;
|
||||
///数据源
|
||||
@property (nonatomic,strong) NSMutableArray *datasource;
|
||||
///当前页数
|
||||
@property (nonatomic,assign) int page;
|
||||
///更多数据
|
||||
@property (nonatomic,assign) BOOL hasNoMoreData;
|
||||
@end
|
||||
|
||||
@implementation XPMineVisitorViewController
|
||||
|
||||
- (XPMineVisitorPresenter *)createPresenter {
|
||||
return [[XPMineVisitorPresenter alloc] init];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self initHeaderAndFooterRrfresh];
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
|
||||
#pragma mark - 下拉刷新
|
||||
- (void)initHeaderAndFooterRrfresh {
|
||||
MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(headerRefresh)];
|
||||
header.stateLabel.font = [UIFont systemFontOfSize:10.0];
|
||||
header.lastUpdatedTimeLabel.font = [UIFont systemFontOfSize:10.0];
|
||||
header.stateLabel.textColor = [ThemeColor secondTextColor];
|
||||
header.lastUpdatedTimeLabel.textColor = [ThemeColor secondTextColor];
|
||||
self.tableView.mj_header = header;
|
||||
|
||||
MJRefreshBackNormalFooter *footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(footerRefresh)];
|
||||
footer.stateLabel.textColor = [ThemeColor secondTextColor];
|
||||
footer.stateLabel.font = [UIFont systemFontOfSize:10.0];
|
||||
self.tableView.mj_footer = footer;
|
||||
|
||||
[self headerRefresh];
|
||||
}
|
||||
|
||||
#pragma mark - 刷新的fangfa
|
||||
- (void)headerRefresh {
|
||||
self.page = 1;
|
||||
[self.presenter getVisitorList:self.page pageSize:20 state:0];
|
||||
}
|
||||
|
||||
- (void)footerRefresh {
|
||||
if (self.hasNoMoreData) {
|
||||
[self showErrorToast:@"没有更多访客记录了"];
|
||||
return;
|
||||
}
|
||||
self.page++;
|
||||
[self.presenter getVisitorList:self.page pageSize:20 state:1];
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
self.title = @"访客记录";
|
||||
[self.view addSubview:self.tableView];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self.view);
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - XPMineVisitorProtocol
|
||||
- (void)onGetVisitorListSuccess:(NSArray *)array state:(int)state {
|
||||
if (state == 0) {
|
||||
[self.datasource removeAllObjects];
|
||||
[self.tableView.mj_header endRefreshing];
|
||||
} else {
|
||||
[self.tableView.mj_footer endRefreshing];
|
||||
}
|
||||
if (array.count > 0) {
|
||||
self.hasNoMoreData = NO;
|
||||
[self.datasource addObjectsFromArray:array];
|
||||
} else {
|
||||
self.hasNoMoreData = YES;
|
||||
[self.tableView.mj_footer endRefreshingWithNoMoreData];
|
||||
}
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
|
||||
- (void)getVisitorListFail:(int)state {
|
||||
if (state == 0) {
|
||||
[self.tableView.mj_header endRefreshing];
|
||||
} else {
|
||||
[self.tableView.mj_footer endRefreshing];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - UITableViewDelegate And UITableViewDataSource
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||
return self.datasource.count > 0 ? self.datasource.count : 1;
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
if (self.datasource.count > 0) {
|
||||
XPMineVisitorTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineVisitorTableViewCell class])];
|
||||
if (cell == nil) {
|
||||
cell = [[XPMineVisitorTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineVisitorTableViewCell class])];
|
||||
}
|
||||
if (indexPath.row == 0) {
|
||||
cell.isFirstItem = YES;
|
||||
}
|
||||
if(indexPath.row == self.datasource.count - 1) {
|
||||
cell.isLastItem = YES;
|
||||
}
|
||||
cell.delegate = self;
|
||||
cell.item = [self.datasource objectAtIndex:indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
|
||||
XPMineVisitorEmptyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineVisitorEmptyTableViewCell class])];
|
||||
if (cell == nil) {
|
||||
cell = [[XPMineVisitorEmptyTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineVisitorEmptyTableViewCell class])];
|
||||
}
|
||||
cell.emptyTitle = @"暂无访客记录";
|
||||
return cell;
|
||||
}
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
if (indexPath.row == 0) {
|
||||
return 85;
|
||||
} else {
|
||||
return 70;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - TTVisitorRecordCellDelegate
|
||||
- (void)onAvatarClick:(XPMineVisitorTableViewCell *)cell {
|
||||
NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
|
||||
XPMineVisitorItemModel *item = [self.datasource objectAtIndex:indexPath.row];
|
||||
XPMineUserInfoViewController * userInfoVC = [[XPMineUserInfoViewController alloc] init];
|
||||
userInfoVC.uid = item.uid;
|
||||
[self.navigationController pushViewController:userInfoVC animated:YES];
|
||||
}
|
||||
|
||||
- (void)onChatClick:(XPMineVisitorTableViewCell *)cell {
|
||||
NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
|
||||
XPMineVisitorItemModel *item = [self.datasource objectAtIndex:indexPath.row];
|
||||
NSString * sessionId = [NSString stringWithFormat:@"%lld",item.uid];
|
||||
NIMSession * session = [NIMSession session:sessionId type:NIMSessionTypeP2P];
|
||||
SessionViewController * sessionVC = [[SessionViewController alloc] initWithSession:session];
|
||||
[self.navigationController pushViewController:sessionVC animated:YES];
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (UITableView *)tableView {
|
||||
if (!_tableView) {
|
||||
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
|
||||
_tableView.delegate = self;
|
||||
_tableView.dataSource = self;
|
||||
_tableView.tableFooterView = [UIView new];
|
||||
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
_tableView.backgroundColor = [UIColor clearColor];
|
||||
_tableView.rowHeight = 65;
|
||||
if (@available(iOS 11.0, *)) {
|
||||
_tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
||||
}
|
||||
[_tableView registerClass:[XPMineVisitorEmptyTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineVisitorEmptyTableViewCell class])];
|
||||
[_tableView registerClass:[XPMineVisitorTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineVisitorTableViewCell class])];
|
||||
}
|
||||
return _tableView;
|
||||
}
|
||||
|
||||
- (NSMutableArray *)datasource {
|
||||
if (!_datasource) {
|
||||
_datasource = [NSMutableArray array];
|
||||
}
|
||||
return _datasource;
|
||||
}
|
||||
|
||||
@end
|
Reference in New Issue
Block a user