hxb 8 jaren geleden
bovenliggende
commit
51e51d7ac7

+ 5 - 4
WSCloudStorage/AppDelegate.m

@@ -10,7 +10,8 @@
 #import "CloudStorage/CSFirstPageController.h"
 
 
-#import "LoginViewController.h"
+//#import "LoginViewController.h"
+#import "CloudStorage/CSTabBarController.h"
 @interface AppDelegate ()
 
 @end
@@ -23,9 +24,9 @@
     _window = [[UIWindow alloc]init];
     _window.frame = [UIScreen mainScreen].bounds;
     //CSFirstPageController *firstvc = [CSFirstPageController csFirstPageControllerWithCSFileSourceType:CSFileSourceTypeSelf pid:@"0" shareId:nil];
-    LoginViewController *loginvc = [LoginViewController new];
-    UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:loginvc];
-    _window.rootViewController = nav;
+    CSTabBarController *loginvc = [CSTabBarController new];
+    //UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:loginvc];
+    _window.rootViewController = loginvc;
     [_window makeKeyAndVisible];
     return YES;
 }

+ 4 - 1
WSCloudStorage/CloudStorage/CSTabBarController.m

@@ -46,7 +46,10 @@
     
     //认证
     __weak typeof(self)weakSelf = self;
-    
+    //临时写死传入自己的号
+    [userDefaults setObject:@"hxb" forKey:USERDEFAULT_LOGIN_NAME];
+    [userDefaults setObject:@"e9bc0e13a8a16cbb07b175d92a113126" forKey:USERDEFAULT_PASSWORD];
+    [userDefaults setObject:@"WSPROD" forKey:USERDEFAULT_SERVER_ID];
     [self doLoginResultBlock:^(bool result){
         
         if (result) {

+ 4 - 1
WSCloudStorage/CloudStorage/std.h

@@ -37,7 +37,10 @@
 #define RGBA(r,g,b,a)         [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]
 #define RGB(r,g,b)            [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1.0]
 #define SahreColorRGB(r,g,b)  [UIColor colorWithRed:r green:g blue:b alpha:1.000]
-
+#define UIColorFromRGB(rgbValue) [UIColor \
+                                    colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
+                                    green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
+                                    blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
 #define LineForSubLineViewColor RGB(214, 215, 217)
 #define LineForDrawColor [UIColor lightGrayColor]
 /**

+ 16 - 7
WSCloudStorage/VC/More/PreferencesViewController.m

@@ -8,11 +8,12 @@
 
 #import "PreferencesViewController.h"
 #define AvatarWH 80
+#define ProgressH 4
 #define MaxX(view) CGRectGetMaxX(view.frame)
 #define EqualY(view) view.frame.origin.y
 //#define MaxXPlus(MaxX(v),plusnumber) (MaxX(v) + plusnumber)
 //Avatar frame
-#define MarginLeft 20
+#define ScreenMarginTBLR 20
 @interface PreferencesViewController()<UITableViewDelegate,UITableViewDataSource>
 @property(nonatomic,weak)UIImageView *avatarview;
 @property(nonatomic,weak)UIProgressView *progressview;
@@ -29,26 +30,34 @@
     //|头像 |progress
     //|____|descritionlabel
     CGFloat screenW = SCREEN_WIDTH;
-    CGFloat leftRightW;
+    CGFloat residualRightW;
+    CGFloat residualRightH;
     UIImageView *avatarview = [[UIImageView alloc]init];
     avatarview.layer.cornerRadius = AvatarWH/2;
     avatarview.layer.masksToBounds = YES;
-    avatarview.frame = CGRectMake(MarginLeft, 20, AvatarWH, AvatarWH);
+    avatarview.frame = CGRectMake(ScreenMarginTBLR, ScreenMarginTBLR, AvatarWH, AvatarWH);
     avatarview.backgroundColor = [UIColor grayColor];
     [self.view addSubview:avatarview];
     self.avatarview = avatarview;
     
-    leftRightW = screenW - MaxX(avatarview) - 10;//10 为何下一个控件的x距离
+    residualRightW = screenW - MaxX(avatarview) - 10 - 20;//10 为何下一个控件的x距离 20为右边距
     
     UILabel *namelab = [[UILabel alloc]init];
     namelab.textColor = [UIColor blackColor];
     namelab.font = [UIFont boldSystemFontOfSize:18];
     namelab.text = [userDefaults objectForKey:@"displayName"];
-    namelab.frame = CGRectMake(MaxX(avatarview)+ 10, EqualY(avatarview), 200, 30);//临时写死
+    namelab.frame = CGRectMake(MaxX(avatarview)+ 10, ScreenMarginTBLR, 200, 30);//临时写死
     [self.view addSubview:namelab];
     
-    UIProgressView *progressview = [[UIProgressView alloc]initWithFrame:CGRectMake(screenW-leftRightW,avatarview.centerY -2 , leftRightW, 4)];
-    progressview.progressTintColor = RGB(<#r#>, <#g#>, <#b#>)    progressview.backgroundColor = [UIColor lightGrayColor]
+    UIProgressView *progressview = [[UIProgressView alloc]initWithFrame:CGRectMake(screenW-residualRightW,avatarview.centerY -2 , residualRightW, ProgressH)];
+    progressview.progressTintColor = UIColorFromRGB(0x0DA32E);
+    progressview.backgroundColor = [UIColor lightGrayColor];
+    [self.view addSubview:progressview];
+    self.progressview = progressview;
+    
+    UILabel *descritionlab = [[UILabel alloc]init];
+    descritionlab.text = @"容量 (23.12G/35.00G 66%)";
+    [self.view addSubview:descritionlab];
 }
 
 @end