Commit 64630bb5 authored by AvatarC's avatar AvatarC

Merge branch 'develop' of https://git.oschina.net/gomoretech/RedstarIOS into develop_avatar

parents 5851ab4e db5156eb
This diff is collapsed.
......@@ -10,10 +10,10 @@
#define Url_h
// url 测试环境
// #define kRedStarURL @"http://218.244.151.129:7580/"
#define kRedStarURL @"http://218.244.151.129:7580/"
// 正式环境
#define kRedStarURL @"http://219.235.234.225:7580/"
// #define kRedStarURL @"http://219.235.234.225:7580/"
// 检查更新
......@@ -119,4 +119,7 @@
// 获取下级组织
#define kQueryLowerOrgsURL @"redstar-server/rest/organization/queryLowerOrgs"
// 口碑标注附件列表
#define kGetAttachmentsURL @"redstar-server/rest/standardpraise/get_attachments"
#endif /* Url_h */
//
// AttachmentTableViewCell.h
// redstar
//
// Created by admin on 15/12/25.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AttachmentTableViewCell : UITableViewCell
@property (nonatomic, strong) UIButton *nameBtn;
@property (nonatomic, strong) UIButton *downloadBtn;
@end
//
// AttachmentTableViewCell.m
// redstar
//
// Created by admin on 15/12/25.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "AttachmentTableViewCell.h"
@implementation AttachmentTableViewCell
- (UIButton *)nameBtn
{
if (!_nameBtn) {
_nameBtn = [[UIButton alloc] init];
_nameBtn.backgroundColor = [UIColor grayColor];
_nameBtn.translatesAutoresizingMaskIntoConstraints = NO;
_nameBtn.layer.cornerRadius = 4.0;
[self.contentView addSubview:_nameBtn];
NSLayoutConstraint *lineViewTop = [NSLayoutConstraint constraintWithItem:_nameBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:5];
[self.contentView addConstraint:lineViewTop];
NSLayoutConstraint *lineViewRight = [NSLayoutConstraint constraintWithItem:_nameBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:-20];
[self.contentView addConstraint:lineViewRight];
NSLayoutConstraint *lineViewBottom = [NSLayoutConstraint constraintWithItem:_nameBtn attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-5];
[self.contentView addConstraint:lineViewBottom];
NSLayoutConstraint *lineViewLeft = [NSLayoutConstraint constraintWithItem:_nameBtn attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:10];
[self.contentView addConstraint:lineViewLeft];
NSLayoutConstraint *lineViewHeight = [NSLayoutConstraint constraintWithItem:_nameBtn attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:35];
[self.contentView addConstraint:lineViewHeight];
}
return _nameBtn;
}
- (UIButton *)downloadBtn
{
if (!_downloadBtn) {
_downloadBtn = [[UIButton alloc] init];
_downloadBtn.backgroundColor = [UIColor grayColor];
_downloadBtn.translatesAutoresizingMaskIntoConstraints = NO;
_downloadBtn.layer.cornerRadius = 4.0;
[self.contentView addSubview:_downloadBtn];
NSLayoutConstraint *lineViewTop = [NSLayoutConstraint constraintWithItem:_downloadBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:5];
[self.contentView addConstraint:lineViewTop];
NSLayoutConstraint *lineViewRight = [NSLayoutConstraint constraintWithItem:_downloadBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:lineViewRight];
NSLayoutConstraint *lineViewBottom = [NSLayoutConstraint constraintWithItem:_downloadBtn attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-5];
[self.contentView addConstraint:lineViewBottom];
NSLayoutConstraint *lineViewLeft = [NSLayoutConstraint constraintWithItem:_downloadBtn attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:10];
[self.contentView addConstraint:lineViewLeft];
}
return _downloadBtn;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
......@@ -15,8 +15,10 @@
#import "AnnounceDetailModel.h"
#define kAnnounceContentCell @"AnnoContentTableViewCell"
#import "AttachmentTableViewCell.h"
#define kAnnounceContentCell @"AnnoContentTableViewCell"
#define kAttachmentTableViewCell @"AttachmentTableViewCell"
@interface AnnoDetailViewController ()<UITableViewDataSource, UITableViewDelegate>
@property (nonatomic, strong) UITableView *tableView;
......@@ -43,7 +45,7 @@
NSString *url = [NSString stringWithFormat:@"%@%@%@", kRedStarURL, kAnnounceDetailURL, self.affiche_uuid];
HttpClient *httpCilent = [[HttpClient alloc] initWithUrl:url];
[httpCilent getAnnounceDetailWithCompletion:^(id response, NSError *error) {
NSLog(@"anno详情 = %@", response);
NSLog(@"anno 公告详情 = %@", response);
NSDictionary *dict = response[@"data"];
AnnounceDetailModel *annoDetail = [AnnounceDetailModel announceDetailModelWithDict:dict];
_annoDetail = annoDetail;
......@@ -94,6 +96,15 @@
}
- (void)showFile:(UIButton *)sender
{
}
- (void)downloadFile:(UIButton *)sender
{
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
......@@ -103,26 +114,42 @@
#pragma mark - UITableView Delegate/DataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 1;
return 1 + _annoDetail.attachmentUrls.count;
}
// cell显示的内容
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
AnnoContentTableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:kAnnounceContentCell];
if (!cell) {
cell = [[AnnoContentTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kAnnounceContentCell];
if (indexPath.row == 0) {
AnnoContentTableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:kAnnounceContentCell];
if (!cell) {
cell = [[AnnoContentTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kAnnounceContentCell];
}
cell.titleLabel.text = @"内容";
NSString *str = [NSString stringWithFormat:@"<style> html{ font-size: 15px; color: #444444 } </style>%@", _annoDetail.content];
NSAttributedString * attrStr = [[NSAttributedString alloc] initWithData:[str dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType} documentAttributes:nil error:nil];
cell.contentLabel.attributedText = attrStr;
cell.backgroundColor = kAnnounceHeaderColor;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
} else {
AttachmentTableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:kAttachmentTableViewCell];
if (!cell) {
cell = [[AttachmentTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kAttachmentTableViewCell];
}
NSDictionary *dict = _annoDetail.attachmentUrls[indexPath.row - 1];
NSString *name = dict[@"fileName"];
[cell.nameBtn setTitle:name forState:UIControlStateNormal];
[cell.downloadBtn setTitle:@"下载" forState:UIControlStateNormal];
[cell.nameBtn addTarget:self action:@selector(showFile:) forControlEvents:UIControlEventTouchUpInside];
[cell.downloadBtn addTarget:self action:@selector(downloadFile:) forControlEvents:UIControlEventTouchUpInside];
return cell;
}
cell.titleLabel.text = @"内容";
NSString *str = [NSString stringWithFormat:@"<style> html{ font-size: 15px; color: #444444 } </style>%@", _annoDetail.content];
NSAttributedString * attrStr = [[NSAttributedString alloc] initWithData:[str dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType} documentAttributes:nil error:nil];
cell.contentLabel.attributedText = attrStr;
cell.backgroundColor = kAnnounceHeaderColor;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
......@@ -140,7 +167,7 @@
_tableView.tableHeaderView = self.headerView;
_tableView.tableFooterView = self.footerView;
[_tableView registerClass:[AnnoContentTableViewCell class] forCellReuseIdentifier:kAnnounceContentCell];
[_tableView registerClass:[AttachmentTableViewCell class] forCellReuseIdentifier:kAttachmentTableViewCell];
[self.view addSubview:_tableView];
NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
......
......@@ -22,6 +22,11 @@
@property (nonatomic, strong) NSMutableArray *uuidArray;
@property (nonatomic, strong) OnLineFooterView *footView;
@property (nonatomic, strong) NSString *storeName;
@property (nonatomic, strong) NSString *dateStr;
@property (nonatomic, strong) UIView *backGroundView;
@property (nonatomic, strong) UIView *pickBackView;
@property (nonatomic, strong) UIDatePicker *datePicker;
@end
@implementation OnLineViewController
......@@ -50,6 +55,7 @@
self.navigationItem.leftBarButtonItem = backItem;
_storeName = @"全部";
_dateStr = @"";
}
- (void)doBack:(id)sender
......@@ -75,6 +81,20 @@
- (void)saveClick:(UIButton *)sender
{
if (_dateStr.length == 0) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"请选择截止时间!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
return;
}
if (self.footView.titleTextView.text.length == 0 || self.footView.contentTextView.text.length == 0) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"任务标题和任务内容不能为空!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
return;
}
// 提示框
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"您确定要下达新的抽查任务吗?" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
alert.tag = 334281;
......@@ -82,6 +102,31 @@
[alert show];
}
- (void)closeBackGroundView
{
[UIView animateWithDuration:0.3 animations:^{
_backGroundView.alpha = .0f;
_pickBackView.alpha = 0.0f;
} completion:^(BOOL finished) {
[_backGroundView removeFromSuperview];
[_datePicker removeFromSuperview];
[_pickBackView removeFromSuperview];
_backGroundView = nil;
_datePicker = nil;
_pickBackView = nil;
}];
}
- (void)okClick:(UIButton *)sender
{
NSDate *select = [_datePicker date];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyy-MM-dd"];
_dateStr = [dateFormatter stringFromDate:select];
[self closeBackGroundView];
[self.tableView reloadData];
}
#pragma mark - SelectStoreDelegate
- (void)deliverWithArray:(NSMutableArray *)array
{
......@@ -103,6 +148,7 @@
if (alertView.tag == 334281) {
if (buttonIndex == 1) {
NSDate *date = [NSDate date];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"YYYY-MM-dd hh:mm:ss"];
......@@ -117,24 +163,35 @@
NSLog(@"发起抽查url = %@", url);
HttpClient *httpClient= [[HttpClient alloc] initWithUrl:url];
NSDictionary *parameters = @{
@"title":self.footView.titleTextView.text,
NSDictionary *parameters = @{@"title":self.footView.titleTextView.text,
@"content":self.footView.contentTextView.text,
@"endDate":dateString,
@"endDate":_dateStr,
@"state":@"initial",
@"stores":_uuidArray
};
@"stores":_uuidArray};
NSLog(@"发起抽查par = %@", parameters);
[httpClient saveSportCheckWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"发起抽查 response = %@", response);
NSLog(@"发起抽查 error = %@", error);
if ([response[@"message"] isEqualToString:@"ok"]) {
[self.navigationController popViewControllerAnimated:YES];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"下达任务成功!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
alert.tag = 334285;
[alert show];
}
}];
}
}
if (alertView.tag == 334285) {
if (buttonIndex == 0) {
[self.navigationController popViewControllerAnimated:YES];
}
}
}
#pragma mark - TableView Delegate/DateSource
......@@ -153,7 +210,13 @@
}
cell.titleLabel.text = [NSString stringWithFormat:@"%@", _titleArray[indexPath.row]];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.selectLabel.text = [NSString stringWithFormat:@"%@", _storeName];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (indexPath.row == 0) {
cell.selectLabel.text = [NSString stringWithFormat:@"%@", _storeName];
} else {
cell.selectLabel.text = [NSString stringWithFormat:@"%@", _dateStr];
}
return cell;
......@@ -167,12 +230,64 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
SelectStoreViewController *select = [[SelectStoreViewController alloc] init];
select.delegate = self;
[self.navigationController pushViewController:select animated:YES];
if (indexPath.row == 0) {
SelectStoreViewController *select = [[SelectStoreViewController alloc] init];
select.delegate = self;
[self.navigationController pushViewController:select animated:YES];
} else {
if (!_backGroundView) {
_backGroundView = [[UIView alloc] initWithFrame:self.view.bounds];
UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeBackGroundView)];
[_backGroundView addGestureRecognizer:tapGR];
}
if (!_pickBackView) {
_pickBackView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 280, 190)];
_pickBackView.backgroundColor = [UIColor whiteColor];
_pickBackView.center = CGPointMake(self.view.center.x, self.view.center.y - 120);
_pickBackView.alpha = 0.0;
UIButton *okButton = [[UIButton alloc] initWithFrame:CGRectMake(140, 150, 140, 40)];
[okButton setTitle:@"确定" forState:UIControlStateNormal];
okButton.titleLabel.font = [UIFont systemFontOfSize:15.0];
[okButton setTitleColor:kLightBlack forState:UIControlStateNormal];
[okButton addTarget:self action:@selector(okClick:) forControlEvents:UIControlEventTouchUpInside];
[_pickBackView addSubview:okButton];
UIButton *quitButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 150, 140, 40)];
[quitButton setTitle:@"取消" forState:UIControlStateNormal];
quitButton.titleLabel.font = [UIFont systemFontOfSize:15.0];
[quitButton setTitleColor:kLightBlack forState:UIControlStateNormal];
[quitButton addTarget:self action:@selector(closeBackGroundView) forControlEvents:UIControlEventTouchUpInside];
[_pickBackView addSubview:quitButton];
}
if (!_datePicker) {
_datePicker = [[UIDatePicker alloc] initWithFrame:CGRectMake(0, 0, 280, 150)];
_datePicker.datePickerMode = UIDatePickerModeDate;
[_pickBackView addSubview:_datePicker];
}
_backGroundView.alpha = 0;
_backGroundView.backgroundColor = [UIColor blackColor];
[self.view insertSubview:_backGroundView aboveSubview:_tableView];
[self.view insertSubview:_pickBackView aboveSubview:_backGroundView];
[UIView animateWithDuration:0.3 animations:^{
_backGroundView.alpha = 0.6;
_pickBackView.alpha = 1.0;
}];
}
}
#pragma mark - lazy loading
- (UITableView *)tableView
{
if (!_tableView) {
......
......@@ -15,4 +15,5 @@
@property (nonatomic, strong) UILabel *addressLabel;
@property (nonatomic, strong) UIScrollView *showScrollView; // 轮播图
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier storePictures:(NSArray *)storePictures;
@end
......@@ -11,16 +11,16 @@
#import <UIButton+WebCache.h>
@implementation OnLineResultDetailCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier storePictures:(NSArray *)storePictures
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self setupScrollView];
[self setupScrollViewWithStorePictures:storePictures];
}
return self;
}
- (void)setupScrollView
- (void)setupScrollViewWithStorePictures:(NSArray *)storePictures
{
int imageCount = 4;
......
......@@ -180,7 +180,7 @@
{
OnLineResultDetailCell *cell = [tableView dequeueReusableCellWithIdentifier:kOnLineResultDetailCell];
if (!cell) {
cell = [[OnLineResultDetailCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kOnLineResultDetailCell];
cell = [[OnLineResultDetailCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kOnLineResultDetailCell storePictures:_storeDetail.storePictures];
}
cell.contentView.backgroundColor = kResultTitleBackColor;
cell.shopNameLabel.text = [NSString stringWithFormat:@"%@", _storeDetail.store_name];
......
......@@ -176,14 +176,10 @@
if (indexPath.section == 0) {
return;
} else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"当前功能正在开发!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
// OnLineResultViewController *onLineResult = [[OnLineResultViewController alloc] init];
// onLineResult.storeDetail = _allStoreArray[indexPath.row];
// onLineResult.checkUuid = self.uuid;
// [self.navigationController pushViewController:onLineResult animated:YES];
OnLineResultViewController *onLineResult = [[OnLineResultViewController alloc] init];
onLineResult.storeDetail = _allStoreArray[indexPath.row];
onLineResult.checkUuid = self.uuid;
[self.navigationController pushViewController:onLineResult animated:YES];
}
}
......
......@@ -193,10 +193,10 @@
- (void)addSpotCheckTaskClick:(UIButton *)sender
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"当前功能正在开发!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
// OnLineViewController *onlineVC = [[OnLineViewController alloc] init];
// [self.navigationController pushViewController:onlineVC animated:YES];
// UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"当前功能正在开发!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
// [alert show];
OnLineViewController *onlineVC = [[OnLineViewController alloc] init];
[self.navigationController pushViewController:onlineVC animated:YES];
}
- (void)dropCilck:(MenuButton *)sender
......
//
// SOPTableView.h
// redstar
//
// Created by admin on 15/12/25.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@protocol SOPTableViewDelegate <NSObject>
- (void)selectRowWithDetailTitle:(NSString *)detailTitle;
@end
@interface SOPTableView : UITableView
@property (nonatomic, assign) id <SOPTableViewDelegate> sop_delegate;
- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style titleArray:(NSArray *)titleArray;
- (instancetype)initWithTitleArray:(NSArray *)titleArray;
@end
//
// SOPTableView.m
// redstar
//
// Created by admin on 15/12/25.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "SOPTableView.h"
@interface SOPTableView () <UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) NSArray *titleArray;
@end
@implementation SOPTableView
- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style titleArray:(NSArray *)titleArray
{
self = [super initWithFrame:frame style:style];
if (self) {
_titleArray = titleArray;
[self setup];
}
return self;
}
- (instancetype)initWithTitleArray:(NSArray *)titleArray
{
self = [super init];
if (self) {
_titleArray = titleArray;
[self setup];
}
return self;
}
- (void)setup
{
self.delegate = self;
self.dataSource = self;
}
#pragma mark - UItableView Delegate/DataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return _titleArray.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:@"cell333"];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"cell333"];
}
cell.textLabel.text = _titleArray[indexPath.row];
cell.textLabel.font = [UIFont systemFontOfSize:15.0];
cell.textLabel.textColor = kLightBlack;
cell.textLabel.numberOfLines = 0;
return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return CGFLOAT_MIN;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
return CGFLOAT_MIN;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if (_sop_delegate && [_sop_delegate respondsToSelector:@selector(selectRowWithDetailTitle:)]) {
[_sop_delegate selectRowWithDetailTitle:_titleArray[indexPath.row]];
}
}
@end
//
// SOPViewController.h
// redstar
//
// Created by admin on 15/12/25.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface SOPViewController : UIViewController
@end
......@@ -9,6 +9,7 @@
#import "StandardViewController.h"
#import "StandardTableViewCell.h"
#import "HandOutViewController.h"
#import "SOPViewController.h"
#define kStandardTableViewCell @"standardTableViewCell"
@interface StandardViewController ()<UITableViewDelegate, UITableViewDataSource>
......@@ -102,14 +103,20 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"该功能正在努力开发中!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
// if (indexPath.section == 1) {
if (indexPath.section == 0) {
SOPViewController *sopVC = [[SOPViewController alloc] init];
[self.navigationController pushViewController:sopVC animated:YES];
} else if (indexPath.section == 1) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"该功能正在努力开发中!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
// HandOutViewController *hoandOutVC = [[HandOutViewController alloc] init];
// [self.navigationController pushViewController:hoandOutVC animated:YES];
// }
} else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"该功能正在努力开发中!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
}
}
#pragma mark - lazy laoding
......
......@@ -29,6 +29,9 @@
@property (nonatomic, copy) NSString *originScore;
@property (nonatomic, copy) NSString *readonlyType;
@property (nonatomic, copy) NSString *orderNo;
@property (nonatomic, assign) int index;
+ (instancetype)taskModelWithDict:(NSDictionary *)dict;
- (instancetype)initWithDict:(NSDictionary *)dict;
@end
......@@ -64,12 +64,13 @@
NSLayoutConstraint *shoppingLeft = [NSLayoutConstraint constraintWithItem:_mainTitleBtn attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:37];
[self.contentView addConstraint:shoppingLeft];
NSLayoutConstraint *shoppingRight = [NSLayoutConstraint constraintWithItem:_mainTitleBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.scoreLabel attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.contentView addConstraint:shoppingRight];
NSLayoutConstraint *shoppingHeight = [NSLayoutConstraint constraintWithItem:_mainTitleBtn attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:42];
[self.contentView addConstraint:shoppingHeight];
NSLayoutConstraint *shoppingBottom = [NSLayoutConstraint constraintWithItem:_mainTitleBtn attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-2];
[self.contentView addConstraint:shoppingBottom];
}
return _mainTitleBtn;
......
//
// RankScrollTableViewCell.h
// redstar
//
// Created by admin on 15/12/25.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface RankScrollTableViewCell : UITableViewCell
@property (nonatomic, strong) UIScrollView *scrollView;
@end
//
// RankScrollTableViewCell.m
// redstar
//
// Created by admin on 15/12/25.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "RankScrollTableViewCell.h"
#import <UIButton+WebCache.h>
@implementation RankScrollTableViewCell
- (UIScrollView *)scrollView
{
if (!_scrollView) {
_scrollView = [[UIScrollView alloc] init];
_scrollView.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_scrollView];
NSLayoutConstraint *someoneTop = [NSLayoutConstraint constraintWithItem:_scrollView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:5];
[self.contentView addConstraint:someoneTop];
NSLayoutConstraint *someoneLeft = [NSLayoutConstraint constraintWithItem:_scrollView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self.contentView addConstraint:someoneLeft];
NSLayoutConstraint *someoneRight = [NSLayoutConstraint constraintWithItem:_scrollView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:someoneRight];
NSLayoutConstraint *someoneHeight = [NSLayoutConstraint constraintWithItem:_scrollView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:65];
[self.contentView addConstraint:someoneHeight];
NSLayoutConstraint *someoneBottom = [NSLayoutConstraint constraintWithItem:_scrollView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-5];
[self.contentView addConstraint:someoneBottom];
}
return _scrollView;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
}
@end
//
// RankSectionTableCell.h
// redstar
//
// Created by admin on 15/12/25.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface RankSectionTableCell : UITableViewCell
@property (nonatomic, strong) UILabel *categoryLabel;
@property (nonatomic, strong) UILabel *scoreLabel;
@property (nonatomic, strong) UILabel *gradeLabel;
@property (nonatomic, strong) UIImageView *arrowImageView;
@end
//
// RankSectionTableCell.m
// redstar
//
// Created by admin on 15/12/25.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "RankSectionTableCell.h"
@implementation RankSectionTableCell
- (UILabel *)categoryLabel
{
if (!_categoryLabel) {
_categoryLabel = [[UILabel alloc] init];
_categoryLabel.font = [UIFont systemFontOfSize:17.0];
_categoryLabel.textColor = kLightBlack;
_categoryLabel.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_categoryLabel];
NSLayoutConstraint *shoppingTop = [NSLayoutConstraint constraintWithItem:_categoryLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.contentView addConstraint:shoppingTop];
NSLayoutConstraint *shoppingLeft = [NSLayoutConstraint constraintWithItem:_categoryLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self.contentView addConstraint:shoppingLeft];
NSLayoutConstraint *shoppingHeight = [NSLayoutConstraint constraintWithItem:_categoryLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:50];
[self.contentView addConstraint:shoppingHeight];
NSLayoutConstraint *shoppingBottom = [NSLayoutConstraint constraintWithItem:_categoryLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:shoppingBottom];
}
return _categoryLabel;
}
- (UILabel *)gradeLabel
{
if (!_gradeLabel) {
_gradeLabel = [[UILabel alloc] init];
_gradeLabel.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_gradeLabel];
NSLayoutConstraint *shoppingTop = [NSLayoutConstraint constraintWithItem:_gradeLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.contentView addConstraint:shoppingTop];
NSLayoutConstraint *shoppingLeft = [NSLayoutConstraint constraintWithItem:_gradeLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.arrowImageView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.contentView addConstraint:shoppingLeft];
NSLayoutConstraint *shoppingWidth = [NSLayoutConstraint constraintWithItem:_gradeLabel attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:60];
[self.contentView addConstraint:shoppingWidth];
NSLayoutConstraint *shoppingBottom = [NSLayoutConstraint constraintWithItem:_gradeLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:shoppingBottom];
}
return _gradeLabel;
}
- (UILabel *)scoreLabel
{
if (!_scoreLabel) {
_scoreLabel = [[UILabel alloc] init];
_scoreLabel.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_scoreLabel];
NSLayoutConstraint *shoppingTop = [NSLayoutConstraint constraintWithItem:_scoreLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.contentView addConstraint:shoppingTop];
NSLayoutConstraint *shoppingLeft = [NSLayoutConstraint constraintWithItem:_scoreLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.gradeLabel attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.contentView addConstraint:shoppingLeft];
NSLayoutConstraint *shoppingWidth = [NSLayoutConstraint constraintWithItem:_scoreLabel attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:60];
[self.contentView addConstraint:shoppingWidth];
NSLayoutConstraint *shoppingBottom = [NSLayoutConstraint constraintWithItem:_scoreLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.contentView addConstraint:shoppingBottom];
}
return _scoreLabel;
}
- (UIImageView *)arrowImageView
{
if (!_arrowImageView) {
_arrowImageView = [[UIImageView alloc] init];
_arrowImageView.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_arrowImageView];
NSLayoutConstraint *shoppingTop = [NSLayoutConstraint constraintWithItem:_arrowImageView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:20];
[self.contentView addConstraint:shoppingTop];
NSLayoutConstraint *shoppingRight = [NSLayoutConstraint constraintWithItem:_arrowImageView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:shoppingRight];
NSLayoutConstraint *shoppingWidth = [NSLayoutConstraint constraintWithItem:_arrowImageView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:12.5];
[self.contentView addConstraint:shoppingWidth];
NSLayoutConstraint *shoppingHeight = [NSLayoutConstraint constraintWithItem:_arrowImageView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:7.5];
[self.contentView addConstraint:shoppingHeight];
}
return _arrowImageView;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
......@@ -14,7 +14,6 @@
@property (nonatomic,copy) NSString *store_uuid;
@property (nonatomic,copy) NSString *store_code;
@property (nonatomic,copy) NSString *store_name;
// @property (nonatomic,copy) NSString * score;
@property (nonatomic, assign) CGFloat score;
@property (nonatomic,copy) NSString *reported;
......
......@@ -139,10 +139,8 @@
__block RankingListViewController *weakSelf = self;
[httpCilent getRankingListWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"口碑排名response = %@", response);
if ([(NSArray *)response[@"data"] count] == 0) {
return;
}
NSArray *dataArray = response[@"data"];
NSDictionary *dataDict = response[@"data"];
NSArray *dataArray = dataDict[@"records"];
NSMutableArray *tgArray = [NSMutableArray array];
......@@ -202,8 +200,6 @@
- (void)requestPartPraise
{
NSString *url = [NSString stringWithFormat:@"%@%@", kRedStarURL, kRankingListURL];
_statisMode = _selectButton.tag - 323228;
......@@ -211,14 +207,15 @@
NSDictionary *dict = _titleArray[_pickRow];
NSDictionary *parameters = @{@"praiseUuid":dict[@"uuid"],
@"statisMode":@(_statisMode),
@"orgUuids":_uuidArray
@"orgUuids":_uuidArray,
};
NSLog(@"parrrrrters = %@", parameters);
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
[httpCilent getRankingListWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"分区域 口碑排名response = %@ error = %@", response, error);
NSArray *dataArray = response[@"data"];
NSDictionary *dataDict = response[@"data"];
NSArray *dataArray = dataDict[@"records"];
NSMutableArray *tgArray = [NSMutableArray array];
......
......@@ -207,17 +207,15 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
// 口碑巡检
NSString *url1 = [NSString stringWithFormat:@"%@%@", kRedStarURL, kRankingListURL];
HttpClient *httpCilent1 = [[HttpClient alloc] initWithUrl:url1];
NSDictionary *parameters1 = @{
@"queryOrders":@[@{@"direction":@"asc"}],
NSDictionary *parameters1 = @{@"praiseUuid":@"",
@"statisMode":@(0),
@"pageNumber":@(0),
@"pageSize":@(3)
};
__block HomeViewController *weakSelf = self;
[httpCilent1 getRankingListWithParameters:parameters1 completion:^(id response, NSError *error) {
NSLog(@"刷新!! = 口碑排名response = %@", response);
if ([(NSArray *)response[@"data"] count] == 0) {
return;
}
NSDictionary *dataDict = response[@"data"];
NSArray *dataArray = dataDict[@"records"];
......@@ -283,15 +281,15 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
NSString *url = [NSString stringWithFormat:@"%@%@", kRedStarURL, kRankingListURL];
HttpClient *httpCilent = [[HttpClient alloc] initWithUrl:url];
NSDictionary *parameters = @{@"praiseUuid":@"",
@"statisMode":@(0)
@"statisMode":@(0),
@"pageNumber":@(0),
@"pageSize":@(3)
};
[httpCilent getRankingListWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"口碑排名response = %@", response);
if ([(NSArray *)response[@"data"] count] == 0) {
return;
}
NSArray *dataArray = response[@"data"];
NSDictionary *dataDict = response[@"data"];
NSArray *dataArray = dataDict[@"records"];
NSMutableArray *tgArray = [NSMutableArray array];
......@@ -493,16 +491,16 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
nav = [[UINavigationController alloc] initWithRootViewController:inspectListVC];
} else if ([item.titleLabel.text isEqualToString:@"口碑标准"]) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"当前功能正在开发!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
return;
// UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"当前功能正在开发!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
// [alert show];
// return;
// LookOnLineViewController *lookOnLine = [[LookOnLineViewController alloc] init];
// nav = [[UINavigationController alloc] initWithRootViewController:lookOnLine];
// StandardViewController *standardVC = [[StandardViewController alloc] init];
// nav = [[UINavigationController alloc] initWithRootViewController:standardVC];
StandardViewController *standardVC = [[StandardViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:standardVC];
} else if ([item.titleLabel.text isEqualToString:@"图说口碑"]) {
PictureViewController *pictureVC = [[PictureViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:pictureVC];
......@@ -595,7 +593,7 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
}
RankListModel *rankList = _allRankListArray[indexPath.row - 1];
cell.rankList = rankList;
cell.gradeImageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"medal_0%d", rankList.index]];
cell.gradeImageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"medal_0%d", rankList.index+ 1]];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
......
......@@ -122,4 +122,7 @@ typedef void (^completionBlock) (id response, NSError *error);
// 查询下级参数
- (void)queryLowerOrgsWithParameters:(id)parameters completion:(completionBlock)completion;
// 获取口碑标准的附件列表
- (void)getAttachmentsWithParameters:(id)parameters completion:(completionBlock)completion;
@end
......@@ -419,4 +419,15 @@
}];
}
// 获取口碑标准的附件列表
- (void)getAttachmentsWithParameters:(id)parameters completion:(completionBlock)completion
{
[self postParameters:parameters completion:^(id response, NSError *error) {
if (completion) {
completion (response, error);
}
}];
}
@end
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