123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358 |
- //
- // XYPersonalCenterViewModel.m
- // Starbuds
- //
- // Created by 翟玉磊 on 2019/12/21.
- // Copyright © 2019 翟玉磊. All rights reserved.
- //
- #import "XYPersonalCenterViewModel.h"
- #import "XYPersonalCenterListModel.h"
- #import "XYWalletViewController.h"
- #import "XYSetupViewController.h"
- #import "XYVisitorsManagerViewController.h"
- #import "XYBackpackManageViewController.h"
- #import "XYFeedbackListViewController.h"
- #import "XYSendFeedbackViewController.h"
- #import "XYRechargeItemsViewController.h"
- #import "XYInviteFriendsController.h"
- #import "XYMyVoiceRoomListViewController.h"
- #import "XYOrderCenterMainViewController.h"
- #import "XYWishCenterViewController.h"
- #import "XYWishAPIManager.h"
- #import "XYWishGiftModel.h"
- @implementation XYPersonalCenterViewModel
- - (instancetype)init {
- if (self = [super init]) {
- self.shouldPullDownToRefresh = YES;
- self.shouldBeginRefreshing = NO;
- // self.shouldCustomRefresh = NO;
- self.minutes = 0;
- self.fansCount = 0;
- self.followCount = 0;
- self.charmValue = @"0";
- self.wealthValue = @"0";
- self.starValue = @"0";
- [self initValue];
- }
- return self;
- }
- - (void)initValue {
-
- self.nowUser = [XYUserInfoManager nowUser];
- [self.dataSource removeAllObjects];
- if (ApplicationDelegate.isVersionStatus) {
- // 审核状态
- [self.dataSource addObject:[EmptyCellModel new]];
-
- NSString *coinBalance = @"";
- if (StringIsNotEmpty([XYUserInfoManager nowUser].coinBalance)) {
- coinBalance = [NSString stringWithFormat:@"%@%@", [XYUserInfoManager nowUser].coinBalance, App_CoinName(Wallet_Type_Star_Diamond)];
- }
- XYPersonalCenterListModel *rechargeModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_my_recharge" title:kLocalizedString(@"我要充值") content:coinBalance isShowMoreImage:YES pushControllerName:NSStringFromClass([XYRechargeItemsViewController class]) borderType:UIRectCornerTopLeft|UIRectCornerTopRight];
- [self.dataSource addObject:rechargeModel];
-
- XYPersonalCenterListModel *visitorsModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_my_visitors" title:kLocalizedString(@"我的访客") content:@"" isShowMoreImage:YES pushControllerName:NSStringFromClass([XYVisitorsManagerViewController class]) borderType:UIRectCornerTopLeft|UIRectCornerTopRight];
- [self.dataSource addObject:visitorsModel];
-
- XYPersonalCenterListModel *voiceModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_my_voice" title:kLocalizedString(@"语音房") content:@"" isShowMoreImage:YES pushControllerName:NSStringFromClass([XYMyVoiceRoomListViewController class]) borderType:0];
- [self.dataSource addObject:voiceModel];
-
- XYPersonalCenterListModel *voiceCollectModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_my_voiceroom_collect" title:kLocalizedString(@"我的收藏") content:@"" isShowMoreImage:YES pushControllerName:NSStringFromClass([XYMyVoiceRoomListViewController class]) borderType:0];
- [self.dataSource addObject:voiceCollectModel];
-
- XYPersonalCenterListModel *helpModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_my_help" title:kLocalizedString(@"帮助与反馈") content:@"" isShowMoreImage:YES pushControllerName:NSStringFromClass(XYSendFeedbackViewController.class) borderType:UIRectCornerTopLeft|UIRectCornerTopRight];
- [self.dataSource addObject:helpModel];
-
- XYPersonalCenterListModel *setupModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_my_setup" title:kLocalizedString(@"设置") content:@"" isShowMoreImage:YES pushControllerName:@"XYSetupViewController" borderType:0];
- [self.dataSource addObject:setupModel];
-
- [self.dataSource addObject:[EmptyCellModel new]];
- }else {
- // 正常状态
- [self.dataSource addObject:[EmptyCellModel new]];
-
- // if (self.nowUser.vipLevel <= 0 && StringIsNotEmpty([XYAppConfigModel getUrlVip])) {
- // XYPersonalCenterListModel *vipModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_my_novip" title:kLocalizedString(@"成为超级VIP") content:kLocalizedString(@"每天领取免费聊天时长") isShowMoreImage:YES pushControllerName:@"" borderType:UIRectCornerAllCorners];
- // [self.dataSource addObject:vipModel];
- //
- // [self.dataSource addObject:[EmptyCellModel new]];
- // }
-
- if([XYUserInfoManager nowUser].userScore < 50){
- XYPersonalCenterListModel *editAlertModel = [XYPersonalCenterListModel createListModelWithIconName:@"" title:kLocalizedString(@"资料评分") content:@"" isShowMoreImage:YES pushControllerName:@"" borderType:0];
- [self.dataSource addObject:editAlertModel];
-
- [self.dataSource addObject:[EmptyCellModel new]];
- }
-
- NSMutableArray *itemArray = [NSMutableArray array];
- XYPersonalCenterListModel *rechargeModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_personal_center_recharge" title:kLocalizedString(@"充值") content:@"" isShowMoreImage:YES pushControllerName:@"" borderType:0];
- [itemArray addObject:rechargeModel];
-
- if (StringIsNotEmpty([XYAppConfigModel getUrlNoble])) {
- XYPersonalCenterListModel *nobleModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_personal_center_nobility" title:kLocalizedString(@"贵族") content:@"" isShowMoreImage:YES pushControllerName:@"" borderType:0];
- [itemArray addObject:nobleModel];
- }
-
- if (StringIsNotEmpty([XYAppConfigModel getUrlCoinShop])) {
- XYPersonalCenterListModel *shopModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_personal_center_mall" title:kLocalizedString(@"商城") content:@"" isShowMoreImage:YES pushControllerName:@"" borderType:0];
- [itemArray addObject:shopModel];
- }
-
- if (StringIsNotEmpty([XYAppConfigModel getUrlNiceNo])) {
- XYPersonalCenterListModel *niceNoModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_personal_center_nicenum" title:kLocalizedString(@"靓号") content:@"" isShowMoreImage:YES pushControllerName:@"" borderType:0];
- [itemArray addObject:niceNoModel];
- }
-
- XYPersonalCenterListModel *packageModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_personal_center_package" title:kLocalizedString(@"背包") content:@"" isShowMoreImage:YES pushControllerName:@"" borderType:0];
- [itemArray addObject:packageModel];
-
-
- // if (StringIsNotEmpty([XYAppConfigModel getUrlVip])) {
- // XYPersonalCenterListModel *membersModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_my_members" title:kLocalizedString(@"会员中心") content:@"" isShowMoreImage:YES pushControllerName:@"" borderType:0];
- // [itemArray addObject:membersModel];
- // }
-
- if (itemArray.count > 0) {
- XYPersonalCenterListModel *urlItemModel = [XYPersonalCenterListModel createListModelWithIconName:@"" title:kLocalizedString(@"url_item") content:@"" isShowMoreImage:YES pushControllerName:@"" borderType:UIRectCornerAllCorners];
- urlItemModel.urlItemArray = itemArray;
- [self.dataSource addObject:urlItemModel];
-
- [self.dataSource addObject:[EmptyCellModel new]];
- }
-
- XYPersonalCenterListModel *walletModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_my_wallet" title:kLocalizedString(@"我的钱包") content:@"" isShowMoreImage:YES pushControllerName:NSStringFromClass([XYWalletViewController class]) borderType:UIRectCornerAllCorners];
- [self.dataSource addObject:walletModel];
-
- [self.dataSource addObject:[EmptyCellModel new]];
-
-
- // 常驻功能
- NSMutableArray *normalItems = [NSMutableArray array];
-
- UIRectCorner borderType = UIRectCornerTopLeft|UIRectCornerTopRight;
-
- borderType = 0;
-
- /*
- XYPersonalCenterListModel *wishModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_my_wish" title:kLocalizedString(@"许愿中心") content:@"未设置" isShowMoreImage:YES pushControllerName:NSStringFromClass([XYWishCenterViewController class]) borderType:borderType];
- if (StringIsNotEmpty(self.wishModel.wishId)) {
- wishModel.content = [NSString stringWithFormat:@"%ld/%ld", self.wishModel.currentNum, self.wishModel.giftNum];
- wishModel.imageContent = [self.wishModel.giftIcon copy];
- }
- [normalItems addObject:wishModel];
- XYPersonalCenterListModel *orderCenterModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_my_order_center" title:PeiWanEnable?kLocalizedString(@"订单中心"):kLocalizedString(@"派单记录") content:@"" isShowMoreImage:YES pushControllerName:NSStringFromClass([XYOrderCenterMainViewController class]) borderType:borderType];
- [normalItems addObject:orderCenterModel];
-
- if (StringIsNotEmpty([XYAppConfigModel getUrlChatTimeWallet])) {
- XYPersonalCenterListModel *membersModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_my_time" title:kLocalizedString(@"时间钱包") content:self.minutes==0?@"":[NSString stringWithFormat:@"%ld%@", (long)self.minutes,kLocalizedString(@"分钟")] isShowMoreImage:YES pushControllerName:@"" borderType:borderType];
- [normalItems addObject:membersModel];
- }
- XYPersonalCenterListModel *backpackModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_my_backpack" title:kLocalizedString(@"我的背包") content:@"" isShowMoreImage:YES pushControllerName:NSStringFromClass([XYBackpackManageViewController class]) borderType:borderType];
- [normalItems addObject:backpackModel];
- XYPersonalCenterListModel *visitorsModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_my_visitors" title:kLocalizedString(@"我的访客") content:@"" isShowMoreImage:YES pushControllerName:NSStringFromClass([XYVisitorsManagerViewController class]) borderType:borderType];
- [normalItems addObject:visitorsModel];
-
- XYPersonalCenterListModel *liveModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_my_voiceLive" title:kLocalizedString(@"我要开播") content:@"" isShowMoreImage:YES pushControllerName:@"" borderType:borderType];
- [normalItems addObject:liveModel];
-
- XYPersonalCenterListModel *voiceModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_my_voice" title:kLocalizedString(@"语音房") content:@"" isShowMoreImage:YES pushControllerName:NSStringFromClass([XYMyVoiceRoomListViewController class]) borderType:borderType];
- [normalItems addObject:voiceModel];
-
- XYPersonalCenterListModel *voiceCollectModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_my_voiceroom_collect" title:kLocalizedString(@"我的收藏") content:@"" isShowMoreImage:YES pushControllerName:NSStringFromClass([XYMyVoiceRoomListViewController class]) borderType:borderType];
- [normalItems addObject:voiceCollectModel];
-
- XYPersonalCenterListModel *familyModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_my_family" title:kLocalizedString(@"我的家族") content:@"" isShowMoreImage:YES pushControllerName:NSStringFromClass([XYMyVoiceRoomListViewController class]) borderType:borderType];
- [normalItems addObject:familyModel];
-
- if (StringIsNotEmpty([XYAppConfigModel getUrlLevel])) {
- XYPersonalCenterListModel *levelModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_my_level" title:kLocalizedString(@"我的等级") content:@"" isShowMoreImage:YES pushControllerName:@"" borderType:borderType];
- [normalItems addObject:levelModel];
- }
-
- XYPersonalCenterListModel *realNameModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_my_realName" title:kLocalizedString(@"实名认证") content:@"" isShowMoreImage:YES pushControllerName:@"" borderType:borderType];
- [normalItems addObject:realNameModel];
-
- XYPersonalCenterListModel *skillsModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_my_skills" title:kLocalizedString(@"大神认证") content:@"" isShowMoreImage:YES pushControllerName:@"" borderType:borderType];
- [normalItems addObject:skillsModel];
-
- //if (ApplicationDelegate.appConfigModel.channelConfig.inviteAddress.length) {
- XYPersonalCenterListModel *shareModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_my_share" title:kLocalizedString(@"邀请好友") content:@"" isShowMoreImage:YES pushControllerName:@"XYInviteFriendsController" borderType:borderType];
- [normalItems addObject:shareModel];
- //}
- XYPersonalCenterListModel *helpModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_my_help" title:kLocalizedString(@"帮助与反馈") content:@"" isShowMoreImage:YES pushControllerName:NSStringFromClass(XYSendFeedbackViewController.class) borderType:borderType];
- [normalItems addObject:helpModel];
-
- borderType = UIRectCornerBottomLeft|UIRectCornerBottomRight;
- XYPersonalCenterListModel *setupModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_my_setup" title:kLocalizedString(@"设置") content:@"" isShowMoreImage:YES pushControllerName:@"XYSetupViewController" borderType:borderType];
- [normalItems addObject:setupModel];
- */
-
- XYPersonalCenterListModel *voiceModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_personal_center_voiceroom" title:kLocalizedString(@"语音房") content:@"" isShowMoreImage:YES pushControllerName:NSStringFromClass([XYMyVoiceRoomListViewController class]) borderType:borderType];
- [normalItems addObject:voiceModel];
-
- XYPersonalCenterListModel *familyModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_personal_center_myfamily" title:kLocalizedString(@"我的家族") content:@"" isShowMoreImage:YES pushControllerName:NSStringFromClass([XYMyVoiceRoomListViewController class]) borderType:borderType];
- [normalItems addObject:familyModel];
-
- XYPersonalCenterListModel *realNameModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_personal_center_realauth" title:kLocalizedString(@"实名认证") content:@"" isShowMoreImage:YES pushControllerName:@"" borderType:borderType];
- [normalItems addObject:realNameModel];
-
- XYPersonalCenterListModel *liveModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_personal_center_startbroadcast" title:kLocalizedString(@"我要开播") content:@"" isShowMoreImage:YES pushControllerName:@"" borderType:borderType];
- [normalItems addObject:liveModel];
- XYPersonalCenterListModel *wishModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_personal_center_wishcenter" title:kLocalizedString(@"许愿中心") content:@"未设置" isShowMoreImage:YES pushControllerName:NSStringFromClass([XYWishCenterViewController class]) borderType:borderType];
- if (StringIsNotEmpty(self.wishModel.wishId)) {
- wishModel.content = [NSString stringWithFormat:@"%ld/%ld", self.wishModel.currentNum, self.wishModel.giftNum];
- wishModel.imageContent = [self.wishModel.giftIcon copy];
- }
- [normalItems addObject:wishModel];
-
- XYPersonalCenterListModel *skillsModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_personal_center_godauth" title:kLocalizedString(@"大神认证") content:@"" isShowMoreImage:YES pushControllerName:@"" borderType:borderType];
- [normalItems addObject:skillsModel];
-
- XYPersonalCenterListModel *orderCenterModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_personal_center_ordercenter" title:PeiWanEnable?kLocalizedString(@"订单中心"):kLocalizedString(@"派单记录") content:@"" isShowMoreImage:YES pushControllerName:NSStringFromClass([XYOrderCenterMainViewController class]) borderType:borderType];
- [normalItems addObject:orderCenterModel];
-
- if (StringIsNotEmpty([XYAppConfigModel getUrlLevel])) {
- XYPersonalCenterListModel *levelModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_personal_center_mygrade" title:kLocalizedString(@"我的等级") content:@"" isShowMoreImage:YES pushControllerName:@"" borderType:borderType];
- [normalItems addObject:levelModel];
- }
- XYPersonalCenterListModel *voiceCollectModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_personal_center_mycollect" title:kLocalizedString(@"我的收藏") content:@"" isShowMoreImage:YES pushControllerName:NSStringFromClass([XYMyVoiceRoomListViewController class]) borderType:borderType];
- [normalItems addObject:voiceCollectModel];
-
- XYPersonalCenterListModel *visitorsModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_personal_center_myvisit" title:kLocalizedString(@"我的访客") content:@"" isShowMoreImage:YES pushControllerName:NSStringFromClass([XYVisitorsManagerViewController class]) borderType:borderType];
- [normalItems addObject:visitorsModel];
-
- XYPersonalCenterListModel *shareModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_personal_center_invitefriend" title:kLocalizedString(@"邀请好友") content:@"" isShowMoreImage:YES pushControllerName:@"XYInviteFriendsController" borderType:borderType];
- [normalItems addObject:shareModel];
-
- XYPersonalCenterListModel *helpModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_personal_center_help" title:kLocalizedString(@"帮助与反馈") content:@"" isShowMoreImage:YES pushControllerName:NSStringFromClass(XYSendFeedbackViewController.class) borderType:borderType];
- [normalItems addObject:helpModel];
-
- XYPersonalCenterListModel *signModel = [XYPersonalCenterListModel createListModelWithIconName:@"icon_personal_center_sign" title:kLocalizedString(@"每日签到") content:@"" isShowMoreImage:YES pushControllerName:@"" borderType:borderType];
- [normalItems addObject:signModel];
-
- if (itemArray.count > 0) {
- XYPersonalCenterListModel *normalItemModel = [XYPersonalCenterListModel createListModelWithIconName:@"" title:kLocalizedString(@"常驻功能") content:@"" isShowMoreImage:YES pushControllerName:@"" borderType:UIRectCornerAllCorners];
- normalItemModel.urlItemArray = normalItems;
- [self.dataSource addObject:normalItemModel];
-
- }
-
- [self.dataSource addObject:[EmptyCellModel new]];
- }
- }
- + (CGFloat)getNormalItemsHeightWithItems:(NSArray *)items {
- NSInteger count = items.count;
- CGFloat itemWidth = 67.0f;
- CGFloat itemHeight = 64.0f;
- CGFloat itemTop = 8.0f;
- CGFloat itemBottom = 8.0f;
- // 总宽度除以一个item的宽度获取一行最多放多少个item
- // NSInteger lineMaxCount = (SCREEN_WIDTH-16.0f*2)/itemWidth;
- NSInteger lineMaxCount = 4;
- // 获取行数 行数=(总个数-1)/列数+1
- NSInteger line = (count-1)/lineMaxCount+1;
- CGFloat cellHeight = itemTop+line*itemHeight+itemBottom;
- return cellHeight;
- }
- - (void)loadDataWithUserInfo:(BOOL)isUserInfo success:(SuccessHandler)success failure:(FailureHandler)failure {
-
- NSError *error;
- dispatch_group_t group = dispatch_group_create();
- dispatch_queue_t queue = dispatch_get_main_queue();
-
- if ([XYUserInfoManager nowUser]) {
- dispatch_group_enter(group);
- dispatch_async(queue, ^{
- [[XYUserAPIManager new] getProfileSuccessHandler:^(ZYLResponseModel *responseModel) {
- self.fansCount = [responseModel.data[@"fansCount"] integerValue];
- self.followCount = [responseModel.data[@"followCount"] integerValue];
- self.charmValue = [CaculateNumberTool stringFromNumber:[BaseMethod toString:responseModel.data[@"charmValue"]].doubleValue toFixedCount:1 roundingMode:CNRoundingModeOnlyDown];
- self.wealthValue = [CaculateNumberTool stringFromNumber:[BaseMethod toString:responseModel.data[@"wealthValue"]].doubleValue toFixedCount:1 roundingMode:CNRoundingModeOnlyDown];
- self.starValue = [CaculateNumberTool stringFromNumber:[BaseMethod toString:responseModel.data[@"starValue"]].doubleValue toFixedCount:1 roundingMode:CNRoundingModeOnlyDown];
- int niceLevel = [responseModel.data[@"userNiceNo"][@"niceLevel"] intValue];
- [XYUserInfoManager nowUser].niceLevel = niceLevel;
- self.visitCount = [responseModel.data[@"visitCount"] integerValue];
- self.intervieweeCount = [responseModel.data[@"intervieweeCount"] integerValue];
- dispatch_group_leave(group);
- } failureHandler:^(NSError *error) {
- error = error;
- dispatch_group_leave(group);
- }];
- });
- if (!isUserInfo) {
- dispatch_group_enter(group);
- dispatch_async(queue, ^{
- [[XYUserAPIManager new] getUserWalletSuccessHandler:^(ZYLResponseModel *responseModel) {
- dispatch_group_leave(group);
- } failureHandler:^(NSError *error) {
- dispatch_group_leave(group);
- }];
- });
- dispatch_group_enter(group);
- dispatch_async(queue, ^{
- [[XYUserAPIManager new] getUserChatTimeWalletSuccessHandler:^(ZYLResponseModel *responseModel) {
- self.minutes = [responseModel.data[@"minutes"] integerValue];
- dispatch_group_leave(group);
- } failureHandler:^(NSError *error) {
- dispatch_group_leave(group);
- }];
- });
- dispatch_group_enter(group);
- dispatch_async(queue, ^{
- [[XYWishAPIManager new] getWishOpenedDetailWithUserId:[XYUserInfoManager nowUser].userId successHandler:^(ZYLResponseModel *responseModel) {
- XYWishGiftModel *wishModel = [XYWishGiftModel new];
- [wishModel yy_modelSetWithDictionary:responseModel.data];
- self.wishModel = wishModel;
-
- dispatch_group_leave(group);
- } failureHandler:^(ZYLNetworkError *error) {
- dispatch_group_leave(group);
- }];
- });
-
- dispatch_group_enter(group);
- dispatch_async(queue, ^{
- [[XYConfigAPIManager new] getBannersWithBannerPosition:501 categoryId:@"" successHandler:^(ZYLResponseModel *responseModel) {
- dispatch_group_leave(group);
- [[XYUserInfoManager sharedInstance].rechargeActivityRewardArrs removeAllObjects];
- [[XYUserInfoManager sharedInstance].rechargeActivityRewardArrs addObjectsFromArray:responseModel.data[@"list"]];
- } failureHandler:^(ZYLNetworkError *error) {
- dispatch_group_leave(group);
-
- }];
- });
-
- }
- }else {
- self.minutes = 0;
- self.fansCount = 0;
- self.followCount = 0;
- self.charmValue = @"0";
- self.starValue = @"0";
- self.wealthValue = @"0";
- }
- dispatch_group_notify(group, queue, ^{
- dispatch_async(dispatch_get_main_queue(), ^{
- [self initValue];
- if (error) {
- !failure?:failure(error);
- }else {
- !success?:success(self.dataSource);
- }
- });
- });
- }
- @end
|