Initial commit
This commit is contained in:
Vendored
BIN
Binary file not shown.
BIN
Binary file not shown.
+20
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// IfishCommentEditeView.h
|
||||
// CollectionViewTest
|
||||
//
|
||||
// Created by imac on 17/2/22.
|
||||
// Copyright © 2017年 xiang. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface IfishCommentEditeView : UIView
|
||||
@property (nonatomic, strong) UITextField *commentTextField;
|
||||
@property (nonatomic, strong) UIButton *sendButton;
|
||||
@property (nonatomic, copy) void (^SendCommentHandler)(NSString *content);
|
||||
@property (nonatomic, strong) UIView *commentInputView;
|
||||
@property (nonatomic, copy) NSString *palceholderText;
|
||||
|
||||
-(void)setPalceholderText:(NSString *)palceholderText;
|
||||
|
||||
@end
|
||||
+164
@@ -0,0 +1,164 @@
|
||||
//
|
||||
// IfishCommentEditeView.m
|
||||
// CollectionViewTest
|
||||
//
|
||||
// Created by imac on 17/2/22.
|
||||
// Copyright © 2017年 xiang. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IfishCommentEditeView.h"
|
||||
@interface IfishCommentEditeView ()<UITextFieldDelegate>
|
||||
|
||||
@end
|
||||
|
||||
@implementation IfishCommentEditeView
|
||||
|
||||
-(instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
if (self = [super initWithFrame:frame]) {
|
||||
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
//self.alpha = 0.3;
|
||||
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(dismissSelfViewTap)];
|
||||
[self addGestureRecognizer:tap];
|
||||
[self creatInpuView];
|
||||
//黑色背景 个人强烈建议加上 需求不要去掉
|
||||
UIView *holdView =[[UIView alloc] initWithFrame:frame];
|
||||
holdView.backgroundColor = [UIColor blackColor];
|
||||
holdView.alpha = 0.3;
|
||||
//[self addSubview:holdView];
|
||||
[self bringSubviewToFront:self.commentInputView];
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)creatInpuView{
|
||||
NSArray *commentInputNibs = [[NSBundle mainBundle]loadNibNamed:@"IfishCommentEditeView" owner:self options:nil];
|
||||
UIView *commentInputView = [commentInputNibs objectAtIndex:0];
|
||||
self.commentInputView = commentInputView;
|
||||
self.commentTextField = [commentInputView.subviews objectAtIndex:0];
|
||||
self.sendButton = [commentInputView.subviews objectAtIndex:1];
|
||||
self.sendButton.clipsToBounds = YES;
|
||||
self.sendButton.layer.cornerRadius = self.sendButton.frame.size.height/2;
|
||||
self.commentTextField.delegate = self;
|
||||
[self.commentTextField becomeFirstResponder];
|
||||
|
||||
|
||||
self.commentInputView.frame = CGRectMake(0, self.frame.size.height-self.commentInputView.frame.size.height, self.frame.size.width, self.commentInputView.frame.size.height);
|
||||
[self addSubview:self.commentInputView];
|
||||
[self bringSubviewToFront:self.commentInputView];
|
||||
[self.sendButton addTarget:self action:@selector(sendCommend) forControlEvents:UIControlEventTouchUpInside];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(keyboardWillHide:)
|
||||
name:UIKeyboardWillHideNotification
|
||||
object:nil];
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void)setPalceholderText:(NSString *)palceholderText
|
||||
{
|
||||
_palceholderText = palceholderText;
|
||||
|
||||
}
|
||||
|
||||
- (void)sendCommend
|
||||
{
|
||||
if (self.commentTextField.text.length > 200) {
|
||||
[self makeToast:@"评论内容不能超过200字"];
|
||||
return;
|
||||
}
|
||||
if (self.commentTextField.text.length == 0) {
|
||||
[self makeToast:@"评论内容不能为空"];
|
||||
return;
|
||||
}
|
||||
|
||||
if (self.SendCommentHandler) {
|
||||
self.SendCommentHandler(self.commentTextField.text);
|
||||
}
|
||||
|
||||
[self dismissKeyboard];
|
||||
|
||||
}
|
||||
|
||||
- (void)dismissKeyboard
|
||||
{
|
||||
|
||||
if ([self.commentTextField becomeFirstResponder]) {
|
||||
[self.commentTextField resignFirstResponder];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)dismissSelfViewTap{
|
||||
|
||||
[self removeFromSuperview];
|
||||
|
||||
}
|
||||
|
||||
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField;
|
||||
{
|
||||
if (textField ==self.commentTextField) {
|
||||
textField.placeholder = _palceholderText;
|
||||
}
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
-(BOOL)textFieldShouldReturn:(UITextField *)textField{
|
||||
|
||||
if (textField ==self.commentTextField) {
|
||||
[self sendCommend];
|
||||
}
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)keyboardWillShow:(NSNotification*)notification {
|
||||
|
||||
// get keyboard size and loctaion
|
||||
CGRect keyboardBounds;
|
||||
[[notification.userInfo valueForKey:UIKeyboardFrameEndUserInfoKey] getValue: &keyboardBounds];
|
||||
NSNumber *duration = [notification.userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey];
|
||||
NSNumber *curve = [notification.userInfo objectForKey:UIKeyboardAnimationCurveUserInfoKey];
|
||||
|
||||
// Need to translate the bounds to account for rotation.
|
||||
keyboardBounds = [self convertRect:keyboardBounds toView:nil];
|
||||
|
||||
// get a rect for the textView frame
|
||||
CGRect commentInputViewFrame = self.commentInputView.frame;
|
||||
commentInputViewFrame.origin.y = self.bounds.size.height - (keyboardBounds.size.height + commentInputViewFrame.size.height);
|
||||
|
||||
// animations settings
|
||||
[UIView beginAnimations:nil context:NULL];
|
||||
[UIView setAnimationBeginsFromCurrentState:YES];
|
||||
[UIView setAnimationDuration:[duration doubleValue]];
|
||||
[UIView setAnimationCurve:[curve intValue]];
|
||||
|
||||
// set views with new info
|
||||
self.commentInputView.frame = commentInputViewFrame;
|
||||
|
||||
[UIView commitAnimations];
|
||||
|
||||
|
||||
}
|
||||
|
||||
- (void) keyboardWillHide:(NSNotification *)note
|
||||
{
|
||||
[self dismissSelfView];
|
||||
}
|
||||
-(void)dismissSelfView
|
||||
{
|
||||
[self removeFromSuperview];
|
||||
|
||||
}
|
||||
- (void)dealloc
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
self.commentInputView = nil;
|
||||
self.commentTextField = nil;
|
||||
|
||||
}
|
||||
@end
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
<?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"/>
|
||||
<view contentMode="scaleToFill" id="iN0-l3-epB">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="50"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="mc2-cD-RYw">
|
||||
<rect key="frame" x="16" y="10" width="222" height="30"/>
|
||||
<nil key="textColor"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits" returnKeyType="send"/>
|
||||
</textField>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="SCm-6c-OCD">
|
||||
<rect key="frame" x="254" y="11" width="58" height="28"/>
|
||||
<color key="backgroundColor" red="0.15294117647058825" green="0.71764705882352942" blue="0.95686274509803926" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="58" id="4Fn-3i-gNh"/>
|
||||
<constraint firstAttribute="height" constant="28" id="UeX-vo-O6B"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
<state key="normal" title="发送"/>
|
||||
</button>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="mc2-cD-RYw" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="2lI-WC-QPH"/>
|
||||
<constraint firstItem="SCm-6c-OCD" firstAttribute="leading" secondItem="mc2-cD-RYw" secondAttribute="trailing" constant="16" id="LQB-HC-RMP"/>
|
||||
<constraint firstItem="mc2-cD-RYw" firstAttribute="centerY" secondItem="SCm-6c-OCD" secondAttribute="centerY" id="UhS-oZ-neD"/>
|
||||
<constraint firstItem="mc2-cD-RYw" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="16" id="Yh4-iu-B0Q"/>
|
||||
<constraint firstAttribute="trailing" secondItem="SCm-6c-OCD" secondAttribute="trailing" constant="8" id="weA-Oq-B6n"/>
|
||||
</constraints>
|
||||
<nil key="simulatedStatusBarMetrics"/>
|
||||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
|
||||
<point key="canvasLocation" x="-77" y="-189"/>
|
||||
</view>
|
||||
</objects>
|
||||
</document>
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// IfishFeedCellHeaghtCalculator.h
|
||||
// CollectionViewTest
|
||||
//
|
||||
// Created by imac on 17/2/21.
|
||||
// Copyright © 2017年 xiang. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "IfishFeedListData.h"
|
||||
@interface IfishFeedCellHeaghtCalculator : NSObject
|
||||
//系统计算高度后缓存进cache
|
||||
-(void)setHeight:(CGFloat)height withCalculateheightModel:(IfishFeedListData *)model;
|
||||
|
||||
//根据model hash 获取cache中的高度,如过无则返回-1
|
||||
-(CGFloat)heightForCalculateheightModel:(IfishFeedListData *)model;
|
||||
|
||||
//清空cache
|
||||
-(void)clearCaches;
|
||||
|
||||
@end
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
//
|
||||
// IfishFeedCellHeaghtCalculator.m
|
||||
// CollectionViewTest
|
||||
//
|
||||
// Created by imac on 17/2/21.
|
||||
// Copyright © 2017年 xiang. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IfishFeedCellHeaghtCalculator.h"
|
||||
@interface IfishFeedCellHeaghtCalculator ()
|
||||
@property (strong, nonatomic, readonly) NSCache *cache;
|
||||
@end
|
||||
|
||||
@implementation IfishFeedCellHeaghtCalculator
|
||||
#pragma mark - Init
|
||||
-(instancetype)init
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
[self defaultConfigure];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)defaultConfigure
|
||||
{
|
||||
NSCache *cache = [NSCache new];
|
||||
cache.name = @"IfishFeedCellHeaghtCalculator.cache";
|
||||
cache.countLimit = 200;
|
||||
_cache = cache;
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - NSObject
|
||||
|
||||
- (NSString *)description
|
||||
{
|
||||
return [NSString stringWithFormat:@"<%@: cache=%@",
|
||||
[self class], self.cache];
|
||||
}
|
||||
|
||||
#pragma mark - Publci Methods
|
||||
-(void)clearCaches
|
||||
{
|
||||
[self.cache removeAllObjects];
|
||||
}
|
||||
|
||||
-(void)setHeight:(CGFloat)height withCalculateheightModel:(IfishFeedListData *)model
|
||||
{
|
||||
NSAssert(model != nil, @"Cell Model can't nil");
|
||||
NSAssert(height >= 0, @"cell height must greater than or equal to 0");
|
||||
|
||||
[self.cache setObject:[NSNumber numberWithFloat:height] forKey:@(model.hash)];
|
||||
}
|
||||
|
||||
|
||||
-(CGFloat)heightForCalculateheightModel:(IfishFeedListData *)model
|
||||
{
|
||||
NSNumber *cellHeightNumber = [self.cache objectForKey:@(model.hash)];
|
||||
if (cellHeightNumber) {
|
||||
return [cellHeightNumber floatValue];
|
||||
}else
|
||||
return -1;
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// XuanYanCellHCaculator.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 17/2/21.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "IfishKankanListModel.h"
|
||||
|
||||
@interface XuanYanCellHCaculator : NSObject
|
||||
//系统计算高度后缓存进cache
|
||||
|
||||
-(void)setHeight:(CGFloat)height withCalculateheightModel:(IfishKankanListModel *)model;
|
||||
|
||||
//根据model hash 获取cache中的高度,如过无则返回-1
|
||||
-(CGFloat)heightForCalculateheightModel:(IfishKankanListModel *)model;
|
||||
|
||||
//清空cache
|
||||
-(void)clearCaches;
|
||||
|
||||
@end
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
//
|
||||
// XuanYanCellHCaculator.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 17/2/21.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "XuanYanCellHCaculator.h"
|
||||
@interface XuanYanCellHCaculator ()
|
||||
@property (strong, nonatomic, readonly) NSCache *cache;
|
||||
@end
|
||||
|
||||
@implementation XuanYanCellHCaculator
|
||||
#pragma mark - Init
|
||||
-(instancetype)init
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
[self defaultConfigure];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)defaultConfigure
|
||||
{
|
||||
NSCache *cache = [NSCache new];
|
||||
cache.name = @"XuanYanCellHCaculator.cache";
|
||||
cache.countLimit = 200;
|
||||
_cache = cache;
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - NSObject
|
||||
|
||||
- (NSString *)description
|
||||
{
|
||||
return [NSString stringWithFormat:@"<%@: cache=%@",
|
||||
[self class], self.cache];
|
||||
}
|
||||
|
||||
#pragma mark - Publci Methods
|
||||
-(void)clearCaches
|
||||
{
|
||||
[self.cache removeAllObjects];
|
||||
}
|
||||
|
||||
-(void)setHeight:(CGFloat)height withCalculateheightModel:(IfishKankanListModel *)model
|
||||
{
|
||||
NSAssert(model != nil, @"Cell Model can't nil");
|
||||
NSAssert(height >= 0, @"cell height must greater than or equal to 0");
|
||||
|
||||
[self.cache setObject:[NSNumber numberWithFloat:height] forKey:@(model.hash)];
|
||||
}
|
||||
|
||||
|
||||
-(CGFloat)heightForCalculateheightModel:(IfishKankanListModel *)model
|
||||
{
|
||||
NSNumber *cellHeightNumber = [self.cache objectForKey:@(model.hash)];
|
||||
if (cellHeightNumber) {
|
||||
return [cellHeightNumber floatValue];
|
||||
}else
|
||||
return -1;
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// IfishFeedListData.h
|
||||
// CollectionViewTest
|
||||
//
|
||||
// Created by imac on 17/2/21.
|
||||
// Copyright © 2017年 xiang. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface IfishFeedListData : NSObject
|
||||
@property (nonatomic,copy) NSString *userImg;
|
||||
@property (nonatomic,copy) NSString *userName;
|
||||
@property (nonatomic,copy) NSString *messageId;
|
||||
@property (nonatomic,copy) NSString *messageContent;
|
||||
@property (nonatomic,copy) NSString *time;
|
||||
@property (nonatomic,copy) NSString *userId;
|
||||
@property (nonatomic,copy) NSString *roomId;
|
||||
@property (nonatomic,copy) NSString *asUserId;
|
||||
@property (nonatomic,copy) NSString *asUserName;
|
||||
|
||||
- (instancetype)initWithDictionary:(NSDictionary *)dictionary;
|
||||
|
||||
@end
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// IfishFeedListData.m
|
||||
// CollectionViewTest
|
||||
//
|
||||
// Created by imac on 17/2/21.
|
||||
// Copyright © 2017年 xiang. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IfishFeedListData.h"
|
||||
|
||||
@implementation IfishFeedListData
|
||||
|
||||
-(instancetype)initWithDictionary:(NSDictionary *)dictionary
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
_userImg = dictionary[@"userImg"];
|
||||
_userId = dictionary[@"userId"];
|
||||
_userName = dictionary[@"userName"];
|
||||
_messageId = dictionary[@"messageId"];
|
||||
_time = dictionary[@"createTime"];
|
||||
_roomId = dictionary[@"roomId"];
|
||||
_asUserId = dictionary[@"asUserId"];
|
||||
_asUserName = dictionary[@"asUserName"];
|
||||
_messageContent = dictionary[@"messageContent"];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// P2PShareViewFeedMessageCell.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 17/2/21.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "IfishFeedListData.h"
|
||||
|
||||
@interface P2PShareViewFeedMessageCell : UITableViewCell
|
||||
|
||||
@property (strong, nonatomic) IfishFeedListData *model;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *userImg;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *userName;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *messageContent;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
|
||||
|
||||
@end
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
//
|
||||
// P2PShareViewFeedMessageCell.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 17/2/21.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "P2PShareViewFeedMessageCell.h"
|
||||
#import "UIImageView+WebCache.h"
|
||||
@implementation P2PShareViewFeedMessageCell
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
self.userImg.layer.masksToBounds = YES;
|
||||
self.userImg.layer.cornerRadius = CGRectGetHeight(self.userImg.frame)/2;
|
||||
}
|
||||
|
||||
#pragma mark - Setters
|
||||
-(void)setModel:(IfishFeedListData *)model
|
||||
{
|
||||
_model = model;
|
||||
|
||||
self.timeLabel.text = model.time;
|
||||
NSString*str=[NSString stringWithFormat:@"%@%@",kGetIconUrl,model.userImg];
|
||||
|
||||
[self.userImg sd_setImageWithURL:[NSURL URLWithString:str]];
|
||||
|
||||
if ([model.asUserId isKindOfClass:[NSNull class]]) {
|
||||
|
||||
self.messageContent.text = model.messageContent;
|
||||
|
||||
}else{
|
||||
|
||||
NSString *messageContent = [NSString stringWithFormat:@"@%@ %@",model.asUserName,model.messageContent];
|
||||
|
||||
NSMutableAttributedString *attri = [[NSMutableAttributedString alloc] initWithString:messageContent];
|
||||
|
||||
[attri addAttribute:NSForegroundColorAttributeName value:RGB(42, 195, 247) range:NSMakeRange(0,model.asUserName.length+1)];
|
||||
[attri addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:14] range:NSMakeRange(0,model.asUserName.length+1)];
|
||||
|
||||
self.messageContent.attributedText = attri;
|
||||
}
|
||||
|
||||
self.userName.text = model.userName;
|
||||
;
|
||||
|
||||
}
|
||||
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||
[super setSelected:selected animated:animated];
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
@end
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
<?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" rowHeight="66" id="KGk-i7-Jjw" customClass="P2PShareViewFeedMessageCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="66"/>
|
||||
<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="66"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="name" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="NKX-Ga-PGe">
|
||||
<rect key="frame" x="58" y="8" width="36" height="15"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="15" id="mM7-Ji-Srk"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2019/01/01" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hzy-XI-fMn">
|
||||
<rect key="frame" x="261" y="8" width="106" height="15"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="106" id="bvZ-Dv-a47"/>
|
||||
<constraint firstAttribute="height" constant="15" id="gG4-J0-ACH"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="10"/>
|
||||
<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="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="KuJ-EY-iya">
|
||||
<rect key="frame" x="58" y="31" width="309" height="20.5"/>
|
||||
<attributedString key="attributedText">
|
||||
<fragment content="feed">
|
||||
<attributes>
|
||||
<color key="NSColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<font key="NSFont" metaFont="cellTitle"/>
|
||||
</attributes>
|
||||
</fragment>
|
||||
</attributedString>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="pWI-bZ-4di">
|
||||
<rect key="frame" x="0.0" y="65" width="375" height="1"/>
|
||||
<color key="backgroundColor" red="0.82745098039999998" green="0.82745098039999998" blue="0.82745098039999998" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="1" id="zSB-ts-Kmb"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="ebg-HG-SzQ">
|
||||
<rect key="frame" x="8" y="8" width="42" height="42"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="42" id="8gf-ZE-8e4"/>
|
||||
<constraint firstAttribute="height" constant="42" id="MIa-Ch-k4D"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailingMargin" secondItem="hzy-XI-fMn" secondAttribute="trailing" id="8JN-jQ-weM"/>
|
||||
<constraint firstAttribute="topMargin" secondItem="NKX-Ga-PGe" secondAttribute="top" id="G1Q-oS-0iD"/>
|
||||
<constraint firstAttribute="trailingMargin" secondItem="KuJ-EY-iya" secondAttribute="trailing" id="J9S-vZ-1pT"/>
|
||||
<constraint firstAttribute="trailingMargin" secondItem="pWI-bZ-4di" secondAttribute="trailing" constant="-8" id="NFf-yO-Tqn"/>
|
||||
<constraint firstItem="ebg-HG-SzQ" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leadingMargin" id="PNv-mE-aik"/>
|
||||
<constraint firstAttribute="topMargin" secondItem="ebg-HG-SzQ" secondAttribute="top" id="QYt-Ko-4N6"/>
|
||||
<constraint firstItem="KuJ-EY-iya" firstAttribute="top" secondItem="NKX-Ga-PGe" secondAttribute="bottom" constant="8" id="RXh-hb-ksp"/>
|
||||
<constraint firstAttribute="topMargin" secondItem="hzy-XI-fMn" secondAttribute="top" id="VKv-Oc-dJz"/>
|
||||
<constraint firstItem="KuJ-EY-iya" firstAttribute="top" secondItem="hzy-XI-fMn" secondAttribute="bottom" constant="8" id="hd1-LH-1pk"/>
|
||||
<constraint firstAttribute="bottomMargin" secondItem="KuJ-EY-iya" secondAttribute="bottom" constant="6" id="knN-sc-PgB"/>
|
||||
<constraint firstAttribute="bottomMargin" secondItem="pWI-bZ-4di" secondAttribute="bottom" constant="-8" id="rig-Re-MId"/>
|
||||
<constraint firstItem="pWI-bZ-4di" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leadingMargin" constant="-8" id="sI2-oj-eaj"/>
|
||||
<constraint firstItem="KuJ-EY-iya" firstAttribute="leading" secondItem="ebg-HG-SzQ" secondAttribute="trailing" constant="8" id="uV0-Iq-T5n"/>
|
||||
<constraint firstItem="NKX-Ga-PGe" firstAttribute="leading" secondItem="ebg-HG-SzQ" secondAttribute="trailing" constant="8" id="wa8-Uy-Iyq"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<connections>
|
||||
<outlet property="messageContent" destination="KuJ-EY-iya" id="Lto-KT-Hbl"/>
|
||||
<outlet property="timeLabel" destination="hzy-XI-fMn" id="fRt-H0-D0k"/>
|
||||
<outlet property="userImg" destination="ebg-HG-SzQ" id="XqC-Dl-ZZS"/>
|
||||
<outlet property="userName" destination="NKX-Ga-PGe" id="2Fy-jZ-ezn"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="25.5" y="30"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// P2pShareLiveCommitCell.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 17/2/21.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface P2pShareLiveCommitCell : UITableViewCell
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *userImg;
|
||||
@property (weak, nonatomic) IBOutlet UITextField *inpuTextView;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *totalNumber;
|
||||
|
||||
@end
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// P2pShareLiveCommitCell.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 17/2/21.
|
||||
// Copyright © 2017年 lianlian. All rights reserved.
|
||||
//
|
||||
|
||||
#import "P2pShareLiveCommitCell.h"
|
||||
#import "UIImageView+WebCache.h"
|
||||
@implementation P2pShareLiveCommitCell
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
UserModel *model = [dataContorl getUserInfo];
|
||||
NSString*str=[NSString stringWithFormat:@"%@%@",kGetIconUrl,model.userImg];
|
||||
|
||||
[self.userImg sd_setImageWithURL:[NSURL URLWithString:str] placeholderImage:[UIImage imageNamed:@"account"]];
|
||||
self.inpuTextView.layer.masksToBounds = YES;
|
||||
self.inpuTextView.layer.cornerRadius = CGRectGetHeight(self.inpuTextView.frame)/2;
|
||||
self.userImg.layer.masksToBounds = YES;
|
||||
self.userImg.layer.cornerRadius = CGRectGetHeight(self.userImg.frame)/2;
|
||||
// Initialization code
|
||||
|
||||
UIView*phoneView=[[UIView alloc]initWithFrame:CGRectMake(0,0,18, CGRectGetHeight(self.inpuTextView.frame))];
|
||||
self.inpuTextView.leftView=phoneView;
|
||||
self.inpuTextView.leftViewMode=UITextFieldViewModeAlways;
|
||||
|
||||
|
||||
}
|
||||
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||
[super setSelected:selected animated:animated];
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
@end
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
<?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="P2pShareLiveCommitCell" rowHeight="100" id="KGk-i7-Jjw" customClass="P2pShareLiveCommitCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="100"/>
|
||||
<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="100"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="180" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="BNP-Fc-NK2">
|
||||
<rect key="frame" x="50" y="17" width="28" height="21"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="21" id="GGE-fh-K15"/>
|
||||
<constraint firstAttribute="width" constant="28" id="VaT-gh-MF4"/>
|
||||
</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>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="vt8-0m-Ykh">
|
||||
<rect key="frame" x="8" y="46" width="42" height="42"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="42" id="Thu-pd-zc7"/>
|
||||
<constraint firstAttribute="height" constant="42" id="vg7-dr-yvH"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="我也说两句" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="4CN-0s-ZwI">
|
||||
<rect key="frame" x="58" y="51" width="292" height="30"/>
|
||||
<color key="backgroundColor" red="0.95686274509803915" green="0.96862745098039216" blue="0.97647058823529409" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="30" id="dZ9-6F-IPE"/>
|
||||
</constraints>
|
||||
<nil key="textColor"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits"/>
|
||||
</textField>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="留言" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="CVf-kW-p0x">
|
||||
<rect key="frame" x="8" y="17" width="34" height="21"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="21" id="j69-ub-FhC"/>
|
||||
<constraint firstAttribute="width" constant="34" id="sXP-kq-7s3"/>
|
||||
</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>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="vt8-0m-Ykh" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leadingMargin" id="2eY-sa-vSf"/>
|
||||
<constraint firstItem="BNP-Fc-NK2" firstAttribute="leading" secondItem="CVf-kW-p0x" secondAttribute="trailing" constant="8" id="3TQ-Uf-h1F"/>
|
||||
<constraint firstItem="CVf-kW-p0x" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="topMargin" constant="9" id="Apn-D6-8Cl"/>
|
||||
<constraint firstItem="vt8-0m-Ykh" firstAttribute="top" secondItem="CVf-kW-p0x" secondAttribute="bottom" constant="8" id="KOG-A1-rhk"/>
|
||||
<constraint firstAttribute="trailingMargin" secondItem="4CN-0s-ZwI" secondAttribute="trailing" constant="17" id="cAk-jR-tIB"/>
|
||||
<constraint firstItem="4CN-0s-ZwI" firstAttribute="top" secondItem="BNP-Fc-NK2" secondAttribute="bottom" constant="13" id="jXV-5v-yRr"/>
|
||||
<constraint firstItem="vt8-0m-Ykh" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="topMargin" constant="38" id="kWx-IY-2FD"/>
|
||||
<constraint firstItem="CVf-kW-p0x" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leadingMargin" id="uiC-iI-Sem"/>
|
||||
<constraint firstItem="BNP-Fc-NK2" firstAttribute="top" secondItem="CVf-kW-p0x" secondAttribute="top" id="xdV-h3-fnJ"/>
|
||||
<constraint firstItem="4CN-0s-ZwI" firstAttribute="leading" secondItem="vt8-0m-Ykh" secondAttribute="trailing" constant="8" id="zRe-YO-ImE"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<connections>
|
||||
<outlet property="inpuTextView" destination="4CN-0s-ZwI" id="VsU-9R-Usu"/>
|
||||
<outlet property="totalNumber" destination="BNP-Fc-NK2" id="FCe-Lb-8lK"/>
|
||||
<outlet property="userImg" destination="vt8-0m-Ykh" id="Roy-xW-6lz"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="-45.5" y="24"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// P2PShareView1Cell.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 16/11/17.
|
||||
// Copyright © 2016年 lianxiang. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "IfishKankanListModel.h"
|
||||
@interface P2PShareView1Cell : UITableViewCell
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *roomOwnerImg;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UIButton *chatBtn;
|
||||
|
||||
-(void)loaDataWith:(IfishKankanListModel*)model;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UILabel *roomUserName;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *renzhengImg;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *zanBtn;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *daShangBtn;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *levelLabel;
|
||||
|
||||
@end
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
//
|
||||
// P2PShareView1Cell.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 16/11/17.
|
||||
// Copyright © 2016年 lianxiang. All rights reserved.
|
||||
//
|
||||
|
||||
#import "P2PShareView1Cell.h"
|
||||
#import "UIImageView+WebCache.h"
|
||||
@implementation P2PShareView1Cell
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
self.chatBtn.layer.masksToBounds = YES;
|
||||
self.chatBtn.layer.cornerRadius = 5;
|
||||
self.roomOwnerImg.layer.masksToBounds = YES;
|
||||
self.roomOwnerImg.layer.cornerRadius = 2;
|
||||
}
|
||||
-(void)loaDataWith:(IfishKankanListModel*)model
|
||||
{
|
||||
|
||||
[self.roomOwnerImg sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",kGetIconUrl,model.userImg]] placeholderImage:[UIImage imageNamed:@"live_roomUser_holder"]];
|
||||
|
||||
self.roomUserName.text = model.nickname;
|
||||
|
||||
if (!model.userType) {
|
||||
model.userType = @"0";
|
||||
}
|
||||
|
||||
if ([model.userType isEqualToString:@"1"]) {
|
||||
self.renzhengImg.hidden =NO;
|
||||
}else{
|
||||
self.renzhengImg.hidden =YES;
|
||||
|
||||
}
|
||||
|
||||
if (model.isZan) {
|
||||
[self.zanBtn setBackgroundImage:[UIImage imageNamed:@"live_botton_uncheck_like"] forState:UIControlStateNormal];
|
||||
}else{
|
||||
[self.zanBtn setBackgroundImage:[UIImage imageNamed:@"live_botton_like"] forState:UIControlStateNormal];
|
||||
}
|
||||
|
||||
NSString *title = [NSString stringWithFormat:@"LV%d",model.gradeNum];
|
||||
NSAttributedString * str= [[NSAttributedString alloc] initWithString:title attributes:@{NSFontAttributeName:[UIFont fontWithName:@"Arial-BoldItalicMT" size:14],NSForegroundColorAttributeName:RGB(252, 217, 94)}];
|
||||
self.levelLabel.attributedText = str;
|
||||
|
||||
|
||||
}
|
||||
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||
[super setSelected:selected animated:animated];
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
@end
|
||||
+122
@@ -0,0 +1,122 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina5_5" 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="P2PShareView1Cell" id="KGk-i7-Jjw" customClass="P2PShareView1Cell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="84"/>
|
||||
<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="84"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="k8y-Xx-OXi">
|
||||
<rect key="frame" x="15" y="11" width="60" height="60"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="60" id="ia0-G0-X1J"/>
|
||||
<constraint firstAttribute="width" constant="60" id="lRy-w4-dhc"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="BP2-VQ-Obk">
|
||||
<rect key="frame" x="0.0" y="85" width="320" height="1"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<color key="backgroundColor" red="0.9137254901960784" green="0.9137254901960784" blue="0.8901960784313725" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</view>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="live_label_v.png" translatesAutoresizingMaskIntoConstraints="NO" id="hTM-h8-mp0">
|
||||
<rect key="frame" x="56" y="55" width="19" height="16"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="19" id="PTp-XD-dcN"/>
|
||||
<constraint firstAttribute="height" constant="16" id="zVK-Pt-hRL"/>
|
||||
</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="e3s-Oh-KIo">
|
||||
<rect key="frame" x="83" y="18" width="43" height="16"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="16" id="Z4Q-L2-TZQ"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="HtB-76-hbb">
|
||||
<rect key="frame" x="83" y="44" width="68" height="27"/>
|
||||
<color key="backgroundColor" red="0.1215686275" green="0.66274509800000003" blue="0.91372549020000005" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="27" id="lNO-kf-uSj"/>
|
||||
<constraint firstAttribute="width" constant="68" id="w9c-ZE-aLF"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
<inset key="imageEdgeInsets" minX="-10" minY="0.0" maxX="0.0" maxY="0.0"/>
|
||||
<state key="normal" title="私聊" image="live_sharechat_iocn.png"/>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3IN-fl-Exf">
|
||||
<rect key="frame" x="244" y="44" width="68" height="27"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="68" id="dju-Wj-8Dv"/>
|
||||
<constraint firstAttribute="height" constant="27" id="eKn-Mh-R6q"/>
|
||||
</constraints>
|
||||
<state key="normal" backgroundImage="live_botton_exceptional.png"/>
|
||||
</button>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" preservesSuperviewLayoutMargins="YES" text="等级" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zHc-Gp-EDS">
|
||||
<rect key="frame" x="140" y="18" width="29" height="16"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="16" id="Pli-e0-Tht"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<color key="textColor" red="0.98823529409999999" green="0.85098039219999999" blue="0.36862745099999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ORC-xS-F3u">
|
||||
<rect key="frame" x="168" y="44" width="68" height="27"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="27" id="6Fv-N5-fAE"/>
|
||||
<constraint firstAttribute="width" constant="68" id="qPo-iu-BbX"/>
|
||||
</constraints>
|
||||
<state key="normal" backgroundImage="live_botton_like.png"/>
|
||||
</button>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="ORC-xS-F3u" firstAttribute="centerY" secondItem="HtB-76-hbb" secondAttribute="centerY" id="6E1-oC-2ct"/>
|
||||
<constraint firstItem="3IN-fl-Exf" firstAttribute="leading" secondItem="ORC-xS-F3u" secondAttribute="trailing" constant="8" id="CY3-c2-fFQ"/>
|
||||
<constraint firstItem="hTM-h8-mp0" firstAttribute="bottom" secondItem="k8y-Xx-OXi" secondAttribute="bottom" id="DH5-zy-27r"/>
|
||||
<constraint firstAttribute="trailingMargin" secondItem="3IN-fl-Exf" secondAttribute="trailing" id="FXx-MM-eBm"/>
|
||||
<constraint firstItem="zHc-Gp-EDS" firstAttribute="leading" secondItem="e3s-Oh-KIo" secondAttribute="trailing" constant="14" id="IVp-QS-6qi"/>
|
||||
<constraint firstItem="k8y-Xx-OXi" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="LFn-aL-yDR"/>
|
||||
<constraint firstItem="k8y-Xx-OXi" firstAttribute="top" secondItem="e3s-Oh-KIo" secondAttribute="bottom" constant="-23" id="MyI-IA-fou"/>
|
||||
<constraint firstItem="3IN-fl-Exf" firstAttribute="centerY" secondItem="ORC-xS-F3u" secondAttribute="centerY" id="S0b-cS-qTp"/>
|
||||
<constraint firstItem="hTM-h8-mp0" firstAttribute="trailing" secondItem="k8y-Xx-OXi" secondAttribute="trailing" id="Ttp-DS-CKm"/>
|
||||
<constraint firstItem="e3s-Oh-KIo" firstAttribute="leading" secondItem="k8y-Xx-OXi" secondAttribute="trailing" constant="8" id="bXf-Sl-SZE"/>
|
||||
<constraint firstItem="HtB-76-hbb" firstAttribute="bottom" secondItem="k8y-Xx-OXi" secondAttribute="bottom" id="fs5-1W-87x"/>
|
||||
<constraint firstItem="zHc-Gp-EDS" firstAttribute="centerY" secondItem="e3s-Oh-KIo" secondAttribute="centerY" id="g9I-9i-yuV"/>
|
||||
<constraint firstItem="HtB-76-hbb" firstAttribute="leading" secondItem="k8y-Xx-OXi" secondAttribute="trailing" constant="8" id="pwz-La-yK7"/>
|
||||
<constraint firstItem="k8y-Xx-OXi" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="zgc-ug-DJe"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<connections>
|
||||
<outlet property="chatBtn" destination="HtB-76-hbb" id="1Ie-GO-awa"/>
|
||||
<outlet property="daShangBtn" destination="3IN-fl-Exf" id="BJe-gm-Fvk"/>
|
||||
<outlet property="levelLabel" destination="zHc-Gp-EDS" id="Qu6-wi-k2r"/>
|
||||
<outlet property="renzhengImg" destination="hTM-h8-mp0" id="b0f-Ko-L34"/>
|
||||
<outlet property="roomOwnerImg" destination="k8y-Xx-OXi" id="seT-cP-K9d"/>
|
||||
<outlet property="roomUserName" destination="e3s-Oh-KIo" id="iVQ-ni-gdk"/>
|
||||
<outlet property="zanBtn" destination="ORC-xS-F3u" id="nPp-Ty-U2s"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="-147" y="49"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="live_botton_exceptional.png" width="57" height="22"/>
|
||||
<image name="live_botton_like.png" width="57" height="22"/>
|
||||
<image name="live_label_v.png" width="19" height="15"/>
|
||||
<image name="live_sharechat_iocn.png" width="11" height="11"/>
|
||||
</resources>
|
||||
</document>
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
//
|
||||
// P2PShareViewBootomView.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 16/11/17.
|
||||
// Copyright © 2016年 lianxiang. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "IfishKankanListModel.h"
|
||||
//分享中 底部直播间信息 view
|
||||
#import "IfishFeedListData.h"
|
||||
#import "P2PShareViewFeedMessageCell.h"
|
||||
#import "P2pShareLiveCommitCell.h"
|
||||
#import "IfishFeedCellHeaghtCalculator.h"
|
||||
#import "XuanYanCellHCaculator.h"
|
||||
#import "P2PShareViewFour4Cell.h"
|
||||
#import "IfishCommentEditeView.h"
|
||||
@protocol P2PShareViewBootomViewDelegate <NSObject>
|
||||
@optional
|
||||
-(void)chatBtnClickAction;
|
||||
-(void)daShangSuccsess;
|
||||
|
||||
@end
|
||||
|
||||
@interface P2PShareViewBootomView : UIView<
|
||||
UITableViewDelegate,
|
||||
UITableViewDataSource,UITextFieldDelegate>
|
||||
{
|
||||
IfishFeedCellHeaghtCalculator *heightCalculator;
|
||||
XuanYanCellHCaculator *xYCalculator;
|
||||
NSInteger _first;
|
||||
NSInteger _total;
|
||||
NSInteger _totalNumber;
|
||||
BOOL _isRefreshing;
|
||||
BOOL _isLoadMore;
|
||||
|
||||
}
|
||||
|
||||
@property(nonatomic)BOOL isRefreshing;
|
||||
@property(nonatomic)BOOL isLoadMore;
|
||||
@property(nonatomic) int page;
|
||||
@property(nonatomic,assign) id<P2PShareViewBootomViewDelegate> delegate;
|
||||
@property(nonatomic,strong) IfishKankanListModel *roomModel;
|
||||
//评论
|
||||
@property(nonatomic,strong) UITableView *tableView;
|
||||
@property(nonatomic,strong) NSMutableArray *massageData;
|
||||
@property (nonatomic, strong) P2PShareViewFeedMessageCell *prototypeCell;
|
||||
@property (nonatomic, strong) P2PShareViewFour4Cell *xuanYanCell;
|
||||
@property (strong, nonatomic) IfishCommentEditeView *commentEditView;
|
||||
|
||||
-(void)initDataWithRoomId:(NSString *)roomId;
|
||||
|
||||
|
||||
@end
|
||||
+532
@@ -0,0 +1,532 @@
|
||||
//
|
||||
// P2PShareViewBootomView.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 16/11/17.
|
||||
// Copyright © 2016年 lianxiang. All rights reserved.
|
||||
//
|
||||
|
||||
#import "P2PShareViewBootomView.h"
|
||||
|
||||
#import "P2PShareView1Cell.h"
|
||||
#import "P2PShareViewsec2Cell.h"
|
||||
#import "P2PShareViewTh3Cell.h"
|
||||
#import "JHRefresh.h"
|
||||
@implementation P2PShareViewBootomView
|
||||
|
||||
-(id)initWithFrame:(CGRect)frame{
|
||||
|
||||
self= [super initWithFrame:frame];
|
||||
|
||||
if (self) {
|
||||
self.massageData = [[NSMutableArray alloc] init];
|
||||
[self setUp];
|
||||
[self creatReatRefreshView];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)initDataWithRoomId:(NSString *)roomId{
|
||||
_page = 0;
|
||||
_first = 0;
|
||||
NSInteger rooId =[roomId integerValue];
|
||||
[self loadMeassgeDataWithFirst:_first addrommId:rooId isRefresh:NO];
|
||||
}
|
||||
|
||||
|
||||
-(void)loadMeassgeDataWithFirst:(NSInteger)firstResult addrommId:(NSInteger)roomId isRefresh:(BOOL)isRefresh{
|
||||
|
||||
NSInteger pageSize = 10;
|
||||
__weak typeof(self) weakSelf = self;
|
||||
[AFHttpTool ifishGetLiveMeassage:firstResult pageSize:pageSize roomId:roomId success:^(id response) {
|
||||
|
||||
NSDictionary *reDic=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil];
|
||||
NSString *result=reDic[@"result"];
|
||||
//NSLog(@"roomId:%d pinglun::%@",roomId,reDic);
|
||||
if ([result isEqualToString:@"100"]) {
|
||||
|
||||
NSString *first = reDic[@"firstResult"];
|
||||
_first = [first intValue];
|
||||
NSString *total = reDic[@"total"];
|
||||
_total =[total intValue];
|
||||
_totalNumber = [total intValue];
|
||||
|
||||
NSArray *array = [reDic objectForKey:@"data"];
|
||||
for (NSDictionary *dic in array) {
|
||||
IfishFeedListData *model = [[IfishFeedListData alloc]initWithDictionary:dic];
|
||||
[self.massageData addObject:model];
|
||||
}
|
||||
[weakSelf.tableView reloadData];
|
||||
}
|
||||
|
||||
[weakSelf endRefreshing];
|
||||
|
||||
} failure:^(NSError *err) {
|
||||
[weakSelf endRefreshing];
|
||||
[weakSelf makeToast:@"请求异常"];
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
|
||||
-(void)creatReatRefreshView{
|
||||
__weak typeof (self)weskSelf=self;
|
||||
// 下拉刷新
|
||||
|
||||
//[weskSelf.tableView addRefreshHeaderViewWithAniViewClass:[JHRefreshAmazingAniView class] beginRefresh:^{
|
||||
// if (weskSelf.isRefreshing) {
|
||||
// return ;
|
||||
// }
|
||||
// weskSelf.isRefreshing=YES;
|
||||
// [weskSelf loadData];
|
||||
|
||||
// }];
|
||||
|
||||
|
||||
//上拉加载更多
|
||||
|
||||
[weskSelf.tableView addRefreshFooterViewWithAniViewClass:[JHRefreshCommonAniView class] beginRefresh:^{
|
||||
if (weskSelf.isLoadMore) {
|
||||
return ;
|
||||
}
|
||||
weskSelf.isLoadMore=YES;
|
||||
|
||||
NSInteger pagecount =_total/10+1;
|
||||
if (_page<pagecount-1) {
|
||||
_page++;
|
||||
|
||||
_first= (NSInteger)_page*10;
|
||||
|
||||
NSInteger roomId = [weskSelf.roomModel.room_id integerValue];
|
||||
[weskSelf loadMeassgeDataWithFirst:_first addrommId:roomId isRefresh:NO];
|
||||
|
||||
}else{
|
||||
[weskSelf endRefreshing];
|
||||
[weskSelf makeToast:@"已无更多数据"];
|
||||
}
|
||||
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void)endRefreshing{
|
||||
if (self.isRefreshing) {
|
||||
self.isRefreshing=NO;
|
||||
[self.tableView headerEndRefreshingWithResult:JHRefreshResultNone];
|
||||
}
|
||||
|
||||
if (self.isLoadMore) {
|
||||
self.isLoadMore=NO;
|
||||
[self.tableView footerEndRefreshing];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)setUp{
|
||||
|
||||
// CGFloat videoViewH= self.bounds.size.width * 9 / 16;
|
||||
|
||||
_tableView=[[UITableView alloc]initWithFrame:CGRectMake(0,0,self.bounds.size.width, self.bounds.size.height - 60) style:UITableViewStyleGrouped];
|
||||
_tableView.dataSource=self;
|
||||
_tableView.delegate=self;
|
||||
_tableView.separatorStyle=UITableViewCellSeparatorStyleNone;
|
||||
_tableView.backgroundColor=TABLE_BACKGROUD_COLOR;
|
||||
self.tableView.sectionFooterHeight = 0;
|
||||
self.tableView.sectionHeaderHeight = 5;
|
||||
|
||||
[self addSubview:_tableView];
|
||||
|
||||
// UIView *tabeFooterView =[[UIView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, 30)];
|
||||
//tabeFooterView.backgroundColor = [UIColor redColor];
|
||||
// UIButton *footbtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
//footbtn.frame = CGRectMake(10, 0,200, 30);
|
||||
//[footbtn setTitle:@"点击加载更多" forState:UIControlStateNormal];
|
||||
//[tabeFooterView addSubview:footbtn];
|
||||
//self.tableView.tableFooterView = tabeFooterView;
|
||||
|
||||
|
||||
self.tableView.estimatedRowHeight = 100;
|
||||
[self.tableView registerNib:[UINib nibWithNibName:@"P2PShareViewFeedMessageCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"P2PShareViewFeedMessageCell"];
|
||||
self.prototypeCell = [self.tableView dequeueReusableCellWithIdentifier:@"P2PShareViewFeedMessageCell"];
|
||||
|
||||
[self.tableView registerNib:[UINib nibWithNibName:@"P2PShareViewFour4Cell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"P2PShareViewFour4Cell"];
|
||||
self.xuanYanCell = [self.tableView dequeueReusableCellWithIdentifier:@"P2PShareViewFour4Cell"];
|
||||
|
||||
}
|
||||
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
||||
|
||||
{
|
||||
if (section ==2) {
|
||||
return self.massageData.count + 1;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
|
||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
|
||||
{
|
||||
|
||||
|
||||
return 3;
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
|
||||
if (indexPath.section == 0 && indexPath.row ==0) {
|
||||
|
||||
P2PShareView1Cell *cell = [tableView dequeueReusableCellWithIdentifier:@"P2PShareView1Cell"];
|
||||
|
||||
if (!cell) {
|
||||
cell = [[[NSBundle mainBundle]loadNibNamed:@"P2PShareView1Cell" owner:self options:nil]lastObject];
|
||||
|
||||
}
|
||||
|
||||
[cell loaDataWith:self.roomModel];
|
||||
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
//cell.backgroundColor = TABLE_BACKGROUD_COLOR;
|
||||
[cell.chatBtn addTarget:self action:@selector(chatBtnAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
[cell.zanBtn addTarget:self action:@selector(zanBtnClick:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[cell.daShangBtn addTarget:self action:@selector(daShangBtnClick:) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
return cell;
|
||||
|
||||
}else if (indexPath.section == 0 && indexPath.row ==1){
|
||||
|
||||
P2PShareViewsec2Cell *cell = [tableView dequeueReusableCellWithIdentifier:@"P2PShareViewsec2Cell"];
|
||||
|
||||
if (!cell) {
|
||||
cell = [[[NSBundle mainBundle]loadNibNamed:@"P2PShareViewsec2Cell" owner:self options:nil]lastObject];
|
||||
|
||||
}
|
||||
[cell loaDataWith:self.roomModel];
|
||||
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
// cell.backgroundColor = TABLE_BACKGROUD_COLOR;
|
||||
|
||||
return cell;
|
||||
}else if (indexPath.section == 1 && indexPath.row ==0){
|
||||
|
||||
P2PShareViewTh3Cell *cell = [tableView dequeueReusableCellWithIdentifier:@"P2PShareViewTh3Cell"];
|
||||
|
||||
if (!cell) {
|
||||
cell = [[[NSBundle mainBundle]loadNibNamed:@"P2PShareViewTh3Cell" owner:self options:nil]lastObject];
|
||||
|
||||
}
|
||||
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
//cell.backgroundColor = TABLE_BACKGROUD_COLOR;
|
||||
cell.roomName.text = self.roomModel.room_name;
|
||||
return cell;
|
||||
|
||||
}else if (indexPath.section == 1 && indexPath.row ==1){
|
||||
|
||||
P2PShareViewFour4Cell *cell= [tableView dequeueReusableCellWithIdentifier:@"P2PShareViewFour4Cell" forIndexPath:indexPath];
|
||||
cell.model = self.roomModel;
|
||||
//cell.backgroundColor = [UIColor redColor];
|
||||
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
|
||||
return cell;
|
||||
|
||||
}else if (indexPath.section == 2 && indexPath.row ==0){
|
||||
P2pShareLiveCommitCell *cell = [tableView dequeueReusableCellWithIdentifier:@"P2pShareLiveCommitCell"];
|
||||
if (!cell) {
|
||||
cell = [[[NSBundle mainBundle]loadNibNamed:@"P2pShareLiveCommitCell" owner:self options:nil]lastObject];
|
||||
}
|
||||
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
cell.inpuTextView.delegate = self;
|
||||
cell.totalNumber.text =[NSString stringWithFormat:@"%ld",(long)_totalNumber];
|
||||
return cell;
|
||||
|
||||
}else if (indexPath.section == 2 && indexPath.row >0){
|
||||
P2PShareViewFeedMessageCell *cell= [tableView dequeueReusableCellWithIdentifier:@"P2PShareViewFeedMessageCell" forIndexPath:indexPath];
|
||||
[self configureCell:cell atIndexPath:indexPath];
|
||||
|
||||
return cell;
|
||||
|
||||
}
|
||||
return nil;
|
||||
|
||||
}
|
||||
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
|
||||
|
||||
if (section==1||section ==2) {
|
||||
|
||||
return 5;
|
||||
}
|
||||
return 0.1;
|
||||
|
||||
}
|
||||
|
||||
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
//int sliderValue=(int)(slider.value+0.5);
|
||||
//内容高度
|
||||
if (indexPath.section==0 &&indexPath.row ==1) {
|
||||
return 50;
|
||||
}else if (indexPath.section==0 &&indexPath.row ==0){
|
||||
return 100;
|
||||
|
||||
}else if (indexPath.section == 1 && indexPath.row ==0){
|
||||
return 40;
|
||||
|
||||
}else if (indexPath.section == 1 && indexPath.row ==1){
|
||||
|
||||
CGFloat height = [xYCalculator heightForCalculateheightModel:self.roomModel];
|
||||
if (height>0) {
|
||||
NSLog(@"cache height");
|
||||
return height;
|
||||
}else{
|
||||
NSLog(@"calculate height");
|
||||
}
|
||||
P2PShareViewFour4Cell *cell = self.xuanYanCell;
|
||||
cell.contentView.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
cell.model = self.roomModel;
|
||||
|
||||
CGFloat fittingHeight = [self getCellFittingHeightWhih:cell];
|
||||
CGFloat cellHeight = fittingHeight+2*1/[UIScreen mainScreen].scale;//必须加上上下分割线的高度
|
||||
[xYCalculator setHeight:cellHeight withCalculateheightModel:self.roomModel];
|
||||
|
||||
return cellHeight;
|
||||
|
||||
}
|
||||
else if (indexPath.section == 2 && indexPath.row ==0){
|
||||
//return kScreenSize.width * 0.27;
|
||||
return 100;
|
||||
}
|
||||
|
||||
IfishFeedListData *model = model = [self.massageData objectAtIndex:indexPath.row-1];
|
||||
|
||||
CGFloat height = [heightCalculator heightForCalculateheightModel:model];
|
||||
if (height>0) {
|
||||
NSLog(@"cache height");
|
||||
return height;
|
||||
}else{
|
||||
NSLog(@"calculate height");
|
||||
}
|
||||
|
||||
P2PShareViewFeedMessageCell *cell = self.prototypeCell;
|
||||
cell.contentView.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
[self configureCell:cell atIndexPath:indexPath];
|
||||
|
||||
CGFloat fittingHeight = [self getCellFittingHeightWhih:cell];
|
||||
|
||||
CGFloat cellHeight = fittingHeight+2*1/[UIScreen mainScreen].scale;//必须加上上下分割线的高度
|
||||
[heightCalculator setHeight:cellHeight withCalculateheightModel:model];
|
||||
//NSLog(@"cellHeight***%f",cellHeight);
|
||||
return cellHeight;
|
||||
|
||||
}
|
||||
|
||||
-(CGFloat)getCellFittingHeightWhih:(UITableViewCell*)cell
|
||||
{
|
||||
/*------------------------------重点这里必须加上contentView的宽度约束不然计算出来的高度不准确-------------------------------------*/
|
||||
CGFloat contentViewWidth = CGRectGetWidth(self.tableView.bounds);
|
||||
NSLayoutConstraint *widthFenceConstraint = [NSLayoutConstraint constraintWithItem:cell.contentView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:contentViewWidth];
|
||||
[cell.contentView addConstraint:widthFenceConstraint];
|
||||
// Auto layout engine does its math
|
||||
CGFloat fittingHeight = [cell.contentView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize].height;
|
||||
[cell.contentView removeConstraint:widthFenceConstraint];
|
||||
/*-------------------------------End------------------------------------*/
|
||||
|
||||
return fittingHeight;
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
if (indexPath.section ==2) {
|
||||
if (indexPath.row ==0) {
|
||||
return;
|
||||
}
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
NSString *userId = [dataContorl dataControlGetUserIdInfo];
|
||||
|
||||
|
||||
IfishFeedListData *model = self.massageData[indexPath.row-1];
|
||||
NSString *palceholdT = [NSString stringWithFormat:@"@%@",model.userName];
|
||||
NSString *atUSer=[NSString stringWithFormat:@"%@",model.userId];
|
||||
if ([userId isEqual:atUSer]) {
|
||||
[self.superview makeToast:@"不能@自己呦"];
|
||||
return;
|
||||
}
|
||||
[self creatCommentEditeViewWithPalceholderText:palceholdT addAsUserId:model.userId];
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark-chatBtnAction
|
||||
-(void)chatBtnAction{
|
||||
|
||||
[self.delegate chatBtnClickAction];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark Configure Cell Data
|
||||
- (void)configureCell:(P2PShareViewFeedMessageCell *)cell atIndexPath:(NSIndexPath *)indexPath {
|
||||
|
||||
cell.model = [self.massageData objectAtIndex:indexPath.row -1];
|
||||
}
|
||||
|
||||
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
// Remove seperator inset
|
||||
if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
|
||||
[cell setSeparatorInset:UIEdgeInsetsZero];
|
||||
}
|
||||
|
||||
// Prevent the cell from inheriting the Table View's margin settings
|
||||
if ([cell respondsToSelector:@selector(setPreservesSuperviewLayoutMargins:)]) {
|
||||
[cell setPreservesSuperviewLayoutMargins:NO];
|
||||
}
|
||||
|
||||
// Explictly set your cell's layout margins
|
||||
if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
|
||||
[cell setLayoutMargins:UIEdgeInsetsZero];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark -textField 代理
|
||||
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
|
||||
{
|
||||
NSLog(@"ShouldBeginEditing");
|
||||
//处理评论事件
|
||||
|
||||
[self creatCommentEditeViewWithPalceholderText:@"我也说两句" addAsUserId:nil];
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
#pragma mark - 评论输入框
|
||||
|
||||
-(void)creatCommentEditeViewWithPalceholderText:(NSString *)palceholderText addAsUserId:(NSString*)asUserId
|
||||
{
|
||||
|
||||
|
||||
__weak typeof(self) weakSelf = self;
|
||||
IfishCommentEditeView *commentView =[[IfishCommentEditeView alloc] initWithFrame:[UIApplication sharedApplication].keyWindow.bounds];
|
||||
commentView.palceholderText = palceholderText;
|
||||
[[UIApplication sharedApplication].keyWindow addSubview:commentView];
|
||||
commentView.SendCommentHandler = ^(NSString *conttent){
|
||||
|
||||
[weakSelf sendCommentWithContent:conttent addAsUserId:asUserId];
|
||||
|
||||
NSLog(@"conttent:%@",conttent);
|
||||
};
|
||||
self.commentEditView = commentView;
|
||||
|
||||
}
|
||||
|
||||
#pragma mark -sendCommentWithContent
|
||||
|
||||
-(void)sendCommentWithContent:(NSString*)content addAsUserId:(NSString*)asuserId{
|
||||
|
||||
NSString *userId = [dataContorl dataControlGetUserIdInfo];
|
||||
__weak typeof(self) weakSelf = self;
|
||||
[AFHttpTool IfishCommitLeaveMessage:userId roomId:self.roomModel.room_id asUserId:asuserId messageContent:content success:^(id response) {
|
||||
NSDictionary *reDic=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil];
|
||||
NSString *result=reDic[@"result"];
|
||||
if ([result isEqualToString:@"100"]) {
|
||||
_totalNumber ++;
|
||||
NSDictionary *dataDic =reDic[@"data"];
|
||||
|
||||
IfishFeedListData *model = [[IfishFeedListData alloc]initWithDictionary:dataDic];
|
||||
[weakSelf.massageData insertObject:model atIndex:0];
|
||||
NSIndexSet *indexSet=[NSIndexSet indexSetWithIndex:2];
|
||||
[weakSelf.tableView reloadSections:indexSet withRowAnimation:UITableViewRowAnimationNone];
|
||||
//每日评论 加金币
|
||||
[[IfishUserObsever sharedInstance] addGoldWith:ROOMLEAVEMSG addType:IFISHADDGOLDTYPE0];
|
||||
|
||||
}else{
|
||||
[weakSelf makeToast:@"请求错误"];
|
||||
}
|
||||
|
||||
} failure:^(NSError *err) {
|
||||
|
||||
[weakSelf makeToast:@"请求异常"];
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - 点赞
|
||||
-(void)zanBtnClick:(UIButton *)btn{
|
||||
|
||||
NSString *roomId = self.roomModel.room_id;
|
||||
NSString *userID = [dataContorl dataControlGetUserIdInfo];
|
||||
__weak typeof(self) weakSelf = self;
|
||||
[AFHttpTool liveDianZanRoomId:roomId userId:userID success:^(id response) {
|
||||
NSDictionary *reDic=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil];
|
||||
NSString *result=reDic[@"result"];
|
||||
if ([result isEqualToString:@"100"]){
|
||||
NSDictionary *dataDic =reDic[@"data"];
|
||||
weakSelf.roomModel.zanNumber = [[dataDic objectForKey:@"zanNum"] intValue];
|
||||
weakSelf.roomModel.isZan = [[dataDic objectForKey:@"isZan"] boolValue];
|
||||
|
||||
NSIndexSet *set = [NSIndexSet indexSetWithIndex:0];
|
||||
[weakSelf.tableView reloadSections:set withRowAnimation:UITableViewRowAnimationNone];
|
||||
//(通知)更新直播间列表数据 只更新对应 IfishKankanListModel 列表数据做缓存处理后可不用此操作
|
||||
//@"liveRoomDataDidChange"
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"liveRoomDataDidChange" object:weakSelf.roomModel];
|
||||
|
||||
}else{
|
||||
[weakSelf makeToast:@"点赞出了点问题"];
|
||||
}
|
||||
|
||||
} failure:^(NSError *err) {
|
||||
|
||||
[weakSelf makeToast:@"网络异常"];
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - 打赏
|
||||
-(void)daShangBtnClick:(UIButton *)btn{
|
||||
|
||||
NSString *userID = [dataContorl dataControlGetUserIdInfo];
|
||||
NSString *peeUsrId = [NSString stringWithFormat:@"%@",self.roomModel.userId];
|
||||
if ([userID isEqual:peeUsrId]) {
|
||||
[self makeToast:@"不能打赏给自己呦!"];
|
||||
return;
|
||||
}
|
||||
|
||||
__weak typeof(self) weakSelf = self;
|
||||
[AFHttpTool liveRoomDaShang:userID payeeUserId:peeUsrId success:^(id response) {
|
||||
NSDictionary *reDic=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil];
|
||||
NSString *result=reDic[@"result"];
|
||||
if ([result isEqualToString:@"100"]){
|
||||
NSDictionary *dataDic =reDic[@"data"];
|
||||
//更新当前用户金币
|
||||
IfishUserAsset *userAset =[dataContorl getAllIfishUserAsset];
|
||||
userAset.goldValue = [[dataDic objectForKey:@"userGoldValue"] integerValue];
|
||||
[dataContorl resetUserAsset:userAset];
|
||||
|
||||
//直播间用户总金额
|
||||
weakSelf.roomModel.goldValue = [[dataDic objectForKey:@"totalGoldValue"] floatValue];
|
||||
|
||||
NSIndexPath *index =[NSIndexPath indexPathForRow:1 inSection:0];
|
||||
NSArray *rowArr =@[index];
|
||||
[weakSelf.tableView reloadRowsAtIndexPaths:rowArr withRowAnimation:UITableViewRowAnimationNone];
|
||||
//(通知)更新直播间列表数据 只更新对应 IfishKankanListModel 列表数据做缓存处理后可不用此操作
|
||||
//@"liveRoomDataDidChange"
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"liveRoomDataDidChange" object:weakSelf.roomModel];
|
||||
|
||||
//打赏金额
|
||||
CGFloat rewardvalue = [[dataDic objectForKey:@"rewardValue"] floatValue];
|
||||
int gold = (int)rewardvalue;
|
||||
[weakSelf makeToast:[NSString stringWithFormat:@"已打赏%d金币",gold]];
|
||||
|
||||
}else{
|
||||
|
||||
[weakSelf makeToast:@"打赏了出点问题"];
|
||||
}
|
||||
|
||||
} failure:^(NSError *err){
|
||||
[weakSelf makeToast:@"网络异常"];
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// P2PShareViewFour4Cell.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 16/11/17.
|
||||
// Copyright © 2016年 lianxiang. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "IfishKankanListModel.h"
|
||||
@interface P2PShareViewFour4Cell : UITableViewCell
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UILabel *xuanYanLabl;
|
||||
@property (strong, nonatomic) IfishKankanListModel *model;
|
||||
|
||||
@end
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// P2PShareViewFour4Cell.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 16/11/17.
|
||||
// Copyright © 2016年 lianxiang. All rights reserved.
|
||||
//
|
||||
|
||||
#import "P2PShareViewFour4Cell.h"
|
||||
|
||||
@implementation P2PShareViewFour4Cell
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
;
|
||||
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - Setters
|
||||
-(void)setModel:(IfishKankanListModel *)model
|
||||
{
|
||||
_model = model;
|
||||
|
||||
self.xuanYanLabl.text = model.roomDesc;
|
||||
|
||||
|
||||
}
|
||||
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||
[super setSelected:selected animated:animated];
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
@end
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
<?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" rowHeight="50" id="KGk-i7-Jjw" customClass="P2PShareViewFour4Cell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="50"/>
|
||||
<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="49.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7CE-42-psD">
|
||||
<rect key="frame" x="8" y="8" width="359" height="34"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="12"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailingMargin" secondItem="7CE-42-psD" secondAttribute="trailing" id="BFR-W5-Kyr"/>
|
||||
<constraint firstAttribute="leadingMargin" secondItem="7CE-42-psD" secondAttribute="leading" id="JsP-h3-rKU"/>
|
||||
<constraint firstItem="7CE-42-psD" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="tae-hV-EL5"/>
|
||||
<constraint firstItem="7CE-42-psD" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="topMargin" id="vDw-bd-Grk"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<connections>
|
||||
<outlet property="xuanYanLabl" destination="7CE-42-psD" id="rJ9-zg-egg"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="-56.5" y="-51"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// P2PShareViewTh3Cell.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 16/11/17.
|
||||
// Copyright © 2016年 lianxiang. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface P2PShareViewTh3Cell : UITableViewCell
|
||||
@property (weak, nonatomic) IBOutlet UILabel *roomName;
|
||||
|
||||
@end
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// P2PShareViewTh3Cell.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 16/11/17.
|
||||
// Copyright © 2016年 lianxiang. All rights reserved.
|
||||
//
|
||||
|
||||
#import "P2PShareViewTh3Cell.h"
|
||||
|
||||
@implementation P2PShareViewTh3Cell
|
||||
|
||||
- (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
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16E195" 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="P2PShareViewTh3Cell" id="KGk-i7-Jjw" customClass="P2PShareViewTh3Cell">
|
||||
<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="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="r05-Ph-tkY">
|
||||
<rect key="frame" x="0.0" y="43" width="320" height="1"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<color key="backgroundColor" red="0.91372549020000005" green="0.91372549020000005" blue="0.89019607840000003" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</view>
|
||||
<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="wOx-oW-6un">
|
||||
<rect key="frame" x="8" y="11" width="104" height="21"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
</tableViewCellContentView>
|
||||
<connections>
|
||||
<outlet property="roomName" destination="wOx-oW-6un" id="9yi-rK-Lge"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="-103" y="13"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// P2PShareViewsec2Cell.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 16/11/17.
|
||||
// Copyright © 2016年 lianxiang. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "IfishKankanListModel.h"
|
||||
@interface P2PShareViewsec2Cell : UITableViewCell
|
||||
@property (weak, nonatomic) IBOutlet UILabel *liveDays;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *renQiLab;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *zanLabel;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *shangLabel;
|
||||
|
||||
-(void)loaDataWith:(IfishKankanListModel*)model;
|
||||
|
||||
@end
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// P2PShareViewsec2Cell.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 16/11/17.
|
||||
// Copyright © 2016年 lianxiang. All rights reserved.
|
||||
//
|
||||
|
||||
#import "P2PShareViewsec2Cell.h"
|
||||
|
||||
@implementation P2PShareViewsec2Cell
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
self.liveDays.layer.masksToBounds = YES;
|
||||
self.liveDays.layer.cornerRadius = 2;
|
||||
self.renQiLab.layer.masksToBounds = YES;
|
||||
self.renQiLab.layer.cornerRadius = 2;
|
||||
self.shangLabel.layer.masksToBounds = YES;
|
||||
self.shangLabel.layer.cornerRadius = 2;
|
||||
self.zanLabel.layer.masksToBounds = YES;
|
||||
self.zanLabel.layer.cornerRadius =2;
|
||||
|
||||
}
|
||||
-(void)loaDataWith:(IfishKankanListModel*)model
|
||||
{
|
||||
self.liveDays.text = [NSString stringWithFormat:@"开播:%@天",model.numberDays];
|
||||
self.renQiLab.text = [NSString stringWithFormat:@"人气:%@",model.popularityValue];
|
||||
self.zanLabel.text = [NSString stringWithFormat:@"赞:%d",model.zanNumber];
|
||||
int gold = (int)model.goldValue;
|
||||
self.shangLabel.text = [NSString stringWithFormat:@"赏:%d",gold];
|
||||
|
||||
}
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||
[super setSelected:selected animated:animated];
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
@end
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16E195" 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="P2PShareViewsec2Cell" id="KGk-i7-Jjw" customClass="P2PShareViewsec2Cell">
|
||||
<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" fixedFrame="YES" text="分享:100天" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dUx-cM-rT2">
|
||||
<rect key="frame" x="8" y="11" width="67" height="21"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="0.91764705882352937" green="0.9137254901960784" blue="0.8901960784313725" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="11"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="人气:1000" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rxB-dn-1O6">
|
||||
<rect key="frame" x="83" y="11" width="66" height="21"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="0.91764705879999997" green="0.91372549020000005" blue="0.89019607840000003" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="11"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="赞:100" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uzI-dI-VnP">
|
||||
<rect key="frame" x="157" y="11" width="50" height="21"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="0.91764705879999997" green="0.91372549020000005" blue="0.89019607840000003" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="11"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="赏:100" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xic-fj-b52">
|
||||
<rect key="frame" x="215" y="11" width="50" height="21"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="0.91764705879999997" green="0.91372549020000005" blue="0.89019607840000003" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="11"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
</tableViewCellContentView>
|
||||
<connections>
|
||||
<outlet property="liveDays" destination="dUx-cM-rT2" id="weY-hN-UC7"/>
|
||||
<outlet property="renQiLab" destination="rxB-dn-1O6" id="zei-8P-OIE"/>
|
||||
<outlet property="shangLabel" destination="xic-fj-b52" id="41l-Pk-ed2"/>
|
||||
<outlet property="zanLabel" destination="uzI-dI-VnP" id="adH-NQ-TXW"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="-166" y="15"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
Reference in New Issue
Block a user