朋友圈一部分UI temp
@@ -344,6 +344,10 @@
|
|||||||
E8098CB4282E97550090B9F0 /* XPMineBlackListPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E8098CB3282E97550090B9F0 /* XPMineBlackListPresenter.m */; };
|
E8098CB4282E97550090B9F0 /* XPMineBlackListPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E8098CB3282E97550090B9F0 /* XPMineBlackListPresenter.m */; };
|
||||||
E80A086227F2AC190027B30C /* RoomPKDetailInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E80A086127F2AC190027B30C /* RoomPKDetailInfoModel.m */; };
|
E80A086227F2AC190027B30C /* RoomPKDetailInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E80A086127F2AC190027B30C /* RoomPKDetailInfoModel.m */; };
|
||||||
E80A086527F318620027B30C /* XPRoomPKPlayingView.m in Sources */ = {isa = PBXBuildFile; fileRef = E80A086427F318620027B30C /* XPRoomPKPlayingView.m */; };
|
E80A086527F318620027B30C /* XPRoomPKPlayingView.m in Sources */ = {isa = PBXBuildFile; fileRef = E80A086427F318620027B30C /* XPRoomPKPlayingView.m */; };
|
||||||
|
E8098CA7282E00920090B9F0 /* Api+Monents.m in Sources */ = {isa = PBXBuildFile; fileRef = E8098CA6282E00920090B9F0 /* Api+Monents.m */; };
|
||||||
|
E8098CAA282E03B40090B9F0 /* XPMonentsRecommendPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E8098CA9282E03B40090B9F0 /* XPMonentsRecommendPresenter.m */; };
|
||||||
|
E8098CAE282E07C00090B9F0 /* XPMonentsEmptyTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8098CAD282E07C00090B9F0 /* XPMonentsEmptyTableViewCell.m */; };
|
||||||
|
E8098CB1282E86EF0090B9F0 /* XPMonentsContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8098CB0282E86EF0090B9F0 /* XPMonentsContentView.m */; };
|
||||||
E80B0712280D0A6700A79F63 /* FansInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E80B0711280D0A6700A79F63 /* FansInfoModel.m */; };
|
E80B0712280D0A6700A79F63 /* FansInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E80B0711280D0A6700A79F63 /* FansInfoModel.m */; };
|
||||||
E80B0734280D740600A79F63 /* MessageContentGuildView.m in Sources */ = {isa = PBXBuildFile; fileRef = E80B0733280D740600A79F63 /* MessageContentGuildView.m */; };
|
E80B0734280D740600A79F63 /* MessageContentGuildView.m in Sources */ = {isa = PBXBuildFile; fileRef = E80B0733280D740600A79F63 /* MessageContentGuildView.m */; };
|
||||||
E80B0737280D790400A79F63 /* GuildMessageModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E80B0736280D790400A79F63 /* GuildMessageModel.m */; };
|
E80B0737280D790400A79F63 /* GuildMessageModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E80B0736280D790400A79F63 /* GuildMessageModel.m */; };
|
||||||
@@ -1623,6 +1627,15 @@
|
|||||||
E80A086127F2AC190027B30C /* RoomPKDetailInfoModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoomPKDetailInfoModel.m; sourceTree = "<group>"; };
|
E80A086127F2AC190027B30C /* RoomPKDetailInfoModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoomPKDetailInfoModel.m; sourceTree = "<group>"; };
|
||||||
E80A086327F318620027B30C /* XPRoomPKPlayingView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomPKPlayingView.h; sourceTree = "<group>"; };
|
E80A086327F318620027B30C /* XPRoomPKPlayingView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomPKPlayingView.h; sourceTree = "<group>"; };
|
||||||
E80A086427F318620027B30C /* XPRoomPKPlayingView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomPKPlayingView.m; sourceTree = "<group>"; };
|
E80A086427F318620027B30C /* XPRoomPKPlayingView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomPKPlayingView.m; sourceTree = "<group>"; };
|
||||||
|
E8098CA5282E00920090B9F0 /* Api+Monents.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Api+Monents.h"; sourceTree = "<group>"; };
|
||||||
|
E8098CA6282E00920090B9F0 /* Api+Monents.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "Api+Monents.m"; sourceTree = "<group>"; };
|
||||||
|
E8098CA8282E03B40090B9F0 /* XPMonentsRecommendPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMonentsRecommendPresenter.h; sourceTree = "<group>"; };
|
||||||
|
E8098CA9282E03B40090B9F0 /* XPMonentsRecommendPresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMonentsRecommendPresenter.m; sourceTree = "<group>"; };
|
||||||
|
E8098CAB282E04870090B9F0 /* XPMonentsRecommendProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMonentsRecommendProtocol.h; sourceTree = "<group>"; };
|
||||||
|
E8098CAC282E07C00090B9F0 /* XPMonentsEmptyTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMonentsEmptyTableViewCell.h; sourceTree = "<group>"; };
|
||||||
|
E8098CAD282E07C00090B9F0 /* XPMonentsEmptyTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMonentsEmptyTableViewCell.m; sourceTree = "<group>"; };
|
||||||
|
E8098CAF282E86EF0090B9F0 /* XPMonentsContentView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMonentsContentView.h; sourceTree = "<group>"; };
|
||||||
|
E8098CB0282E86EF0090B9F0 /* XPMonentsContentView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMonentsContentView.m; sourceTree = "<group>"; };
|
||||||
E80B0710280D0A6700A79F63 /* FansInfoModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FansInfoModel.h; sourceTree = "<group>"; };
|
E80B0710280D0A6700A79F63 /* FansInfoModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FansInfoModel.h; sourceTree = "<group>"; };
|
||||||
E80B0711280D0A6700A79F63 /* FansInfoModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FansInfoModel.m; sourceTree = "<group>"; };
|
E80B0711280D0A6700A79F63 /* FansInfoModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FansInfoModel.m; sourceTree = "<group>"; };
|
||||||
E80B0732280D740600A79F63 /* MessageContentGuildView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MessageContentGuildView.h; sourceTree = "<group>"; };
|
E80B0732280D740600A79F63 /* MessageContentGuildView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MessageContentGuildView.h; sourceTree = "<group>"; };
|
||||||
@@ -4829,6 +4842,7 @@
|
|||||||
E81DCCC6282B63630039E5C5 /* Protocol */ = {
|
E81DCCC6282B63630039E5C5 /* Protocol */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
E8098CAB282E04870090B9F0 /* XPMonentsRecommendProtocol.h */,
|
||||||
);
|
);
|
||||||
path = Protocol;
|
path = Protocol;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -4838,6 +4852,8 @@
|
|||||||
children = (
|
children = (
|
||||||
E8950187282CFFB1007E459A /* XPMonentsLayoutConfig.h */,
|
E8950187282CFFB1007E459A /* XPMonentsLayoutConfig.h */,
|
||||||
E8950188282CFFB1007E459A /* XPMonentsLayoutConfig.m */,
|
E8950188282CFFB1007E459A /* XPMonentsLayoutConfig.m */,
|
||||||
|
E8098CA8282E03B40090B9F0 /* XPMonentsRecommendPresenter.h */,
|
||||||
|
E8098CA9282E03B40090B9F0 /* XPMonentsRecommendPresenter.m */,
|
||||||
);
|
);
|
||||||
path = Presenter;
|
path = Presenter;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -4860,6 +4876,8 @@
|
|||||||
E81DCCC9282B63840039E5C5 /* Api */ = {
|
E81DCCC9282B63840039E5C5 /* Api */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
E8098CA5282E00920090B9F0 /* Api+Monents.h */,
|
||||||
|
E8098CA6282E00920090B9F0 /* Api+Monents.m */,
|
||||||
);
|
);
|
||||||
path = Api;
|
path = Api;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -6979,6 +6997,8 @@
|
|||||||
children = (
|
children = (
|
||||||
E8D7D749282BA1EC0007D7BD /* XPMonentsTableViewCell.h */,
|
E8D7D749282BA1EC0007D7BD /* XPMonentsTableViewCell.h */,
|
||||||
E8D7D74A282BA1EC0007D7BD /* XPMonentsTableViewCell.m */,
|
E8D7D74A282BA1EC0007D7BD /* XPMonentsTableViewCell.m */,
|
||||||
|
E8098CAC282E07C00090B9F0 /* XPMonentsEmptyTableViewCell.h */,
|
||||||
|
E8098CAD282E07C00090B9F0 /* XPMonentsEmptyTableViewCell.m */,
|
||||||
);
|
);
|
||||||
path = Cell;
|
path = Cell;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -6992,6 +7012,8 @@
|
|||||||
E8950182282CAC6A007E459A /* XPMonentsPhotoView.m */,
|
E8950182282CAC6A007E459A /* XPMonentsPhotoView.m */,
|
||||||
E8950184282CAC80007E459A /* XPMonentsTooBarView.h */,
|
E8950184282CAC80007E459A /* XPMonentsTooBarView.h */,
|
||||||
E8950185282CAC80007E459A /* XPMonentsTooBarView.m */,
|
E8950185282CAC80007E459A /* XPMonentsTooBarView.m */,
|
||||||
|
E8098CAF282E86EF0090B9F0 /* XPMonentsContentView.h */,
|
||||||
|
E8098CB0282E86EF0090B9F0 /* XPMonentsContentView.m */,
|
||||||
E895018A282D0701007E459A /* XPMoentsTopicView.h */,
|
E895018A282D0701007E459A /* XPMoentsTopicView.h */,
|
||||||
E895018B282D0701007E459A /* XPMoentsTopicView.m */,
|
E895018B282D0701007E459A /* XPMoentsTopicView.m */,
|
||||||
);
|
);
|
||||||
@@ -8239,6 +8261,7 @@
|
|||||||
9BCF585C279909D7008401A4 /* XPSkillCardEditPropCell.m in Sources */,
|
9BCF585C279909D7008401A4 /* XPSkillCardEditPropCell.m in Sources */,
|
||||||
E88863C6278EAFC3004BCFAB /* XPAcrossRoomPKResultView.m in Sources */,
|
E88863C6278EAFC3004BCFAB /* XPAcrossRoomPKResultView.m in Sources */,
|
||||||
E8AC722C26F49580007D6E91 /* XPMineNotificaViewController.m in Sources */,
|
E8AC722C26F49580007D6E91 /* XPMineNotificaViewController.m in Sources */,
|
||||||
|
E8098CAE282E07C00090B9F0 /* XPMonentsEmptyTableViewCell.m in Sources */,
|
||||||
9B044DA0282D32F700DE4859 /* MicroInviteExtModel.m in Sources */,
|
9B044DA0282D32F700DE4859 /* MicroInviteExtModel.m in Sources */,
|
||||||
E8D7D74B282BA1EC0007D7BD /* XPMonentsTableViewCell.m in Sources */,
|
E8D7D74B282BA1EC0007D7BD /* XPMonentsTableViewCell.m in Sources */,
|
||||||
E8D34D5A28082357009C4835 /* UserGiftWallInfoModel.m in Sources */,
|
E8D34D5A28082357009C4835 /* UserGiftWallInfoModel.m in Sources */,
|
||||||
@@ -8307,6 +8330,7 @@
|
|||||||
E80A086227F2AC190027B30C /* RoomPKDetailInfoModel.m in Sources */,
|
E80A086227F2AC190027B30C /* RoomPKDetailInfoModel.m in Sources */,
|
||||||
E824545126F5CE6E00BE8163 /* XPMineModifPayPwdPresenter.m in Sources */,
|
E824545126F5CE6E00BE8163 /* XPMineModifPayPwdPresenter.m in Sources */,
|
||||||
E8A86DF727BA2F1C001C21F9 /* XPRoomLittleGameContainerView.m in Sources */,
|
E8A86DF727BA2F1C001C21F9 /* XPRoomLittleGameContainerView.m in Sources */,
|
||||||
|
E8098CB1282E86EF0090B9F0 /* XPMonentsContentView.m in Sources */,
|
||||||
E880B3AF278BE1D800A83B0D /* Api+AcrossRoomPK.m in Sources */,
|
E880B3AF278BE1D800A83B0D /* Api+AcrossRoomPK.m in Sources */,
|
||||||
E88C72992828F3620047FB2B /* XPRoomMusicLibraryTableViewCell.m in Sources */,
|
E88C72992828F3620047FB2B /* XPRoomMusicLibraryTableViewCell.m in Sources */,
|
||||||
E8D34D4728080295009C4835 /* XPMineUserDataViewController.m in Sources */,
|
E8D34D4728080295009C4835 /* XPMineUserDataViewController.m in Sources */,
|
||||||
@@ -8316,6 +8340,7 @@
|
|||||||
E8AC723A26F49AAE007D6E91 /* XPMineNotifyStatus.m in Sources */,
|
E8AC723A26F49AAE007D6E91 /* XPMineNotifyStatus.m in Sources */,
|
||||||
18E7B33226F317A20064BC9B /* XPWebViewController.m in Sources */,
|
18E7B33226F317A20064BC9B /* XPWebViewController.m in Sources */,
|
||||||
E8AEAEF927141CA30017FCE0 /* RoomHeaderView.m in Sources */,
|
E8AEAEF927141CA30017FCE0 /* RoomHeaderView.m in Sources */,
|
||||||
|
E8098CAA282E03B40090B9F0 /* XPMonentsRecommendPresenter.m in Sources */,
|
||||||
9B1B729828002147003FACE9 /* XPMineFansTeamPresenter.m in Sources */,
|
9B1B729828002147003FACE9 /* XPMineFansTeamPresenter.m in Sources */,
|
||||||
E86507E8281A8212006951B0 /* ContentTweetModel.m in Sources */,
|
E86507E8281A8212006951B0 /* ContentTweetModel.m in Sources */,
|
||||||
E8D55CA0281186D6006935A5 /* SessionAudioRecordView.m in Sources */,
|
E8D55CA0281186D6006935A5 /* SessionAudioRecordView.m in Sources */,
|
||||||
@@ -8453,6 +8478,7 @@
|
|||||||
9B0997A327F19DE500EB8F14 /* QGHWDShaders.metal in Sources */,
|
9B0997A327F19DE500EB8F14 /* QGHWDShaders.metal in Sources */,
|
||||||
187EEEE126E89BFB002833B2 /* AccountModel.m in Sources */,
|
187EEEE126E89BFB002833B2 /* AccountModel.m in Sources */,
|
||||||
E87C54C22823CD6F0051AA11 /* XPMineResetLoginPwdViewController.m in Sources */,
|
E87C54C22823CD6F0051AA11 /* XPMineResetLoginPwdViewController.m in Sources */,
|
||||||
|
E8098CA7282E00920090B9F0 /* Api+Monents.m in Sources */,
|
||||||
E896EFA92771AEEC00AD2CC1 /* XPMineAttentionTableViewCell.m in Sources */,
|
E896EFA92771AEEC00AD2CC1 /* XPMineAttentionTableViewCell.m in Sources */,
|
||||||
E8F1559328129EBA00EE8C06 /* ContentSecretaryModel.m in Sources */,
|
E8F1559328129EBA00EE8C06 /* ContentSecretaryModel.m in Sources */,
|
||||||
9BBC02912786FC570007C24B /* XPMineNobleCardTableViewCell.m in Sources */,
|
9BBC02912786FC570007C24B /* XPMineNobleCardTableViewCell.m in Sources */,
|
||||||
|
22
xplan-ios/Assets.xcassets/Monents/monents_info_top.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "monents_info_top@2x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "monents_info_top@3x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
BIN
xplan-ios/Assets.xcassets/Monents/monents_info_top.imageset/monents_info_top@2x.png
vendored
Normal file
After Width: | Height: | Size: 968 B |
BIN
xplan-ios/Assets.xcassets/Monents/monents_info_top.imageset/monents_info_top@3x.png
vendored
Normal file
After Width: | Height: | Size: 1.4 KiB |
22
xplan-ios/Assets.xcassets/Monents/monents_info_topic_icon.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "monents_info_topic_icon@2x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "monents_info_topic_icon@3x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
BIN
xplan-ios/Assets.xcassets/Monents/monents_info_topic_icon.imageset/monents_info_topic_icon@2x.png
vendored
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
xplan-ios/Assets.xcassets/Monents/monents_info_topic_icon.imageset/monents_info_topic_icon@3x.png
vendored
Normal file
After Width: | Height: | Size: 2.2 KiB |
22
xplan-ios/Assets.xcassets/Tabbar/tab_monents_normal.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "tab_monents_normal@2x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "tab_monents_normal@3x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
BIN
xplan-ios/Assets.xcassets/Tabbar/tab_monents_normal.imageset/tab_monents_normal@2x.png
vendored
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
xplan-ios/Assets.xcassets/Tabbar/tab_monents_normal.imageset/tab_monents_normal@3x.png
vendored
Normal file
After Width: | Height: | Size: 2.2 KiB |
22
xplan-ios/Assets.xcassets/Tabbar/tab_monents_select.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "tab_monents_select@2x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "tab_monents_select@3x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
BIN
xplan-ios/Assets.xcassets/Tabbar/tab_monents_select.imageset/tab_monents_select@2x.png
vendored
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
xplan-ios/Assets.xcassets/Tabbar/tab_monents_select.imageset/tab_monents_select@3x.png
vendored
Normal file
After Width: | Height: | Size: 2.3 KiB |
@@ -20,6 +20,7 @@ UIKIT_EXTERN NSString * const kImageTypeUserLibaryDetail;//用户相册大图nil
|
|||||||
UIKIT_EXTERN NSString * const kImageTypeCornerAvatar;//圆角图形,会先把图形裁剪成正方形,并且转换为png
|
UIKIT_EXTERN NSString * const kImageTypeCornerAvatar;//圆角图形,会先把图形裁剪成正方形,并且转换为png
|
||||||
UIKIT_EXTERN NSString * const kImageTypeUserInfoAlbum;//用户信息里面相册
|
UIKIT_EXTERN NSString * const kImageTypeUserInfoAlbum;//用户信息里面相册
|
||||||
UIKIT_EXTERN NSString * const kImageTypeUserCardLevel;///用户资料卡中 等级以高度20等比例缩放
|
UIKIT_EXTERN NSString * const kImageTypeUserCardLevel;///用户资料卡中 等级以高度20等比例缩放
|
||||||
|
UIKIT_EXTERN NSString * const kImageTypeMonentsPhoto;///动态中的图片
|
||||||
typedef NS_ENUM(NSUInteger, ImageType){
|
typedef NS_ENUM(NSUInteger, ImageType){
|
||||||
ImageTypeRoomFace = 1, //房间表情
|
ImageTypeRoomFace = 1, //房间表情
|
||||||
ImageTypeRoomGift, //房间礼物
|
ImageTypeRoomGift, //房间礼物
|
||||||
@@ -27,7 +28,8 @@ typedef NS_ENUM(NSUInteger, ImageType){
|
|||||||
ImageTypeUserLibaryDetail, //用户相册大图
|
ImageTypeUserLibaryDetail, //用户相册大图
|
||||||
ImageTypeCornerAvatar, //圆角图形,会先把图形裁剪成正方形,并且转换为png
|
ImageTypeCornerAvatar, //圆角图形,会先把图形裁剪成正方形,并且转换为png
|
||||||
ImageTypeUserInfoAlbum, ///用户信息里面相册
|
ImageTypeUserInfoAlbum, ///用户信息里面相册
|
||||||
ImageTypeUserCardLevel /// 用户资料卡中 等级以高度20等比例缩放
|
ImageTypeUserCardLevel, /// 用户资料卡中 等级以高度20等比例缩放
|
||||||
|
ImageTypeMonentsPhoto, ///动态中的图片
|
||||||
};
|
};
|
||||||
|
|
||||||
///展位图
|
///展位图
|
||||||
|
@@ -22,7 +22,8 @@ NSString * const kImageTypeCornerAvatar = @"imageMogr2/auto-orient/thumbnail/300
|
|||||||
NSString * const kImageTypeUserInfoAlbum = @"imageMogr2/auto-orient/blur/375x375";
|
NSString * const kImageTypeUserInfoAlbum = @"imageMogr2/auto-orient/blur/375x375";
|
||||||
/// 用户信息里面相册
|
/// 用户信息里面相册
|
||||||
NSString * const kImageTypeUserCardLevel = @"imageMogr2/thumbnail/x40";
|
NSString * const kImageTypeUserCardLevel = @"imageMogr2/thumbnail/x40";
|
||||||
|
/// 动态中的图片 400 * 400
|
||||||
|
NSString * const kImageTypeMonentsPhoto = @"imageMogr2/auto-orient/thumbnail/400x400";
|
||||||
|
|
||||||
/// 头像的默认占位图
|
/// 头像的默认占位图
|
||||||
+ (UIImage *)defaultAvatarPlaceholder {
|
+ (UIImage *)defaultAvatarPlaceholder {
|
||||||
@@ -76,6 +77,8 @@ NSString * const kImageTypeUserCardLevel = @"imageMogr2/thumbnail/x40";
|
|||||||
break;
|
break;
|
||||||
case ImageTypeUserCardLevel:
|
case ImageTypeUserCardLevel:
|
||||||
configUrl = kImageTypeUserCardLevel;
|
configUrl = kImageTypeUserCardLevel;
|
||||||
|
case ImageTypeMonentsPhoto:
|
||||||
|
configUrl = kImageTypeMonentsPhoto;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
43
xplan-ios/Main/Monents/Api/Api+Monents.h
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
//
|
||||||
|
// Api+Monents.h
|
||||||
|
// xplan-ios
|
||||||
|
//
|
||||||
|
// Created by 冯硕 on 2022/5/13.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "Api.h"
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface Api (Monents)
|
||||||
|
/// 朋友圈动态推荐列表
|
||||||
|
/// @param completion 完成
|
||||||
|
/// @param page 当前的页数
|
||||||
|
/// @param pageSize 一页的个数
|
||||||
|
/// @param types 类型 0,2
|
||||||
|
+ (void)monentsRecommendList:(HttpRequestHelperCompletion)completion page:(NSString *)page pageSize:(NSString *)pageSize types:(NSString *)types;
|
||||||
|
|
||||||
|
/// 朋友圈动态最新列表
|
||||||
|
/// @param completion 完成
|
||||||
|
/// @param dynamicId 最新动态的id
|
||||||
|
/// @param pageSize 一页的个数
|
||||||
|
/// @param types 类型 0,2
|
||||||
|
+ (void)monentsLatestList:(HttpRequestHelperCompletion)completion dynamicId:(NSString *)dynamicId pageSize:(NSString *)pageSize types:(NSString *)types;
|
||||||
|
|
||||||
|
/// 朋友圈动态关注列表
|
||||||
|
/// @param completion 完成
|
||||||
|
/// @param dynamicId 最新动态的id
|
||||||
|
/// @param pageSize 一页的个数
|
||||||
|
/// @param types 类型 0,2
|
||||||
|
+ (void)monentsFollowerList:(HttpRequestHelperCompletion)completion dynamicId:(NSString *)dynamicId pageSize:(NSString *)pageSize types:(NSString *)types;
|
||||||
|
|
||||||
|
/// 分享动态
|
||||||
|
/// @param completion 完成
|
||||||
|
/// @param dynamicId 动态的id
|
||||||
|
/// @param uid 动态发布者的uid
|
||||||
|
/// @param worldId 动态的话题id
|
||||||
|
/// @param shareUid 分享者的uid
|
||||||
|
+ (void)userShareMonents:(HttpRequestHelperCompletion)completion dynamicId:(NSString *)dynamicId uid:(NSString *)uid worldId:(NSString *)worldId shareUid:(NSString *)shareUid;
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
49
xplan-ios/Main/Monents/Api/Api+Monents.m
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
//
|
||||||
|
// Api+Monents.m
|
||||||
|
// xplan-ios
|
||||||
|
//
|
||||||
|
// Created by 冯硕 on 2022/5/13.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "Api+Monents.h"
|
||||||
|
|
||||||
|
@implementation Api (Monents)
|
||||||
|
|
||||||
|
/// 朋友圈动态推荐列表
|
||||||
|
/// @param completion 完成
|
||||||
|
/// @param page 当前的页数
|
||||||
|
/// @param pageSize 一页的个数
|
||||||
|
/// @param types 类型 0,2
|
||||||
|
+ (void)monentsRecommendList:(HttpRequestHelperCompletion)completion page:(NSString *)page pageSize:(NSString *)pageSize types:(NSString *)types {
|
||||||
|
[self makeRequest:@"dynamic/square/recommendDynamics" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, page, pageSize, types, nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 朋友圈动态最新列表
|
||||||
|
/// @param completion 完成
|
||||||
|
/// @param dynamicId 最新动态的id
|
||||||
|
/// @param pageSize 一页的个数
|
||||||
|
/// @param types 类型 0,2
|
||||||
|
+ (void)monentsLatestList:(HttpRequestHelperCompletion)completion dynamicId:(NSString *)dynamicId pageSize:(NSString *)pageSize types:(NSString *)types {
|
||||||
|
[self makeRequest:@"dynamic/square/latestDynamics" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, dynamicId, pageSize, types, nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 朋友圈动态关注列表
|
||||||
|
/// @param completion 完成
|
||||||
|
/// @param dynamicId 最新动态的id
|
||||||
|
/// @param pageSize 一页的个数
|
||||||
|
/// @param types 类型 0,2
|
||||||
|
+ (void)monentsFollowerList:(HttpRequestHelperCompletion)completion dynamicId:(NSString *)dynamicId pageSize:(NSString *)pageSize types:(NSString *)types {
|
||||||
|
[self makeRequest:@"dynamic/square/latestDynamics" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, dynamicId, pageSize, types, nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 分享动态
|
||||||
|
/// @param completion 完成
|
||||||
|
/// @param dynamicId 动态的id
|
||||||
|
/// @param uid 动态发布者的uid
|
||||||
|
/// @param worldId 动态的话题id
|
||||||
|
/// @param shareUid 分享者的uid
|
||||||
|
+ (void)userShareMonents:(HttpRequestHelperCompletion)completion dynamicId:(NSString *)dynamicId uid:(NSString *)uid worldId:(NSString *)worldId shareUid:(NSString *)shareUid {
|
||||||
|
[self makeRequest:@"dynamic/share" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, dynamicId, uid, worldId, shareUid, nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
@@ -71,6 +71,14 @@ typedef NS_ENUM(NSInteger, MonentsContentType) {
|
|||||||
@property (nonatomic,assign) BOOL isFold;
|
@property (nonatomic,assign) BOOL isFold;
|
||||||
///cell的高度
|
///cell的高度
|
||||||
@property (nonatomic,assign) CGFloat rowHeight;
|
@property (nonatomic,assign) CGFloat rowHeight;
|
||||||
|
///图片的高度
|
||||||
|
@property (nonatomic,assign) CGFloat picHeight;
|
||||||
|
///文本内容的高度
|
||||||
|
@property (nonatomic,assign) CGFloat contentHeight;
|
||||||
|
///显示的内容的富文本
|
||||||
|
@property (nonatomic,strong) NSMutableAttributedString *contentAttribute;
|
||||||
|
///收起的
|
||||||
|
@property (nonatomic,strong, nullable) NSMutableAttributedString *foldAttribute;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface MonentsPicInfoModel : NSObject
|
@interface MonentsPicInfoModel : NSObject
|
||||||
|
@@ -10,6 +10,12 @@
|
|||||||
#define aMinute 60
|
#define aMinute 60
|
||||||
|
|
||||||
@implementation MonentsInfoModel
|
@implementation MonentsInfoModel
|
||||||
|
- (instancetype)init {
|
||||||
|
if (self = [super init]) {
|
||||||
|
self.isFold = YES;
|
||||||
|
}
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
+ (NSDictionary *)objectClassInArray {
|
+ (NSDictionary *)objectClassInArray {
|
||||||
return @{@"dynamicResList":MonentsPicInfoModel.class};
|
return @{@"dynamicResList":MonentsPicInfoModel.class};
|
||||||
@@ -17,7 +23,7 @@
|
|||||||
|
|
||||||
|
|
||||||
- (NSString *)publishTime {
|
- (NSString *)publishTime {
|
||||||
return [self stringWithTimeStamp:self.publishTime];
|
return [self stringWithTimeStamp:_publishTime];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *)stringWithTimeStamp:(NSString *)timeStamp {
|
- (NSString *)stringWithTimeStamp:(NSString *)timeStamp {
|
||||||
@@ -74,6 +80,7 @@
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
@@ -11,14 +11,18 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
#define kMONENTS_CONTENT_LEFT_PADDING 67
|
#define kMONENTS_CONTENT_LEFT_PADDING 67
|
||||||
#define kMONENTS_CONTENT_RIGHT_PADDING 36
|
#define kMONENTS_CONTENT_RIGHT_PADDING 36
|
||||||
#define kMONENTS_CONTENT_MAX_WIDTH (KScreenWidth -kMONENTS_CONTENT_LEFT_PADDING - kMONENTS_CONTENT_RIGHT_PADDING)
|
#define kMONENTS_CONTENT_MAX_WIDTH (KScreenWidth -kMONENTS_CONTENT_LEFT_PADDING - kMONENTS_CONTENT_RIGHT_PADDING)
|
||||||
#define kMONENTS_PIC_ONE_WIDTH 150 ///只有一个动态图片的高度
|
#define kMONENTS_PIC_ONE_WIDTH 200 ///只有一个动态图片的高度
|
||||||
#define kMONENTS_PIC_SPACE 4 ///图片之间的间隙的宽度或者高度
|
#define kMONENTS_PIC_SPACE 4 ///图片之间的间隙的宽度或者高度
|
||||||
#define kMONENTS_USER_INFO_HEIGHT 60 ///用户信息的高度
|
#define kMONENTS_USER_INFO_HEIGHT 60 ///用户信息的高度
|
||||||
#define kMONENTS_TOOL_BAR_HEIGHT 58 ///底部操作栏的高度
|
#define kMONENTS_TOOL_BAR_HEIGHT 58 ///底部操作栏的高度
|
||||||
#define kMONENTS_CONTENT_SPACAE_HEIGHT 12 /// 每个内容之间下面的间隙的高度
|
#define kMONENTS_CONTENT_SPACAE_HEIGHT 12 /// 每个内容之间下面的间隙的高度
|
||||||
#define kMONENTS_TEXT_TOPIC_HEIGHT 20 /// 话题的高度
|
#define kMONENTS_TEXT_TOPIC_HEIGHT 20 /// 话题的高度
|
||||||
|
#define kMONENTS_FOLD_HEIGHT 20 /// 展开 关闭的高度
|
||||||
|
@class MonentsInfoModel;
|
||||||
@interface XPMonentsLayoutConfig : NSObject
|
@interface XPMonentsLayoutConfig : NSObject
|
||||||
|
+ (void)layoutMonentsModel:(MonentsInfoModel *)monents;
|
||||||
|
+ (CGFloat)monentsPicHeight:(MonentsInfoModel *)monents;
|
||||||
|
+ (CGFloat)monentsContentHeight:(MonentsInfoModel *)monents;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
NS_ASSUME_NONNULL_END
|
||||||
|
@@ -6,7 +6,102 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "XPMonentsLayoutConfig.h"
|
#import "XPMonentsLayoutConfig.h"
|
||||||
|
#import <YYText/YYText.h>
|
||||||
|
#import "ThemeColor.h"
|
||||||
|
///Model
|
||||||
|
#import "MonentsInfoModel.h"
|
||||||
|
|
||||||
@implementation XPMonentsLayoutConfig
|
@implementation XPMonentsLayoutConfig
|
||||||
|
|
||||||
|
+ (void)layoutMonentsModel:(MonentsInfoModel *)monents {
|
||||||
|
CGFloat rowHeight = kMONENTS_USER_INFO_HEIGHT+ 20;
|
||||||
|
///用户信息和文字之间的间隙
|
||||||
|
rowHeight = rowHeight + kMONENTS_CONTENT_SPACAE_HEIGHT;
|
||||||
|
///文字内容的高度
|
||||||
|
rowHeight = rowHeight + [self monentsContentHeight:monents];
|
||||||
|
///图片的高度
|
||||||
|
rowHeight = rowHeight + [self monentsPicHeight:monents];
|
||||||
|
///如果没有图片的话 间隙就只有一个
|
||||||
|
if (monents.type == MonentsContentType_Picture) {
|
||||||
|
rowHeight = rowHeight + kMONENTS_CONTENT_SPACAE_HEIGHT * 2;
|
||||||
|
}else {
|
||||||
|
rowHeight = rowHeight + kMONENTS_CONTENT_SPACAE_HEIGHT;
|
||||||
|
}
|
||||||
|
///话题的高度
|
||||||
|
rowHeight = rowHeight + kMONENTS_TEXT_TOPIC_HEIGHT;
|
||||||
|
///底部操作栏的高度
|
||||||
|
rowHeight = rowHeight + kMONENTS_TOOL_BAR_HEIGHT;
|
||||||
|
monents.rowHeight = rowHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (CGFloat)monentsPicHeight:(MonentsInfoModel *)monents {
|
||||||
|
///计算图片的高度
|
||||||
|
NSInteger picCount = monents.dynamicResList.count;
|
||||||
|
CGFloat picHeight;
|
||||||
|
if (picCount == 0) {
|
||||||
|
picHeight = 0;
|
||||||
|
} else if(picCount == 1) {
|
||||||
|
picHeight = kMONENTS_PIC_ONE_WIDTH;
|
||||||
|
} else if(picCount == 2) {
|
||||||
|
picHeight = (kMONENTS_CONTENT_MAX_WIDTH - kMONENTS_PIC_SPACE) / 2;
|
||||||
|
} else {
|
||||||
|
if (picCount > 9) {
|
||||||
|
picCount = 9;
|
||||||
|
}
|
||||||
|
CGFloat itemWidth = (kMONENTS_CONTENT_MAX_WIDTH - kMONENTS_PIC_SPACE * 2) / 3;
|
||||||
|
NSInteger page = picCount % 3;
|
||||||
|
NSInteger line = picCount / 3;
|
||||||
|
if (page == 0) {
|
||||||
|
picHeight = itemWidth * line + (line -1)* kMONENTS_PIC_SPACE;
|
||||||
|
} else {
|
||||||
|
picHeight = itemWidth * (line +1) + line * kMONENTS_PIC_SPACE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
monents.picHeight = picHeight;
|
||||||
|
return picHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (CGFloat)monentsContentHeight:(MonentsInfoModel *)monents {
|
||||||
|
///计算文本的高度
|
||||||
|
if (!monents.contentAttribute) {
|
||||||
|
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
|
||||||
|
///置顶
|
||||||
|
if (monents.squareTop) {
|
||||||
|
UIImageView *imageView = [[UIImageView alloc]init];
|
||||||
|
imageView.frame = CGRectMake(0, 0, 36, 14);
|
||||||
|
imageView.image = [UIImage imageNamed:@"monents_info_top"];
|
||||||
|
NSMutableAttributedString * topAttrString = [NSMutableAttributedString yy_attachmentStringWithContent:imageView contentMode:UIViewContentModeScaleAspectFit attachmentSize:CGSizeMake(imageView.frame.size.width, imageView.frame.size.height) alignToFont:[UIFont systemFontOfSize:15.0] alignment:YYTextVerticalAlignmentCenter];
|
||||||
|
[attribute appendAttributedString:topAttrString];
|
||||||
|
}
|
||||||
|
|
||||||
|
///文本
|
||||||
|
NSString * text = monents.content;
|
||||||
|
if (text == nil || text.length <= 0) {
|
||||||
|
text = @"";
|
||||||
|
}
|
||||||
|
NSMutableAttributedString *contentAttribute = [[NSMutableAttributedString alloc] initWithString:text attributes:nil];
|
||||||
|
contentAttribute.yy_font = [UIFont systemFontOfSize:14];
|
||||||
|
NSMutableParagraphStyle *paraStyle = [[NSMutableParagraphStyle alloc] init];
|
||||||
|
paraStyle.lineSpacing = 4.0f;//行间距
|
||||||
|
// 强制排版(从左到右)
|
||||||
|
paraStyle.alignment = NSTextAlignmentLeft;
|
||||||
|
paraStyle.baseWritingDirection = NSWritingDirectionLeftToRight;
|
||||||
|
contentAttribute.yy_paragraphStyle = paraStyle;
|
||||||
|
[attribute appendAttributedString:contentAttribute];
|
||||||
|
monents.contentAttribute = attribute;
|
||||||
|
}
|
||||||
|
|
||||||
|
YYTextContainer *container = [YYTextContainer new];
|
||||||
|
container.size = CGSizeMake(kMONENTS_CONTENT_MAX_WIDTH, CGFLOAT_MAX);
|
||||||
|
container.maximumNumberOfRows = 0;
|
||||||
|
YYTextLayout *layout = [YYTextLayout layoutWithContainer:container text:monents.contentAttribute];
|
||||||
|
CGFloat foldHeight = 0;
|
||||||
|
if (layout.rowCount > 6) {
|
||||||
|
foldHeight = kMONENTS_FOLD_HEIGHT;
|
||||||
|
}
|
||||||
|
YYTextLayout *realLayout = [YYTextLayout layoutWithContainer:container text:monents.contentAttribute];
|
||||||
|
monents.contentHeight = realLayout.textBoundingSize.height;
|
||||||
|
return realLayout.textBoundingSize.height + foldHeight;
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@@ -0,0 +1,20 @@
|
|||||||
|
//
|
||||||
|
// XPMonentsRecommendPresenter.h
|
||||||
|
// xplan-ios
|
||||||
|
//
|
||||||
|
// Created by 冯硕 on 2022/5/13.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "BaseMvpPresenter.h"
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface XPMonentsRecommendPresenter : BaseMvpPresenter
|
||||||
|
/// 获取朋友圈动态推荐列表
|
||||||
|
/// @param page 当前的页数
|
||||||
|
/// @param pageSize 一页的个数
|
||||||
|
/// @param state 状态
|
||||||
|
- (void)getMonentsRecommendList:(NSInteger)page pageSize:(NSInteger)pageSize state:(int)state;
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,29 @@
|
|||||||
|
//
|
||||||
|
// XPMonentsRecommendPresenter.m
|
||||||
|
// xplan-ios
|
||||||
|
//
|
||||||
|
// Created by 冯硕 on 2022/5/13.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "XPMonentsRecommendPresenter.h"
|
||||||
|
#import "Api+Monents.h"
|
||||||
|
#import "MonentsInfoModel.h"
|
||||||
|
#import "XPMonentsRecommendProtocol.h"
|
||||||
|
@implementation XPMonentsRecommendPresenter
|
||||||
|
|
||||||
|
|
||||||
|
/// 获取朋友圈动态推荐列表
|
||||||
|
/// @param page 当前的页数
|
||||||
|
/// @param pageSize 一页的个数
|
||||||
|
/// @param state 状态
|
||||||
|
- (void)getMonentsRecommendList:(NSInteger)page pageSize:(NSInteger)pageSize state:(int)state {
|
||||||
|
NSString * pageStr = [NSString stringWithFormat:@"%ld", page];
|
||||||
|
NSString * pageSizeStr = [NSString stringWithFormat:@"%ld", pageSize];
|
||||||
|
[Api monentsRecommendList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||||
|
NSArray *array = [MonentsInfoModel modelsWithArray:data.data];
|
||||||
|
[[self getView] getMonentsRecommendListSuccess:array state:state];
|
||||||
|
}] page:pageStr pageSize:pageSizeStr types:@"0,2"];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
19
xplan-ios/Main/Monents/Protocol/XPMonentsRecommendProtocol.h
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
//
|
||||||
|
// XPMonentsRecommendProtocol.h
|
||||||
|
// xplan-ios
|
||||||
|
//
|
||||||
|
// Created by 冯硕 on 2022/5/13.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@protocol XPMonentsRecommendProtocol <NSObject>
|
||||||
|
|
||||||
|
///获取推荐列表从成功
|
||||||
|
- (void)getMonentsRecommendListSuccess:(NSArray *)array state:(int)state;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,16 @@
|
|||||||
|
//
|
||||||
|
// XPMonentsEmptyTableViewCell.h
|
||||||
|
// xplan-ios
|
||||||
|
//
|
||||||
|
// Created by 冯硕 on 2022/5/13.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface XPMonentsEmptyTableViewCell : UITableViewCell
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,23 @@
|
|||||||
|
//
|
||||||
|
// XPMonentsEmptyTableViewCell.m
|
||||||
|
// xplan-ios
|
||||||
|
//
|
||||||
|
// Created by 冯硕 on 2022/5/13.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "XPMonentsEmptyTableViewCell.h"
|
||||||
|
|
||||||
|
@implementation XPMonentsEmptyTableViewCell
|
||||||
|
|
||||||
|
- (void)awakeFromNib {
|
||||||
|
[super awakeFromNib];
|
||||||
|
// Initialization code
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||||
|
[super setSelected:selected animated:animated];
|
||||||
|
|
||||||
|
// Configure the view for the selected state
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
@@ -8,7 +8,7 @@
|
|||||||
#import "XPMonentsTableViewCell.h"
|
#import "XPMonentsTableViewCell.h"
|
||||||
///Third
|
///Third
|
||||||
#import <Masonry/Masonry.h>
|
#import <Masonry/Masonry.h>
|
||||||
#import <YYText/YYText.h>
|
|
||||||
///Tool
|
///Tool
|
||||||
#import "ThemeColor.h"
|
#import "ThemeColor.h"
|
||||||
#import "NetImageView.h"
|
#import "NetImageView.h"
|
||||||
@@ -20,6 +20,8 @@
|
|||||||
#import "XPMonentsPhotoView.h"
|
#import "XPMonentsPhotoView.h"
|
||||||
#import "XPMonentsTooBarView.h"
|
#import "XPMonentsTooBarView.h"
|
||||||
#import "XPMoentsTopicView.h"
|
#import "XPMoentsTopicView.h"
|
||||||
|
#import "XPMonentsContentView.h"
|
||||||
|
#import "XPMonentsLayoutConfig.h"
|
||||||
@interface XPMonentsTableViewCell ()
|
@interface XPMonentsTableViewCell ()
|
||||||
///显示颜色的 有的时候stackView 不能显示颜色
|
///显示颜色的 有的时候stackView 不能显示颜色
|
||||||
@property (nonatomic,strong) UIView * backView;
|
@property (nonatomic,strong) UIView * backView;
|
||||||
@@ -27,12 +29,12 @@
|
|||||||
@property (nonatomic,strong) UIStackView *stackView;
|
@property (nonatomic,strong) UIStackView *stackView;
|
||||||
///用户信息
|
///用户信息
|
||||||
@property (nonatomic,strong) XPMonentsUserInfoView * userInfoView;
|
@property (nonatomic,strong) XPMonentsUserInfoView * userInfoView;
|
||||||
|
///显示内容的
|
||||||
|
@property (nonatomic,strong) XPMonentsContentView *textView;
|
||||||
///图片
|
///图片
|
||||||
@property (nonatomic,strong) XPMonentsPhotoView *photoView;
|
@property (nonatomic,strong) XPMonentsPhotoView *photoView;
|
||||||
///显示底部的操作栏
|
///显示底部的操作栏
|
||||||
@property (nonatomic,strong) XPMonentsTooBarView *toolBarView;
|
@property (nonatomic,strong) XPMonentsTooBarView *toolBarView;
|
||||||
///显示内容
|
|
||||||
@property (nonatomic,strong) YYLabel *contentLabel;
|
|
||||||
///话题
|
///话题
|
||||||
@property (nonatomic,strong) XPMoentsTopicView *topicView;
|
@property (nonatomic,strong) XPMoentsTopicView *topicView;
|
||||||
@end
|
@end
|
||||||
@@ -57,7 +59,7 @@
|
|||||||
[self.backView addSubview:self.stackView];
|
[self.backView addSubview:self.stackView];
|
||||||
[self.backView addSubview:self.toolBarView];
|
[self.backView addSubview:self.toolBarView];
|
||||||
|
|
||||||
[self.stackView addArrangedSubview:self.contentLabel];
|
[self.stackView addArrangedSubview:self.textView];
|
||||||
[self.stackView addArrangedSubview:self.photoView];
|
[self.stackView addArrangedSubview:self.photoView];
|
||||||
[self.stackView addArrangedSubview:self.topicView];
|
[self.stackView addArrangedSubview:self.topicView];
|
||||||
}
|
}
|
||||||
@@ -67,13 +69,8 @@
|
|||||||
make.edges.mas_equalTo(self.contentView);
|
make.edges.mas_equalTo(self.contentView);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
||||||
make.edges.mas_equalTo(self.contentView);
|
|
||||||
}];
|
|
||||||
|
|
||||||
[self.userInfoView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.userInfoView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.left.mas_equalTo(self.backView);
|
make.left.right.top.mas_equalTo(self.backView);
|
||||||
make.right.mas_equalTo(self.backView);
|
|
||||||
make.height.mas_equalTo(kMONENTS_USER_INFO_HEIGHT);
|
make.height.mas_equalTo(kMONENTS_USER_INFO_HEIGHT);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
@@ -94,55 +91,31 @@
|
|||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSAttributedString *)createMonentsContentAttribute {
|
|
||||||
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
|
|
||||||
if (self.monentsInfo.squareTop) {
|
|
||||||
[attribute appendAttributedString:[self createImageAttribute:[UIImage imageNamed:@""]]];
|
|
||||||
}
|
|
||||||
|
|
||||||
NSString * text = _monentsInfo.content;
|
|
||||||
if (text == nil || text.length <= 0) {
|
|
||||||
text = @"";
|
|
||||||
}
|
|
||||||
NSMutableAttributedString *contentAttribute = [[NSMutableAttributedString alloc] initWithString:text attributes:nil];
|
|
||||||
contentAttribute.yy_font = [UIFont systemFontOfSize:14];
|
|
||||||
contentAttribute.yy_color = [ThemeColor mainTextColor];
|
|
||||||
contentAttribute.yy_paragraphStyle = [self paragraphStyle];
|
|
||||||
[attribute appendAttributedString:contentAttribute];
|
|
||||||
return attribute;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// 生成本地一个图片的富文本
|
|
||||||
/// @param image 本地的图片
|
|
||||||
- (NSMutableAttributedString *)createImageAttribute:(UIImage *)image {
|
|
||||||
UIImageView *imaveView = [[UIImageView alloc]init];
|
|
||||||
imaveView.image = image;
|
|
||||||
CGFloat scale = (CGFloat)imaveView.image.size.width / (CGFloat)imaveView.image.size.height;
|
|
||||||
imaveView.bounds = CGRectMake(0, 0, 20 * scale, 20);
|
|
||||||
NSMutableAttributedString * attrString = [NSMutableAttributedString yy_attachmentStringWithContent:imaveView contentMode:UIViewContentModeScaleAspectFit attachmentSize:CGSizeMake(imaveView.frame.size.width, imaveView.frame.size.height) alignToFont:[UIFont systemFontOfSize:15.0] alignment:YYTextVerticalAlignmentCenter];
|
|
||||||
return attrString;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// 设置文本的样式 间隙 缩进 ...
|
|
||||||
- (NSMutableParagraphStyle *)paragraphStyle {
|
|
||||||
NSMutableParagraphStyle *paraStyle = [[NSMutableParagraphStyle alloc] init];
|
|
||||||
paraStyle.lineSpacing = 4.0f;//行间距
|
|
||||||
// 强制排版(从左到右)
|
|
||||||
paraStyle.alignment = NSTextAlignmentLeft;
|
|
||||||
paraStyle.baseWritingDirection = NSWritingDirectionLeftToRight;
|
|
||||||
return paraStyle;
|
|
||||||
}
|
|
||||||
|
|
||||||
#pragma mark - Getters And Setters
|
#pragma mark - Getters And Setters
|
||||||
- (void)setMonentsInfo:(MonentsInfoModel *)monentsInfo {
|
- (void)setMonentsInfo:(MonentsInfoModel *)monentsInfo {
|
||||||
_monentsInfo = monentsInfo;
|
_monentsInfo = monentsInfo;
|
||||||
if (_monentsInfo) {
|
if (_monentsInfo) {
|
||||||
self.userInfoView.monentsInfo = _monentsInfo;
|
self.userInfoView.monentsInfo = _monentsInfo;
|
||||||
self.contentLabel.attributedText = [self createMonentsContentAttribute];
|
self.textView.monentsInfo = _monentsInfo;
|
||||||
self.photoView.dynamicResList = _monentsInfo.dynamicResList;
|
self.photoView.dynamicResList = _monentsInfo.dynamicResList;
|
||||||
self.photoView.hidden = _monentsInfo.type == MonentsContentType_Text;
|
|
||||||
self.topicView.monentsInfo = _monentsInfo;
|
self.topicView.monentsInfo = _monentsInfo;
|
||||||
self.toolBarView.monentsInfo = _monentsInfo;
|
self.toolBarView.monentsInfo = _monentsInfo;
|
||||||
|
if (_monentsInfo.type == MonentsContentType_Text) {
|
||||||
|
self.photoView.hidden = YES;
|
||||||
|
[self.photoView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.height.mas_equalTo(0);
|
||||||
|
}];
|
||||||
|
} else {
|
||||||
|
CGFloat picHeight = _monentsInfo.picHeight <=0 ? [XPMonentsLayoutConfig monentsPicHeight:_monentsInfo] : _monentsInfo.picHeight;
|
||||||
|
[self.photoView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.height.mas_equalTo(picHeight);
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
|
CGFloat contentHeight = _monentsInfo.contentHeight <=0 ? [XPMonentsLayoutConfig monentsContentHeight:_monentsInfo] : _monentsInfo.contentHeight;
|
||||||
|
[self.textView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.height.mas_equalTo(contentHeight);
|
||||||
|
}];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,14 +134,6 @@
|
|||||||
return _userInfoView;
|
return _userInfoView;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (YYLabel *)contentLabel {
|
|
||||||
if (!_contentLabel) {
|
|
||||||
_contentLabel = [[YYLabel alloc] init];
|
|
||||||
_contentLabel.preferredMaxLayoutWidth = kMONENTS_CONTENT_MAX_WIDTH;
|
|
||||||
}
|
|
||||||
return _contentLabel;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (XPMonentsPhotoView *)photoView {
|
- (XPMonentsPhotoView *)photoView {
|
||||||
if (!_photoView) {
|
if (!_photoView) {
|
||||||
_photoView = [[XPMonentsPhotoView alloc] init];
|
_photoView = [[XPMonentsPhotoView alloc] init];
|
||||||
@@ -179,14 +144,21 @@
|
|||||||
- (UIStackView *)stackView {
|
- (UIStackView *)stackView {
|
||||||
if (!_stackView) {
|
if (!_stackView) {
|
||||||
_stackView = [[UIStackView alloc] init];
|
_stackView = [[UIStackView alloc] init];
|
||||||
_stackView.axis = UILayoutConstraintAxisHorizontal;
|
_stackView.axis = UILayoutConstraintAxisVertical;
|
||||||
_stackView.distribution = UIStackViewDistributionFill;
|
_stackView.distribution = UIStackViewDistributionFill;
|
||||||
_stackView.alignment = UIStackViewAlignmentFill;
|
_stackView.alignment = UIStackViewAlignmentLeading;
|
||||||
_stackView.spacing = kMONENTS_CONTENT_SPACAE_HEIGHT;
|
_stackView.spacing = kMONENTS_CONTENT_SPACAE_HEIGHT;
|
||||||
}
|
}
|
||||||
return _stackView;
|
return _stackView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (XPMonentsContentView *)textView {
|
||||||
|
if (!_textView) {
|
||||||
|
_textView = [[XPMonentsContentView alloc] init];
|
||||||
|
}
|
||||||
|
return _textView;
|
||||||
|
}
|
||||||
|
|
||||||
- (XPMoentsTopicView *)topicView {
|
- (XPMoentsTopicView *)topicView {
|
||||||
if (!_topicView) {
|
if (!_topicView) {
|
||||||
_topicView = [[XPMoentsTopicView alloc] init];
|
_topicView = [[XPMoentsTopicView alloc] init];
|
||||||
|
@@ -53,7 +53,7 @@
|
|||||||
}];
|
}];
|
||||||
|
|
||||||
[self.topicImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.topicImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.right.mas_equalTo(self.topicLabel).offset(9);
|
make.right.mas_equalTo(self.topicLabel.mas_right).offset(9);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
[self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
@@ -69,6 +69,7 @@
|
|||||||
}
|
}
|
||||||
#pragma mark - Getters And Setters
|
#pragma mark - Getters And Setters
|
||||||
- (void)setMonentsInfo:(MonentsInfoModel *)monentsInfo {
|
- (void)setMonentsInfo:(MonentsInfoModel *)monentsInfo {
|
||||||
|
_monentsInfo = monentsInfo;
|
||||||
if (_monentsInfo) {
|
if (_monentsInfo) {
|
||||||
if (_monentsInfo.topicId > 0) {
|
if (_monentsInfo.topicId > 0) {
|
||||||
self.topicImageView.hidden = NO;
|
self.topicImageView.hidden = NO;
|
||||||
@@ -106,7 +107,7 @@
|
|||||||
if (!_iconImageView) {
|
if (!_iconImageView) {
|
||||||
_iconImageView = [[UIImageView alloc] init];
|
_iconImageView = [[UIImageView alloc] init];
|
||||||
_iconImageView.userInteractionEnabled = YES;
|
_iconImageView.userInteractionEnabled = YES;
|
||||||
_iconImageView.image = [UIImage imageNamed:@""];
|
_iconImageView.image = [UIImage imageNamed:@"monents_info_topic_icon"];
|
||||||
}
|
}
|
||||||
return _iconImageView;
|
return _iconImageView;
|
||||||
}
|
}
|
||||||
|
16
xplan-ios/Main/Monents/View/SubViews/XPMonentsContentView.h
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
//
|
||||||
|
// XPMonentsContentView.h
|
||||||
|
// xplan-ios
|
||||||
|
//
|
||||||
|
// Created by 冯硕 on 2022/5/13.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
@class MonentsInfoModel;
|
||||||
|
@interface XPMonentsContentView : UIView
|
||||||
|
@property (nonatomic,strong) MonentsInfoModel *monentsInfo;
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
151
xplan-ios/Main/Monents/View/SubViews/XPMonentsContentView.m
Normal file
@@ -0,0 +1,151 @@
|
|||||||
|
//
|
||||||
|
// XPMonentsContentView.m
|
||||||
|
// xplan-ios
|
||||||
|
//
|
||||||
|
// Created by 冯硕 on 2022/5/13.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "XPMonentsContentView.h"
|
||||||
|
///Third
|
||||||
|
#import <Masonry/Masonry.h>
|
||||||
|
#import <YYText/YYText.h>
|
||||||
|
///Tool
|
||||||
|
#import "ThemeColor.h"
|
||||||
|
#import "XPMonentsLayoutConfig.h"
|
||||||
|
///Model
|
||||||
|
#import "MonentsInfoModel.h"
|
||||||
|
@interface XPMonentsContentView ()
|
||||||
|
///容器
|
||||||
|
@property (nonatomic,strong) UIStackView *stackView;
|
||||||
|
///显示内容
|
||||||
|
@property (nonatomic,strong) YYLabel *contentLabel;
|
||||||
|
///折叠的按钮
|
||||||
|
@property (nonatomic,strong) UIButton *foldButton;
|
||||||
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
@implementation XPMonentsContentView
|
||||||
|
|
||||||
|
- (instancetype)initWithFrame:(CGRect)frame {
|
||||||
|
self = [super initWithFrame:frame];
|
||||||
|
if (self) {
|
||||||
|
[self initSubViews];
|
||||||
|
[self initSubViewConstraints];
|
||||||
|
}
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - Private Method
|
||||||
|
- (void)initSubViews {
|
||||||
|
[self addSubview:self.stackView];
|
||||||
|
[self.stackView addSubview:self.contentLabel];
|
||||||
|
[self.stackView addSubview:self.foldButton];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)initSubViewConstraints {
|
||||||
|
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.edges.mas_equalTo(self);
|
||||||
|
}];
|
||||||
|
|
||||||
|
[self.foldButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.height.mas_equalTo(kMONENTS_FOLD_HEIGHT);
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSAttributedString *)createMonentsContentAttribute {
|
||||||
|
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
|
||||||
|
if (self.monentsInfo.squareTop) {
|
||||||
|
[attribute appendAttributedString:[self createImageAttribute:[UIImage imageNamed:@"monents_info_top"]]];
|
||||||
|
}
|
||||||
|
|
||||||
|
NSString * text = _monentsInfo.content;
|
||||||
|
if (text == nil || text.length <= 0) {
|
||||||
|
text = @"";
|
||||||
|
}
|
||||||
|
NSMutableAttributedString *contentAttribute = [[NSMutableAttributedString alloc] initWithString:text attributes:nil];
|
||||||
|
contentAttribute.yy_font = [UIFont systemFontOfSize:14];
|
||||||
|
contentAttribute.yy_color = [ThemeColor mainTextColor];
|
||||||
|
contentAttribute.yy_paragraphStyle = [self paragraphStyle];
|
||||||
|
[attribute appendAttributedString:contentAttribute];
|
||||||
|
return attribute;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 生成本地一个图片的富文本
|
||||||
|
/// @param image 本地的图片
|
||||||
|
- (NSMutableAttributedString *)createImageAttribute:(UIImage *)image {
|
||||||
|
UIImageView *imaveView = [[UIImageView alloc]init];
|
||||||
|
imaveView.image = image;
|
||||||
|
CGFloat scale = (CGFloat)imaveView.image.size.width / (CGFloat)imaveView.image.size.height;
|
||||||
|
imaveView.bounds = CGRectMake(0, 0, 20 * scale, 20);
|
||||||
|
NSMutableAttributedString * attrString = [NSMutableAttributedString yy_attachmentStringWithContent:imaveView contentMode:UIViewContentModeScaleAspectFit attachmentSize:CGSizeMake(imaveView.frame.size.width, imaveView.frame.size.height) alignToFont:[UIFont systemFontOfSize:15.0] alignment:YYTextVerticalAlignmentCenter];
|
||||||
|
return attrString;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 设置文本的样式 间隙 缩进 ...
|
||||||
|
- (NSMutableParagraphStyle *)paragraphStyle {
|
||||||
|
NSMutableParagraphStyle *paraStyle = [[NSMutableParagraphStyle alloc] init];
|
||||||
|
paraStyle.lineSpacing = 4.0f;//行间距
|
||||||
|
// 强制排版(从左到右)
|
||||||
|
paraStyle.alignment = NSTextAlignmentLeft;
|
||||||
|
paraStyle.baseWritingDirection = NSWritingDirectionLeftToRight;
|
||||||
|
return paraStyle;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - Event Response
|
||||||
|
- (void)didClickFoldButton:(UIButton *)sender {
|
||||||
|
//TODO: 展开收起
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - Getters And Setters
|
||||||
|
- (void)setMonentsInfo:(MonentsInfoModel *)monentsInfo {
|
||||||
|
_monentsInfo = monentsInfo;
|
||||||
|
if (_monentsInfo) {
|
||||||
|
self.contentLabel.attributedText = [self createMonentsContentAttribute];
|
||||||
|
YYTextContainer *container = [YYTextContainer new];
|
||||||
|
container.size = CGSizeMake(kMONENTS_CONTENT_MAX_WIDTH, CGFLOAT_MAX);
|
||||||
|
container.maximumNumberOfRows = 0;
|
||||||
|
YYTextLayout *layout = [YYTextLayout layoutWithContainer:container text:self.contentLabel.attributedText];
|
||||||
|
if (layout.rowCount > 6) {
|
||||||
|
self.foldButton.hidden = NO;
|
||||||
|
} else {
|
||||||
|
self.foldButton.hidden = YES;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (UIStackView *)stackView {
|
||||||
|
if (!_stackView) {
|
||||||
|
_stackView = [[UIStackView alloc] init];
|
||||||
|
_stackView.axis = UILayoutConstraintAxisVertical;
|
||||||
|
_stackView.distribution = UIStackViewDistributionFill;
|
||||||
|
_stackView.alignment = UIStackViewAlignmentFill;
|
||||||
|
_stackView.spacing = 0;
|
||||||
|
}
|
||||||
|
return _stackView;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (UIButton *)foldButton {
|
||||||
|
if (_foldButton == nil) {
|
||||||
|
_foldButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||||
|
[_foldButton setTitle:@"展开" forState:UIControlStateNormal];
|
||||||
|
[_foldButton setTitle:@"收起" forState:UIControlStateSelected];
|
||||||
|
[_foldButton setTitleColor:UIColorFromRGB(0x34A7FF) forState:UIControlStateNormal];
|
||||||
|
[_foldButton setTitleColor:UIColorFromRGB(0x34A7FF) forState:UIControlStateSelected];
|
||||||
|
_foldButton.titleLabel.font = [UIFont systemFontOfSize:15];
|
||||||
|
_foldButton.hidden = YES;
|
||||||
|
[_foldButton addTarget:self action:@selector(didClickFoldButton:) forControlEvents:UIControlEventTouchUpInside];
|
||||||
|
}
|
||||||
|
return _foldButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
- (YYLabel *)contentLabel {
|
||||||
|
if (!_contentLabel) {
|
||||||
|
_contentLabel = [[YYLabel alloc] init];
|
||||||
|
_contentLabel.preferredMaxLayoutWidth = kMONENTS_CONTENT_MAX_WIDTH;
|
||||||
|
_contentLabel.numberOfLines = 0;
|
||||||
|
}
|
||||||
|
return _contentLabel;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
@@ -75,7 +75,7 @@
|
|||||||
|
|
||||||
} else if (_dynamicResList.count == 1) {
|
} else if (_dynamicResList.count == 1) {
|
||||||
self.firstImageView.hidden = NO;
|
self.firstImageView.hidden = NO;
|
||||||
[self.firstImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.firstImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.size.mas_equalTo(CGSizeMake(kMONENTS_PIC_ONE_WIDTH, kMONENTS_PIC_ONE_WIDTH));
|
make.size.mas_equalTo(CGSizeMake(kMONENTS_PIC_ONE_WIDTH, kMONENTS_PIC_ONE_WIDTH));
|
||||||
make.left.top.mas_equalTo(self);
|
make.left.top.mas_equalTo(self);
|
||||||
}];
|
}];
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
self.firstImageView.imageUrl = picInfo.resUrl;
|
self.firstImageView.imageUrl = picInfo.resUrl;
|
||||||
|
|
||||||
self.secondImageView.hidden = NO;
|
self.secondImageView.hidden = NO;
|
||||||
[self.secondImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.secondImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.size.mas_equalTo(CGSizeMake(itemWidth, itemWidth));
|
make.size.mas_equalTo(CGSizeMake(itemWidth, itemWidth));
|
||||||
make.top.mas_equalTo(self);
|
make.top.mas_equalTo(self);
|
||||||
make.left.mas_equalTo(self.firstImageView.mas_right).offset(kMONENTS_PIC_SPACE);
|
make.left.mas_equalTo(self.firstImageView.mas_right).offset(kMONENTS_PIC_SPACE);
|
||||||
@@ -117,7 +117,7 @@
|
|||||||
NSInteger page = i % 3;
|
NSInteger page = i % 3;
|
||||||
NSInteger line = i / 3;
|
NSInteger line = i / 3;
|
||||||
NetImageView * imageView = [self.subViewArray objectAtIndex:i];
|
NetImageView * imageView = [self.subViewArray objectAtIndex:i];
|
||||||
[imageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[imageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.size.mas_equalTo(CGSizeMake(itemWidth, itemWidth));
|
make.size.mas_equalTo(CGSizeMake(itemWidth, itemWidth));
|
||||||
make.left.mas_equalTo(page * (itemWidth + kMONENTS_PIC_SPACE));
|
make.left.mas_equalTo(page * (itemWidth + kMONENTS_PIC_SPACE));
|
||||||
make.top.mas_equalTo(line * (itemWidth + kMONENTS_PIC_SPACE));
|
make.top.mas_equalTo(line * (itemWidth + kMONENTS_PIC_SPACE));
|
||||||
@@ -130,11 +130,12 @@
|
|||||||
- (NetImageView *)firstImageView {
|
- (NetImageView *)firstImageView {
|
||||||
if (!_firstImageView) {
|
if (!_firstImageView) {
|
||||||
NetImageConfig * config = [[NetImageConfig alloc]init];
|
NetImageConfig * config = [[NetImageConfig alloc]init];
|
||||||
config.imageType = ImageTypeUserIcon;
|
config.imageType = ImageTypeMonentsPhoto;
|
||||||
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
||||||
_firstImageView = [[NetImageView alloc] initWithConfig:config];
|
_firstImageView = [[NetImageView alloc] initWithConfig:config];
|
||||||
_firstImageView.layer.masksToBounds = YES;
|
_firstImageView.layer.masksToBounds = YES;
|
||||||
_firstImageView.layer.cornerRadius = 12;
|
_firstImageView.layer.cornerRadius = 12;
|
||||||
|
_firstImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||||
}
|
}
|
||||||
return _firstImageView;
|
return _firstImageView;
|
||||||
}
|
}
|
||||||
@@ -142,11 +143,12 @@
|
|||||||
- (NetImageView *)secondImageView {
|
- (NetImageView *)secondImageView {
|
||||||
if (!_secondImageView) {
|
if (!_secondImageView) {
|
||||||
NetImageConfig * config = [[NetImageConfig alloc]init];
|
NetImageConfig * config = [[NetImageConfig alloc]init];
|
||||||
config.imageType = ImageTypeUserIcon;
|
config.imageType = ImageTypeMonentsPhoto;
|
||||||
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
||||||
_secondImageView = [[NetImageView alloc] initWithConfig:config];
|
_secondImageView = [[NetImageView alloc] initWithConfig:config];
|
||||||
_secondImageView.layer.masksToBounds = YES;
|
_secondImageView.layer.masksToBounds = YES;
|
||||||
_secondImageView.layer.cornerRadius = 12;
|
_secondImageView.layer.cornerRadius = 12;
|
||||||
|
_secondImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||||
}
|
}
|
||||||
return _secondImageView;
|
return _secondImageView;
|
||||||
}
|
}
|
||||||
@@ -154,11 +156,12 @@
|
|||||||
- (NetImageView *)thirdImageView {
|
- (NetImageView *)thirdImageView {
|
||||||
if (!_thirdImageView) {
|
if (!_thirdImageView) {
|
||||||
NetImageConfig * config = [[NetImageConfig alloc]init];
|
NetImageConfig * config = [[NetImageConfig alloc]init];
|
||||||
config.imageType = ImageTypeUserIcon;
|
config.imageType = ImageTypeMonentsPhoto;
|
||||||
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
||||||
_thirdImageView = [[NetImageView alloc] initWithConfig:config];
|
_thirdImageView = [[NetImageView alloc] initWithConfig:config];
|
||||||
_thirdImageView.layer.masksToBounds = YES;
|
_thirdImageView.layer.masksToBounds = YES;
|
||||||
_thirdImageView.layer.cornerRadius = 12;
|
_thirdImageView.layer.cornerRadius = 12;
|
||||||
|
_thirdImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||||
}
|
}
|
||||||
return _thirdImageView;
|
return _thirdImageView;
|
||||||
}
|
}
|
||||||
@@ -167,11 +170,12 @@
|
|||||||
- (NetImageView *)fourthImageView {
|
- (NetImageView *)fourthImageView {
|
||||||
if (!_fourthImageView) {
|
if (!_fourthImageView) {
|
||||||
NetImageConfig * config = [[NetImageConfig alloc]init];
|
NetImageConfig * config = [[NetImageConfig alloc]init];
|
||||||
config.imageType = ImageTypeUserIcon;
|
config.imageType = ImageTypeMonentsPhoto;
|
||||||
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
||||||
_fourthImageView = [[NetImageView alloc] initWithConfig:config];
|
_fourthImageView = [[NetImageView alloc] initWithConfig:config];
|
||||||
_fourthImageView.layer.masksToBounds = YES;
|
_fourthImageView.layer.masksToBounds = YES;
|
||||||
_fourthImageView.layer.cornerRadius = 12;
|
_fourthImageView.layer.cornerRadius = 12;
|
||||||
|
_fourthImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||||
}
|
}
|
||||||
return _fourthImageView;
|
return _fourthImageView;
|
||||||
}
|
}
|
||||||
@@ -179,11 +183,12 @@
|
|||||||
- (NetImageView *)fifthImageView {
|
- (NetImageView *)fifthImageView {
|
||||||
if (!_fifthImageView) {
|
if (!_fifthImageView) {
|
||||||
NetImageConfig * config = [[NetImageConfig alloc]init];
|
NetImageConfig * config = [[NetImageConfig alloc]init];
|
||||||
config.imageType = ImageTypeUserIcon;
|
config.imageType = ImageTypeMonentsPhoto;
|
||||||
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
||||||
_fifthImageView = [[NetImageView alloc] initWithConfig:config];
|
_fifthImageView = [[NetImageView alloc] initWithConfig:config];
|
||||||
_fifthImageView.layer.masksToBounds = YES;
|
_fifthImageView.layer.masksToBounds = YES;
|
||||||
_fifthImageView.layer.cornerRadius = 12;
|
_fifthImageView.layer.cornerRadius = 12;
|
||||||
|
_fifthImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||||
}
|
}
|
||||||
return _fifthImageView;
|
return _fifthImageView;
|
||||||
}
|
}
|
||||||
@@ -192,11 +197,12 @@
|
|||||||
- (NetImageView *)sixthImageView {
|
- (NetImageView *)sixthImageView {
|
||||||
if (!_sixthImageView) {
|
if (!_sixthImageView) {
|
||||||
NetImageConfig * config = [[NetImageConfig alloc]init];
|
NetImageConfig * config = [[NetImageConfig alloc]init];
|
||||||
config.imageType = ImageTypeUserIcon;
|
config.imageType = ImageTypeMonentsPhoto;
|
||||||
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
||||||
_sixthImageView = [[NetImageView alloc] initWithConfig:config];
|
_sixthImageView = [[NetImageView alloc] initWithConfig:config];
|
||||||
_sixthImageView.layer.masksToBounds = YES;
|
_sixthImageView.layer.masksToBounds = YES;
|
||||||
_sixthImageView.layer.cornerRadius = 12;
|
_sixthImageView.layer.cornerRadius = 12;
|
||||||
|
_sixthImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||||
}
|
}
|
||||||
return _sixthImageView;
|
return _sixthImageView;
|
||||||
}
|
}
|
||||||
@@ -205,11 +211,12 @@
|
|||||||
- (NetImageView *)sevenImageView {
|
- (NetImageView *)sevenImageView {
|
||||||
if (!_sevenImageView) {
|
if (!_sevenImageView) {
|
||||||
NetImageConfig * config = [[NetImageConfig alloc]init];
|
NetImageConfig * config = [[NetImageConfig alloc]init];
|
||||||
config.imageType = ImageTypeUserIcon;
|
config.imageType = ImageTypeMonentsPhoto;
|
||||||
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
||||||
_sevenImageView = [[NetImageView alloc] initWithConfig:config];
|
_sevenImageView = [[NetImageView alloc] initWithConfig:config];
|
||||||
_sevenImageView.layer.masksToBounds = YES;
|
_sevenImageView.layer.masksToBounds = YES;
|
||||||
_sevenImageView.layer.cornerRadius = 12;
|
_sevenImageView.layer.cornerRadius = 12;
|
||||||
|
_sevenImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||||
}
|
}
|
||||||
return _sevenImageView;
|
return _sevenImageView;
|
||||||
}
|
}
|
||||||
@@ -218,11 +225,12 @@
|
|||||||
- (NetImageView *)eighthImageView {
|
- (NetImageView *)eighthImageView {
|
||||||
if (!_eighthImageView) {
|
if (!_eighthImageView) {
|
||||||
NetImageConfig * config = [[NetImageConfig alloc]init];
|
NetImageConfig * config = [[NetImageConfig alloc]init];
|
||||||
config.imageType = ImageTypeUserIcon;
|
config.imageType = ImageTypeMonentsPhoto;
|
||||||
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
||||||
_eighthImageView = [[NetImageView alloc] initWithConfig:config];
|
_eighthImageView = [[NetImageView alloc] initWithConfig:config];
|
||||||
_eighthImageView.layer.masksToBounds = YES;
|
_eighthImageView.layer.masksToBounds = YES;
|
||||||
_eighthImageView.layer.cornerRadius = 12;
|
_eighthImageView.layer.cornerRadius = 12;
|
||||||
|
_eighthImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||||
}
|
}
|
||||||
return _eighthImageView;
|
return _eighthImageView;
|
||||||
}
|
}
|
||||||
@@ -231,13 +239,14 @@
|
|||||||
- (NetImageView *)ninthImageView {
|
- (NetImageView *)ninthImageView {
|
||||||
if (!_ninthImageView) {
|
if (!_ninthImageView) {
|
||||||
NetImageConfig * config = [[NetImageConfig alloc]init];
|
NetImageConfig * config = [[NetImageConfig alloc]init];
|
||||||
config.imageType = ImageTypeUserIcon;
|
config.imageType = ImageTypeMonentsPhoto;
|
||||||
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
||||||
_ninthImageView = [[NetImageView alloc] initWithConfig:config];
|
_ninthImageView = [[NetImageView alloc] initWithConfig:config];
|
||||||
_ninthImageView.layer.masksToBounds = YES;
|
_ninthImageView.layer.masksToBounds = YES;
|
||||||
_ninthImageView.layer.cornerRadius = 12;
|
_ninthImageView.layer.cornerRadius = 12;
|
||||||
|
_ninthImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||||
}
|
}
|
||||||
return _firstImageView;
|
return _ninthImageView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -75,34 +75,35 @@
|
|||||||
}];
|
}];
|
||||||
|
|
||||||
[self.likeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.likeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.right.mas_equalTo(self.likeView);
|
make.right.mas_equalTo(self.likeView.mas_right).offset(-3);
|
||||||
make.centerY.mas_equalTo(self.likeView);
|
make.centerY.mas_equalTo(self.likeView);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
[self.likeButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.likeButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.size.mas_equalTo(CGSizeMake(22, 22));
|
make.size.mas_equalTo(CGSizeMake(22, 22));
|
||||||
make.centerY.mas_equalTo(self.likeView);
|
make.centerY.mas_equalTo(self.likeView);
|
||||||
make.right.mas_equalTo(self.likeView.mas_left).offset(-2);
|
make.right.mas_equalTo(self.likeLabel.mas_left).offset(-3);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
[self.commentView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.commentView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.left.mas_equalTo(self.commentButton.mas_left);
|
make.left.mas_equalTo(self.commentButton.mas_left).offset(-2);
|
||||||
make.height.mas_equalTo(22);
|
make.height.mas_equalTo(22);
|
||||||
make.centerY.mas_equalTo(self.reportButton);
|
make.centerY.mas_equalTo(self.reportButton);
|
||||||
make.right.mas_equalTo(self.shareButton.mas_left).offset(-12);
|
make.right.mas_equalTo(self.shareButton.mas_left).offset(-12);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
[self.commentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
||||||
make.right.mas_equalTo(self.commentView);
|
|
||||||
make.centerY.mas_equalTo(self.commentView);
|
|
||||||
}];
|
|
||||||
|
|
||||||
[self.commentButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.commentButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.size.mas_equalTo(CGSizeMake(22, 22));
|
make.size.mas_equalTo(CGSizeMake(22, 22));
|
||||||
make.centerY.mas_equalTo(self.commentView);
|
make.centerY.mas_equalTo(self.commentView);
|
||||||
make.right.mas_equalTo(self.commentLabel.mas_left).offset(-2);
|
make.right.mas_equalTo(self.commentLabel.mas_left).offset(-2);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
|
[self.commentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.right.mas_equalTo(self.commentView.mas_right).offset(-3);
|
||||||
|
make.centerY.mas_equalTo(self.commentView);
|
||||||
|
}];
|
||||||
|
|
||||||
[self.shareButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.shareButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.size.mas_equalTo(CGSizeMake(22, 22));
|
make.size.mas_equalTo(CGSizeMake(22, 22));
|
||||||
make.right.mas_equalTo(self).offset(-32);
|
make.right.mas_equalTo(self).offset(-32);
|
||||||
@@ -214,11 +215,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (UIView *)lineView {
|
- (UIView *)lineView {
|
||||||
if (!_likeView) {
|
if (!_lineView) {
|
||||||
_likeView = [[UIView alloc] init];
|
_lineView = [[UIView alloc] init];
|
||||||
_likeView.backgroundColor = [ThemeColor dividerColor];
|
_lineView.backgroundColor = [ThemeColor dividerColor];
|
||||||
}
|
}
|
||||||
return _likeView;
|
return _lineView;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@@ -253,7 +253,7 @@
|
|||||||
_avatarImageView = [[NetImageView alloc] initWithConfig:config];
|
_avatarImageView = [[NetImageView alloc] initWithConfig:config];
|
||||||
_avatarImageView.userInteractionEnabled = YES;
|
_avatarImageView.userInteractionEnabled = YES;
|
||||||
_avatarImageView.layer.masksToBounds = YES;
|
_avatarImageView.layer.masksToBounds = YES;
|
||||||
_avatarImageView.layer.cornerRadius = 25;
|
_avatarImageView.layer.cornerRadius = 20;
|
||||||
_avatarImageView.contentMode = UIViewContentModeScaleAspectFill;
|
_avatarImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||||
}
|
}
|
||||||
return _avatarImageView;
|
return _avatarImageView;
|
||||||
|
@@ -6,21 +6,162 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "XPMonentsRecommendViewController.h"
|
#import "XPMonentsRecommendViewController.h"
|
||||||
|
///Third
|
||||||
|
#import <Masonry/Masonry.h>
|
||||||
|
#import <MJRefresh/MJRefresh.h>
|
||||||
|
///Tool
|
||||||
|
#import "ThemeColor.h"
|
||||||
|
#import "XPMacro.h"
|
||||||
|
#import "XPMonentsLayoutConfig.h"
|
||||||
|
///Model
|
||||||
|
#import "MonentsInfoModel.h"
|
||||||
|
///P
|
||||||
|
#import "XPMonentsRecommendPresenter.h"
|
||||||
|
#import "XPMonentsRecommendProtocol.h"
|
||||||
|
///View
|
||||||
|
#import "XPMonentsTableViewCell.h"
|
||||||
|
#import "XPMonentsEmptyTableViewCell.h"
|
||||||
|
|
||||||
@interface XPMonentsRecommendViewController ()
|
@interface XPMonentsRecommendViewController ()<UITableViewDelegate, UITableViewDataSource,XPMonentsRecommendProtocol>
|
||||||
|
|
||||||
///列表
|
///列表
|
||||||
@property (nonatomic,strong) UITableView *tableView;
|
@property (nonatomic,strong) UITableView *tableView;
|
||||||
///数据源
|
///数据源
|
||||||
@property (nonatomic,strong) NSMutableArray *datasource;
|
@property (nonatomic,strong) NSMutableArray<MonentsInfoModel *> *datasource;
|
||||||
|
///当前的页数
|
||||||
|
@property (nonatomic,assign) NSInteger page;
|
||||||
|
///是否有更多的数据
|
||||||
|
@property (nonatomic,assign) BOOL hasNoMoreData;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation XPMonentsRecommendViewController
|
@implementation XPMonentsRecommendViewController
|
||||||
|
|
||||||
|
- (__kindof id)createPresenter {
|
||||||
|
return [[XPMonentsRecommendPresenter alloc] init];
|
||||||
|
}
|
||||||
|
|
||||||
- (void)viewDidLoad {
|
- (void)viewDidLoad {
|
||||||
[super viewDidLoad];
|
[super viewDidLoad];
|
||||||
|
[self initHeaderAndFooterRrfresh];
|
||||||
|
[self initSubViews];
|
||||||
|
[self initSubViewConstraints];
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - Private Method
|
||||||
|
- (void)initSubViews {
|
||||||
|
[self.view addSubview:self.tableView];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)initSubViewConstraints {
|
||||||
|
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.edges.mas_equalTo(self.view);
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
|
#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 getMonentsRecommendList:self.page pageSize:20 state:0];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)footerRefresh {
|
||||||
|
if (self.hasNoMoreData) {
|
||||||
|
[self showErrorToast:@"没有更多数据了"];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self.page++;
|
||||||
|
[self.presenter getMonentsRecommendList:self.page pageSize:20 state:1];
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - UITableViewDelegate And UITableViewDataSource
|
||||||
|
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||||
|
return self.datasource.count > 0 ? self.datasource.count : 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||||
|
if (self.datasource.count > 0) {
|
||||||
|
MonentsInfoModel * monentInfo= [self.datasource objectAtIndex:indexPath.row];
|
||||||
|
[XPMonentsLayoutConfig layoutMonentsModel:monentInfo];
|
||||||
|
return monentInfo.rowHeight;
|
||||||
|
}
|
||||||
|
return KScreenHeight - kNavigationHeight - 49 - kSafeAreaBottomHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||||
|
if (self.datasource.count > 0) {
|
||||||
|
XPMonentsTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMonentsTableViewCell class])];
|
||||||
|
MonentsInfoModel * monentsInfo = [self.datasource objectAtIndex:indexPath.row];
|
||||||
|
cell.monentsInfo = monentsInfo;
|
||||||
|
return cell;
|
||||||
|
}
|
||||||
|
XPMonentsEmptyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMonentsEmptyTableViewCell class])];
|
||||||
|
return cell;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - XPMonentsRecommendProtocol
|
||||||
|
- (void)getMonentsRecommendListSuccess:(NSArray *)array state:(int)state {
|
||||||
|
if (state == 0) {
|
||||||
|
[self.datasource removeAllObjects];
|
||||||
|
}
|
||||||
|
if (array.count > 0) {
|
||||||
|
[self.datasource addObjectsFromArray:array];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (state == 0) {
|
||||||
|
self.hasNoMoreData = NO;
|
||||||
|
[self.tableView.mj_header endRefreshing];
|
||||||
|
} else {
|
||||||
|
if (array.count > 0) {
|
||||||
|
self.hasNoMoreData = NO;
|
||||||
|
[self.tableView.mj_footer endRefreshing];
|
||||||
|
} else {
|
||||||
|
self.hasNoMoreData = YES;
|
||||||
|
[self.tableView.mj_footer endRefreshingWithNoMoreData];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
[self.tableView reloadData];
|
||||||
|
}
|
||||||
|
|
||||||
|
#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];
|
||||||
|
if (@available(iOS 11.0, *)) {
|
||||||
|
_tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
||||||
|
}
|
||||||
|
[_tableView registerClass:[XPMonentsTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMonentsTableViewCell class])];
|
||||||
|
[_tableView registerClass:[XPMonentsEmptyTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMonentsEmptyTableViewCell class])];
|
||||||
|
}
|
||||||
|
return _tableView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
- (NSMutableArray<MonentsInfoModel *> *)datasource {
|
||||||
|
if (!_datasource) {
|
||||||
|
_datasource = [NSMutableArray array];
|
||||||
|
}
|
||||||
|
return _datasource;
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@@ -62,6 +62,7 @@
|
|||||||
#import "XPTaskCompleteTipView.h"
|
#import "XPTaskCompleteTipView.h"
|
||||||
#import "XPWebViewController.h"
|
#import "XPWebViewController.h"
|
||||||
#import "XPMineUserInfoViewController.h"
|
#import "XPMineUserInfoViewController.h"
|
||||||
|
#import "XPMonentsRecommendViewController.h"
|
||||||
///Present
|
///Present
|
||||||
#import "MainPresenter.h"
|
#import "MainPresenter.h"
|
||||||
#import "MainProtocol.h"
|
#import "MainProtocol.h"
|
||||||
@@ -373,14 +374,15 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
|||||||
|
|
||||||
- (void)initTabs:(BOOL)logined {
|
- (void)initTabs:(BOOL)logined {
|
||||||
self.viewControllers = nil;
|
self.viewControllers = nil;
|
||||||
NSArray *normalImageNames = @[@"tab_gameHome_normal",@"tab_live_normal",@"tab_message_normal", @"tab_mine_normal"];
|
NSArray *normalImageNames = @[@"tab_gameHome_normal",@"tab_monents_normal",@"tab_message_normal", @"tab_mine_normal"];
|
||||||
NSArray *selectImageNames = @[@"tab_gameHome_selected",@"tab_live_selected",@"tab_message_selected", @"tab_mine_selected"];
|
NSArray *selectImageNames = @[@"tab_gameHome_selected",@"tab_monents_select",@"tab_message_selected", @"tab_mine_selected"];
|
||||||
NSArray *tabLabel = @[@"派对",@"直播",@"消息", @"我的"];
|
NSArray *tabLabel = @[@"派对",@"广场",@"消息", @"我的"];
|
||||||
|
|
||||||
UIViewController *game;
|
UIViewController *game;
|
||||||
UIViewController *msg;
|
UIViewController *msg;
|
||||||
UIViewController *me;
|
UIViewController *me;
|
||||||
UIViewController * home;
|
UIViewController * home;
|
||||||
|
UIViewController * monents;
|
||||||
if (logined) {
|
if (logined) {
|
||||||
XplanFBFlutterViewContainer *fvcGame = XplanFBFlutterViewContainer.new;
|
XplanFBFlutterViewContainer *fvcGame = XplanFBFlutterViewContainer.new;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
@@ -388,22 +390,23 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
|||||||
#else
|
#else
|
||||||
[fvcGame setName:@"/" uniqueId:nil params:nil];
|
[fvcGame setName:@"/" uniqueId:nil params:nil];
|
||||||
#endif
|
#endif
|
||||||
game = [[XPHomeLivesViewController alloc] init];
|
|
||||||
msg = [[SessionListViewController alloc] init];
|
msg = [[SessionListViewController alloc] init];
|
||||||
me = [[XPMineViewController alloc] init];
|
me = [[XPMineViewController alloc] init];
|
||||||
|
|
||||||
home = [[XPHomeViewController alloc] init];
|
home = [[XPHomeViewController alloc] init];
|
||||||
|
monents = [[XPMonentsRecommendViewController alloc] init];
|
||||||
} else {
|
} else {
|
||||||
game = [[BaseViewController alloc]init];
|
game = [[BaseViewController alloc]init];
|
||||||
msg = [[SessionListViewController alloc]init];
|
msg = [[SessionListViewController alloc]init];
|
||||||
me = [[BaseViewController alloc]init];
|
me = [[BaseViewController alloc]init];
|
||||||
home = [[BaseViewController alloc] init];
|
home = [[BaseViewController alloc] init];
|
||||||
|
monents = [[BaseViewController alloc] init];
|
||||||
}
|
}
|
||||||
[self createTabBarItem:home title:tabLabel[0] image:normalImageNames[0] selectedImage:selectImageNames[0]];
|
[self createTabBarItem:home title:tabLabel[0] image:normalImageNames[0] selectedImage:selectImageNames[0]];
|
||||||
[self createTabBarItem:game title:tabLabel[1] image:normalImageNames[1] selectedImage:selectImageNames[1]];
|
[self createTabBarItem:monents title:tabLabel[1] image:normalImageNames[1] selectedImage:selectImageNames[1]];
|
||||||
[self createTabBarItem:msg title:tabLabel[2] image:normalImageNames[2] selectedImage:selectImageNames[2]];
|
[self createTabBarItem:msg title:tabLabel[2] image:normalImageNames[2] selectedImage:selectImageNames[2]];
|
||||||
[self createTabBarItem:me title:tabLabel[3] image:normalImageNames[3] selectedImage:selectImageNames[3]];
|
[self createTabBarItem:me title:tabLabel[3] image:normalImageNames[3] selectedImage:selectImageNames[3]];
|
||||||
self.viewControllers = @[home,game,msg,me];
|
self.viewControllers = @[home,monents,msg,me];
|
||||||
self.selectedIndex = 0;
|
self.selectedIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|