提交
This commit is contained in:
17
QXLive/Mine(音域)/View/亲密关系/QXHeartBeatLevelRuleView.h
Normal file
17
QXLive/Mine(音域)/View/亲密关系/QXHeartBeatLevelRuleView.h
Normal file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// QXHeartBeatLevelRuleView.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/11/22.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXHeartBeatLevelRuleView : UIView
|
||||
@property (nonatomic,strong)NSString*rule;
|
||||
-(void)showInView:(UIView *)view;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
123
QXLive/Mine(音域)/View/亲密关系/QXHeartBeatLevelRuleView.m
Normal file
123
QXLive/Mine(音域)/View/亲密关系/QXHeartBeatLevelRuleView.m
Normal file
@@ -0,0 +1,123 @@
|
||||
//
|
||||
// QXHeartBeatLevelRuleView.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/11/22.
|
||||
//
|
||||
|
||||
#import "QXHeartBeatLevelRuleView.h"
|
||||
#import <WebKit/WebKit.h>
|
||||
@interface QXHeartBeatLevelRuleView()
|
||||
@property(nonatomic,strong)WKWebView *contentWebView;
|
||||
@property(nonatomic,strong)UIView* bgView;
|
||||
@property(nonatomic,strong)UIButton* closeBtn;
|
||||
@end
|
||||
@implementation QXHeartBeatLevelRuleView
|
||||
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
[self initSubviews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
-(void)initSubviews{
|
||||
self.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.3];
|
||||
|
||||
self.bgView = [[UIView alloc] initWithFrame:CGRectMake((self.width-ScaleWidth(312))/2, (self.height-ScaleWidth(492))/2-40, ScaleWidth(312), ScaleWidth(492))];
|
||||
[self.bgView addRoundedCornersWithRadius:16 byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight)];
|
||||
[self addSubview:self.bgView];
|
||||
|
||||
[self.bgView addSubview:self.contentWebView];
|
||||
self.closeBtn = [[UIButton alloc] initWithFrame:CGRectMake((self.width-40)/2, self.bgView.bottom+10, 40, 40)];
|
||||
[self.closeBtn setBackgroundImage:[UIImage imageNamed:@"home_white_close"] forState:(UIControlStateNormal)];
|
||||
[self.closeBtn addTarget:self action:@selector(closeAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self addSubview:self.closeBtn];
|
||||
[self.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.height.mas_equalTo(40);
|
||||
make.centerX.equalTo(self);
|
||||
make.top.mas_equalTo(self.bgView.bottom+10);
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
-(void)setRule:(NSString *)rule{
|
||||
_rule = rule;
|
||||
[self loadData];
|
||||
}
|
||||
- (void)loadData {
|
||||
NSURL* url=[NSURL URLWithString:self.rule];
|
||||
NSURLRequest *request =[NSURLRequest requestWithURL:url];
|
||||
[self.contentWebView loadRequest:request];
|
||||
}
|
||||
|
||||
|
||||
-(void)closeAction{
|
||||
[self hide];
|
||||
}
|
||||
|
||||
#pragma mark - getters and setters
|
||||
- (WKWebView *)contentWebView {
|
||||
if (!_contentWebView) {
|
||||
//设置网页的配置文件
|
||||
WKWebViewConfiguration * configuration = [[WKWebViewConfiguration alloc]init];
|
||||
// 允许可以与网页交互,选择视图
|
||||
configuration.selectionGranularity = YES;
|
||||
// web内容处理池pr
|
||||
configuration.processPool = [[WKProcessPool alloc] init];
|
||||
//自定义配置,一般用于 js调用oc方法(OC拦截URL中的数据做自定义操作)
|
||||
WKUserContentController * UserContentController = [[WKUserContentController alloc]init];
|
||||
// 是否支持记忆读取
|
||||
configuration.suppressesIncrementalRendering = NO;
|
||||
// 允许用户更改网页的设置
|
||||
configuration.preferences.javaScriptEnabled = YES;
|
||||
configuration.preferences.javaScriptCanOpenWindowsAutomatically = YES;
|
||||
configuration.userContentController = UserContentController;
|
||||
// 此处一定要做判断,因为是iOS9之后才有的方法,否则在iOS8下会崩溃
|
||||
if ([[UIDevice currentDevice].systemVersion floatValue] >= 9.0) {
|
||||
//允许视频播放
|
||||
configuration.allowsAirPlayForMediaPlayback = YES;
|
||||
// 允许在线播放
|
||||
configuration.allowsInlineMediaPlayback = YES;
|
||||
//开启手势触摸 默认设置就是NO。在ios8系统中会导致手势问题,程序崩溃
|
||||
_contentWebView.allowsBackForwardNavigationGestures = YES;
|
||||
}
|
||||
_contentWebView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, self.bgView.width, self.bgView.height) configuration:configuration];
|
||||
_contentWebView.backgroundColor = UIColor.clearColor;
|
||||
[_contentWebView addRoundedCornersWithRadius:6];
|
||||
_contentWebView.opaque = NO;
|
||||
//适应你设定的尺寸
|
||||
[_contentWebView sizeToFit];
|
||||
_contentWebView.scrollView.showsVerticalScrollIndicator = NO;
|
||||
_contentWebView.scrollView.backgroundColor = [UIColor clearColor];
|
||||
_contentWebView.scrollView.bounces = NO;
|
||||
// 设置代理
|
||||
}
|
||||
return _contentWebView;
|
||||
}
|
||||
|
||||
|
||||
|
||||
-(void)showInView:(UIView *)view{
|
||||
self.bgView.y = -SCREEN_HEIGHT;
|
||||
[view addSubview:self];
|
||||
[UIView animateWithDuration:0.3 animations:^{
|
||||
self.bgView.y = (self.height-ScaleWidth(492))/2-40;
|
||||
} completion:^(BOOL finished) {
|
||||
self.closeBtn.hidden = NO;
|
||||
}];
|
||||
}
|
||||
-(void)hide{
|
||||
self.closeBtn.hidden = YES;
|
||||
[UIView animateWithDuration:0.3 animations:^{
|
||||
self.bgView.y = SCREEN_HEIGHT;
|
||||
} completion:^(BOOL finished) {
|
||||
|
||||
[self removeFromSuperview];
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
22
QXLive/Mine(音域)/View/亲密关系/QXHeartBeatSpaceRecordCell.h
Normal file
22
QXLive/Mine(音域)/View/亲密关系/QXHeartBeatSpaceRecordCell.h
Normal file
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// QXHeartBeatSpaceRecordCell.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/11/22.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXHeartBeatSpaceRecordCell : UITableViewCell
|
||||
@property (weak, nonatomic) IBOutlet QXSeatHeaderView *headerView;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *contentLabel;
|
||||
@property (strong, nonatomic)QXUserHeartBeatSpaceLogModel *model;
|
||||
@property (strong, nonatomic)NSString *userId;
|
||||
+(instancetype)cellWithTableView:(UITableView *)tableView;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
59
QXLive/Mine(音域)/View/亲密关系/QXHeartBeatSpaceRecordCell.m
Normal file
59
QXLive/Mine(音域)/View/亲密关系/QXHeartBeatSpaceRecordCell.m
Normal file
@@ -0,0 +1,59 @@
|
||||
//
|
||||
// QXHeartBeatSpaceRecordCell.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/11/22.
|
||||
//
|
||||
|
||||
#import "QXHeartBeatSpaceRecordCell.h"
|
||||
|
||||
@implementation QXHeartBeatSpaceRecordCell
|
||||
+(instancetype)cellWithTableView:(UITableView *)tableView{
|
||||
static NSString *cellId = @"QXHeartBeatSpaceRecordCell";
|
||||
QXHeartBeatSpaceRecordCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
|
||||
if (!cell) {
|
||||
cell = [[NSBundle mainBundle] loadNibNamed:cellId owner:nil options:nil].lastObject;
|
||||
cell.backgroundColor = [UIColor clearColor];
|
||||
cell.contentView.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
return cell;
|
||||
}
|
||||
-(void)setUserId:(NSString *)userId{
|
||||
_userId = userId;
|
||||
}
|
||||
|
||||
-(void)setModel:(QXUserHeartBeatSpaceLogModel *)model{
|
||||
_model = model;
|
||||
[self.headerView setHeadIcon:model.from_user_info.avatar dress:model.from_user_info.dress];
|
||||
NSDate *date = [NSDate dateWithTimeIntervalSince1970:model.createtime.longLongValue]; //此处根据项目需求,选择是否除以1000 , 如果时间戳精确到秒则去掉1000
|
||||
NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
|
||||
formatter.dateFormat = @"yyyy-MM-dd HH:mm:ss";
|
||||
NSString*time = [formatter stringFromDate:date];
|
||||
self.timeLabel.text = time;
|
||||
self.nameLabel.text = model.from_user_info.nickname;
|
||||
UIColor *nameColor = RGB16(0xFF53CC);
|
||||
UIColor *contentNameColor = RGB16(0x4A89FF);
|
||||
NSString *content = [NSString stringWithFormat:@"%@",model.remark];
|
||||
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:content];
|
||||
|
||||
if ([model.from_user_id isEqualToString:self.userId] ) {
|
||||
self.nameLabel.textColor = nameColor;
|
||||
[attr yy_setColor:contentNameColor range:[content rangeOfString:model.to_user_info.nickname]];
|
||||
}else{
|
||||
self.nameLabel.textColor = contentNameColor;
|
||||
[attr yy_setColor:nameColor range:[content rangeOfString:model.to_user_info.nickname]];
|
||||
}
|
||||
self.contentLabel.attributedText = attr;
|
||||
}
|
||||
- (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
|
||||
86
QXLive/Mine(音域)/View/亲密关系/QXHeartBeatSpaceRecordCell.xib
Normal file
86
QXLive/Mine(音域)/View/亲密关系/QXHeartBeatSpaceRecordCell.xib
Normal file
@@ -0,0 +1,86 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina6_12" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.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="none" indentationWidth="10" rowHeight="307" id="KGk-i7-Jjw" customClass="QXHeartBeatSpaceRecordCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="516" height="307"/>
|
||||
<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="516" height="307"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="kDB-P0-eAc" customClass="QXSeatHeaderView">
|
||||
<rect key="frame" x="16" y="16" width="48" height="48"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="48" id="2z8-8O-4vb"/>
|
||||
<constraint firstAttribute="height" constant="48" id="aX5-8B-RZa"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZRa-V2-B3h">
|
||||
<rect key="frame" x="72" y="20" width="35.333333333333343" height="20"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="20" id="2S3-wj-dYF"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<color key="textColor" red="1" green="0.32549019607843138" blue="0.80000000000000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uCL-M4-5Hx">
|
||||
<rect key="frame" x="72" y="68" width="408" height="223"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="3qb-wi-G90">
|
||||
<rect key="frame" x="16" y="306" width="484" height="1"/>
|
||||
<color key="backgroundColor" red="0.81568627450980391" green="0.81568627450980391" blue="0.81568627450980391" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="1" id="wlx-KN-3DQ"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="AYF-oO-8tq">
|
||||
<rect key="frame" x="72" y="43" width="428" height="17"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="17" id="B9l-Hd-p4f"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="12"/>
|
||||
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="3qb-wi-G90" secondAttribute="trailing" constant="16" id="91k-0N-Wpr"/>
|
||||
<constraint firstItem="ZRa-V2-B3h" firstAttribute="top" secondItem="kDB-P0-eAc" secondAttribute="top" constant="4" id="Bny-jR-cys"/>
|
||||
<constraint firstAttribute="bottom" secondItem="uCL-M4-5Hx" secondAttribute="bottom" constant="16" id="CrK-CK-4Hs"/>
|
||||
<constraint firstItem="uCL-M4-5Hx" firstAttribute="leading" secondItem="ZRa-V2-B3h" secondAttribute="leading" id="P89-5y-Jqq"/>
|
||||
<constraint firstAttribute="trailingMargin" secondItem="uCL-M4-5Hx" secondAttribute="trailing" constant="16" id="VUI-pF-Aev"/>
|
||||
<constraint firstItem="kDB-P0-eAc" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="Xor-lq-pkP"/>
|
||||
<constraint firstItem="uCL-M4-5Hx" firstAttribute="top" secondItem="AYF-oO-8tq" secondAttribute="bottom" constant="8" id="XuR-uq-ICR"/>
|
||||
<constraint firstAttribute="bottom" secondItem="3qb-wi-G90" secondAttribute="bottom" id="YpW-IW-hTe"/>
|
||||
<constraint firstAttribute="trailing" secondItem="AYF-oO-8tq" secondAttribute="trailing" constant="16" id="fAd-RQ-39L"/>
|
||||
<constraint firstItem="kDB-P0-eAc" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="16" id="h9b-b5-5UI"/>
|
||||
<constraint firstItem="ZRa-V2-B3h" firstAttribute="leading" secondItem="kDB-P0-eAc" secondAttribute="trailing" constant="8" id="hLc-EK-j17"/>
|
||||
<constraint firstItem="AYF-oO-8tq" firstAttribute="leading" secondItem="ZRa-V2-B3h" secondAttribute="leading" id="jhq-zF-K72"/>
|
||||
<constraint firstItem="3qb-wi-G90" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="sub-hr-L9S"/>
|
||||
<constraint firstItem="AYF-oO-8tq" firstAttribute="bottom" secondItem="kDB-P0-eAc" secondAttribute="bottom" constant="-4" id="u8f-kW-vSK"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
|
||||
<connections>
|
||||
<outlet property="contentLabel" destination="uCL-M4-5Hx" id="Tco-Mw-PN0"/>
|
||||
<outlet property="headerView" destination="kDB-P0-eAc" id="qMe-nZ-45F"/>
|
||||
<outlet property="nameLabel" destination="ZRa-V2-B3h" id="uYk-gZ-QRb"/>
|
||||
<outlet property="timeLabel" destination="AYF-oO-8tq" id="WLP-Ta-oye"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="287.02290076335879" y="112.32394366197184"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -119,6 +119,7 @@
|
||||
|
||||
-(void)setUserId:(NSString *)userId{
|
||||
_userId = userId;
|
||||
self.cpCardView.userId = userId;
|
||||
self.page = 1;
|
||||
[self getList];
|
||||
}
|
||||
@@ -159,6 +160,7 @@
|
||||
QXMoreIntimateViewController *vc = [[QXMoreIntimateViewController alloc] init];
|
||||
vc.userId = self.userId;
|
||||
vc.relation_id = md.relation_list.firstObject.relation_id;
|
||||
vc.relation_name = md.relation_name;
|
||||
[self.viewController.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
@@ -175,11 +177,13 @@
|
||||
if (md.relation_list.count > 1) {
|
||||
QXIntimateListCell*cell = [QXIntimateListCell cellWithTableView:tableView];
|
||||
QXRoomBestFriendListModel *md = self.dataArray[indexPath.section];
|
||||
cell.userId = self.userId;
|
||||
cell.model = md;
|
||||
return cell;
|
||||
}else{
|
||||
MJWeakSelf
|
||||
QXIntimateMoreListCell *cell = [QXIntimateMoreListCell cellWithTableView:tableView];
|
||||
cell.userId = self.userId;
|
||||
cell.model = md.relation_list.firstObject;
|
||||
cell.deleteSuccessBlock = ^(QXRelationshipListModel * _Nonnull model) {
|
||||
weakSelf.page = 1;
|
||||
@@ -235,7 +239,7 @@
|
||||
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXRoomBestFriendListModel *md = self.dataArray[indexPath.section];
|
||||
if (md.relation_list.count > 1) {
|
||||
if (md.relation_list.count == 1) {
|
||||
return ScaleWidth(92)+18;
|
||||
}else{
|
||||
if (md.relation_list.count == 0) {
|
||||
|
||||
@@ -6,11 +6,13 @@
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "QXUserCpCardView.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXIntimateCpCell : UITableViewCell
|
||||
@property (nonatomic,strong)QXUserCpInfoModel *model;
|
||||
@property (nonatomic,strong)NSString *userId;
|
||||
@property (nonatomic,weak)id<QXUserCpCardViewDelegate>delegate;
|
||||
+(instancetype)cellWithTableView:(UITableView *)tableView;
|
||||
@end
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
//
|
||||
|
||||
#import "QXIntimateCpCell.h"
|
||||
#import "QXUserCpCardView.h"
|
||||
@interface QXIntimateCpCell()
|
||||
|
||||
@interface QXIntimateCpCell()<QXUserCpCardViewDelegate>
|
||||
@property (nonatomic,strong)QXUserCpCardView *cardView;
|
||||
@end
|
||||
@implementation QXIntimateCpCell
|
||||
@@ -34,9 +34,13 @@
|
||||
_model = model;
|
||||
self.cardView.model = model;
|
||||
}
|
||||
|
||||
-(void)setUserId:(NSString *)userId{
|
||||
_userId = userId;
|
||||
self.cardView.userId = self.userId;
|
||||
}
|
||||
-(void)initSubviews{
|
||||
self.cardView = [[QXUserCpCardView alloc] init];
|
||||
self.cardView.delegate = self;
|
||||
[self.contentView addSubview:self.cardView];
|
||||
[self.cardView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(24);
|
||||
@@ -44,6 +48,17 @@
|
||||
make.top.bottom.equalTo(self.contentView);
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)didClickHeaderCardViewWithUserId:(NSString *)userId{
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickHeaderCardViewWithUserId:)]) {
|
||||
[self.delegate didClickHeaderCardViewWithUserId:userId];
|
||||
}
|
||||
}
|
||||
-(void)didClickHeaderViewUserId:(NSString *)userId{
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickHeaderViewUserId:)]) {
|
||||
[self.delegate didClickHeaderViewUserId:userId];
|
||||
}
|
||||
}
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
|
||||
@@ -11,6 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXIntimateListCell : UITableViewCell
|
||||
@property (nonatomic,strong)QXRoomBestFriendListModel *model;
|
||||
@property (nonatomic,strong)NSString *userId;
|
||||
+(instancetype)cellWithTableView:(UITableView *)tableView;
|
||||
@end
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#import "QXIntimateListCell.h"
|
||||
#import "QXIntimateUserCell.h"
|
||||
|
||||
#import "QXUserHomePageViewController.h"
|
||||
@interface QXIntimateListCell()<UICollectionViewDataSource,UICollectionViewDelegate>
|
||||
@property (nonatomic,strong)UICollectionView *collectionView;
|
||||
@end
|
||||
@@ -68,9 +68,22 @@
|
||||
}
|
||||
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXIntimateUserCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXIntimateUserCell" forIndexPath:indexPath];
|
||||
cell.userId = self.userId;
|
||||
cell.model = self.model.relation_list[indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXRelationshipListModel *md = self.model.relation_list[indexPath.row];
|
||||
NSString *userId = @"";
|
||||
if ([md.user_id1 isEqualToString:self.userId]) {
|
||||
userId = md.user_id2;
|
||||
}else{
|
||||
userId = md.user_id1;
|
||||
}
|
||||
QXUserHomePageViewController *vc = [[QXUserHomePageViewController alloc] init];
|
||||
vc.user_id = userId;
|
||||
[self.viewController.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
|
||||
@@ -8,7 +8,12 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@protocol QXIntimateMoreListCellDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
-(void)didClickHeaderWithUserId:(NSString*)userId;
|
||||
|
||||
@end
|
||||
@interface QXIntimateMoreListCell : UITableViewCell
|
||||
@property (weak, nonatomic) IBOutlet QXSeatHeaderView *leftHeaderView;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *leftSexImageView;
|
||||
@@ -18,8 +23,10 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (weak, nonatomic) IBOutlet UILabel *rightNameLabel;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
|
||||
@property (nonatomic,strong)QXRelationshipListModel *model;
|
||||
@property (nonatomic,strong)NSString *userId;
|
||||
@property (nonatomic,copy)void(^topSuccessBlock)(QXRelationshipListModel*model);
|
||||
@property (nonatomic,copy)void(^deleteSuccessBlock)(QXRelationshipListModel*model);
|
||||
@property (nonatomic,weak)id<QXIntimateMoreListCellDelegate>delegate;
|
||||
+(instancetype)cellWithTableView:(UITableView *)tableView;
|
||||
@end
|
||||
|
||||
|
||||
@@ -67,25 +67,41 @@
|
||||
}];
|
||||
}
|
||||
|
||||
- (IBAction)leftAction:(id)sender {
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickHeaderWithUserId:)]) {
|
||||
[self.delegate didClickHeaderWithUserId:self.userId];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- (IBAction)rightAction:(id)sender {
|
||||
NSString *userId = @"";
|
||||
if ([self.model.user_id1 isEqualToString:self.userId]) {
|
||||
userId = self.model.user_id2;
|
||||
}else{
|
||||
userId = self.model.user_id1;
|
||||
}
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickHeaderWithUserId:)]) {
|
||||
[self.delegate didClickHeaderWithUserId:userId];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)setModel:(QXRelationshipListModel *)model{
|
||||
_model = model;
|
||||
if ([model.user_id1 isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
|
||||
[self.leftHeaderView setHeadIcon:model.avatar2 dress:@""];
|
||||
self.leftNameLabel.text = model.nickname2;
|
||||
self.leftSexImageView.image = [UIImage imageNamed:model.sex2.intValue == 1?@"user_sex_boy":@"user_sex_girl"];
|
||||
[self.rightHeaderView setHeadIcon:model.avatar1 dress:@""];
|
||||
self.rightNameLabel.text = model.nickname1;
|
||||
self.rightSexImageView.image = [UIImage imageNamed:model.sex1.intValue == 1?@"user_sex_boy":@"user_sex_girl"];
|
||||
}else{
|
||||
if ([model.user_id1 isEqualToString:self.userId]) {
|
||||
[self.leftHeaderView setHeadIcon:model.avatar1 dress:@""];
|
||||
self.leftNameLabel.text = model.nickname1;
|
||||
self.leftSexImageView.image = [UIImage imageNamed:model.sex1.intValue == 1?@"user_sex_boy":@"user_sex_girl"];
|
||||
[self.rightHeaderView setHeadIcon:model.avatar2 dress:@""];
|
||||
self.rightNameLabel.text = model.nickname2;
|
||||
self.rightSexImageView.image = [UIImage imageNamed:model.sex2.intValue == 1?@"user_sex_boy":@"user_sex_girl"];
|
||||
}else{
|
||||
[self.leftHeaderView setHeadIcon:model.avatar2 dress:@""];
|
||||
self.leftNameLabel.text = model.nickname2;
|
||||
self.leftSexImageView.image = [UIImage imageNamed:model.sex2.intValue == 1?@"user_sex_boy":@"user_sex_girl"];
|
||||
[self.rightHeaderView setHeadIcon:model.avatar1 dress:@""];
|
||||
self.rightNameLabel.text = model.nickname1;
|
||||
self.rightSexImageView.image = [UIImage imageNamed:model.sex2.intValue == 1?@"user_sex_boy":@"user_sex_girl"];
|
||||
}
|
||||
NSTimeInterval currentTime = [[NSDate date] timeIntervalSince1970];
|
||||
long long milliseconds = (long long)(currentTime);
|
||||
|
||||
@@ -30,6 +30,19 @@
|
||||
<constraint firstAttribute="width" constant="50" id="f4E-eT-Fu8"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eAs-09-73J">
|
||||
<rect key="frame" x="46.666666666666671" y="66" width="33" height="16"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="13"/>
|
||||
<color key="textColor" red="0.36078431372549019" green="0.16470588235294117" blue="0.44313725490196076" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="xap-Up-DHk">
|
||||
<rect key="frame" x="38" y="12" width="50" height="70"/>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
||||
<connections>
|
||||
<action selector="leftAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="r31-OZ-CWl"/>
|
||||
</connections>
|
||||
</button>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="fJj-mx-2yM">
|
||||
<rect key="frame" x="72" y="46" width="16" height="16"/>
|
||||
<constraints>
|
||||
@@ -70,35 +83,44 @@
|
||||
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eAs-09-73J">
|
||||
<rect key="frame" x="46.666666666666671" y="66" width="33" height="16"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="13"/>
|
||||
<color key="textColor" red="0.36078431372549019" green="0.16470588235294117" blue="0.44313725490196076" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tuv-zg-sBW">
|
||||
<rect key="frame" x="343.66666666666669" y="66" width="33" height="16"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="13"/>
|
||||
<color key="textColor" red="0.36078431372549019" green="0.16470588235294117" blue="0.44313725490196076" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="SsY-uu-WFL">
|
||||
<rect key="frame" x="335" y="12" width="50" height="70"/>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
||||
<connections>
|
||||
<action selector="rightAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="c6p-5f-wxW"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="50s-uU-EKD" firstAttribute="centerY" secondItem="pS6-S4-a2G" secondAttribute="centerY" id="5g4-vp-EYv"/>
|
||||
<constraint firstItem="SsY-uu-WFL" firstAttribute="top" secondItem="50s-uU-EKD" secondAttribute="top" id="8be-wg-JP2"/>
|
||||
<constraint firstItem="8wc-ZY-rQa" firstAttribute="top" secondItem="dAK-uZ-bVb" secondAttribute="bottom" constant="5" id="8rk-dg-kaQ"/>
|
||||
<constraint firstItem="fJj-mx-2yM" firstAttribute="trailing" secondItem="pS6-S4-a2G" secondAttribute="trailing" id="BEj-jg-gAB"/>
|
||||
<constraint firstItem="dAK-uZ-bVb" firstAttribute="top" secondItem="9uF-c2-o0x" secondAttribute="top" constant="24" id="D9p-BA-KBw"/>
|
||||
<constraint firstItem="6nc-bo-ejr" firstAttribute="bottom" secondItem="50s-uU-EKD" secondAttribute="bottom" id="FGe-n1-Wks"/>
|
||||
<constraint firstItem="pS6-S4-a2G" firstAttribute="leading" secondItem="9uF-c2-o0x" secondAttribute="leading" constant="38" id="H5c-Mz-Qma"/>
|
||||
<constraint firstItem="SsY-uu-WFL" firstAttribute="leading" secondItem="50s-uU-EKD" secondAttribute="leading" id="Rl2-c0-BBe"/>
|
||||
<constraint firstItem="dAK-uZ-bVb" firstAttribute="centerX" secondItem="9uF-c2-o0x" secondAttribute="centerX" id="VG0-8q-Lrq"/>
|
||||
<constraint firstAttribute="trailing" secondItem="50s-uU-EKD" secondAttribute="trailing" constant="38" id="Wh8-QI-j4t"/>
|
||||
<constraint firstItem="xap-Up-DHk" firstAttribute="leading" secondItem="pS6-S4-a2G" secondAttribute="leading" id="YQL-gI-xBB"/>
|
||||
<constraint firstItem="pS6-S4-a2G" firstAttribute="top" secondItem="9uF-c2-o0x" secondAttribute="top" constant="12" id="YtX-oa-Z5o"/>
|
||||
<constraint firstItem="SsY-uu-WFL" firstAttribute="bottom" secondItem="tuv-zg-sBW" secondAttribute="bottom" id="a00-qT-gYV"/>
|
||||
<constraint firstItem="fJj-mx-2yM" firstAttribute="bottom" secondItem="pS6-S4-a2G" secondAttribute="bottom" id="a5l-4I-UsC"/>
|
||||
<constraint firstItem="tuv-zg-sBW" firstAttribute="centerX" secondItem="50s-uU-EKD" secondAttribute="centerX" id="eA4-hx-xId"/>
|
||||
<constraint firstItem="eAs-09-73J" firstAttribute="top" secondItem="pS6-S4-a2G" secondAttribute="bottom" constant="4" id="inp-kG-exH"/>
|
||||
<constraint firstItem="6nc-bo-ejr" firstAttribute="trailing" secondItem="50s-uU-EKD" secondAttribute="trailing" id="j7A-eO-KSJ"/>
|
||||
<constraint firstItem="xap-Up-DHk" firstAttribute="top" secondItem="pS6-S4-a2G" secondAttribute="top" id="k1J-S0-BPd"/>
|
||||
<constraint firstItem="SsY-uu-WFL" firstAttribute="trailing" secondItem="50s-uU-EKD" secondAttribute="trailing" id="rQE-om-5xf"/>
|
||||
<constraint firstItem="eAs-09-73J" firstAttribute="centerX" secondItem="pS6-S4-a2G" secondAttribute="centerX" id="smC-jH-4iI"/>
|
||||
<constraint firstItem="xap-Up-DHk" firstAttribute="bottom" secondItem="eAs-09-73J" secondAttribute="bottom" id="ssk-yf-L3c"/>
|
||||
<constraint firstItem="8wc-ZY-rQa" firstAttribute="centerX" secondItem="9uF-c2-o0x" secondAttribute="centerX" id="uKd-PA-s9w"/>
|
||||
<constraint firstItem="xap-Up-DHk" firstAttribute="trailing" secondItem="pS6-S4-a2G" secondAttribute="trailing" id="v5j-a8-69s"/>
|
||||
<constraint firstItem="tuv-zg-sBW" firstAttribute="top" secondItem="50s-uU-EKD" secondAttribute="bottom" constant="4" id="yjp-7F-Gwe"/>
|
||||
</constraints>
|
||||
</view>
|
||||
|
||||
@@ -14,6 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
|
||||
@property (weak, nonatomic) IBOutlet QXSeatHeaderView *headerView;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *sexImageView;
|
||||
@property (nonatomic,strong)NSString* userId;
|
||||
@property (nonatomic,strong)QXRelationshipListModel *model;
|
||||
@end
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
@implementation QXIntimateUserCell
|
||||
-(void)setModel:(QXRelationshipListModel *)model{
|
||||
_model = model;
|
||||
if ([model.user_id1 isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
|
||||
if ([model.user_id1 isEqualToString:self.userId]) {
|
||||
[self.headerView setHeadIcon:model.avatar2 dress:@""];
|
||||
self.nameLabel.text = model.nickname2;
|
||||
self.sexImageView.image = [UIImage imageNamed:model.sex2.intValue == 1?@"user_sex_boy":@"user_sex_girl"];
|
||||
@@ -19,9 +19,15 @@
|
||||
self.nameLabel.text = model.nickname1;
|
||||
self.sexImageView.image = [UIImage imageNamed:model.sex1.intValue == 1?@"user_sex_boy":@"user_sex_girl"];
|
||||
}
|
||||
self.timeLabel.text = [NSString getTimeWithSecond:model.end_time.longLongValue];
|
||||
NSTimeInterval currentTime = [[NSDate date] timeIntervalSince1970];
|
||||
long long milliseconds = (long long)(currentTime);
|
||||
NSInteger time = model.end_time.longLongValue - milliseconds;
|
||||
self.timeLabel.text = [NSString stringWithFormat:@" %@ ",[NSString getTimeWithSecond:time]];
|
||||
|
||||
}
|
||||
-(void)setUserId:(NSString *)userId{
|
||||
_userId = userId;
|
||||
}
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
|
||||
Reference in New Issue
Block a user