This commit is contained in:
启星
2025-12-13 00:43:57 +08:00
parent ad6cd82a05
commit 999bf3d804
41 changed files with 1017 additions and 168 deletions

View File

@@ -29,6 +29,8 @@
#import "QXSystemNoticeViewController.h"
#import "QXHotRoomViewController.h"
#import "QXInvitePopView.h"
#import "QXMineNetwork.h"
#import "QXSignInAppView.h"
@interface QXHomeViewController ()<JXPagerViewDelegate,JXCategoryViewDelegate,GKCycleScrollViewDataSource,GKCycleScrollViewDelegate,QXGiftScrollViewDelegate,SDCycleScrollViewDelegate,QXHomeTopViewDelegate>
@property (nonatomic, strong) JXPagerView *pagingView;
@@ -60,6 +62,8 @@
@property (nonatomic,strong)QXRechargePermissionModel *permissionModel;
@property (nonatomic,strong)QXRoomListModel *recommendRoom;
///
@property (nonatomic,strong)NSString* signStatus;
@end
@implementation QXHomeViewController
@@ -150,6 +154,7 @@
self.rechargePermissionView.hidden = YES;
[self.view addSubview:self.rechargePermissionView];
[self getRecommendRoom];
[self getSignStatus];
}
- (void)viewDidLayoutSubviews {
[super viewDidLayoutSubviews];
@@ -247,6 +252,14 @@
}];
}
-(void)getSignStatus{
MJWeakSelf
[QXMineNetwork appSignTaskStatusSuccessBlock:^(NSString * _Nonnull status) {
weakSelf.signStatus = status;
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
}
//-(void)firstAction{
// [self popnPeopleRechargeView];
@@ -318,41 +331,58 @@
if ([QXGlobal shareGlobal].isAppStore) {
return;
}
if (self.permissionModel.first_charge_permission.intValue != 1) {
[self popRecommendRoom];
return;
}
MJWeakSelf
QXFirstRechargeView *view = [[QXFirstRechargeView alloc] init];
view.closeActionBlock = ^{
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
QXLOG(@"页面关闭");
if (self.permissionModel.first_charge_permission.intValue == 1) {
QXFirstRechargeView *view = [[QXFirstRechargeView alloc] init];
view.closeActionBlock = ^{
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
QXLOG(@"页面关闭");
if (weakSelf.signStatus.intValue == 1) {
[weakSelf popRecommendRoom];
}else{
[weakSelf popSignTask];
}
}];
};
view.rechargeActionBlock = ^(NSString * _Nonnull money, NSString * _Nonnull gift_bag_id) {
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
QXLOG(@"页面关闭");
QXRechargeView *recharge = [[QXRechargeView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
QXRechargeListModel *model = [[QXRechargeListModel alloc] init];
model.money = money;
recharge.selectedModel = model;
recharge.isPop = YES;
recharge.gift_bag_id = gift_bag_id;
recharge.isOnlyDisplayPayType = YES;
[recharge showInView:KEYWINDOW];
}];
};
view.refreshBlcock = ^{
[weakSelf getRechargePermission];
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
QXLOG(@"页面关闭");
}];
};
[[QXGlobal shareGlobal] showView:view popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{
}];
}else{
if (weakSelf.signStatus.intValue == 1) {
[weakSelf popRecommendRoom];
}];
}else{
[weakSelf popSignTask];
}
}
}
-(void)popSignTask{
MJWeakSelf
QXSignInAppView *view = [[QXSignInAppView alloc] init];
view.cancelBlock = ^{
[weakSelf popRecommendRoom];
};
view.rechargeActionBlock = ^(NSString * _Nonnull money, NSString * _Nonnull gift_bag_id) {
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
QXLOG(@"页面关闭");
QXRechargeView *recharge = [[QXRechargeView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
QXRechargeListModel *model = [[QXRechargeListModel alloc] init];
model.money = money;
recharge.selectedModel = model;
recharge.isPop = YES;
recharge.gift_bag_id = gift_bag_id;
recharge.isOnlyDisplayPayType = YES;
[recharge showInView:KEYWINDOW];
}];
};
view.refreshBlcock = ^{
[weakSelf getRechargePermission];
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
QXLOG(@"页面关闭");
}];
};
[[QXGlobal shareGlobal] showView:view popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{
}];
[view showInView:KEYWINDOW];
}
-(void)popRecommendRoom{

View File

@@ -253,7 +253,7 @@
}
-(UITableView *)tableView{
if (!_tableView) {
_tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, self.rankTypeView.bottom+10, SCREEN_WIDTH, self.myRankView.top - self.rankTypeView.bottom-10) style:(UITableViewStyleGrouped)];
_tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, self.rankTypeView.bottom+10, SCREEN_WIDTH, self.myRankView.top - self.rankTypeView.bottom-10) style:(UITableViewStylePlain)];
_tableView.dataSource = self;
_tableView.delegate = self;
_tableView.backgroundColor = [UIColor clearColor];

View File

@@ -15,6 +15,7 @@
if (self) {
self = [[[NSBundle mainBundle]loadNibNamed:@"QXRankCPTopThreeView" owner:nil options:nil] lastObject];
self.frame = frame;
self.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
}
return self;
}

View File

@@ -10,11 +10,11 @@
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="WH3-Kj-tPl" userLabel="RankCP Top Three View" customClass="QXRankCPTopThreeView">
<rect key="frame" x="0.0" y="0.0" width="438" height="230"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="230"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="home_rank_top_bg" translatesAutoresizingMaskIntoConstraints="NO" id="ouU-i5-mkT">
<rect key="frame" x="10" y="0.0" width="418" height="230"/>
<rect key="frame" x="10" y="0.0" width="355" height="230"/>
</imageView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="fkt-5i-wGo">
<rect key="frame" x="12" y="71" width="106" height="147"/>
@@ -131,13 +131,13 @@
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9kQ-2p-WMi">
<rect key="frame" x="140" y="32" width="158" height="197"/>
<rect key="frame" x="108.66666666666669" y="32" width="158" height="197"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="rank_first_bg" translatesAutoresizingMaskIntoConstraints="NO" id="ELT-qa-QKO">
<rect key="frame" x="0.0" y="0.0" width="158" height="197"/>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="user_header_placehoulder" translatesAutoresizingMaskIntoConstraints="NO" id="aGF-cs-ovJ">
<rect key="frame" x="34" y="61.666666666666671" width="43" height="43"/>
<rect key="frame" x="33.999999999999986" y="61.666666666666671" width="43" height="43"/>
<constraints>
<constraint firstAttribute="width" constant="43" id="hxW-n4-Uyk"/>
<constraint firstAttribute="height" constant="43" id="rge-H5-p6O"/>
@@ -150,7 +150,7 @@
</userDefinedRuntimeAttributes>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="user_header_placehoulder" translatesAutoresizingMaskIntoConstraints="NO" id="hOp-Tb-y2w">
<rect key="frame" x="81" y="61.666666666666671" width="43" height="43"/>
<rect key="frame" x="80.999999999999986" y="61.666666666666671" width="43" height="43"/>
<constraints>
<constraint firstAttribute="height" constant="43" id="Lc4-yM-QcA"/>
<constraint firstAttribute="width" constant="43" id="r5d-qQ-0ry"/>
@@ -163,21 +163,21 @@
</userDefinedRuntimeAttributes>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="my_real_love_bg" translatesAutoresizingMaskIntoConstraints="NO" id="TNm-GF-bzb">
<rect key="frame" x="34" y="60" width="90" height="46"/>
<rect key="frame" x="33.999999999999986" y="60" width="90" height="46"/>
<constraints>
<constraint firstAttribute="height" constant="46" id="NPw-VB-8m8"/>
<constraint firstAttribute="width" constant="90" id="fP0-0i-9jG"/>
</constraints>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="home_rank_top_name_bg" translatesAutoresizingMaskIntoConstraints="NO" id="LZO-Bi-Scl">
<rect key="frame" x="43" y="120" width="72" height="22"/>
<rect key="frame" x="42.999999999999986" y="120" width="72" height="22"/>
<constraints>
<constraint firstAttribute="height" constant="22" id="9Ll-3D-kiE"/>
<constraint firstAttribute="width" constant="72" id="itM-jv-mGn"/>
</constraints>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="home_rank_top_cp_name_bg" translatesAutoresizingMaskIntoConstraints="NO" id="aOR-DW-3Z8">
<rect key="frame" x="43" y="143" width="72" height="22"/>
<rect key="frame" x="42.999999999999986" y="143" width="72" height="22"/>
<constraints>
<constraint firstAttribute="width" constant="72" id="aBr-8e-rKs"/>
<constraint firstAttribute="height" constant="22" id="fOH-xn-3FU"/>
@@ -202,14 +202,14 @@
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="rank_real_love_value_bg" translatesAutoresizingMaskIntoConstraints="NO" id="PqR-bx-jVl">
<rect key="frame" x="39" y="102" width="80" height="18"/>
<rect key="frame" x="38.999999999999986" y="102" width="80" height="18"/>
<constraints>
<constraint firstAttribute="width" constant="80" id="ZYt-mm-gLE"/>
<constraint firstAttribute="height" constant="18" id="eFY-Wa-ws3"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Z7f-CG-uOk">
<rect key="frame" x="58" y="102" width="61" height="18"/>
<rect key="frame" x="57.999999999999986" y="102" width="61" height="18"/>
<constraints>
<constraint firstAttribute="height" constant="18" id="VNk-5G-EDl"/>
</constraints>
@@ -249,7 +249,7 @@
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="W20-Fx-QTq">
<rect key="frame" x="316" y="71" width="106" height="147"/>
<rect key="frame" x="253" y="71" width="106" height="147"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="rank_third_bg" translatesAutoresizingMaskIntoConstraints="NO" id="Nxb-5v-S7f">
<rect key="frame" x="0.0" y="0.0" width="106" height="147"/>
@@ -379,6 +379,8 @@
<constraint firstItem="ouU-i5-mkT" firstAttribute="top" secondItem="WH3-Kj-tPl" secondAttribute="top" id="uqO-NW-LZp"/>
<constraint firstItem="ouU-i5-mkT" firstAttribute="leading" secondItem="WH3-Kj-tPl" secondAttribute="leading" constant="10" id="xnA-kc-eRW"/>
</constraints>
<nil key="simulatedTopBarMetrics"/>
<nil key="simulatedBottomBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<connections>
<outlet property="firstHeaderImage" destination="aGF-cs-ovJ" id="rwA-vJ-tQq"/>

View File

@@ -25,6 +25,8 @@ typedef NS_ENUM(NSInteger) {
QXRoomMessageTypeSendAndRecieveCpHeartSignal = 130,
/// cp双向奔赴
QXRoomMessageTypeCpHeartFinished = 131,
/// 师徒任务
QXRoomMessageTypeMasterTask = 132,
/// 基础文本消息类型
QXRoomMessageTypeText = 1,

View File

@@ -791,6 +791,21 @@
};
}
-(void)showMasterTaskInviteAlertViewWithRoomId:(NSString*)roomId userId:(NSString*)userId{
QXCustomAlertView *alertView = [[QXCustomAlertView alloc] init];
alertView.autoDismissTime = 10;
[alertView showInView:KEYWINDOW title:@"温馨提示" message:@"您的师傅邀请您进入房间,您是否同意?" cancleTitle:@"拒绝" commitTitle:@"同意"];
alertView.cancelBlock = ^{
NSDictionary *dict = @{@"status":@"2",@"room_id":roomId?:@""};
NSString *jsonStr = [dict jsonStringEncoded];
[[QXRoomMessageManager shared] sendC2CMessage:jsonStr messageType:(QXRoomMessageTypeMasterTask) userId:userId];
};
alertView.commitBlock = ^{
QXLOG(@"进入房间");
[[QXGlobal shareGlobal] joinRoomWithRoomId:roomId isRejoin:NO navagationController:(QXRoomNavigationController*)KEYWINDOW.rootViewController];
};
}
-(void)onRecvC2CTextMessage:(NSString *)msgID sender:(V2TIMUserInfo *)info text:(NSString *)text{
}
@@ -823,6 +838,17 @@
NSDictionary *dict = [json jsonValueDecoded];
NSString *message = [NSString stringWithFormat:@"%@",dict[@"text1"]];
[self showCpFinishedAlertViewWithText:message];
}else if (meesageType == QXRoomMessageTypeMasterTask){
NSString *json = [NSString stringWithFormat:@"%@",msg.Text[@"text"]];
NSDictionary *dict = [json jsonValueDecoded];
NSString *status = [NSString stringWithFormat:@"%@",dict[@"status"]];
if ([status isEqualToString:@"2"]) {
showToast(@"您的徒弟拒绝了您的邀请");
}else if ([status isEqualToString:@"1"]){
NSString *roomId = [NSString stringWithFormat:@"%@",dict[@"room_id"]];
QXRoomChatListModel *model = [QXRoomChatListModel yy_modelWithJSON:msg.Text];
[self showMasterTaskInviteAlertViewWithRoomId:roomId userId:model.FromUserInfo.user_id];
}
}
}
-(void)onRecvGroupCustomMessage:(NSString *)msgID groupID:(NSString *)groupID sender:(V2TIMGroupMemberInfo *)info customData:(NSData *)data{

View File

@@ -171,8 +171,7 @@
};
v.authActionBlock = ^{
[[QXGlobal shareGlobal] hideViewBlock:^{
QXRoomSingerAuthViewController *vc = [[QXRoomSingerAuthViewController alloc] init];
vc.singer_status = weakSelf.userModel.singer_status;
QXRealNameViewController *vc = [[QXRealNameViewController alloc] init];
[weakSelf.navigationController pushViewController:vc animated:YES];
}];
};

View File

@@ -12,6 +12,8 @@ NS_ASSUME_NONNULL_BEGIN
@interface QXUserHomePageViewController : QXBaseViewController
@property (nonatomic,strong)NSString *user_id;
@property (nonatomic,assign)BOOL isGiftWall;
/// 是否是相册
@property (nonatomic,assign)BOOL isAlbum;
@end
NS_ASSUME_NONNULL_END

View File

@@ -79,6 +79,9 @@
if (self.isGiftWall) {
self.categoryView.defaultSelectedIndex = 1;
}
if (self.isAlbum) {
self.categoryView.defaultSelectedIndex = 2;
}
self.categoryView.backgroundColor = [UIColor clearColor];
JXCategoryIndicatorImageView *indicatorView = [[JXCategoryIndicatorImageView alloc] init];
indicatorView.indicatorImageView.image = [UIImage imageNamed:@"home_slider"];

View File

@@ -11,8 +11,15 @@
#import "QXDayTaskRuleView.h"
#import "QXMineNetwork.h"
#import "QXTaskGiftRecordVC.h"
#import "QXRealNameViewController.h"
#import "QXUserHomePageViewController.h"
#import "QXGuildViewController.h"
#import "QXWithDrawBindViewController.h"
#import "QXRechargeViewcController.h"
#import "QXSignInAppView.h"
#import "QXCreatPhotosViewController.h"
@interface QXTaskViewController ()<UITableViewDataSource,UITableViewDelegate>
@interface QXTaskViewController ()<UITableViewDataSource,UITableViewDelegate,QXDayTaskCellDelegate>
@property (nonatomic,strong)QXDayTaskTopView *topView;
@property (nonatomic,strong)UITableView *tableView;
@property (nonatomic,strong)QXDayTaskModel *model;
@@ -42,7 +49,7 @@
}
- (void)initSubViews{
self.bgImageHidden = YES;
self.view.backgroundColor = RGB16(0xD7CDFF);
self.view.backgroundColor = RGB16(0xE3FAE4);
self.tableView.tableHeaderView = self.topView;
[self.view addSubview:self.tableView];
}
@@ -51,6 +58,15 @@
MJWeakSelf
[QXMineNetwork getDayTaskListSuccessBlock:^(QXDayTaskModel * _Nonnull model) {
weakSelf.model = model;
[weakSelf.dataArray removeAllObjects];
[weakSelf.dataArray addObjectsFromArray:model.tasks];
for (int i = 0 ; i < model.tasks.count; i++) {
QXDayTaskTypeModel*md = model.tasks[i];
if (md.task_list.count == 0) {
[weakSelf.dataArray removeObjectAtIndex:i];
}
}
weakSelf.model.tasks = weakSelf.dataArray;
weakSelf.topView.model = model;
[weakSelf.tableView reloadData];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
@@ -69,43 +85,95 @@
return _topView;
}
-(void)didClickFinishTaskWithModel:(QXDayTaskListModel *)taskModel{
if ([taskModel.task_id isEqualToString:@"1"]) {
QXSignInAppView *signView = [[QXSignInAppView alloc] init];
[signView showInView:self.view];
return;
}
if (taskModel.task_status.intValue == 1) {
// if (taskModel.task_id.intValue == 9 || taskModel.task_id.intValue == 10) {
//// QXGlobal.shareGlobal.taskModel = self.model;
// if ([[QXGlobal shareGlobal].roomId isEqualToString:taskModel.from_id]) {
// [[QXGlobal shareGlobal] popToRoomViewController];
// }
// [[QXGlobal shareGlobal] joinRoomWithRoomId:self.model.from_id isRejoin:NO navagationController:self.viewController.navigationController];
// }
if (taskModel.jump_type.intValue == 0) {
return;
}else if (taskModel.jump_type.intValue == 1) {
QXRealNameViewController *vc = [[QXRealNameViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
return;
}else if (taskModel.jump_type.intValue == 2) {
QXCreatPhotosViewController *vc = [[QXCreatPhotosViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
return;
}else if (taskModel.jump_type.intValue == 3) {
QXWithDrawBindViewController *vc = [[QXWithDrawBindViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
return;
}else if (taskModel.jump_type.intValue == 4) {
// if (taskModel.from_id.longLongValue > 0) {
showLoadingInView(self.view);
[QXMineNetwork getRoomTaskJumpRoomWithTaskId:taskModel.task_id successBlock:^(NSString * _Nonnull roomId) {
hideLoadingInView(self.view);
if (roomId.longLongValue > 0) {
NSDictionary *dict = @{@"status":@"1",@"room_id":taskModel.from_id?:@""};
NSString *jsonStr = [dict jsonStringEncoded];
[[QXRoomMessageManager shared] sendC2CMessage:jsonStr messageType:(QXRoomMessageTypeMasterTask) userId:taskModel.student_id];
[QXGlobal.shareGlobal joinRoomWithRoomId:roomId isRejoin:NO navagationController:self.navigationController];
}else{
showToast(@"暂无此类型房间");
}
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
hideLoadingInView(self.view);
showToast(msg);
}];
// }else{
// showToast(@"暂无此类型房间");
// }
return;
}else if (taskModel.jump_type.intValue == 5) {
QXGuildViewController *vc = [[QXGuildViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
return;
}else if (taskModel.jump_type.intValue == 6) {
QXRechargeViewcController *vc = [[QXRechargeViewcController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
return;
}else if (taskModel.jump_type.intValue == 7) {
}
}else if (taskModel.task_status.intValue == 2) {
MJWeakSelf
[QXMineNetwork dayTaskDrawWithTaskId:taskModel.task_id student_id:taskModel.student_id successBlock:^(NSDictionary * _Nonnull dict) {
showToast(@"领取成功");
[weakSelf getDayTask];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}
}
#pragma mark - UITableViewDataSource,UITableViewDelegate
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
if (self.model == nil) {
return 0;
}
if (self.model.tasks.teacher_tasks.count > 0) {
return 4;
}else{
return 3;
}
return self.model.tasks.count;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
if (section == 0) {
return self.model.tasks.daily_tasks.count;
}else if(section == 1){
return self.model.tasks.daily_tasks_special.count;
}else if(section == 2){
return self.model.tasks.usual_tasks.count;
}else{
return self.model.tasks.teacher_tasks.count;
}
QXDayTaskTypeModel *model = self.model.tasks[section];
return model.task_list.count;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
QXDayTaskCell *cell = [QXDayTaskCell cellWithTableView:tableView];
QXDayTaskListModel *model;
if (indexPath.section == 0) {
model = self.model.tasks.daily_tasks[indexPath.row];
}else if(indexPath.section == 1){
model = self.model.tasks.daily_tasks_special[indexPath.row];
}else if(indexPath.section == 2){
model = self.model.tasks.usual_tasks[indexPath.row];
}else{
model = self.model.tasks.teacher_tasks[indexPath.row];
}
cell.model = model;
QXDayTaskTypeModel *model = self.model.tasks[indexPath.section];
QXDayTaskListModel *taskModel = model.task_list[indexPath.row];
cell.model = taskModel;
cell.delegate = self;
return cell;
}
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
@@ -115,15 +183,8 @@
UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, 12, SCREEN_WIDTH-32*2, 23)];
titleLabel.font = [UIFont boldSystemFontOfSize:16];
titleLabel.textColor = QXConfig.textColor;
if (section == 0) {
titleLabel.text = QXText(@"每日任务");
}else if(section == 1){
titleLabel.text = QXText(@"特殊任务");
}else if(section == 2){
titleLabel.text = QXText(@"平台任务");
}else{
titleLabel.text = QXText(@"师徒任务");
}
QXDayTaskTypeModel *model = self.model.tasks[section];
titleLabel.text = model.task_type_name;
[header addSubview:titleLabel];
return header;
}
@@ -142,6 +203,15 @@
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
return 35;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
QXDayTaskTypeModel *model = self.model.tasks[indexPath.section];
QXDayTaskListModel *taskModel = model.task_list[indexPath.row];
if ([taskModel.task_id isEqualToString:@"1"]) {
QXSignInAppView *signView = [[QXSignInAppView alloc] init];
[signView showInView:self.view];
return;
}
}
-(UITableView *)tableView{
if (!_tableView) {
@@ -149,7 +219,8 @@
_tableView.dataSource = self;
_tableView.delegate = self;
_tableView.backgroundColor = [UIColor clearColor];
_tableView.rowHeight = 60;
// _tableView.estimatedRowHeight = 60;
_tableView.rowHeight = UITableViewAutomaticDimension;
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
if (@available(iOS 15.0, *)) {
_tableView.sectionHeaderTopPadding = 0;

View File

@@ -15,7 +15,7 @@ NS_ASSUME_NONNULL_BEGIN
/// 盲盒信息
@property(nonatomic,strong)NSArray <QXGiftBoxModel*>*gift_box_list;
@property(nonatomic,strong)QXDayTaskTypeModel*tasks;
@property(nonatomic,strong)NSArray<QXDayTaskTypeModel*>* tasks;
@end
@@ -41,15 +41,17 @@ NS_ASSUME_NONNULL_BEGIN
@end
@interface QXDayTaskTypeModel : NSObject
/// 每日特殊任务2
@property(nonatomic,strong)NSArray <QXDayTaskListModel*>*daily_tasks_special;
/// 每日常规任务
@property(nonatomic,strong)NSArray <QXDayTaskListModel*>*daily_tasks;
/// 平台任务列表
@property(nonatomic,strong)NSArray <QXDayTaskListModel*>*usual_tasks;
@property(nonatomic,strong)NSArray <QXDayTaskListModel*>*teacher_tasks;
///// 每日特殊任务2
//@property(nonatomic,strong)NSArray <QXDayTaskListModel*>*daily_tasks_special;
///// 每日常规任务
//@property(nonatomic,strong)NSArray <QXDayTaskListModel*>*daily_tasks;
///// 平台任务列表
//@property(nonatomic,strong)NSArray <QXDayTaskListModel*>*usual_tasks;
//
//@property(nonatomic,strong)NSArray <QXDayTaskListModel*>*teacher_tasks;
@property(nonatomic,strong)NSString *task_type_name;
@property(nonatomic,strong)NSString *task_type_id;
@property(nonatomic,strong)NSArray<QXDayTaskListModel*>*task_list;
@end
@interface QXDayTaskListModel : NSObject
@@ -76,7 +78,23 @@ NS_ASSUME_NONNULL_BEGIN
/// 0 记录次数 1 计时
@property(nonatomic,strong)NSString *is_time;
/// 奖励类型 1金币 2钻石
@property(nonatomic,strong)NSString *reward_type;
//@property(nonatomic,strong)NSString *reward_type;
/// 任务奖励
@property(nonatomic,strong)NSString *reward_str;
/**
0 不跳转
1 跳转实名
2 跳转我的相册
3 跳转绑定管理
4 跳转房间
5 跳转申请加入公会
6 跳转充值
7 签到
*/
@property(nonatomic,strong)NSString *jump_type;
/// 徒弟user id
@property(nonatomic,strong)NSString *student_id;
@end
@@ -89,4 +107,26 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic,strong)NSString *createtime;
@end
@interface QXSignAppModel : NSObject
/// 第几天
@property(nonatomic,strong)NSString *day;
/// 日期
@property(nonatomic,strong)NSString *sign_in_date;
/// 签到状态1已签到 0未签到
@property(nonatomic,strong)NSString *sign_in_status;
/// 初级礼盒
@property(nonatomic,strong)NSString *sign_in_status_str;
/// 是否是当天 0否 1是
@property(nonatomic,strong)NSString *is_today;
/// 礼物名称
@property(nonatomic,strong)NSString *gift_name;
/// 数量
@property(nonatomic,strong)NSString *num;
/// 价格
@property(nonatomic,strong)NSString *gift_price;
/// 1金币 2礼物 3装扮 4钻石
@property(nonatomic,strong)NSString *type;
/// 礼物
@property(nonatomic,strong)NSString *base_image;
@end
NS_ASSUME_NONNULL_END

View File

@@ -25,10 +25,10 @@
+(NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass{
return @{
@"daily_tasks" : @"QXDayTaskListModel",
@"usual_tasks" : @"QXDayTaskListModel",
@"daily_tasks_special": @"QXDayTaskListModel",
@"teacher_tasks": @"QXDayTaskListModel",
@"task_list" : @"QXDayTaskListModel",
// @"usual_tasks" : @"QXDayTaskListModel",
// @"daily_tasks_special": @"QXDayTaskListModel",
// @"teacher_tasks": @"QXDayTaskListModel",
};
}
@@ -43,4 +43,10 @@
@end
@implementation QXSignAppModel
@end

View File

@@ -33,9 +33,12 @@ NS_ASSUME_NONNULL_BEGIN
/// 是否为爵位礼物 0 打开 1 锁住
@property (nonatomic,strong)NSString *is_lock;
/// 是否为爵位礼物 0 打开 1 锁住
/// 是否为cp礼物 0 打开 1 锁住
@property (nonatomic,strong)NSString *is_cp;
/// 是否为师徒标签
@property (nonatomic,strong)NSString *is_teacher;
@property (nonatomic,assign)BOOL isSelected;
@end

View File

@@ -947,6 +947,7 @@ NS_ASSUME_NONNULL_BEGIN
领取任务金币
*/
+(void)dayTaskDrawWithTaskId:(NSString*)task_id
student_id:(NSString*)student_id
successBlock:(void (^)(NSDictionary* dict))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
/**
@@ -1402,6 +1403,32 @@ NS_ASSUME_NONNULL_BEGIN
+(void)signRoomRefuseSignWithRoomId:(NSString*)roomId
successBlock:(void (^)(NSDictionary* dict))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
/**
每日任务跳转房间
*/
+(void)getRoomTaskJumpRoomWithTaskId:(NSString*)task_id
successBlock:(void (^)(NSString* roomId))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
/**
每日签到状态
*/
+(void)getAppSignTaskListSuccessBlock:(void (^)(NSArray<QXSignAppModel*>* list))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
/**
每日签到
*/
+(void)appSignTaskSuccessBlock:(void (^)(NSDictionary* dict))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
/**
每日签到状态
*/
+(void)appSignTaskStatusSuccessBlock:(void (^)(NSString* status))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
@end

View File

@@ -1870,10 +1870,12 @@
*/
+(void)dayTaskDrawWithTaskId:(NSString*)task_id
student_id:(NSString*)student_id
successBlock:(void (^)(NSDictionary* dict))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock{
NSDictionary *parameters =@{
@"task_id":task_id?task_id:@""
@"task_id":task_id?task_id:@"",
@"student_id":student_id?:@""
};
[[QXRequset shareInstance] postWithUrl:QXDayDrawTaskCoin parameters:parameters needCache:NO success:^(id responseObject) {
if (successBlock) {
@@ -2825,5 +2827,63 @@
}];
}
/**
*/
+(void)getRoomTaskJumpRoomWithTaskId:(NSString*)task_id
successBlock:(void (^)(NSString* roomId))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock{
[[QXRequset shareInstance] getWithUrl:QXRoomTaskJumpRoom parameters:@{@"task_id":task_id?:@""} needCache:NO success:^(id responseObject) {
if (successBlock) {
NSString *roomId = [NSString stringWithFormat:@"%@",responseObject[@"data"]];
successBlock(roomId);
}
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
failBlock(error,msg);
}];
}
/**
*/
+(void)getAppSignTaskListSuccessBlock:(void (^)(NSArray<QXSignAppModel*>* list))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock{
[[QXRequset shareInstance] getWithUrl:QXAppSignTask parameters:@{} needCache:NO success:^(id responseObject) {
if (successBlock) {
NSArray *list = [NSArray yy_modelArrayWithClass:[QXSignAppModel class] json:responseObject[@"data"]];
successBlock(list);
}
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
failBlock(error,msg);
}];
}
/**
*/
+(void)appSignTaskSuccessBlock:(void (^)(NSDictionary* dict))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock{
[[QXRequset shareInstance] getWithUrl:QXAppSign parameters:@{} needCache:NO success:^(id responseObject) {
if (successBlock) {
successBlock(responseObject[@"data"]);
}
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
failBlock(error,msg);
}];
}
/**
*/
+(void)appSignTaskStatusSuccessBlock:(void (^)(NSString* status))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock{
[[QXRequset shareInstance] getWithUrl:QXAppSignStatus parameters:@{} needCache:NO success:^(id responseObject) {
if (successBlock) {
NSString *status = [NSString stringWithFormat:@"%@",responseObject[@"data"]];
successBlock(status);
}
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
failBlock(error,msg);
}];
}
@end

View File

@@ -8,7 +8,13 @@
#import <UIKit/UIKit.h>
#import "QXDayTaskModel.h"
NS_ASSUME_NONNULL_BEGIN
@protocol QXDayTaskCellDelegate <NSObject>
@optional
-(void)didClickFinishTaskWithModel:(QXDayTaskListModel *)taskModel;
@end
@interface QXDayTaskCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@@ -16,6 +22,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (weak, nonatomic) IBOutlet UIButton *finishBtn;
@property (strong, nonatomic) QXDayTaskListModel *model;
@property (weak, nonatomic) id<QXDayTaskCellDelegate>delegate;
+(instancetype)cellWithTableView:(UITableView *)tableView;
@end

View File

@@ -21,15 +21,16 @@
-(void)setModel:(QXDayTaskListModel *)model{
_model = model;
self.titleLabel.text = model.task_name;
NSString*subTitle = @"";
if (model.reward_type.intValue == 1) {
subTitle = [NSString stringWithFormat:@"金币+%@",model.gold_reward];
}else{
subTitle = [NSString stringWithFormat:@"钻石+%@",model.gold_reward];
}
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:subTitle];
[attr yy_setColor:RGB16(0xFF8827) range:[subTitle rangeOfString:[NSString stringWithFormat:@"+%@",model.gold_reward]]];
self.subTitleLabel.attributedText = attr;
// NSString*subTitle = @"";
// if (model.reward_type.intValue == 1) {
// subTitle = [NSString stringWithFormat:@"金币+%@",model.gold_reward];
// }else{
// subTitle = [NSString stringWithFormat:@"钻石+%@",model.gold_reward];
// }
// NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:model.reward_str];
// [attr yy_setColor:RGB16(0xFF8827) range:[subTitle rangeOfString:[NSString stringWithFormat:@"+%@",model.gold_reward]]];
self.subTitleLabel.text = [model.reward_str isExist]?model.reward_str:@" ";
[self.finishBtn setTitle:model.task_type_str forState:(UIControlStateNormal)];
[self.iconImageView sd_setImageWithURL:[NSURL URLWithString:model.icon]];
if (model.task_status.intValue == 1) {
self.finishBtn.enabled = YES;
@@ -46,38 +47,21 @@
}
}
- (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;
if ([[QXGlobal shareGlobal].roomId isEqualToString:self.model.from_id]) {
[[QXGlobal shareGlobal] popToRoomViewController];
}
[[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);
}];
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickFinishTaskWithModel:)]) {
[self.delegate didClickFinishTaskWithModel:self.model];
}
}
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
[self.finishBtn addRoundedCornersWithRadius:15];
[self.finishBtn setTitleColor:RGB16(0xC134EE) forState:(UIControlStateNormal)];
[self.finishBtn setTitleColor:RGB16(0x3ABC6D) forState:(UIControlStateNormal)];
[self.finishBtn setTitleColor:UIColor.whiteColor forState:(UIControlStateSelected)];
[self.finishBtn setTitleColor:RGB16(0x666666) forState:(UIControlStateDisabled)];
[self.finishBtn setBackgroundImage:[UIImage imageWithColor:RGB16(0xC134EE)] forState:(UIControlStateSelected)];
[self.finishBtn setBackgroundImage:[UIImage imageWithColor:RGB16(0x3ABC6D)] forState:(UIControlStateSelected)];
[self.finishBtn setBackgroundImage:[UIImage imageWithColor:UIColor.clearColor] forState:(UIControlStateNormal)];
[self.finishBtn setBackgroundImage:[UIImage imageWithColor:RGB16(0xF1F2F3)] forState:(UIControlStateDisabled)];
self.finishBtn.layer.borderColor = RGB16(0xC134EE).CGColor;
self.finishBtn.layer.borderColor = RGB16(0x3ABC6D).CGColor;
self.finishBtn.layer.borderWidth = 1;
}

View File

@@ -10,7 +10,7 @@
<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">
<tableViewCell contentMode="scaleToFill" selectionStyle="none" 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">
@@ -18,23 +18,23 @@
<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"/>
<rect key="frame" x="16" y="9" width="40" height="40"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="Xua-MB-4nn"/>
<constraint firstAttribute="width" constant="40" id="e6m-v0-EYD"/>
<constraint firstAttribute="width" constant="40" id="Nup-9v-MxR"/>
<constraint firstAttribute="height" constant="40" id="w2p-VE-pN3"/>
</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"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gZv-uE-Dy3">
<rect key="frame" x="62" y="9" width="333" height="69"/>
<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"/>
<rect key="frame" x="405" y="14" width="60" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="NYX-5D-Uw8"/>
<constraint firstAttribute="width" constant="60" id="afU-OP-XMX"/>
<constraint firstAttribute="height" constant="30" id="AVT-S0-Yru"/>
<constraint firstAttribute="width" constant="60" id="UW1-Ri-uwx"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
@@ -47,30 +47,29 @@
<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"/>
<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="eqP-bF-SEp">
<rect key="frame" x="62" y="83" 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"/>
<color key="textColor" red="0.88627450980392153" green="0.25490196078431371" blue="0.44313725490196076" 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"/>
<constraint firstItem="bni-4p-6Qt" firstAttribute="centerY" secondItem="Zzf-Hx-7yu" secondAttribute="centerY" id="0rH-Y7-jwf"/>
<constraint firstItem="gZv-uE-Dy3" firstAttribute="leading" secondItem="Zzf-Hx-7yu" secondAttribute="trailing" constant="6" id="2nM-DG-Grg"/>
<constraint firstItem="bni-4p-6Qt" firstAttribute="leading" secondItem="eqP-bF-SEp" secondAttribute="trailing" constant="10" id="ANm-2o-d67"/>
<constraint firstAttribute="trailing" secondItem="bni-4p-6Qt" secondAttribute="trailing" constant="16" id="FGd-NP-Bud"/>
<constraint firstItem="eqP-bF-SEp" firstAttribute="top" secondItem="gZv-uE-Dy3" secondAttribute="bottom" constant="5" id="Ftb-vc-ugs"/>
<constraint firstItem="Zzf-Hx-7yu" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="9" id="JNo-Ml-0Uf"/>
<constraint firstItem="Zzf-Hx-7yu" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="LJ1-Ut-byU"/>
<constraint firstItem="bni-4p-6Qt" firstAttribute="leading" secondItem="gZv-uE-Dy3" secondAttribute="trailing" constant="10" id="XUO-fj-17G"/>
<constraint firstAttribute="bottom" secondItem="eqP-bF-SEp" secondAttribute="bottom" constant="8" id="iSn-GZ-hix"/>
<constraint firstItem="gZv-uE-Dy3" firstAttribute="top" secondItem="Zzf-Hx-7yu" secondAttribute="top" id="mgj-C7-FFs"/>
<constraint firstItem="eqP-bF-SEp" firstAttribute="leading" secondItem="gZv-uE-Dy3" secondAttribute="leading" id="qVo-gN-l0W"/>
</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"/>

View File

@@ -0,0 +1,39 @@
//
// QXSignInAppView.h
// QXLive
//
// Created by 启星 on 2025/12/11.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface QXSignInAppView : UIView
@property (nonatomic,copy)void(^cancelBlock)(void);
-(void)showInView:(UIView *)view;
-(void)hide;
@end
@interface QXSignInAppSubView : UIView
@property (nonatomic,strong)UIImageView *bgImageView;
@property (nonatomic,strong)UILabel *dayLabel;
@property (nonatomic,strong)UILabel *dayTitleLabel;
@property (nonatomic,strong)UIImageView *statusImageView;
@property (nonatomic,strong)UIImageView *giftImageView;
@property (nonatomic,strong)UILabel *giftNameLabel;
@property (nonatomic,strong)QXSignAppModel *model;
@end
@interface QXSignInAppResultView : UIView
@property (nonatomic,strong)UIImageView *giftImageView;
@property (nonatomic,strong)UILabel *giftNameLabel;
@property (nonatomic,strong)QXSignAppModel *model;
@property (nonatomic,strong)UIButton *happyBtn;
@property (nonatomic,copy)void(^happyBlock)(void);
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,407 @@
//
// QXSignInAppView.m
// QXLive
//
// Created by on 2025/12/11.
//
#import "QXSignInAppView.h"
#import "QXMineNetwork.h"
@interface QXSignInAppView()
@property (nonatomic,strong)UIView *bgView;
@property (nonatomic,strong)UIImageView *bgImageView;
@property (nonatomic,strong)QXSignInAppSubView *signView1;
@property (nonatomic,strong)QXSignInAppSubView *signView2;
@property (nonatomic,strong)QXSignInAppSubView *signView3;
@property (nonatomic,strong)QXSignInAppSubView *signView4;
@property (nonatomic,strong)QXSignInAppSubView *signView5;
@property (nonatomic,strong)QXSignInAppSubView *signView6;
@property (nonatomic,strong)QXSignInAppSubView *signView7;
@property (nonatomic,strong)NSMutableArray *signViewArray;
@property (nonatomic,strong)UIButton *signBtn;
@property (nonatomic,strong)UIButton *closeBtn;
@property (nonatomic,strong)QXSignAppModel*todayModel;
@property (nonatomic,strong)QXSignInAppResultView *resultView;
@end
@implementation QXSignInAppView
- (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.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.5];
self.bgView = [[UIView alloc] initWithFrame:CGRectMake((SCREEN_WIDTH-ScaleWidth(331))/2.0, -self.height, ScaleWidth(331), ScaleWidth(446)+50)];
// self.bgView.backgroundColor = [UIColor whiteColor];
self.bgView.layer.masksToBounds = YES;
self.bgView.layer.cornerRadius = 16;
[self addSubview:self.bgView];
self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"app_sign_task_bg"]];
[self.bgView addSubview:self.bgImageView];
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.equalTo(self.bgView);
make.height.mas_equalTo(ScaleWidth(446));
}];
self.signView1 = [[QXSignInAppSubView alloc] init];
[self.signView1 addRoundedCornersWithRadius:4];
[self.bgView addSubview:self.signView1];
self.signView2 = [[QXSignInAppSubView alloc] init];
[self.signView2 addRoundedCornersWithRadius:4];
[self.bgView addSubview:self.signView2];
self.signView3 = [[QXSignInAppSubView alloc] init];
[self.signView3 addRoundedCornersWithRadius:4];
[self.bgView addSubview:self.signView3];
self.signView4 = [[QXSignInAppSubView alloc] init];
[self.signView4 addRoundedCornersWithRadius:4];
[self.bgView addSubview:self.signView4];
self.signView5 = [[QXSignInAppSubView alloc] init];
[self.signView5 addRoundedCornersWithRadius:4];
[self.bgView addSubview:self.signView5];
self.signView6 = [[QXSignInAppSubView alloc] init];
[self.signView6 addRoundedCornersWithRadius:4];
[self.bgView addSubview:self.signView6];
self.signView7 = [[QXSignInAppSubView alloc] init];
[self.signView7 addRoundedCornersWithRadius:4];
[self.bgView addSubview:self.signView7];
CGFloat leftMargin = ScaleWidth(22);
CGFloat itemSpace = ScaleWidth(6);
CGFloat itemWidth = (self.bgView.width - leftMargin*2 - itemSpace*3)/4;
CGFloat itemHeight = ScaleWidth(88);
[self.signView1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(leftMargin);
make.width.mas_equalTo(itemWidth);
make.height.mas_equalTo(itemHeight);
make.top.mas_equalTo(ScaleWidth(168));
}];
[self.signView2 mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.signView1);
make.left.equalTo(self.signView1.mas_right).offset(itemSpace);
make.width.mas_equalTo(itemWidth);
make.height.mas_equalTo(itemHeight);
}];
[self.signView3 mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.signView1);
make.left.equalTo(self.signView2.mas_right).offset(itemSpace);
make.width.mas_equalTo(itemWidth);
make.height.mas_equalTo(itemHeight);
}];
[self.signView4 mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.signView1);
make.left.equalTo(self.signView3.mas_right).offset(itemSpace);
make.width.mas_equalTo(itemWidth);
make.height.mas_equalTo(itemHeight);
}];
[self.signView5 mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.signView1.mas_bottom).offset(ScaleWidth(10));
make.left.equalTo(self.signView1);
make.width.mas_equalTo(itemWidth);
make.height.mas_equalTo(itemHeight);
}];
[self.signView6 mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.signView5);
make.left.equalTo(self.signView5.mas_right).offset(itemSpace);
make.width.mas_equalTo(itemWidth);
make.height.mas_equalTo(itemHeight);
}];
[self.signView7 mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.signView5);
make.left.equalTo(self.signView6.mas_right).offset(itemSpace);
make.right.mas_equalTo(-leftMargin);
make.height.mas_equalTo(itemHeight);
}];
[self.signViewArray addObject:self.signView1];
[self.signViewArray addObject:self.signView2];
[self.signViewArray addObject:self.signView3];
[self.signViewArray addObject:self.signView4];
[self.signViewArray addObject:self.signView5];
[self.signViewArray addObject:self.signView6];
[self.signViewArray addObject:self.signView7];
self.signBtn = [[UIButton alloc] init];
[self.signBtn setBackgroundImage:[UIImage imageNamed:@"sign_app_btn_bg"] forState:(UIControlStateNormal)];
[self.signBtn setBackgroundImage:[UIImage imageWithColor:RGB16(0x999999)] forState:(UIControlStateDisabled)];
[self.signBtn setTitle:@"立即签到" forState:(UIControlStateNormal)];
[self.signBtn setTitle:@"已签到" forState:(UIControlStateDisabled)];
[self.signBtn addTarget:self action:@selector(signAction) forControlEvents:(UIControlEventTouchUpInside)];
self.signBtn.titleLabel.font = [UIFont boldSystemFontOfSize:14];
[self.signBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)];
[self.signBtn setTitleColor:RGB16(0xffffff) forState:(UIControlStateDisabled)];
[self.signBtn addRoundedCornersWithRadius:25];
[self.bgView addSubview:self.signBtn];
[self.signBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(ScaleWidth(257));
make.height.mas_equalTo(50);
make.centerX.equalTo(self.bgView);
make.bottom.equalTo(self.bgImageView.mas_bottom).offset(-ScaleWidth(20));
}];
self.closeBtn = [[UIButton alloc] init];
[self.closeBtn setBackgroundImage:[UIImage imageNamed:@"home_white_close"] forState:(UIControlStateNormal)];
[self.closeBtn addTarget:self action:@selector(closeAction) forControlEvents:(UIControlEventTouchUpInside)];
[self.bgView addSubview:self.closeBtn];
[self.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(35);
make.height.mas_equalTo(35);
make.centerX.equalTo(self.bgView);
make.bottom.equalTo(self.bgView);
}];
[self addSubview:self.resultView];
self.resultView.hidden = YES;
[self.resultView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.top.equalTo(self.signView1);
make.right.equalTo(self.signView4);
make.bottom.equalTo(self.signBtn);
}];
}
-(void)signAction{
MJWeakSelf
[QXMineNetwork appSignTaskSuccessBlock:^(NSDictionary * _Nonnull dict) {
weakSelf.resultView.hidden = NO;
[weakSelf getSignTaskList];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}
-(void)getSignTaskList{
MJWeakSelf
[QXMineNetwork getAppSignTaskListSuccessBlock:^(NSArray<QXSignAppModel *> * _Nonnull list) {
if (list.count == weakSelf.signViewArray.count) {
for (int i = 0;i < list.count; i++) {
QXSignAppModel*md = list[i];
QXSignInAppSubView *signView = weakSelf.signViewArray[i];
signView.model = md;
if (md.is_today.intValue == 1) {
weakSelf.todayModel = md;
weakSelf.resultView.model = weakSelf.todayModel;
if (md.sign_in_status.intValue == 1) {
weakSelf.signBtn.enabled = NO;
}else{
weakSelf.signBtn.enabled = YES;
}
}
}
}
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
}
-(void)closeAction{
if (self.cancelBlock) {
self.cancelBlock();
}
[self hide];
}
-(void)showInView:(UIView *)view{
[self getSignTaskList];
[view addSubview:self];
[UIView animateWithDuration:0.3 delay:0 usingSpringWithDamping:0.5 initialSpringVelocity:1.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
self.bgView.y = (SCREEN_HEIGHT-ScaleWidth(446))/2.0-60;
} completion:^(BOOL finished) {
}];
}
-(void)hide{
[UIView animateWithDuration:0.3 delay:0 usingSpringWithDamping:0.5 initialSpringVelocity:1.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
self.bgView.y = SCREEN_HEIGHT;
} completion:^(BOOL finished) {
[self removeFromSuperview];
}];
}
-(NSMutableArray *)signViewArray{
if (!_signViewArray) {
_signViewArray = [NSMutableArray array];
}
return _signViewArray;
}
-(QXSignInAppResultView *)resultView{
if (!_resultView) {
_resultView = [[QXSignInAppResultView alloc] init];
MJWeakSelf
_resultView.happyBlock = ^{
[weakSelf closeAction];
};
}
return _resultView;
}
@end
@implementation QXSignInAppSubView
- (instancetype)init
{
self = [super init];
if (self) {
[self initSubviews];
}
return self;
}
-(void)setModel:(QXSignAppModel *)model{
_model = model;
self.dayLabel.text = model.day;
if (model.sign_in_status.intValue == 1) {
self.statusImageView.hidden = NO;
self.statusImageView.image = [UIImage imageNamed:@"app_sign_drawed"];
self.alpha = 0.5;
}else{
self.statusImageView.hidden = YES;
self.alpha = 1;
}
self.giftNameLabel.text = [NSString stringWithFormat:@"%@%@",model.gift_name,model.num];
[self.giftImageView sd_setImageWithURL:[NSURL URLWithString:model.base_image]];
}
-(void)initSubviews{
self.bgImageView = [[UIImageView alloc] init];
self.bgImageView.backgroundColor = RGB16(0xD3FFC8);
[self addSubview:self.bgImageView];
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self);
}];
self.dayLabel = [[UILabel alloc] init];
self.dayLabel.textColor = RGB16(0xFFC273);
self.dayLabel.font = [UIFont fontWithName:@"YouSheBiaoTiHei" size:32];
[self addSubview:self.dayLabel];
[self.dayLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self).offset(-5);
make.left.mas_equalTo(5);
}];
self.dayTitleLabel = [[UILabel alloc] init];
self.dayTitleLabel.textColor = RGB16(0xFFC273);
self.dayTitleLabel.font = [UIFont systemFontOfSize:12];
self.dayTitleLabel.text = @"DAY";
[self addSubview:self.dayTitleLabel];
[self.dayTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self).offset(10);
make.left.equalTo(self.dayLabel.mas_right).offset(3);
}];
self.giftImageView = [[UIImageView alloc] init];
self.giftImageView.contentMode = UIViewContentModeScaleAspectFit;
[self addSubview:self.giftImageView];
[self.giftImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(38);
make.centerX.centerY.equalTo(self);
}];
self.giftNameLabel = [[UILabel alloc] init];
self.giftNameLabel.textColor = RGB16(0x999999);
self.giftNameLabel.textAlignment = NSTextAlignmentCenter;
self.giftNameLabel.font = [UIFont systemFontOfSize:12];
self.giftNameLabel.lineBreakMode = NSLineBreakByTruncatingMiddle;
[self addSubview:self.giftNameLabel];
[self.giftNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self);
make.bottom.mas_equalTo(-6);
}];
self.statusImageView = [[UIImageView alloc] init];
[self addSubview:self.statusImageView];
[self.statusImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(ScaleWidth(32));
make.centerX.centerY.equalTo(self);
}];
}
@end
@implementation QXSignInAppResultView
- (instancetype)init
{
self = [super init];
if (self) {
[self initSubviews];
}
return self;
}
-(void)setModel:(QXSignAppModel *)model{
_model = model;
[self.giftImageView sd_setImageWithURL:[NSURL URLWithString:model.base_image]];
self.giftNameLabel.text = [NSString stringWithFormat:@"签到成功 %@%@",model.gift_name,model.num];
}
-(void)initSubviews{
self.backgroundColor =RGB16(0xffffff);
self.giftImageView = [[UIImageView alloc] init];
self.giftImageView.contentMode = UIViewContentModeScaleAspectFit;
[self addSubview:self.giftImageView];
[self.giftImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(80);
make.centerX.equalTo(self);
make.top.mas_equalTo(40);
}];
self.giftNameLabel = [[UILabel alloc] init];
self.giftNameLabel.font = [UIFont systemFontOfSize:14.f];
self.giftNameLabel.textColor = QXConfig.themeColor;
[self addSubview:self.giftNameLabel];
[self.giftNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self);
make.top.equalTo(self.giftImageView.mas_bottom).offset(20);
}];
self.happyBtn = [[UIButton alloc] init];
[self.happyBtn setBackgroundImage:[UIImage imageNamed:@"sign_app_btn_bg"] forState:(UIControlStateNormal)];
[self.happyBtn setTitle:@"开心收下" forState:(UIControlStateNormal)];
[self.happyBtn addTarget:self action:@selector(happyAction) forControlEvents:(UIControlEventTouchUpInside)];
self.happyBtn.titleLabel.font = [UIFont boldSystemFontOfSize:14];
[self.happyBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)];
[self.happyBtn addRoundedCornersWithRadius:25];
[self addSubview:self.happyBtn];
[self.happyBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(ScaleWidth(257));
make.height.mas_equalTo(50);
make.centerX.equalTo(self);
make.bottom.equalTo(self);
}];
}
-(void)happyAction{
if (self.happyBlock) {
self.happyBlock();
}
}
@end

View File

@@ -289,6 +289,10 @@
}
}
-(void)popInviteWithModel:(QXRoomListModel*)model{
QXRoomNavigationController*na = (QXRoomNavigationController*)KEYWINDOW.rootViewController;
if ([na.visibleViewController isKindOfClass:[QXAlertViewController class]]) {
return;
}
__block QXRoomListModel *roomModel = model;
QXInvitePopView *view = [[QXInvitePopView alloc] init];
view.model = model;

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "app_sign_drawed@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "app_sign_drawed@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "app_sign_task_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "sign_app_btn_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "sign_app_btn_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_gift_teacher_boom_tag_icon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_gift_teacher_boom_tag_icon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -411,15 +411,15 @@ static NSString * QXBagOutcomeList = @"api/UserGiftPack/get_gift_pack_outcome";
/// 每日任务列表
static NSString * QXDayTaskList = @"api/Dailytasks/dailyTasksList";
static NSString * QXDayTaskList = @"api/Tasks/dailyTasksList";
/// 开启礼盒
static NSString * QXDayTaskOpenGift = @"api/Dailytasks/dailyTasksOpenBox";
static NSString * QXDayTaskOpenGift = @"api/Tasks/dailyTasksOpenBox";
/// 完成每日任务
static NSString * QXDayTaskFinished = @"api/Dailytasks/dailyTasksComplete";
static NSString * QXDayTaskFinished = @"api/Tasks/dailyTasksComplete";
/// 领取每日任务金币奖励
static NSString * QXDayDrawTaskCoin = @"api/Dailytasks/dailyTasksReceive";
static NSString * QXDayDrawTaskCoin = @"api/Tasks/dailyTasksReceive";
/// 礼盒记录
static NSString * QXDayGiftBoxRecord = @"api/Dailytasks/dailyTasksBoxRecord";
static NSString * QXDayGiftBoxRecord = @"api/Tasks/dailyTasksBoxRecord";
/// 置顶关系
static NSString * QXTopRelationCard = @"api/Room/top_relation_card";
/// 删除关系
@@ -552,5 +552,13 @@ static NSString * QXSignDelaySign = @"api/Sign/sign_delay";
/// 心跳
static NSString * QXKeepAlive = @"api/Xintiao/keep_room_heartbeat";
/// 师徒任务
static NSString * QXRoomTaskJumpRoom = @"api/Room/task_jump_room";
/// 每日签到状态
static NSString * QXAppSignTask = @"api/Tasks/dailyTasksSignList";
/// 每日签到
static NSString * QXAppSign = @"api/Tasks/dailyTasksSign";
/// 每日签到
static NSString * QXAppSignStatus = @"api/Tasks/dailyTasksSignStatus";
#endif /* Api_h */

View File

@@ -151,7 +151,8 @@
}];
[self addSubview:self.onLineBgView];
[self.onLineBgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.countLabel.mas_left).offset(-5);
// make.right.equalTo(self.countLabel.mas_left).offset(-5);
make.right.equalTo(self.closeBtn.mas_left).offset(-5);
make.left.equalTo(self.leftBgView.mas_right);
make.height.equalTo(self.leftBgView);
make.top.equalTo(self.leftBgView);

View File

@@ -73,7 +73,7 @@
self.todayTitle = @"今日";
self.yestoryTitle = @"昨日";
self.weekTitle = @"本周";
self.lastweekTitle = @"上周";
self.lastweekTitle = @"本月";
[self.titles removeAllObjects];
[self.titles addObject:self.todayTitle];
[self.titles addObject:self.yestoryTitle];

View File

@@ -238,6 +238,10 @@
[self stopHWDMP4];
_model = nil;
}
-(void)dealloc{
[self.mp4View stopHWDMP4];
self.mp4View = nil;
}
//- (QXEffectSvgaView *)svgaView {
// if (!_svgaView) {
// _svgaView = [[QXEffectSvgaView alloc] initWithFrame:CGRectZero isAutoPlay:YES];

View File

@@ -507,10 +507,13 @@
showToast(@"签约座位暂无人员");
return;
}
self.startBtn.userInteractionEnabled = NO;
MJWeakSelf
[QXMineNetwork signStartWithRoomId:self.roomModel.room_info.room_id userId:self.signView.pitModel.user_id successBlock:^(NSDictionary * _Nonnull dict) {
weakSelf.startBtn.userInteractionEnabled = YES;
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
weakSelf.startBtn.userInteractionEnabled = YES;
}];
}
-(void)delayAction{
@@ -543,7 +546,7 @@
}];
}
-(void)applyAction{
[QXMineNetwork roomUpSeatWithRoomId:self.roomModel.room_info.room_id pit_number:@"1" isUpSeat:YES successBlock:^(NSDictionary * _Nonnull dict) {
[QXMineNetwork roomUpSeatWithRoomId:self.roomModel.room_info.room_id pit_number:@"" isUpSeat:YES successBlock:^(NSDictionary * _Nonnull dict) {
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);

View File

@@ -14,6 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong)NSString*message;
@property (nonatomic,strong)NSString*cancleTitle;
@property (nonatomic,strong)NSString*commitTitle;
@property (nonatomic,assign)NSInteger autoDismissTime;
@property (nonatomic,assign)BOOL isFromController;
@property (nonatomic,copy)void(^commitBlock)(void);
@property (nonatomic,copy)void(^cancelBlock)(void);

View File

@@ -12,6 +12,7 @@
@property (nonatomic,strong)UILabel *messageLabel;
@property (nonatomic,strong)UIButton *cancelBtn;
@property (nonatomic,strong)UIButton *commitBtn;
@property (nonatomic,strong)QXTimer *timer;
@end
@implementation QXCustomAlertView
@@ -119,7 +120,28 @@
[self.commitBtn setTitle:commitTitle forState:(UIControlStateNormal)];
}
-(void)setAutoDismissTime:(NSInteger)autoDismissTime{
if (autoDismissTime > 0) {
@weakify(self);
__block NSInteger timeCount = autoDismissTime;
self.timer = [QXTimer scheduledTimerWithTimeInterval:1 repeats:YES queue:dispatch_get_main_queue() block:^{
@strongify(self);
timeCount--;
if (timeCount<=0) {
[self.timer invalidate];
[self cancelAction];
}else{
[self.cancelBtn setTitle:[NSString stringWithFormat:@"%@(%ld)",self.cancleTitle,timeCount] forState:(UIControlStateNormal)];
}
}];
}
}
-(void)cancelAction{
if (self.timer) {
[self.timer invalidate];
self.timer = nil;
}
if (self.isFromController) {
if (self.cancelBlock) {
self.cancelBlock();
@@ -132,6 +154,10 @@
[self hide];
}
-(void)commitAction{
if (self.timer) {
[self.timer invalidate];
self.timer = nil;
}
if (self.isFromController) {
if (self.commitBlock) {
self.commitBlock();
@@ -152,9 +178,11 @@
self.messageLabel.text = message;
}
if (cancleTitle) {
_cancleTitle = cancleTitle;
[self.cancelBtn setTitle:cancleTitle forState:(UIControlStateNormal)];
}
if (commitTitle) {
_commitTitle = commitTitle;
[self.commitBtn setTitle:commitTitle forState:(UIControlStateNormal)];
}
CGFloat messageHeight = [message heightForFont:[UIFont systemFontOfSize:13] width:ScaleWidth(275)-1];

View File

@@ -121,6 +121,10 @@
}
if ([roomGiftModel.is_cp isEqualToString:@"1"]) {
self.cpImageView.hidden = NO;
self.cpImageView.image = [UIImage imageNamed:@"room_gift_heart_boom_tag_icon"];
}else if ([roomGiftModel.is_teacher isEqualToString:@"1"]) {
self.cpImageView.image = [UIImage imageNamed:@"room_gift_teacher_boom_tag_icon"];
self.cpImageView.hidden = NO;
}else{
self.cpImageView.hidden = YES;
}