Commit bad86e04 cgx

搭建社区模块框架

1 个父辈 68e42a59
正在显示 44 个修改的文件 包含 747 行增加25 行删除
...@@ -97,6 +97,7 @@ ...@@ -97,6 +97,7 @@
D055BECB28252E4000BC11A4 /* SubAudioModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D055BECA28252E4000BC11A4 /* SubAudioModel.m */; }; D055BECB28252E4000BC11A4 /* SubAudioModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D055BECA28252E4000BC11A4 /* SubAudioModel.m */; };
D062A09E281838B800B4F48A /* FeedbackRequestModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D062A09D281838B800B4F48A /* FeedbackRequestModel.m */; }; D062A09E281838B800B4F48A /* FeedbackRequestModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D062A09D281838B800B4F48A /* FeedbackRequestModel.m */; };
D062A0A128183FE000B4F48A /* FeedbackDetailController.m in Sources */ = {isa = PBXBuildFile; fileRef = D062A0A028183FE000B4F48A /* FeedbackDetailController.m */; }; D062A0A128183FE000B4F48A /* FeedbackDetailController.m in Sources */ = {isa = PBXBuildFile; fileRef = D062A0A028183FE000B4F48A /* FeedbackDetailController.m */; };
D06381A428D012420074515B /* SleepStoryController.m in Sources */ = {isa = PBXBuildFile; fileRef = D06381A328D012420074515B /* SleepStoryController.m */; };
D0691E01287FB330008BFFAB /* XLCircle.m in Sources */ = {isa = PBXBuildFile; fileRef = D0691DFE287FB330008BFFAB /* XLCircle.m */; }; D0691E01287FB330008BFFAB /* XLCircle.m in Sources */ = {isa = PBXBuildFile; fileRef = D0691DFE287FB330008BFFAB /* XLCircle.m */; };
D0691E02287FB331008BFFAB /* XLCircleProgress.m in Sources */ = {isa = PBXBuildFile; fileRef = D0691DFF287FB330008BFFAB /* XLCircleProgress.m */; }; D0691E02287FB331008BFFAB /* XLCircleProgress.m in Sources */ = {isa = PBXBuildFile; fileRef = D0691DFF287FB330008BFFAB /* XLCircleProgress.m */; };
D0691E05287FEA04008BFFAB /* SleepReadyRequestModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D0691E04287FEA04008BFFAB /* SleepReadyRequestModel.m */; }; D0691E05287FEA04008BFFAB /* SleepReadyRequestModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D0691E04287FEA04008BFFAB /* SleepReadyRequestModel.m */; };
...@@ -156,6 +157,10 @@ ...@@ -156,6 +157,10 @@
D0A1C48F28C1A9E1000975DC /* Info_Debug.plist in Resources */ = {isa = PBXBuildFile; fileRef = D0A1C48E28C1A9E1000975DC /* Info_Debug.plist */; }; D0A1C48F28C1A9E1000975DC /* Info_Debug.plist in Resources */ = {isa = PBXBuildFile; fileRef = D0A1C48E28C1A9E1000975DC /* Info_Debug.plist */; };
D0A1C49228C2084B000975DC /* ArticleRequestModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D0A1C49128C2084B000975DC /* ArticleRequestModel.m */; }; D0A1C49228C2084B000975DC /* ArticleRequestModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D0A1C49128C2084B000975DC /* ArticleRequestModel.m */; };
D0A245F6283DB12100FB49AA /* WKWebView+Extras.m in Sources */ = {isa = PBXBuildFile; fileRef = D0A245F5283DB12100FB49AA /* WKWebView+Extras.m */; }; D0A245F6283DB12100FB49AA /* WKWebView+Extras.m in Sources */ = {isa = PBXBuildFile; fileRef = D0A245F5283DB12100FB49AA /* WKWebView+Extras.m */; };
D0A3BB9228D95A2B00F58781 /* CommunityView.m in Sources */ = {isa = PBXBuildFile; fileRef = D0A3BB9128D95A2B00F58781 /* CommunityView.m */; };
D0A3BB9628D9B43700F58781 /* ArticleController.m in Sources */ = {isa = PBXBuildFile; fileRef = D0A3BB9528D9B43700F58781 /* ArticleController.m */; };
D0A3BB9928D9B76C00F58781 /* EvaluateController.m in Sources */ = {isa = PBXBuildFile; fileRef = D0A3BB9828D9B76C00F58781 /* EvaluateController.m */; };
D0A3BB9C28D9BA3500F58781 /* EvaluateRequestModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D0A3BB9B28D9BA3500F58781 /* EvaluateRequestModel.m */; };
D0A72E39282B566200EED7BE /* HomeBasicCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D0A72E38282B566200EED7BE /* HomeBasicCell.m */; }; D0A72E39282B566200EED7BE /* HomeBasicCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D0A72E38282B566200EED7BE /* HomeBasicCell.m */; };
D0A72E3F282B89AD00EED7BE /* DSHomeView.m in Sources */ = {isa = PBXBuildFile; fileRef = D0A72E3E282B89AD00EED7BE /* DSHomeView.m */; }; D0A72E3F282B89AD00EED7BE /* DSHomeView.m in Sources */ = {isa = PBXBuildFile; fileRef = D0A72E3E282B89AD00EED7BE /* DSHomeView.m */; };
D0A72E42282B8BA600EED7BE /* CourseMusicCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D0A72E41282B8BA600EED7BE /* CourseMusicCell.m */; }; D0A72E42282B8BA600EED7BE /* CourseMusicCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D0A72E41282B8BA600EED7BE /* CourseMusicCell.m */; };
...@@ -437,6 +442,8 @@ ...@@ -437,6 +442,8 @@
D062A09D281838B800B4F48A /* FeedbackRequestModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FeedbackRequestModel.m; sourceTree = "<group>"; }; D062A09D281838B800B4F48A /* FeedbackRequestModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FeedbackRequestModel.m; sourceTree = "<group>"; };
D062A09F28183FE000B4F48A /* FeedbackDetailController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FeedbackDetailController.h; sourceTree = "<group>"; }; D062A09F28183FE000B4F48A /* FeedbackDetailController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FeedbackDetailController.h; sourceTree = "<group>"; };
D062A0A028183FE000B4F48A /* FeedbackDetailController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FeedbackDetailController.m; sourceTree = "<group>"; }; D062A0A028183FE000B4F48A /* FeedbackDetailController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FeedbackDetailController.m; sourceTree = "<group>"; };
D06381A228D012420074515B /* SleepStoryController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SleepStoryController.h; sourceTree = "<group>"; };
D06381A328D012420074515B /* SleepStoryController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SleepStoryController.m; sourceTree = "<group>"; };
D0691DFD287FB330008BFFAB /* XLCircleProgress.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLCircleProgress.h; sourceTree = "<group>"; }; D0691DFD287FB330008BFFAB /* XLCircleProgress.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XLCircleProgress.h; sourceTree = "<group>"; };
D0691DFE287FB330008BFFAB /* XLCircle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLCircle.m; sourceTree = "<group>"; }; D0691DFE287FB330008BFFAB /* XLCircle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLCircle.m; sourceTree = "<group>"; };
D0691DFF287FB330008BFFAB /* XLCircleProgress.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLCircleProgress.m; sourceTree = "<group>"; }; D0691DFF287FB330008BFFAB /* XLCircleProgress.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XLCircleProgress.m; sourceTree = "<group>"; };
...@@ -552,6 +559,14 @@ ...@@ -552,6 +559,14 @@
D0A1C49128C2084B000975DC /* ArticleRequestModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ArticleRequestModel.m; sourceTree = "<group>"; }; D0A1C49128C2084B000975DC /* ArticleRequestModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ArticleRequestModel.m; sourceTree = "<group>"; };
D0A245F4283DB12100FB49AA /* WKWebView+Extras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "WKWebView+Extras.h"; sourceTree = "<group>"; }; D0A245F4283DB12100FB49AA /* WKWebView+Extras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "WKWebView+Extras.h"; sourceTree = "<group>"; };
D0A245F5283DB12100FB49AA /* WKWebView+Extras.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "WKWebView+Extras.m"; sourceTree = "<group>"; }; D0A245F5283DB12100FB49AA /* WKWebView+Extras.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "WKWebView+Extras.m"; sourceTree = "<group>"; };
D0A3BB9028D95A2B00F58781 /* CommunityView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CommunityView.h; sourceTree = "<group>"; };
D0A3BB9128D95A2B00F58781 /* CommunityView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CommunityView.m; sourceTree = "<group>"; };
D0A3BB9428D9B43700F58781 /* ArticleController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ArticleController.h; sourceTree = "<group>"; };
D0A3BB9528D9B43700F58781 /* ArticleController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ArticleController.m; sourceTree = "<group>"; };
D0A3BB9728D9B76C00F58781 /* EvaluateController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EvaluateController.h; sourceTree = "<group>"; };
D0A3BB9828D9B76C00F58781 /* EvaluateController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EvaluateController.m; sourceTree = "<group>"; };
D0A3BB9A28D9BA3500F58781 /* EvaluateRequestModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EvaluateRequestModel.h; sourceTree = "<group>"; };
D0A3BB9B28D9BA3500F58781 /* EvaluateRequestModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EvaluateRequestModel.m; sourceTree = "<group>"; };
D0A72E37282B566200EED7BE /* HomeBasicCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeBasicCell.h; sourceTree = "<group>"; }; D0A72E37282B566200EED7BE /* HomeBasicCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeBasicCell.h; sourceTree = "<group>"; };
D0A72E38282B566200EED7BE /* HomeBasicCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HomeBasicCell.m; sourceTree = "<group>"; }; D0A72E38282B566200EED7BE /* HomeBasicCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HomeBasicCell.m; sourceTree = "<group>"; };
D0A72E3D282B89AD00EED7BE /* DSHomeView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DSHomeView.h; sourceTree = "<group>"; }; D0A72E3D282B89AD00EED7BE /* DSHomeView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DSHomeView.h; sourceTree = "<group>"; };
...@@ -1372,11 +1387,10 @@ ...@@ -1372,11 +1387,10 @@
D0A1C48028C194A6000975DC /* CommunityModule */ = { D0A1C48028C194A6000975DC /* CommunityModule */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
D0A1C48428C197B3000975DC /* Community.storyboard */, D0A3BB8D28D959F800F58781 /* View */,
D0A1C48128C195CD000975DC /* CommunityController.h */, D0A3BB8F28D95A0C00F58781 /* Model */,
D0A1C48228C195CD000975DC /* CommunityController.m */, D0A3BB9328D9B3E000F58781 /* ViewModel */,
D0A1C49028C2084B000975DC /* ArticleRequestModel.h */, D0A3BB8E28D95A0200F58781 /* Controller */,
D0A1C49128C2084B000975DC /* ArticleRequestModel.m */,
); );
path = CommunityModule; path = CommunityModule;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -1392,6 +1406,49 @@ ...@@ -1392,6 +1406,49 @@
path = Flutter; path = Flutter;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
D0A3BB8D28D959F800F58781 /* View */ = {
isa = PBXGroup;
children = (
D0A3BB9028D95A2B00F58781 /* CommunityView.h */,
D0A3BB9128D95A2B00F58781 /* CommunityView.m */,
);
path = View;
sourceTree = "<group>";
};
D0A3BB8E28D95A0200F58781 /* Controller */ = {
isa = PBXGroup;
children = (
D0A1C48428C197B3000975DC /* Community.storyboard */,
D0A1C48128C195CD000975DC /* CommunityController.h */,
D0A1C48228C195CD000975DC /* CommunityController.m */,
D06381A228D012420074515B /* SleepStoryController.h */,
D06381A328D012420074515B /* SleepStoryController.m */,
D0A3BB9428D9B43700F58781 /* ArticleController.h */,
D0A3BB9528D9B43700F58781 /* ArticleController.m */,
D0A3BB9728D9B76C00F58781 /* EvaluateController.h */,
D0A3BB9828D9B76C00F58781 /* EvaluateController.m */,
);
path = Controller;
sourceTree = "<group>";
};
D0A3BB8F28D95A0C00F58781 /* Model */ = {
isa = PBXGroup;
children = (
);
path = Model;
sourceTree = "<group>";
};
D0A3BB9328D9B3E000F58781 /* ViewModel */ = {
isa = PBXGroup;
children = (
D0A1C49028C2084B000975DC /* ArticleRequestModel.h */,
D0A1C49128C2084B000975DC /* ArticleRequestModel.m */,
D0A3BB9A28D9BA3500F58781 /* EvaluateRequestModel.h */,
D0A3BB9B28D9BA3500F58781 /* EvaluateRequestModel.m */,
);
path = ViewModel;
sourceTree = "<group>";
};
D0A72E30282B4FE300EED7BE /* Course */ = { D0A72E30282B4FE300EED7BE /* Course */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -2266,6 +2323,7 @@ ...@@ -2266,6 +2323,7 @@
D0BE53712845AFD8007F15B3 /* NewTaskModel.m in Sources */, D0BE53712845AFD8007F15B3 /* NewTaskModel.m in Sources */,
D0B5ECD527F2F0B2003EDFE3 /* AdaptationUtil.m in Sources */, D0B5ECD527F2F0B2003EDFE3 /* AdaptationUtil.m in Sources */,
D070509A28071BAF006D72E1 /* DSNetworkTool.m in Sources */, D070509A28071BAF006D72E1 /* DSNetworkTool.m in Sources */,
D0A3BB9628D9B43700F58781 /* ArticleController.m in Sources */,
D01814D127FFCBAF00583D4E /* CWCarousel.m in Sources */, D01814D127FFCBAF00583D4E /* CWCarousel.m in Sources */,
D0D96FE22848493700461839 /* RelaxTrainModel.m in Sources */, D0D96FE22848493700461839 /* RelaxTrainModel.m in Sources */,
D0B5ECB727F2D9E0003EDFE3 /* main.m in Sources */, D0B5ECB727F2D9E0003EDFE3 /* main.m in Sources */,
...@@ -2334,7 +2392,9 @@ ...@@ -2334,7 +2392,9 @@
D091E671283F2E6F00D3279E /* ScoreDetailListController.m in Sources */, D091E671283F2E6F00D3279E /* ScoreDetailListController.m in Sources */,
D07DACAB2810557D0067A1BF /* RSKImageScrollView.m in Sources */, D07DACAB2810557D0067A1BF /* RSKImageScrollView.m in Sources */,
D0AEFE812817DD1500230DC6 /* MyFeedCell.m in Sources */, D0AEFE812817DD1500230DC6 /* MyFeedCell.m in Sources */,
D0A3BB9228D95A2B00F58781 /* CommunityView.m in Sources */,
D02D082D287BD05D005C3A00 /* ReadyListController.m in Sources */, D02D082D287BD05D005C3A00 /* ReadyListController.m in Sources */,
D06381A428D012420074515B /* SleepStoryController.m in Sources */,
D0F9AC542826563400FD7A3B /* MusicPlayerController.m in Sources */, D0F9AC542826563400FD7A3B /* MusicPlayerController.m in Sources */,
D0506B1528051ED400229278 /* SafeSleepModel.m in Sources */, D0506B1528051ED400229278 /* SafeSleepModel.m in Sources */,
D054CCB52830DE5600420DC4 /* NoisePlayerManager.m in Sources */, D054CCB52830DE5600420DC4 /* NoisePlayerManager.m in Sources */,
...@@ -2358,6 +2418,8 @@ ...@@ -2358,6 +2418,8 @@
D01BD425282BFFB400BA86B3 /* WhiteNoiseRequestModel.m in Sources */, D01BD425282BFFB400BA86B3 /* WhiteNoiseRequestModel.m in Sources */,
D0BE32E9281551EB006539BE /* ShareAlertView.m in Sources */, D0BE32E9281551EB006539BE /* ShareAlertView.m in Sources */,
D049886E286E9209000ACF55 /* TaskTimerTool.m in Sources */, D049886E286E9209000ACF55 /* TaskTimerTool.m in Sources */,
D0A3BB9928D9B76C00F58781 /* EvaluateController.m in Sources */,
D0A3BB9C28D9BA3500F58781 /* EvaluateRequestModel.m in Sources */,
D0071C7028707BCC0035AD8A /* ScoreRulesView.m in Sources */, D0071C7028707BCC0035AD8A /* ScoreRulesView.m in Sources */,
D091BBBB2809079600487A50 /* NSString+Extras.m in Sources */, D091BBBB2809079600487A50 /* NSString+Extras.m in Sources */,
D0691E0B287FFB54008BFFAB /* ReadyItem.m in Sources */, D0691E0B287FFB54008BFFAB /* ReadyItem.m in Sources */,
......
...@@ -7,13 +7,13 @@ ...@@ -7,13 +7,13 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#define kBaseW 375.
#define kBaseH 812.
// 屏幕尺寸 // 屏幕尺寸
#define kScreenWidth [[UIScreen mainScreen] bounds].size.width #define kScreenWidth [[UIScreen mainScreen] bounds].size.width
#define kScreenHeight [[UIScreen mainScreen] bounds].size.height #define kScreenHeight [[UIScreen mainScreen] bounds].size.height
#define IPHONEHIGHT(b) [UIScreen mainScreen].bounds.size.height*((b)/812.0)
#define IPHONEWIDTH(a) [UIScreen mainScreen].bounds.size.width*((a)/375.0)
// 水平方向布局(iPhone X作为设计基准) // 水平方向布局(iPhone X作为设计基准)
#define HLayout(H) kScreenWidth*(H/375.) #define HLayout(H) kScreenWidth*(H/375.)
// 垂直方向布局 // 垂直方向布局
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<scene sceneID="r6W-es-cXt"> <scene sceneID="r6W-es-cXt">
<objects> <objects>
<navigationController title="社区" id="Ly8-54-acr" customClass="BaseNaviController" sceneMemberID="viewController"> <navigationController title="社区" id="Ly8-54-acr" customClass="BaseNaviController" sceneMemberID="viewController">
<tabBarItem key="tabBarItem" title="社区" image="moon.circle" catalog="system" selectedImage="moon.circle.fill" id="c3n-YH-Gwa"/> <tabBarItem key="tabBarItem" title="社区" image="community" selectedImage="community_selected" id="c3n-YH-Gwa"/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="0aX-Zq-ZfB"> <navigationBar key="navigationBar" contentMode="scaleToFill" id="0aX-Zq-ZfB">
<rect key="frame" x="0.0" y="44" width="414" height="44"/> <rect key="frame" x="0.0" y="44" width="414" height="44"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
...@@ -44,8 +44,8 @@ ...@@ -44,8 +44,8 @@
</scene> </scene>
</scenes> </scenes>
<resources> <resources>
<image name="moon.circle" catalog="system" width="128" height="121"/> <image name="community" width="25" height="25"/>
<image name="moon.circle.fill" catalog="system" width="128" height="121"/> <image name="community_selected" width="25" height="25"/>
<systemColor name="systemBackgroundColor"> <systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor> </systemColor>
......
//
// ArticleController.h
// DreamSleep
//
// Created by peter on 2022/9/20.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
/// 社区睡眠文章控制器
@interface ArticleController : UIViewController
@end
NS_ASSUME_NONNULL_END
// //
// CommunityController.m // ArticleController.m
// DreamSleep // DreamSleep
// //
// Created by peter on 2022/9/2. // Created by peter on 2022/9/20.
// //
#import "CommunityController.h" #import "ArticleController.h"
#import "TestFlutterController.h"
#import "ArticleRequestModel.h" #import "ArticleRequestModel.h"
@interface CommunityController () @interface ArticleController ()
@property (nonatomic, strong) TestFlutterController *flutterEngine;
@end @end
@implementation CommunityController @implementation ArticleController
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
self.flutterEngine = [TestFlutterController new]; self.navigationItem.title = @"睡眠文章";
self.view.dk_backgroundColorPicker = DKColorPickerWithKey(VCViewBG);
[ArticleRequestModel querySsmianKnowledgeListWithTypeID:4 WithCompletion:^(ArticleRequestModel * _Nonnull requestModel) { [ArticleRequestModel querySsmianKnowledgeListWithCompletion:^(ArticleRequestModel * _Nonnull requestModel) {
}]; }];
} }
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event { #pragma mark - 品牌模式
[self.navigationController pushViewController:self.flutterEngine animated:YES]; - (NaviStyle)navigationBarStyle {
return NaviStyleDefault;
} }
@end @end
//
// CommunityController.h
// DreamSleep
//
// Created by peter on 2022/9/2.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface CommunityController : UIViewController
@end
NS_ASSUME_NONNULL_END
//
// CommunityController.m
// DreamSleep
//
// Created by peter on 2022/9/2.
//
#import "CommunityController.h"
#import "CommunityView.h"
#import "TestFlutterController.h"
@interface CommunityController () <CommunityViewDelegate>
@property (nonatomic, strong) CommunityView *communityView;
@property (nonatomic, strong) TestFlutterController *flutterEngine;
@end
@implementation CommunityController
- (void)loadView {
self.view = self.communityView;
}
- (void)viewDidLoad {
[super viewDidLoad];
[self setupUI];
}
- (void)setupUI {
self.edgesForExtendedLayout = UIRectEdgeNone;
UILabel *leftLab = [UILabel dkLabWithText:@"小梦社区" font:BoldFont(24.0)];
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:leftLab];
UIButton *messageBtn = [UIButton new];
[messageBtn addTarget:self action:@selector(messageAction) forControlEvents:UIControlEventTouchUpInside];
[messageBtn dk_setImage:DKImagePickerWithNames(@"ic_message_shequ", @"ic_message_shequ", @"ic_message_shequ") forState:UIControlStateNormal];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:messageBtn];
}
- (void)messageAction {
self.flutterEngine = [TestFlutterController new];
[self.navigationController pushViewController:self.flutterEngine animated:YES];
}
#pragma mark - CommunityViewDelegate
- (void)tapCommunityHeaderModule:(NSInteger)index {
NSString *clsName = index == 1 ? @"ArticleController" : @"EvaluateController";
[self.navigationController pushViewController:[NSClassFromString(clsName) new] animated:YES];
}
- (void)getDynamicListRequest:(BOOL)loadMore {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self.communityView updateCommunityMoments:loadMore];
});
}
#pragma mark - lazy
- (CommunityView *)communityView {
if (!_communityView) {
_communityView = [[CommunityView alloc] initWithDelegate:self];
}
return _communityView;
}
#pragma mark - 导航栏日间、黑夜模式
- (NaviStyle)navigationBarStyle {
return [self.dk_manager.themeVersion isEqualToString:DKThemeVersionNormal] ? NaviStyleLight : NaviStyleDark;
}
@end
//
// EvaluateController.h
// DreamSleep
//
// Created by peter on 2022/9/20.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
/// 社区人气评测控制器
@interface EvaluateController : UIViewController
@end
NS_ASSUME_NONNULL_END
//
// EvaluateController.m
// DreamSleep
//
// Created by peter on 2022/9/20.
//
#import "EvaluateController.h"
#import "EvaluateRequestModel.h"
@interface EvaluateController ()
@end
@implementation EvaluateController
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationItem.title = @"人气测评";
self.view.dk_backgroundColorPicker = DKColorPickerWithKey(VCViewBG);
[EvaluateRequestModel queryCommunityEvaluationListWithCompletion:^(EvaluateRequestModel * _Nonnull requestModel) {
}];
}
#pragma mark - 品牌模式
- (NaviStyle)navigationBarStyle {
return NaviStyleDefault;
}
@end
//
// SleepStoryController.h
// DreamSleep
//
// Created by peter on 2022/9/13.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SleepStoryController : UIViewController
@end
NS_ASSUME_NONNULL_END
//
// SleepStoryController.m
// DreamSleep
//
// Created by peter on 2022/9/13.
//
#import "SleepStoryController.h"
#import "SafeSleepRequestModel.h"
@interface SleepStoryController ()
@end
@implementation SleepStoryController
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationItem.title = @"睡前故事";
self.view.backgroundColor = DSWhite;
[SafeSleepRequestModel queryRelaxMeditationAudiosWithTypeID:501 completion:^(SafeSleepRequestModel * _Nonnull requestModel) {
if (requestModel.resCode == DSResCodeSuccess) {
}
}];
}
#pragma mark - 品牌模式
- (NaviStyle)navigationBarStyle {
return NaviStyleDefault;
}
@end
//
// CommunityView.h
// DreamSleep
//
// Created by peter on 2022/9/20.
//
#import <UIKit/UIKit.h>
@protocol CommunityViewDelegate <NSObject>
/// 点击社区头部模块
/// @param index 模块标识
- (void)tapCommunityHeaderModule:(NSInteger)index;
/// 获取社区动态列表请求
- (void)getDynamicListRequest:(BOOL)loadMore;
@end
NS_ASSUME_NONNULL_BEGIN
@interface CommunityView : UIView
@property (nonatomic, weak) id<CommunityViewDelegate> delegate;
- (instancetype)initWithDelegate:(id<CommunityViewDelegate>)delegate;
/// 更新社区动态
- (void)updateCommunityMoments:(BOOL)loadMore;
@end
NS_ASSUME_NONNULL_END
//
// CommunityView.m
// DreamSleep
//
// Created by peter on 2022/9/20.
//
#import "CommunityView.h"
@interface CommunityView () <UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) UIView *headView;
@property (nonatomic, strong) UITableView *listView;
@property (nonatomic, strong) NSArray *listArr;
@end
@implementation CommunityView
#pragma mark - 初始化
- (instancetype)initWithDelegate:(id<CommunityViewDelegate>)delegate {
if (self = [super init]) {
self.delegate = delegate;
self.listArr = @[@"1", @"2", @"3", @"4", @"5", @"6", @"7", @"8", @"9", @"10"];
self.dk_backgroundColorPicker = DKColorPickerWithKey(VCViewBG);
[self addSubview:self.listView];
UIButton *publishBtn = [UIButton new];
[publishBtn setImage:[UIImage imageNamed:@"ic_fabu"] forState:UIControlStateNormal];
[publishBtn addTarget:self action:@selector(publishAction) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:publishBtn];
[publishBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self).offset(-15);
make.bottom.equalTo(self).offset(-45);
}];
}
return self;
}
- (void)layoutSubviews {
self.listView.frame = CGRectMake(15, 0, self.width - 30, self.height);
}
#pragma mark - public
- (void)updateCommunityMoments:(BOOL)loadMore {
if (loadMore) {
self.listArr = @[@"1", @"2", @"3", @"4", @"5", @"6", @"7", @"8", @"9", @"10", @"8", @"9", @"10"];
[self.listView.mj_footer endRefreshing];
} else {
[self.listView.mj_header endRefreshing];
}
[self.listView reloadData];
}
#pragma mark - Action
- (void)tapAction:(UITapGestureRecognizer *)tapGR {
if (self.delegate && [self.delegate respondsToSelector:@selector(tapCommunityHeaderModule:)]) {
[self.delegate tapCommunityHeaderModule:tapGR.view.tag];
}
}
- (void)publishAction {
DSLog(@"发布说说...");
}
#pragma mark - UITableViewDelegate, UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return self.listArr.count;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 1;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 150;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
return CGFLOAT_MIN;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
return [UIView new];
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
return section == self.listArr.count - 1 ? CGFLOAT_MIN : 12;;
}
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
return [UIView new];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([UITableViewCell class])];
[cell cornerRadius:24.0];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.dk_backgroundColorPicker = DKColorPickerWithColors(DSWhite, CornerViewDarkColor, DSWhite);
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
DSLog(@"indexPath:%ld", indexPath.section)
}
#pragma mark - lazy
- (UITableView *)listView {
if (!_listView) {
_listView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
_listView.delegate = self;
_listView.dataSource = self;
_listView.backgroundColor = DSClearColor;
_listView.showsVerticalScrollIndicator = NO;
_listView.separatorStyle = UITableViewCellSeparatorStyleNone;
_listView.tableHeaderView = self.headView;
[_listView registerClass:[UITableViewCell class] forCellReuseIdentifier:NSStringFromClass([UITableViewCell class])];
WS(weakSelf);
_listView.mj_header = [DSGifHeader headerWithRefreshingBlock:^{
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(getDynamicListRequest:)]) {
[weakSelf.delegate getDynamicListRequest:NO];
}
}];
[_listView.mj_header beginRefreshing];
_listView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(getDynamicListRequest:)]) {
[weakSelf.delegate getDynamicListRequest:YES];
}
}];
}
return _listView;
}
- (UIView *)headView {
if (!_headView) {
CGFloat aroundMargin = 15;
CGFloat middleSpace = 12;
CGFloat articleScale = 146.0 / (kBaseW - 2*aroundMargin - middleSpace);
CGFloat totalW = kScreenWidth - 2*aroundMargin - middleSpace;
CGFloat articleW = articleScale * totalW;
CGFloat evaluationW = totalW * (1 - articleScale);
CGFloat articleH = 80 * articleW / 146;
_headView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.listView.width, articleH + 2*aroundMargin)];
_headView.backgroundColor = DSClearColor;
UIImageView *articleIV = [self plateWithFrame:CGRectMake(0, 15, articleW, articleH) title:@"#睡眠文章" desc:@"精选海量好文" imgName:@"btn_shequ_shuimianwenzhang" tag:1];
[self plateWithFrame:CGRectMake(articleW + 12, articleIV.y, evaluationW, articleH) title:@"#人气测评" desc:@"玩转趣味测试" imgName:@"btn_shequ_ceping" tag:2];
}
return _headView;
}
- (UIImageView *)plateWithFrame:(CGRect)frame title:(NSString *)title desc:(NSString *)desc imgName:(NSString *)imgName tag:(NSInteger)tag {
UIImageView *imgView = [[UIImageView alloc] initWithFrame:frame];
[imgView dk_setAlphaPicker:DKAlphaPickerWithAlphas(1.0, .5, .5)];
imgView.image = [UIImage imageNamed:imgName];
imgView.tag = tag;
imgView.userInteractionEnabled = YES;
[self.headView addSubview:imgView];
UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)];
[imgView addGestureRecognizer:tapGR];
UILabel *titleLab = [UILabel labWithText:title textColor:DSWhite font:BoldFont(16)];
[imgView addSubview:titleLab];
UILabel *descLab = [UILabel labWithText:desc textColor:ColorFromHexA(0xFFFFFF, .5) font:SysFont(14)];
[imgView addSubview:descLab];
[titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.equalTo(imgView).offset(15);
make.height.equalTo(@22);
}];
[descLab mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(titleLab);
make.bottom.equalTo(imgView).offset(-15);
}];
return imgView;
}
@end
//
// ArticleRequestModel.h
// DreamSleep
//
// Created by peter on 2022/9/2.
//
#import "DSNetworkTool.h"
NS_ASSUME_NONNULL_BEGIN
/// 文章咨询数据请求model
@interface ArticleRequestModel : DSNetworkTool
/// 获取文章咨询列表接口
/// @param completion completion
+ (NSURLSessionDataTask *)querySsmianKnowledgeListWithCompletion:(void (^)(ArticleRequestModel *requestModel))completion;
@end
NS_ASSUME_NONNULL_END
//
// ArticleRequestModel.m
// DreamSleep
//
// Created by peter on 2022/9/2.
//
#import "ArticleRequestModel.h"
@implementation ArticleRequestModel
+ (NSURLSessionDataTask *)querySsmianKnowledgeListWithCompletion:(void (^)(ArticleRequestModel *requestModel))completion {
ArticleRequestModel * requestModel = [[ArticleRequestModel alloc] init];
NSString *api = @"query_ssmian_knowledge_list";
NSString *argStr = [NSString stringWithFormat:@"query{%@}", api];
return [self httpPostBodyRequestWithAPI:api params:@{@"query" : argStr} view:nil hasNetActivity:YES loadingInfo:nil hasFailInfo:NO success:^(NSDictionary * _Nonnull apiDic) {
DSLog(@"文章咨询数据接口apiDic:%@", apiDic);
requestModel.resCode = DSResCodeSuccess;
NSDictionary *resultDic = apiDic[@"result"];
completion(requestModel);
} failure:^(id _Nonnull failureInfo) {
requestModel.resCode = [failureInfo[@"errorCode"] integerValue];
requestModel.errMessage = failureInfo[@"errMessage"];
completion(requestModel);
}];
}
@end
//
// EvaluateRequestModel.h
// DreamSleep
//
// Created by peter on 2022/9/20.
//
#import "DSNetworkTool.h"
NS_ASSUME_NONNULL_BEGIN
@interface EvaluateRequestModel : DSNetworkTool
/// 社区测评列表接口
/// @param completion completion
+ (NSURLSessionDataTask *)queryCommunityEvaluationListWithCompletion:(void (^)(EvaluateRequestModel *requestModel))completion;
@end
NS_ASSUME_NONNULL_END
//
// EvaluateRequestModel.m
// DreamSleep
//
// Created by peter on 2022/9/20.
//
#import "EvaluateRequestModel.h"
@implementation EvaluateRequestModel
+ (NSURLSessionDataTask *)queryCommunityEvaluationListWithCompletion:(void (^)(EvaluateRequestModel *requestModel))completion {
EvaluateRequestModel * requestModel = [[EvaluateRequestModel alloc] init];
NSString *api = @"query_community_evaluation_list";
NSString *argStr = [NSString stringWithFormat:@"query{%@}", api];
return [self httpPostBodyRequestWithAPI:api params:@{@"query" : argStr} view:nil hasNetActivity:YES loadingInfo:nil hasFailInfo:NO success:^(NSDictionary * _Nonnull apiDic) {
DSLog(@"社区评测数据列表接口apiDic:%@", apiDic);
requestModel.resCode = DSResCodeSuccess;
completion(requestModel);
} failure:^(id _Nonnull failureInfo) {
requestModel.resCode = [failureInfo[@"errorCode"] integerValue];
requestModel.errMessage = failureInfo[@"errMessage"];
completion(requestModel);
}];
}
@end
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
return self.listData.count; return self.listData.count;
} }
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 110.f; return 110.f;
} }
......
...@@ -197,7 +197,7 @@ ...@@ -197,7 +197,7 @@
} }
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
return (section == 0) ? 8 : 0.001; return (section == 0) ? 8 : 0.001;
} }
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
......
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "btn_shequ_ceping.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "btn_shequ_ceping@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "btn_shequ_ceping@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "btn_shequ_shuimianwenzhang.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "btn_shequ_shuimianwenzhang@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "btn_shequ_shuimianwenzhang@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ic_fabu.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_fabu@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_fabu@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ic_message_shequ.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_message_shequ@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_message_shequ@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "community.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "community@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "community@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "community_selected.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "community_selected@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "community_selected@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!