|
@@ -9,7 +9,6 @@
|
|
#import "ASSettingListCell.h"
|
|
#import "ASSettingListCell.h"
|
|
#import "ASInfomationSetController.h"
|
|
#import "ASInfomationSetController.h"
|
|
#import "ASHelpListViewController.h"
|
|
#import "ASHelpListViewController.h"
|
|
-#import "AppDelegate.h"
|
|
|
|
|
|
|
|
@interface ASSettingViewController () <UITableViewDelegate,UITableViewDataSource>
|
|
@interface ASSettingViewController () <UITableViewDelegate,UITableViewDataSource>
|
|
|
|
|
|
@@ -20,7 +19,6 @@
|
|
@property (nonatomic, strong) NSArray *titleArr;
|
|
@property (nonatomic, strong) NSArray *titleArr;
|
|
@property (nonatomic, strong) NSArray *detailArr;
|
|
@property (nonatomic, strong) NSArray *detailArr;
|
|
|
|
|
|
-//@property (nonatomic, strong) KWLoginedUserModel *userInfo;
|
|
|
|
|
|
|
|
@end
|
|
@end
|
|
|
|
|
|
@@ -38,19 +36,11 @@
|
|
|
|
|
|
[self loadSubVs];
|
|
[self loadSubVs];
|
|
|
|
|
|
-// [self configData];
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- (void)viewWillAppear:(BOOL)animated {
|
|
- (void)viewWillAppear:(BOOL)animated {
|
|
[super viewWillAppear:animated];
|
|
[super viewWillAppear:animated];
|
|
-
|
|
|
|
-// self.userInfo = [KWLoginedManager.shareInstance getCurrentLoginedUser];
|
|
|
|
[self configData];
|
|
[self configData];
|
|
-// @weakify(self);
|
|
|
|
-// [KWLoginedManager.shareInstance getUserInfo:^(bool flag) {
|
|
|
|
-// weak_self.userInfo = [KWLoginedManager.shareInstance getCurrentLoginedUser];
|
|
|
|
-// [weak_self configData];
|
|
|
|
-// }];
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- (void)configData {
|
|
- (void)configData {
|
|
@@ -153,9 +143,6 @@
|
|
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
|
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
|
switch (indexPath.row) {
|
|
switch (indexPath.row) {
|
|
case 0:{
|
|
case 0:{
|
|
-// if (![self checkLogin:true]) {
|
|
|
|
-// return;
|
|
|
|
-// }
|
|
|
|
ASInfomationSetController *vc = [ASInfomationSetController new];
|
|
ASInfomationSetController *vc = [ASInfomationSetController new];
|
|
[self.navigationController pushViewController:vc animated:true];
|
|
[self.navigationController pushViewController:vc animated:true];
|
|
break;
|
|
break;
|
|
@@ -186,7 +173,7 @@
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
case 6: {
|
|
case 6: {
|
|
-// [self showDeleteAccountAlert];
|
|
|
|
|
|
+ [self showDeleteAccountAlert];
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
default:
|
|
default:
|
|
@@ -202,8 +189,7 @@
|
|
|
|
|
|
ASSettingListCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ASSettingListCell" forIndexPath:indexPath];
|
|
ASSettingListCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ASSettingListCell" forIndexPath:indexPath];
|
|
[cell setTitle:self.titleArr[indexPath.row] points:self.detailArr[indexPath.row] enable:true];
|
|
[cell setTitle:self.titleArr[indexPath.row] points:self.detailArr[indexPath.row] enable:true];
|
|
- if (//KWLoginedManager.shareInstance.isLogined &&
|
|
|
|
- ((indexPath.row == _titleArr.count - 1) || (indexPath.row == _titleArr.count - 2))) {
|
|
|
|
|
|
+ if (((indexPath.row == _titleArr.count - 1) || (indexPath.row == _titleArr.count - 2))) {
|
|
cell.moreIcon.hidden = true;
|
|
cell.moreIcon.hidden = true;
|
|
} else {
|
|
} else {
|
|
cell.moreIcon.hidden = false;
|
|
cell.moreIcon.hidden = false;
|
|
@@ -228,11 +214,11 @@
|
|
[MBProgressHUD showHUDAddedTo:self.view animated:true];
|
|
[MBProgressHUD showHUDAddedTo:self.view animated:true];
|
|
__weak typeof(self) weak_self = self;
|
|
__weak typeof(self) weak_self = self;
|
|
[ASNetTools.shared postWithPath:postLogOut param:@{} success:^(id _Nonnull json) {
|
|
[ASNetTools.shared postWithPath:postLogOut param:@{} success:^(id _Nonnull json) {
|
|
- [MBProgressHUD hideHUDForView:self.view animated:true];
|
|
|
|
|
|
+ [MBProgressHUD hideHUDForView:weak_self.view animated:true];
|
|
[weak_self popAndToLogin];
|
|
[weak_self popAndToLogin];
|
|
|
|
|
|
} faild:^(NSString * _Nonnull code, NSString * _Nonnull msg) {
|
|
} faild:^(NSString * _Nonnull code, NSString * _Nonnull msg) {
|
|
- [MBProgressHUD hideHUDForView:self.view animated:true];
|
|
|
|
|
|
+ [MBProgressHUD hideHUDForView:weak_self.view animated:true];
|
|
NSLog(@"err:%@",code);
|
|
NSLog(@"err:%@",code);
|
|
[weak_self.view makeToast:@"Oh No, Bad Net"];
|
|
[weak_self.view makeToast:@"Oh No, Bad Net"];
|
|
}];
|
|
}];
|
|
@@ -275,7 +261,8 @@
|
|
__weak typeof(self) weakSelf = self;
|
|
__weak typeof(self) weakSelf = self;
|
|
ASCustomWindow *window = [ASCustomWindow show:@"Are You Sure To Delete Your Account?\n(This action can't be undone. All the data of your account will be delete)" isMast:false upBlock:^{
|
|
ASCustomWindow *window = [ASCustomWindow show:@"Are You Sure To Delete Your Account?\n(This action can't be undone. All the data of your account will be delete)" isMast:false upBlock:^{
|
|
} cancelBlock:^{
|
|
} cancelBlock:^{
|
|
- [weakSelf showDeletedReasonInput];
|
|
|
|
|
|
+ [weakSelf deleteAccount:@""];
|
|
|
|
+// [weakSelf showDeletedReasonInput];
|
|
|
|
|
|
}];
|
|
}];
|
|
window.vc.titleLb.text = @"Delete Account?";
|
|
window.vc.titleLb.text = @"Delete Account?";
|
|
@@ -300,37 +287,29 @@
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-- (void)showDeletedReasonInput {
|
|
|
|
- __weak typeof(self) weakSelf = self;
|
|
|
|
- [APHomeActiveWindow show:@"Deleted Account" des:@"Dear user, could you tell me the reason for leaving?" sureBlock:^(NSString *reason) {
|
|
|
|
- NSString *str = @"";
|
|
|
|
- if (!reason.isEmpty) {
|
|
|
|
- str = reason;
|
|
|
|
- }
|
|
|
|
- [weakSelf deleteAccount:str];
|
|
|
|
- } cancelBlock:^{
|
|
|
|
- }];
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-- (void)deleteAccount:(NSString *)msg {
|
|
|
|
-// [MBProgressHUD showHUDAddedTo:self.view animated:true];
|
|
|
|
-// @weakify(self);
|
|
|
|
-// [PPNetworkHelper POST:DeleteAccount parameters:@{@"deleteReason":msg} success:^(id responseObject) {
|
|
|
|
-// [MBProgressHUD hideHUDForView:self.view animated:true];
|
|
|
|
-// if (RequestSuccess) {
|
|
|
|
-// NSLog(@"success:%@",responseObject);
|
|
|
|
-// [XXX_Tabber shareInstance].xxx_barCartBtn.badgeValue = @"0";
|
|
|
|
-// [weak_self popAndToLogin];
|
|
|
|
-//
|
|
|
|
-// } else {
|
|
|
|
-// NSLog(@"fail:%@",RequestErrorMsg);
|
|
|
|
-// [weak_self.view makeToast:RequestErrorMsg];
|
|
|
|
|
|
+//- (void)showDeletedReasonInput {
|
|
|
|
+// __weak typeof(self) weakSelf = self;
|
|
|
|
+// [APHomeActiveWindow show:@"Deleted Account" des:@"Dear user, could you tell me the reason for leaving?" sureBlock:^(NSString *reason) {
|
|
|
|
+// NSString *str = @"";
|
|
|
|
+// if (!reason.isEmpty) {
|
|
|
|
+// str = reason;
|
|
// }
|
|
// }
|
|
-// } failure:^(NSError *error) {
|
|
|
|
-// [MBProgressHUD hideHUDForView:self.view animated:true];
|
|
|
|
-// NSLog(@"err:%@",error);
|
|
|
|
-// [weak_self.view makeToast:@"Oh No, Bad Net"];
|
|
|
|
|
|
+// [weakSelf deleteAccount:str];
|
|
|
|
+// } cancelBlock:^{
|
|
// }];
|
|
// }];
|
|
|
|
+//}
|
|
|
|
+
|
|
|
|
+- (void)deleteAccount:(NSString *)msg {
|
|
|
|
+
|
|
|
|
+ [MBProgressHUD showHUDAddedTo:self.view animated:true];
|
|
|
|
+ __weak typeof(self) weakSelf = self;
|
|
|
|
+ [ASNetTools.shared delWithPath:deleteUser param:@{} success:^(id _Nonnull json) {
|
|
|
|
+ [MBProgressHUD hideHUDForView:weakSelf.view animated:true];
|
|
|
|
+ [weakSelf popAndToLogin];
|
|
|
|
+ } faild:^(NSString * _Nonnull code, NSString * _Nonnull msg) {
|
|
|
|
+ [MBProgressHUD hideHUDForView:weakSelf.view animated:true];
|
|
|
|
+ [weakSelf.view makeToast:@"Oh No, Bad Net"];
|
|
|
|
+ }];
|
|
}
|
|
}
|
|
|
|
|
|
@end
|
|
@end
|