Initial commit
This commit is contained in:
Binary file not shown.
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QianDaoBannerViewCell.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 17/3/6.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "LXAdScrollView.h"
|
||||
|
||||
@interface QianDaoBannerViewCell : UITableViewCell
|
||||
|
||||
@property (weak, nonatomic) IBOutlet LXAdScrollView *adView;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// QianDaoBannerViewCell.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 17/3/6.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "QianDaoBannerViewCell.h"
|
||||
|
||||
@implementation QianDaoBannerViewCell
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
}
|
||||
|
||||
-(void)layoutSubviews{
|
||||
[super layoutSubviews];
|
||||
|
||||
NSLog(@"self.adView.scrollView.contentOffset***:%f",self.adView.scrollView.contentOffset.x);
|
||||
|
||||
}
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||
[super setSelected:selected animated:animated];
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11542" systemVersion="15G31" 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="11524"/>
|
||||
<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="default" indentationWidth="10" reuseIdentifier="QianDaoBannerViewCell" rowHeight="179" id="KGk-i7-Jjw" customClass="QianDaoBannerViewCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="179"/>
|
||||
<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="375" height="178.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="mnB-MQ-D9z" customClass="LXAdScrollView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="179"/>
|
||||
</view>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="mnB-MQ-D9z" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="Qsp-pP-67w"/>
|
||||
<constraint firstItem="mnB-MQ-D9z" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="Sy9-WG-lb8"/>
|
||||
<constraint firstAttribute="bottom" secondItem="mnB-MQ-D9z" secondAttribute="bottom" id="u9M-MF-Xsy"/>
|
||||
<constraint firstAttribute="trailing" secondItem="mnB-MQ-D9z" secondAttribute="trailing" id="we6-EZ-u2l"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<connections>
|
||||
<outlet property="adView" destination="mnB-MQ-D9z" id="apX-wA-Zfs"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="24.5" y="51.5"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// QianDaoGiftView.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 17/3/7.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
//连续签到礼物
|
||||
//typedef void(^GetGiftActionBlock)(NSString *addGoldValue);
|
||||
@interface QianDaoGiftView : UIView
|
||||
//@property (nonatomic,copy) GetGiftActionBlock getGiftBlock;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,158 @@
|
||||
//
|
||||
// QianDaoGiftView.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 17/3/7.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "QianDaoGiftView.h"
|
||||
#import "IfishUserObsever.h"
|
||||
@interface QianDaoGiftView()
|
||||
@property (nonatomic,strong) UIImageView *giftView;
|
||||
@property (nonatomic,strong) UIButton *giftBtn;
|
||||
@property (nonatomic,strong) UILabel *addGoldlabel;
|
||||
@property (nonatomic,strong) UILabel *firstLabe;
|
||||
@property (nonatomic) NSInteger goldValue;
|
||||
|
||||
@end
|
||||
|
||||
@implementation QianDaoGiftView
|
||||
|
||||
-(id)initWithFrame:(CGRect)frame{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
[self creatGiftImg];
|
||||
UIView *holdView =[[UIView alloc] initWithFrame:frame];
|
||||
holdView.backgroundColor = [UIColor blackColor];
|
||||
holdView.alpha = 0.3;
|
||||
[self addSubview:holdView];
|
||||
[self bringSubviewToFront:self.giftBtn];
|
||||
[self insertSubview:self.giftView belowSubview:self.giftBtn];
|
||||
[self insertSubview:holdView belowSubview:self.giftView];
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)creatGiftImg{
|
||||
|
||||
self.giftView = [[UIImageView alloc] init ];
|
||||
self.giftView.userInteractionEnabled = YES;
|
||||
[self addSubview:self.giftView];
|
||||
self.giftView.image = [UIImage imageNamed:@"signin_popup_egg"];
|
||||
|
||||
self.firstLabe = [[UILabel alloc] init];
|
||||
self.firstLabe.textColor = [UIColor whiteColor];
|
||||
self.firstLabe.text = @"恭喜您!";
|
||||
self.firstLabe.textAlignment = NSTextAlignmentCenter;
|
||||
self.firstLabe.font =[UIFont systemFontOfSize:13];
|
||||
self.firstLabe.hidden = YES;
|
||||
[self.giftView addSubview:self.firstLabe];
|
||||
_goldValue = 0;
|
||||
self.addGoldlabel = [[UILabel alloc] init];
|
||||
self.addGoldlabel.textColor = [UIColor whiteColor];
|
||||
self.addGoldlabel.textAlignment = NSTextAlignmentCenter;
|
||||
self.addGoldlabel.attributedText = [self getAddGloldText:_goldValue];
|
||||
self.addGoldlabel.hidden = YES;
|
||||
[self.giftView addSubview:self.addGoldlabel];
|
||||
|
||||
|
||||
self.giftBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[self addSubview:self.giftBtn];
|
||||
[self.giftBtn setBackgroundImage:[UIImage imageNamed:@"signin_popup_egg_button"] forState:UIControlStateNormal];
|
||||
[self.giftBtn addTarget:self action:@selector(btnAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
self.giftBtn.selected = NO;
|
||||
|
||||
[UIView animateWithDuration:0.36 delay:0 usingSpringWithDamping:25 initialSpringVelocity:20 options:UIViewAnimationOptionCurveEaseIn animations:^{
|
||||
CGFloat imgW = self.frame.size.width - 53*2*KWidth_Scale;
|
||||
self.giftView.frame = CGRectMake(0, 0, imgW, imgW * 1.04);
|
||||
self.giftView.center = self.center;
|
||||
self.firstLabe.frame = CGRectMake(0, 30*KWidth_Scale, imgW, 13);
|
||||
self.addGoldlabel.frame = CGRectMake(0,CGRectGetMaxY(self.firstLabe.frame) +8*KWidth_Scale, imgW, 18);
|
||||
|
||||
CGFloat btnH = (imgW -51*2) * 0.21;
|
||||
self.giftBtn.frame = CGRectMake(CGRectGetMinX(self.giftView.frame) + 51,CGRectGetMaxY(self.giftView.frame) - 19 - btnH,imgW -51*2, btnH);
|
||||
|
||||
|
||||
} completion:^(BOOL finished){
|
||||
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
-(NSMutableAttributedString*)getAddGloldText:(NSInteger)goldValue{
|
||||
NSString *gold =[NSString stringWithFormat:@"[%ld个金币]",(long)goldValue];
|
||||
NSString * goldAllStr = [NSString stringWithFormat:@"获得了%@",gold];
|
||||
NSRange range = [goldAllStr rangeOfString:gold];
|
||||
NSMutableAttributedString* string = [[NSMutableAttributedString alloc] initWithString:goldAllStr];
|
||||
[string addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255.0/255.0 green:218.0/255.0 blue:128.0/255.0 alpha:1] range:range];
|
||||
[string addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255.0/255.0 green:147.0/255.0 blue:81.0/255.0 alpha:1] range:NSMakeRange(3, 1)];
|
||||
[string addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255.0/255.0 green:147.0/255.0 blue:81.0/255.0 alpha:1] range:NSMakeRange(goldAllStr.length -1,1)];
|
||||
|
||||
[string addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:15] range:NSMakeRange(0, 3)];
|
||||
[string addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:18] range:range];
|
||||
return string;
|
||||
|
||||
}
|
||||
|
||||
-(void)btnAction:(UIButton *)btn{
|
||||
|
||||
|
||||
if (btn.selected) {
|
||||
|
||||
[self removeFromSuperview];
|
||||
|
||||
}else{
|
||||
[self hitGoldEgg:btn];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-(void)hitGoldEgg:(UIButton*)btn{
|
||||
|
||||
// self.giftView.image = [UIImage imageNamed:@"signin_popup_obtain"];
|
||||
// [self.giftBtn setBackgroundImage:[UIImage imageNamed:@"signin_popup_obtain_button"] forState:UIControlStateNormal];
|
||||
// self.firstLabe.hidden = NO;
|
||||
// self.addGoldlabel.hidden = NO;
|
||||
// return;
|
||||
|
||||
NSString *userId =[dataContorl dataControlGetUserIdInfo];
|
||||
__weak typeof (self) weakself = self;
|
||||
|
||||
[AFHttpTool ifishHitGoldenEgg:userId success:^(id response) {
|
||||
NSDictionary *reDic=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil];
|
||||
|
||||
if ([reDic[@"result"] isEqualToString:@"100"]){
|
||||
NSDictionary *data=reDic[@"data"];
|
||||
if (![data isKindOfClass:[NSNull class]]&&data) {
|
||||
|
||||
IfishUserAsset *userAsset = [[IfishUserAsset alloc] initWithDict:data];
|
||||
[dataContorl resetUserAsset:userAsset];
|
||||
//加金币
|
||||
//if (weakself.getGiftBlock) {
|
||||
// weakself.getGiftBlock(addGoldValue);
|
||||
//}
|
||||
|
||||
weakself.giftView.image = [UIImage imageNamed:@"signin_popup_obtain"];
|
||||
[weakself.giftBtn setBackgroundImage:[UIImage imageNamed:@"signin_popup_obtain_button"] forState:UIControlStateNormal];
|
||||
weakself.giftBtn.selected = YES;
|
||||
weakself.firstLabe.hidden = NO;
|
||||
weakself.addGoldlabel.hidden = NO;
|
||||
_goldValue =userAsset.addValue;
|
||||
weakself.addGoldlabel.attributedText = [self getAddGloldText:_goldValue];
|
||||
//加金币 tost
|
||||
NSString *addvalue = [NSString stringWithFormat:@"%ld",(long)userAsset.addValue];
|
||||
[[IfishUserObsever sharedInstance] showAddGoldWith:addvalue];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
} failure:^(NSError *err) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QianDaoGongLueViewCell.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 17/3/6.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface QianDaoGongLueViewCell : UITableViewCell
|
||||
@property (weak, nonatomic) IBOutlet UILabel *firstLabel;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *secondLabel;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *thirdlabel;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// QianDaoGongLueViewCell.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 17/3/6.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "QianDaoGongLueViewCell.h"
|
||||
|
||||
@implementation QianDaoGongLueViewCell
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
NSMutableAttributedString * firstString = [[NSMutableAttributedString alloc] initWithString:@"首次签到+1金币,连续签到每天递增+1,7天后回到1,第7天可额外获得一个神秘礼物。"];
|
||||
|
||||
NSMutableParagraphStyle * paragraphStyle = [[NSMutableParagraphStyle alloc] init];
|
||||
[paragraphStyle setLineSpacing:8];
|
||||
[firstString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [firstString length])];
|
||||
[firstString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:225.0/255.0 green:115.0/255.0 blue:92.0/255.0 alpha:1] range:NSMakeRange(17, 2)];
|
||||
[firstString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:225.0/255.0 green:156.0/255.0 blue:1.0/255.0 alpha:1] range:NSMakeRange(37, 4)];
|
||||
self.firstLabel.attributedText = firstString;
|
||||
|
||||
NSMutableAttributedString * secString = [[NSMutableAttributedString alloc] initWithString:@"*金币兑换比例:100金币≈1人民币"];
|
||||
[secString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:225.0/255.0 green:115.0/255.0 blue:92.0/255.0 alpha:1] range:NSMakeRange(0, 1)];
|
||||
[secString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:225.0/255.0 green:115.0/255.0 blue:92.0/255.0 alpha:1] range:NSMakeRange(8, 3)];
|
||||
self.secondLabel.attributedText = secString;
|
||||
|
||||
NSMutableAttributedString * thirdString = [[NSMutableAttributedString alloc] initWithString:@"*一切解释权归©爱鱼奇所有"];
|
||||
[thirdString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:225.0/255.0 green:115.0/255.0 blue:92.0/255.0 alpha:1] range:NSMakeRange(0, 1)];
|
||||
self.thirdlabel.attributedText = thirdString;
|
||||
|
||||
}
|
||||
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||
[super setSelected:selected animated:animated];
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,89 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="15G31" 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="default" indentationWidth="10" reuseIdentifier="QianDaoGongLueViewCell" id="KGk-i7-Jjw" customClass="QianDaoGongLueViewCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="108"/>
|
||||
<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="375" height="108"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="873-oS-3w5">
|
||||
<rect key="frame" x="15" y="5" width="344" height="103"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="fwsfff从 v 第三次 v 是 v 才是 v" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hWC-XB-oLE">
|
||||
<rect key="frame" x="21" y="54" width="301" height="15"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="15" id="d4S-BY-AoX"/>
|
||||
</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>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="擦啊擦擦擦" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2OW-Hn-sOQ">
|
||||
<rect key="frame" x="21" y="74" width="301" height="15"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="15" id="bNL-Lm-Fgx"/>
|
||||
</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>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rSM-l0-O1T">
|
||||
<rect key="frame" x="21" y="16" width="301" height="32"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="32" id="PcM-SD-CTs"/>
|
||||
</constraints>
|
||||
<attributedString key="attributedText">
|
||||
<fragment content="十二届全国人大五次会议开幕会:国务院总理李克强作政府工作报告">
|
||||
<attributes>
|
||||
<color key="NSColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<font key="NSFont" size="12" name=".PingFangSC-Regular"/>
|
||||
<paragraphStyle key="NSParagraphStyle" alignment="left" lineBreakMode="wordWrapping" baseWritingDirection="natural" lineSpacing="8" tighteningFactorForTruncation="0.0"/>
|
||||
</attributes>
|
||||
</fragment>
|
||||
</attributedString>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.96862745098039216" green="0.96470588235294119" blue="0.96078431372549022" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="rSM-l0-O1T" firstAttribute="top" secondItem="873-oS-3w5" secondAttribute="top" constant="16" id="9wV-Pv-jkU"/>
|
||||
<constraint firstItem="2OW-Hn-sOQ" firstAttribute="leading" secondItem="873-oS-3w5" secondAttribute="leading" constant="21" id="DqS-zv-31y"/>
|
||||
<constraint firstItem="hWC-XB-oLE" firstAttribute="leading" secondItem="873-oS-3w5" secondAttribute="leading" constant="21" id="O1B-tL-SEb"/>
|
||||
<constraint firstItem="2OW-Hn-sOQ" firstAttribute="top" secondItem="hWC-XB-oLE" secondAttribute="bottom" constant="5" id="UHJ-lY-KaX"/>
|
||||
<constraint firstAttribute="trailing" secondItem="rSM-l0-O1T" secondAttribute="trailing" constant="22" id="cuY-Kg-pVz"/>
|
||||
<constraint firstAttribute="trailing" secondItem="hWC-XB-oLE" secondAttribute="trailing" constant="22" id="qba-b7-E64"/>
|
||||
<constraint firstAttribute="trailing" secondItem="2OW-Hn-sOQ" secondAttribute="trailing" constant="22" id="usA-pp-Tgv"/>
|
||||
<constraint firstItem="rSM-l0-O1T" firstAttribute="leading" secondItem="873-oS-3w5" secondAttribute="leading" constant="21" id="vOh-Df-dR6"/>
|
||||
<constraint firstItem="hWC-XB-oLE" firstAttribute="top" secondItem="rSM-l0-O1T" secondAttribute="bottom" constant="6" id="w74-7h-UVR"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="873-oS-3w5" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="topMargin" constant="-3" id="40Y-wn-vat"/>
|
||||
<constraint firstItem="873-oS-3w5" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leadingMargin" constant="7" id="5Si-4n-UeD"/>
|
||||
<constraint firstAttribute="bottomMargin" secondItem="873-oS-3w5" secondAttribute="bottom" constant="-8" id="Cbu-UA-Dp1"/>
|
||||
<constraint firstAttribute="trailingMargin" secondItem="873-oS-3w5" secondAttribute="trailing" constant="8" id="xT0-Vu-xRT"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<connections>
|
||||
<outlet property="firstLabel" destination="rSM-l0-O1T" id="r72-QM-vfI"/>
|
||||
<outlet property="secondLabel" destination="hWC-XB-oLE" id="H65-0M-Qnm"/>
|
||||
<outlet property="thirdlabel" destination="2OW-Hn-sOQ" id="bwu-Hk-IVr"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="-323.5" y="-54"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QianDaoTimeLineView.h
|
||||
// CollectionViewTest
|
||||
//
|
||||
// Created by imac on 17/3/6.
|
||||
// Copyright © 2017年 xiang. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface QianDaoTimeLineView : UIView
|
||||
|
||||
@property (nonatomic) int dayValue;
|
||||
@property (nonatomic) BOOL isSignInToday;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,91 @@
|
||||
//
|
||||
// QianDaoTimeLineView.m
|
||||
// CollectionViewTest
|
||||
//
|
||||
// Created by imac on 17/3/6.
|
||||
// Copyright © 2017年 xiang. All rights reserved.
|
||||
//
|
||||
|
||||
#import "QianDaoTimeLineView.h"
|
||||
|
||||
@implementation QianDaoTimeLineView
|
||||
|
||||
-(id)initWithFrame:(CGRect)frame{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
|
||||
[self creatSub];
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)awakeFromNib{
|
||||
[super awakeFromNib];
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void)layoutSubviews
|
||||
{
|
||||
[super layoutSubviews];
|
||||
[self creatSub];
|
||||
|
||||
}
|
||||
|
||||
-(void)creatSub{
|
||||
|
||||
for (int i = 0; i<=6; i++) {
|
||||
CGFloat marginTosuper = 15;
|
||||
CGFloat imgW = 22;
|
||||
CGFloat lineW = (self.frame.size.width - 15*2 - imgW * 7)/6;
|
||||
|
||||
UIImageView *signInImg = [[UIImageView alloc] init];
|
||||
signInImg.frame = CGRectMake(marginTosuper+i*(imgW + lineW),0, imgW, imgW);
|
||||
[self addSubview:signInImg];
|
||||
if (!_dayValue) {
|
||||
_dayValue = 0;
|
||||
}
|
||||
if (i<6) {
|
||||
UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(signInImg.frame), CGRectGetMidY(signInImg.frame) -2, lineW, 2)];
|
||||
lineView.backgroundColor = [UIColor colorWithRed:255.0/256.0 green:115.0/256.0 blue:92.0/256.0 alpha:1];
|
||||
[self addSubview:lineView];
|
||||
if (i>=_dayValue) {
|
||||
lineView.backgroundColor = [UIColor colorWithRed:221.0/256.0 green:221.0/256.0 blue:221.0/256.0 alpha:1];
|
||||
}
|
||||
}
|
||||
|
||||
UILabel *title=[[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMidX(signInImg.frame) - 36/2, CGRectGetMaxY(signInImg.frame) + 6,36,13)];
|
||||
title.text = [NSString stringWithFormat:@"第%d天",i + 1];
|
||||
title.textAlignment = NSTextAlignmentCenter;
|
||||
title.font = [UIFont systemFontOfSize:12];
|
||||
[self addSubview:title];
|
||||
|
||||
|
||||
if (i<_dayValue) {
|
||||
signInImg.image = [UIImage imageNamed:@"signin_condition_succeed"];
|
||||
title.textColor = [UIColor colorWithRed:153.0/256.0 green:153.0/256.0 blue:153.0/256.0 alpha:1];
|
||||
}else if (i==_dayValue){
|
||||
if (_isSignInToday) {
|
||||
signInImg.image = i==6 ? [UIImage imageNamed:@"signin_condition_gift_achieve"]: [UIImage imageNamed:@"signin_condition_succeed"];
|
||||
|
||||
}else{
|
||||
|
||||
signInImg.image = i==6 ? [UIImage imageNamed:@"signin_condition_gift_conduct"]: [UIImage imageNamed:@"signin_condition_conduct"];
|
||||
}
|
||||
|
||||
title.textColor = [UIColor colorWithRed:254.0/256.0 green:156.0/256.0 blue:139.0/256.0 alpha:1];
|
||||
|
||||
}else{
|
||||
|
||||
signInImg.image = i==6 ? [UIImage imageNamed:@"signin_condition_gift"]: [UIImage imageNamed:@"signin_condition_await"];
|
||||
title.textColor = [UIColor colorWithRed:221.0/256.0 green:221.0/256.0 blue:221.0/256.0 alpha:1];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// QianDaoTimeViewCell.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 17/3/6.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "QianDaoTimeLineView.h"
|
||||
@interface QianDaoTimeViewCell : UITableViewCell
|
||||
@property (weak, nonatomic) IBOutlet UILabel *todayQianDaoGold;
|
||||
@property (weak, nonatomic) IBOutlet QianDaoTimeLineView *qianDaoTimeView;
|
||||
-(void)setQianDaoData;
|
||||
@end
|
||||
@@ -0,0 +1,87 @@
|
||||
//
|
||||
// QianDaoTimeViewCell.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 17/3/6.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "QianDaoTimeViewCell.h"
|
||||
|
||||
@implementation QianDaoTimeViewCell
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void)setQianDaoData{
|
||||
|
||||
IfishUserAsset *asset = [dataContorl getAllIfishUserAsset];
|
||||
int keepsign = (int)asset.keepSigninNum;
|
||||
int dayValue =0;
|
||||
dayValue = keepsign;
|
||||
if (asset.toDaySignin) {
|
||||
//已签到时
|
||||
if (keepsign>=1) {
|
||||
//签到view 从0 算起
|
||||
dayValue = keepsign - 1;
|
||||
}
|
||||
}
|
||||
self.qianDaoTimeView.dayValue = dayValue;
|
||||
self.qianDaoTimeView.isSignInToday = asset.toDaySignin;
|
||||
NSString *goldAllStr = nil;
|
||||
NSMutableAttributedString * String = nil;
|
||||
|
||||
if (asset.toDaySignin) {
|
||||
|
||||
if (keepsign ==7) {
|
||||
goldAllStr = [NSString stringWithFormat:@"已获得%d金币+70金币的签到奖励",keepsign];
|
||||
NSString *gold =[NSString stringWithFormat:@"%d金币",keepsign];
|
||||
NSRange range = [goldAllStr rangeOfString:gold];
|
||||
NSRange godrange = [goldAllStr rangeOfString:@"70金币"];
|
||||
String = [[NSMutableAttributedString alloc] initWithString:goldAllStr];
|
||||
[String addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:225.0/255.0 green:115.0/255.0 blue:92.0/255.0 alpha:1] range:range];
|
||||
[String addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:225.0/255.0 green:115.0/255.0 blue:92.0/255.0 alpha:1] range:godrange];
|
||||
}else{
|
||||
goldAllStr = [NSString stringWithFormat:@"已获得%d金币的签到奖励",keepsign];
|
||||
NSString *gold =[NSString stringWithFormat:@"%d",keepsign];
|
||||
NSRange range = [goldAllStr rangeOfString:gold];
|
||||
String = [[NSMutableAttributedString alloc] initWithString:goldAllStr];
|
||||
[String addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:225.0/255.0 green:115.0/255.0 blue:92.0/255.0 alpha:1] range:range];
|
||||
}
|
||||
|
||||
|
||||
}else{
|
||||
|
||||
if (keepsign ==6) {
|
||||
goldAllStr = [NSString stringWithFormat:@"今天签到可获得%d金币+一份神秘礼物",keepsign +1];
|
||||
NSString *gold =[NSString stringWithFormat:@"%d金币",keepsign +1];
|
||||
NSRange range = [goldAllStr rangeOfString:gold];
|
||||
NSRange liwuRange = [goldAllStr rangeOfString:@"神秘礼物"];
|
||||
String = [[NSMutableAttributedString alloc] initWithString:goldAllStr];
|
||||
[String addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:225.0/255.0 green:115.0/255.0 blue:92.0/255.0 alpha:1] range:range];
|
||||
[String addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:225.0/255.0 green:115.0/255.0 blue:92.0/255.0 alpha:1] range:liwuRange];
|
||||
|
||||
}else{
|
||||
goldAllStr = [NSString stringWithFormat:@"今天签到可获得%d金币",keepsign +1];
|
||||
NSString *gold =[NSString stringWithFormat:@"%d",keepsign +1];
|
||||
NSRange range = [goldAllStr rangeOfString:gold];
|
||||
String = [[NSMutableAttributedString alloc] initWithString:goldAllStr];
|
||||
[String addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:225.0/255.0 green:115.0/255.0 blue:92.0/255.0 alpha:1] range:range];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
self.todayQianDaoGold.attributedText = String;
|
||||
}
|
||||
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||
[super setSelected:selected animated:animated];
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="15G31" 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="default" indentationWidth="10" reuseIdentifier="QianDaoTimeViewCell" rowHeight="136" id="KGk-i7-Jjw" customClass="QianDaoTimeViewCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="136"/>
|
||||
<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="375" height="135"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="iWL-W0-4nY" customClass="QianDaoTimeLineView">
|
||||
<rect key="frame" x="0.0" y="60" width="375" height="67"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="67" id="yXg-sM-Sfu"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0AX-EX-uz0">
|
||||
<rect key="frame" x="8" y="31" width="359" height="16"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="16" id="8Eg-23-BB9"/>
|
||||
</constraints>
|
||||
<attributedString key="attributedText">
|
||||
<fragment content="今天签到可获得">
|
||||
<attributes>
|
||||
<color key="NSColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<font key="NSFont" size="13" name=".PingFangSC-Regular"/>
|
||||
<paragraphStyle key="NSParagraphStyle" alignment="center" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
|
||||
</attributes>
|
||||
</fragment>
|
||||
<fragment content="N">
|
||||
<attributes>
|
||||
<color key="NSColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<font key="NSFont" metaFont="system"/>
|
||||
<paragraphStyle key="NSParagraphStyle" alignment="center" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
|
||||
</attributes>
|
||||
</fragment>
|
||||
<fragment content="金币">
|
||||
<attributes>
|
||||
<color key="NSColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<font key="NSFont" size="13" name=".PingFangSC-Regular"/>
|
||||
<paragraphStyle key="NSParagraphStyle" alignment="center" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
|
||||
</attributes>
|
||||
</fragment>
|
||||
</attributedString>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="iWL-W0-4nY" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leadingMargin" constant="-8" id="573-PE-ff9"/>
|
||||
<constraint firstAttribute="trailingMargin" secondItem="iWL-W0-4nY" secondAttribute="trailing" constant="-8" id="JrB-Gp-B3b"/>
|
||||
<constraint firstItem="iWL-W0-4nY" firstAttribute="centerX" secondItem="H2p-sc-9uM" secondAttribute="centerX" id="VsJ-0d-gTT"/>
|
||||
<constraint firstItem="0AX-EX-uz0" firstAttribute="centerX" secondItem="H2p-sc-9uM" secondAttribute="centerX" id="jas-n5-WDy"/>
|
||||
<constraint firstItem="iWL-W0-4nY" firstAttribute="top" secondItem="0AX-EX-uz0" secondAttribute="bottom" constant="13" id="psG-Z7-nnR"/>
|
||||
<constraint firstAttribute="leadingMargin" secondItem="0AX-EX-uz0" secondAttribute="leading" id="r8w-8s-9G8"/>
|
||||
<constraint firstAttribute="bottomMargin" secondItem="iWL-W0-4nY" secondAttribute="bottom" constant="0.5" id="uZi-5D-G2x"/>
|
||||
<constraint firstAttribute="trailingMargin" secondItem="0AX-EX-uz0" secondAttribute="trailing" id="zX6-gw-TCe"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<connections>
|
||||
<outlet property="qianDaoTimeView" destination="iWL-W0-4nY" id="fgY-j3-rw1"/>
|
||||
<outlet property="todayQianDaoGold" destination="0AX-EX-uz0" id="ij6-5o-Wow"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="26.5" y="52"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// QianDaoWayTitleViewCell.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 17/3/6.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface QianDaoWayTitleViewCell : UITableViewCell
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// QianDaoWayTitleViewCell.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 17/3/6.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "QianDaoWayTitleViewCell.h"
|
||||
|
||||
@implementation QianDaoWayTitleViewCell
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
}
|
||||
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||
[super setSelected:selected animated:animated];
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11542" systemVersion="15G31" 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="11524"/>
|
||||
<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="default" indentationWidth="10" reuseIdentifier="QianDaoWayTitleViewCell" id="KGk-i7-Jjw" customClass="QianDaoWayTitleViewCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
|
||||
<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="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="签到攻略" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="GTU-ep-nfL">
|
||||
<rect key="frame" x="43" y="10.5" width="176" height="21"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="176" id="68a-es-PZM"/>
|
||||
<constraint firstAttribute="height" constant="21" id="txX-x4-Dzy"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="R5z-lD-ily">
|
||||
<rect key="frame" x="0.0" y="43" width="320" height="1"/>
|
||||
<color key="backgroundColor" red="0.94901960784313721" green="0.94901960784313721" blue="0.94901960784313721" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="1" id="Ohl-p0-KoI"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="signin_strategy.png" translatesAutoresizingMaskIntoConstraints="NO" id="CVn-yq-ozC">
|
||||
<rect key="frame" x="15" y="12" width="18" height="18"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="18" id="iX9-PF-5NT"/>
|
||||
<constraint firstAttribute="width" constant="18" id="jfA-vu-N7w"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="R5z-lD-ily" secondAttribute="trailing" id="5Vy-cl-hDW"/>
|
||||
<constraint firstAttribute="bottom" secondItem="R5z-lD-ily" secondAttribute="bottom" id="9RX-zX-Kmh"/>
|
||||
<constraint firstItem="R5z-lD-ily" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="F35-Xy-pcX"/>
|
||||
<constraint firstItem="GTU-ep-nfL" firstAttribute="centerY" secondItem="CVn-yq-ozC" secondAttribute="centerY" id="VeR-A3-SD6"/>
|
||||
<constraint firstAttribute="leadingMargin" secondItem="CVn-yq-ozC" secondAttribute="leading" constant="-7" id="d2I-Ay-gae"/>
|
||||
<constraint firstItem="CVn-yq-ozC" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="l5K-k3-WQO"/>
|
||||
<constraint firstItem="GTU-ep-nfL" firstAttribute="leading" secondItem="CVn-yq-ozC" secondAttribute="trailing" constant="10" id="lck-Hh-Ylt"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="signin_strategy.png" width="15" height="15"/>
|
||||
</resources>
|
||||
</document>
|
||||
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// RenQuYinDaoVIew.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 17/3/8.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
//任务引导
|
||||
@interface RenQuYinDaoVIew : UIView
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,58 @@
|
||||
//
|
||||
// RenQuYinDaoVIew.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 17/3/8.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RenQuYinDaoVIew.h"
|
||||
#import "IfishUserDefaultHelper.h"
|
||||
@interface RenQuYinDaoVIew()
|
||||
@property (nonatomic,strong) UIImageView *yinDaoView;
|
||||
@end
|
||||
@implementation RenQuYinDaoVIew
|
||||
|
||||
-(id)initWithFrame:(CGRect)frame{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
UIView *holdView =[[UIView alloc] initWithFrame:CGRectMake(0,0, frame.size.width,6)];
|
||||
holdView.backgroundColor = [UIColor blackColor];
|
||||
holdView.alpha = 0.6;
|
||||
[self addSubview:holdView];
|
||||
[self bringSubviewToFront:self.yinDaoView];
|
||||
[self yinDaoImg];
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)yinDaoImg
|
||||
{
|
||||
self.yinDaoView = [[UIImageView alloc] init ];
|
||||
self.yinDaoView.userInteractionEnabled = YES;
|
||||
[self addSubview:self.yinDaoView];
|
||||
self.yinDaoView.image = [UIImage imageNamed:@"signin_prompt"];
|
||||
if (self.frame.size.width ==320) {
|
||||
|
||||
self.yinDaoView.frame = CGRectMake(0,6, self.frame.size.width,kScreenSize.height);
|
||||
}else{
|
||||
self.yinDaoView.frame = CGRectMake(0,0, self.frame.size.width,kScreenSize.height);
|
||||
}
|
||||
|
||||
|
||||
self.yinDaoView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
|
||||
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(dismissSelfViewTap)];
|
||||
self.yinDaoView.userInteractionEnabled = YES;
|
||||
[self.yinDaoView addGestureRecognizer:tap];
|
||||
|
||||
}
|
||||
|
||||
-(void)dismissSelfViewTap{
|
||||
[IfishUserDefaultHelper IfishTaskIsShowed:YES];
|
||||
[self removeFromSuperview];
|
||||
}
|
||||
|
||||
@end
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// QianDaoViewController.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 17/3/6.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "BaseVIewContorller.h"
|
||||
|
||||
@interface QianDaoViewController : BaseVIewContorller
|
||||
|
||||
@end
|
||||
+406
@@ -0,0 +1,406 @@
|
||||
//
|
||||
// QianDaoViewController.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 17/3/6.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "QianDaoViewController.h"
|
||||
#import "QianDaoGongLueViewCell.h"
|
||||
#import "QianDaoTimeLineView.h"
|
||||
#import "QianDaoTimeViewCell.h"
|
||||
#import "QianDaoBannerViewCell.h"
|
||||
#import "QianDaoWayTitleViewCell.h"
|
||||
#import "UIControl+YT.h"
|
||||
#import "RenQuYinDaoVIew.h"
|
||||
#import "QianDaoGiftView.h"
|
||||
#import "WoDeRenWuViewController.h"
|
||||
#import "IfishUserDefaultHelper.h"
|
||||
#import "PushMasssageWebViewController.h"
|
||||
#import <AlibcTradeSDK/AlibcTradeSDK.h>
|
||||
#import "IfishAlibcWebViewController.h"
|
||||
@interface QianDaoViewController ()<UITableViewDelegate,UITableViewDataSource>
|
||||
@property(nonatomic,strong)UITableView *tableView;
|
||||
@property(nonatomic) BOOL isPushNext;
|
||||
@property (nonatomic,strong) NSMutableArray *bannerDataArr;
|
||||
@end
|
||||
|
||||
@implementation QianDaoViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
[self addTitleViewWithTitle:@"签到"];
|
||||
_bannerDataArr = [[NSMutableArray alloc] init];
|
||||
_isPushNext = NO;
|
||||
UIBarButtonItem*rightItem= [[UIBarButtonItem alloc] initWithTitle:@"我的任务" style:UIBarButtonItemStyleDone target:self action:@selector(wodeRenWuAction)];
|
||||
|
||||
self.navigationItem.rightBarButtonItem= rightItem;
|
||||
[self.navigationItem.rightBarButtonItem setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIFont systemFontOfSize:14],NSFontAttributeName, [UIColor whiteColor], NSForegroundColorAttributeName, nil] forState:UIControlStateNormal];
|
||||
|
||||
|
||||
[self creatTab];
|
||||
|
||||
BOOL isshow = [IfishUserDefaultHelper digisShowTaskLead];
|
||||
if (!isshow) {
|
||||
|
||||
[self initYinDaoView];
|
||||
|
||||
}
|
||||
[self testCanGetGiftView];
|
||||
//banner 数据
|
||||
[self initBannerData];
|
||||
//[self testdocu];
|
||||
}
|
||||
|
||||
-(void)testdocu{
|
||||
|
||||
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
||||
NSString *documentsDirectory = [paths objectAtIndex:0];
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
NSDirectoryEnumerator *dirEnum = [fileManager enumeratorAtPath:documentsDirectory];
|
||||
NSString *path;
|
||||
while ((path = [dirEnum nextObject]) != nil) {
|
||||
NSLog(@"path:%@", path);
|
||||
}
|
||||
}
|
||||
|
||||
-(void)initBannerData
|
||||
{
|
||||
__weak typeof (self)weakSelf = self;
|
||||
[AFHttpTool getIfishBannerData:IfishAdTypeQianDao success:^(id response) {
|
||||
|
||||
NSDictionary *reDic=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil];
|
||||
NSString *result=reDic[@"result"];
|
||||
if ([result isEqualToString:@"100"]) {
|
||||
NSArray *data= reDic[@"data"];
|
||||
if (data&&data.count!=0) {
|
||||
for (NSDictionary *dic in data) {
|
||||
IfishBannerData *bannerdata = [[IfishBannerData alloc] initWithDict:dic];
|
||||
[_bannerDataArr addObject:bannerdata];
|
||||
}
|
||||
NSIndexSet *asset = [NSIndexSet indexSetWithIndex:1];
|
||||
[weakSelf.tableView reloadSections:asset withRowAnimation:UITableViewRowAnimationNone];
|
||||
}
|
||||
|
||||
}else{
|
||||
|
||||
//[weakSelf.view makeToast:@"广告位获取失败"];
|
||||
}
|
||||
|
||||
|
||||
} failure:^(NSError *err) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)testCanGetGiftView
|
||||
{
|
||||
IfishUserAsset *userAsset = [dataContorl getAllIfishUserAsset];
|
||||
if (!userAsset.isHitGoldenEgg) {
|
||||
[self showGiftView];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
|
||||
if (_isPushNext) {
|
||||
//广告栏bug 返回不显示
|
||||
NSIndexSet *set = [NSIndexSet indexSetWithIndex:1];
|
||||
[self.tableView reloadSections:set withRowAnimation:UITableViewRowAnimationNone];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
-(void)initYinDaoView{
|
||||
|
||||
RenQuYinDaoVIew *yinDaoVIew =[[RenQuYinDaoVIew alloc] initWithFrame:[UIApplication sharedApplication].keyWindow.bounds];
|
||||
[[UIApplication sharedApplication].keyWindow addSubview:yinDaoVIew];
|
||||
}
|
||||
|
||||
-(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.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
self.tableView.showsVerticalScrollIndicator = NO;
|
||||
self.tableView.backgroundColor = [UIColor whiteColor];
|
||||
[self.view addSubview:self.tableView];
|
||||
UIButton *qiandaoBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
CGFloat btnH = self.view.frame.size.width * 0.13;
|
||||
|
||||
qiandaoBtn.frame = CGRectMake(0,self.view.frame.size.height - btnH, self.view.frame.size.width, btnH);
|
||||
IfishUserAsset *asset = [dataContorl getAllIfishUserAsset];
|
||||
|
||||
qiandaoBtn.backgroundColor = asset.toDaySignin ? RGB(221, 221,221):RGB(0, 184, 329);
|
||||
qiandaoBtn.userInteractionEnabled = asset.toDaySignin ? NO:YES;
|
||||
|
||||
[qiandaoBtn addTarget:self action:@selector(qiandaoAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
qiandaoBtn.yt_acceptEventInterval = 5;
|
||||
if (asset.toDaySignin) {
|
||||
[qiandaoBtn setTitle:@"已签到" forState:UIControlStateNormal];
|
||||
|
||||
}else{
|
||||
[qiandaoBtn setTitle:@"立即签到" forState:UIControlStateNormal];
|
||||
|
||||
}
|
||||
|
||||
[qiandaoBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
[self.view addSubview:qiandaoBtn];
|
||||
[self.view bringSubviewToFront:qiandaoBtn];
|
||||
|
||||
}
|
||||
|
||||
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
|
||||
if (section == 0 || section == 2) {
|
||||
return 1;
|
||||
}
|
||||
return 2;
|
||||
|
||||
}
|
||||
|
||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||
|
||||
return 3;
|
||||
}
|
||||
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
|
||||
if (indexPath.section ==0) {
|
||||
|
||||
QianDaoTimeViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"QianDaoTimeViewCell"];
|
||||
if(cell==nil){
|
||||
|
||||
cell = [[[NSBundle mainBundle]loadNibNamed:@"QianDaoTimeViewCell" owner:self options:nil]lastObject];
|
||||
}
|
||||
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
[cell setQianDaoData];
|
||||
return cell;
|
||||
|
||||
|
||||
}else if (indexPath.section ==1&&indexPath.row ==0){
|
||||
QianDaoBannerViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"QianDaoBannerViewCell"];
|
||||
if(cell==nil){
|
||||
|
||||
cell = [[[NSBundle mainBundle]loadNibNamed:@"QianDaoBannerViewCell" owner:self options:nil]lastObject];
|
||||
}
|
||||
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
if (_bannerDataArr.count !=0) {
|
||||
NSArray *ads =self.bannerDataArr;
|
||||
NSMutableArray *imgs = [[NSMutableArray alloc] init];
|
||||
[ads enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
if ([obj isKindOfClass:[IfishBannerData class]]) {
|
||||
IfishBannerData *banner = (IfishBannerData *)obj;
|
||||
[imgs addObject:banner.adImage];
|
||||
}
|
||||
|
||||
}];
|
||||
|
||||
cell.adView.adList = imgs;
|
||||
__weak typeof (self)weakSelf = self;
|
||||
cell.adView.tapActionBlock =^(LXAdScrollView *adScrollView) {
|
||||
IfishBannerData *bdata = _bannerDataArr[adScrollView.currentPage];
|
||||
[weakSelf tapAdWithLink:bdata.adLink];
|
||||
};
|
||||
|
||||
}else{
|
||||
//默认加载本地
|
||||
cell.adView.adList = @[@"signin_banner.png"];
|
||||
cell.adView.tapActionBlock =^(LXAdScrollView *adScrollView) {
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
return cell;
|
||||
|
||||
}else if (indexPath.section ==1&&indexPath.row ==1){
|
||||
QianDaoWayTitleViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"QianDaoWayTitleViewCell"];
|
||||
if(cell==nil){
|
||||
|
||||
cell = [[[NSBundle mainBundle]loadNibNamed:@"QianDaoWayTitleViewCell" owner:self options:nil]lastObject];
|
||||
}
|
||||
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
return cell;
|
||||
|
||||
}else if (indexPath.section ==2&&indexPath.row ==0){
|
||||
QianDaoGongLueViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"QianDaoGongLueViewCell"];
|
||||
if(cell==nil){
|
||||
|
||||
cell = [[[NSBundle mainBundle]loadNibNamed:@"QianDaoGongLueViewCell" owner:self options:nil]lastObject];
|
||||
}
|
||||
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
return cell;
|
||||
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
- (void)didReceiveMemoryWarning {
|
||||
[super didReceiveMemoryWarning];
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
|
||||
if (indexPath.section ==0&&indexPath.row ==0) {
|
||||
return self.view.frame.size.width * 0.36;
|
||||
}else if (indexPath.section ==1&&indexPath.row ==0){
|
||||
return self.view.frame.size.width * 0.48;
|
||||
}else if (indexPath.section ==1&&indexPath.row ==1){
|
||||
return 44;
|
||||
}else if (indexPath.section ==2&&indexPath.row ==0){
|
||||
return 108;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
|
||||
|
||||
if (section ==0) {
|
||||
return 5;
|
||||
}else if (section ==1){
|
||||
return 10;
|
||||
}
|
||||
return 0.001;
|
||||
}
|
||||
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
|
||||
return 0.001;
|
||||
}
|
||||
|
||||
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
|
||||
|
||||
UIView *holdView =[[UIView alloc] init];
|
||||
holdView.backgroundColor = JWUIColorFromRGB(0xf2f2f2);
|
||||
return holdView;
|
||||
}
|
||||
|
||||
/*
|
||||
#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.
|
||||
}
|
||||
*/
|
||||
|
||||
#pragma mark - 签到
|
||||
-(void)qiandaoAction:(UIButton*)btn{
|
||||
|
||||
NSString *userId = [dataContorl dataControlGetUserIdInfo] ;
|
||||
__weak typeof (self) weakself = self;
|
||||
[AFHttpTool ifishSignIn:userId success:^(id response) {
|
||||
NSDictionary *reDic=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil];
|
||||
if ([reDic[@"result"] isEqualToString:@"100"]){
|
||||
btn.backgroundColor = RGB(221, 221, 221);
|
||||
btn.userInteractionEnabled = NO;
|
||||
[btn setTitle:@"已签到" forState:UIControlStateNormal];
|
||||
NSDictionary *userAssetDic = reDic[@"data"];
|
||||
IfishUserAsset *userAsset =[[IfishUserAsset alloc] initWithDict:userAssetDic];
|
||||
[dataContorl resetUserAsset:userAsset];
|
||||
|
||||
NSIndexSet *set = [NSIndexSet indexSetWithIndex:0];
|
||||
[weakself.tableView reloadSections:set withRowAnimation:UITableViewRowAnimationNone];
|
||||
[weakself.view makeToast: @"签到成功"];
|
||||
//签到成功 tost加金币
|
||||
NSString *addValue = [NSString stringWithFormat:@"%ld",(long)userAsset.addValue];
|
||||
[[IfishUserObsever sharedInstance] showAddGoldWith:addValue];
|
||||
//更新任务列表数据
|
||||
[IfishHelperUtils updateTask:EVERYDAYSIGNIN];
|
||||
|
||||
//连续签到七天神秘礼物(用是否砸过金蛋字段 1 砸guo)
|
||||
if (!userAsset.isHitGoldenEgg) {
|
||||
[weakself showGiftView];
|
||||
|
||||
}
|
||||
}else if ([reDic[@"result"] isEqualToString:@"402"]){
|
||||
[weakself.view makeToast: @"签到失败402"];
|
||||
}else{
|
||||
[weakself.view makeToast: @"签到失败101"];
|
||||
}
|
||||
|
||||
} failure:^(NSError *err) {
|
||||
[weakself.view makeToast: @"网络异常"];
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - 连续签到礼物
|
||||
|
||||
-(void)showGiftView{
|
||||
|
||||
QianDaoGiftView *levelUpView =[[QianDaoGiftView alloc] initWithFrame:[UIApplication sharedApplication].keyWindow.bounds];
|
||||
[[UIApplication sharedApplication].keyWindow addSubview:levelUpView];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - 我的任务
|
||||
-(void)wodeRenWuAction
|
||||
{
|
||||
_isPushNext = YES;
|
||||
WoDeRenWuViewController *wodeRenWuVC = [[WoDeRenWuViewController alloc] init];
|
||||
self.hidesBottomBarWhenPushed = YES;
|
||||
[self.navigationController pushViewController:wodeRenWuVC animated:YES];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - banner 点击事件
|
||||
-(void)tapAdWithLink:(NSString *)pushlink
|
||||
{
|
||||
|
||||
if (![pushlink isKindOfClass:[NSNull class]] &&pushlink && ![pushlink isEqualToString:@""]) {
|
||||
_isPushNext = YES;
|
||||
//字条串是否包含有某字符串
|
||||
if ([pushlink rangeOfString:@"taobao"].location == NSNotFound) {
|
||||
self.hidesBottomBarWhenPushed = YES;
|
||||
PushMasssageWebViewController*webVC=[[PushMasssageWebViewController alloc]init];
|
||||
webVC.pushlink =pushlink;
|
||||
webVC.pushtitle = @"详情";
|
||||
[self.navigationController pushViewController:webVC animated:YES];
|
||||
|
||||
} else {
|
||||
|
||||
[self openAliBCWithLink:pushlink];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-(void)openAliBCWithLink:(NSString *)linkUrl{
|
||||
|
||||
//535991514644
|
||||
//根据商品ID
|
||||
//id<AlibcTradePage> page = [AlibcTradePageFactory itemDetailPage: @"535991514644"];
|
||||
//根据链接打开页面
|
||||
id<AlibcTradePage> page = [AlibcTradePageFactory page:linkUrl];
|
||||
AlibcTradeShowParams* showParam = [[AlibcTradeShowParams alloc] init];
|
||||
//app 内闭环交易 强制H5 打开
|
||||
showParam.openType = AlibcOpenTypeH5;
|
||||
|
||||
//AlibcWebViewController* myView = [[AlibcWebViewController alloc] init];
|
||||
//自定义web
|
||||
IfishAlibcWebViewController* myView = [[IfishAlibcWebViewController alloc] init];
|
||||
NSInteger ret = [[AlibcTradeSDK sharedInstance].tradeService show:self.navigationController webView:myView.webView page:page showParams:showParam taoKeParams:nil trackParam:nil tradeProcessSuccessCallback:^(AlibcTradeResult * _Nullable result) {
|
||||
|
||||
} tradeProcessFailedCallback:^(NSError * _Nullable error) {
|
||||
|
||||
}]; //返回1,说明h5打开,否则不应该展示页面
|
||||
|
||||
|
||||
if (ret == 1) {
|
||||
|
||||
self.hidesBottomBarWhenPushed = YES;
|
||||
[self.navigationController pushViewController:myView animated:YES];
|
||||
self.hidesBottomBarWhenPushed = NO;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
Binary file not shown.
@@ -0,0 +1,164 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<array>
|
||||
<array>
|
||||
<dict>
|
||||
<key>taskId</key>
|
||||
<string>0</string>
|
||||
<key>addType</key>
|
||||
<string>everyDay</string>
|
||||
<key>ruleType</key>
|
||||
<string>everyDaySignin</string>
|
||||
<key>ruleDetail</key>
|
||||
<string>小手一抖,金币到手</string>
|
||||
<key>ruleTitle</key>
|
||||
<string>签到</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>taskId</key>
|
||||
<string>1</string>
|
||||
<key>addType</key>
|
||||
<string>everyDay</string>
|
||||
<key>ruleType</key>
|
||||
<string>readInformation</string>
|
||||
<key>ruleDetail</key>
|
||||
<string>阅读一条资讯</string>
|
||||
<key>ruleTitle</key>
|
||||
<string>阅读资讯</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>taskId</key>
|
||||
<string>2</string>
|
||||
<key>addType</key>
|
||||
<string>everyDay</string>
|
||||
<key>ruleType</key>
|
||||
<string>openGoodsLink</string>
|
||||
<key>ruleDetail</key>
|
||||
<string>打开一个商品链接</string>
|
||||
<key>ruleTitle</key>
|
||||
<string>查看商品</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>taskId</key>
|
||||
<string>3</string>
|
||||
<key>addType</key>
|
||||
<string>everyDay</string>
|
||||
<key>ruleType</key>
|
||||
<string>roomLeaveMsg</string>
|
||||
<key>ruleDetail</key>
|
||||
<string>在爱鱼看看中留言</string>
|
||||
<key>ruleTitle</key>
|
||||
<string>爱鱼看看</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>taskId</key>
|
||||
<string>5</string>
|
||||
<key>addType</key>
|
||||
<string>everyDay</string>
|
||||
<key>ruleType</key>
|
||||
<string>shareIfishApp</string>
|
||||
<key>ruleDetail</key>
|
||||
<string>分享爱鱼奇到朋友圈</string>
|
||||
<key>ruleTitle</key>
|
||||
<string>分享爱鱼奇</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>taskId</key>
|
||||
<string>4</string>
|
||||
<key>addType</key>
|
||||
<string>everyDay</string>
|
||||
<key>ruleType</key>
|
||||
<string>ifishCommunity</string>
|
||||
<key>ruleDetail</key>
|
||||
<string>进入爱鱼圈和鱼友交流</string>
|
||||
<key>ruleTitle</key>
|
||||
<string>爱鱼圈</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>taskId</key>
|
||||
<string>6</string>
|
||||
<key>addType</key>
|
||||
<string>everyDay</string>
|
||||
<key>ruleType</key>
|
||||
<string>shareCameraPicture</string>
|
||||
<key>ruleDetail</key>
|
||||
<string>分享图库中的图片到朋友圈(需要摄像头)</string>
|
||||
<key>ruleTitle</key>
|
||||
<string>图片分享</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>taskId</key>
|
||||
<string>7</string>
|
||||
<key>addType</key>
|
||||
<string>everyDay</string>
|
||||
<key>ruleType</key>
|
||||
<string>shareLookReport</string>
|
||||
<key>ruleDetail</key>
|
||||
<string>分享看护报告到朋友圈(需要摄像头)</string>
|
||||
<key>ruleTitle</key>
|
||||
<string>看护报告</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>taskId</key>
|
||||
<string>8</string>
|
||||
<key>addType</key>
|
||||
<string>once</string>
|
||||
<key>ruleType</key>
|
||||
<string>rename</string>
|
||||
<key>ruleDetail</key>
|
||||
<string>更换在爱鱼奇中的用户名</string>
|
||||
<key>ruleTitle</key>
|
||||
<string>更换姓名</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>taskId</key>
|
||||
<string>9</string>
|
||||
<key>addType</key>
|
||||
<string>once</string>
|
||||
<key>ruleType</key>
|
||||
<string>uploadHeadImg</string>
|
||||
<key>ruleDetail</key>
|
||||
<string>上传在爱鱼奇中的显示的头像</string>
|
||||
<key>ruleTitle</key>
|
||||
<string>上传头像</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>taskId</key>
|
||||
<string>10</string>
|
||||
<key>addType</key>
|
||||
<string>once</string>
|
||||
<key>ruleType</key>
|
||||
<string>openShareCamera</string>
|
||||
<key>ruleDetail</key>
|
||||
<string>开启爱鱼看看中的分享</string>
|
||||
<key>ruleTitle</key>
|
||||
<string>开启分享</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>taskId</key>
|
||||
<string>11</string>
|
||||
<key>addType</key>
|
||||
<string>once</string>
|
||||
<key>ruleType</key>
|
||||
<string>choiceLookShops</string>
|
||||
<key>ruleDetail</key>
|
||||
<string>在优选商家中选择一个看护商家</string>
|
||||
<key>ruleTitle</key>
|
||||
<string>优选商家</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>taskId</key>
|
||||
<string>12</string>
|
||||
<key>addType</key>
|
||||
<string>once</string>
|
||||
<key>ruleType</key>
|
||||
<string>ifishDoctor</string>
|
||||
<key>ruleDetail</key>
|
||||
<string>在鱼医生中发起一次提问</string>
|
||||
<key>ruleTitle</key>
|
||||
<string>鱼医生</string>
|
||||
</dict>
|
||||
</array>
|
||||
</array>
|
||||
</plist>
|
||||
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// IfishTaskModel.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 17/3/9.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface IfishTaskModel : NSObject
|
||||
|
||||
@property (nonatomic,copy) NSString *addType;
|
||||
@property (nonatomic,copy) NSString *ruleType;
|
||||
@property (nonatomic) BOOL isDone;
|
||||
@property (nonatomic) NSInteger addGoldValue;
|
||||
-(instancetype)initWithDict:(NSDictionary *)dict;
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
//
|
||||
// IfishTaskModel.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 17/3/9.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IfishTaskModel.h"
|
||||
|
||||
@implementation IfishTaskModel
|
||||
|
||||
-(void)encodeWithCoder:(NSCoder*)aCoder{
|
||||
[aCoder encodeObject:self.addType forKey:@"addType"];
|
||||
[aCoder encodeObject:self.ruleType forKey:@"ruleType"];
|
||||
[aCoder encodeBool:self.isDone forKey:@"isFinish"];
|
||||
[aCoder encodeInteger:self.addGoldValue forKey:@"addValue"];
|
||||
|
||||
}
|
||||
|
||||
-(id)initWithCoder:(NSCoder*)aDecoder{
|
||||
|
||||
if (self= [super init]) {
|
||||
self.addType=[aDecoder decodeObjectForKey:@"addType"];
|
||||
self.ruleType=[aDecoder decodeObjectForKey:@"ruleType"];
|
||||
self.isDone=[aDecoder decodeBoolForKey:@"isFinish"];
|
||||
self.addGoldValue=[aDecoder decodeIntegerForKey:@"addValue"];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
-(instancetype)initWithDict:(NSDictionary *)dict{
|
||||
if (self= [super init]) {
|
||||
self.addType = [dict objectForKey:@"addType"];
|
||||
self.ruleType = [dict objectForKey:@"ruleType"];
|
||||
self.isDone = [[dict objectForKey:@"isFinish"] boolValue];
|
||||
self.addGoldValue = [[dict objectForKey:@"addValue"] integerValue];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// IfishTaskRuletype.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 17/3/15.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface IfishTaskRuletype : NSObject
|
||||
@property (nonatomic,copy) NSString *taskId;
|
||||
@property (nonatomic,copy) NSString *addType;
|
||||
@property (nonatomic,copy) NSString *ruleType;
|
||||
@property (nonatomic,copy) NSString *ruleTitle;
|
||||
@property (nonatomic,copy) NSString *ruleDetail;
|
||||
-(instancetype)initWithDict:(NSDictionary *)dict;
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// IfishTaskRuletype.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 17/3/15.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IfishTaskRuletype.h"
|
||||
|
||||
@implementation IfishTaskRuletype
|
||||
-(instancetype)initWithDict:(NSDictionary *)dict{
|
||||
if (self= [super init]) {
|
||||
_ruleType = dict[@"ruleType"];
|
||||
_ruleTitle = dict[@"ruleTitle"];
|
||||
_ruleDetail = dict[@"ruleDetail"];
|
||||
_addType = dict[@"addType"];
|
||||
_taskId = dict[@"taskId"];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// IfishTaskViewCell.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 17/3/9.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "IfishTaskModel.h"
|
||||
#import "IfishTaskRuletype.h"
|
||||
@interface IfishTaskViewCell : UITableViewCell
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *taskImg;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *taskTitle;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *taskaddGold;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *isDoneTask;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *taskdetail;
|
||||
-(void)loadEveryDayDataWith:(IfishTaskRuletype*)model doneTaskArr:(NSArray *)doneTaskArr;
|
||||
|
||||
-(void)loadChioceDataWith:(IfishTaskRuletype*)model doneTaskArr:(NSArray *)doneTaskArr
|
||||
;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,55 @@
|
||||
//
|
||||
// IfishTaskViewCell.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 17/3/9.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IfishTaskViewCell.h"
|
||||
|
||||
@implementation IfishTaskViewCell
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
}
|
||||
-(void)loadEveryDayDataWith:(IfishTaskRuletype*)model doneTaskArr:(NSArray *)doneTaskArr
|
||||
{
|
||||
[self getdataWith:model doneTaskArr:(NSArray *)doneTaskArr];
|
||||
}
|
||||
|
||||
-(void)loadChioceDataWith:(IfishTaskRuletype*)model doneTaskArr:(NSArray *)doneTaskArr
|
||||
|
||||
{
|
||||
[self getdataWith:model doneTaskArr:(NSArray *)doneTaskArr];
|
||||
}
|
||||
|
||||
-(void)getdataWith:(IfishTaskRuletype*)model doneTaskArr:(NSArray *)doneTaskArr
|
||||
|
||||
{
|
||||
self.taskImg.image = [UIImage imageNamed:[NSString stringWithFormat:@"task_%@",model.ruleType]];
|
||||
|
||||
self.taskTitle.text = model.ruleTitle;
|
||||
self.taskdetail.text = model.ruleDetail;
|
||||
|
||||
for (IfishTaskModel *task in doneTaskArr) {
|
||||
if ([task.ruleType isEqualToString:model.ruleType]) {
|
||||
self.taskaddGold.text = [NSString stringWithFormat:@"+ %ld金币",(long)task.addGoldValue];
|
||||
self.isDoneTask.text = task.isDone ? @"已领取":@"未完成";
|
||||
self.isDoneTask.textColor = task.isDone ? RGB(227, 227, 227):RGB(255, 92, 92);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||
[super setSelected:selected animated:animated];
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,98 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="15G31" 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="Alignment constraints to the first baseline" minToolsVersion="6.0"/>
|
||||
<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="default" indentationWidth="10" reuseIdentifier="IfishTaskViewCell" rowHeight="60" id="KGk-i7-Jjw" customClass="IfishTaskViewCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="60"/>
|
||||
<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="375" height="59"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="4fu-iT-aSd">
|
||||
<rect key="frame" x="15" y="10" width="40" height="40"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="40" id="vk0-0H-k38"/>
|
||||
</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="0o5-Ky-AJw">
|
||||
<rect key="frame" x="68" y="10" width="38" height="17"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="17" id="ral-ys-sH0"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
<color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" 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="OcM-yp-S2R">
|
||||
<rect key="frame" x="68" y="33" width="31" height="17"/>
|
||||
<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>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="未完成" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Rxj-36-x7X">
|
||||
<rect key="frame" x="295" y="6" width="63" height="21"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="21" id="EQQ-74-f0R"/>
|
||||
<constraint firstAttribute="width" constant="63" id="ZJB-ec-0Lf"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
<color key="textColor" red="1" green="0.36078431372549019" blue="0.36078431372549019" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="+1金币" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="GpX-us-hFd">
|
||||
<rect key="frame" x="114" y="12" width="41" height="15"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="13"/>
|
||||
<color key="textColor" red="1" green="0.79607843137254897" blue="0.36078431372549019" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="451-KR-hX0">
|
||||
<rect key="frame" x="15" y="59" width="360" height="1"/>
|
||||
<color key="backgroundColor" red="0.94901960784313721" green="0.94901960784313721" blue="0.94901960784313721" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="1" id="cep-Iv-mDh"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="4fu-iT-aSd" firstAttribute="leading" secondItem="451-KR-hX0" secondAttribute="leading" id="0ja-dd-LBN"/>
|
||||
<constraint firstItem="0o5-Ky-AJw" firstAttribute="firstBaseline" secondItem="GpX-us-hFd" secondAttribute="firstBaseline" id="11T-kH-qy8"/>
|
||||
<constraint firstAttribute="trailingMargin" secondItem="Rxj-36-x7X" secondAttribute="trailing" constant="9" id="2J5-bn-0Yp"/>
|
||||
<constraint firstItem="GpX-us-hFd" firstAttribute="baseline" secondItem="Rxj-36-x7X" secondAttribute="baseline" id="Bdr-l1-VDt"/>
|
||||
<constraint firstItem="451-KR-hX0" firstAttribute="top" secondItem="4fu-iT-aSd" secondAttribute="bottom" constant="9" id="BqD-1i-1hP"/>
|
||||
<constraint firstItem="OcM-yp-S2R" firstAttribute="bottom" secondItem="4fu-iT-aSd" secondAttribute="bottom" id="Eey-X9-g6s"/>
|
||||
<constraint firstItem="0o5-Ky-AJw" firstAttribute="baseline" secondItem="GpX-us-hFd" secondAttribute="baseline" id="FCS-ZC-Vfh"/>
|
||||
<constraint firstAttribute="bottom" secondItem="451-KR-hX0" secondAttribute="bottom" id="GKs-Uz-Gt1"/>
|
||||
<constraint firstItem="4fu-iT-aSd" firstAttribute="top" secondItem="0o5-Ky-AJw" secondAttribute="top" id="OWZ-JX-peM"/>
|
||||
<constraint firstAttribute="trailing" secondItem="451-KR-hX0" secondAttribute="trailing" id="U26-MD-icq"/>
|
||||
<constraint firstItem="OcM-yp-S2R" firstAttribute="top" secondItem="0o5-Ky-AJw" secondAttribute="bottom" constant="6" id="Z9e-ek-Joi"/>
|
||||
<constraint firstItem="OcM-yp-S2R" firstAttribute="leading" secondItem="0o5-Ky-AJw" secondAttribute="leading" id="c0A-6p-5qG"/>
|
||||
<constraint firstItem="GpX-us-hFd" firstAttribute="leading" secondItem="0o5-Ky-AJw" secondAttribute="trailing" constant="8" id="ig6-Xi-ABL"/>
|
||||
<constraint firstItem="OcM-yp-S2R" firstAttribute="leading" secondItem="4fu-iT-aSd" secondAttribute="trailing" constant="13" id="l1T-J2-zim"/>
|
||||
<constraint firstItem="4fu-iT-aSd" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="pqU-sf-gCL"/>
|
||||
<constraint firstItem="Rxj-36-x7X" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="topMargin" constant="-2" id="rJ1-Ha-KUP"/>
|
||||
<constraint firstItem="451-KR-hX0" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="vPF-qC-2U3"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<connections>
|
||||
<outlet property="isDoneTask" destination="Rxj-36-x7X" id="D3O-4I-hZV"/>
|
||||
<outlet property="taskImg" destination="4fu-iT-aSd" id="Ugk-Aw-ccI"/>
|
||||
<outlet property="taskTitle" destination="0o5-Ky-AJw" id="4af-EU-wDc"/>
|
||||
<outlet property="taskaddGold" destination="GpX-us-hFd" id="O4K-I5-x6v"/>
|
||||
<outlet property="taskdetail" destination="OcM-yp-S2R" id="Brb-Fu-699"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="25.5" y="52"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// TaskHeadViewCell.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 17/3/9.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface TaskHeadViewCell : UITableViewCell
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// TaskHeadViewCell.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 17/3/9.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "TaskHeadViewCell.h"
|
||||
|
||||
@implementation TaskHeadViewCell
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
}
|
||||
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||
[super setSelected:selected animated:animated];
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="15G31" 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="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="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="TaskHeadViewCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="35"/>
|
||||
<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="375" height="34.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="完成以下任务,轻松赚取金币" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Tsb-JG-Shx">
|
||||
<rect key="frame" x="101.5" y="9.5" width="172.5" 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="Tsb-JG-Shx" firstAttribute="centerX" secondItem="H2p-sc-9uM" secondAttribute="centerX" id="EYa-Oi-97T"/>
|
||||
<constraint firstItem="Tsb-JG-Shx" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="wWd-is-Ek7"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<color key="backgroundColor" red="1" green="0.72549019607843135" blue="0.33725490196078434" alpha="0.30146748310810811" colorSpace="calibratedRGB"/>
|
||||
<point key="canvasLocation" x="24.5" y="51.5"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// TaskKindViewCell.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 17/3/9.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface TaskKindViewCell : UITableViewCell
|
||||
@property (weak, nonatomic) IBOutlet UILabel *taskTitle;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *doneTask;
|
||||
-(void)setCellDataAt:(NSIndexPath*)indexPath;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// TaskKindViewCell.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 17/3/9.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "TaskKindViewCell.h"
|
||||
|
||||
@implementation TaskKindViewCell
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
}
|
||||
|
||||
-(void)setCellDataAt:(NSIndexPath*)indexPath{
|
||||
if (indexPath.section ==1) {
|
||||
self.taskTitle.text = @"每日任务";
|
||||
|
||||
}else if (indexPath.section ==3){
|
||||
self.taskTitle.text = @"精选任务";
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||
[super setSelected:selected animated:animated];
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="15G31" 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="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="default" indentationWidth="10" reuseIdentifier="TaskKindViewCell" rowHeight="44" id="KGk-i7-Jjw" customClass="TaskKindViewCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
|
||||
<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="375" height="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="每日任务" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0RK-zw-ATy">
|
||||
<rect key="frame" x="27" y="17" width="118" height="21"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<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" fixedFrame="YES" text="Label" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nhl-YU-I4E">
|
||||
<rect key="frame" x="297" y="17" width="56" height="21"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="13"/>
|
||||
<color key="textColor" red="1" green="0.53725490200000003" blue="0.2274509804" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Ja6-jz-Hhm">
|
||||
<rect key="frame" x="15" y="18" width="4" height="16"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="1" green="0.53725490196078429" blue="0.22745098039215686" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="OTX-Us-fCP">
|
||||
<rect key="frame" x="0.0" y="43" width="375" height="1"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<color key="backgroundColor" red="0.94901960780000005" green="0.94901960780000005" blue="0.94901960780000005" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</view>
|
||||
</subviews>
|
||||
</tableViewCellContentView>
|
||||
<connections>
|
||||
<outlet property="doneTask" destination="nhl-YU-I4E" id="Mt5-cc-iGf"/>
|
||||
<outlet property="taskTitle" destination="0RK-zw-ATy" id="QNb-EW-xMm"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="24.5" y="52"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// WoDeRenWuViewController.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 17/3/9.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "BaseVIewContorller.h"
|
||||
|
||||
@interface WoDeRenWuViewController : BaseVIewContorller
|
||||
|
||||
@end
|
||||
+256
@@ -0,0 +1,256 @@
|
||||
//
|
||||
// WoDeRenWuViewController.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 17/3/9.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "WoDeRenWuViewController.h"
|
||||
#import "TaskHeadViewCell.h"
|
||||
#import "TaskKindViewCell.h"
|
||||
#import "IfishTaskViewCell.h"
|
||||
#import "IfishTaskModel.h"
|
||||
#import "IfishTaskRuletype.h"
|
||||
@interface WoDeRenWuViewController ()<UITableViewDelegate,UITableViewDataSource>
|
||||
@property(nonatomic,strong)UITableView *tableView;
|
||||
@property (nonatomic,strong) NSMutableArray *everyDayTask;
|
||||
@property (nonatomic,strong) NSArray *doneTasks;
|
||||
@property (nonatomic,strong) NSMutableArray *chosenTask;
|
||||
|
||||
@property (nonatomic) NSInteger everyDayDoneTaskCount;
|
||||
@property (nonatomic) NSInteger chosenDoneTaskCount;
|
||||
@end
|
||||
|
||||
@implementation WoDeRenWuViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
[self addTitleViewWithTitle:@"我的任务"];
|
||||
_everyDayTask = [[NSMutableArray alloc] init];
|
||||
_chosenTask = [[NSMutableArray alloc] init];
|
||||
_doneTasks = [[NSArray alloc] init];
|
||||
|
||||
_everyDayDoneTaskCount = 0;
|
||||
_chosenDoneTaskCount = 0;
|
||||
[self creatTab];
|
||||
//走网络 体验不好 换静态页面 app端处理任务完成数据
|
||||
//[self getData];
|
||||
[self initData];
|
||||
}
|
||||
|
||||
-(void)initData
|
||||
{
|
||||
|
||||
_doneTasks =[[DataCenter defaultDtacenter] valueForKey:IFISHTASK_ARR];
|
||||
|
||||
if ([_doneTasks count]!=0) {
|
||||
|
||||
for (IfishTaskModel *mode in _doneTasks) {
|
||||
|
||||
if ([mode.addType isEqualToString:@"everyDay"]) {
|
||||
if (mode.isDone) {
|
||||
_everyDayDoneTaskCount ++;
|
||||
}
|
||||
}else{
|
||||
|
||||
if (mode.isDone) {
|
||||
_chosenDoneTaskCount ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"IfishTask" ofType:@"plist"];
|
||||
|
||||
NSArray *data = [[NSArray alloc] initWithContentsOfFile:plistPath];
|
||||
|
||||
for (NSDictionary *listDic in data[0]) {
|
||||
IfishTaskRuletype *model=[[IfishTaskRuletype alloc] initWithDict:listDic];
|
||||
if ([model.addType isEqualToString:@"everyDay"]){
|
||||
|
||||
[_everyDayTask addObject:model];
|
||||
}else{
|
||||
[_chosenTask addObject:model];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//数组排序
|
||||
|
||||
// NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"taskId" ascending:YES];
|
||||
// NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:&sortDescriptor count:1];
|
||||
// [_everyDayTask sortUsingDescriptors:sortDescriptors];
|
||||
//
|
||||
|
||||
//数组排序
|
||||
// NSSortDescriptor *sortDescriptor2 = [[NSSortDescriptor alloc] initWithKey:@"taskId" ascending:YES];
|
||||
//NSArray *sortDescriptors2 = [[NSArray alloc] initWithObjects:sortDescriptor2,nil];
|
||||
|
||||
//_everyDayTask = (NSMutableArray*) [_everyDayTask sortedArrayUsingDescriptors:sortDescriptors2];
|
||||
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
|
||||
-(void)getData{
|
||||
//请求 获取规则金币信息接口
|
||||
__weak typeof (self) weakSelf =self;
|
||||
NSString *userId = [dataContorl dataControlGetUserIdInfo];
|
||||
[AFHttpTool getgGoldRuleInfo:userId success:^(id response) {
|
||||
NSDictionary *reDic=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil];
|
||||
if ([reDic[@"result"] isEqualToString:@"100"]){
|
||||
NSDictionary *dataDic = reDic[@"data"];
|
||||
NSArray *goldRules = dataDic[@"goldRules"];
|
||||
if (![goldRules isKindOfClass:[NSNull class]]&&goldRules) {
|
||||
for (NSDictionary *dic in goldRules) {
|
||||
IfishTaskModel *model = [[IfishTaskModel alloc] initWithDict:dic];
|
||||
if ([model.addType isEqualToString:@"everyDay"]) {
|
||||
[_everyDayTask addObject:model];
|
||||
if (model.isDone) {
|
||||
_everyDayDoneTaskCount ++;
|
||||
}
|
||||
}else{
|
||||
if (model.isDone) {
|
||||
_chosenDoneTaskCount ++;
|
||||
}
|
||||
[_chosenTask addObject:model];
|
||||
}
|
||||
|
||||
}
|
||||
[weakSelf.tableView reloadData];
|
||||
|
||||
}else{
|
||||
[self.view makeToast:@"暂无任务"];
|
||||
}
|
||||
}else{
|
||||
[self.view makeToast:@"请求失败"];
|
||||
}
|
||||
|
||||
} failure:^(NSError *err) {
|
||||
[self.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.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
self.tableView.showsVerticalScrollIndicator = NO;
|
||||
self.tableView.backgroundColor = JWUIColorFromRGB(0xf2f2f2);
|
||||
[self.view addSubview:self.tableView];
|
||||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
[super didReceiveMemoryWarning];
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
|
||||
if (section == 2) {
|
||||
//return [_everyDayTask count];
|
||||
return [_everyDayTask count];
|
||||
}else if (section == 4)
|
||||
{
|
||||
return [_chosenTask count];
|
||||
}
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||
|
||||
return 5;
|
||||
}
|
||||
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if (indexPath.section==0) {
|
||||
TaskHeadViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"TaskHeadViewCell"];
|
||||
if(cell==nil){
|
||||
|
||||
cell = [[[NSBundle mainBundle]loadNibNamed:@"TaskHeadViewCell" owner:self options:nil]lastObject];
|
||||
}
|
||||
|
||||
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
return cell;
|
||||
}else if (indexPath.section==1||indexPath.section ==3){
|
||||
TaskKindViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"TaskKindViewCell"];
|
||||
if(cell==nil){
|
||||
|
||||
cell = [[[NSBundle mainBundle]loadNibNamed:@"TaskKindViewCell" owner:self options:nil]lastObject];
|
||||
}
|
||||
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
[cell setCellDataAt:indexPath];
|
||||
if (indexPath.section ==1) {
|
||||
|
||||
cell.doneTask.text =[NSString stringWithFormat:@"%ld/%ld",(long)_everyDayDoneTaskCount,(unsigned long)[_everyDayTask count]];
|
||||
}else if (indexPath.section ==3){
|
||||
cell.doneTask.text =[NSString stringWithFormat:@"%ld/%ld",(long)_chosenDoneTaskCount,(unsigned long)[_chosenTask count]];
|
||||
}
|
||||
|
||||
return cell;
|
||||
|
||||
}else{
|
||||
|
||||
IfishTaskViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"IfishTaskViewCell"];
|
||||
if(cell==nil){
|
||||
|
||||
cell = [[[NSBundle mainBundle]loadNibNamed:@"IfishTaskViewCell" owner:self options:nil]lastObject];
|
||||
}
|
||||
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
if (indexPath.section ==2) {
|
||||
|
||||
IfishTaskRuletype * model =_everyDayTask[indexPath.row];
|
||||
[cell loadEveryDayDataWith:model doneTaskArr:_doneTasks];
|
||||
}else{;
|
||||
IfishTaskRuletype * model =_chosenTask[indexPath.row];
|
||||
[cell loadChioceDataWith:model doneTaskArr:_doneTasks];
|
||||
}
|
||||
return cell;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
|
||||
if (indexPath.section==0) {
|
||||
return 35*KWidth_Scale;
|
||||
}else if (indexPath.section==1||indexPath.section ==3){
|
||||
|
||||
return 44*KWidth_Scale;
|
||||
}else{
|
||||
|
||||
return 60*KWidth_Scale;
|
||||
}
|
||||
}
|
||||
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
|
||||
|
||||
return 0.01f;
|
||||
}
|
||||
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
|
||||
|
||||
if(section ==1){
|
||||
return 5.0f;
|
||||
}
|
||||
return 0.01f;
|
||||
}
|
||||
|
||||
/*
|
||||
#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
|
||||
Reference in New Issue
Block a user