114 lines
3.3 KiB
Objective-C
114 lines
3.3 KiB
Objective-C
//
|
|
// MineHeaderNewItemsCell.m
|
|
// Ifish
|
|
//
|
|
// Created by imac on 17/3/13.
|
|
// Copyright © 2017年 lianlian. All rights reserved.
|
|
//
|
|
|
|
#import "MineHeaderNewItemsCell.h"
|
|
|
|
@implementation MineHeaderNewItemsCell
|
|
|
|
- (void)awakeFromNib {
|
|
[super awakeFromNib];
|
|
// Initialization code
|
|
|
|
UITapGestureRecognizer *tapDengji=[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dengjiAction)];
|
|
UITapGestureRecognizer *tapDengji2=[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dengjiAction2)];
|
|
[self.dengJi addGestureRecognizer:tapDengji];
|
|
[self.levlellabel addGestureRecognizer:tapDengji2];
|
|
|
|
UITapGestureRecognizer *tapgold=[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapGoldAction)];
|
|
[self.goldLabel addGestureRecognizer:tapgold];
|
|
UITapGestureRecognizer *tapgold2=[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapGoldAction2)];
|
|
[self.jinBi addGestureRecognizer:tapgold2];
|
|
|
|
UITapGestureRecognizer *tapRenWu=[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapRenWuAction)];
|
|
UITapGestureRecognizer *tapRenWu2=[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapRenWuAction2)];
|
|
[self.renWu addGestureRecognizer:tapRenWu];
|
|
[self.taskNumber addGestureRecognizer:tapRenWu2];
|
|
|
|
|
|
}
|
|
|
|
-(void)layoutSubviews{
|
|
|
|
if (!self.redpontView) {
|
|
self.redpontView = [[UIView alloc] init];
|
|
NSString *renwu= @"我的任务";
|
|
CGSize size = [renwu sizeWithAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14]}];
|
|
self.redpontView.frame = CGRectMake(CGRectGetWidth(self.renWu.frame)/2 + size.width/2, 4, 8, 8);
|
|
self.redpontView.backgroundColor = RGB(252, 89, 89);
|
|
self.redpontView.layer.masksToBounds = YES;
|
|
self.redpontView.layer.cornerRadius = 4.0;
|
|
[self addSubview:self.redpontView];
|
|
[self.renWu bringSubviewToFront:self.redpontView];
|
|
}
|
|
|
|
}
|
|
|
|
-(void)loadCellData{
|
|
|
|
IfishUserAsset *userAsset =[dataContorl getAllIfishUserAsset];
|
|
self.levlellabel.text = [NSString stringWithFormat:@"LV%@",userAsset.gradeNum];
|
|
self.goldLabel.text = [NSString stringWithFormat:@"%ld",(long)userAsset.goldValue];
|
|
NSInteger undoneCount = [IfishHelperUtils getUnDoneTaskCount];
|
|
self.taskNumber.text = [NSString stringWithFormat:@"%ld",undoneCount];
|
|
self.redpontView.hidden = undoneCount ==0? YES : NO;
|
|
if (undoneCount==0) {
|
|
[[NSNotificationCenter defaultCenter] postNotificationName:IFISHTASK_HAVEDONEALL object:nil];
|
|
}
|
|
|
|
}
|
|
|
|
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
|
[super setSelected:selected animated:animated];
|
|
|
|
// Configure the view for the selected state
|
|
}
|
|
|
|
|
|
-(void)dengjiAction
|
|
{
|
|
if (self.itemsDelegate) {
|
|
[self.itemsDelegate tapDengjiAction];
|
|
}
|
|
}
|
|
-(void)dengjiAction2
|
|
{
|
|
if (self.itemsDelegate) {
|
|
[self.itemsDelegate tapDengjiAction];
|
|
}
|
|
|
|
}
|
|
|
|
|
|
-(void)tapGoldAction
|
|
{
|
|
if (self.itemsDelegate) {
|
|
[self.itemsDelegate tapGoldAction];
|
|
}
|
|
}
|
|
-(void)tapGoldAction2
|
|
{
|
|
if (self.itemsDelegate) {
|
|
[self.itemsDelegate tapGoldAction];
|
|
}
|
|
}
|
|
|
|
-(void)tapRenWuAction
|
|
{
|
|
if (self.itemsDelegate) {
|
|
[self.itemsDelegate tapRenWuAction];
|
|
}
|
|
}
|
|
|
|
-(void)tapRenWuAction2
|
|
{
|
|
if (self.itemsDelegate) {
|
|
[self.itemsDelegate tapRenWuAction];
|
|
}
|
|
}
|
|
@end
|