liuzhenxing1118 2 months ago
parent
commit
559acec11a

+ 2 - 2
ChineseMedicine/ChineseMedicineSDK/Controller/BaseViewController.m

@@ -75,7 +75,7 @@
         [self showVipInfoAlert];
     } else {
         DetectionViewController *controller = [SK_STORYBOARD instantiateViewControllerWithIdentifier:@"DetectionVC"];
-        controller.needDrunkJudgment = @"0";
+        controller.needDrunkJudgment = NO;
         [self.navigationController pushViewController:controller animated:YES];
     }
 }
@@ -91,7 +91,7 @@
         [self showVipInfoAlert];
     } else {
         DetectionViewController *controller = [SK_STORYBOARD instantiateViewControllerWithIdentifier:@"DetectionVC"];
-        controller.needDrunkJudgment = @"1";
+        controller.needDrunkJudgment = YES;
         [self.navigationController pushViewController:controller animated:YES];
     }
 }

+ 1 - 1
ChineseMedicine/ChineseMedicineSDK/Controller/DetectionViewController.h

@@ -11,7 +11,7 @@
 NS_ASSUME_NONNULL_BEGIN
 
 @interface DetectionViewController : BaseViewController
-@property(nonatomic, copy) NSString* needDrunkJudgment;
+@property(nonatomic, assign) BOOL needDrunkJudgment;
 @end
 
 NS_ASSUME_NONNULL_END

+ 3 - 2
ChineseMedicine/ChineseMedicineSDK/Controller/DetectionViewController.m

@@ -291,12 +291,13 @@
         @"posture" : @(2), //默认2 2:坐姿 3:站姿 4:躺姿
         @"spo" : _mSpoValue > -1 ? @(_mSpoValue) : @([TestDataManager getSpo]),
         @"data" : datas,
-        @"needDrunkJudgment" : self.needDrunkJudgment,
+        @"needDrunkJudgment" : self.needDrunkJudgment ? @"1" : @"0",
     };
     
     [MBProgressHUD showHUDAddedTo:self.view animated:YES];
     __weak __typeof(self) weak_self = self;
-    [ERequest httpRequest:param httpURL:POST_SUBMIT_PULSE_URL httpMethod:@"POST" onSuccess:^(NSDictionary *result) {
+    NSString* httpURL = self.needDrunkJudgment ? POST_SUBMIT_REPORT_DRANK_URL : POST_SUBMIT_REPORT_URL;
+    [ERequest httpRequest:param httpURL:httpURL httpMethod:@"POST" onSuccess:^(NSDictionary *result) {
         [MBProgressHUD hideHUDForView:weak_self.view animated:YES];
         if ([ERequest isSuccessWithResult:result]) {
             [weak_self changeCircleProgress:100];

+ 1 - 1
ChineseMedicine/ChineseMedicineSDK/Request/ERequestList.m

@@ -88,7 +88,7 @@
 {
     NSArray* info = [ServerManager getHttpDomains];
     NSString* url = [NSString stringWithFormat:@"%@%@", info[0], info[1]];
-    return URL_BASE_ACTION(url, POST_SUBMIT_PULSE_URL);
+    return URL_BASE_ACTION(url, POST_SUBMIT_REPORT_URL);
 }
 @end
 

+ 29 - 28
ChineseMedicine/ChineseMedicineSDK/SKValue.h

@@ -20,41 +20,42 @@
 
 
 //接口
-#define POST_LOGIN_INFO_URL         @"/account/api/v1/entry/login/temporary"
-#define POST_SUBMIT_PULSE_URL       @"/healthy/api/v1/submit/report"
-#define POST_QUESTION_URL           @"/healthy/api/v1/inquiry/submit/pulse"
-#define POST_REPORT_URL             @"/healthy/api/v1/get/report"     //通过id,获取报告内容
-#define POST_REPORT_RANGE_URL       @"/healthy/api/v1/statis/report"  //一段时间内数据
-#define POST_LAEST_DETECTION_URL    @"/healthy/api/v1/get/recent/report"
-
-#define POST_VIP_PRICE_URL          @"/trade/api/v1/product/support"
-#define POST_VIP_TRIAL_URL          @"/trade/api/v1/product/activity"
-#define POST_PAYINFO_URL            @"/trade/api/v1/payment/qualification"
-#define POST_PAY_RESULT_URL         @"/trade/api/v1/payment/record"
-#define POST_WEBPAY_URL             @"/trade/api/v1/alipay/htm/payment"
-#define POST_ALIPAY_URL             @"/trade/api/v1/alipay/pay"
-#define POST_WXPAY_URL              @"/trade/api/v1/wxpay/pay"
+#define POST_LOGIN_INFO_URL             @"/account/api/v1/entry/login/temporary"
+#define POST_SUBMIT_REPORT_URL          @"/healthy/api/v1/submit/report"
+#define POST_SUBMIT_REPORT_DRANK_URL    @"/healthy/api/v1//submit/drinkReport"
+#define POST_QUESTION_URL               @"/healthy/api/v1/inquiry/submit/pulse"
+#define POST_REPORT_URL                 @"/healthy/api/v1/get/report"     //通过id,获取报告内容
+#define POST_REPORT_RANGE_URL           @"/healthy/api/v1/statis/report"  //一段时间内数据
+#define POST_LAEST_DETECTION_URL        @"/healthy/api/v1/get/recent/report"
+
+#define POST_VIP_PRICE_URL              @"/trade/api/v1/product/support"
+#define POST_VIP_TRIAL_URL              @"/trade/api/v1/product/activity"
+#define POST_PAYINFO_URL                @"/trade/api/v1/payment/qualification"
+#define POST_PAY_RESULT_URL             @"/trade/api/v1/payment/record"
+#define POST_WEBPAY_URL                 @"/trade/api/v1/alipay/htm/payment"
+#define POST_ALIPAY_URL                 @"/trade/api/v1/alipay/pay"
+#define POST_WXPAY_URL                  @"/trade/api/v1/wxpay/pay"
 
 
 //key
-#define PAY_WX_APPID                @"wxc501f69c23c0a923"
-#define PAY_WX_UNIVERSALLINK        @"https://sikey/"
+#define PAY_WX_APPID                    @"wxc501f69c23c0a923"
+#define PAY_WX_UNIVERSALLINK            @"https://sikey/"
 
-#define KEY_USERID                  @"userId"
-#define KEY_DATA                    @"data"
-#define KEY_MESSAGE                 @"message"
-#define KEY_REPORTID                @"reportId"
-#define KEY_QUESTION                @"questions"
-#define KEY_HAS_QUESTION            @"hasQuestion"
+#define KEY_USERID                      @"userId"
+#define KEY_DATA                        @"data"
+#define KEY_MESSAGE                     @"message"
+#define KEY_REPORTID                    @"reportId"
+#define KEY_QUESTION                    @"questions"
+#define KEY_HAS_QUESTION                @"hasQuestion"
 
 
 //检测
-#define PPG_TIME                    60
-#define PPG_TIME_OUT                PPG_TIME + 5 //延迟10秒,保证检测数据足够
-#define PPG_DATA_COUNT_MAX          PPG_TIME * 100 * 8 //检测一分钟大概48000个数据
-#define PPG_PRECENT_MAX             55.0f //ppg检测百分比
-#define SPO_TIME_OUT                90.0f - PPG_PRECENT_MAX //血氧检测时间
-#define LOAD_PAGE_SIZE              20
+#define PPG_TIME                        60
+#define PPG_TIME_OUT                    PPG_TIME + 5 //延迟10秒,保证检测数据足够
+#define PPG_DATA_COUNT_MAX              PPG_TIME * 100 * 8 //检测一分钟大概48000个数据
+#define PPG_PRECENT_MAX                 55.0f //ppg检测百分比
+#define SPO_TIME_OUT                    90.0f - PPG_PRECENT_MAX //血氧检测时间
+#define LOAD_PAGE_SIZE                  20
 
 #define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width
 #define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height