增加换肤功能

This commit is contained in:
启星
2025-08-14 10:07:49 +08:00
parent f6964c1e89
commit 4f9318d98e
8789 changed files with 978530 additions and 2 deletions

View File

@@ -0,0 +1,22 @@
//
// QXDayTaskCell.h
// QXLive
//
// Created by 启星 on 2025/5/26.
//
#import <UIKit/UIKit.h>
#import "QXDayTaskModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXDayTaskCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *subTitleLabel;
@property (weak, nonatomic) IBOutlet UIButton *finishBtn;
@property (strong, nonatomic) QXDayTaskListModel *model;
+(instancetype)cellWithTableView:(UITableView *)tableView;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,73 @@
//
// QXDayTaskCell.m
// QXLive
//
// Created by on 2025/5/26.
//
#import "QXDayTaskCell.h"
#import "QXMineNetwork.h"
@implementation QXDayTaskCell
+(instancetype)cellWithTableView:(UITableView *)tableView{
static NSString *cellId = @"QXDayTaskCell";
QXDayTaskCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
if (!cell) {
cell = [[NSBundle mainBundle] loadNibNamed:cellId owner:nil options:nil].lastObject;
cell.backgroundColor = [UIColor clearColor];
}
return cell;
}
-(void)setModel:(QXDayTaskListModel *)model{
_model = model;
self.titleLabel.text = model.task_name;
NSString*subTitle = [NSString stringWithFormat:@"金币+%@",model.gold_reward];
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:subTitle];
[attr yy_setColor:RGB16(0xE24171) range:[subTitle rangeOfString:[NSString stringWithFormat:@"+%@",model.gold_reward]]];
self.subTitleLabel.attributedText = attr;
[self.iconImageView sd_setImageWithURL:[NSURL URLWithString:model.icon]];
if (model.task_status.intValue == 1) {
self.finishBtn.enabled = YES;
self.finishBtn.selected = NO;
}else if (model.task_status.intValue == 2) {
self.finishBtn.enabled = YES;
self.finishBtn.selected = YES;
}else{
self.finishBtn.selected = NO;
self.finishBtn.enabled = NO;
}
}
- (IBAction)finishAction:(id)sender {
if (self.model.task_status.intValue == 1) {
if (self.model.task_id.intValue == 9 || self.model.task_id.intValue == 10) {
QXGlobal.shareGlobal.taskModel = self.model;
[[QXGlobal shareGlobal] joinRoomWithRoomId:self.model.from_id isRejoin:NO navagationController:self.viewController.navigationController];
}
}else if (self.model.task_status.intValue == 2) {
MJWeakSelf
[QXMineNetwork dayTaskDrawWithTaskId:self.model.task_id successBlock:^(NSDictionary * _Nonnull dict) {
showToast(@"领取成功");
weakSelf.model.task_status = @"3";
weakSelf.finishBtn.selected = NO;
weakSelf.finishBtn.enabled = NO;
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}
}
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
[self.finishBtn addRoundedCornersWithRadius:15];
self.finishBtn.layer.borderColor = RGB16(0xE24171).CGColor;
self.finishBtn.layer.borderWidth = 1;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end

View File

@@ -0,0 +1,83 @@
<?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="default" indentationWidth="10" rowHeight="108" id="KGk-i7-Jjw" customClass="QXDayTaskCell">
<rect key="frame" x="0.0" y="0.0" width="481" height="108"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="481" height="108"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Zzf-Hx-7yu">
<rect key="frame" x="16" y="34" width="40" height="40"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="Xua-MB-4nn"/>
<constraint firstAttribute="width" constant="40" id="e6m-v0-EYD"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gZv-uE-Dy3">
<rect key="frame" x="62" y="34" width="333" height="17"/>
<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="bni-4p-6Qt">
<rect key="frame" x="405" y="39" width="60" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="NYX-5D-Uw8"/>
<constraint firstAttribute="width" constant="60" id="afU-OP-XMX"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="去完成">
<color key="titleColor" red="0.88627450980392153" green="0.25490196078431371" blue="0.44313725490196076" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
</state>
<state key="disabled" title="已领取"/>
<state key="selected" title="领取"/>
<connections>
<action selector="finishAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="O2a-NK-IEM"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eqP-bF-SEp">
<rect key="frame" x="62" y="57" width="333" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstItem="gZv-uE-Dy3" firstAttribute="leading" secondItem="Zzf-Hx-7yu" secondAttribute="trailing" constant="6" id="0aO-hG-r1W"/>
<constraint firstItem="bni-4p-6Qt" firstAttribute="leading" secondItem="gZv-uE-Dy3" secondAttribute="trailing" constant="10" id="83a-aB-YJD"/>
<constraint firstItem="eqP-bF-SEp" firstAttribute="bottom" secondItem="Zzf-Hx-7yu" secondAttribute="bottom" id="HP4-ka-VMG"/>
<constraint firstItem="eqP-bF-SEp" firstAttribute="leading" secondItem="gZv-uE-Dy3" secondAttribute="leading" id="MeK-CK-V0P"/>
<constraint firstItem="Zzf-Hx-7yu" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="aGe-7f-yAi"/>
<constraint firstAttribute="trailing" secondItem="bni-4p-6Qt" secondAttribute="trailing" constant="16" id="crV-1Z-BmV"/>
<constraint firstItem="gZv-uE-Dy3" firstAttribute="top" secondItem="Zzf-Hx-7yu" secondAttribute="top" id="itH-bd-9ay"/>
<constraint firstItem="bni-4p-6Qt" firstAttribute="leading" secondItem="eqP-bF-SEp" secondAttribute="trailing" constant="10" id="poY-hN-bRh"/>
<constraint firstItem="Zzf-Hx-7yu" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="y6a-e4-hfz"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
<constraints>
<constraint firstItem="bni-4p-6Qt" firstAttribute="centerY" secondItem="aW0-zy-SZf" secondAttribute="centerY" id="IM5-xV-Df6"/>
</constraints>
<connections>
<outlet property="finishBtn" destination="bni-4p-6Qt" id="K8I-ow-9Uv"/>
<outlet property="iconImageView" destination="Zzf-Hx-7yu" id="D8z-6l-i8N"/>
<outlet property="subTitleLabel" destination="eqP-bF-SEp" id="NDK-d5-ZFa"/>
<outlet property="titleLabel" destination="gZv-uE-Dy3" id="2qO-s4-pJt"/>
</connections>
<point key="canvasLocation" x="261.83206106870227" y="42.253521126760567"/>
</tableViewCell>
</objects>
</document>

View File

@@ -0,0 +1,37 @@
//
// QXDayTaskTopView.h
// QXLive
//
// Created by 启星 on 2025/5/26.
//
#import <UIKit/UIKit.h>
#import "QXProgressView.h"
#import "QXDayTaskModel.h"
typedef NS_ENUM(NSInteger) {
QXDayTaskTopSubViewTypeLeft = 0,
QXDayTaskTopSubViewTypeRight
}QXDayTaskTopSubViewType;
NS_ASSUME_NONNULL_BEGIN
@interface QXDayTaskTopView : UIView
@property (nonatomic,strong)QXDayTaskModel *model;
@end
@interface QXDayTaskTopSubView : UIView
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UILabel *subTitleLabel;
@property (nonatomic,strong)UIImageView *iconImageView;
@property (nonatomic,strong)UILabel *cornLabel;
@property (nonatomic,strong)QXProgressView *progressView;
@property (nonatomic,strong)UIButton *openBtn;
@property (nonatomic,assign)QXDayTaskTopSubViewType type;
@property (nonatomic,assign)double progress;
@property(nonatomic,strong)QXGiftBoxModel* boxModel;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,211 @@
//
// QXDayTaskTopView.m
// QXLive
//
// Created by on 2025/5/26.
//
#import "QXDayTaskTopView.h"
#import "QXDayTaskRuleView.h"
#import "QXMineNetwork.h"
@interface QXDayTaskTopView()
@property (nonatomic,strong)UIImageView *topImageView;
@property (nonatomic,strong)UIView *bgView;
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UIButton *ruleBtn;
@property (nonatomic,strong)QXDayTaskTopSubView *leftBoxView;
@property (nonatomic,strong)QXDayTaskTopSubView *rightBoxView;
@end
@implementation QXDayTaskTopView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubviews];
}
return self;
}
-(void)initSubviews{
self.topImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"day_task_top"]];
[self addSubview:self.topImageView];
self.topImageView.frame = CGRectMake(0, 0, self.width, ScaleWidth(187));
self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(ScaleWidth(25), ScaleWidth(22), 250, 21)];
self.titleLabel.textColor = [UIColor whiteColor];
self.titleLabel.font = [UIFont systemFontOfSize:14];
[self addSubview:self.titleLabel];
self.ruleBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.width-25, 0, 25, 50)];
[self.ruleBtn setTitle:QXText(@"任务规则") forState:(UIControlStateNormal)];
self.ruleBtn.titleLabel.numberOfLines = 0;
[self.ruleBtn addRoundedCornersWithRadius:8 byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerBottomLeft)];
[self.ruleBtn setTitleColor:UIColor.whiteColor forState:(UIControlStateNormal)];
self.ruleBtn.titleLabel.font = [UIFont systemFontOfSize:12];
self.ruleBtn.backgroundColor = RGB16(0xEA927E);
[self.ruleBtn addTarget:self action:@selector(ruleAction) forControlEvents:(UIControlEventTouchUpInside)];
[self addSubview:self.ruleBtn];
self.bgView = [[UIView alloc] initWithFrame:CGRectMake(0, ScaleWidth(52), self.width, self.height-ScaleWidth(52)-12)];
[self.bgView addRoundedCornersWithRadius:16];
self.bgView.backgroundColor = [UIColor whiteColor];
[self addSubview:self.bgView];
CGFloat boxWidth = (self.width-16*3)/2;
self.leftBoxView = [[QXDayTaskTopSubView alloc] initWithFrame:CGRectMake(16, 16, boxWidth, self.bgView.height-16*2)];
[self.leftBoxView addRoundedCornersWithRadius:8];
self.leftBoxView.backgroundColor = RGB16(0xFCE4ED);
self.leftBoxView.type = QXDayTaskTopSubViewTypeLeft;
[self.bgView addSubview:self.leftBoxView];
self.rightBoxView = [[QXDayTaskTopSubView alloc] initWithFrame:CGRectMake(self.leftBoxView.right+16, 16, boxWidth, self.leftBoxView.height) ];
self.rightBoxView.backgroundColor = RGB16(0xFDE8AE);
[self.rightBoxView addRoundedCornersWithRadius:8];
self.rightBoxView.type = QXDayTaskTopSubViewTypeRight;
[self.bgView addSubview:self.rightBoxView];
// self.leftBoxView.progress = 0.4;
// self.rightBoxView.progress = 1;
// self.titleLabel.text = [NSString stringWithFormat:@"%@:%@",QXText(@"今日累计获得金币"),@"20"];
}
-(void)setModel:(QXDayTaskModel *)model{
_model = model;
self.titleLabel.text = [NSString stringWithFormat:@"%@:%@",QXText(@"今日累计充值金币"),model.user_gold];
self.leftBoxView.boxModel = model.gift_box_list.firstObject;
self.rightBoxView.boxModel = model.gift_box_list.lastObject;
}
-(void)ruleAction{
QXDayTaskRuleView *ruleView = [[QXDayTaskRuleView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
[self.viewController.view addSubview:ruleView];
}
@end
@implementation QXDayTaskTopSubView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubviews];
}
return self;
}
-(void)initSubviews{
self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, self.width-20, 24)];
self.titleLabel.font = [UIFont boldSystemFontOfSize:16];
self.titleLabel.textColor = RGB16(0xE24171);
self.titleLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:self.titleLabel];
self.subTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, self.titleLabel.bottom, self.width-20, 18)];
self.subTitleLabel.font = [UIFont systemFontOfSize:12];
self.subTitleLabel.textColor = RGB16(0x999999);
self.subTitleLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:self.subTitleLabel];
self.iconImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"day_task_left"]];
self.iconImageView.frame = CGRectMake((self.width-ScaleWidth(60))/2, self.subTitleLabel.bottom, ScaleWidth(60), ScaleWidth(60));
[self addSubview:self.iconImageView];
self.cornLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, self.iconImageView.bottom, self.width-20, 18)];
self.cornLabel.font = [UIFont systemFontOfSize:12];
self.cornLabel.textColor = RGB16(0x999999);
self.cornLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:self.cornLabel];
self.openBtn = [[UIButton alloc] initWithFrame:CGRectMake((self.width-ScaleWidth(80))/2, self.height-30-ScaleWidth(10), ScaleWidth(80), 30)];
[self.openBtn setBackgroundImage:[UIImage imageWithColor:RGB16(0xf8b6a8)] forState:(UIControlStateDisabled)];
[self.openBtn setBackgroundImage:[UIImage imageWithColor:RGB16(0xff512c)] forState:(UIControlStateNormal)];
[self.openBtn setBackgroundImage:[UIImage imageWithColor:RGB16(0xf8b6a8)] forState:(UIControlStateSelected)];
[self.openBtn setTitle:QXText(@"未解锁") forState:(UIControlStateDisabled)];
[self.openBtn setTitle:QXText(@"已领取") forState:(UIControlStateSelected)];
[self.openBtn setTitle:QXText(@"已解锁") forState:(UIControlStateNormal)];
[self.openBtn setTitleColor:UIColor.whiteColor forState:(UIControlStateNormal)];
self.openBtn.titleLabel.font = [UIFont systemFontOfSize:14];
[self.openBtn addTarget:self action:@selector(openAction) forControlEvents:(UIControlEventTouchUpInside)];
[self.openBtn addRoundedCornersWithRadius:15];
self.openBtn.enabled = NO;
[self addSubview:self.openBtn];
self.progressView = [[QXProgressView alloc] initWithFrame:CGRectMake((self.width-ScaleWidth(70))/2, self.openBtn.top-4-13, ScaleWidth(70), 13)];
self.progressView.bgColor = RGB16(0xFFB8CD);
self.progressView.progressColor = RGB16(0xE24272);
self.progressView.progressTitleColor = RGB16(0xE24272);
[self addSubview:self.progressView];
// self.titleLabel.text = @"初级礼盒";
// self.subTitleLabel.text = @"最高可获得1000金币";
// self.cornLabel.text = @"满200金币";
}
-(void)setBoxModel:(QXGiftBoxModel *)boxModel{
_boxModel = boxModel;
self.titleLabel.text = boxModel.name;
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:boxModel.title];
[attr yy_setColor:RGB16(0xE24171) range:[boxModel.title rangeOfString:boxModel.highest_gain]];
self.subTitleLabel.attributedText = attr;
if (boxModel.icon.length > 0 && ([boxModel.icon hasPrefix:@"http"] || [boxModel.icon hasPrefix:@"https"])) {
[self.iconImageView sd_setImageWithURL:[NSURL URLWithString:boxModel.icon]];
}
self.cornLabel.text = [NSString stringWithFormat:@"满%@金币",boxModel.meet];
self.progressView.progress = boxModel.unlock_progress.doubleValue;
if (boxModel.status.intValue == 0) {
self.openBtn.enabled = NO;
}else if (boxModel.status.intValue == 1) {
self.openBtn.selected = NO;
self.openBtn.enabled = YES;
}else{
self.openBtn.enabled = YES;
self.openBtn.selected = YES;
}
}
-(void)openAction{
if (self.openBtn.selected == NO && self.openBtn.enabled == YES) {
MJWeakSelf
[QXMineNetwork openDayTaskGiftWithGiftBoxId:self.boxModel.id successBlock:^(NSString * _Nonnull giftName) {
weakSelf.boxModel.status = @"2";
weakSelf.openBtn.enabled = YES;
weakSelf.openBtn.selected = YES;
showToast(giftName);
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}
}
-(void)setProgress:(double)progress{
_progress = progress;
self.progressView.progress = progress;
if (progress >= 1) {
self.openBtn.enabled = YES;
}else{
self.openBtn.enabled = NO;
}
}
-(void)setType:(QXDayTaskTopSubViewType)type{
_type = type;
switch (type) {
case QXDayTaskTopSubViewTypeLeft:{
self.iconImageView.image = [UIImage imageNamed:@"day_task_left"];
self.progressView.bgColor = RGB16(0xFFB8CD);
self.progressView.progressColor = RGB16(0xE24272);
self.progressView.progressTitleColor = RGB16(0xE24272);
}
break;
case QXDayTaskTopSubViewTypeRight:{
self.iconImageView.image = [UIImage imageNamed:@"day_task_right"];
self.progressView.bgColor = RGB16(0xFFCFB3);
self.progressView.progressColor = RGB16(0xF35F07);
self.progressView.progressTitleColor = RGB16(0xF35F07);
}
break;
default:
break;
}
}
@end

View File

@@ -0,0 +1,19 @@
//
// QXProgressView.h
// QXLive
//
// Created by 启星 on 2025/5/26.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface QXProgressView : UIView
@property (nonatomic,strong)UIColor *bgColor;
@property (nonatomic,strong)UIColor *progressColor;
@property (nonatomic,strong)UIColor *progressTitleColor;
@property (nonatomic,assign)double progress;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,69 @@
//
// QXProgressView.m
// QXLive
//
// Created by on 2025/5/26.
//
#import "QXProgressView.h"
@interface QXProgressView()
@property (nonatomic,strong)UIView *bgView;
@property (nonatomic,strong)UIView *progressView;
@property (nonatomic,strong)UILabel *progressLabel;
@end
@implementation QXProgressView
- (instancetype)init
{
self = [super init];
if (self) {
[self initSubviews];
}
return self;
}
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubviews];
}
return self;
}
-(void)initSubviews{
self.bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.width-32, self.height)];
[self addSubview:self.bgView];
self.bgView.backgroundColor = RGB16(0xFFB8CD);
[self.bgView addRoundedCornersWithRadius:self.height/2];
self.progressView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 2, self.height)];
[self addSubview:self.progressView];
self.progressView.backgroundColor = RGB16(0xE24171);
[self.progressView addRoundedCornersWithRadius:self.height/2];
self.progressLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.width-30, 0, 30, self.height)];
self.progressLabel.textColor = RGB16(0xE24171);
self.progressLabel.font = [UIFont systemFontOfSize:10];
[self addSubview:self.progressLabel];
}
-(void)setBgColor:(UIColor *)bgColor{
_bgColor = bgColor;
self.bgView.backgroundColor = bgColor;
}
-(void)setProgressColor:(UIColor *)progressColor{
_progressColor = progressColor;
self.progressView.backgroundColor = progressColor;
}
-(void)setProgressTitleColor:(UIColor *)progressTitleColor{
_progressTitleColor = progressTitleColor;
self.progressLabel.textColor = progressTitleColor;
}
-(void)setProgress:(double)progress{
_progress = progress;
self.progressLabel.text = [NSString stringWithFormat:@"%d%%",(int)(progress*100)];
[UIView animateWithDuration:0.3 animations:^{
self.progressView.width = (self.width-32)*progress;
}];
}
@end

View File

@@ -0,0 +1,20 @@
//
// QXTaskGiftRecordCell.h
// QXLive
//
// Created by 启星 on 2025/7/11.
//
#import <UIKit/UIKit.h>
#import "QXDayTaskModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXTaskGiftRecordCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *giftLabel;
@property (nonatomic,strong)QXTaskGiftBoxRecordModel *model;
+(instancetype)cellWithTableView:(UITableView *)tableView;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,37 @@
//
// QXTaskGiftRecordCell.m
// QXLive
//
// Created by on 2025/7/11.
//
#import "QXTaskGiftRecordCell.h"
@implementation QXTaskGiftRecordCell
+(instancetype)cellWithTableView:(UITableView *)tableView{
static NSString *cellId = @"QXTaskGiftRecordCell";
QXTaskGiftRecordCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
if (!cell) {
cell = [[NSBundle mainBundle] loadNibNamed:cellId owner:nil options:nil].lastObject;
cell.backgroundColor = [UIColor clearColor];
}
return cell;
}
-(void)setModel:(QXTaskGiftBoxRecordModel *)model{
_model = model;
self.titleLabel.text = model.createtime;
self.nameLabel.text = model.gift_bag_name;
self.giftLabel.text = model.gift_name;
}
- (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

View File

@@ -0,0 +1,64 @@
<?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="default" indentationWidth="10" rowHeight="85" id="KGk-i7-Jjw" customClass="QXTaskGiftRecordCell">
<rect key="frame" x="0.0" y="0.0" width="470" height="85"/>
<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="470" height="85"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="90x-Pq-7Yx">
<rect key="frame" x="16" y="34" width="145" height="17"/>
<constraints>
<constraint firstAttribute="width" constant="145" id="eyv-DX-Iw2"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="iHp-kF-eHc">
<rect key="frame" x="176" y="34" width="75" height="17"/>
<constraints>
<constraint firstAttribute="width" constant="75" id="XWb-kE-QcY"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sTG-EW-ijM">
<rect key="frame" x="266" y="34" width="188" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="sTG-EW-ijM" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="31t-GF-bPI"/>
<constraint firstAttribute="trailing" secondItem="sTG-EW-ijM" secondAttribute="trailing" constant="16" id="4wm-bs-goZ"/>
<constraint firstItem="iHp-kF-eHc" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="B4m-MY-ulS"/>
<constraint firstItem="90x-Pq-7Yx" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="SjY-lW-NP0"/>
<constraint firstItem="90x-Pq-7Yx" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="fTY-fD-Pbd"/>
<constraint firstItem="iHp-kF-eHc" firstAttribute="leading" secondItem="90x-Pq-7Yx" secondAttribute="trailing" constant="15" id="kMC-3d-RBx"/>
<constraint firstItem="sTG-EW-ijM" firstAttribute="leading" secondItem="iHp-kF-eHc" secondAttribute="trailing" constant="15" id="wwQ-Uf-j1C"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
<connections>
<outlet property="giftLabel" destination="sTG-EW-ijM" id="JSB-Yz-MH2"/>
<outlet property="nameLabel" destination="iHp-kF-eHc" id="yvt-RY-bmn"/>
<outlet property="titleLabel" destination="90x-Pq-7Yx" id="Xbl-i4-AOV"/>
</connections>
<point key="canvasLocation" x="253.43511450381678" y="13.028169014084508"/>
</tableViewCell>
</objects>
</document>