2
This commit is contained in:
@@ -70,6 +70,7 @@ static const CGFloat JXheightForHeaderInSection = 50;
|
||||
}];
|
||||
|
||||
[self fetchShopStylesWithHUD:YES];
|
||||
[self fetchWalletBalanceWithHUD:NO];
|
||||
}
|
||||
|
||||
// 系统导航栏显隐由 Base 统一管理(全局隐藏),该 VC 不再手动切换,避免闪烁。
|
||||
@@ -137,6 +138,7 @@ static const CGFloat JXheightForHeaderInSection = 50;
|
||||
__weak typeof(self)weakSelf = self;
|
||||
self.pagerView.mainTableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
|
||||
[weakSelf fetchShopStylesWithHUD:NO];
|
||||
[weakSelf fetchWalletBalanceWithHUD:NO];
|
||||
}];
|
||||
|
||||
self.pagerView.pinSectionHeaderVerticalOffset = KB_NAV_TOTAL_HEIGHT;
|
||||
@@ -272,6 +274,28 @@ static const CGFloat JXheightForHeaderInSection = 50;
|
||||
return _shopVM;
|
||||
}
|
||||
|
||||
- (void)fetchWalletBalanceWithHUD:(BOOL)showHUD {
|
||||
if (showHUD) {
|
||||
[KBHUD show];
|
||||
}
|
||||
__weak typeof(self) weakSelf = self;
|
||||
[self.shopVM fetchWalletBalanceWithCompletion:^(NSNumber * _Nullable balance, NSError * _Nullable error) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if (showHUD) {
|
||||
[KBHUD dismiss];
|
||||
}
|
||||
if (error) {
|
||||
NSString *msg = error.localizedDescription ?: KBLocalized(@"Network error");
|
||||
[KBHUD showInfo:msg];
|
||||
return;
|
||||
}
|
||||
double amountValue = balance.doubleValue;
|
||||
NSString *amountString = [NSString stringWithFormat:@"%.2f", amountValue];
|
||||
[weakSelf.userHeaderView updatePoints:amountString];
|
||||
});
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)fetchShopStylesWithHUD:(BOOL)showHUD {
|
||||
if (showHUD) {
|
||||
[KBHUD show];
|
||||
|
||||
Reference in New Issue
Block a user