123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- //
- // CommonListCell.m
- // smartRhino
- //
- // Created by niuzhen on 2020/4/28.
- // Copyright © 2020 tederen. All rights reserved.
- //
- #import "CommonListCell.h"
- @implementation CommonListCell
- - (void)awakeFromNib {
- [super awakeFromNib];
- // Initialization code
- }
- + (CGFloat)configCell0Height{
- return 72;
- }
- + (CommonListCell *)configCell0:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath{
- static NSString *cellIdentifer = @"CommonListCell0";
- CommonListCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifer];
- if (cell == nil) {
- cell = [[[NSBundle mainBundle] loadNibNamed:@"CommonListCell" owner:nil options:nil] objectAtIndex:0];
- }
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- return cell;
- }
- + (CommonListCell *)configCell1:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath{
- static NSString *cellIdentifer = @"CommonListCell1";
- CommonListCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifer];
- if (cell == nil) {
- cell = [[[NSBundle mainBundle] loadNibNamed:@"CommonListCell" owner:nil options:nil] objectAtIndex:1];
- }
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- return cell;
- }
- - (void)setCell1Data:(MyFavoriteSubModel *)model
- {
- switch (model.CollectionType) {
- // 文章
- case CollectModel_Aritle:{
- [self.iconV sd_setImageWithURL:[NSURL URLWithString:model.Data.ArticleImgUrl.firstObject] placeholderImage:IMG(@"文章")];
- }break;
- // 话题 || 小组
- case CollectModel_Toipc:
- {
- self.iconV.image = IMG(@"话题");
- }break;
- case CollectModel_NewTopic:
- {
- self.iconV.image = IMG(@"话题");
- }break;
- case CollectModel_Group:{
- self.iconV.image = IMG(@"笔记小组");
- }break;
- // 收藏
- case CollectModel_Collect:{
- self.iconV.image = IMG(@"收藏");
- }break;
- // 笔记
- case CollectModel_NoteBook: {
- self.iconV.image = IMG(@"noteBook_icon");
- }break;
- case CollectModel_CollectFile:{
- self.iconV.image = IMG(@"find_1");
- }break;
- case CollectModel_NoteFile: {
- self.iconV.image = IMG(@"find_1");
- }break;
- // 通知 || 站内信
- case CollectModel_Notice:
- {
- self.iconV.image = IMG(@"通知图标");
- }break;
- case CollectModel_InterMail:{
- self.iconV.image = IMG(@"站内信");
- }break;
- // 会议
- case CollectModel_meetMian:{
- self.iconV.image = IMG(@"会议");
- }break;
- case CollectModel_meetDetail:{
- self.iconV.image = IMG(@"会议");
- }break;
- case CollectModel_file:{
- NSString * imageStr = [ZYCTool getFileNameImage:model.Data.FileName];
- if (imageStr.length == 0) {
- [self.iconV sd_setImageWithURL:[NSURL URLWithString:model.Data.MinFile]];
- }else{
- self.iconV.image = IMG(imageStr);
- }
- }break;
- case CollectModel_work:
- {
- self.iconV.image = IMG(@"审批");
- }
- break;
- case CollectModel_financeCount:
- {
- self.iconV.image = IMG(@"报表");
- }
- break;
- case CollectModel_affairsCount:
- {
- self.iconV.image = IMG(@"报表");
- }
- break;
- case CollectModel_publishCount:
- {
- self.iconV.image = IMG(@"报表");
- }
- break;
- default:{
- NSString * imageStr = [ZYCTool getFileNameImage:model.Data.FileName];
- if (imageStr.length == 0) {
- [self.iconV sd_setImageWithURL:[NSURL URLWithString:model.Data.MinFile]];
- }else{
- self.iconV.image = IMG(imageStr);
- }
- }break;
- }
- self.titleL.text = model.Data.Title;
- self.nameL.text = model.Data.Author;
- self.desL.text = model.FolderName;
- }
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
- // Configure the view for the selected state
- }
- @end
|