140 lines
5.7 KiB
Objective-C
Executable File
140 lines
5.7 KiB
Objective-C
Executable File
//
|
|
// SPBangDanHeader.m
|
|
// SweetParty
|
|
//
|
|
// Created by bj_szd on 2022/6/8.
|
|
//
|
|
|
|
#import "SPBangDanHeader.h"
|
|
|
|
@implementation SPBangDanHeader
|
|
|
|
-(void)onUpdateSPBangDanHeader:(NSArray *)arr type:(NSInteger)type {
|
|
if (type == 1) {//贡献
|
|
self.nicknameLab_1.textColor = self.nicknameLab_2.textColor = self.nicknameLab_3.textColor = HEXCOLOR(0x111111);
|
|
}else if(type == 2) {//魅力
|
|
self.nicknameLab_1.textColor = self.nicknameLab_2.textColor = self.nicknameLab_3.textColor = HEXCOLOR(0x111111);
|
|
}else if(type == 3) {
|
|
self.nicknameLab_1.textColor = self.nicknameLab_2.textColor = self.nicknameLab_3.textColor = HEXCOLOR(0x111111);
|
|
// self.kuangImgV_1.image = ImageNamed(@"bang_top_1_room");
|
|
// self.kuangImgV_2.image = ImageNamed(@"bang_top_2_room");
|
|
// self.kuangImgV_3.image = ImageNamed(@"bang_top_3_room");
|
|
// self.avatarImgV_1.layer.cornerRadius = self.avatarImgV_2.layer.cornerRadius = self.avatarImgV_3.layer.cornerRadius = 10;
|
|
}
|
|
|
|
if (type == 3) {
|
|
[self onUpdateRoomRank:arr type:type];
|
|
return;
|
|
}
|
|
|
|
if (arr.count > 0) {
|
|
SPBangDanListModel *model = arr[0];
|
|
[self.avatarImgV_1 sd_setImageWithURL:[NSURL URLWithString:model.head_pic] placeholderImage:kDefaultUserIcon];
|
|
self.nicknameLab_1.text = model.nick_name;
|
|
|
|
[self.levelImgV_1 sd_setImageWithURL:[NSURL URLWithString:model.contribution_image]];
|
|
[self.charmImgV_1 sd_setImageWithURL:[NSURL URLWithString:model.charm_image]];
|
|
self.valueLab_1.text = model.rank_value;
|
|
|
|
[self.bgView_1 dg_Tapped:^{
|
|
if (self.isRoomRank) {
|
|
[UIViewController goUserAlertWithUid:model.uid];
|
|
}else {
|
|
[UIViewController goUserMainpageWith:model.uid withRid:@""];
|
|
}
|
|
}];
|
|
}
|
|
|
|
if (arr.count > 1) {
|
|
SPBangDanListModel *model = arr[1];
|
|
[self.avatarImgV_2 sd_setImageWithURL:[NSURL URLWithString:model.head_pic] placeholderImage:kDefaultUserIcon];
|
|
self.nicknameLab_2.text = model.nick_name;
|
|
|
|
[self.levelImgV_2 sd_setImageWithURL:[NSURL URLWithString:model.contribution_image]];
|
|
[self.charmImgV_2 sd_setImageWithURL:[NSURL URLWithString:model.charm_image]];
|
|
self.valueLab_2.text = model.rank_value;
|
|
[self.bgView_2 dg_Tapped:^{
|
|
if (self.isRoomRank) {
|
|
[UIViewController goUserAlertWithUid:model.uid];
|
|
}else {
|
|
[UIViewController goUserMainpageWith:model.uid withRid:@""];
|
|
}
|
|
}];
|
|
}
|
|
|
|
if (arr.count > 2) {
|
|
SPBangDanListModel *model = arr[2];
|
|
[self.avatarImgV_3 sd_setImageWithURL:[NSURL URLWithString:model.head_pic] placeholderImage:kDefaultUserIcon];
|
|
self.nicknameLab_3.text = model.nick_name;
|
|
|
|
[self.levelImgV_3 sd_setImageWithURL:[NSURL URLWithString:model.contribution_image]];
|
|
[self.charmImgV_3 sd_setImageWithURL:[NSURL URLWithString:model.charm_image]];
|
|
self.valueLab_3.text = model.rank_value;
|
|
[self.bgView_3 dg_Tapped:^{
|
|
if (self.isRoomRank) {
|
|
[UIViewController goUserAlertWithUid:model.uid];
|
|
}else {
|
|
[UIViewController goUserMainpageWith:model.uid withRid:@""];
|
|
}
|
|
}];
|
|
}
|
|
}
|
|
|
|
- (void)onUpdateRoomRank:(NSArray *)arr type:(NSInteger)type {
|
|
if (arr.count > 0) {
|
|
SPBangDanListModel *model = arr[0];
|
|
[self.avatarImgV_1 sd_setImageWithURL:[NSURL URLWithString:model.room_cover] placeholderImage:kDefaultUserIcon];
|
|
self.nicknameLab_1.text = model.room_name;
|
|
self.valueLab_1.text = model.total_amount;
|
|
|
|
[self.bgView_1 dg_Tapped:^{
|
|
[UIViewController goMicRoomWithRid:model.rid withPwd:@""];
|
|
}];
|
|
}
|
|
|
|
if (arr.count > 1) {
|
|
SPBangDanListModel *model = arr[1];
|
|
[self.avatarImgV_2 sd_setImageWithURL:[NSURL URLWithString:model.room_cover] placeholderImage:kDefaultUserIcon];
|
|
self.nicknameLab_2.text = model.room_name;
|
|
self.valueLab_2.text = model.total_amount;
|
|
|
|
[self.bgView_2 dg_Tapped:^{
|
|
[UIViewController goMicRoomWithRid:model.rid withPwd:@""];
|
|
}];
|
|
}
|
|
|
|
if (arr.count > 2) {
|
|
SPBangDanListModel *model = arr[2];
|
|
[self.avatarImgV_3 sd_setImageWithURL:[NSURL URLWithString:model.room_cover] placeholderImage:kDefaultUserIcon];
|
|
self.nicknameLab_3.text = model.room_name;
|
|
self.valueLab_3.text = model.total_amount;
|
|
|
|
[self.bgView_3 dg_Tapped:^{
|
|
[UIViewController goMicRoomWithRid:model.rid withPwd:@""];
|
|
}];
|
|
}
|
|
}
|
|
|
|
- (void)setIsRoomRank:(BOOL)isRoomRank {
|
|
_isRoomRank = isRoomRank;
|
|
if (_isRoomRank == YES){
|
|
// self.nicknameLab_1.textColor = self.nicknameLab_2.textColor = self.nicknameLab_3.textColor = HEXCOLOR(0x333333);
|
|
// self.kuangImgV_1.image = ImageNamed(@"bang_top_1_room_inroom");
|
|
// self.kuangImgV_2.image = ImageNamed(@"bang_top_2_room_inroom");
|
|
// self.kuangImgV_3.image = ImageNamed(@"bang_top_3_room_inroom");
|
|
// self.valueLab_1.textColor = self.valueLab_2.textColor = self.valueLab_3.textColor = HEXCOLOR(0x333333);
|
|
// self.header_1_width.constant = 66;
|
|
// self.header_1_height.constant = 66;
|
|
// self.avatarImgV_1.layer.cornerRadius = 66/2;
|
|
// self.header_2_width.constant = 48;
|
|
// self.header_2_height.constant = 48;
|
|
// self.avatarImgV_2.layer.cornerRadius = 48/2;
|
|
// self.header_3_width.constant = 50;
|
|
// self.header_3_height.constant = 50;
|
|
// self.avatarImgV_3.layer.cornerRadius = 50/2;
|
|
}
|
|
// self.nicknameLab_1.textColor = self.nicknameLab_2.textColor = self.nicknameLab_3.textColor = HEXCOLOR(0xFFFFFF);
|
|
}
|
|
|
|
@end
|