15555599100 6 éve
szülő
commit
df7bdeba25
29 módosított fájl, 578 hozzáadás és 68 törlés
  1. 8 2
      HappyWork/HappyWork.xcodeproj/project.pbxproj
  2. BIN
      HappyWork/HappyWork.xcworkspace/xcuserdata/zhangxiaoguang.xcuserdatad/UserInterfaceState.xcuserstate
  3. 23 0
      HappyWork/HappyWork/Assets.xcassets/PersonalCenter/app_update.imageset/Contents.json
  4. BIN
      HappyWork/HappyWork/Assets.xcassets/PersonalCenter/app_update.imageset/app_update.png
  5. BIN
      HappyWork/HappyWork/Assets.xcassets/PersonalCenter/app_update.imageset/app_update@2x.png
  6. BIN
      HappyWork/HappyWork/Assets.xcassets/PersonalCenter/app_update.imageset/app_update@3x.png
  7. 0 2
      HappyWork/HappyWork/Base/PageListViewController.m
  8. 3 3
      HappyWork/HappyWork/Class/DemandHall/DemanHall_详情/View/DemanHallDetailHeaderView.m
  9. 1 1
      HappyWork/HappyWork/Class/DemandHall/Model/DemanHallModel.h
  10. 22 6
      HappyWork/HappyWork/Class/DemandHall/ViewController/DemanHallViewController.m
  11. 2 0
      HappyWork/HappyWork/Class/DemandHall/ViewModel/DemanHallViewModel.h
  12. 22 3
      HappyWork/HappyWork/Class/DemandHall/ViewModel/DemanHallViewModel.m
  13. 2 0
      HappyWork/HappyWork/Class/DemandHall/Views/View/HWUpdateView.h
  14. 39 17
      HappyWork/HappyWork/Class/DemandHall/Views/View/HWUpdateView.m
  15. 83 2
      HappyWork/HappyWork/Class/LoginRegister/ViewController/RegisterAgreementViewController.m
  16. 254 0
      HappyWork/HappyWork/Class/LoginRegister/ViewController/用户注册协议.html
  17. 1 1
      HappyWork/HappyWork/Class/PersonalCenter/View/PersonalCenterHeaderCell.h
  18. 14 14
      HappyWork/HappyWork/Class/PersonalCenter/View/PersonalCenterHeaderCell.m
  19. 27 0
      HappyWork/HappyWork/Class/PersonalCenter/ViewController/PersonalCenterViewController.m
  20. 2 0
      HappyWork/HappyWork/Class/PersonalCenter/ViewModel/PersonalCenterViewModel.h
  21. 36 6
      HappyWork/HappyWork/Class/PersonalCenter/ViewModel/PersonalCenterViewModel.m
  22. 3 3
      HappyWork/HappyWork/Class/PersonalCenter/我的报名_signup/ViewModel/MySignUpViewModel.m
  23. 3 3
      HappyWork/HappyWork/Class/PersonalCenter/我的订单_order/ViewModel/MyOrderViewModel.m
  24. 1 2
      HappyWork/HappyWork/Custom/ProgressHUD/HWProgressHUD.m
  25. 3 3
      HappyWork/HappyWork/Info.plist
  26. 4 0
      HappyWork/HappyWork/Support/HWAPI.h
  27. 5 0
      HappyWork/HappyWork/Support/HWAppService.h
  28. 17 0
      HappyWork/HappyWork/Support/HWAppService.m
  29. 3 0
      HappyWork/HappyWork/Support/HappyWork.pch

+ 8 - 2
HappyWork/HappyWork.xcodeproj/project.pbxproj

@@ -96,6 +96,7 @@
 		71382916233A1E30007256F4 /* HWProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = 71382915233A1E30007256F4 /* HWProgressHUD.m */; };
 		713DE88323715A3200E0E5EA /* DemanHallEmptyCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 713DE88223715A3200E0E5EA /* DemanHallEmptyCell.m */; };
 		713E8DB02372662400EE66DC /* HWUpdateView.m in Sources */ = {isa = PBXBuildFile; fileRef = 713E8DAF2372662400EE66DC /* HWUpdateView.m */; };
+		715DB801237401490042BFF6 /* 用户注册协议.html in Resources */ = {isa = PBXBuildFile; fileRef = 715DB800237401490042BFF6 /* 用户注册协议.html */; };
 		71A3B090234C135E004D73A5 /* MySignUpDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71A3B08F234C135E004D73A5 /* MySignUpDetailViewController.m */; };
 		71A3B094234D6CB4004D73A5 /* DemanHallDetailSignUpView.m in Sources */ = {isa = PBXBuildFile; fileRef = 71A3B093234D6CB4004D73A5 /* DemanHallDetailSignUpView.m */; };
 		71A3B097234D94F6004D73A5 /* DemanHallModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 71A3B096234D94F6004D73A5 /* DemanHallModel.m */; };
@@ -307,6 +308,7 @@
 		713DE88223715A3200E0E5EA /* DemanHallEmptyCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DemanHallEmptyCell.m; sourceTree = "<group>"; };
 		713E8DAE2372662400EE66DC /* HWUpdateView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HWUpdateView.h; sourceTree = "<group>"; };
 		713E8DAF2372662400EE66DC /* HWUpdateView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HWUpdateView.m; sourceTree = "<group>"; };
+		715DB800237401490042BFF6 /* 用户注册协议.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "用户注册协议.html"; sourceTree = "<group>"; };
 		71A3B08E234C135E004D73A5 /* MySignUpDetailViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MySignUpDetailViewController.h; sourceTree = "<group>"; };
 		71A3B08F234C135E004D73A5 /* MySignUpDetailViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MySignUpDetailViewController.m; sourceTree = "<group>"; };
 		71A3B091234D62C9004D73A5 /* HWAPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HWAPI.h; sourceTree = "<group>"; };
@@ -459,6 +461,7 @@
 				7138287E23366600007256F4 /* RegisterUserViewController.m */,
 				713828ED2339DC31007256F4 /* RegisterAgreementViewController.h */,
 				713828EE2339DC31007256F4 /* RegisterAgreementViewController.m */,
+				715DB800237401490042BFF6 /* 用户注册协议.html */,
 			);
 			path = ViewController;
 			sourceTree = "<group>";
@@ -1333,6 +1336,7 @@
 			files = (
 				71FA53E22330C6780007094A /* LaunchScreen.storyboard in Resources */,
 				712AF729233372FE00EBD542 /* HJCityPickerViewControllerSource.bundle in Resources */,
+				715DB801237401490042BFF6 /* 用户注册协议.html in Resources */,
 				71FA53DF2330C6780007094A /* Assets.xcassets in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
@@ -1703,6 +1707,7 @@
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CODE_SIGN_STYLE = Automatic;
+				CURRENT_PROJECT_VERSION = 2;
 				DEVELOPMENT_TEAM = 6TLH64Q4Z4;
 				GCC_PREFIX_HEADER = "$(SRCROOT)/HappyWork/Support/HappyWork.pch";
 				INFOPLIST_FILE = HappyWork/Info.plist;
@@ -1712,7 +1717,7 @@
 					"@executable_path/Frameworks",
 				);
 				MARKETING_VERSION = 1.0.0;
-				PRODUCT_BUNDLE_IDENTIFIER = com.huijiabo.HappyWork;
+				PRODUCT_BUNDLE_IDENTIFIER = com.huijiabo.happywork;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				TARGETED_DEVICE_FAMILY = 1;
 			};
@@ -1724,6 +1729,7 @@
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CODE_SIGN_STYLE = Automatic;
+				CURRENT_PROJECT_VERSION = 2;
 				DEVELOPMENT_TEAM = 6TLH64Q4Z4;
 				GCC_PREFIX_HEADER = "$(SRCROOT)/HappyWork/Support/HappyWork.pch";
 				INFOPLIST_FILE = HappyWork/Info.plist;
@@ -1733,7 +1739,7 @@
 					"@executable_path/Frameworks",
 				);
 				MARKETING_VERSION = 1.0.0;
-				PRODUCT_BUNDLE_IDENTIFIER = com.huijiabo.HappyWork;
+				PRODUCT_BUNDLE_IDENTIFIER = com.huijiabo.happywork;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				TARGETED_DEVICE_FAMILY = 1;
 			};

BIN
HappyWork/HappyWork.xcworkspace/xcuserdata/zhangxiaoguang.xcuserdatad/UserInterfaceState.xcuserstate


+ 23 - 0
HappyWork/HappyWork/Assets.xcassets/PersonalCenter/app_update.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "app_update.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "app_update@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "app_update@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
HappyWork/HappyWork/Assets.xcassets/PersonalCenter/app_update.imageset/app_update.png


BIN
HappyWork/HappyWork/Assets.xcassets/PersonalCenter/app_update.imageset/app_update@2x.png


BIN
HappyWork/HappyWork/Assets.xcassets/PersonalCenter/app_update.imageset/app_update@3x.png


+ 0 - 2
HappyWork/HappyWork/Base/PageListViewController.m

@@ -106,12 +106,10 @@
     {
         // 判断数据加载是否到了最后一页,如果是最后一页了就用endRefreshingWithNoMoreData去结束动画效果,
         //这样可以显示MJRefreshStateNoMoreData状态下的提示信息
-        NSLog(@"-----没了-----");
         [self.refreshFooter endRefreshingWithNoMoreData];
     }
     else
     {
-        NSLog(@"-----有-----");
         [self.refreshFooter endRefreshing];
     }
 }

+ 3 - 3
HappyWork/HappyWork/Class/DemandHall/DemanHall_详情/View/DemanHallDetailHeaderView.m

@@ -72,11 +72,11 @@
     self.titleLabel.text = model.name;
     if ([model.stage integerValue] == 0)
     {
-        self.moneylabel.text = [NSString stringWithFormat:@"%@元*1次",model.price];
+        self.moneylabel.text = [NSString stringWithFormat:@"%@元*1次",[HWAppService reviseString:model.price]];
     }
     else
     {
-        self.moneylabel.text = [NSString stringWithFormat:@"%@元*%@期",model.price,model.stage];
+        self.moneylabel.text = [NSString stringWithFormat:@"%@元*%@期",[HWAppService reviseString:model.price],model.stage];
     }
     
     [self.timeBtn setTitle:model.expiryDate  forState:UIControlStateNormal];
@@ -91,7 +91,7 @@
     }
     
     NSMutableAttributedString *countAtt1 = [[NSMutableAttributedString alloc]initWithString:self.moneylabel.text];
-    [countAtt1 addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:19] range:NSMakeRange(0, model.price.length + 1)];
+    [countAtt1 addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:19] range:NSMakeRange(0, [HWAppService reviseString:model.price].length + 1)];
     self.moneylabel.attributedText = countAtt1;
 
 }

+ 1 - 1
HappyWork/HappyWork/Class/DemandHall/Model/DemanHallModel.h

@@ -31,7 +31,7 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nonatomic, copy) NSString *name;
 @property (nonatomic, copy) NSString *code;
 @property (nonatomic, copy) NSString *priceType;
-@property (nonatomic, copy) NSString *price;
+@property (nonatomic, strong) NSString *price;
 @property (nonatomic, copy) NSString *countryCode;
 @property (nonatomic, copy) NSString *provinceCityCountry;
 @property (nonatomic, copy) NSString *authenticationStatus;

+ 22 - 6
HappyWork/HappyWork/Class/DemandHall/ViewController/DemanHallViewController.m

@@ -38,8 +38,6 @@ DemanHallMenuFilterViewDelegate
     
     [super viewDidLoad];
     [self dealWithRequestResult];
-//    HWUpdateView *updateView =  [[HWUpdateView alloc]init];
-//    [updateView.doneBtn addTarget:self action:@selector(updateDoneButtonClick:) forControlEvents:UIControlEventTouchUpInside];
     
 }
 
@@ -64,6 +62,7 @@ DemanHallMenuFilterViewDelegate
         make.bottom.equalTo(self.view.mas_bottom).offset(0);
     }];
 }
+
 #pragma mark - private metnod
 
 /* 处理请求结果 */
@@ -71,13 +70,33 @@ DemanHallMenuFilterViewDelegate
     
     [self.view showLoadingView];
     [self.viewModel bannerRequirement];
-    
+    [self.viewModel appUpdateRequirement];
     __weak typeof(self) weakSelf = self;
     
+    //banner
     self.viewModel.bannerDataBlock = ^{
       
         [weakSelf.tableView reloadData];
     };
+    //更新
+    self.viewModel.updateDataBlock = ^(NSDictionary * _Nonnull dataDict) {
+        
+        id isLatest = [dataDict valueForKeyPath:@"data.isLatest"];//[isLatest isKindOfClass:[NSNumber class]] &&
+       
+        if (![isLatest boolValue])
+        {
+            id isForceUpdate = [dataDict valueForKeyPath:@"data.hwVersion.isForceUpdate"];//1强制更新
+            id description = [dataDict valueForKeyPath:@"data.hwVersion.description"];
+            if ([isForceUpdate isKindOfClass:[NSNumber class]] && [description isKindOfClass:[NSString class]])
+            {
+                HWUpdateView *updateView =  [[HWUpdateView alloc]init];
+                updateView.update = [isForceUpdate boolValue];
+                NSAttributedString * attrStr = [[NSAttributedString alloc] initWithData:[description dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType } documentAttributes:nil error:nil];
+                updateView.detailLabel.attributedText = attrStr;
+            }
+        }
+    };
+    //列表
     [self.viewModel initWithResponseDataBlock:^(id  _Nonnull data) {
         
         [weakSelf successfulRefreshOperation];
@@ -86,19 +105,16 @@ DemanHallMenuFilterViewDelegate
         if (weakSelf.viewModel.listArray.count == 0)
         {//空页面是否显示(没有加载更多了)
             weakSelf.refreshFooter.noText = YES;
-            weakSelf.lastPage = [data[@"data"][@"isLast"] boolValue];
         }
         else
         {
             weakSelf.refreshFooter.noText = NO;
-           
         }
         
     } fail:^(id  _Nonnull data) {
         
         [weakSelf failRefreshOperation];
         [HWProgressHUD fb_showFailureWithStatus:data];
-        
     }];
     
 }

+ 2 - 0
HappyWork/HappyWork/Class/DemandHall/ViewModel/DemanHallViewModel.h

@@ -15,8 +15,10 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nonatomic, strong) NSMutableArray *bannerList;
 @property (nonatomic, strong) NSMutableArray *listArray;
 @property (nonatomic, copy) void(^bannerDataBlock)(void);
+@property (nonatomic, copy) void(^updateDataBlock)(NSDictionary *dataDict);
 
 - (void)bannerRequirement;
+- (void)appUpdateRequirement;
 - (void)getRequirementList:(NSDictionary *)parameterDict;
 
 @end

+ 22 - 3
HappyWork/HappyWork/Class/DemandHall/ViewModel/DemanHallViewModel.m

@@ -27,6 +27,24 @@
     }
     return self;
 }
+- (void)appUpdateRequirement {
+    
+    [HWAFHttpTool getRequestWithURLStr:check_Version params:@{@"version":BUNDLE_SHORTVERSION,@"app_system":@"1"} success:^(NSDictionary *responseDic) {
+        
+        if ([responseDic[@"errcode"] integerValue] == 0)
+        {
+            self.updateDataBlock(responseDic);
+        }
+        else
+        {
+            [HWProgressHUD fb_showFailureWithStatus:responseDic[@"errmsg"]];
+        }
+        
+    } failure:^(NSString *error) {
+        
+    }];
+    
+}
 - (void)bannerRequirement {
     
     [HWAFHttpTool getRequestWithURLStr:banner params:nil success:^(NSDictionary *responseDic) {
@@ -132,16 +150,17 @@
                 cell.numberView.taglabel.text = [NSString stringWithFormat:@"任务数:若干"];
             }
             
+            
             if ([model.stage integerValue] == 0)
             {
-                cell.moneyLabel.text = [NSString stringWithFormat:@"%@元*1次",model.price];
+                cell.moneyLabel.text = [NSString stringWithFormat:@"%@元*1次",[HWAppService reviseString:model.price]];
             }
             else
             {
-                cell.moneyLabel.text = [NSString stringWithFormat:@"%@元*%@期",model.price,model.stage];
+                cell.moneyLabel.text = [NSString stringWithFormat:@"%@元*%@期",[HWAppService reviseString:model.price],model.stage];
             }
             NSMutableAttributedString *countAtt1 = [[NSMutableAttributedString alloc]initWithString:cell.moneyLabel.text];
-               [countAtt1 addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:17] range:NSMakeRange(0, model.price.length + 1)];
+               [countAtt1 addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:17] range:NSMakeRange(0, [HWAppService reviseString:model.price].length + 1)];
             cell.moneyLabel.attributedText = countAtt1;
             
             return cell;

+ 2 - 0
HappyWork/HappyWork/Class/DemandHall/Views/View/HWUpdateView.h

@@ -13,6 +13,8 @@ NS_ASSUME_NONNULL_BEGIN
 @interface HWUpdateView : UIView
 
 @property (nonatomic, strong) UIButton *doneBtn;
+@property (nonatomic, strong) UILabel *detailLabel;
+@property (nonatomic, assign) BOOL update;
 
 @end
 

+ 39 - 17
HappyWork/HappyWork/Class/DemandHall/Views/View/HWUpdateView.m

@@ -14,7 +14,6 @@
 @property (nonatomic, strong) UIImageView *icon;
 @property (nonatomic, strong) UIView      *bgView;
 @property (nonatomic, strong) UILabel *titleLabel;
-@property (nonatomic, strong) UILabel *detailLabel;
 @property (nonatomic, strong) UIView  *liveView;
 @property (nonatomic, strong) UIButton *cancelBtn;
 
@@ -86,25 +85,44 @@
         make.height.mas_equalTo(1);
     }];
 
-    [self.cancelBtn mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.left.equalTo(self.bgView).offset(0);
-        make.bottom.equalTo(self.bgView.mas_bottom).offset(0);
-        make.top.equalTo(self.liveView.mas_bottom).offset(0);
-        make.height.mas_equalTo(55);
-        make.right.equalTo(self.doneBtn.mas_left).offset(0);
-        make.width.equalTo(self.doneBtn.mas_width);
-    }];
-    [self.doneBtn mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.right.equalTo(self.bgView).offset(0);
-        make.bottom.equalTo(self.bgView.mas_bottom).offset(0);
-        make.top.equalTo(self.liveView.mas_bottom).offset(0);
-        make.height.mas_equalTo(55);
-    }];
     
-    self.detailLabel.text = @"1.修复目前版本的已知bug若干;\n2.修复目前版本的已知bug若干;";
+//    self.detailLabel.text = @"1.修复目前版本的已知bug若干;\n2.修复目前版本的已知bug若干;";
     
 }
 
+-(void)setUpdate:(BOOL)update {
+    
+    if (update)
+    {
+        self.cancelBtn.hidden = YES;
+        [self.doneBtn mas_remakeConstraints:^(MASConstraintMaker *make) {
+            
+            make.left.equalTo(self.bgView).offset(0);
+            make.right.equalTo(self.bgView).offset(0);
+            make.bottom.equalTo(self.bgView.mas_bottom).offset(0);
+            make.top.equalTo(self.liveView.mas_bottom).offset(0);
+            make.height.mas_equalTo(55);
+        }];
+    }
+    else
+    {
+        [self.cancelBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.equalTo(self.bgView).offset(0);
+            make.bottom.equalTo(self.bgView.mas_bottom).offset(0);
+            make.top.equalTo(self.liveView.mas_bottom).offset(0);
+            make.height.mas_equalTo(55);
+            make.right.equalTo(self.doneBtn.mas_left).offset(0);
+            make.width.equalTo(self.doneBtn.mas_width);
+        }];
+        [self.doneBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.right.equalTo(self.bgView).offset(0);
+            make.bottom.equalTo(self.bgView.mas_bottom).offset(0);
+            make.top.equalTo(self.liveView.mas_bottom).offset(0);
+            make.height.mas_equalTo(55);
+        }];
+    }
+}
+
 -(void)removeViewFromWindow
 {
     [UIView animateWithDuration:0.3 animations:^{
@@ -120,7 +138,10 @@
     
     [self removeViewFromWindow];
 }
-
+- (void)doneButtonClick:(UIButton *)btn {
+    
+    
+}
 #pragma mark - setter and getter
 
 - (UIView *)bigView {
@@ -204,6 +225,7 @@
         [_doneBtn setTitleColor:COLOR_GRAY_F5 forState:UIControlStateNormal];
         _doneBtn.titleLabel.font = [UIFont boldSystemFontOfSize:17];
         _doneBtn.backgroundColor = [UIColor colorFromHexString:@"823BFF"];
+        [_doneBtn addTarget:self action:@selector(doneButtonClick:) forControlEvents:UIControlEventTouchUpInside];
     }
     return _doneBtn;
 }

+ 83 - 2
HappyWork/HappyWork/Class/LoginRegister/ViewController/RegisterAgreementViewController.m

@@ -13,6 +13,8 @@
 
 @property (nonatomic, strong) WKWebView *webView;
 
+//@property (nonatomic, strong) UIWebView *webView;
+
 @end
 
 @implementation RegisterAgreementViewController
@@ -31,18 +33,97 @@
     [self hj_setupNavBar];
     self.view.backgroundColor = [UIColor whiteColor];
     
-    self.webView = [[WKWebView alloc]init];
+    
+    NSString *path = [[NSBundle mainBundle] pathForResource:@"用户注册协议" ofType:@"html" inDirectory:nil];
+    
+    NSLog(@"::::%@",path);
     [self.view addSubview:self.webView];
     [self.webView mas_makeConstraints:^(MASConstraintMaker *make) {
        
         make.left.right.top.bottom.equalTo(self.view).offset(0);
     }];
-//     [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",self.webUrl]]]];
     
+    if ([[UIDevice currentDevice].systemVersion floatValue] >= 9.0)
+    {
+        NSURL*Url = [NSURL fileURLWithPath:path];
+        [self.webView loadRequest:[NSURLRequest requestWithURL:Url]];
+    }
+    else
+    {
+        NSArray * array=@[@"a",@"b",@"c",@"d"];
+        for (NSString * name in array)
+        {
+            [self onlyCopyFile:name type:@"html" directory:@"MyDirect" child:nil];
+        }
+        // 拷贝css  @"thecss.min.css" 这个文件在MyDirect下的css里
+        [self onlyCopyFile:@"bootstrap.min" type:@"css" directory:@"MyDirect/css" child:@"css"];
+        // 拷贝图片,图片存在这个文件在MyDirect下的img里
+        NSArray * arrayImage=@[@"img1",@"img2",@"img3"];
+        
+        for (int i=0; i<arrayImage.count; i++)
+        {
+            NSString * name=arrayImage[i];
+            NSString * type=@"png";
+            [self onlyCopyFile:name type:type directory:@"MyDirect/img" child:@"img"];
+        }
+        //这才是加载的重点,将当前要使用的HTML文件copy到tmp,然后进行加载
+        NSURL *fileURL = [self copyFileToTmp:[NSURL fileURLWithPath:path] childDirect:nil];
+        //            NSURL *fileURL = [self fileURLForBuggyWKWebView8:pathUrl childDirect:nil];
+        NSURLRequest *request = [NSURLRequest requestWithURL:fileURL];
+        [self.webView loadRequest:request];
+    }
+    
+}
+//仅仅复制文件  child 是子文件夹名字,为了传值写的,directory是文件路径
+-(void)onlyCopyFile:(NSString *)name type:(NSString *)type directory:(NSString *)directory child:(NSString *)child{
+    
+    NSString *pathChild = [[NSBundle mainBundle] pathForResource:name ofType:type inDirectory:directory];
+    if (pathChild)
+    {
+        [self copyFileToTmp:[NSURL fileURLWithPath:pathChild] childDirect:child];
+    }
+}
+
+//将文件copy到tmp目录,iOS9以前
+- (NSURL *)copyFileToTmp:(NSURL *)fileURL childDirect:(NSString *)direct{
+    
+    NSError *error = nil;
+    if (!fileURL.fileURL || ![fileURL checkResourceIsReachableAndReturnError:&error])
+    {
+        return nil;
+    }
+    // 在tmp下创建你要保存这些文件的文件夹 "/tmp/XXX",direct是为为了方便判断要copy的文件是否在子文件夹下,如果是的话则要创建子文件夹
+    NSFileManager *fileManager= [NSFileManager defaultManager];
+    NSString * strPath=@"XXX";
+    if (direct)
+    {
+        strPath = [NSString stringWithFormat:@"XXX/%@",direct];
+    }
+
+    NSURL *temDirURL = [[NSURL fileURLWithPath:NSTemporaryDirectory()] URLByAppendingPathComponent:strPath];
+    [fileManager createDirectoryAtURL:temDirURL withIntermediateDirectories:YES attributes:nil error:&error];
     
+    NSURL *dstURL = [temDirURL URLByAppendingPathComponent:fileURL.lastPathComponent];
+    // 将文件拷贝到新路径
+    [fileManager removeItemAtURL:dstURL error:&error];
+    [fileManager copyItemAtURL:fileURL toURL:dstURL error:&error];
+    // 返回新路径
+    return dstURL;
 }
 
 
+#pragma mark - getters and setters
+
+- (WKWebView *)webView {
+
+    if (_webView == nil)
+    {
+        _webView = [[WKWebView alloc] init];
+        _webView.backgroundColor = [UIColor whiteColor];
+    }
+    return _webView;
+}
+
 /*
 #pragma mark - Navigation
 

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 254 - 0
HappyWork/HappyWork/Class/LoginRegister/ViewController/用户注册协议.html


+ 1 - 1
HappyWork/HappyWork/Class/PersonalCenter/View/PersonalCenterHeaderCell.h

@@ -12,7 +12,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface PersonalCenterHeaderCell : UITableViewCell
 
-@property (nonatomic, strong) UIImageView *headerImageV;
+@property (nonatomic, strong) UIButton    *headerBtn;
 @property (nonatomic, strong) UILabel     *nameLabel;
 @property (nonatomic, strong) UILabel     *authLabel;
 @property (nonatomic, strong) UIButton    *setBtn;

+ 14 - 14
HappyWork/HappyWork/Class/PersonalCenter/View/PersonalCenterHeaderCell.m

@@ -32,28 +32,28 @@
 
 - (void)initSubViews {
     
-    [self.contentView addSubview:self.headerImageV];
+    [self.contentView addSubview:self.headerBtn];
     [self.contentView addSubview:self.setBtn];
     [self.contentView addSubview:self.nameLabel];
     [self.contentView addSubview:self.authLabel];
     
-    [self.headerImageV mas_makeConstraints:^(MASConstraintMaker *make) {
+    [self.headerBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        
         make.centerX.equalTo(self.contentView);
         make.top.equalTo(self.contentView.mas_top).offset(25);
         make.size.mas_equalTo(CGSizeMake(80, 80));
     }];
-    self.headerImageV.layer.cornerRadius = 40;
-    self.headerImageV.layer.masksToBounds = YES;
+    self.headerBtn.layer.cornerRadius = 40;
+    self.headerBtn.layer.masksToBounds = YES;
     [self.setBtn mas_makeConstraints:^(MASConstraintMaker *make) {
         
-        make.right.equalTo(self.headerImageV.mas_right).offset(0);
-        make.bottom.equalTo(self.headerImageV.mas_bottom).offset(0);
+        make.right.equalTo(self.headerBtn.mas_right).offset(0);
+        make.bottom.equalTo(self.headerBtn.mas_bottom).offset(0);
     }];
     
     [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
         make.centerX.equalTo(self.contentView);
-        make.top.equalTo(self.headerImageV.mas_bottom).offset(17);
+        make.top.equalTo(self.headerBtn.mas_bottom).offset(17);
     }];
     
     [self.authLabel mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -69,16 +69,16 @@
 
 #pragma mark - setter and getter
 
-- (UIImageView *)headerImageV {
+- (UIButton *)headerBtn {
     
-    if (_headerImageV == nil)
+    if (_headerBtn == nil)
     {
-        _headerImageV = [[UIImageView alloc]init];
-        _headerImageV.image = [UIImage imageNamed:@"personalCenter_icon"];
-        _headerImageV.contentMode = UIViewContentModeScaleAspectFill;
-        _headerImageV.clipsToBounds = YES;
+        _headerBtn = [UIButton buttonWithType:UIButtonTypeCustom];
+        [_headerBtn setBackgroundImage:[UIImage imageNamed:@"personalCenter_icon"] forState:UIControlStateNormal];
+        _headerBtn.imageView.contentMode = UIViewContentModeScaleAspectFill;
+        _headerBtn.imageView.clipsToBounds = YES;
     }
-    return _headerImageV;
+    return _headerBtn;
 }
 - (UIButton *)setBtn {
     

+ 27 - 0
HappyWork/HappyWork/Class/PersonalCenter/ViewController/PersonalCenterViewController.m

@@ -14,6 +14,7 @@
 #import "PaymentRecordViewController.h"//收款记录
 #import "TaxCertificateViewController.h"//完税证明
 #import "LoginRegisterViewController.h"
+#import "HWUpdateView.h"
 
 @interface PersonalCenterViewController ()
 <
@@ -82,6 +83,28 @@ HWConfirmPanelViewDelegate
         
         [HWProgressHUD fb_showFailureWithStatus:data];
     }];
+    //更新
+    self.viewModel.updateDataBlock = ^(NSDictionary * _Nonnull dataDict) {
+        
+        id isLatest = [dataDict valueForKeyPath:@"data.isLatest"];//[isLatest isKindOfClass:[NSNumber class]] &&
+       
+        if (![isLatest boolValue])
+        {
+            id isForceUpdate = [dataDict valueForKeyPath:@"data.hwVersion.isForceUpdate"];//1强制更新
+            id description = [dataDict valueForKeyPath:@"data.hwVersion.description"];
+            if ([isForceUpdate isKindOfClass:[NSNumber class]] && [description isKindOfClass:[NSString class]])
+            {
+                HWUpdateView *updateView =  [[HWUpdateView alloc]init];
+                updateView.update = [isForceUpdate boolValue];
+                NSAttributedString * attrStr = [[NSAttributedString alloc] initWithData:[description dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType } documentAttributes:nil error:nil];
+                updateView.detailLabel.attributedText = attrStr;
+            }
+        }
+        else
+        {
+            [HWProgressHUD fb_showInfoWithStatus:@"已是最新版本"];
+        }
+    };
     // 设置
     self.viewModel.setBlock = ^{
         
@@ -149,6 +172,10 @@ HWConfirmPanelViewDelegate
             [self.navigationController pushViewController:tax animated:YES];
         }
     }
+    if (indexPath.section == 3)
+    {
+        [self.viewModel appUpdateRequirement];
+    }
 }
 
 #pragma mark - HWConfirmPanelViewDelegate

+ 2 - 0
HappyWork/HappyWork/Class/PersonalCenter/ViewModel/PersonalCenterViewModel.h

@@ -14,9 +14,11 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (nonatomic, strong) NSDictionary *userDict;
 @property (nonatomic, copy)   void(^setBlock)(void);
+@property (nonatomic, copy) void(^updateDataBlock)(NSDictionary *dataDict);
 
 /* 请求用户数据 */
 - (void)requestPersonalCenterData;
+- (void)appUpdateRequirement;
 
 
 @end

+ 36 - 6
HappyWork/HappyWork/Class/PersonalCenter/ViewModel/PersonalCenterViewModel.m

@@ -28,6 +28,24 @@
     return self;
 }
 
+- (void)appUpdateRequirement {
+    
+    [HWAFHttpTool getRequestWithURLStr:check_Version params:@{@"version":BUNDLE_SHORTVERSION,@"app_system":@"1"} success:^(NSDictionary *responseDic) {
+        
+        if ([responseDic[@"errcode"] integerValue] == 0)
+        {
+            self.updateDataBlock(responseDic);
+        }
+        else
+        {
+            [HWProgressHUD fb_showFailureWithStatus:responseDic[@"errmsg"]];
+        }
+        
+    } failure:^(NSString *error) {
+        
+    }];
+    
+}
 - (void)requestPersonalCenterData{
     
     __weak typeof(self) weakSelf = self;
@@ -61,17 +79,23 @@
 
 - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
     
-    return 3;
+    return 4;
 }
 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
     
-    return section == 0 ? 1 : 2;
+    if (section == 0 || section == 3)
+    {
+        return 1;
+    }
+    else
+    {
+        return 2;
+    }
     
 }
 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
     
-    
-    
+
     if (indexPath.section == 0)
     {
         static  NSString *headerCell = @"headerCell";
@@ -81,11 +105,11 @@
             cell = [[PersonalCenterHeaderCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:headerCell];
         }
         [cell.setBtn addTarget:self action:@selector(setButtonClick:) forControlEvents:UIControlEventTouchUpInside];
-        
+        [cell.headerBtn addTarget:self action:@selector(setButtonClick:) forControlEvents:UIControlEventTouchUpInside];
         PersonalCenterModel *model = [PersonalCenterModel mj_objectWithKeyValues:self.userDict];
         
         cell.nameLabel.text = model.name;
-        [cell.headerImageV sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",model.avatar]] placeholderImage:[UIImage imageNamed:@"personalCenter_icon"]];
+        [cell.headerBtn sd_setBackgroundImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",model.avatar]] forState:(UIControlState)UIControlStateNormal placeholderImage:[UIImage imageNamed:@"personalCenter_icon"]];
         return cell;
     }
     else
@@ -106,6 +130,7 @@
             cell.leftImageV.image = [UIImage imageNamed:@"personalCenter_myorder"];
             cell.titleLabel.text = @"我的订单";
         }
+        
         if (indexPath.section == 2 && indexPath.row == 0)
         {
             cell.leftImageV.image = [UIImage imageNamed:@"personalCenter_paymentRecord"];
@@ -116,6 +141,11 @@
             cell.leftImageV.image = [UIImage imageNamed:@"personalCenter_tax"];
             cell.titleLabel.text = @"完税证明";
         }
+        if (indexPath.section == 3 && indexPath.row == 0)
+        {
+            cell.leftImageV.image = [UIImage imageNamed:@"app_update"];
+            cell.titleLabel.text = @"版本信息";
+        }
         return cell;
     }
 }

+ 3 - 3
HappyWork/HappyWork/Class/PersonalCenter/我的报名_signup/ViewModel/MySignUpViewModel.m

@@ -76,16 +76,16 @@
     cell.companyLabel.text = model.companyName;
     if ([model.hwRequirement.stage integerValue] == 0)
     {
-        cell.moneylabel.text = [NSString stringWithFormat:@"%@元*1次",model.hwRequirement.price];
+        cell.moneylabel.text = [NSString stringWithFormat:@"%@元*1次",[HWAppService reviseString:model.hwRequirement.price]];
     }
     else
     {
-        cell.moneylabel.text = [NSString stringWithFormat:@"%@元*%@期",model.hwRequirement.price,model.hwRequirement.stage];
+        cell.moneylabel.text = [NSString stringWithFormat:@"%@元*%@期",[HWAppService reviseString:model.hwRequirement.price],model.hwRequirement.stage];
     }
     cell.addressView.taglabel.text = model.hwRequirement.provinceCityCountry;
     
     NSMutableAttributedString *countAtt1 = [[NSMutableAttributedString alloc]initWithString:cell.moneylabel.text];
-       [countAtt1 addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:17] range:NSMakeRange(0, model.hwRequirement.price.length + 1)];
+       [countAtt1 addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:17] range:NSMakeRange(0, [HWAppService reviseString:model.hwRequirement.price].length + 1)];
     cell.moneylabel.attributedText = countAtt1;
     
     if ([model.hwRequirement.isOn integerValue] == 1)

+ 3 - 3
HappyWork/HappyWork/Class/PersonalCenter/我的订单_order/ViewModel/MyOrderViewModel.m

@@ -79,16 +79,16 @@
     cell.titleLabel.text = model.hwRequirement.name;
     if ([model.hwRequirement.stage integerValue] == 0)
     {
-        cell.moneyLabel.text = [NSString stringWithFormat:@"%@元*1次",model.hwRequirement.price];
+        cell.moneyLabel.text = [NSString stringWithFormat:@"%@元*1次",[HWAppService reviseString:model.hwRequirement.price]];
     }
     else
     {
-        cell.moneyLabel.text = [NSString stringWithFormat:@"%@元*%@期",model.hwRequirement.price,model.hwRequirement.stage];
+        cell.moneyLabel.text = [NSString stringWithFormat:@"%@元*%@期",[HWAppService reviseString:model.hwRequirement.price],model.hwRequirement.stage];
     }
     cell.addressView.taglabel.text = model.hwRequirement.provinceCityCountry;
     
     NSMutableAttributedString *countAtt1 = [[NSMutableAttributedString alloc]initWithString:cell.moneyLabel.text];
-          [countAtt1 addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:17] range:NSMakeRange(0, model.hwRequirement.price.length + 1)];
+          [countAtt1 addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:17] range:NSMakeRange(0, [HWAppService reviseString:model.hwRequirement.price].length + 1)];
     cell.moneyLabel.attributedText = countAtt1;
 
     cell.lookBtnBlock = ^{

+ 1 - 2
HappyWork/HappyWork/Custom/ProgressHUD/HWProgressHUD.m

@@ -27,12 +27,11 @@
 
 + (void)fb_showInfoWithStatus:(NSString *)status completion:(void (^ _Nullable)(void))completion {
     
-    
     [SVProgressHUD setCornerRadius:5];
     [SVProgressHUD setBorderColor:COLOR_BACK_31];
     [SVProgressHUD setDefaultStyle:SVProgressHUDStyleDark];
     [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeNone];
-    [SVProgressHUD setInfoImage:[UIImage imageNamed:@""]];
+    [SVProgressHUD setInfoImage:[UIImage imageNamed:@"1"]];
     [SVProgressHUD showInfoWithStatus:status];
     [SVProgressHUD dismissWithDelay:1.5 completion:completion];
     

+ 3 - 3
HappyWork/HappyWork/Info.plist

@@ -2,8 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
-	<key>UIUserInterfaceStyle</key>
-	<string>Light</string>
 	<key>CFBundleDevelopmentRegion</key>
 	<string>$(DEVELOPMENT_LANGUAGE)</string>
 	<key>CFBundleDisplayName</key>
@@ -21,7 +19,7 @@
 	<key>CFBundleShortVersionString</key>
 	<string>$(MARKETING_VERSION)</string>
 	<key>CFBundleVersion</key>
-	<string>1</string>
+	<string>$(CURRENT_PROJECT_VERSION)</string>
 	<key>LSRequiresIPhoneOS</key>
 	<true/>
 	<key>NSAppTransportSecurity</key>
@@ -52,5 +50,7 @@
 		<string>UIInterfaceOrientationLandscapeLeft</string>
 		<string>UIInterfaceOrientationLandscapeRight</string>
 	</array>
+	<key>UIUserInterfaceStyle</key>
+	<string>Light</string>
 </dict>
 </plist>

+ 4 - 0
HappyWork/HappyWork/Support/HWAPI.h

@@ -10,6 +10,10 @@
 #ifndef HWAPI_h
 #define HWAPI_h
 
+
+/*app版本管理*/
+#define check_Version [NSString stringWithFormat:@"%@/api/hwVersion/checkVersion",kHWBaseURL]
+
 /*获取验证码*/
 #define get_Code [NSString stringWithFormat:@"%@/api/hwuser/getAuthCode",kHWBaseURL]
 

+ 5 - 0
HappyWork/HappyWork/Support/HWAppService.h

@@ -51,6 +51,11 @@ typedef enum _TimeStampType {
  */
 +(NSString *)thousandSeparatorStringWithNumber:(NSString *)numberStr;
 
+/*
+ *小数位会出现很多00001的现象
+ */
++(NSString *)reviseString: (NSString *)str;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 17 - 0
HappyWork/HappyWork/Support/HWAppService.m

@@ -164,5 +164,22 @@
     }
 }
 
++(NSString *)reviseString: (NSString *)str
+
+{
+
+//直接传入精度丢失有问题的Double类型
+
+double conversionValue = [str doubleValue];
+
+NSString *doubleString = [NSString stringWithFormat:@"%lf", conversionValue];
+
+NSDecimalNumber *decNumber = [NSDecimalNumber decimalNumberWithString:doubleString];
+
+return [decNumber stringValue];
+
+}
+
+
 
 @end

+ 3 - 0
HappyWork/HappyWork/Support/HappyWork.pch

@@ -52,6 +52,9 @@
 #define NAVI_BACK_TITLE   UIBarButtonItem *barItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil];\
 self.navigationItem.backBarButtonItem = barItem;
 
+/* 获取当前版本号 */
+#define BUNDLE_SHORTVERSION [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]
+
 
 #define COLOR_BACK_31    [UIColor colorFromHexString:@"31364C"]