Commit 06f6352e authored by 曹云霄's avatar 曹云霄

修改项说明:公告开发

parent 57c457f7
......@@ -118,12 +118,10 @@
{
//时间
if (Selected == 0) {
self.afficheModel.dayCountEquals = [self timeString:title];
[self.dateButton setTitle:title forState:UIControlStateNormal];
}else
{//类型
self.afficheModel.afficheTypeEuals = [title isEqualToString:@"全部"]?nil:title;
[self.typeButton setTitle:title forState:UIControlStateNormal];
}
......@@ -220,6 +218,7 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
AnnountcementDetailViewController *detail = [[[self class] getAnnouncementStoryboardClass]instantiateViewControllerWithIdentifier:@"AnnountcementDetailViewController"];
TOAfficheEntity *entity = self.afficheArray[indexPath.row];
detail.announcementID = entity.fid;
......
......@@ -10,6 +10,7 @@
#import "WkWebViewViewController.h"
#import "AnnouncementContentTableViewCell.h"
#import "AnnouncementListTableViewCell.h"
#import "CustomWKWebViewController.h"
@interface AnnountcementDetailViewController ()<UITableViewDelegate,UITableViewDataSource>
......@@ -19,10 +20,15 @@
*/
@property (weak, nonatomic) IBOutlet UILabel *annountcementTitleLabel;
/**
公告headerView
*/
@property (weak, nonatomic) IBOutlet UIView *announcementHeaderView;
/**
公告类型
*/
@property (weak, nonatomic) IBOutlet UILabel *annountcementTypeLabel;
@property (weak, nonatomic) IBOutlet CustomBorderLabel *annountcementTypeLabel;
/**
公告时间
......@@ -63,19 +69,26 @@
{
self.announcementDetailsTableView.tableFooterView = [UIView new];
[self.announcementDetailsTableView registerClass:[AnnouncementContentTableViewCell class] forCellReuseIdentifier:@"AnnouncementContentTableViewCell"];
//headerView
self.announcementDetailsTableView.tableHeaderView = self.announcementHeaderView;
}
#pragma mark - 设置HeaderView
- (void)setUpTableViewHeaderView:(TOAfficheEntity *)entity
{
self.annountcementTitleLabel.text = entity.title;
self.annountcementTimeLabel.text = entity.createDate;
self.annountcementTypeLabel.customText = entity.afficheType;
self.annountcementReadCountLabel.text = @"1000";
}
#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);
[weakSelf.announcementDetailsTableView reloadData];
}];
[self addChildViewController:webView];
}
......@@ -92,6 +105,7 @@
weakSelf.afficheResult = [[TOAfficheEntity alloc]initWithDictionary:returnValue[@"data"] error:nil];
WkWebViewViewController *webView = [weakSelf.childViewControllers firstObject];
webView.htmlString = weakSelf.afficheResult.content;
[weakSelf setUpTableViewHeaderView:weakSelf.afficheResult];
}else {
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
}
......@@ -111,7 +125,6 @@
{
if (indexPath.row == 0) {
AnnouncementContentTableViewCell *contentCell = [tableView dequeueReusableCellWithIdentifier:@"AnnouncementContentTableViewCell" forIndexPath:indexPath];
[contentCell.contentView addSubview:self.childViewControllers[0].view];
return contentCell;
}
......@@ -134,4 +147,13 @@
return 80;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
CustomWKWebViewController *wkWebView = [[CustomWKWebViewController alloc]init];
TOAttachmentEntity *attachment = self.afficheResult.attachmentUrls[indexPath.row-1];
wkWebView.pdfURLString = attachment.fileUrl;
[self presentViewController:wkWebView animated:YES completion:nil];
}
@end
......@@ -7,10 +7,9 @@
//
#import "BaseViewController.h"
#import <WebKit/WebKit.h>
typedef void(^returnContentHeight)(CGFloat height);
@interface WkWebViewViewController : BaseViewController<WKNavigationDelegate>
@interface WkWebViewViewController : BaseViewController
@property (nonatomic,strong) UIWebView *contentWebView;
@property (nonatomic,copy) returnContentHeight contentHeight;
......
......@@ -21,10 +21,21 @@
- (instancetype)initWithReturnContentSize:(void(^)(CGFloat contentHeight))block
{
if (self = [super init]) {
self.contentWebView = [[UIWebView alloc]initWithFrame:CGRectMake(10, 10, ScreenWidth, 0.01)];
self.contentWebView = [[UIWebView alloc]initWithFrame:CGRectMake(27, 10, ScreenWidth-27*2, 0.01)];
self.contentWebView.delegate = self;
self.contentWebView.backgroundColor = [UIColor whiteColor];
self.contentWebView.scrollView.scrollEnabled = NO;
self.contentHeight = block;
[self.view addSubview:self.contentWebView];
UIView *lineView = [[UIView alloc]init];
lineView.backgroundColor = RGB(237, 238, 239, 1);
[self.view addSubview:lineView];
[lineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self.view);
make.top.equalTo(self.view.mas_bottom).mas_offset(1);
make.size.mas_equalTo(CGSizeMake(ScreenWidth-27*2, 1));
}];
}
return self;
}
......@@ -35,33 +46,24 @@
[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
#pragma mark - <UIWebViewDelegate>
- (void)webViewDidStartLoad:(UIWebView *)webView
{
[self CreateMBProgressHUDLoding];
}
- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation
- (void)webViewDidFinishLoad:(UIWebView *)webView
{
webView.height = webView.scrollView.contentSize.height;
[self RemoveMBProgressHUDLoding];
webView.height = webView.scrollView.contentSize.height-10;
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
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
{
[self ErrorMBProgressView:@"加载失败"];
[self dismissViewControllerAnimated:YES completion:nil];
}
@end
//
// ForumViewController.h
// Lighting
//
// Created by 曹云霄 on 2016/11/24.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
@interface ForumViewController : BaseViewController
@end
//
// ForumViewController.m
// Lighting
//
// Created by 曹云霄 on 2016/11/24.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "ForumViewController.h"
@interface ForumViewController ()
@end
@implementation ForumViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// 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.
}
*/
@end
......@@ -142,6 +142,7 @@
299876391CD9981800C90D0A /* GoodsInformationTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 299876381CD9981800C90D0A /* GoodsInformationTableViewCell.m */; };
2998763C1CD9983A00C90D0A /* CommodityListTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2998763B1CD9983A00C90D0A /* CommodityListTableViewCell.m */; };
299876421CD99E4000C90D0A /* OrderdetailsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 299876411CD99E4000C90D0A /* OrderdetailsViewController.m */; };
2999B12F1DE6CD730031F79E /* ForumViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2999B12E1DE6CD730031F79E /* ForumViewController.m */; };
299C7F5A1CE21FA800E7D7CB /* AddressViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 299C7F581CE21FA800E7D7CB /* AddressViewController.m */; };
299C7F5B1CE21FA800E7D7CB /* AddressViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 299C7F591CE21FA800E7D7CB /* AddressViewController.xib */; };
29A8D3981CD85A58004D558F /* ClientdetailsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29A8D3971CD85A58004D558F /* ClientdetailsViewController.m */; };
......@@ -484,6 +485,8 @@
2998763B1CD9983A00C90D0A /* CommodityListTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommodityListTableViewCell.m; sourceTree = "<group>"; };
299876401CD99E4000C90D0A /* OrderdetailsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OrderdetailsViewController.h; sourceTree = "<group>"; };
299876411CD99E4000C90D0A /* OrderdetailsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = OrderdetailsViewController.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
2999B12D1DE6CD730031F79E /* ForumViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ForumViewController.h; sourceTree = "<group>"; };
2999B12E1DE6CD730031F79E /* ForumViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ForumViewController.m; sourceTree = "<group>"; };
299C7F571CE21FA800E7D7CB /* AddressViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddressViewController.h; sourceTree = "<group>"; };
299C7F581CE21FA800E7D7CB /* AddressViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AddressViewController.m; sourceTree = "<group>"; };
299C7F591CE21FA800E7D7CB /* AddressViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = AddressViewController.xib; sourceTree = "<group>"; };
......@@ -1490,6 +1493,22 @@
name = view;
sourceTree = "<group>";
};
2999B12C1DE6CD4F0031F79E /* Controllers */ = {
isa = PBXGroup;
children = (
2999B12D1DE6CD730031F79E /* ForumViewController.h */,
2999B12E1DE6CD730031F79E /* ForumViewController.m */,
);
name = Controllers;
sourceTree = "<group>";
};
2999B1301DE6CD760031F79E /* Cells */ = {
isa = PBXGroup;
children = (
);
name = Cells;
sourceTree = "<group>";
};
299B2E8A1DCE411400068939 /* cells */ = {
isa = PBXGroup;
children = (
......@@ -1519,15 +1538,6 @@
name = PreviewPDF;
sourceTree = "<group>";
};
29ABA6E71DE686B4007D8012 /* Views */ = {
isa = PBXGroup;
children = (
29ABA6E81DE686D5007D8012 /* WkWebViewViewController.h */,
29ABA6E91DE686D5007D8012 /* WkWebViewViewController.m */,
);
name = Views;
sourceTree = "<group>";
};
29B3EE6E1DCE15EC0065FCCF /* MyLuckyDraw */ = {
isa = PBXGroup;
children = (
......@@ -1621,7 +1631,8 @@
29C0E7431DD98943006CCCF9 /* AnnouncementViewController.m */,
29FF55431DE5F29400406852 /* AnnountcementDetailViewController.h */,
29FF55441DE5F29400406852 /* AnnountcementDetailViewController.m */,
29ABA6E71DE686B4007D8012 /* Views */,
29ABA6E81DE686D5007D8012 /* WkWebViewViewController.h */,
29ABA6E91DE686D5007D8012 /* WkWebViewViewController.m */,
29837B521DE598E8009CF614 /* Cells */,
29837B511DE598C9009CF614 /* CustomLabels */,
);
......@@ -1648,6 +1659,8 @@
29C30BD71DDC1E8C00CA3E29 /* ComprehensiveDiscussion */ = {
isa = PBXGroup;
children = (
2999B12C1DE6CD4F0031F79E /* Controllers */,
2999B1301DE6CD760031F79E /* Cells */,
);
path = ComprehensiveDiscussion;
sourceTree = "<group>";
......@@ -2206,6 +2219,7 @@
2916A7411D70362000644C8C /* PaymentsViewController.m in Sources */,
291D6A651D0002AF007891AE /* TOGoodsEntityModel.m in Sources */,
29E944591DE45558007CD26C /* PrizeExchangeConsigneeTableViewCell.m in Sources */,
2999B12F1DE6CD730031F79E /* ForumViewController.m in Sources */,
2928F8381CD09E730036D761 /* CustomButton.m in Sources */,
293393551CD3379E000D997B /* ShoppingTableViewCell.m in Sources */,
29837B561DE5992A009CF614 /* CustomBorderLabel.m in Sources */,
......
This diff is collapsed.
{
"images" : [
{
"idiom" : "universal",
"filename" : "Learningcenter.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "Learningcenter@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "Learningcenter@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "camera.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "camera@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "camera@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "comments.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "comments@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "comments@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "finish.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "finish@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "finish@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "praise.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "praise@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "praise@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "release.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "release@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "release@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
This diff is collapsed.
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