15555599100 6 سال پیش
والد
کامیت
3f9f30b7b8

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

@@ -105,6 +105,7 @@
 		71A3B0A1234DD372004D73A5 /* MySignUpModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 71A3B0A0234DD372004D73A5 /* MySignUpModel.m */; };
 		71A3B0A4234DD564004D73A5 /* MyOrderModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 71A3B0A3234DD564004D73A5 /* MyOrderModel.m */; };
 		71A3B0A7234DD9F0004D73A5 /* PaymentRecordModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 71A3B0A6234DD9F0004D73A5 /* PaymentRecordModel.m */; };
+		71F9190E2383C80600E964CC /* MyOrderWebECOViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71F9190D2383C80600E964CC /* MyOrderWebECOViewController.m */; };
 		71FA53D72330C6780007094A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 71FA53D62330C6780007094A /* AppDelegate.m */; };
 		71FA53DF2330C6780007094A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 71FA53DE2330C6780007094A /* Assets.xcassets */; };
 		71FA53E22330C6780007094A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 71FA53E02330C6780007094A /* LaunchScreen.storyboard */; };
@@ -326,6 +327,8 @@
 		71A3B0A3234DD564004D73A5 /* MyOrderModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MyOrderModel.m; sourceTree = "<group>"; };
 		71A3B0A5234DD9F0004D73A5 /* PaymentRecordModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PaymentRecordModel.h; sourceTree = "<group>"; };
 		71A3B0A6234DD9F0004D73A5 /* PaymentRecordModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PaymentRecordModel.m; sourceTree = "<group>"; };
+		71F9190C2383C80600E964CC /* MyOrderWebECOViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyOrderWebECOViewController.h; sourceTree = "<group>"; };
+		71F9190D2383C80600E964CC /* MyOrderWebECOViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MyOrderWebECOViewController.m; sourceTree = "<group>"; };
 		71FA53D22330C6780007094A /* HappyWork.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HappyWork.app; sourceTree = BUILT_PRODUCTS_DIR; };
 		71FA53D52330C6780007094A /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
 		71FA53D62330C6780007094A /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
@@ -798,6 +801,8 @@
 				71A3B09C234DC6B7004D73A5 /* MyOrderDetailViewController.m */,
 				7133D5D723500B1A009BCCC1 /* MyOrderWebViewController.h */,
 				7133D5D823500B1A009BCCC1 /* MyOrderWebViewController.m */,
+				71F9190C2383C80600E964CC /* MyOrderWebECOViewController.h */,
+				71F9190D2383C80600E964CC /* MyOrderWebECOViewController.m */,
 			);
 			path = ViewController;
 			sourceTree = "<group>";
@@ -1526,6 +1531,7 @@
 				713829022339E964007256F4 /* ValuePickerView.m in Sources */,
 				71FA53E52330C6780007094A /* main.m in Sources */,
 				712AF6FA2333124400EBD542 /* UIColor+Palette.m in Sources */,
+				71F9190E2383C80600E964CC /* MyOrderWebECOViewController.m in Sources */,
 				71FA53D72330C6780007094A /* AppDelegate.m in Sources */,
 				713828E82339BF5A007256F4 /* DemanHallViewModel.m in Sources */,
 				712AF7412334550B00EBD542 /* DemanHallPriceView.m in Sources */,
@@ -1707,7 +1713,7 @@
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 4;
+				CURRENT_PROJECT_VERSION = 5;
 				DEVELOPMENT_TEAM = 6TLH64Q4Z4;
 				GCC_PREFIX_HEADER = "$(SRCROOT)/HappyWork/Support/HappyWork.pch";
 				INFOPLIST_FILE = HappyWork/Info.plist;
@@ -1729,7 +1735,7 @@
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 4;
+				CURRENT_PROJECT_VERSION = 5;
 				DEVELOPMENT_TEAM = 6TLH64Q4Z4;
 				GCC_PREFIX_HEADER = "$(SRCROOT)/HappyWork/Support/HappyWork.pch";
 				INFOPLIST_FILE = HappyWork/Info.plist;

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


+ 3 - 0
HappyWork/HappyWork/API/AFHttpTool/HWAFHttpTool.h

@@ -53,5 +53,8 @@
  *
  */
 + (void)postRequestWithURLStr:(NSString *)urlStr params:(NSDictionary *)params ImageDataArray:(NSMutableArray *)imageArray IsSingleImg:(BOOL)isSingle success:(void (^)(NSDictionary * responseDic))success failure:(void(^)(NSString* error))failure;
+
 + (void)uploadImage:(UIImage *)successImage URL:(NSString *)URLString parameters:(id)parameters success:(void (^)(id responseDic))complete;
+
+
 @end

+ 1 - 1
HappyWork/HappyWork/Base/PageListViewController.m

@@ -70,7 +70,7 @@
     
     [self.parametersDict setValue:[HWAppUserProfile sharedInstance].userId forKey:@"user_id"];
     [self.parametersDict setValue:[HWAppUserProfile sharedInstance].oauthToken forKey:@"user_token"];
-    [self.parametersDict setValue:[HWAppUserProfile sharedInstance].enterpriseId forKey:@"platform_company_id"];
+    [self.parametersDict setValue:[HWAppUserProfile sharedInstance].enterpriseId forKey:@"platform_id"];
     [self.parametersDict setValue:@(self.currentPage) forKey:@"pageNo"];
     [self.parametersDict setValue:@(10) forKey:@"pageSize"];
 

+ 0 - 4
HappyWork/HappyWork/Class/DemandHall/ViewController/DemanHallViewController.m

@@ -238,10 +238,6 @@ DemanHallMenuFilterViewDelegate
     PersonalCenterViewController *vc = [[PersonalCenterViewController alloc]init];
     [self.navigationController pushViewController:vc animated:YES];
 }
-- (void)updateDoneButtonClick:(UIButton *)btn {
-    
-    
-}
 
 #pragma mark - setter and getter
 

+ 1 - 1
HappyWork/HappyWork/Class/LoginRegister/ViewController/LoginRegisterViewController.m

@@ -86,7 +86,7 @@
                 [[HWAppUserProfile sharedInstance] setOauthToken:responseDic[@"data"][@"userInfo"][@"userToken"]];
                 [[HWAppUserProfile sharedInstance] setUserName:responseDic[@"data"][@"userInfo"][@"name"]];
                 [[HWAppUserProfile sharedInstance] setUserId:responseDic[@"data"][@"userInfo"][@"id"]];
-                [[HWAppUserProfile sharedInstance] setEnterpriseId:responseDic[@"data"][@"userInfo"][@"platformCompanyId"]];
+                [[HWAppUserProfile sharedInstance] setEnterpriseId:responseDic[@"data"][@"userInfo"][@"platformId"]];
                 [[HWAppUserProfile sharedInstance] save];
                 DemanHallViewController *demanHall = [[DemanHallViewController alloc]init];
                 [self.navigationController pushViewController:demanHall animated:YES];

+ 9 - 0
HappyWork/HappyWork/Class/PersonalCenter/我的订单_order/ViewController/MyOrderViewController.m

@@ -10,6 +10,7 @@
 #import "MyOrderViewModel.h"
 #import "MyOrderDetailViewController.h"
 #import "MyOrderWebViewController.h"
+#import "MyOrderWebECOViewController.h"
 
 @interface MyOrderViewController ()<UITableViewDelegate,MyOrderViewModelDelegate>
 
@@ -85,12 +86,20 @@
     [self.navigationController pushViewController:web animated:YES];
     
 }
+/* 确认订单 */
 - (void)makeSureOrderIndexPath:(NSIndexPath *)indexpath andMyOrderViewModel:(MyOrderViewModel *)viewModel {
     
     NSIndexPath *indexPath=[NSIndexPath indexPathForRow:indexpath.row inSection:0];
     [self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath,nil] withRowAnimation:UITableViewRowAnimationNone];
     
 }
+/* 电子合同 */
+- (void)makeconfirmECOrdersURL:(NSString *)url andMyOrderViewModel:(MyOrderViewModel *)viewModel {
+    
+    MyOrderWebECOViewController *web = [[MyOrderWebECOViewController alloc]init];
+    web.webUrl = url;
+    [self.navigationController pushViewController:web animated:YES];
+}
 
 #pragma mark - private metnod
 /* 处理请求结果*/

+ 19 - 0
HappyWork/HappyWork/Class/PersonalCenter/我的订单_order/ViewController/MyOrderWebECOViewController.h

@@ -0,0 +1,19 @@
+//
+//  MyOrderWebECOViewController.h
+//  HappyWork
+//
+//  Created by 张晓光 on 2019/11/19.
+//  Copyright © 2019 张晓光. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface MyOrderWebECOViewController : UIViewController
+
+@property (nonatomic, copy) NSString *webUrl;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 70 - 0
HappyWork/HappyWork/Class/PersonalCenter/我的订单_order/ViewController/MyOrderWebECOViewController.m

@@ -0,0 +1,70 @@
+//
+//  MyOrderWebECOViewController.m
+//  HappyWork
+//
+//  Created by 张晓光 on 2019/11/19.
+//  Copyright © 2019 张晓光. All rights reserved.
+//
+
+#import "MyOrderWebECOViewController.h"
+#import <JavaScriptCore/JavaScriptCore.h>
+
+@interface MyOrderWebECOViewController ()<UIWebViewDelegate>
+
+@property (nonatomic, strong) UIWebView *webView;
+@property(nonatomic,strong)  JSContext *context;
+
+@end
+
+@implementation MyOrderWebECOViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    
+    self.navigationItem.title = @"电子合同";
+    self.webView  = [[UIWebView alloc]init];
+    [self.view addSubview:self.webView];
+    self.webView.delegate = self;
+    [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]]]];
+        
+}
+
+#pragma mark webView 代理
+
+- (void)webViewDidFinishLoad:(UIWebView *)webView{
+
+      self.context = [webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+    
+}
+
+// 网页中的每一个请求都会被触发这个方法,返回NO代表不执行这个请求(常用于JS与iOS之间通讯)
+-(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
+{
+    NSURL *requestURL = [request URL];
+    NSLog(@"=1%@",requestURL);
+    NSLog(@"=2%@",[requestURL scheme]);//得到协议的名称http
+    NSLog(@"===3%@",[[request URL] absoluteString]);//得到整个url
+        
+    NSString *absoluteString = [[request URL] absoluteString];
+   
+    NSLog(@":::::4%@",absoluteString);
+    
+    return YES;
+}
+
+/*
+#pragma mark - Navigation
+
+// In a storyboard-based application, you will often want to do a little preparation before navigation
+- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
+    // Get the new view controller using [segue destinationViewController].
+    // Pass the selected object to the new view controller.
+}
+*/
+
+@end

+ 2 - 0
HappyWork/HappyWork/Class/PersonalCenter/我的订单_order/ViewController/MyOrderWebViewController.m

@@ -25,6 +25,7 @@
     self.webView  = [[WKWebView alloc]init];
 //    NSLog(@":::::%@",self.webUrl);
     [self.view addSubview:self.webView];
+    
     [self.webView mas_makeConstraints:^(MASConstraintMaker *make) {
        
         make.left.right.top.bottom.equalTo(self.view).offset(0);
@@ -32,6 +33,7 @@
      [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",self.webUrl]]]];
 }
 
+
 /*
 #pragma mark - Navigation
 

+ 2 - 0
HappyWork/HappyWork/Class/PersonalCenter/我的订单_order/ViewModel/MyOrderViewModel.h

@@ -16,6 +16,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 - (void)contractIndexPath:(NSInteger )index;
 - (void)makeSureOrderIndexPath:(NSIndexPath *)indexpath andMyOrderViewModel:(MyOrderViewModel *)viewModel;
+- (void)makeconfirmECOrdersURL:(NSString *)url andMyOrderViewModel:(MyOrderViewModel *)viewModel;
+
 
 @end
 @interface MyOrderViewModel : PageBaseViewModel<UITableViewDataSource>

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

@@ -98,7 +98,15 @@
     
     cell.makeSureBtnBlock = ^{
         
-        [self makeSureOrderIndexpath:indexPath];
+        if ([model.contractType integerValue] == 2)
+        {
+            [self makeconfirmECOrdersIndexpath:indexPath];
+        }
+        else
+        {
+            [self makeSureOrderIndexpath:indexPath];
+        }
+        
     };
     
     if ([model.status integerValue] == 0)
@@ -163,7 +171,7 @@
 }
 
 #pragma mark - event response
-
+//确认订单
 - (void)makeSureOrderIndexpath:(NSIndexPath *)indexPath {
     
     [HWProgressHUD fb_showLoading];
@@ -199,5 +207,27 @@
     }];
     
 }
-
+- (void)makeconfirmECOrdersIndexpath:(NSIndexPath *)indexPath {
+    
+    [HWProgressHUD fb_showLoading];
+    [HWAFHttpTool postJSONRequestWithURLStr:confirmECOrders params:@{@"user_id":[HWAppUserProfile sharedInstance].userId,@"user_token":[HWAppUserProfile sharedInstance].oauthToken,@"orderId":self.listArray[indexPath.row][@"id"]} success:^(NSDictionary *responseDic) {
+        
+        [HWProgressHUD fb_dismiss];
+        if ([responseDic[@"errcode"] integerValue] == 0)
+        {
+            //https://t-test.fadada.com/aQina1XOh
+            [self.delegate makeconfirmECOrdersURL:responseDic[@"data"][@"url"] andMyOrderViewModel:self];
+//            [self.delegate makeconfirmECOrdersURL:@"https://t-test.fadada.com/aQina1XOh" andMyOrderViewModel:self];
+        }
+        else
+        {
+            [HWProgressHUD fb_showFailureWithStatus:responseDic[@"errmsg"]];
+        }
+        
+    } failure:^(NSString *error) {
+        
+        [HWProgressHUD fb_dismiss];
+        [HWProgressHUD fb_showFailureWithStatus:error];
+    }];
+}
 @end

+ 1 - 1
HappyWork/HappyWork/Info.plist

@@ -3,7 +3,7 @@
 <plist version="1.0">
 <dict>
 	<key>CFBundleDevelopmentRegion</key>
-	<string>$(DEVELOPMENT_LANGUAGE)</string>
+	<string>zh_CN</string>
 	<key>CFBundleDisplayName</key>
 	<string>开心灵工</string>
 	<key>CFBundleExecutable</key>

+ 2 - 2
HappyWork/HappyWork/Support/HWAPI.h

@@ -10,7 +10,6 @@
 #ifndef HWAPI_h
 #define HWAPI_h
 
-
 /*app版本管理*/
 #define check_Version [NSString stringWithFormat:@"%@/api/hwVersion/checkVersion",kHWBaseURL]
 
@@ -56,7 +55,8 @@
 /* 首页banner图 */
 #define banner [NSString stringWithFormat:@"%@/api/hwUser/banner",kHWBaseURL]
 
-
+/* 确认订单电子合同 */
+#define confirmECOrders [NSString stringWithFormat:@"%@/api/hwOrder/confirmECOrders",kHWBaseURL]
 
 
 #endif /* HWAPI_h */

+ 1 - 1
HappyWork/HappyWork/Support/HWAppUserProfile.m

@@ -16,7 +16,7 @@ HWAppUserProfile *g_userProfile = nil;
 /* 获得路径 */
 + (NSString *)localFilePathName;
 
-@end
+ @end
 
 @implementation HWAppUserProfile
 

+ 4 - 4
HappyWork/HappyWork/Support/HWConfig.h

@@ -10,12 +10,12 @@
 #ifndef HWConfig_h
 #define HWConfig_h
 
-/** ******* 测试服接口地址 *************/
-//static NSString * const kHWBaseURL = @"https://hw.hap-job.com/happy-boot";
+/*---------- 测试服接口地址 ---------*/
+static NSString * const kHWBaseURL = @"https://hw.hap-job.com/happy-boot";
 
 
-/** ******* 正试服接口地址 *******/
+/*--------- 正试服接口地址 ---------*/
 
-static NSString * const kHWBaseURL = @"https://www.dal-pay.com/happy-boot";
+//static NSString * const kHWBaseURL = @"https://www.dal-pay.com/happy-boot";
 
 #endif /* HWConfig_h */