Initial commit
This commit is contained in:
Binary file not shown.
+13
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// IfishUsersActivityListController.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 2017/5/11.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "BaseVIewContorller.h"
|
||||
|
||||
@interface IfishUsersActivityListController : BaseVIewContorller
|
||||
|
||||
@end
|
||||
+229
@@ -0,0 +1,229 @@
|
||||
//
|
||||
// IfishUsersActivityListController.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 2017/5/11.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IfishUsersActivityListController.h"
|
||||
#import "IFishUserActivityData.h"
|
||||
#import "IFishUserActivityListCell.h"
|
||||
#import "FishActivityData.h"
|
||||
#import "JHRefresh.h"
|
||||
#import "IfishUserDefaultHelper.h"
|
||||
const float ActivityPageSize = 20;
|
||||
@interface IfishUsersActivityListController ()<UITableViewDelegate,UITableViewDataSource>
|
||||
@property (nonatomic,strong) UITableView *tableView;
|
||||
@property (nonatomic,strong) NSMutableArray *dataArr;
|
||||
@property (nonatomic,strong) NSMutableArray *activTypes;
|
||||
@property (nonatomic) NSInteger firstResult;
|
||||
@property(nonatomic,copy) NSString* total;
|
||||
@property(nonatomic)BOOL isLoadMore;
|
||||
@property(nonatomic) int page;
|
||||
@end
|
||||
|
||||
@implementation IfishUsersActivityListController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
[self addTitleViewWithTitle:@"实时动态"];
|
||||
_dataArr =[[NSMutableArray alloc] init];
|
||||
_page = 0;
|
||||
[self loadActypes];
|
||||
[self creatTab];
|
||||
[self requestListData];
|
||||
[self creatReatRefreshView];
|
||||
}
|
||||
|
||||
-(void)loadActypes{
|
||||
_activTypes = [[NSMutableArray alloc] init];
|
||||
NSString *filePath = [[NSBundle mainBundle]pathForResource:@"ActivityData" ofType:@"json"];
|
||||
NSData *data = [[NSData alloc]initWithContentsOfFile:filePath];
|
||||
NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
|
||||
|
||||
NSArray*typeListArr = [dic objectForKey:@"data"];;
|
||||
for (NSDictionary *typedict in typeListArr ) {
|
||||
FishActivityData *model = [[FishActivityData alloc] initWithDict:typedict];
|
||||
[_activTypes addObject:model];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-(void)requestListData{
|
||||
|
||||
NSString *useriD= [dataContorl dataControlGetUserIdInfo];
|
||||
NSInteger pageSize = ActivityPageSize ;
|
||||
_firstResult = 0;
|
||||
__weak typeof (self)weakSelf = self;
|
||||
[AFHttpTool getUserActivity:useriD pageSize:pageSize firstResult:_firstResult success:^(id response) {
|
||||
NSDictionary *reDic=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil];
|
||||
|
||||
if ([reDic[@"result"] isEqualToString:@"100"]){
|
||||
|
||||
_total = [reDic objectForKey:@"total"];
|
||||
NSArray *daA =reDic[@"data"];
|
||||
for (NSDictionary *dic in daA) {
|
||||
|
||||
IFishUserActivityData *data = [[IFishUserActivityData alloc] initWithDict:dic];
|
||||
[_dataArr addObject:data];
|
||||
}
|
||||
//存储当前最大Id
|
||||
IFishUserActivityData *data = _dataArr[0];
|
||||
[IfishUserDefaultHelper saveUserActivityMaxId:data.activityId];
|
||||
|
||||
[weakSelf.tableView reloadData];
|
||||
}else{
|
||||
[weakSelf.view makeToast:@"请求失败"];
|
||||
}
|
||||
|
||||
} failure:^(NSError *err) {
|
||||
|
||||
[weakSelf.view makeToast:@"请求异常"];
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
-(void)creatTab{
|
||||
|
||||
self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0,0,self.view.frame.size.width,self.view.frame.size.height) style:UITableViewStyleGrouped];
|
||||
self.tableView.delegate = self;
|
||||
self.tableView.dataSource = self;
|
||||
self.tableView.scrollEnabled = YES;
|
||||
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
self.tableView.showsVerticalScrollIndicator = NO;
|
||||
self.tableView.backgroundColor = RGB(242, 242, 242);
|
||||
[self.view addSubview:self.tableView];
|
||||
|
||||
}
|
||||
|
||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||
|
||||
return self.dataArr.count;
|
||||
|
||||
}
|
||||
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
|
||||
IFishUserActivityListCell *cell = [tableView dequeueReusableCellWithIdentifier:@"IFishUserActivityListCell"];
|
||||
if (!cell) {
|
||||
cell = [[[NSBundle mainBundle]loadNibNamed:@"IFishUserActivityListCell" owner:self options:nil]lastObject];
|
||||
|
||||
}
|
||||
IFishUserActivityData *data = _dataArr[indexPath.section];
|
||||
[cell loadDataWith:data typeArr:_activTypes];
|
||||
return cell;
|
||||
}
|
||||
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
|
||||
return 124;
|
||||
}
|
||||
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
|
||||
|
||||
if (section==0) {
|
||||
return 0.01;
|
||||
}else{
|
||||
|
||||
return 10;
|
||||
}
|
||||
}
|
||||
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
|
||||
|
||||
return 0.01;
|
||||
}
|
||||
|
||||
-(void)creatReatRefreshView{
|
||||
__weak typeof (self)weskSelf=self;
|
||||
|
||||
//上拉加载更多
|
||||
|
||||
[weskSelf.tableView addRefreshFooterViewWithAniViewClass:[JHRefreshCommonAniView class] beginRefresh:^{
|
||||
if (weskSelf.isLoadMore) {
|
||||
return ;
|
||||
}
|
||||
weskSelf.isLoadMore=YES;
|
||||
|
||||
NSInteger pagecount =[_total integerValue]/ActivityPageSize + 1;
|
||||
if (_page<pagecount-1) {
|
||||
_page++;
|
||||
//firstResult 服务器返回数据知道总数total 获取分页数据 暂不需要
|
||||
NSInteger first=(NSInteger)_page*ActivityPageSize ;
|
||||
NSInteger pageSize= ActivityPageSize ;
|
||||
[weskSelf addTaskWithfirsStr:first pageSize:pageSize isRefresh:NO];
|
||||
|
||||
}else{
|
||||
[weskSelf endRefreshing];
|
||||
[weskSelf.view makeToast:@"已无更多数据"];
|
||||
}
|
||||
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
-(void)endRefreshing{
|
||||
|
||||
if (self.isLoadMore) {
|
||||
self.isLoadMore=NO;
|
||||
[self.tableView footerEndRefreshing];
|
||||
}
|
||||
}
|
||||
-(void)addTaskWithfirsStr:(NSInteger)firsStr pageSize:(NSInteger)pageSize isRefresh:(BOOL)isRefresh{
|
||||
|
||||
__weak typeof (self)weskSelf=self;
|
||||
|
||||
NSString *userId= [dataContorl dataControlGetUserIdInfo];
|
||||
[AFHttpTool getUserActivity:userId pageSize:pageSize firstResult:firsStr success:^(id response) {
|
||||
|
||||
NSDictionary *reDic=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil];
|
||||
// if (isRefresh) {
|
||||
// [weskSelf.dataArr removeAllObjects];
|
||||
// }
|
||||
|
||||
if ([reDic[@"result"] isEqualToString:@"100"]) {
|
||||
|
||||
NSArray *daA =reDic[@"data"];
|
||||
for (NSDictionary *dic in daA) {
|
||||
|
||||
IFishUserActivityData *data = [[IFishUserActivityData alloc] initWithDict:dic];
|
||||
[_dataArr addObject:data];
|
||||
}
|
||||
_total = reDic[@"total"];
|
||||
[weskSelf.tableView reloadData];
|
||||
|
||||
}else{
|
||||
[weskSelf.view makeToast:@"请求失败"];
|
||||
}
|
||||
[weskSelf endRefreshing];
|
||||
|
||||
} failure:^(NSError *err) {
|
||||
[weskSelf endRefreshing];
|
||||
[weskSelf.view makeToast:@"没有加载成功"];
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
- (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
|
||||
@@ -0,0 +1,112 @@
|
||||
{
|
||||
|
||||
"data":[
|
||||
{
|
||||
"activityType":"everyDaySignin",
|
||||
"typeTitle":"签到",
|
||||
"typeDetail":"小手一抖,金币到手~还不快去签到"
|
||||
},
|
||||
{
|
||||
"activityType":"readInformation",
|
||||
"typeTitle":"阅读资讯",
|
||||
"typeDetail":"我刚刚阅读了一条资讯,嗯,离大神又更近了一步!"
|
||||
},
|
||||
{
|
||||
"activityType":"openGoodsLink",
|
||||
"typeTitle":"查看商品",
|
||||
"typeDetail":"我刚刚查看了一个商品,真是物美价廉,我瞎说的,不信你自己去看~"
|
||||
},
|
||||
{
|
||||
"activityType":"roomLeaveMsg",
|
||||
"typeTitle":"爱鱼看看",
|
||||
"typeDetail":"我刚刚在爱鱼看看留了个言,鱼友分享的视频真不错"
|
||||
},
|
||||
{
|
||||
"activityType":"ifishCommunity",
|
||||
"typeTitle":"爱鱼圈",
|
||||
"typeDetail":"刚刚在爱鱼圈和鱼友们交流,感觉这次真的找到组织了~"
|
||||
},
|
||||
{
|
||||
"activityType":"shareIfishApp",
|
||||
"typeTitle":"分享app",
|
||||
"typeDetail":"水族黑科技,尽在爱鱼奇!"
|
||||
},
|
||||
{
|
||||
"activityType":"shareCameraPicture",
|
||||
"typeTitle":"图片分享",
|
||||
"typeDetail":"我刚刚分享了一张图片到朋友圈,好东西要和大家一起分享~"
|
||||
},
|
||||
{
|
||||
"activityType":"shareLookReport",
|
||||
"typeTitle":"看护报告",
|
||||
"typeDetail":"我刚刚分享了看护报告到朋友圈,这么好玩的东西,你值得拥有~"
|
||||
},
|
||||
{
|
||||
"activityType":"rename",
|
||||
"typeTitle":"更换姓名",
|
||||
"typeDetail":"我刚刚改了名字,牛气吧~"
|
||||
},
|
||||
{
|
||||
"activityType":"uploadHeadImg",
|
||||
"typeTitle":"上传头像",
|
||||
"typeDetail":"有图有真相,我美丽我自豪~"
|
||||
},
|
||||
{
|
||||
"activityType":"openShareCamera",
|
||||
"typeTitle":"开启分享",
|
||||
"typeDetail":"妈妈说,好东西要和别人分享,这样就能收获双份的快乐~"
|
||||
},
|
||||
{
|
||||
"activityType":"choiceLookShops",
|
||||
"typeTitle":"优选商家",
|
||||
"typeDetail":"终于逮着一个商家帮我看护了,哈哈,从此爱鱼不愁~"
|
||||
},
|
||||
{
|
||||
"activityType":"ifishDoctor",
|
||||
"typeTitle":"鱼医生",
|
||||
"typeDetail":"我刚刚在鱼医生问了一个问题,养鱼有问题?来问鱼医生呀~"
|
||||
},
|
||||
{
|
||||
"activityType":"everyDayLogin",
|
||||
"typeTitle":"登陆",
|
||||
"typeDetail":"小伙伴们我又来了,你们坐稳了~"
|
||||
},
|
||||
{
|
||||
"activityType":"registerGive",
|
||||
"typeTitle":"注册",
|
||||
"typeDetail":"历经千辛万苦,终于找到组织了!"
|
||||
},
|
||||
{
|
||||
"activityType":"bindDevice",
|
||||
"typeTitle":"水族箱",
|
||||
"typeDetail":"我刚刚添加了水族箱,从此开启智能生活~"
|
||||
},
|
||||
{
|
||||
"activityType":"bindCamera",
|
||||
"typeTitle":"摄像头",
|
||||
"typeDetail":"我刚刚添加了摄像头,从此爱鱼尽收眼底!"
|
||||
},
|
||||
{
|
||||
"activityType":"warningByTemperature",
|
||||
"typeTitle":"温度预警",
|
||||
"typeDetail":"我的鱼缸刚刚温度超过了我设定了的范围,还好有温度预警,及时提醒,防范未然~!"
|
||||
},
|
||||
{
|
||||
"activityType":"reminderByChangeWater",
|
||||
"typeTitle":"换水提醒",
|
||||
"typeDetail":"我刚刚收到了换水提醒,再也不怕忘记换水了,哈哈,真不错~!"
|
||||
},
|
||||
{
|
||||
"activityType":"merchantsSettled",
|
||||
"typeTitle":"商家入驻",
|
||||
"typeDetail":"经过层层审核,终于完成了入驻,鱼友们大家好,很高心能为大家服务~"
|
||||
},
|
||||
|
||||
{
|
||||
"activityType":"upgrade",
|
||||
"typeTitle":"升级",
|
||||
"typeDetail":"哟哟~我刚刚华丽丽的升级了,快来膜拜吧~"
|
||||
},
|
||||
]
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// FishActivityData.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 2017/5/12.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface FishActivityData : NSObject
|
||||
@property (nonatomic,copy) NSString *activityType;
|
||||
@property (nonatomic,copy) NSString *typeTitle;
|
||||
@property (nonatomic,copy) NSString *typeDetail;
|
||||
-(instancetype)initWithDict:(NSDictionary *)dict;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// FishActivityData.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 2017/5/12.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "FishActivityData.h"
|
||||
|
||||
@implementation FishActivityData
|
||||
|
||||
-(instancetype)initWithDict:(NSDictionary *)dict
|
||||
{
|
||||
if (self = [super init]) {
|
||||
_activityType = [dict objectForKey:@"activityType"];
|
||||
_typeTitle = [dict objectForKey:@"typeTitle"];
|
||||
_typeDetail = [dict objectForKey:@"typeDetail"];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@end
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// IFishUserActivityData.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 2017/5/11.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface IFishUserActivityData : NSObject
|
||||
@property (nonatomic,copy) NSString *activityId;
|
||||
@property (nonatomic,copy) NSString *userId;
|
||||
@property (nonatomic,copy) NSString *userImg;
|
||||
@property (nonatomic,copy) NSString *nickName;
|
||||
@property (nonatomic,copy) NSString *gradeNum;
|
||||
@property (nonatomic,copy) NSString *activityType;
|
||||
@property (nonatomic,copy) NSString *createTime;
|
||||
-(instancetype)initWithDict:(NSDictionary *)dict;
|
||||
@end
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// IFishUserActivityData.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 2017/5/11.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IFishUserActivityData.h"
|
||||
|
||||
@implementation IFishUserActivityData
|
||||
|
||||
-(instancetype)initWithDict:(NSDictionary *)dict
|
||||
{
|
||||
if (self =[super init]) {
|
||||
|
||||
_activityId = [dict objectForKey:@"activityId"];
|
||||
_userId = [dict objectForKey:@"userId"];
|
||||
_userImg = [dict objectForKey:@"userImg"];
|
||||
_nickName = [dict objectForKey:@"nickName"];
|
||||
_gradeNum = [dict objectForKey:@"gradeNum"];
|
||||
_activityType = [dict objectForKey:@"activityType"];
|
||||
_createTime = [dict objectForKey:@"create_time"];
|
||||
|
||||
}
|
||||
return self;
|
||||
|
||||
}
|
||||
@end
|
||||
Binary file not shown.
+14
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// IFishActivityCateView.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 2017/5/12.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface IFishActivityCateView : UIView
|
||||
-(void)activityViewaddTitle:(NSString *)title;
|
||||
|
||||
@end
|
||||
+134
@@ -0,0 +1,134 @@
|
||||
//
|
||||
// IFishActivityCateView.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 2017/5/12.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IFishActivityCateView.h"
|
||||
@interface IFishActivityCateView ()
|
||||
@property (nonatomic,strong) UILabel *textLabe;
|
||||
@property (nonatomic,strong) UIView *circleView;
|
||||
|
||||
@end
|
||||
|
||||
@implementation IFishActivityCateView
|
||||
|
||||
-(id)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
|
||||
[self creatSub];
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)awakeFromNib{
|
||||
[super awakeFromNib];
|
||||
[self creatSub];
|
||||
}
|
||||
|
||||
-(void)layoutSubviews{
|
||||
|
||||
[super layoutSubviews];
|
||||
|
||||
}
|
||||
|
||||
-(void)creatSub{
|
||||
|
||||
if (!_circleView) {
|
||||
_circleView = [[UIView alloc] init];
|
||||
|
||||
[self addSubview:_circleView];
|
||||
}
|
||||
if (!_textLabe) {
|
||||
_textLabe = [[UILabel alloc] init];
|
||||
_textLabe.textAlignment = NSTextAlignmentLeft;
|
||||
_textLabe.textColor = [UIColor whiteColor];
|
||||
_textLabe.font = [UIFont systemFontOfSize:12];
|
||||
[self addSubview:_textLabe];
|
||||
}
|
||||
|
||||
UIColor *color = [self loadrandomColor];
|
||||
_textLabe.backgroundColor = color;
|
||||
_circleView.backgroundColor = color;
|
||||
|
||||
}
|
||||
|
||||
-(UIColor *)loadrandomColor
|
||||
{
|
||||
UIColor *color = nil;
|
||||
int i = (arc4random()%4) + 1;// 设置随机色
|
||||
switch (i) {
|
||||
case 1:
|
||||
{
|
||||
color = RGB(113, 219, 254);
|
||||
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
color = RGB(255, 117, 156);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
color = RGB(255, 175, 117);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
color = RGB(117, 198, 255);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
|
||||
-(void)activityViewaddTitle:(NSString *)title
|
||||
{
|
||||
_textLabe.text = title;
|
||||
|
||||
CGFloat strW = [self widthForString:title fontSize:12 andHeight:self.frame.size.height];
|
||||
CGFloat labeW= strW + 15;
|
||||
_textLabe.frame = CGRectMake(self.frame.size.width-labeW, 0, labeW, self.frame.size.height);
|
||||
_circleView.frame = CGRectMake(self.frame.size.width-labeW - self.frame.size.height/2,0, self.frame.size.height, self.frame.size.height);
|
||||
[self bringSubviewToFront:_textLabe];
|
||||
_circleView.layer.masksToBounds = YES;
|
||||
_circleView.layer.cornerRadius = self.frame.size.height/2;
|
||||
|
||||
}
|
||||
|
||||
#pragma -mark -functions
|
||||
|
||||
//获取字符串的宽度
|
||||
-(float) widthForString:(NSString *)value fontSize:(float)fontSize andHeight:(float)height
|
||||
{
|
||||
|
||||
CGRect rect = [value boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, height) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:fontSize]} context:nil];
|
||||
|
||||
CGSize sizeToFit = rect.size;
|
||||
|
||||
return sizeToFit.width;
|
||||
|
||||
}
|
||||
|
||||
//获得字符串的高度
|
||||
-(float) heightForString:(NSString *)value fontSize:(float)fontSize andWidth:(float)width
|
||||
{
|
||||
|
||||
CGRect rect = [value boundingRectWithSize:CGSizeMake(width, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:fontSize]} context:nil];
|
||||
CGSize sizeToFit = rect.size;
|
||||
return sizeToFit.height;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// IFishUserActivityListCell.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 2017/5/12.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "IFishActivityCateView.h"
|
||||
#import "IFishUserActivityData.h"
|
||||
@interface IFishUserActivityListCell : UITableViewCell
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *userImg;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *levelLabel;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *nameLab;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *timeLabe;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *descLabe;
|
||||
@property (weak, nonatomic) IBOutlet IFishActivityCateView *noteView;
|
||||
-(void)loadDataWith:(IFishUserActivityData*)data typeArr:(NSMutableArray *)typArr;
|
||||
@end
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
//
|
||||
// IFishUserActivityListCell.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 2017/5/12.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IFishUserActivityListCell.h"
|
||||
#import "UIImageView+WebCache.h"
|
||||
#import "FishActivityData.h"
|
||||
@implementation IFishUserActivityListCell
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
self.userImg.layer.masksToBounds = YES;
|
||||
self.userImg.layer.cornerRadius = self.userImg.frame.size.width/2;
|
||||
|
||||
}
|
||||
|
||||
-(void)layoutSubviews{
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void)loadDataWith:(IFishUserActivityData*)data typeArr:(NSMutableArray *)typArr{
|
||||
|
||||
|
||||
NSString*strUrl=[NSString stringWithFormat:@"%@%@",kGetIconUrl,data.userImg];
|
||||
[self.userImg sd_setImageWithURL:[NSURL URLWithString:strUrl] placeholderImage:[UIImage imageNamed:@"live_hold.png"]];
|
||||
self.levelLabel.text = [NSString stringWithFormat:@"LV%@",data.gradeNum];
|
||||
self.nameLab.text = data.nickName;
|
||||
NSString *dateStr = [NSString stringWithFormat:@"%@",data.createTime];
|
||||
NSDate *date = [dataContorl formatDateTime:dateStr];
|
||||
//NSLog(@"date***%@****",date);
|
||||
|
||||
NSString *riqi =[dataContorl getMonthAndDay:date];
|
||||
NSString *time = [dataContorl getHmWithDate:date];
|
||||
self.timeLabe.text = [NSString stringWithFormat:@"%@ %@",riqi,time];
|
||||
//self.timeLabe.text = data.createTime;
|
||||
for (FishActivityData *typ in typArr) {
|
||||
if ([data.activityType isEqualToString:typ.activityType]) {
|
||||
|
||||
self.descLabe.text = typ.typeDetail;
|
||||
|
||||
[self.noteView activityViewaddTitle:typ.typeTitle];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||
[super setSelected:selected animated:animated];
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
@end
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
|
||||
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="IFishUserActivityListCell" id="KGk-i7-Jjw" customClass="IFishUserActivityListCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="124"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="123"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="yCp-Pc-niT">
|
||||
<rect key="frame" x="15" y="19" width="43" height="43"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="43" id="K1h-6R-dgq"/>
|
||||
<constraint firstAttribute="width" constant="43" id="utS-Lc-5nb"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="MC2-dj-tQV">
|
||||
<rect key="frame" x="15" y="70" width="43" height="21"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="43" id="O0H-Fu-MQP"/>
|
||||
<constraint firstAttribute="height" constant="21" id="spG-aM-uyY"/>
|
||||
</constraints>
|
||||
<attributedString key="attributedText">
|
||||
<fragment content="Label">
|
||||
<attributes>
|
||||
<color key="NSColor" red="1" green="0.87058823529411766" blue="0.34901960784313724" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<font key="NSFont" size="15" name="GillSans-BoldItalic"/>
|
||||
<paragraphStyle key="NSParagraphStyle" alignment="center" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
|
||||
</attributes>
|
||||
</fragment>
|
||||
</attributedString>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="j4H-3i-r5P">
|
||||
<rect key="frame" x="66" y="19" width="44" height="21"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="21" id="E4g-ow-Bbo"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="18"/>
|
||||
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="o4z-Rh-bJE">
|
||||
<rect key="frame" x="66" y="44" width="31" height="15"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="15" id="ehn-eA-OyR"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="12"/>
|
||||
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Rvn-dY-yD4" customClass="IFishActivityCateView">
|
||||
<rect key="frame" x="207" y="13" width="113" height="18"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="113" id="prU-qW-zDS"/>
|
||||
<constraint firstAttribute="height" constant="18" id="zt9-Kb-dri"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="3" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ncX-Ol-5UJ">
|
||||
<rect key="frame" x="66" y="75" width="230" height="16"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="13"/>
|
||||
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="MC2-dj-tQV" firstAttribute="top" secondItem="yCp-Pc-niT" secondAttribute="bottom" constant="8" id="3rn-Yu-isb"/>
|
||||
<constraint firstItem="o4z-Rh-bJE" firstAttribute="top" secondItem="j4H-3i-r5P" secondAttribute="bottom" constant="4" id="4bK-ON-pNb"/>
|
||||
<constraint firstItem="j4H-3i-r5P" firstAttribute="leading" secondItem="yCp-Pc-niT" secondAttribute="trailing" constant="8" id="6sP-lR-lDJ"/>
|
||||
<constraint firstAttribute="trailingMargin" secondItem="ncX-Ol-5UJ" secondAttribute="trailing" constant="16" id="JDU-Um-Ioe"/>
|
||||
<constraint firstItem="yCp-Pc-niT" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="topMargin" constant="11" id="PiQ-ZO-35r"/>
|
||||
<constraint firstItem="j4H-3i-r5P" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="topMargin" constant="11" id="Tfx-OA-r8W"/>
|
||||
<constraint firstAttribute="trailingMargin" secondItem="Rvn-dY-yD4" secondAttribute="trailing" constant="-8" id="WEX-Zx-rtu"/>
|
||||
<constraint firstItem="ncX-Ol-5UJ" firstAttribute="top" secondItem="o4z-Rh-bJE" secondAttribute="bottom" constant="16" id="YSG-xm-deN"/>
|
||||
<constraint firstItem="ncX-Ol-5UJ" firstAttribute="leading" secondItem="yCp-Pc-niT" secondAttribute="trailing" constant="8" id="cUG-b4-oPR"/>
|
||||
<constraint firstItem="Rvn-dY-yD4" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="topMargin" constant="4.5" id="jMR-mB-VCL"/>
|
||||
<constraint firstItem="yCp-Pc-niT" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leadingMargin" constant="7" id="nv5-dr-4tf"/>
|
||||
<constraint firstItem="MC2-dj-tQV" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leadingMargin" constant="7" id="pVJ-z4-AiC"/>
|
||||
<constraint firstItem="o4z-Rh-bJE" firstAttribute="leading" secondItem="yCp-Pc-niT" secondAttribute="trailing" constant="8" id="zG2-tM-7vG"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<connections>
|
||||
<outlet property="descLabe" destination="ncX-Ol-5UJ" id="enJ-bM-x0c"/>
|
||||
<outlet property="levelLabel" destination="MC2-dj-tQV" id="Q7h-xD-OJL"/>
|
||||
<outlet property="nameLab" destination="j4H-3i-r5P" id="ZPg-Ga-jTg"/>
|
||||
<outlet property="noteView" destination="Rvn-dY-yD4" id="R6S-tX-teh"/>
|
||||
<outlet property="timeLabe" destination="o4z-Rh-bJE" id="F9X-HK-lAh"/>
|
||||
<outlet property="userImg" destination="yCp-Pc-niT" id="pd3-Bt-mHx"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="-69" y="33.5"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
Reference in New Issue
Block a user