341 lines
13 KiB
Objective-C
Executable File
341 lines
13 KiB
Objective-C
Executable File
//
|
|
// SPMineHeaderView.m
|
|
// SweetParty
|
|
//
|
|
// Created by bj_szd on 2022/6/2.
|
|
//
|
|
|
|
#import "SPMineHeaderView.h"
|
|
#import "UIButton+BAKit.h"
|
|
#import "SPMineDressVC.h"
|
|
#import "SPInviteFriendVC.h"
|
|
#import "SPFocusFansListVC.h"
|
|
#import "SPMineEditInfoVC.h"
|
|
#import "SPMineSettingVC.h"
|
|
#import "SPFeedbackVC.h"
|
|
#import "SPWalletContainerVC.h"
|
|
#import "SPGiftRecordVC.h"
|
|
#import "SPGonghuiVC.h"
|
|
#import "SPMineLevelVC.h"
|
|
#import "SAIdentityAuthVC.h"
|
|
#import "SPShopMallVC.h"
|
|
#import "DLJueweiContainerVC.h"
|
|
#import "SPMineCell.h"
|
|
#import "YYVipVC.h"
|
|
#import "YYMineCPVC.h"
|
|
#import "SPMineQianyueListVC.h"
|
|
#import "YYMineRoomListVC.h"
|
|
#import "LMWalletHomepageViewController.h"
|
|
#import "LMSignInAlertView.h"
|
|
#import "LMWechatKefuViewController.h"
|
|
|
|
@interface SPMineHeaderView () <UITableViewDelegate, UITableViewDataSource>
|
|
|
|
@property (nonatomic, strong) NSArray *btnImgsArr;
|
|
@property (nonatomic, strong) NSArray *btnTitlesArr;
|
|
|
|
@property (nonatomic, strong) NSArray *dataArray;
|
|
|
|
@property (weak, nonatomic) IBOutlet UIButton *roomButton;
|
|
@property (weak, nonatomic) IBOutlet UIButton *levelButton;
|
|
@property (weak, nonatomic) IBOutlet UIButton *giftSendButton;
|
|
@property (weak, nonatomic) IBOutlet UIButton *gonghuiButton;
|
|
@property (weak, nonatomic) IBOutlet UIButton *qianyueYRButton;
|
|
@property (weak, nonatomic) IBOutlet UIButton *inviteButton;
|
|
@property (weak, nonatomic) IBOutlet UIButton *kefuButton;
|
|
@property (weak, nonatomic) IBOutlet UIButton *qiandaoButton;
|
|
@property (weak, nonatomic) IBOutlet UIButton *wxkefuButton;
|
|
@property (weak, nonatomic) IBOutlet UIButton *helpButton;
|
|
|
|
@property (weak, nonatomic) IBOutlet UIImageView *walletIMG;
|
|
@property (weak, nonatomic) IBOutlet UIImageView *giftRecordIMG;
|
|
@property (weak, nonatomic) IBOutlet UIImageView *nobilityIMG;
|
|
@property (weak, nonatomic) IBOutlet UIImageView *dressshopIMG;
|
|
|
|
@property (weak, nonatomic) IBOutlet UIImageView *vipBGIMG;
|
|
|
|
@end
|
|
|
|
@implementation SPMineHeaderView
|
|
|
|
- (void)awakeFromNib {
|
|
[super awakeFromNib];
|
|
|
|
self.btnImgsArr = @[@"mine_wallet", @"mine_daoju", @"mine_room", @"mine_level"];
|
|
|
|
self.dataArray = @[
|
|
@{@"icon":@"mine_gonghui",@"title":@"我的公会"},
|
|
@{@"icon":@"mine_qianyue",@"title":@"签约艺人"},
|
|
@{@"icon":@"mine_juewei",@"title":@"我的爵位"},
|
|
@{@"icon":@"mine_gift",@"title":@"礼物记录"},
|
|
@{@"icon":@"mine_record",@"title":@"赠送记录"},
|
|
@{@"icon":@"mine_help",@"title":@"帮助/反馈"},
|
|
@{@"icon":@"mine_invite",@"title":@"邀请好友"},
|
|
@{@"icon":@"mine_kefu",@"title":@"客服"},
|
|
@{@"icon":@"mine_setting",@"title":@"设置"}];
|
|
|
|
[self createUI];
|
|
|
|
[self.avatarImgV dg_Tapped:^{
|
|
[UIViewController goUserMainpageWith:self.model.uid withRid:@""];
|
|
}];
|
|
|
|
[self.focusView dg_Tapped:^{
|
|
SPFocusFansListVC *vc = [[SPFocusFansListVC alloc] init];
|
|
vc.type = 1;
|
|
[vc pushSelf];
|
|
}];
|
|
[self.fansView dg_Tapped:^{
|
|
SPFocusFansListVC *vc = [[SPFocusFansListVC alloc] init];
|
|
vc.type = 2;
|
|
[vc pushSelf];
|
|
}];
|
|
[self.collectView dg_Tapped:^{
|
|
SPFocusFansListVC *vc = [[SPFocusFansListVC alloc] init];
|
|
vc.type = 3;
|
|
[vc pushSelf];
|
|
}];
|
|
[self.CPView dg_Tapped:^{
|
|
YYMineCPVC *vc = [[YYMineCPVC alloc] init];
|
|
[vc pushSelf];
|
|
}];
|
|
|
|
self.avatarImgV.layer.borderColor = [UIColor bm_colorGradientChangeWithSize:CGSizeMake(62, 62) direction:FXGradientChangeDirectionVertical startColor:HEXCOLOR(0xC385FD) endColor:HEXCOLOR(0xFEACE9)].CGColor;
|
|
// [self.btnsBgView_1 styleShadowWithRedius:10];
|
|
// [self.btnsBgView_2 styleShadowWithRedius:10];
|
|
|
|
[self.giftRecordIMG dg_Tapped:^{
|
|
SPGiftRecordVC *vc = [[SPGiftRecordVC alloc] init];
|
|
vc.type = 1;
|
|
[vc pushSelf];
|
|
}];
|
|
|
|
[self.walletIMG dg_Tapped:^{
|
|
LMWalletHomepageViewController *vc = [[LMWalletHomepageViewController alloc] init];
|
|
[vc pushSelf];
|
|
}];
|
|
|
|
WEAK_SELF;
|
|
[self.dressshopIMG dg_Tapped:^{
|
|
SPShopMallVC *vc = [[SPShopMallVC alloc] init];
|
|
vc.model = weakSelf.model;
|
|
[vc pushSelf];
|
|
}];
|
|
|
|
[self.nobilityIMG dg_Tapped:^{
|
|
DLJueweiContainerVC *vc = [[DLJueweiContainerVC alloc] init];
|
|
[vc pushSelf];
|
|
}];
|
|
}
|
|
|
|
- (void)setModel:(SPMineModel *)model {
|
|
_model = model;
|
|
|
|
[self.avatarImgV sd_setImageWithURL:[NSURL URLWithString:model.head_pic] placeholderImage:kDefaultUserIcon];
|
|
self.nicknameLab.text = model.nick_name;
|
|
if ([model.special_uid integerValue] > 0) {
|
|
self.IDLab.text = [NSString stringWithFormat:@"%@", model.special_uid];
|
|
}else {
|
|
self.IDLab.text = [NSString stringWithFormat:@"%@", model.uid];
|
|
}
|
|
// self.signLab.text = model.autograph;
|
|
|
|
self.focusLab.text = model.follow_num;
|
|
self.fansLab.text = model.fans_num;
|
|
self.collectLab.text = model.collect_room_num;
|
|
self.CPLab.text = model.cp_num;
|
|
[self.gxImgV sd_setImageWithURL:[NSURL URLWithString:model.contribution_level_image]];
|
|
[self.mlImgV sd_setImageWithURL:[NSURL URLWithString:model.charm_level_image]];
|
|
[self.jueweiImgV sd_setImageWithURL:[NSURL URLWithString:model.nobility_image]];
|
|
|
|
if (model.vid > 0) {
|
|
// self.vipBtn.selected = YES;
|
|
self.vipBGIMG.image = ImageNamed(@"mine_vip_bg_sel");
|
|
}else {
|
|
self.vipBGIMG.image = ImageNamed(@"mine_vip_bg");
|
|
}
|
|
}
|
|
|
|
- (void)createUI {
|
|
|
|
[self.roomButton ba_button_setButtonLayoutType:BAKit_ButtonLayoutTypeCenterImageTop padding:10];
|
|
[self.levelButton ba_button_setButtonLayoutType:BAKit_ButtonLayoutTypeCenterImageTop padding:10];
|
|
[self.giftSendButton ba_button_setButtonLayoutType:BAKit_ButtonLayoutTypeCenterImageTop padding:10];
|
|
[self.gonghuiButton ba_button_setButtonLayoutType:BAKit_ButtonLayoutTypeCenterImageTop padding:10];
|
|
[self.qianyueYRButton ba_button_setButtonLayoutType:BAKit_ButtonLayoutTypeCenterImageTop padding:10];
|
|
[self.inviteButton ba_button_setButtonLayoutType:BAKit_ButtonLayoutTypeCenterImageTop padding:10];
|
|
[self.kefuButton ba_button_setButtonLayoutType:BAKit_ButtonLayoutTypeCenterImageTop padding:10];
|
|
[self.qiandaoButton ba_button_setButtonLayoutType:BAKit_ButtonLayoutTypeCenterImageTop padding:10];
|
|
[self.wxkefuButton ba_button_setButtonLayoutType:BAKit_ButtonLayoutTypeCenterImageTop padding:10];
|
|
[self.helpButton ba_button_setButtonLayoutType:BAKit_ButtonLayoutTypeCenterImageTop padding:10];
|
|
self.btnTitlesArr = @[@"我的等级",@"赠送记录", @"我的公会", @"签约艺人", @"邀请好友", @"在线客服",@"每日签到"];
|
|
|
|
|
|
// CGFloat btnW = (ScreenWidth-15*2)/4;
|
|
// CGFloat btnH = 90;
|
|
// for (NSInteger i = 0; i < self.btnTitlesArr.count; i++) {
|
|
// UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
// btn.tag = 100+i;
|
|
// [btn setTitle:self.btnTitlesArr[i] forState:UIControlStateNormal];
|
|
// btn.titleLabel.font = YBMediumFont(11);
|
|
// [btn setTitleColor:HEXCOLOR(0x111111) forState:UIControlStateNormal];
|
|
// [btn setImage:ImageNamed(self.btnImgsArr[i]) forState:UIControlStateNormal];
|
|
// [btn addTarget:self action:@selector(onBtnClick:) forControlEvents:UIControlEventTouchUpInside];
|
|
//
|
|
// btn.frame = CGRectMake(btnW*i, 0, btnW, btnH);
|
|
// [self.btnsBgView_1 addSubview:btn];
|
|
//
|
|
// [btn ba_button_setButtonLayoutType:BAKit_ButtonLayoutTypeCenterImageTop padding:10];
|
|
// }
|
|
//
|
|
// self.tableView.separatorStyle = NO;
|
|
// self.tableView.delegate = self;
|
|
// self.tableView.dataSource = self;
|
|
// [self.tableView registerNib:[UINib nibWithNibName:@"SPMineCell" bundle:nil] forCellReuseIdentifier:@"SPMineCell"];
|
|
// self.tableView.rowHeight = 53;
|
|
}
|
|
|
|
- (IBAction)stackButtonClick:(UIButton *)sender {
|
|
NSString *title = self.btnTitlesArr[sender.tag-100];
|
|
if ([title isEqualToString:@"赠送记录"]) {
|
|
SPGiftRecordVC *vc = [[SPGiftRecordVC alloc] init];
|
|
vc.type = 2;
|
|
[vc pushSelf];
|
|
}else if ([title isEqualToString:@"我的等级"]) {
|
|
SPMineLevelVC *vc = [[SPMineLevelVC alloc] init];
|
|
[vc pushSelf];
|
|
}else if ([title isEqualToString:@"我的公会"]) {
|
|
SPGonghuiVC *vc = [[SPGonghuiVC alloc] init];
|
|
[vc pushSelf];
|
|
}else if ([title isEqualToString:@"签约艺人"]) {
|
|
SPMineQianyueListVC *vc = [[SPMineQianyueListVC alloc] init];
|
|
[vc pushSelf];
|
|
}else if ([title isEqualToString:@"邀请好友"]) {
|
|
SPInviteFriendVC *vc = [[SPInviteFriendVC alloc] init];
|
|
vc.model = self.model;
|
|
[vc pushSelf];
|
|
}else if ([title isEqualToString:@"在线客服"]) {
|
|
// [HelpPageDefine showMessage:@"联系客服"];
|
|
[UIViewController goWebWithUrl:@"https://kefu.muye.club/index/index/home?visiter_id=&visiter_name=&avatar=&business_id=39&groupid=18&special=58"];
|
|
}else if ([title isEqualToString:@"每日签到"]) {
|
|
LMSignInAlertView *signv = LoadNib(@"LMSignInAlertView");
|
|
signv.frame = CGRectMake(0 , 0, APPW, APPH);
|
|
signv.isHome = NO;
|
|
[MainWindow() addSubview:signv];
|
|
}
|
|
}
|
|
// 每日签到
|
|
- (IBAction)signInClick:(id)sender {
|
|
LMSignInAlertView *signv = LoadNib(@"LMSignInAlertView");
|
|
signv.frame = CGRectMake(0 , 0, APPW, APPH);
|
|
signv.isHome = NO;
|
|
[MainWindow() addSubview:signv];
|
|
}
|
|
- (IBAction)onSetting:(id)sender {
|
|
SPMineSettingVC *vc = [[SPMineSettingVC alloc] init];
|
|
vc.model = self.model;
|
|
[vc pushSelf];
|
|
}
|
|
|
|
- (IBAction)onEdit:(id)sender {
|
|
SPMineEditInfoVC *vc = [[SPMineEditInfoVC alloc] init];
|
|
vc.model = self.model;
|
|
[vc pushSelf];
|
|
}
|
|
|
|
- (IBAction)facebackButtonClick:(UIButton *)sender {
|
|
SPFeedbackVC *vc = [[SPFeedbackVC alloc] init];
|
|
[vc pushSelf];
|
|
}
|
|
|
|
- (IBAction)wxchatKefuButtonClick:(UIButton *)sender {
|
|
LMWechatKefuViewController *kfvc = [[LMWechatKefuViewController alloc] init];
|
|
[kfvc pushSelf];
|
|
}
|
|
|
|
|
|
- (IBAction)onMineRoom:(id)sender {
|
|
// [UIViewController roomOwnerGoSelfRoom];
|
|
YYMineRoomListVC *vc = [[YYMineRoomListVC alloc] init];
|
|
[vc pushSelf];
|
|
}
|
|
|
|
- (IBAction)onDuplicateID:(id)sender {
|
|
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
|
|
if ([self.model.special_uid integerValue] > 0) {
|
|
pasteboard.string = self.model.special_uid;
|
|
}else {
|
|
pasteboard.string = self.model.uid;
|
|
}
|
|
|
|
[HelpPageDefine showMessage:@"ID已复制"];
|
|
}
|
|
|
|
- (IBAction)onHomepage:(id)sender {
|
|
[UIViewController goUserMainpageWith:self.model.uid withRid:@""];
|
|
}
|
|
|
|
- (IBAction)onVip:(id)sender {
|
|
YYVipVC *vc = [[YYVipVC alloc] init];
|
|
[vc pushSelf];
|
|
}
|
|
|
|
#pragma mark - Table view data source
|
|
|
|
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
|
|
return 1;
|
|
}
|
|
|
|
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
|
return self.dataArray.count;
|
|
}
|
|
|
|
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
|
SPMineCell *cell = [tableView dequeueReusableCellWithIdentifier:@"SPMineCell" forIndexPath:indexPath];
|
|
cell.selectionStyle = NO;
|
|
NSDictionary *dict = self.dataArray[indexPath.row];
|
|
cell.titleLab.text = [dict safeStringForKey:@"title"];
|
|
cell.imgV.image = ImageNamed(dict[@"icon"]);
|
|
|
|
return cell;
|
|
}
|
|
|
|
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
|
NSDictionary *dict = self.dataArray[indexPath.row];
|
|
NSString *title = [dict safeStringForKey:@"title"];
|
|
if ([title isEqualToString:@"我的爵位"]) {
|
|
DLJueweiContainerVC *vc = [[DLJueweiContainerVC alloc] init];
|
|
[vc pushSelf];
|
|
}else if ([title isEqualToString:@"礼物记录"]) {
|
|
SPGiftRecordVC *vc = [[SPGiftRecordVC alloc] init];
|
|
vc.type = 1;
|
|
[vc pushSelf];
|
|
}else if ([title isEqualToString:@"赠送记录"]) {
|
|
SPGiftRecordVC *vc = [[SPGiftRecordVC alloc] init];
|
|
vc.type = 2;
|
|
[vc pushSelf];
|
|
}else if ([title isEqualToString:@"帮助/反馈"]) {
|
|
SPFeedbackVC *vc = [[SPFeedbackVC alloc] init];
|
|
[vc pushSelf];
|
|
}else if ([title isEqualToString:@"客服"]) {
|
|
// [HelpPageDefine showMessage:@"联系客服"];
|
|
[UIViewController goWebWithUrl:@"https://kefu.muye.club/index/index/home?visiter_id=&visiter_name=&avatar=&business_id=39&groupid=18&special=58"];
|
|
}else if ([title isEqualToString:@"设置"]) {
|
|
SPMineSettingVC *vc = [[SPMineSettingVC alloc] init];
|
|
vc.model = self.model;
|
|
[vc pushSelf];
|
|
}else if ([title isEqualToString:@"邀请好友"]) {
|
|
SPInviteFriendVC *vc = [[SPInviteFriendVC alloc] init];
|
|
vc.model = self.model;
|
|
[vc pushSelf];
|
|
}else if ([title isEqualToString:@"签约艺人"]) {
|
|
SPMineQianyueListVC *vc = [[SPMineQianyueListVC alloc] init];
|
|
[vc pushSelf];
|
|
}else if ([title isEqualToString:@"我的公会"]) {
|
|
SPGonghuiVC *vc = [[SPGonghuiVC alloc] init];
|
|
[vc pushSelf];
|
|
}
|
|
}
|
|
|
|
@end
|