Initial commit

This commit is contained in:
ifish
2017-08-15 16:59:01 +08:00
commit bdc83e07ef
5766 changed files with 423223 additions and 0 deletions
@@ -0,0 +1,22 @@
//
// IfishInformations.h
// Ifish
//
// Created by imac on 17/3/13.
// Copyright © 2017年 lianlian. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface IfishInformations : NSObject
@property (nonatomic) int clickNum;
@property (nonatomic) int pinglunNum;
@property (nonatomic,copy) NSString *contents;
@property (nonatomic,copy) NSString *image;
@property (nonatomic) int infoId;
@property (nonatomic,copy) NSString *link;
@property (nonatomic,copy) NSString *title;
-(instancetype)initWithDict:(NSDictionary *)dict;
@end
@@ -0,0 +1,27 @@
//
// IfishInformations.m
// Ifish
//
// Created by imac on 17/3/13.
// Copyright © 2017年 lianlian. All rights reserved.
//
#import "IfishInformations.h"
@implementation IfishInformations
-(instancetype)initWithDict:(NSDictionary *)dict
{
if (self=[super init]) {
_clickNum = [[dict objectForKey:@"clickNum"] intValue];
_contents = [dict objectForKey:@"contents"];
_image = [dict objectForKey:@"image"];
_infoId = [[dict objectForKey:@"infoId"] intValue];
_link = [dict objectForKey:@"link"];
_pinglunNum = [[dict objectForKey:@"pinglunNum"] intValue];
_title = [dict objectForKey:@"title"];
}
return self;
}
@end
@@ -0,0 +1,13 @@
//
// IfishInfoDetailContentViewCell.h
// Ifish
//
// Created by imac on 17/3/23.
// Copyright © 2017年 lianlian. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface IfishInfoDetailContentViewCell : UITableViewCell
@end
@@ -0,0 +1,24 @@
//
// IfishInfoDetailContentViewCell.m
// Ifish
//
// Created by imac on 17/3/23.
// Copyright © 2017年 lianlian. All rights reserved.
//
#import "IfishInfoDetailContentViewCell.h"
@implementation IfishInfoDetailContentViewCell
- (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,40 @@
<?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="IfishInfoDetailContentViewCell" rowHeight="200" id="KGk-i7-Jjw" customClass="IfishInfoDetailContentViewCell">
<rect key="frame" x="0.0" y="0.0" width="320" height="200"/>
<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="199.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="9Zm-SE-YUT">
<rect key="frame" x="14" y="8" width="298" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="EFQ-n5-XiD">
<rect key="frame" x="14" y="37" width="298" height="132"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<string key="text">实际上,克强总理出访时去对方首都以外的地方并不少见。去年11月,克强总理访问俄罗斯,先来到俄总理梅德韦杰夫的家乡圣彼得堡,书写了一笔浓墨重彩的“家乡外交”;去年9月,克强总理访问加拿大时去了加总理特鲁多的家乡蒙特利尔,并与特鲁多共同上演了一场“冰球外交”,给外界留下深刻印象;2014年10月,克强总理访问意大利,除了首都罗马还去了米兰,是为了出席亚欧首脑会议……</string>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
</tableViewCell>
</objects>
</document>
@@ -0,0 +1,13 @@
//
// IfishInfoDetailPingLunCell.h
// Ifish
//
// Created by imac on 17/3/23.
// Copyright © 2017年 lianlian. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface IfishInfoDetailPingLunCell : UITableViewCell
@end
@@ -0,0 +1,24 @@
//
// IfishInfoDetailPingLunCell.m
// Ifish
//
// Created by imac on 17/3/23.
// Copyright © 2017年 lianlian. All rights reserved.
//
#import "IfishInfoDetailPingLunCell.h"
@implementation IfishInfoDetailPingLunCell
- (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,43 @@
<?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="IfishInfoDetailPingLunCell" id="KGk-i7-Jjw" customClass="IfishInfoDetailPingLunCell">
<rect key="frame" x="0.0" y="0.0" width="320" 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="320" height="59.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kG9-NK-c0J">
<rect key="frame" x="45" y="8" width="267" height="16"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Kpc-9w-Y8O">
<rect key="frame" x="8" y="32" width="304" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="10"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="0Y3-kz-VB0">
<rect key="frame" x="8" y="2" width="29" height="28"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
</subviews>
</tableViewCellContentView>
</tableViewCell>
</objects>
</document>
@@ -0,0 +1,20 @@
//
// IfishInformationListViewCell.h
// Ifish
//
// Created by imac on 17/3/15.
// Copyright © 2017年 lianlian. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "IfishInformations.h"
@interface IfishInformationListViewCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UIImageView *newsimg;
@property (weak, nonatomic) IBOutlet UILabel *titlelab;
@property (weak, nonatomic) IBOutlet UILabel *detailLabe;
@property (weak, nonatomic) IBOutlet UILabel *watchNumber;
@property (weak, nonatomic) IBOutlet UILabel *pinglunNumber;
-(void)loadCellDataWith:(IfishInformations *)info;
@end
@@ -0,0 +1,35 @@
//
// IfishInformationListViewCell.m
// Ifish
//
// Created by imac on 17/3/15.
// Copyright © 2017年 lianlian. All rights reserved.
//
#import "IfishInformationListViewCell.h"
#import "UIImageView+WebCache.h"
@implementation IfishInformationListViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
-(void)loadCellDataWith:(IfishInformations *)info
{
[self.newsimg sd_setImageWithURL:[NSURL URLWithString:info.image]];
self.titlelab.text = info.title;
self.detailLabe.text = info.contents;
self.watchNumber.text = [NSString stringWithFormat:@"%d",info.clickNum];
self.pinglunNumber.text = [NSString stringWithFormat:@"%d",info.pinglunNum];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
@@ -0,0 +1,123 @@
<?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="IfishInformationListViewCell" rowHeight="80" id="KGk-i7-Jjw" customClass="IfishInformationListViewCell">
<rect key="frame" x="0.0" y="0.0" width="320" height="95"/>
<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="94.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="THd-Bu-zD5">
<rect key="frame" x="17" y="10" width="89" height="75"/>
<constraints>
<constraint firstAttribute="width" constant="89" id="0Pc-4E-ufb"/>
<constraint firstAttribute="height" constant="75" id="KcI-Vb-QWI"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="内容摘要" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="j2f-hz-gt7">
<rect key="frame" x="114" y="33" width="198" height="15"/>
<constraints>
<constraint firstAttribute="height" constant="15" id="Mem-ah-ew5"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<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="JgQ-HP-X5l">
<rect key="frame" x="114" y="10" width="198" height="21"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="BEA-GV-KLN"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="21M-GY-1ue">
<rect key="frame" x="0.0" y="94" width="320" height="1"/>
<color key="backgroundColor" red="0.83529411764705885" green="0.83529411764705885" blue="0.83529411764705885" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="Swk-c6-aZl"/>
</constraints>
</view>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="informationlist_view.png" translatesAutoresizingMaskIntoConstraints="NO" id="4WM-Lf-mP1">
<rect key="frame" x="208" y="69" width="20" height="12"/>
<constraints>
<constraint firstAttribute="height" constant="12" id="5Q6-5Z-GhG"/>
<constraint firstAttribute="width" constant="20" id="kt8-Rt-4lN"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="1000" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="8BV-KU-YQ2">
<rect key="frame" x="234.5" y="64" width="28.5" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="CWc-Pp-MZi"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" red="0.66666666666666663" green="0.66666666666666663" blue="0.66666666666666663" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="10" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tos-bK-aju">
<rect key="frame" x="298.5" y="65" width="13.5" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="aPb-az-2hG"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" red="0.66666666666666663" green="0.66666666666666663" blue="0.66666666666666663" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="informationlist_comment.png" translatesAutoresizingMaskIntoConstraints="NO" id="akZ-xg-M7C">
<rect key="frame" x="278" y="69" width="16" height="13"/>
<constraints>
<constraint firstAttribute="height" constant="13" id="jI9-LF-fAx"/>
<constraint firstAttribute="width" constant="16" id="jlO-wX-UXc"/>
</constraints>
</imageView>
</subviews>
<constraints>
<constraint firstAttribute="bottomMargin" secondItem="tos-bK-aju" secondAttribute="bottom" constant="1.5" id="3KU-Xf-QSJ"/>
<constraint firstItem="THd-Bu-zD5" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="4q2-ep-Lz6"/>
<constraint firstItem="tos-bK-aju" firstAttribute="leading" secondItem="akZ-xg-M7C" secondAttribute="trailing" constant="4.5" id="8VK-iy-Oir"/>
<constraint firstAttribute="trailingMargin" secondItem="j2f-hz-gt7" secondAttribute="trailing" id="AMc-t9-yZi"/>
<constraint firstItem="j2f-hz-gt7" firstAttribute="leading" secondItem="THd-Bu-zD5" secondAttribute="trailing" constant="8" id="B9R-WW-fmz"/>
<constraint firstAttribute="trailing" secondItem="21M-GY-1ue" secondAttribute="trailing" id="Cbb-pX-NWd"/>
<constraint firstItem="JgQ-HP-X5l" firstAttribute="top" secondItem="THd-Bu-zD5" secondAttribute="top" id="FSL-W9-y6a"/>
<constraint firstItem="8BV-KU-YQ2" firstAttribute="leading" secondItem="4WM-Lf-mP1" secondAttribute="trailing" constant="6.5" id="Fk4-WP-Itg"/>
<constraint firstAttribute="bottomMargin" secondItem="akZ-xg-M7C" secondAttribute="bottom" constant="4.5" id="Hdc-sH-uvA"/>
<constraint firstAttribute="bottomMargin" secondItem="8BV-KU-YQ2" secondAttribute="bottom" constant="2.5" id="MQW-Yy-pTi"/>
<constraint firstAttribute="bottomMargin" secondItem="4WM-Lf-mP1" secondAttribute="bottom" constant="5.5" id="S0d-uR-8pW"/>
<constraint firstAttribute="trailingMargin" secondItem="tos-bK-aju" secondAttribute="trailing" id="bLD-S3-j90"/>
<constraint firstItem="akZ-xg-M7C" firstAttribute="leading" secondItem="8BV-KU-YQ2" secondAttribute="trailing" constant="15" id="bfB-wH-t10"/>
<constraint firstItem="THd-Bu-zD5" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leadingMargin" constant="9" id="bxm-rl-y2u"/>
<constraint firstItem="JgQ-HP-X5l" firstAttribute="leading" secondItem="THd-Bu-zD5" secondAttribute="trailing" constant="8" id="c0A-m8-7o4"/>
<constraint firstItem="21M-GY-1ue" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="e7S-Pw-Xnv"/>
<constraint firstAttribute="bottom" secondItem="21M-GY-1ue" secondAttribute="bottom" id="eQt-ey-poe"/>
<constraint firstItem="j2f-hz-gt7" firstAttribute="top" secondItem="JgQ-HP-X5l" secondAttribute="bottom" constant="2" id="fgL-3A-GSX"/>
<constraint firstAttribute="trailingMargin" secondItem="JgQ-HP-X5l" secondAttribute="trailing" id="vgK-9J-52g"/>
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="detailLabe" destination="j2f-hz-gt7" id="Qgk-YF-MRi"/>
<outlet property="newsimg" destination="THd-Bu-zD5" id="g18-wW-Op9"/>
<outlet property="pinglunNumber" destination="tos-bK-aju" id="IQ3-8n-Qj8"/>
<outlet property="titlelab" destination="JgQ-HP-X5l" id="FY1-ZH-i8R"/>
<outlet property="watchNumber" destination="8BV-KU-YQ2" id="CNc-cU-kJZ"/>
</connections>
<point key="canvasLocation" x="33" y="57.5"/>
</tableViewCell>
</objects>
<resources>
<image name="informationlist_comment.png" width="27" height="22"/>
<image name="informationlist_view.png" width="32" height="20"/>
</resources>
</document>
@@ -0,0 +1,14 @@
//
// IfishZiXunAdViewCell.h
// Ifish
//
// Created by imac on 17/3/22.
// Copyright © 2017年 lianlian. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "LXAdScrollView.h"
@interface IfishZiXunAdViewCell : UITableViewCell
@property (weak, nonatomic) IBOutlet LXAdScrollView *newsAdview;
@end
@@ -0,0 +1,24 @@
//
// IfishZiXunAdViewCell.m
// Ifish
//
// Created by imac on 17/3/22.
// Copyright © 2017年 lianlian. All rights reserved.
//
#import "IfishZiXunAdViewCell.h"
@implementation IfishZiXunAdViewCell
- (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,39 @@
<?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="IfishZiXunAdViewCell" rowHeight="160" id="KGk-i7-Jjw" customClass="IfishZiXunAdViewCell">
<rect key="frame" x="0.0" y="0.0" width="375" height="160"/>
<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="159.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="h41-WO-1Yc" customClass="LXAdScrollView">
<rect key="frame" x="0.0" y="0.0" width="375" height="160"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
</subviews>
<constraints>
<constraint firstAttribute="bottom" secondItem="h41-WO-1Yc" secondAttribute="bottom" id="YF7-I9-8yJ"/>
<constraint firstItem="h41-WO-1Yc" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="ekK-qe-0p1"/>
<constraint firstAttribute="trailing" secondItem="h41-WO-1Yc" secondAttribute="trailing" id="x4j-TF-2N0"/>
<constraint firstItem="h41-WO-1Yc" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="zGE-hz-2EX"/>
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="newsAdview" destination="h41-WO-1Yc" id="MT7-lH-4aF"/>
</connections>
<point key="canvasLocation" x="24.5" y="52"/>
</tableViewCell>
</objects>
</document>
@@ -0,0 +1,13 @@
//
// IfishInformationViewController.h
// Ifish
//
// Created by imac on 17/3/13.
// Copyright © 2017年 lianlian. All rights reserved.
//
#import "BaseVIewContorller.h"
@interface IfishInformationViewController : BaseVIewContorller
@end
@@ -0,0 +1,421 @@
//
// IfishInformationViewController.m
// Ifish
//
// Created by imac on 17/3/13.
// Copyright © 2017年 lianlian. All rights reserved.
//
#import "IfishInformationViewController.h"
#import "IfishInformationListViewCell.h"
#import "IfishZiXunAdViewCell.h"
#import "PushMasssageWebViewController.h"
#import "IfishInformations.h"
#import "PushMasssageWebViewController.h"
#import "JHRefresh.h"
#import "IfishUserDefaultHelper.h"
#import <AlibcTradeSDK/AlibcTradeSDK.h>
#import "IfishAlibcWebViewController.h"
@interface IfishInformationViewController ()<UITableViewDelegate,UITableViewDataSource>
{
BOOL _isPush;
BOOL _isRefreshing;
BOOL _isLoadMore;
}
@property (nonatomic,strong) UITableView *tableView;
@property (nonatomic,strong) NSMutableArray *bannerDataArr;
@property (nonatomic,strong) NSMutableArray *listDataArr;
@property(nonatomic,copy) NSString* total;
@property(nonatomic) int page;
@property(nonatomic)BOOL isRefreshing;
@property(nonatomic)BOOL isLoadMore;
@property(nonatomic) NSIndexPath *didSelectIndexPath;
@end
@implementation IfishInformationViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
[self addTitleViewWithTitle:@"资讯"];
_isPush = NO;
_bannerDataArr = [[NSMutableArray alloc] init];
_listDataArr = [[NSMutableArray alloc] init];
[self creatTab];
[self initBannerData];
[self initInformations];
[self creatReatRefreshView];
}
-(void)initInformations
{
//NSArray *arr = [[IfishDatabaseManager sharedManager] readInformations];
//IfishInformations *mode = arr[0];
//NSLog(@"arr##%@",arr);
//NSLog(@"IfishInformations0## mode.title:%@ , mode.clickNum:%d",mode.title,mode.clickNum);
[self loadDataWith:0 pageSize:10 isRefres:NO];
}
-(void)creatTab{
_tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleGrouped];
_tableView.dataSource = self;
_tableView.delegate = self;
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
_tableView.backgroundColor = RGB(242, 242, 242);
[self.view addSubview:_tableView];
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
if (section ==0) {
return 1;
}
return _listDataArr.count;
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
return 2;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
if (indexPath.section ==0) {
IfishZiXunAdViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"IfishZiXunAdViewCell"];
if (!cell) {
cell = [[[NSBundle mainBundle] loadNibNamed:@"IfishZiXunAdViewCell" owner:self options:nil] lastObject];
}
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.newsAdview.adList = imgs;
__weak typeof (self)weakSelf = self;
cell.newsAdview.tapActionBlock =^(LXAdScrollView *adScrollView) {
IfishBannerData *bdata = _bannerDataArr[adScrollView.currentPage];
[weakSelf tapAdWithLink:bdata.adLink];
};
}else{
//默认加载本地
cell.newsAdview.adList = @[@"Ifishbanner_zixun.jpg"];
cell.newsAdview.tapActionBlock =^(LXAdScrollView *adScrollView) {
};
}
return cell;
}
IfishInformationListViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"IfishInformationListViewCell"];
if (!cell) {
cell = [[[NSBundle mainBundle] loadNibNamed:@"IfishInformationListViewCell" owner:self options:nil] lastObject];
}
IfishInformations *model =_listDataArr[indexPath.row];
[cell loadCellDataWith:model];
return cell;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
if (indexPath.section==0) {
return self.view.frame.size.width * 0.427;//320/750
}
return 95;
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
return 0.01f;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if (indexPath.section !=0) {
//每日打开资讯链接 加金币
[[IfishUserObsever sharedInstance] addGoldWith:READINFORMATION addType:IFISHADDGOLDTYPE0];
_isPush = YES;
PushMasssageWebViewController*webVC=[[PushMasssageWebViewController alloc]init];
webVC.pushtitle = @"资讯详情";
IfishInformations *model =_listDataArr[indexPath.row];
webVC.pushlink = model.link;
//观看数加一 不考虑打开成功与否
model.clickNum ++;
_didSelectIndexPath = indexPath;
[self addClicknumber:model.infoId];
NSString *infoIdstr = [NSString stringWithFormat:@"%d",model.infoId];
//首页资讯红点标志位
//是否比当前值大 大则存储
NSString *oldId = [IfishUserDefaultHelper getDefualtInfoId];
if (!oldId) {
oldId = @"";
}
if (infoIdstr.intValue >= oldId.intValue) {
[IfishUserDefaultHelper saveinfoId:infoIdstr];
}
self.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:webVC animated:YES];
}
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
if (_isPush) {
//NSIndexSet *asset = [NSIndexSet indexSetWithIndex:0];
//[self.tableView reloadSections:asset withRowAnimation:UITableViewRowAnimationNone];
NSIndexPath *indexPath =[NSIndexPath indexPathForRow:0 inSection:0];
NSArray *arr =nil;
if (_didSelectIndexPath) {
arr =@[indexPath,_didSelectIndexPath];
}else{
arr =@[indexPath];
}
[self.tableView reloadRowsAtIndexPaths:arr withRowAnimation:UITableViewRowAnimationNone];
}
}
-(void)initBannerData
{
__weak typeof (self)weakSelf = self;
[AFHttpTool getIfishBannerData:IfishAdTypeZiXun 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];
}
NSIndexPath *indexPath =[NSIndexPath indexPathForRow:0 inSection:0];
NSArray *arr=@[indexPath];
[weakSelf.tableView reloadRowsAtIndexPaths:arr withRowAnimation:UITableViewRowAnimationNone];
}
}else{
//[weakSelf.view makeToast:@"广告位获取失败"];
}
} failure:^(NSError *err) {
}];
}
#pragma mark - banner 点击事件
-(void)tapAdWithLink:(NSString *)pushlink
{
if (![pushlink isKindOfClass:[NSNull class]] &&pushlink && ![pushlink isEqualToString:@""]) {
_isPush = 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];
}
}
#pragma mark 刷新 加载时更多
-(void)creatReatRefreshView{
__weak typeof (self)weskSelf=self;
// 下拉刷新
[weskSelf.tableView addRefreshHeaderViewWithAniViewClass:[JHRefreshAmazingAniView class] beginRefresh:^{
if (weskSelf.isRefreshing) {
return ;
}
weskSelf.isRefreshing=YES;
_page=0;
NSInteger firstResult = 0;
NSInteger pageSize = 10;
[weskSelf addRefreshHeaderTaskWithFirst:firstResult pageSize:pageSize isRefresh:YES];
}];
//上拉加载更多
[weskSelf.tableView addRefreshFooterViewWithAniViewClass:[JHRefreshCommonAniView class] beginRefresh:^{
if (weskSelf.isLoadMore) {
return ;
}
weskSelf.isLoadMore=YES;
NSInteger pagecount =[self.total integerValue]/10+1;
if (weskSelf.page<pagecount-1) {
weskSelf.page++;
NSInteger first=(NSInteger)weskSelf.page*10;
NSInteger pageSize = 10;
[weskSelf addRefreshFooterTaskWithFirst:first pageSize:pageSize isRefres:YES];
}else{
[weskSelf endRefreshing];
[weskSelf.view makeToast:@"已无更多数据"];
}
}];
}
-(void)endRefreshing{
if (self.isRefreshing) {
self.isRefreshing=NO;
[self.tableView headerEndRefreshingWithResult:JHRefreshResultNone];
}
if (self.isLoadMore) {
self.isLoadMore=NO;
[self.tableView footerEndRefreshing];
}
}
#pragma mark -刷新
-(void)addRefreshHeaderTaskWithFirst:(NSInteger)firstResult pageSize:(NSInteger)pageSize isRefresh:(BOOL)isRefresh{
[self loadDataWith:firstResult pageSize:pageSize isRefres:isRefresh];
}
#pragma mark -加载更多
-(void)addRefreshFooterTaskWithFirst:(NSInteger)firstResult pageSize:(NSInteger)pageSize isRefres:(BOOL)isRefresh
{
[self loadDataWith:firstResult pageSize:pageSize isRefres:isRefresh];
}
-(void)loadDataWith:(NSInteger)firstResult pageSize:(NSInteger)pageSize isRefres:(BOOL)isRefresh
{
__weak typeof (self)weakSelf = self;
NSString *userId= [dataContorl dataControlGetUserIdInfo];
[AFHttpTool ifishGetInformations:firstResult pageSize:pageSize userId:userId success:^(id response) {
NSDictionary *reDic=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil];
NSString *result=reDic[@"result"];
_total = reDic[@"total"];
if ([result isEqualToString:@"100"]) {
NSArray *dataarr =reDic[@"data"];
if (self.isRefreshing&&isRefresh) {
[_listDataArr removeAllObjects];
}
for (NSDictionary *dic in dataarr) {
IfishInformations *info =[[IfishInformations alloc] initWithDict:dic];
[_listDataArr addObject:info];
//[[IfishDatabaseManager sharedManager] insertIfishInformations:model];
}
NSIndexSet *asset = [NSIndexSet indexSetWithIndex:1];
[weakSelf.tableView reloadSections:asset withRowAnimation:UITableViewRowAnimationNone];
}
[weakSelf endRefreshing];
} failure:^(NSError *err) {
[weakSelf endRefreshing];
}];
}
#pragma mark - 增加点击数
-(void)addClicknumber:(int)infoId{
[AFHttpTool ifishAdditionClickNum:infoId success:^(id response) {
NSDictionary *reDic=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil];
NSString *result=reDic[@"result"];
if ([result isEqualToString:@"100"]) {
//NSDictionary *dict = reDic[@"data"];
//int clickNum = [[dict objectForKey:@"clickNum"] intValue];
//int infoId = [[dict objectForKey:@"infoId"] intValue];
}
} failure:^(NSError *err) {
}];
}
/*
#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