From 57e30bc2584b92ce3da3821bd0f6e040f2ad28df Mon Sep 17 00:00:00 2001
From: admin <lrj@aelines-MacBook-Air.local>
Date: 星期五, 21 四月 2023 18:08:07 +0800
Subject: [PATCH] 抖音SDK 升级,个人中心bug修改,增加

---
 BuWanVideo2.0/SettingController.m |   54 ++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 48 insertions(+), 6 deletions(-)

diff --git a/BuWanVideo2.0/SettingController.m b/BuWanVideo2.0/SettingController.m
index 8dbe65c..c43f083 100755
--- a/BuWanVideo2.0/SettingController.m
+++ b/BuWanVideo2.0/SettingController.m
@@ -9,10 +9,13 @@
 #import "SettingController.h"
 #import "StorageSpaceTableViewCell.h"
 #import "SettingWebView.h"
+#import "UIView+Toast.h"
 
 #define indentfly @"cell"
 #define indentfly1 @"Mcell"
 #define indentfly2 @"WIFIcell"
+#define indentfly_logout @"LogoutCell"
+#define indentfly_unregister @"UnregisterCell"
 
 @interface SettingController()<UITableViewDelegate,UITableViewDataSource>{
     BOOL _userOnLine;
@@ -26,6 +29,10 @@
 @implementation SettingController
 
 - (void)viewWillAppear:(BOOL)animated {
+    _userOnLine=[[NSUserDefaults standardUserDefaults] boolForKey:@"userOnLine"];
+    if(_mytableview){
+        [_mytableview reloadData];
+    }
     [super viewWillAppear:animated];
     [self.navigationController setNavigationBarHidden:NO animated:animated];
 }
@@ -89,9 +96,24 @@
     [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"buUserInfo"];
     [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"userOnLine"];
     [[NSUserDefaults standardUserDefaults] synchronize];
-    
     [[NSNotificationCenter defaultCenter] postNotificationName:@"RELOAD_DATA" object:nil];
     [self.navigationController popViewControllerAnimated:YES];
+}
+
+// 娉ㄩ攢
+-(void)unRegister{
+    NSString *link= [[NSUserDefaults standardUserDefaults] stringForKey:UNREGISTER_LINK];
+    
+    if(link&&![link isEqual:@""])
+    {
+        NSLog(@"娉ㄩ攢");
+        SettingWebView *settingWebViewController = [[SettingWebView alloc] init];
+        settingWebViewController.webTitle=@"璐﹀彿娉ㄩ攢";
+        settingWebViewController.requestURL=link;
+        [self.navigationController pushViewController:settingWebViewController animated:YES];
+    }else{
+        [self.view makeToast:@"灏氭湭鑾峰彇鍒版敞閿�閾炬帴"];
+    }
 }
 
 - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
@@ -102,7 +124,7 @@
 
 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
     if(_userOnLine){
-        if (section==3) {
+        if (section==3||section==4) {
             return 1;
         }
     }
@@ -111,7 +133,7 @@
 
 - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
     if (_userOnLine) {
-        return _dataAry.count+1;
+        return _dataAry.count+2;
     }
     return _dataAry.count;
 }
@@ -119,7 +141,7 @@
 - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
     if(section==0){
         return 30;
-    }else if(section==3){
+    }else if(section==3||section==4){
         return 0;
     }
     return 22;
@@ -150,9 +172,9 @@
         return cell;
         
     }else if(indexPath.section==3){
-        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:indentfly];
+        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:indentfly_logout];
         if (cell==nil) {
-            cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:indentfly];
+            cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:indentfly_logout];
             [cell setAccessoryType:UITableViewCellAccessoryNone];
         }
         
@@ -161,6 +183,23 @@
         [outButton setTitle:@"閫�鍑虹櫥褰�" forState:UIControlStateNormal];
         [outButton setTintColor:[UIColor whiteColor]];
         [outButton addTarget:self action:@selector(OutOfLogin) forControlEvents:UIControlEventTouchUpInside];
+        [cell.viewForLastBaselineLayout addSubview:outButton];
+        
+        return cell;
+    }else if(indexPath.section==4){
+        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:indentfly_unregister];
+        if (cell==nil) {
+            cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:indentfly_unregister];
+            [cell setAccessoryType:UITableViewCellAccessoryNone];
+        }
+        
+        UIButton *outButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, KScreenW, 44)];
+        [outButton setBackgroundColor:[UIColor whiteColor]];
+//        [outButton setBackgroundColor:kGlobalBlueColor];
+        [outButton setTitle:@"娉ㄩ攢璐﹀彿" forState:UIControlStateNormal];
+        [outButton setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
+        [outButton setTintColor:[UIColor grayColor]];
+        [outButton addTarget:self action:@selector(unRegister) forControlEvents:UIControlEventTouchUpInside];
         [cell.viewForLastBaselineLayout addSubview:outButton];
         
         return cell;
@@ -234,6 +273,9 @@
     if(indexPath.section == 3 && indexPath.row == 0) {
         [self OutOfLogin];
     }
+    if(indexPath.section == 4 && indexPath.row == 0) {
+        [self unRegister];
+    }
 }
 
 - (void)popTips {

--
Gitblit v1.8.0