V5.0.0正式版:
1、加热棒内容修改; 2、首页商品删除,更改为行业资讯; 3、绚多设备更名显示; 4、bugly更换为新版本; 5、摄像头显示bug修复; 6、开屏广告显示不全修复;
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// IfishMainInfoCell.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by wbzhan on 2019/8/23.
|
||||
// Copyright © 2019 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface IfishMainInfoCell : UITableViewCell
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,175 @@
|
||||
//
|
||||
// IfishMainInfoCell.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by wbzhan on 2019/8/23.
|
||||
// Copyright © 2019 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IfishMainInfoCell.h"
|
||||
@interface IfishMainInfoCell()
|
||||
Strong UIImageView *iconImage;
|
||||
Strong UILabel *titleLabel;
|
||||
Strong UILabel *subTitle;
|
||||
Strong UIImageView *watchImage;//查看数
|
||||
Strong UILabel *watchLabel;
|
||||
Strong UIImageView *favImage;//收藏数
|
||||
Strong UILabel *favLabel;
|
||||
Strong UIView *sepLine;
|
||||
@end
|
||||
@implementation IfishMainInfoCell
|
||||
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
|
||||
{
|
||||
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
|
||||
if (self) {
|
||||
|
||||
[self.contentView addSubview:self.sepLine];
|
||||
|
||||
[self.contentView addSubview:self.iconImage];
|
||||
|
||||
[self.contentView addSubview:self.titleLabel];
|
||||
|
||||
[self.contentView addSubview:self.subTitle];
|
||||
|
||||
[self.contentView addSubview:self.watchImage];
|
||||
|
||||
[self.contentView addSubview:self.watchLabel];
|
||||
|
||||
[self.contentView addSubview:self.favImage];
|
||||
|
||||
[self.contentView addSubview:self.favLabel];
|
||||
|
||||
[self.contentView addSubview:self.sepLine];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
- (UIView *)sepLine{
|
||||
if (!_sepLine) {
|
||||
_sepLine = InitObject(UIView);
|
||||
_sepLine.backgroundColor = RGB(222, 222, 222);
|
||||
}
|
||||
return _sepLine;
|
||||
}
|
||||
-(UIImageView *)iconImage{
|
||||
if (!_iconImage) {
|
||||
_iconImage = InitObject(UIImageView);
|
||||
_iconImage.contentMode = UIViewContentModeScaleAspectFill;
|
||||
_iconImage.clipsToBounds = YES;
|
||||
}
|
||||
return _iconImage;
|
||||
}
|
||||
-(UILabel *)titleLabel{
|
||||
if (!_titleLabel) {
|
||||
_titleLabel= InitObject(UILabel);
|
||||
_titleLabel.font = FontSize(15);
|
||||
_titleLabel.textColor=RGB(51, 51, 51);
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
-(UIImageView *)watchImage{
|
||||
if (!_watchImage) {
|
||||
_watchImage = InitObject(UIImageView);
|
||||
[_watchImage setImage:IMAGEBYENAME(@"icons_watch")];
|
||||
}
|
||||
return _watchImage;
|
||||
}
|
||||
-(UILabel *)watchLabel{
|
||||
if (!_watchLabel) {
|
||||
_watchLabel= InitObject(UILabel);
|
||||
_watchLabel.font = FontSize(11);
|
||||
_watchLabel.textColor=RGB(153, 153, 153);
|
||||
_watchLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _watchLabel;
|
||||
}
|
||||
-(UIImageView *)favImage{
|
||||
if (!_favImage) {
|
||||
_favImage = InitObject(UIImageView);
|
||||
[_favImage setImage:IMAGEBYENAME(@"icons_fav")];
|
||||
|
||||
}
|
||||
return _favImage;
|
||||
}
|
||||
-(UILabel *)favLabel{
|
||||
if (!_favLabel) {
|
||||
_favLabel= InitObject(UILabel);
|
||||
_favLabel.font = FontSize(11);
|
||||
_favLabel.textColor=RGB(153, 153, 153);
|
||||
_favLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _favLabel;
|
||||
}
|
||||
-(void)loadLayout{
|
||||
|
||||
[self.sepLine mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.top.width.mas_equalTo(self.contentView);
|
||||
make.height.mas_equalTo(ONE_PIXEL_SIZE);
|
||||
}];
|
||||
|
||||
[self.iconImage mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(15);
|
||||
make.height.mas_equalTo(75);
|
||||
make.left.mas_equalTo(23);
|
||||
make.width.mas_equalTo(89);
|
||||
}];
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.iconImage.mas_right).offset(9);
|
||||
make.top.mas_equalTo(self.iconImage);
|
||||
make.right.mas_equalTo(15);
|
||||
}];
|
||||
|
||||
|
||||
[self.watchImage mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(self.mas_bottom);
|
||||
make.right.mas_equalTo(self.favImage.mas_left).offset(-kSizeFrom750(30));
|
||||
make.width.mas_equalTo(kSizeFrom750(24));
|
||||
make.height.mas_equalTo(kSizeFrom750(14));
|
||||
}];
|
||||
|
||||
[self.watchLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.watchImage.mas_centerY);
|
||||
make.height.mas_equalTo(kSizeFrom750(14));
|
||||
make.left.mas_equalTo(self.watchImage.mas_centerX);
|
||||
make.width.mas_greaterThanOrEqualTo(kSizeFrom750(14));
|
||||
}];
|
||||
|
||||
[self.favImage mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(self.watchImage);
|
||||
make.width.mas_equalTo(kSizeFrom750(22));
|
||||
make.height.mas_equalTo(kSizeFrom750(20));
|
||||
make.right.mas_equalTo(-kSizeFrom750(35));
|
||||
}];
|
||||
|
||||
[self.favLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.height.mas_equalTo(self.watchLabel);
|
||||
make.left.mas_equalTo(self.favImage.mas_centerX);
|
||||
make.width.mas_greaterThanOrEqualTo(kSizeFrom750(14));
|
||||
}];
|
||||
|
||||
}
|
||||
//
|
||||
//-(void)loadInfoWithModel:(GoodsModel *)model{
|
||||
//
|
||||
// NSString *soldTxt = [NSString stringWithFormat:@"已销售%@件",model.sales_num];
|
||||
//
|
||||
// NSMutableAttributedString *priceAttr = [CommonUtils diffierentFontWithString:soldTxt rang:[soldTxt rangeOfString:model.sales_num] font:self.soldLabel.font color:Color_Pink spacingBeforeValue:0 lineSpace:0];
|
||||
// [self.soldLabel setAttributedText:priceAttr];
|
||||
// if ([model.collection_num integerValue]>1000) {
|
||||
// model.collection_num = @"999+";
|
||||
// }
|
||||
// if ([model.click integerValue]>1000) {
|
||||
// model.click = @"999+";
|
||||
// }
|
||||
// self.favLabel.text = [NSString stringWithFormat:@" %@ ",model.collection_num];
|
||||
// self.watchLabel.text = [NSString stringWithFormat:@" %@ ",model.click];
|
||||
// self.titleLabel.text = model.title;
|
||||
// [self.iconImage setImageWithString:model.img_url];
|
||||
//}
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||
[super setSelected:selected animated:animated];
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -41,6 +41,8 @@
|
||||
#import "RunSunChangeNameViewController.h"
|
||||
#import "IfishMessageViewController.h"
|
||||
#import "PushMessageModel.h"
|
||||
#import "IfishInformationListViewCell.h"//资讯
|
||||
#import "JHRefresh.h"//refresh
|
||||
@interface IfishDeviceViewController ()<UITableViewDelegate,UITableViewDataSource,LxPopViewDelegate,ShopTtemListDelegate>
|
||||
|
||||
@property(nonatomic,strong)UITableView *tableView;
|
||||
@@ -56,9 +58,6 @@
|
||||
@property(nonatomic,strong) UIView *tabHeaderImgView;
|
||||
@property(nonatomic,strong) UIImageView *userImgView;
|
||||
@property(nonatomic,strong) UILabel *userNameLabel;
|
||||
@property(nonatomic,strong) UIButton *newsButton;
|
||||
@property(nonatomic,strong) UIView *newsRedPoint;
|
||||
@property(nonatomic,strong) UILabel *newsLabel;
|
||||
@property(nonatomic,strong) UIView *orangeView;
|
||||
@property(nonatomic,strong) UIButton *qianDaoBtn;
|
||||
@property(nonatomic,strong) UIView *qianDaoRedPoint;
|
||||
@@ -78,6 +77,12 @@
|
||||
@property (nonatomic,strong) UILabel *mesglabel;
|
||||
@property(nonatomic,assign)NSInteger curDeviceIdx;
|
||||
Assign NSInteger messageCount;//消息个数
|
||||
Assign BOOL isLoadMore;
|
||||
Assign BOOL isPush;
|
||||
@property (nonatomic,strong) NSMutableArray *listDataArr;
|
||||
@property(nonatomic,copy) NSString* total;
|
||||
@property(nonatomic) int page;
|
||||
@property(nonatomic) NSIndexPath *didSelectIndexPath;
|
||||
//@property (nonatomic,strong) UIView *redView;
|
||||
@end
|
||||
|
||||
@@ -85,8 +90,9 @@ Assign NSInteger messageCount;//消息个数
|
||||
|
||||
- (void)viewDidLoad {
|
||||
|
||||
[super viewDidLoad];
|
||||
self.messageCount = 0;
|
||||
[super viewDidLoad];
|
||||
self.messageCount = 0;
|
||||
self.isPush = NO;
|
||||
// Do any additional setup after loading the view.
|
||||
//self.view.backgroundColor = [];
|
||||
_adViewData = [[NSMutableArray alloc] init];
|
||||
@@ -99,6 +105,7 @@ Assign NSInteger messageCount;//消息个数
|
||||
[self showProgress];
|
||||
[self addDataRequestQueue];
|
||||
[self checkNotification];
|
||||
[self creatReatRefreshView];//上拉加载更多
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(deleteCurDevice) name:@"DeleteCurDevice" object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateDevice) name:@"updateDevice" object:nil];
|
||||
}
|
||||
@@ -121,7 +128,7 @@ Assign NSInteger messageCount;//消息个数
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self getMoreUserData];
|
||||
[self initBannerData];
|
||||
[self loadGoodsData];
|
||||
[self loadDataWith:0 pageSize:10 isRefres:NO];
|
||||
});
|
||||
|
||||
}
|
||||
@@ -196,7 +203,74 @@ Assign NSInteger messageCount;//消息个数
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark --资讯相关
|
||||
//获取资讯列表数据
|
||||
-(void)loadDataWith:(NSInteger)firstResult pageSize:(NSInteger)pageSize isRefres:(BOOL)isRefresh
|
||||
{
|
||||
|
||||
__weak typeof (self)weakSelf = self;
|
||||
NSString *userId= [dataContorl dataControlGetUserIdInfo];
|
||||
[AFHttpTool ifishGetInformations:firstResult pageSize:pageSize userId:userId success:^(id response) {
|
||||
NSDictionary *reDic=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil];
|
||||
NSString *result=reDic[@"result"];
|
||||
_total = reDic[@"total"];
|
||||
if ([result isEqualToString:@"100"]) {
|
||||
NSArray *dataarr =reDic[@"data"];
|
||||
for (NSDictionary *dic in dataarr) {
|
||||
IfishInformations *info =[[IfishInformations alloc] initWithDict:dic];
|
||||
[self.listDataArr addObject:info];
|
||||
//[[IfishDatabaseManager sharedManager] insertIfishInformations:model];
|
||||
}
|
||||
NSIndexSet *indexSet=[[NSIndexSet alloc]initWithIndex:2];
|
||||
[weakSelf.tableView reloadSections:indexSet withRowAnimation:UITableViewRowAnimationNone];
|
||||
}
|
||||
[weakSelf endRefreshing];
|
||||
} failure:^(NSError *err) {
|
||||
[weakSelf endRefreshing];
|
||||
}];
|
||||
|
||||
}
|
||||
-(void)creatReatRefreshView{
|
||||
__weak typeof (self)weakSelf=self;
|
||||
//上拉加载更多
|
||||
[weakSelf.tableView addRefreshFooterViewWithAniViewClass:[JHRefreshCommonAniView class] beginRefresh:^{
|
||||
if (weakSelf.isLoadMore) {
|
||||
return ;
|
||||
}
|
||||
weakSelf.isLoadMore=YES;
|
||||
NSInteger pagecount =[self.total integerValue]/10+1;
|
||||
if (weakSelf.page<pagecount-1) {
|
||||
weakSelf.page++;
|
||||
NSInteger first=(NSInteger)weakSelf.page*10;
|
||||
NSInteger pageSize = 5;//加载更多每次加5个
|
||||
[weakSelf loadDataWith:first pageSize:pageSize isRefres:YES];
|
||||
|
||||
}else{
|
||||
|
||||
[weakSelf endRefreshing];
|
||||
[weakSelf.view makeToast:@"已无更多数据"];
|
||||
}
|
||||
}];
|
||||
}
|
||||
//停止刷新
|
||||
-(void)endRefreshing{
|
||||
|
||||
if (self.isLoadMore) {
|
||||
self.isLoadMore=NO;
|
||||
[self.tableView footerEndRefreshing];
|
||||
}
|
||||
}
|
||||
#pragma mark - 增加点击数
|
||||
-(void)addClicknumber:(int)infoId{
|
||||
[AFHttpTool ifishAdditionClickNum:infoId success:^(id response) {
|
||||
NSDictionary *reDic=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil];
|
||||
NSString *result=reDic[@"result"];
|
||||
if ([result isEqualToString:@"100"]) {
|
||||
|
||||
}
|
||||
} failure:^(NSError *err) {
|
||||
}];
|
||||
}
|
||||
#pragma mark - 获取更多用户数据(新加)
|
||||
-(void)getMoreUserData{
|
||||
|
||||
@@ -477,27 +551,10 @@ Assign NSInteger messageCount;//消息个数
|
||||
[_userImgView sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",kGetIconUrl,umodel.userImg]]];
|
||||
|
||||
}
|
||||
|
||||
|
||||
//资讯首页
|
||||
IfishNewsModel *newsModel=[[DataCenter defaultDtacenter] valueForKey:@"informationNews"];
|
||||
self.newsModel = newsModel;
|
||||
NSString *newsTitle= self.newsModel.title;
|
||||
_newsLabel.text =newsTitle;
|
||||
|
||||
|
||||
//签到按钮红点
|
||||
_qianDaoRedPoint.hidden = userAsset.toDaySignin ? YES : NO;
|
||||
|
||||
//资讯按钮红点
|
||||
NSString *infoId =[IfishUserDefaultHelper getDefualtInfoId];
|
||||
if (infoId) {
|
||||
|
||||
if (infoId.intValue <self.newsModel.infoId.intValue) {
|
||||
_newsRedPoint.hidden = NO;
|
||||
}else{
|
||||
_newsRedPoint.hidden = YES;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -511,51 +568,12 @@ Assign NSInteger messageCount;//消息个数
|
||||
}
|
||||
return _orangeView;
|
||||
}
|
||||
|
||||
-(UIButton*)newsButton{
|
||||
|
||||
CGFloat SapceH= TabContentHeaght *0.086;
|
||||
//CGFloat SapceH= TabContentHeaght *0.06;
|
||||
CGFloat newsButtonW= CGRectGetWidth(_userImgView.frame);
|
||||
CGFloat newsButtonH =newsButtonW*0.46;
|
||||
|
||||
if (!_newsButton) {
|
||||
_newsButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
|
||||
[_newsButton setBackgroundImage:[UIImage imageNamed:@"tab_device_message"] forState:UIControlStateNormal];
|
||||
|
||||
_newsButton.frame = CGRectMake(CGRectGetMinX(_userImgView.frame),CGRectGetMaxY(_userImgView.frame) + SapceH ,newsButtonW, newsButtonH);
|
||||
[_newsButton addTarget:self action:@selector(newsButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
CGFloat pointW =8;
|
||||
NSString *renwu= @"资讯";
|
||||
CGSize size = [renwu sizeWithAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:10]}];
|
||||
_newsRedPoint = [[UIView alloc] initWithFrame:CGRectMake(newsButtonW/2 + size.width/2 , -2, pointW , pointW )];
|
||||
_newsRedPoint.backgroundColor = RGB(252, 89, 89);
|
||||
_newsRedPoint.layer.masksToBounds = YES;
|
||||
_newsRedPoint.layer.cornerRadius = pointW /2;
|
||||
[_newsButton addSubview:self.newsRedPoint];
|
||||
|
||||
- (NSMutableArray *)listDataArr{
|
||||
if (!_listDataArr) {
|
||||
_listDataArr = InitObject(NSMutableArray);
|
||||
}
|
||||
|
||||
return _newsButton;
|
||||
|
||||
return _listDataArr;
|
||||
}
|
||||
|
||||
-(UILabel *)newsLabel{
|
||||
|
||||
if (!_newsLabel) {
|
||||
_newsLabel = [[UILabel alloc] init];
|
||||
_newsLabel.frame = CGRectMake(CGRectGetMaxX(_newsButton.frame) + 5,CGRectGetMidY(_newsButton.frame) -22, kScreenSize.width - CGRectGetMaxX(_newsButton.frame) - 5,44);
|
||||
|
||||
UITapGestureRecognizer *labelTapGestureRecognizer = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(newsTitleBtnAction)];
|
||||
_newsLabel.textColor = [UIColor whiteColor];
|
||||
_newsLabel.font =[UIFont systemFontOfSize:15];
|
||||
_newsLabel.userInteractionEnabled = YES;
|
||||
[_newsLabel addGestureRecognizer:labelTapGestureRecognizer];
|
||||
}
|
||||
return _newsLabel;
|
||||
}
|
||||
|
||||
-(void)newsButtonAction{
|
||||
|
||||
[self pushZiXunVC];
|
||||
@@ -669,8 +687,7 @@ Assign NSInteger messageCount;//消息个数
|
||||
[self.tableView registerNib:[UINib nibWithNibName:@"TabBarDeviceShouYeCell" bundle:nil] forCellReuseIdentifier:@"TabBarDeviceShouYeCell"];
|
||||
[self.tableView registerNib:[UINib nibWithNibName:@"TabbarDeiceSecdCell" bundle:nil] forCellReuseIdentifier:@"TabbarDeiceSecdCell"];
|
||||
//CGFloat sapce=TabContentHeaght*0.011;//20/1776
|
||||
self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0,0,self.view.frame.size.width,self.view.frame.size.height) style:UITableViewStyleGrouped];
|
||||
|
||||
self.tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
|
||||
self.tableView.delegate = self;
|
||||
self.tableView.dataSource = self;
|
||||
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
@@ -684,11 +701,7 @@ Assign NSInteger messageCount;//消息个数
|
||||
[self.tabHeaderImgView addSubview:self.orangeView];
|
||||
[self.tabHeaderImgView addSubview:self.goldBtn];
|
||||
[self.tabHeaderImgView addSubview:self.levelBtn];
|
||||
|
||||
[self.tabHeaderImgView addSubview:self.newsButton];
|
||||
[self.tabHeaderImgView addSubview:self.newsLabel];
|
||||
[self.tabHeaderImgView addSubview:self.qianDaoBtn];
|
||||
self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
|
||||
[self.view addSubview:self.tableView];
|
||||
UILongPressGestureRecognizer *longpress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(addLongPressGesture:)];
|
||||
[self.tableView addGestureRecognizer:longpress];
|
||||
@@ -697,6 +710,10 @@ Assign NSInteger messageCount;//消息个数
|
||||
if (@available(iOS 11.0, *)) {
|
||||
self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
||||
}
|
||||
|
||||
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self.view);
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)addLongPressGesture:(UILongPressGestureRecognizer *)guesture
|
||||
@@ -730,11 +747,24 @@ Assign NSInteger messageCount;//消息个数
|
||||
[self scrollViewDidScroll:self.tableView];
|
||||
//内容置顶
|
||||
//[self.tableView setContentOffset:CGPointMake(0,0) animated:NO];
|
||||
|
||||
[self refreshUI];
|
||||
//刷新消息数
|
||||
[self setRedViewData];
|
||||
|
||||
[self getMessageCount];
|
||||
//刷新观看人数
|
||||
if (_isPush) {
|
||||
|
||||
NSIndexPath *indexPath =[NSIndexPath indexPathForRow:0 inSection:0];
|
||||
NSArray *arr =nil;
|
||||
if (_didSelectIndexPath) {
|
||||
arr =@[indexPath,_didSelectIndexPath];
|
||||
}else{
|
||||
arr =@[indexPath];
|
||||
}
|
||||
|
||||
[self.tableView reloadRowsAtIndexPaths:arr withRowAnimation:UITableViewRowAnimationNone];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)refreshUI{
|
||||
@@ -798,6 +828,8 @@ Assign NSInteger messageCount;//消息个数
|
||||
|
||||
return total ;
|
||||
|
||||
}else if(section==2){
|
||||
return self.listDataArr.count;
|
||||
}
|
||||
return 1;
|
||||
|
||||
@@ -805,19 +837,9 @@ Assign NSInteger messageCount;//消息个数
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
CGFloat listrowH=TabContentHeaght*0.074;
|
||||
|
||||
if (indexPath.section ==2 &&indexPath.row ==0){
|
||||
|
||||
CGFloat Itemwidth = (kScreenSize.width-1)/2;
|
||||
CGFloat ItemH = Itemwidth*1.38 +1;
|
||||
if (_goodsArr.count!=0) {
|
||||
|
||||
int total = (int)[_goodsArr count];
|
||||
int rowCount =total%2==0?total/2:total/2+1;
|
||||
return ItemH*rowCount;
|
||||
}
|
||||
return ItemH*2;
|
||||
|
||||
//资讯列表
|
||||
if (indexPath.section ==2){
|
||||
return 95;
|
||||
}else if (indexPath.section ==1){
|
||||
CGFloat wH=kScreenSize.width*0.184;
|
||||
return wH;
|
||||
@@ -843,28 +865,15 @@ Assign NSInteger messageCount;//消息个数
|
||||
|
||||
return tCell;
|
||||
|
||||
}else if (indexPath.section== 2){
|
||||
|
||||
/*TabbarDeiceSecdCell *cell = [tableView dequeueReusableCellWithIdentifier:@"TabbarDeiceSecdCell"];
|
||||
if(cell==nil){
|
||||
|
||||
cell = [[TabbarDeiceSecdCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"TabbarDeiceSecdCell"];
|
||||
cell.backgroundColor = [UIColor whiteColor];
|
||||
|
||||
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
}*/
|
||||
|
||||
static NSString *identfire=@"IfishAiLiShopGoodsViewCell";
|
||||
|
||||
IfishAiLiShopGoodsViewCell *cell=[tableView dequeueReusableCellWithIdentifier:identfire];
|
||||
}else if (indexPath.section== 2){//资讯
|
||||
|
||||
IfishInformationListViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"IfishInformationListViewCell"];
|
||||
if (!cell) {
|
||||
cell = [[[NSBundle mainBundle] loadNibNamed:@"IfishInformationListViewCell" owner:self options:nil] lastObject];
|
||||
|
||||
cell=[[IfishAiLiShopGoodsViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identfire];
|
||||
}
|
||||
cell.delegate = self;
|
||||
[cell setGoodsdataArr:_goodsArr];
|
||||
[cell refreshCollellction];
|
||||
IfishInformations *model =self.listDataArr[indexPath.row];
|
||||
[cell loadCellDataWith:model];
|
||||
return cell;
|
||||
|
||||
}else if (indexPath.section== 1){
|
||||
@@ -944,7 +953,7 @@ Assign NSInteger messageCount;//消息个数
|
||||
|
||||
return 4;
|
||||
}else if (section==2){
|
||||
return 100;
|
||||
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -1026,15 +1035,10 @@ Assign NSInteger messageCount;//消息个数
|
||||
CGFloat remaiLabelW = 70;
|
||||
UILabel *remaiLabel = [[UILabel alloc] init];
|
||||
remaiLabel.frame = CGRectMake(CGRectGetMaxX(hotImgView.frame) + Space,0, remaiLabelW, remaiLabelH);
|
||||
remaiLabel.text = @"爱鱼严选";
|
||||
remaiLabel.text = @"行业资讯";
|
||||
remaiLabel.font = [UIFont systemFontOfSize:16];
|
||||
remaiLabel.textAlignment = NSTextAlignmentLeft;
|
||||
//remaiLabel.backgroundColor = [UIColor redColor];
|
||||
UILabel *yanxuanDetail = [[UILabel alloc] init];
|
||||
yanxuanDetail.frame = CGRectMake(CGRectGetMaxX(remaiLabel.frame),0, 200, remaiLabelH);
|
||||
yanxuanDetail.text = @"爱鱼奇为您严格挑选的优质宝贝";
|
||||
yanxuanDetail.font = [UIFont systemFontOfSize:11];
|
||||
yanxuanDetail.textColor = RGB(153, 153, 153);
|
||||
|
||||
|
||||
UIView*backview=[[UIView alloc] initWithFrame:CGRectMake(0,0, kScreenSize.width,remaiLabelH)];
|
||||
backview.backgroundColor = [UIColor whiteColor];
|
||||
@@ -1044,7 +1048,7 @@ Assign NSInteger messageCount;//消息个数
|
||||
[backview addSubview:lineview];
|
||||
[backview addSubview:hotImgView];
|
||||
[backview addSubview: remaiLabel];
|
||||
[backview addSubview: yanxuanDetail];
|
||||
// [backview addSubview: yanxuanDetail];
|
||||
[backview bringSubviewToFront:lineview];
|
||||
|
||||
[header1view addSubview:backview];
|
||||
@@ -1101,9 +1105,7 @@ Assign NSInteger messageCount;//消息个数
|
||||
return view;
|
||||
|
||||
}else if (section ==2){
|
||||
UIView *Footerback=[[UIView alloc] init];
|
||||
Footerback.backgroundColor = RGB(242, 242, 242);
|
||||
return Footerback;
|
||||
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
@@ -1168,8 +1170,34 @@ Assign NSInteger messageCount;//消息个数
|
||||
|
||||
}
|
||||
|
||||
}else if (indexPath.section == 2){
|
||||
}else if (indexPath.section == 2){//点击资讯
|
||||
//每日打开资讯链接 加金币
|
||||
[[IfishUserObsever sharedInstance] addGoldWith:READINFORMATION addType:IFISHADDGOLDTYPE0];
|
||||
|
||||
_isPush = YES;
|
||||
PushMasssageWebViewController*webVC=[[PushMasssageWebViewController alloc]init];
|
||||
webVC.pushtitle = @"资讯详情";
|
||||
IfishInformations *model =self.listDataArr[indexPath.row];
|
||||
webVC.pushlink = model.link;
|
||||
//观看数加一 不考虑打开成功与否
|
||||
model.clickNum ++;
|
||||
_didSelectIndexPath = indexPath;
|
||||
[self addClicknumber:model.infoId];
|
||||
NSString *infoIdstr = [NSString stringWithFormat:@"%d",model.infoId];
|
||||
//首页资讯红点标志位
|
||||
//是否比当前值大 大则存储
|
||||
NSString *oldId = [IfishUserDefaultHelper getDefualtInfoId];
|
||||
|
||||
if (!oldId) {
|
||||
oldId = @"";
|
||||
}
|
||||
if (infoIdstr.intValue >= oldId.intValue) {
|
||||
[IfishUserDefaultHelper saveinfoId:infoIdstr];
|
||||
}
|
||||
|
||||
self.hidesBottomBarWhenPushed = YES;
|
||||
[self.navigationController pushViewController:webVC animated:YES];
|
||||
self.hidesBottomBarWhenPushed = NO;
|
||||
}else if (indexPath.section == 1)
|
||||
{
|
||||
|
||||
@@ -1326,10 +1354,7 @@ Assign NSInteger messageCount;//消息个数
|
||||
#pragma mark - 删除设备
|
||||
|
||||
-(void)delectTankWith:(FormatTankAddCamera*)deviceListModel AtIndexPath:(NSIndexPath *)indexPath
|
||||
|
||||
{
|
||||
|
||||
|
||||
AFHTTPRequestOperationManager*mannager=[AFHTTPRequestOperationManager manager];
|
||||
mannager.responseSerializer=[AFHTTPResponseSerializer serializer];
|
||||
NSMutableDictionary * para = [NSMutableDictionary dictionary];
|
||||
|
||||
Reference in New Issue
Block a user