Commit 47040812 authored by lmj_521aiau@163.com's avatar lmj_521aiau@163.com

Merge branch 'master' into lmj_branch

# Conflicts:
#	.DS_Store
#	Dolphins/Classes/Guard/Controller/ZJGuardViewController.m
parents ed7a1598 e020ae9f
......@@ -857,10 +857,10 @@
A9C2B89224D039B400010EAE /* Network */ = {
isa = PBXGroup;
children = (
A9C2B89324D039B400010EAE /* ZJAESCommonCrypto.m */,
A9C2B89424D039B400010EAE /* AESCipher */,
A9C2B89724D039B400010EAE /* TQNetworkTools.h */,
A9C2B89824D039B400010EAE /* ZJAESCommonCrypto.h */,
A9C2B89324D039B400010EAE /* ZJAESCommonCrypto.m */,
A9C2B89724D039B400010EAE /* TQNetworkTools.h */,
A9C2B89924D039B400010EAE /* TQNetworkTools.m */,
);
path = Network;
......
......@@ -3,17 +3,4 @@
uuid = "05A8EC5D-3D7B-4194-AF9F-73A026E946A1"
type = "0"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
<BreakpointContent
uuid = "C59D3D3D-C4C8-4509-B8B8-06E2EA4C9D35"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
scope = "1"
stopOnStyle = "0">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
......@@ -32,6 +32,9 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, copy) NSString * editNickName;
@property(nonatomic,assign)BOOL choose;
@end
NS_ASSUME_NONNULL_END
......@@ -16,6 +16,7 @@
#import "ZJReminderMainController.h"
#import "ZJAddReminderController.h"
#import "ZJUserInfoManager.h"
#import "ZJReminder.h"
@interface ZJGuardViewController ()<UICollectionViewDelegate, UICollectionViewDataSource>
......@@ -37,14 +38,15 @@
[super viewDidLoad];
_dataSource = [[NSMutableArray alloc] init];
_dataSource = @[@{@"title":@"多吃蔬菜", @"image":@"remind_cell_2_3"},
@{@"title":@"记得起床", @"image":@"remind_cell_3_2"},
@{@"title":@"多吃水果", @"image":@"remind_cell_2_0"},
@{@"title":@"多喝水", @"image":@"remind_cell_0_2"},
@{@"title":@"添加提醒", @"image":@"remind_cell_Add"}].mutableCopy;
// _dataSource = @[@{@"title":@"多吃蔬菜", @"image":@"remind_cell_2_3"},
// @{@"title":@"记得起床", @"image":@"remind_cell_3_2"},
// @{@"title":@"多吃水果", @"image":@"remind_cell_2_0"},
// @{@"title":@"多喝水", @"image":@"remind_cell_0_2"},
// @{@"title":@"添加提醒", @"image":@"remind_cell_Add"}].mutableCopy;
[self setUI];
[self getFriendList];
[self requestRemindList];
}
- (void)setUI{
......@@ -78,6 +80,26 @@
}
}
-(void)requestRemindList
{
[[TQNetworkTools shared] getWithAction:reminderTypeList parameters:@{} success:^(id _Nonnull response) {
if ([response[@"status"] intValue] == 200) {
[self.dataSource removeAllObjects];
if ([response[@"result"][@"data"] isKindOfClass:[NSArray class]]) {
for (NSDictionary *dict in response[@"result"][@"data"]) {
ZJChooseIcon *model = [ZJChooseIcon yy_modelWithJSON:dict];
[self.dataSource addObject:model];
}
ZJChooseIcon *model = [ZJChooseIcon yy_modelWithJSON:@{@"name":@"添加提醒", @"iconUrl":@"remind_cell_Add"}];
[self.dataSource addObject:model];
}
}
[self.collectView reloadData];
} failure:^(NSError * _Nonnull error) {
}];
}
#pragma mark 好友列表
- (void)getFriendList{
......@@ -144,10 +166,16 @@
ZJGuardCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"ZJGuardCell" forIndexPath:indexPath];
NSDictionary * dic = _dataSource[indexPath.item];
cell.iconImV.image = [UIImage imageNamed:[dic objectForKey:@"image"]];
cell.titleLab.text = [dic objectForKey:@"title"];
if (self.dataSource.count) {
ZJChooseIcon *model = _dataSource[indexPath.item];
if (indexPath.row == self.dataSource.count - 1) {
cell.iconImV.image = [UIImage imageNamed:model.iconUrl];
cell.titleLab.text = model.name;
}else{
[cell.iconImV sd_setImageWithURL:[NSURL URLWithString:model.iconUrl]];
cell.titleLab.text = model.name;
}
}
return cell;
}
......@@ -191,7 +219,8 @@
[self.navigationController pushViewController:vc animated:YES];
}else{
ZJReminderMainController *vc = [ZJReminderMainController new];
vc.title = _dataSource[indexPath.row][@"title"];
ZJChooseIcon *model = _dataSource[indexPath.item];
vc.model = model;
[self.navigationController pushViewController:vc animated:YES];
}
}
......
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097.2" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15510"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
......@@ -19,6 +19,10 @@
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="remind_cell_Add" translatesAutoresizingMaskIntoConstraints="NO" id="wdg-vm-tUc">
<rect key="frame" x="132.5" y="56.5" width="40" height="40"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="Cw1-FS-hD9"/>
<constraint firstAttribute="width" constant="40" id="skZ-oG-oDx"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mve-uo-rrt">
<rect key="frame" x="138.5" y="104.5" width="28.5" height="13.5"/>
......
......@@ -8,11 +8,13 @@
#import "ZJAddReminderController.h"
#import "ZJChooseIconController.h"
#import "ZJReminder.h"
@interface ZJAddReminderController ()
@property (weak, nonatomic) IBOutlet UITextField *textField;
@property (weak, nonatomic) IBOutlet UIImageView *icon;
@property(nonatomic,strong)ZJChooseIcon *chooseModel;
......@@ -33,11 +35,35 @@
[MBProgressHUD showMessage:@"请输入名称"];
return;
}
if (self.chooseModel == nil) {
[MBProgressHUD showMessage:@"请输入选择图片"];
return;
}
NSDictionary *dict = @{@"iconId":@(self.chooseModel.id),@"name":self.textField.text};
// dict[@"remindTypeInsert"] = @{@"iconId":@(self.chooseModel.id),@"name":self.textField.text};
[[TQNetworkTools shared] postWithBodyAction:reminderAddRemindType parameters:@{} body:dict success:^(NSDictionary * _Nonnull response) {
if ([response[@"status"] intValue] == 200) {
[self.navigationController popViewControllerAnimated:YES];
}else{
[MBProgressHUD showMessage:@"服务出错,请稍后重试!"];
}
} failure:^(NSError * _Nonnull error) {
}];
}
- (IBAction)addIconAction:(UIButton *)sender {
ZJChooseIconController *vc = [ZJChooseIconController new];
__weak typeof(self) weakSelf = self;
vc.backIcon = ^(ZJChooseIcon * _Nonnull model) {
weakSelf.chooseModel = model;
if (model.url) {
[weakSelf.icon sd_setImageWithURL:[NSURL URLWithString:model.url]];
}
};
[self.navigationController pushViewController:vc animated:YES];
}
......
......@@ -62,7 +62,7 @@
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_More" translatesAutoresizingMaskIntoConstraints="NO" id="nUU-By-QqR">
<rect key="frame" x="356" y="28" width="14" height="14"/>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="remind_cell_0_1" translatesAutoresizingMaskIntoConstraints="NO" id="nDX-Z7-3Jj">
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="nDX-Z7-3Jj">
<rect key="frame" x="311" y="20" width="30" height="30"/>
<constraints>
<constraint firstAttribute="width" constant="30" id="CGZ-kg-NZk"/>
......@@ -129,6 +129,5 @@
</objects>
<resources>
<image name="icon_More" width="14" height="14"/>
<image name="remind_cell_0_1" width="40" height="40"/>
</resources>
</document>
......@@ -10,8 +10,13 @@
NS_ASSUME_NONNULL_BEGIN
@class ZJChooseIcon;
@interface ZJChooseIconController : UIViewController
@property(nonatomic,copy)void (^backIcon)(ZJChooseIcon *model);
@end
NS_ASSUME_NONNULL_END
......@@ -8,6 +8,7 @@
#import "ZJChooseIconController.h"
#import "ZJChooseIconCell.h"
#import "ZJReminder.h"
@interface ZJChooseIconController ()<UICollectionViewDelegate,UICollectionViewDataSource>
......@@ -35,21 +36,55 @@
self.view.backgroundColor = [UIColor colorWithHexString:@"fafafa"];
[self.view addSubview:self.collectionView];
[self requestData];
}
-(void)requestData
{
[[TQNetworkTools shared] getWithAction:reminderIconList parameters:@{} success:^(id _Nonnull response) {
if ([response[@"status"] intValue] == 200) {
[self.dataArray removeAllObjects];
if ([response[@"result"][@"data"] isKindOfClass:[NSArray class]]) {
for (NSDictionary *dict in response[@"result"][@"data"]) {
ZJChooseIcon *model = [ZJChooseIcon yy_modelWithJSON:dict];
[self.dataArray addObject:model];
}
}
}
[self.collectionView reloadData];
} failure:^(NSError * _Nonnull error) {
}];
}
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
return 10;
return self.dataArray.count;
}
-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
ZJChooseIconCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath];
if (self.dataArray.count) {
ZJChooseIcon *model = self.dataArray[indexPath.row];
[cell.icon sd_setImageWithURL:[NSURL URLWithString:model.url]];
}
return cell;
}
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
if (self.dataArray.count) {
ZJChooseIcon *model = self.dataArray[indexPath.row];
if (self.backIcon) {
self.backIcon(model);
}
[self.navigationController popViewControllerAnimated:YES];
}
}
-(UICollectionView *)collectionView
{
......
......@@ -10,9 +10,10 @@
NS_ASSUME_NONNULL_BEGIN
@class ZJFriendModel;
@interface ZJReminderCareController : UIViewController
@property(nonatomic,copy)void (^backData)(NSString *data);
@property(nonatomic,copy)void (^backData)(ZJFriendModel *model);
@end
......
......@@ -8,6 +8,7 @@
#import "ZJReminderCareController.h"
#import "ZJReminderCareCell.h"
#import "ZJFriendModel.h"
static NSString * const ZJReminderCareCellID = @"ZJReminderCareCellID";
@interface ZJReminderCareController ()<UITableViewDataSource,UITableViewDelegate>
......@@ -53,14 +54,23 @@ static NSString * const ZJReminderCareCellID = @"ZJReminderCareCellID";
-(void)requestData
{
[self.dataArray removeAllObjects];
NSArray *res = @[@{@"name":@"关心的人",@"subName":@"选择关心的人"},
@{@"name":@"提醒图片",@"subName":@""},
@{@"name":@"提醒事项",@"subName":@"多吃蔬菜"},
@{@"name":@"提醒时间",@"subName":@""},
@{@"name":@"重复",@"subName":@"每天"}];
[self.dataArray addObjectsFromArray:res];
[self.tableView reloadData];
[[TQNetworkTools shared] getWithAction:findFriendList parameters:@{} success:^(id _Nonnull response) {
if([[response objectForKey:@"status"] integerValue] == 200){
if ([response[@"result"][@"data"] isKindOfClass:[NSArray class]]) {
for (NSDictionary *dict in response[@"result"][@"data"]) {
ZJFriendModel *model = [ZJFriendModel yy_modelWithJSON:dict];
[self.dataArray addObject:model];
}
}
}else{
[MBProgressHUD showError:[NSString stringWithFormat:@"%@", [response objectForKey:@"msg"]] toView:self.view];
}
[self.tableView reloadData];
} failure:^(NSError * _Nonnull error) {
}];
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
......@@ -73,6 +83,10 @@ static NSString * const ZJReminderCareCellID = @"ZJReminderCareCellID";
ZJReminderCareCell *cell = [tableView dequeueReusableCellWithIdentifier:ZJReminderCareCellID];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (self.dataArray.count) {
ZJFriendModel *model = self.dataArray[indexPath.row];
cell.model = model;
}
return cell;
}
......@@ -80,10 +94,16 @@ static NSString * const ZJReminderCareCellID = @"ZJReminderCareCellID";
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
ZJFriendModel *model = self.dataArray[indexPath.row];
model.choose = !model.choose;
if (self.backData) {
self.backData(@"关心的人");
self.backData(model);
}
[self.navigationController popViewControllerAnimated:YES];
[self.tableView reloadData];
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
......
......@@ -9,9 +9,11 @@
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@class ZJChooseIcon;
@interface ZJReminderCateAddController : UIViewController
@property(nonatomic,strong)ZJChooseIcon *model;
@end
NS_ASSUME_NONNULL_END
......@@ -12,6 +12,8 @@
#import "ZJReminderCareController.h"
#import "ZJReminderTimeController.h"
#import "QFTimePickerView.h"
#import "ZJFriendModel.h"
#import "ZJReminder.h"
static NSString * const ZJReminderCateAddCellID = @"ZJReminderCateAddCellID";
static NSString * const ZJReminderFooterViewID = @"ZJReminderFooterViewID";
......@@ -19,6 +21,9 @@ static NSString * const ZJReminderFooterViewID = @"ZJReminderFooterViewID";
@property(nonatomic,strong)UITableView *tableView;
@property(nonatomic,strong)NSMutableArray *dataArray;
@property(nonatomic,strong)ZJFriendModel *friendModel;
@property(nonatomic,copy)NSString *timeString;
@end
......@@ -58,13 +63,18 @@ static NSString * const ZJReminderFooterViewID = @"ZJReminderFooterViewID";
-(void)requestData
{
[self.dataArray removeAllObjects];
NSArray *res = @[@{@"name":@"关心的人",@"subName":@"选择关心的人"},
@{@"name":@"提醒图片",@"subName":@""},
@{@"name":@"提醒事项",@"subName":@"多吃蔬菜"},
@{@"name":@"提醒时间",@"subName":@""},
@{@"name":@"重复",@"subName":@"每天"}];
NSArray *names = @[@[@"关心的人",@"选择关心的人"],@[@"提醒图片",@""],@[@"提醒事项",@"多吃蔬菜"],@[@"提醒时间",@""],@[@"重复",@"每天"]];
for (int i = 0; i < names.count; i++) {
NSArray *sub = names[i];
ZJChooseIcon *model = [ZJChooseIcon new];
model.name = sub[0];
model.subName = sub[1];
if (i == 1) {
model.iconUrl = self.model.iconUrl;
}
[self.dataArray addObject:model];
}
[self.dataArray addObjectsFromArray:res];
[self.tableView reloadData];
}
......@@ -76,24 +86,39 @@ static NSString * const ZJReminderFooterViewID = @"ZJReminderFooterViewID";
-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
ZJReminderFooterView *footer = [tableView dequeueReusableHeaderFooterViewWithIdentifier:ZJReminderFooterViewID];
// footer.backgroundColor = [UIColor redColor];
[footer.saveBtn addTarget:self action:@selector(saveButtonAction:) forControlEvents:UIControlEventTouchUpInside];
return footer;
}
-(void)saveButtonAction:(UIButton *)sender
{
if (self.timeString.length == 0) {
[MBProgressHUD showMessage:@"请选择时间"];
return;
}
NSMutableDictionary *dict = @{}.mutableCopy;
// @{@"typeId":@"1", @"status":sender.selected?@"1":@"0", @"friendId":[NSString stringWithFormat:@"%ld", (long)model.friendId], @"id":[NSString stringWithFormat:@"%ld", (long)model.id]}
dict[@"typeId"] = @(self.model.id);
dict[@"friendId"] = self.friendModel.id;
dict[@"remindTime"] = self.timeString;
dict[@"weekSetting"] = @"";
[[TQNetworkTools shared] postWithBodyAction:userRemindInfoSet parameters:@{} body:dict success:^(NSDictionary * _Nonnull response) {
} failure:^(NSError * _Nonnull error) {
}];
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
ZJReminderCateAddCell *cell = [tableView dequeueReusableCellWithIdentifier:ZJReminderCateAddCellID];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (self.dataArray.count) {
cell.icon.hidden = indexPath.row == 1 ? NO : YES;
cell.subName.hidden = !cell.icon.hidden;
cell.arrow.hidden = (indexPath.row == 1 || indexPath.row == 2) ? YES : NO;
NSDictionary *dict = self.dataArray[indexPath.row];
cell.name.text = dict[@"name"];
cell.subName.text = dict[@"subName"];
ZJChooseIcon *model = self.dataArray[indexPath.row];
[cell reloadData:model indexPath:indexPath];
}
return cell;
......@@ -107,8 +132,14 @@ static NSString * const ZJReminderFooterViewID = @"ZJReminderFooterViewID";
case 0:
{// 关心的人
ZJReminderCareController *vc = [ZJReminderCareController new];
vc.backData = ^(NSString * _Nonnull data) {
__weak typeof(self) weakSelf = self;
vc.backData = ^(ZJFriendModel * _Nonnull model) {
weakSelf.friendModel = model;
if (weakSelf.dataArray.count) {
ZJChooseIcon *item = weakSelf.dataArray[0];
item.subName = model.phoneNo;
}
[weakSelf.tableView reloadData];
};
[self.navigationController pushViewController:vc animated:YES];
}
......@@ -125,9 +156,17 @@ static NSString * const ZJReminderFooterViewID = @"ZJReminderFooterViewID";
break;
case 3:
{// 提醒时间
__weak typeof(self) weakSelf = self;
QFTimePickerView *pickerView = [[QFTimePickerView alloc] initDatePackerWithStartHour:@"00" endHour:@"24" period:1 response:^(NSString *str) {
NSString *string = str;
NSLog(@"str = %@",string);
if ([str containsString:@"时"] && [str containsString:@"分"]) {
weakSelf.timeString = [str stringByReplacingOccurrencesOfString:@"时" withString:@""];
weakSelf.timeString = [weakSelf.timeString stringByReplacingOccurrencesOfString:@"分" withString:@""];
}
if (weakSelf.dataArray.count > 3) {
ZJChooseIcon *item = weakSelf.dataArray[3];
item.subName = weakSelf.timeString;
}
[weakSelf.tableView reloadData];
}];
[pickerView show];
}
......
......@@ -10,8 +10,12 @@
NS_ASSUME_NONNULL_BEGIN
@class ZJChooseIcon;
@interface ZJReminderMainController : UIViewController
@property(nonatomic,strong)ZJChooseIcon *model;
@end
NS_ASSUME_NONNULL_END
......@@ -37,6 +37,9 @@ static NSString *ZJReminderMainCellID = @"ZJReminderMainCellID";
[super viewDidLoad];
// Do any additional setup after loading the view.
if (self.model) {
self.title = self.model.name;
}
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"管理" style:UIBarButtonItemStyleDone target:self action:@selector(chooseAction)];
self.navigationItem.rightBarButtonItem.tintColor = [UIColor blackColor];
......@@ -75,6 +78,7 @@ static NSString *ZJReminderMainCellID = @"ZJReminderMainCellID";
}else{
NSLog(@"添加提醒");
ZJReminderCateAddController *vc = [ZJReminderCateAddController new];
vc.model = self.model;
[weakSelf.navigationController pushViewController:vc animated:YES];
}
};
......@@ -111,13 +115,21 @@ static NSString *ZJReminderMainCellID = @"ZJReminderMainCellID";
-(void)requestData
{
for (int i = 0; i < 10; i++) {
ZJReminder *model = [ZJReminder new];
model.choose = NO;
[self.dataArray addObject:model];
}
if (self.model == nil) return;
[[TQNetworkTools shared] getWithAction:userRemindInfo parameters:@{@"typeId":@(self.model.id)} success:^(id _Nonnull response) {
if([[response objectForKey:@"status"] integerValue] == 200){
}else{
[MBProgressHUD showError:[NSString stringWithFormat:@"%@", response[@"msg"]] toView:self.view];
}
[self.tableView reloadData];
} failure:^(NSError * _Nonnull error) {
}];
[self.tableView reloadData];
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
......
......@@ -107,13 +107,8 @@ static NSString * const ZJReminderTimeCellID = @"ZJReminderTimeCellID";
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
for (int i = 0; i < self.dataArray.count; i++) {
ZJReminderTime *model = self.dataArray[indexPath.row];
if (i == indexPath.row) {
model.choose = !model.choose;
}
}
ZJReminderTime *model = self.dataArray[indexPath.row];
model.choose = !model.choose;
[self.tableView reloadData];
}
......
......@@ -172,9 +172,7 @@
if (sender.tag == 10) {
[self dismiss];
} else {
restr = [NSString stringWithFormat:@"%@:%@",selectedHour,selectedMin];
backBlock(restr);
[self dismiss];
}
......@@ -186,7 +184,7 @@
[[UIApplication sharedApplication].keyWindow addSubview:self];
[UIView animateWithDuration:0.4 animations:^{
contentView.center = CGPointMake(self.frame.size.width/2, contentView.center.y - contentView.frame.size.height);
self->contentView.center = CGPointMake(self.frame.size.width/2, self->contentView.center.y - self->contentView.frame.size.height);
}];
}
......@@ -194,7 +192,7 @@
- (void)dismiss{
[UIView animateWithDuration:0.4 animations:^{
contentView.center = CGPointMake(self.frame.size.width/2, contentView.center.y + contentView.frame.size.height);
self->contentView.center = CGPointMake(self.frame.size.width/2, self->contentView.center.y + self->contentView.frame.size.height);
} completion:^(BOOL finished) {
[self removeFromSuperview];
}];
......
......@@ -26,7 +26,15 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic,assign)BOOL choose;
@end
@interface ZJChooseIcon : NSObject
@property(nonatomic,assign)NSInteger id;
@property(nonatomic,copy)NSString *url;
@property(nonatomic,copy)NSString *iconUrl;
@property(nonatomic,copy)NSString *name;
@property(nonatomic,copy)NSString *subName;
@end
......
......@@ -15,3 +15,7 @@
@implementation ZJReminderTime
@end
@implementation ZJChooseIcon
@end
......@@ -12,6 +12,9 @@ NS_ASSUME_NONNULL_BEGIN
@interface ZJChooseIconCell : UICollectionViewCell
@property (weak, nonatomic) IBOutlet UIImageView *icon;
@end
NS_ASSUME_NONNULL_END
......@@ -30,6 +30,9 @@
<constraint firstItem="nuB-Rn-VdK" firstAttribute="centerY" secondItem="gTV-IL-0wX" secondAttribute="centerY" id="yDR-GO-KrF"/>
</constraints>
<size key="customSize" width="91" height="108"/>
<connections>
<outlet property="icon" destination="nuB-Rn-VdK" id="rEb-zm-eut"/>
</connections>
<point key="canvasLocation" x="167.39130434782609" y="119.19642857142857"/>
</collectionViewCell>
</objects>
......
......@@ -10,6 +10,7 @@
NS_ASSUME_NONNULL_BEGIN
@class ZJFriendModel;
@interface ZJReminderCareCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UIImageView *icon;
......@@ -18,6 +19,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (weak, nonatomic) IBOutlet UIView *baseView;
@property (weak, nonatomic) IBOutlet UIView *mainView;
@property (weak, nonatomic) IBOutlet UIImageView *iconSelect;
@property(nonatomic,strong)ZJFriendModel *model;
......
......@@ -7,6 +7,7 @@
//
#import "ZJReminderCareCell.h"
#import "ZJFriendModel.h"
@implementation ZJReminderCareCell
......@@ -30,4 +31,15 @@
// Configure the view for the selected state
}
-(void)setModel:(ZJFriendModel *)model
{
_model = model;
[self.icon sd_setImageWithURL:[NSURL URLWithString:model.headImage]];
self.name.text = model.phoneNo;
self.iconSelect.image = model.choose ? [UIImage imageNamed:@"caring_person_listed"] : [UIImage imageNamed:@"caring_person_list"];
}
@end
......@@ -10,6 +10,7 @@
NS_ASSUME_NONNULL_BEGIN
@class ZJChooseIcon;
@interface ZJReminderCateAddCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UILabel *name;
......@@ -17,6 +18,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (weak, nonatomic) IBOutlet UIImageView *icon;
@property (weak, nonatomic) IBOutlet UIImageView *arrow;
-(void)reloadData:(ZJChooseIcon *)model indexPath:(NSIndexPath *)indexPath;
@end
......
......@@ -7,6 +7,7 @@
//
#import "ZJReminderCateAddCell.h"
#import "ZJReminder.h"
@interface ZJReminderCateAddCell ()
......@@ -25,4 +26,27 @@
// Configure the view for the selected state
}
-(void)reloadData:(ZJChooseIcon *)model indexPath:(NSIndexPath *)indexPath
{
self.icon.hidden = indexPath.row == 1 ? NO : YES;
self.subName.hidden = !self.icon.hidden;
self.arrow.hidden = (indexPath.row == 1 || indexPath.row == 2) ? YES : NO;
self.name.text = model.name;
self.subName.text = model.subName;
if (indexPath.row == 1) {
[self.icon sd_setImageWithURL:[NSURL URLWithString:model.iconUrl]];
}else{
[self.icon sd_setImageWithURL:[NSURL URLWithString:@""]];
}
if (indexPath.row == 3) {
self.subName.textColor = [UIColor colorWithHexString:@"528BFF"];
}else{
self.subName.textColor = [UIColor colorWithHexString:@"999999"];
}
}
@end
......@@ -35,7 +35,7 @@
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="remind_cell_0_0" translatesAutoresizingMaskIntoConstraints="NO" id="IY7-bN-UvX">
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="IY7-bN-UvX">
<rect key="frame" x="307" y="15" width="30" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="Dkr-Rp-0Vh"/>
......@@ -78,6 +78,5 @@
</objects>
<resources>
<image name="icon_More" width="14" height="14"/>
<image name="remind_cell_0_0" width="40" height="40"/>
</resources>
</document>
......@@ -46,7 +46,9 @@ typedef enum : NSUInteger {
PaymentConfiguration,//支付配置
payPageData,//支付页面数据
addFriendHintStyle, //用户注销
userRemindInfo //用户提醒列表信息 typeId = 1 电量
userRemindInfo, //用户提醒列表信息 typeId = 1 电量
reminderIconList, // 图标列表
reminderTypeList
} TQNetwortGetAction;
......@@ -93,7 +95,8 @@ typedef enum : NSUInteger {
iosIPAVerifyReceipt,
logCollection, //埋点
userRemindInfoSet //上报用户提醒信息
userRemindInfoSet, //上报用户提醒信息
reminderAddRemindType // 添加提醒类型
} TQNetwortPostAction;
......
......@@ -329,6 +329,10 @@ static TQNetworkTools* _tools = nil;
return @"/app/v1/location/reminder-copywriting";
case userRemindInfo:
return @"/app/v1/location/remind-list";
case reminderIconList:
return @"/app/v1/location/remind/icon-list";
case reminderTypeList:
return @"/app/v1/location/remind/remind-type";
default:
return @"";
}
......@@ -401,6 +405,8 @@ static TQNetworkTools* _tools = nil;
return @"/logCollection/log/v1/userLogCollection";
case userRemindInfoSet:
return @"/app/v1/location/remind/remind";
case reminderAddRemindType:
return @"/app/v1/location/remind/add-remind-type";
default:
return @"";
}
......
File added
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