小说绘上架版本

This commit is contained in:
xtfei2011
2021-02-07 11:24:08 +08:00
commit ee5c1c8b12
1762 changed files with 115892 additions and 0 deletions
@@ -0,0 +1,18 @@
//
// TFFeedBackRecordViewController.h
// TFReader
//
// Created by 谢腾飞 on 2020/12/23.
// Copyright © 2020 xtfei_2011@126.com. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "TFBasicViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface TFFeedBackRecordViewController : TFBasicViewController
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,133 @@
//
// TFFeedBackRecordViewController.m
// TFReader
//
// Created by 谢腾飞 on 2020/12/23.
// Copyright © 2020 xtfei_2011@126.com. All rights reserved.
//
#import "TFFeedBackRecordViewController.h"
#import "TFFeedBackRecordViewCell.h"
#import "TFFeedBackRecordModel.h"
@interface TFFeedBackRecordViewController ()<UITableViewDelegate, UITableViewDataSource>
@end
@implementation TFFeedBackRecordViewController
- (void)viewDidLoad
{
[super viewDidLoad];
[self initialize];
[self createSubviews];
}
- (void)initialize
{
[self setNavigationBarTitle:TFLocalizedString(@"我的反馈")];
}
- (void)createSubviews
{
self.view.backgroundColor = kGrayViewColor;
self.mainTableViewGroup.delegate = self;
self.mainTableViewGroup.dataSource = self;
[self.view addSubview:self.mainTableViewGroup];
[self.mainTableViewGroup mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(0);
make.top.mas_equalTo(PUB_NAVBAR_HEIGHT);
make.width.mas_equalTo(SCREEN_WIDTH);
make.height.mas_equalTo(SCREEN_HEIGHT - PUB_NAVBAR_HEIGHT);
}];
WS(weakSelf)
self.mainTableViewGroup.mj_header = [TFRefreshHeader headerWithRefreshingBlock:^{
weakSelf.currentPageNumber = 1;
[weakSelf netRequest];
}];
[self.mainTableViewGroup.mj_header beginRefreshing];
self.mainTableViewGroup.mj_footer = [TFRefreshFooter footerWithRefreshingBlock:^{
weakSelf.currentPageNumber ++;
[weakSelf netRequest];
}];
[self setEmptyOnView:self.mainTableViewGroup title:TFLocalizedString(@"您还没有任何反馈") tapBlock:^{
}];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return self.dataSourceArray.count;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 1;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *cellName = @"TFFeedBackRecordViewCell";
TFFeedBackRecordViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellName];
if (!cell) {
cell = [[TFFeedBackRecordViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellName];
}
cell.contentModel = [self.dataSourceArray objectOrNilAtIndex:indexPath.section];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return kHalfMargin;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, kHalfMargin)];
view.backgroundColor = kGrayViewColor;
return view;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
return CGFLOAT_MIN;
}
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, PUB_TABBAR_OFFSET == 0 ? 10 : PUB_TABBAR_OFFSET)];
view.backgroundColor = kGrayViewColor;
return view;
}
- (void)netRequest
{
WS(weakSelf)
[TFNetworkTools POST:Feed_Back_List parameters:nil model:TFFeedBackRecordModel.class success:^(BOOL isSuccess, TFFeedBackRecordModel *_Nullable t_model, TFNetworkRequestModel *requestModel) {
[weakSelf.mainTableViewGroup endRefreshing];
if (isSuccess) {
if (weakSelf.currentPageNumber == 1) {
weakSelf.dataSourceArray = [NSMutableArray arrayWithArray:t_model.list];
} else {
[weakSelf.dataSourceArray addObjectsFromArray:t_model.list];
}
[weakSelf.mainTableViewGroup reloadData];
if (t_model.total_page <= t_model.current_page) {
[weakSelf.mainTableViewGroup hideRefreshFooter];
}
}
[weakSelf.mainTableViewGroup xtfei_endLoading];
} failure:nil];
}
@end
@@ -0,0 +1,18 @@
//
// TFFeedBackViewController.h
// TFReader
//
// Created by 谢腾飞 on 2020/12/22.
// Copyright © 2020 xtfei_2011@126.com. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "TFBasicViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface TFFeedBackViewController : TFBasicViewController
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,153 @@
//
// TFFeedBackViewController.m
// TFReader
//
// Created by 谢腾飞 on 2020/12/22.
// Copyright © 2020 xtfei_2011@126.com. All rights reserved.
//
#import "TFFeedBackViewController.h"
#import "WXYZ_FeedbackSubViewController.h"
#import "TFFeedBackRecordViewController.h"
#import "TFFeedBackHeaderView.h"
#import "TFFeedBackViewCellCell.h"
#import "TFFeedBackModel.h"
@interface TFFeedBackViewController ()<UITableViewDataSource, UITableViewDelegate>
@property (nonatomic ,strong) TFFeedBackModel *feedbackModel;
@property (nonatomic ,assign) NSUInteger selectIndex; // 当前选择位置
@end
@implementation TFFeedBackViewController
- (void)viewDidLoad
{
[super viewDidLoad];
[self initialize];
[self createSubviews];
[self netRequest];
}
- (void)initialize
{
[self setNavigationBarTitle:TFLocalizedString(@"首页帮助反馈")];
self.selectIndex = 99999;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(deletePhoto:) name:TF_DELETE_PHOTO object:nil];
}
- (void)createSubviews
{
self.mainTableViewGroup.delegate = self;
self.mainTableViewGroup.dataSource = self;
[self.view addSubview:self.mainTableViewGroup];
WS(weakSelf)
TFFeedBackHeaderView *headerView = [[TFFeedBackHeaderView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 80)];
headerView.leftButtonClick = ^{
[weakSelf.navigationController pushViewController:[[TFFeedBackRecordViewController alloc] init] animated:YES];
};
headerView.rightButtonClick = ^{
[weakSelf.navigationController pushViewController:[[WXYZ_FeedbackSubViewController alloc] init] animated:YES];
};
[self.mainTableViewGroup setTableHeaderView:headerView];
[self.mainTableViewGroup mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(0);
make.top.mas_equalTo(PUB_NAVBAR_HEIGHT);
make.width.mas_equalTo(SCREEN_WIDTH);
make.height.mas_equalTo(SCREEN_HEIGHT - PUB_NAVBAR_HEIGHT);
}];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return self.feedbackModel.help_list.count;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [self.feedbackModel.help_list objectAtIndex:section].list.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
TFHelpListModel *sectionModel = [self.feedbackModel.help_list objectAtIndex:indexPath.section];
TFQuestionListModel *indexModel = [sectionModel.list objectOrNilAtIndex:indexPath.row];
static NSString *cellName = @"TFFeedBackViewCellCell";
TFFeedBackViewCellCell *cell = [tableView dequeueReusableCellWithIdentifier:cellName];
if (!cell) {
cell = [[TFFeedBackViewCellCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellName];
}
cell.questionModel = indexModel;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return 40;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 40)];
view.backgroundColor = kGrayViewColor;
UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(kHalfMargin, 0, SCREEN_WIDTH - 2 * kHalfMargin, 40)];
titleLabel.text = [self.feedbackModel.help_list objectAtIndex:section].name ? : @"";
titleLabel.textColor = kGrayTextColor;
titleLabel.font = kFont15;
[view addSubview:titleLabel];
return view;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
if (section == self.feedbackModel.help_list.count - 1) {
return PUB_TABBAR_OFFSET == 0 ? 10 : PUB_TABBAR_OFFSET;
}
return CGFLOAT_MIN;
}
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, kHalfMargin)];
view.backgroundColor = [UIColor clearColor];
return view;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
TFFeedBackViewCellCell *cell = [self.mainTableViewGroup cellForRowAtIndexPath:indexPath];
[self.mainTableViewGroup beginUpdates];
if (cell.detailCellShowing) {
[cell hiddenDetail];
} else {
[cell showDetail];
}
[self.mainTableViewGroup endUpdates];
}
- (void)netRequest
{
WS(weakSelf)
[TFNetworkTools POST:Answer_List parameters:nil model:TFFeedBackModel.class success:^(BOOL isSuccess, TFFeedBackModel *_Nullable t_model, TFNetworkRequestModel *requestModel) {
if (isSuccess) {
weakSelf.feedbackModel = t_model;
[weakSelf.mainTableViewGroup reloadData];
}
} failure:nil];
}
- (void)deletePhoto:(NSNotification *)noti
{
[TFNetworkTools POST:Delete_Upload_Image parameters:@{@"image":[TFUtilsHelper formatStringWithObject:noti.object]} model:nil success:nil failure:nil];
}
@end