This commit is contained in:
启星
2025-09-29 17:21:49 +08:00
parent 9307d88177
commit 2a44a06630
138 changed files with 2802 additions and 439 deletions

View File

@@ -0,0 +1,16 @@
//
// QXSearchHeaderReusableView.h
// QXLive
//
// Created by 启星 on 2025/9/29.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface QXSearchHeaderReusableView : UICollectionReusableView
@property (nonatomic,strong)NSString *title;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,37 @@
//
// QXSearchHeaderReusableView.m
// QXLive
//
// Created by on 2025/9/29.
//
#import "QXSearchHeaderReusableView.h"
@interface QXSearchHeaderReusableView()
@property (nonatomic,strong)UILabel *titleLabel;
@end
@implementation QXSearchHeaderReusableView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubviews];
}
return self;
}
-(void)setTitle:(NSString *)title{
_title = title;
self.titleLabel.text = title;
}
-(void)initSubviews{
self.titleLabel = [[UILabel alloc] init];
self.titleLabel.font = [UIFont boldSystemFontOfSize:16];
self.titleLabel.textColor = RGB16(0x333333);
[self addSubview:self.titleLabel];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.height.mas_equalTo(24);
make.bottom.equalTo(self).offset(-8);
}];
}
@end

View File

@@ -0,0 +1,21 @@
//
// QXSearchUserCell.h
// QXLive
//
// Created by 启星 on 2025/9/29.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface QXSearchUserCell : UICollectionViewCell
@property (weak, nonatomic) IBOutlet UIImageView *avatarImageView;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *IdLabel;
@property (weak, nonatomic) IBOutlet UIButton *optionBtn;
@property (weak, nonatomic) IBOutlet UIImageView *sexImageView;
@property (nonatomic,strong)QXUserHomeModel *model;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,37 @@
//
// QXSearchUserCell.m
// QXLive
//
// Created by on 2025/9/29.
//
#import "QXSearchUserCell.h"
@implementation QXSearchUserCell
-(void)setModel:(QXUserHomeModel *)model{
_model = model;
[self.avatarImageView sd_setImageWithURL:[NSURL URLWithString:model.avatar]];
self.nameLabel.text = model.nickname;
self.IdLabel.text = [NSString stringWithFormat:@"ID%@",model.user_code];
UIImage *sexImage = [UIImage imageNamed:model.sex.intValue==1?@"user_sex_boy":@"user_sex_girl"];
self.sexImageView.image = sexImage;
if (self.model.room_id.intValue > 0) {
self.optionBtn.selected = YES;
}else{
self.optionBtn.selected = NO;
}
}
- (IBAction)chatAction:(UIButton *)sender {
if (self.model.room_id.intValue > 0) {
//
[[QXGlobal shareGlobal] joinRoomWithRoomId:self.model.room_id isRejoin:NO navagationController:self.navigationController];
}else{
[[QXGlobal shareGlobal] chatWithUserID:self.model.user_id nickname:self.model.nickname avatar:self.model.avatar navagationController:self.viewController.navigationController];
}
}
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
@end

View File

@@ -0,0 +1,124 @@
<?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"/>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="gTV-IL-0wX" customClass="QXSearchUserCell">
<rect key="frame" x="0.0" y="0.0" width="371" height="95"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="371" height="95"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="AiX-PB-0jE">
<rect key="frame" x="16" y="4" width="339" height="87"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="RUy-ti-tja">
<rect key="frame" x="12" y="13.666666666666671" width="60" height="60"/>
<constraints>
<constraint firstAttribute="width" constant="60" id="X7W-pj-bao"/>
<constraint firstAttribute="height" constant="60" id="nwZ-Tl-zHh"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<real key="value" value="25"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
</userDefinedRuntimeAttributes>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rip-bc-tOa">
<rect key="frame" x="82" y="19.666666666666671" width="40" height="27"/>
<constraints>
<constraint firstAttribute="height" constant="27" id="ZK9-sP-XU2"/>
</constraints>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<color key="textColor" red="0.12941176469999999" green="0.12941176469999999" blue="0.12941176469999999" 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" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4eM-ZP-CzJ">
<rect key="frame" x="82" y="49.666666666666664" width="31.666666666666671" height="17.999999999999993"/>
<constraints>
<constraint firstAttribute="height" constant="18" id="W5j-Nm-enT"/>
</constraints>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="12"/>
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="xa2-yM-3W3">
<rect key="frame" x="254" y="30.666666666666664" width="73" height="26"/>
<constraints>
<constraint firstAttribute="width" constant="73" id="XaJ-9F-XK5"/>
<constraint firstAttribute="height" constant="26" id="lhR-hi-ftE"/>
</constraints>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="12"/>
<color key="tintColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<state key="normal" image="expansion_call">
<color key="titleColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<state key="selected" image="room_user_follow">
<color key="titleColor" red="0.50196078430000002" green="0.50196078430000002" blue="0.59607843140000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<connections>
<action selector="chatAction:" destination="gTV-IL-0wX" eventType="touchUpInside" id="oW8-IW-WjV"/>
</connections>
</button>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="grA-va-voZ">
<rect key="frame" x="56" y="57.666666666666657" width="16" height="16"/>
<constraints>
<constraint firstAttribute="width" constant="16" id="VOg-h6-E7f"/>
<constraint firstAttribute="height" constant="16" id="l1q-Ci-t5c"/>
</constraints>
</imageView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstItem="xa2-yM-3W3" firstAttribute="centerY" secondItem="RUy-ti-tja" secondAttribute="centerY" id="35D-wG-jPy"/>
<constraint firstItem="4eM-ZP-CzJ" firstAttribute="leading" secondItem="rip-bc-tOa" secondAttribute="leading" id="4eZ-93-u3G"/>
<constraint firstItem="RUy-ti-tja" firstAttribute="leading" secondItem="AiX-PB-0jE" secondAttribute="leading" constant="12" id="9o5-Gq-QaZ"/>
<constraint firstItem="4eM-ZP-CzJ" firstAttribute="bottom" secondItem="RUy-ti-tja" secondAttribute="bottom" constant="-6" id="Aj5-gY-hr4"/>
<constraint firstItem="grA-va-voZ" firstAttribute="trailing" secondItem="RUy-ti-tja" secondAttribute="trailing" id="AkR-d0-Lbh"/>
<constraint firstItem="rip-bc-tOa" firstAttribute="leading" secondItem="RUy-ti-tja" secondAttribute="trailing" constant="10" id="E15-Xe-GNn"/>
<constraint firstItem="RUy-ti-tja" firstAttribute="centerY" secondItem="AiX-PB-0jE" secondAttribute="centerY" id="Xuv-VI-dq5"/>
<constraint firstItem="grA-va-voZ" firstAttribute="bottom" secondItem="RUy-ti-tja" secondAttribute="bottom" id="dMW-4g-bI7"/>
<constraint firstItem="RUy-ti-tja" firstAttribute="top" secondItem="rip-bc-tOa" secondAttribute="top" constant="-6" id="kK9-Sc-Ccx"/>
<constraint firstAttribute="trailing" secondItem="xa2-yM-3W3" secondAttribute="trailing" constant="12" id="vK8-uT-plY"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="16"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
</subviews>
</view>
<viewLayoutGuide key="safeArea" id="SEy-5g-ep8"/>
<constraints>
<constraint firstItem="AiX-PB-0jE" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" constant="4" id="6MU-Lr-pjF"/>
<constraint firstAttribute="trailing" secondItem="AiX-PB-0jE" secondAttribute="trailing" constant="16" id="B8q-ek-qJK"/>
<constraint firstItem="AiX-PB-0jE" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="16" id="H8X-EV-nQ1"/>
<constraint firstAttribute="bottom" secondItem="AiX-PB-0jE" secondAttribute="bottom" constant="4" id="hQF-6v-yj7"/>
</constraints>
<size key="customSize" width="348" height="91"/>
<connections>
<outlet property="IdLabel" destination="4eM-ZP-CzJ" id="BzD-Gi-TRa"/>
<outlet property="avatarImageView" destination="RUy-ti-tja" id="SDI-HQ-R6r"/>
<outlet property="nameLabel" destination="rip-bc-tOa" id="WuG-Xz-qnw"/>
<outlet property="optionBtn" destination="xa2-yM-3W3" id="5pr-oe-PpY"/>
<outlet property="sexImageView" destination="grA-va-voZ" id="n17-3F-emS"/>
</connections>
<point key="canvasLocation" x="394.6564885496183" y="-83.450704225352112"/>
</collectionViewCell>
</objects>
<resources>
<image name="expansion_call" width="73" height="26"/>
<image name="room_user_follow" width="73" height="26"/>
</resources>
</document>