Commit 57c457f7 authored by 曹云霄's avatar 曹云霄

修改项说明:

parent 02a78e8b
//
// AnnouncementContentTableViewCell.h
// Lighting
//
// Created by 曹云霄 on 2016/11/24.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AnnouncementContentTableViewCell : UITableViewCell
@end
//
// AnnouncementContentTableViewCell.m
// Lighting
//
// Created by 曹云霄 on 2016/11/24.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "AnnouncementContentTableViewCell.h"
@implementation AnnouncementContentTableViewCell
- (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
//
// AnnouncementListTableViewCell.h
// Lighting
//
// Created by 曹云霄 on 2016/11/24.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AnnouncementListTableViewCell : UITableViewCell
/**
公告项图片
*/
@property (weak, nonatomic) IBOutlet UIImageView *annountcementImageView;
/**
公告项标题
*/
@property (weak, nonatomic) IBOutlet UILabel *annountcementTitleLabel;
/**
公告项大小
*/
@property (weak, nonatomic) IBOutlet UILabel *annountcementSizeLabel;
/**
公告附件
*/
@property (nonatomic,strong) TOAttachmentEntity *attachmentEntity;
@end
//
// AnnouncementListTableViewCell.m
// Lighting
//
// Created by 曹云霄 on 2016/11/24.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "AnnouncementListTableViewCell.h"
@implementation AnnouncementListTableViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setAttachmentEntity:(TOAttachmentEntity *)attachmentEntity
{
_attachmentEntity = attachmentEntity;
[self.annountcementImageView sd_setImageWithURL:[NSURL URLWithString:_attachmentEntity.thumbnailUrl] placeholderImage:REPLACEIMAGE];
// self.annountcementSizeLabel.text = _attachmentEnt
self.annountcementTitleLabel.text = _attachmentEntity.fileName;
}
@end
......@@ -9,6 +9,7 @@
#import "AnnouncementViewController.h"
#import "AnnouncementTableViewCell.h"
#import "ScreeningButton.h"
#import "AnnountcementDetailViewController.h"
@interface AnnouncementViewController ()<UITableViewDelegate,UITableViewDataSource,ReturnTableviewcellIndexpathdelegate>
......@@ -217,6 +218,14 @@
return self.afficheArray.count;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
AnnountcementDetailViewController *detail = [[[self class] getAnnouncementStoryboardClass]instantiateViewControllerWithIdentifier:@"AnnountcementDetailViewController"];
TOAfficheEntity *entity = self.afficheArray[indexPath.row];
detail.announcementID = entity.fid;
[self.navigationController pushViewController:detail animated:YES];
}
#pragma mark - lazy
- (AfficheCondition *)afficheModel
{
......
......@@ -10,4 +10,12 @@
@interface AnnountcementDetailViewController : BaseViewController
@property (weak, nonatomic) IBOutlet UITableView *announcementDetailsTableView;
/**
公告ID
*/
@property (nonatomic,copy) NSString *announcementID;
@end
......@@ -7,8 +7,44 @@
//
#import "AnnountcementDetailViewController.h"
#import "WkWebViewViewController.h"
#import "AnnouncementContentTableViewCell.h"
#import "AnnouncementListTableViewCell.h"
@interface AnnountcementDetailViewController ()<UITableViewDelegate,UITableViewDataSource>
/**
公告标题
*/
@property (weak, nonatomic) IBOutlet UILabel *annountcementTitleLabel;
/**
公告类型
*/
@property (weak, nonatomic) IBOutlet UILabel *annountcementTypeLabel;
/**
公告时间
*/
@property (weak, nonatomic) IBOutlet UILabel *annountcementTimeLabel;
/**
公告阅读数
*/
@property (weak, nonatomic) IBOutlet UILabel *annountcementReadCountLabel;
/**
公告内容高度
*/
@property (nonatomic,assign) CGFloat annountcementContentHeigt;
/**
公告数据源
*/
@property (nonatomic,strong) TOAfficheEntity *afficheResult;
@interface AnnountcementDetailViewController ()
@end
......@@ -16,22 +52,86 @@
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
[self setUpTableViewAction];
[self addChildWebViewController];
[self getAnnouncementDetailsDatasAction];
}
#pragma mark - 设置Tableview
- (void)setUpTableViewAction
{
self.announcementDetailsTableView.tableFooterView = [UIView new];
[self.announcementDetailsTableView registerClass:[AnnouncementContentTableViewCell class] forCellReuseIdentifier:@"AnnouncementContentTableViewCell"];
//headerView
}
#pragma mark - WKWebView
- (void)addChildWebViewController
{
WS(weakSelf);
weakSelf.annountcementContentHeigt = 44;
WkWebViewViewController *webView = [[WkWebViewViewController alloc]initWithReturnContentSize:^(CGFloat contentHeight) {
weakSelf.annountcementContentHeigt = contentHeight;
[weakSelf.announcementDetailsTableView reloadData];
webView.view.frame = CGRectMake(0, 0, ScreenWidth, contentHeight);
}];
[self addChildViewController:webView];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
#pragma mark - 获取公告详情数据
- (void)getAnnouncementDetailsDatasAction
{
WS(weakSelf);
[self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(AFFICHEdETAILS),self.announcementID] WithCallClass:weakSelf WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
weakSelf.afficheResult = [[TOAfficheEntity alloc]initWithDictionary:returnValue[@"data"] error:nil];
WkWebViewViewController *webView = [weakSelf.childViewControllers firstObject];
webView.htmlString = weakSelf.afficheResult.content;
}else {
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
}
[weakSelf.announcementDetailsTableView reloadData];
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
}
/*
#pragma mark - Navigation
#pragma mark - <UITableViewDelegate,UITableViewDataSource>
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.row == 0) {
AnnouncementContentTableViewCell *contentCell = [tableView dequeueReusableCellWithIdentifier:@"AnnouncementContentTableViewCell" forIndexPath:indexPath];
[contentCell.contentView addSubview:self.childViewControllers[0].view];
return contentCell;
}
AnnouncementListTableViewCell *listCell = [tableView dequeueReusableCellWithIdentifier:@"AnnouncementListTableViewCell" forIndexPath:indexPath];
listCell.attachmentEntity = self.afficheResult.attachmentUrls[indexPath.row-1];
return listCell;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return self.afficheResult.attachmentUrls.count+1;
}
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.row == 0) {
return self.annountcementContentHeigt;
}
return 80;
}
*/
@end
//
// WkWebViewViewController.h
// Lighting
//
// Created by 曹云霄 on 2016/11/24.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
#import <WebKit/WebKit.h>
typedef void(^returnContentHeight)(CGFloat height);
@interface WkWebViewViewController : BaseViewController<WKNavigationDelegate>
@property (nonatomic,strong) UIWebView *contentWebView;
@property (nonatomic,copy) returnContentHeight contentHeight;
@property (nonatomic,copy) NSString *htmlString;
/**
初始化
@param htmlString HTML字符串
@param block 返回content Height
*/
- (instancetype)initWithReturnContentSize:(void(^)(CGFloat contentHeight))block;
@end
//
// WkWebViewViewController.m
// Lighting
//
// Created by 曹云霄 on 2016/11/24.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "WkWebViewViewController.h"
@interface WkWebViewViewController ()<UIWebViewDelegate>
@end
@implementation WkWebViewViewController
- (void)viewDidLoad {
[super viewDidLoad];
}
#pragma mark - 初始化
- (instancetype)initWithReturnContentSize:(void(^)(CGFloat contentHeight))block
{
if (self = [super init]) {
self.contentWebView = [[UIWebView alloc]initWithFrame:CGRectMake(10, 10, ScreenWidth, 0.01)];
self.contentWebView.delegate = self;
self.contentHeight = block;
[self.view addSubview:self.contentWebView];
}
return self;
}
- (void)setHtmlString:(NSString *)htmlString
{
_htmlString = htmlString;
[self.contentWebView loadHTMLString:_htmlString baseURL:nil];
}
#pragma mark - <WKNavigationDelegate>
- (void)webViewDidFinishLoad:(UIWebView *)webView
{
NSLog(@"%f",webView.scrollView.contentSize.height);
}
- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(null_unspecified WKNavigation *)navigation
{
[self CreateMBProgressHUDLoding];
}
- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation
{
webView.height = webView.scrollView.contentSize.height;
[self RemoveMBProgressHUDLoding];
if (self.contentHeight) {
self.contentHeight(webView.scrollView.contentSize.height);
}
NSLog(@"%f",webView.scrollView.contentSize.height);
}
- (void)webView:(WKWebView *)webView didFailNavigation:(WKNavigation *)navigation withError:(NSError *)error
{
[self ErrorMBProgressView:@"加载失败"];
[self dismissViewControllerAnimated:YES completion:nil];
}
@end
......@@ -150,6 +150,7 @@
29A938271CDAE31B00F21E54 /* ProductDetailsHeaderView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 29A938261CDAE31B00F21E54 /* ProductDetailsHeaderView.xib */; };
29A974CA1D72F9C80012AFA1 /* RebateSuccessTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29A974C91D72F9C80012AFA1 /* RebateSuccessTableViewController.m */; };
29A9DCAE1CEB643C00A7567A /* CustomWKWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29A9DCAC1CEB643C00A7567A /* CustomWKWebViewController.m */; };
29ABA6EA1DE686D5007D8012 /* WkWebViewViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29ABA6E91DE686D5007D8012 /* WkWebViewViewController.m */; };
29B3EE711DCE16130065FCCF /* LuckyDrawViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B3EE701DCE16130065FCCF /* LuckyDrawViewController.m */; };
29BAA3AB1DC9FB5B00927D04 /* PromptTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29BAA3AA1DC9FB5B00927D04 /* PromptTableViewCell.m */; };
29BB27681CD9D38E009A0813 /* AllpriceTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29BB27671CD9D38E009A0813 /* AllpriceTableViewCell.m */; };
......@@ -185,6 +186,8 @@
29E2D3301DB8AFD500443170 /* MDScratchImageView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29E2D32E1DB8AFD500443170 /* MDScratchImageView.mm */; };
29E2D33C1DB8BE7F00443170 /* CardAmplificationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E2D33A1DB8BE7F00443170 /* CardAmplificationViewController.m */; };
29E2D33D1DB8BE7F00443170 /* CardAmplificationViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 29E2D33B1DB8BE7F00443170 /* CardAmplificationViewController.xib */; };
29E35F6E1DE6827900103BE3 /* AnnouncementListTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E35F6D1DE6827900103BE3 /* AnnouncementListTableViewCell.m */; };
29E35F711DE6828D00103BE3 /* AnnouncementContentTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E35F701DE6828D00103BE3 /* AnnouncementContentTableViewCell.m */; };
29E384BE1CE9933300888199 /* AdditionalTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E384BC1CE9933300888199 /* AdditionalTableViewCell.m */; };
29E384BF1CE9933300888199 /* AdditionalTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 29E384BD1CE9933300888199 /* AdditionalTableViewCell.xib */; };
29E384C81CE9A8BF00888199 /* SearchCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E384C71CE9A8BF00888199 /* SearchCollectionViewCell.m */; };
......@@ -495,6 +498,8 @@
29A974C91D72F9C80012AFA1 /* RebateSuccessTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RebateSuccessTableViewController.m; sourceTree = "<group>"; };
29A9DCAB1CEB643C00A7567A /* CustomWKWebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomWKWebViewController.h; sourceTree = "<group>"; };
29A9DCAC1CEB643C00A7567A /* CustomWKWebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomWKWebViewController.m; sourceTree = "<group>"; };
29ABA6E81DE686D5007D8012 /* WkWebViewViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WkWebViewViewController.h; sourceTree = "<group>"; };
29ABA6E91DE686D5007D8012 /* WkWebViewViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WkWebViewViewController.m; sourceTree = "<group>"; };
29B3EE6F1DCE16130065FCCF /* LuckyDrawViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LuckyDrawViewController.h; sourceTree = "<group>"; };
29B3EE701DCE16130065FCCF /* LuckyDrawViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LuckyDrawViewController.m; sourceTree = "<group>"; };
29BAA3A91DC9FB5B00927D04 /* PromptTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PromptTableViewCell.h; sourceTree = "<group>"; };
......@@ -558,6 +563,10 @@
29E2D3391DB8BE7F00443170 /* CardAmplificationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardAmplificationViewController.h; sourceTree = "<group>"; };
29E2D33A1DB8BE7F00443170 /* CardAmplificationViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CardAmplificationViewController.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
29E2D33B1DB8BE7F00443170 /* CardAmplificationViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CardAmplificationViewController.xib; sourceTree = "<group>"; };
29E35F6C1DE6827900103BE3 /* AnnouncementListTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnnouncementListTableViewCell.h; sourceTree = "<group>"; };
29E35F6D1DE6827900103BE3 /* AnnouncementListTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AnnouncementListTableViewCell.m; sourceTree = "<group>"; };
29E35F6F1DE6828D00103BE3 /* AnnouncementContentTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnnouncementContentTableViewCell.h; sourceTree = "<group>"; };
29E35F701DE6828D00103BE3 /* AnnouncementContentTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AnnouncementContentTableViewCell.m; sourceTree = "<group>"; };
29E384BB1CE9933300888199 /* AdditionalTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdditionalTableViewCell.h; sourceTree = "<group>"; };
29E384BC1CE9933300888199 /* AdditionalTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdditionalTableViewCell.m; sourceTree = "<group>"; };
29E384BD1CE9933300888199 /* AdditionalTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = AdditionalTableViewCell.xib; sourceTree = "<group>"; };
......@@ -1385,6 +1394,10 @@
children = (
29837B571DE59E09009CF614 /* AnnouncementTableViewCell.h */,
29837B581DE59E09009CF614 /* AnnouncementTableViewCell.m */,
29E35F6C1DE6827900103BE3 /* AnnouncementListTableViewCell.h */,
29E35F6D1DE6827900103BE3 /* AnnouncementListTableViewCell.m */,
29E35F6F1DE6828D00103BE3 /* AnnouncementContentTableViewCell.h */,
29E35F701DE6828D00103BE3 /* AnnouncementContentTableViewCell.m */,
);
name = Cells;
sourceTree = "<group>";
......@@ -1506,6 +1519,15 @@
name = PreviewPDF;
sourceTree = "<group>";
};
29ABA6E71DE686B4007D8012 /* Views */ = {
isa = PBXGroup;
children = (
29ABA6E81DE686D5007D8012 /* WkWebViewViewController.h */,
29ABA6E91DE686D5007D8012 /* WkWebViewViewController.m */,
);
name = Views;
sourceTree = "<group>";
};
29B3EE6E1DCE15EC0065FCCF /* MyLuckyDraw */ = {
isa = PBXGroup;
children = (
......@@ -1599,6 +1621,7 @@
29C0E7431DD98943006CCCF9 /* AnnouncementViewController.m */,
29FF55431DE5F29400406852 /* AnnountcementDetailViewController.h */,
29FF55441DE5F29400406852 /* AnnountcementDetailViewController.m */,
29ABA6E71DE686B4007D8012 /* Views */,
29837B521DE598E8009CF614 /* Cells */,
29837B511DE598C9009CF614 /* CustomLabels */,
);
......@@ -2309,6 +2332,7 @@
0447085E1CD7C06B00555827 /* LoginViewController.m in Sources */,
29E9445C1DE45583007CD26C /* PrizeExchangeSectionTableViewCell.m in Sources */,
298534601DD4B0290023BBAE /* AirPrintManager.m in Sources */,
29ABA6EA1DE686D5007D8012 /* WkWebViewViewController.m in Sources */,
2928F83B1CD0A0CE0036D761 /* CustomTabbarController.m in Sources */,
295DEA9C1DB70FB9006ED4A6 /* RightControlTableViewCell.m in Sources */,
29A9DCAE1CEB643C00A7567A /* CustomWKWebViewController.m in Sources */,
......@@ -2324,6 +2348,7 @@
29E28CE81CE0B91B00812A55 /* HENLENSONG.m in Sources */,
299249441CDB51B100786B1E /* ModifyShippingAddressView.m in Sources */,
29E9445F1DE455AC007CD26C /* PrizeExchangeInformationTableViewCell.m in Sources */,
29E35F711DE6828D00103BE3 /* AnnouncementContentTableViewCell.m in Sources */,
295DE56C1DDC5DFA00E27725 /* GuideIntegralViewController.m in Sources */,
2906B5D71CD89246000849B4 /* ClientDetailsTableViewCell.m in Sources */,
29BB27801CD9DFD7009A0813 /* AboutViewController.m in Sources */,
......@@ -2335,6 +2360,7 @@
29834EC01CDF5E4E001A484F /* ScreeningFirstCollectionViewCell.m in Sources */,
29834EC51CDF76C1001A484F /* UserViewController.m in Sources */,
29A974CA1D72F9C80012AFA1 /* RebateSuccessTableViewController.m in Sources */,
29E35F6E1DE6827900103BE3 /* AnnouncementListTableViewCell.m in Sources */,
29E2D3271DB88D8B00443170 /* CardOrderInformationReusableView.m in Sources */,
29FF55451DE5F29400406852 /* AnnountcementDetailViewController.m in Sources */,
2962D06D1CD1A43A0058829D /* ClientViewController.m in Sources */,
......
This diff is collapsed.
{
"images" : [
{
"idiom" : "universal",
"filename" : "read.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "read@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "read@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment