Commit 0441bb0f by 刘卓鑫

最新需求 1.订单推送 2.订单模式和系扣切换。。。

parent cd6c1a70
...@@ -86,9 +86,6 @@ ...@@ -86,9 +86,6 @@
[userDefaults setObject:@"http://192.168.1.173:9091" forKey:@"BOOK"]; [userDefaults setObject:@"http://192.168.1.173:9091" forKey:@"BOOK"];
[userDefaults setObject:@"http://ex-dev-dcxy-customer-app.168cad.top" forKey:@"NEW_PAY"]; [userDefaults setObject:@"http://ex-dev-dcxy-customer-app.168cad.top" forKey:@"NEW_PAY"];
// [userDefaults setObject:@"http://192.168.1.102:8000" forKey:@"NEW_PAY"]; // [userDefaults setObject:@"http://192.168.1.102:8000" forKey:@"NEW_PAY"];
[userDefaults setObject:@"http://ex-dev-dcxy-base-app.168cad.top" forKey:@"SX_MONEY"]; //授信保证金 [userDefaults setObject:@"http://ex-dev-dcxy-base-app.168cad.top" forKey:@"SX_MONEY"]; //授信保证金
[userDefaults setValue:@"http://121.15.180.66:801/netpayment/BaseHttp.dll?MB_EUserPay" forKey:@"YWT_PAY"]; [userDefaults setValue:@"http://121.15.180.66:801/netpayment/BaseHttp.dll?MB_EUserPay" forKey:@"YWT_PAY"];
[userDefaults synchronize]; [userDefaults synchronize];
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#import "AppDelegate.h" #import "AppDelegate.h"
#import "AppDelegate+Extension.h" #import "AppDelegate+Extension.h"
#import "ZXOrderPayController.h"
#import "LoginView.h" #import "LoginView.h"
#import "MyTabViewController.h" #import "MyTabViewController.h"
#import "XMGNavigationViewController.h" #import "XMGNavigationViewController.h"
...@@ -18,6 +19,7 @@ ...@@ -18,6 +19,7 @@
#import "XMGFileTool.h" #import "XMGFileTool.h"
#import "LoginJump.h" #import "LoginJump.h"
#import "FTUploader.h" #import "FTUploader.h"
#import "ZXNewOrderDetailViewController.h"
#import <AFNetworkReachabilityManager.h> #import <AFNetworkReachabilityManager.h>
// 引入JPush功能所需头文件 // 引入JPush功能所需头文件
#import "JPUSHService.h" #import "JPUSHService.h"
...@@ -351,7 +353,7 @@ ...@@ -351,7 +353,7 @@
handleActionWithIdentifier:(NSString *)identifier handleActionWithIdentifier:(NSString *)identifier
forRemoteNotification:(NSDictionary *)userInfo forRemoteNotification:(NSDictionary *)userInfo
completionHandler:(void (^)())completionHandler { completionHandler:(void (^)())completionHandler {
//MARK:点击通知触发的动作
} }
- (void)application:(UIApplication *)application - (void)application:(UIApplication *)application
didReceiveRemoteNotification:(NSDictionary *)userInfo didReceiveRemoteNotification:(NSDictionary *)userInfo
...@@ -428,23 +430,49 @@ fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler { ...@@ -428,23 +430,49 @@ fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
self.notifyDic=userInfo; self.notifyDic=userInfo;
} }
//跳转到指定界面; //跳转到指定界面;
[self goToMssageViewControllerWith:userInfo]; [self jumpNotPayView:userInfo];
} }
else { else {
// 判断为本地通知 // 判断为本地通知
NSLog(@"iOS10 收到本地通知:{\nbody:%@,\ntitle:%@,\nsubtitle:%@,\nbadge:%@,\nsound:%@,\nuserInfo:%@\n}",body,title,subtitle,badge,sound,userInfo); NSLog(@"iOS10 收到本地通知:{\nbody:%@,\ntitle:%@,\nsubtitle:%@,\nbadge:%@,\nsound:%@,\nuserInfo:%@\n}",body,title,subtitle,badge,sound,userInfo);
} }
completionHandler(); // 系统要求执行这个方法 completionHandler(); // 系统要求执行这个方法
} }
#pragma mark 通过通知跳转到指定界面; #pragma mark - 点击推送 跳转未支付订单
- (void)goToMssageViewControllerWith:(NSDictionary*)msgDic{ - (void) jumpNotPayView:(NSDictionary *) userInfo {
if ([userInfo[@"CODE"] integerValue] == 997) {
//请求未支付订单数据
NSString *url = [NSString stringWithFormat:@"%@/consumeOrder/getUnpaidOrder?customerId=%@", [kUserDefaults objectForKey:@"NEW_PAY"], CacheUserId];
[XMCenter sendRequest:^(XMRequest *request) {
request.url = [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
request.httpMethod = kXMHTTPMethodGET;
request.headers = @{@"token": CacheToken,@"reqSource":@"app", @"Content-Type":@"application/json"};
} onSuccess:^(id responseObject) {
if ([responseObject[@"code"] integerValue] == 1000) {
dispatch_async(dispatch_get_main_queue(), ^{
id order = responseObject[@"orderId"];
if (![order isKindOfClass:[NSNull class]]) {
ZXOrderPayController *jumpPay = [[ZXOrderPayController alloc] init];
NSInteger orderId = [responseObject[@"orderId"] integerValue];
jumpPay.orderId = orderId;
[ZXPayManager sharedZXPayManager].orderId = orderId;
[[ZXTool getCurrentVC].navigationController pushViewController:jumpPay animated:YES];
} else {
ZXNewOrderDetailViewController *orderDetail = [[ZXNewOrderDetailViewController alloc] init];
orderDetail.orderId = [userInfo[@"orderInfo"] integerValue];
[[ZXTool getCurrentVC].navigationController pushViewController:orderDetail animated:YES];
}
});
}
} onFailure:^(NSError *error) {
} onFinished:^(id responseObject, NSError *error) {
}];
}
} }
//#pragma mark - ========== 版本检测 ========== //#pragma mark - ========== 版本检测 ==========
//-(void)checkVersion{ //-(void)checkVersion{
// self.updateModel = [[UpdateVersionModel alloc] init]; // self.updateModel = [[UpdateVersionModel alloc] init];
......
// //
...@@ -533,7 +533,7 @@ static NSInteger seq = 0; ...@@ -533,7 +533,7 @@ static NSInteger seq = 0;
//当没得校区的时候就判定为个人信息没有完善 //当没得校区的时候就判定为个人信息没有完善
NSLog(@"====%@",CacheCampusId); NSLog(@"====%@",CacheCampusId);
if ([CacheCampusId isEqualToString:@""]){ if ([CacheCampusId isEqualToString:@""] || [CacheCampusId isEqualToString:@"0"]){
_infoView = [[PerfectInformation alloc]initWithFrame:CGRectMake(0, 0, kWidth, kHeight)]; _infoView = [[PerfectInformation alloc]initWithFrame:CGRectMake(0, 0, kWidth, kHeight)];
@weakify(self); @weakify(self);
......
// //
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#import "AnnouncementView.h" #import "AnnouncementView.h"
@interface AnnouncementView()<WKScriptMessageHandler>{ @interface AnnouncementView()<UIScrollViewDelegate>{
BOOL jugeAgreed; BOOL jugeAgreed;
} }
...@@ -21,152 +21,19 @@ ...@@ -21,152 +21,19 @@
WKWebViewConfiguration *config = [WKWebViewConfiguration new]; WKWebViewConfiguration *config = [WKWebViewConfiguration new];
_webView = [[WKWebView alloc]initWithFrame:CGRectMake(0,0,kWidth-20, kHeight-2*87) configuration:config]; _webView = [[WKWebView alloc]initWithFrame:CGRectMake(0,0,kWidth-20, kHeight-2*87) configuration:config];
_webView.scrollView.delegate = self;
} }
return _webView; return _webView;
} }
#pragma mark - ========== 注册方法列表 ========== #pragma mark - scrollView协议
- (NSArray *)indentifierList { -(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
if (!_indentifierList) { {
_indentifierList = @[@"backToTheHomePageH5ToAPPNative",//返回
@"scanH5ToAPPNative",//打开扫一扫
@"newPageH5ToAPPNative",//打开新页面
@"onLoadingInitViewH5ToAPPnative",//预加载
@"closeWindowsH5ToAPPNative",//关闭页面
@"writeDataH5ToAPPNative",//存储数据
@"readDataH5ToAPPNative",//读数据
@"removeDataH5ToAPPnative",//删除键值对数据
@"removeLazyInitViewH5ToAPPNative",//删除某页面的缓存数据
@"showProgressDialogH5ToAPPNative",//打开加载框
@"closeProgressDialogH5ToAPPNative",//关闭加载框
@"showDialogH5ToAPPNative",//显示提示信息
@"doWXPayH5ToAPPNative",//微信支付
@"doAlipayH5ToAPPNative",//支付宝支付
@"showToastH5ToAPPNative",//弹出提示信息
@"closeAllWindowsH5ToAPPNative",//关闭除首页外的所有窗口
@"getUserInfoH5ToAPPNative",//获取用户信息
@"setGenerateQrCodesH5ToAPPNative",//二维码
@"showYesNoDialogH5ToAPPNative",//确认选择弹窗
@"getCachePageH5ToAPPNative", //banner外联
@"registerDeviceServiceEvent",//呼起原生快捷操作
@"setHighlightH5ToAPPNative",//屏幕高亮
@"ExitLogin",//退出登录
@"setCameraCutting",//裁剪图片
@"doJDPayH5ToAPPNative",//京东支付
];
}
return _indentifierList;
}
#pragma mark - ==========JS 调用 OC ==========
- (void)ba_JS_OC {
for (NSString *str in self.indentifierList) {
[self.webView.configuration.userContentController addScriptMessageHandler:self name:str];
}
}
- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message {
if ([message.name isEqualToString:self.indentifierList[0]]) {
} else if ([message.name isEqualToString:self.indentifierList[1]]) {
} else if ([message.name isEqualToString:self.indentifierList[2]]) {
} else if ([message.name isEqualToString:self.indentifierList[3]]) {
} else if ([message.name isEqualToString:self.indentifierList[4]]) {
} else if ([message.name isEqualToString:self.indentifierList[5]]) {
/*准备写入数据*/
//注意callBackPage0001 对商品应详情页
[ZXTool saveValue:[message.body lastObject] fromKey:[message.body firstObject]];
} else if ([message.name isEqualToString:self.indentifierList[6]]) {
/*准备读取数据*/
NSString *str = [ZXTool getValueFromKey:[message.body firstObject]];
[self.webView evaluateJavaScript:[NSString stringWithFormat:@"%@('%@')", [message.body lastObject], str] completionHandler:^(id _Nullable result, NSError * _Nullable error) {
}];
} else if ([message.name isEqualToString:self.indentifierList[7]]) {
/*删除键值对数据*/
[ZXTool removeValueFromKey:message.body];
} else if ([message.name isEqualToString:self.indentifierList[8]]) {
} else if ([message.name isEqualToString:self.indentifierList[9]]) {
/*打开加载框*/
[ZXTool showLoadingAnimation];
} else if ([message.name isEqualToString:self.indentifierList[10]]) {
/*关闭加载框*/
[ZXTool hideLoadingAnimation];
} else if ([message.name isEqualToString:self.indentifierList[11]]) {
/*显示提示信息*/
if ([message.body isKindOfClass:[NSArray class]]) {
[ZXTool showAlertText:[message.body lastObject]];
} else {
[ZXTool showAlertText:message.body];
}
} else if ([message.name isEqualToString:self.indentifierList[12]]) {
} else if ([message.name isEqualToString:self.indentifierList[13]]) {
} else if ([message.name isEqualToString:self.indentifierList[14]]) {
/*显示提示信息*/
if ([message.body isKindOfClass:[NSArray class]]) {
[ZXTool showText:[message.body lastObject]];
} else {
[ZXTool showText:message.body];
}
} else if ([message.name isEqualToString:self.indentifierList[15]]) {
} else if ([message.name isEqualToString:self.indentifierList[16]]) {
/*获取用户信息*/
NSString *str = [ZXTool returnUserInfo];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self.webView evaluateJavaScript:[NSString stringWithFormat:@"%@('%@')", message.body, str] completionHandler:^(id _Nullable result, NSError * _Nullable error) {
NSLog(@"%@", error?error:@"成功");;
}];
});
} else if ([message.name isEqualToString:self.indentifierList[17]]) {
} else if ([message.name isEqualToString:self.indentifierList[18]]) {
} else if ([message.name isEqualToString:self.indentifierList[19]]) {
} else if ([message.name isEqualToString:self.indentifierList[20]]) {
/*呼起原生快捷操作*/
} else if ([message.name isEqualToString:self.indentifierList[21]]) {
} else if ([message.name isEqualToString:self.indentifierList[22]]) {
/*退出登录*/
[self exitLogin:message.body];
} else if ([message.name isEqualToString:self.indentifierList[23]]) {
/*裁剪图片*/
} else if ([message.name isEqualToString:self.indentifierList[24]]) {
/*京东支付*/
if (scrollView.contentSize.height - scrollView.contentOffset.y == self.webView.frame.size.height) {
//滚动到底部了
self.agreedBtn.hidden = NO;
} }
} }
/*退出登录*/
- (void) exitLogin:(id) info {
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
if ([userDefaults objectForKey:@"userId"] == nil) {
return;
}
[ZXTool showText:info];
[ZXTool backToLogin];
}
- (instancetype)init{ - (instancetype)init{
self = [super init]; self = [super init];
if (self) { if (self) {
...@@ -186,6 +53,7 @@ ...@@ -186,6 +53,7 @@
self.frame=frame; self.frame=frame;
self.BgView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.4]; self.BgView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.4];
[self creatWebView]; [self creatWebView];
self.agreedBtn.hidden = YES;
} }
return self; return self;
} }
...@@ -214,7 +82,6 @@ ...@@ -214,7 +82,6 @@
[self.webView mas_makeConstraints:^(MASConstraintMaker *make) { [self.webView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.bottom. mas_equalTo(@(0)); make.left.right.top.bottom. mas_equalTo(@(0));
}]; }];
[self ba_JS_OC];
} }
- (IBAction)agreeBtnClick:(id)sender { - (IBAction)agreeBtnClick:(id)sender {
...@@ -236,12 +103,5 @@ ...@@ -236,12 +103,5 @@
} }
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end @end
// //
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
@implementation AboutUs @implementation AboutUs
- (void)dealloc{ - (void)dealloc{
// [UIGestureRecognizer ]
[self removeNotificationAndKVO]; [self removeNotificationAndKVO];
[self.webView removeObserver:self forKeyPath:@"loading"]; [self.webView removeObserver:self forKeyPath:@"loading"];
[self.webView removeObserver:self forKeyPath:@"estimatedProgress"]; [self.webView removeObserver:self forKeyPath:@"estimatedProgress"];
......
// //
...@@ -95,6 +95,9 @@ ...@@ -95,6 +95,9 @@
vc.adUrl = [NSString stringWithFormat:@"%@/static/outlink.html", [kUserDefaults valueForKey:@"h5FirstPage"]]; vc.adUrl = [NSString stringWithFormat:@"%@/static/outlink.html", [kUserDefaults valueForKey:@"h5FirstPage"]];
vc.selfHelpTitle = operation.remark; vc.selfHelpTitle = operation.remark;
vc.selfHelpType = operation.defaultValue.length==1?[@"0" stringByAppendingString:operation.defaultValue]:operation.defaultValue; vc.selfHelpType = operation.defaultValue.length==1?[@"0" stringByAppendingString:operation.defaultValue]:operation.defaultValue;
vc.backAction = ^{
[ZXTool firstPageRefreshAddNotPayView:self.view];
};
[self.navigationController pushViewController:vc animated:YES]; [self.navigationController pushViewController:vc animated:YES];
} }
} }
...@@ -114,6 +117,9 @@ ...@@ -114,6 +117,9 @@
vc.adUrl = @""; vc.adUrl = @"";
vc.model = model; vc.model = model;
vc.defaultModel = defaultValue; vc.defaultModel = defaultValue;
vc.backAction = ^{
[ZXTool firstPageRefreshAddNotPayView:self.view];
};
[self.navigationController pushViewController:vc animated:YES]; [self.navigationController pushViewController:vc animated:YES];
break; break;
} }
...@@ -136,6 +142,9 @@ ...@@ -136,6 +142,9 @@
vc.adUrl = @""; vc.adUrl = @"";
vc.model = model; vc.model = model;
vc.defaultModel = defaultValue; vc.defaultModel = defaultValue;
vc.backAction = ^{
[ZXTool firstPageRefreshAddNotPayView:self.view];
};
[self.navigationController pushViewController:vc animated:YES]; [self.navigationController pushViewController:vc animated:YES];
} else { } else {
ZXDrinkViewController *vc= [[ZXDrinkViewController alloc] init]; ZXDrinkViewController *vc= [[ZXDrinkViewController alloc] init];
...@@ -161,6 +170,9 @@ ...@@ -161,6 +170,9 @@
vc.adUrl = @""; vc.adUrl = @"";
vc.model = 1; vc.model = 1;
vc.defaultModel = 1; vc.defaultModel = 1;
vc.backAction = ^{
[ZXTool firstPageRefreshAddNotPayView:self.view];
};
[self.navigationController pushViewController:vc animated:YES]; [self.navigationController pushViewController:vc animated:YES];
} }
break; break;
......
// //
...@@ -146,20 +146,12 @@ static NSInteger seq = 0; ...@@ -146,20 +146,12 @@ static NSInteger seq = 0;
- (void) createUI { - (void) createUI {
//
// [UIApplication sharedApplication].statusBarHidden = NO;
// [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
// UIView *nabar = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kNavBarHeight + kStatusBarHeight)];
// nabar.backgroundColor = [UIColor orangeColor];
//
// [self.view addSubview:nabar];
// UILabel *naTitle = [[UILabel alloc] initWithFrame:CGRectMake(0, kStatusBarHeight, kScreenWidth, kNavBarHeight)];
// naTitle.textAlignment = NSTextAlignmentCenter;
// naTitle.textColor = [UIColor whiteColor];
// naTitle.font = [UIFont boldSystemFontOfSize:17 * k6Scale];
// naTitle.text = @"多彩校园";
// [nabar addSubview:naTitle];
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
[UIApplication sharedApplication].statusBarHidden = NO;
UIView *nabar = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kStatusBarHeight)];
nabar.backgroundColor = [UIColor colorWithHexString:@"#ffa244"];
[self.view addSubview:nabar];
[self.view addSubview:self.myTableView]; [self.view addSubview:self.myTableView];
} }
...@@ -308,7 +300,7 @@ static NSInteger seq = 0; ...@@ -308,7 +300,7 @@ static NSInteger seq = 0;
if (iPhoneX) { if (iPhoneX) {
bottomH = 34; bottomH = 34;
} }
_myTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight - bottomH - 49) style:UITableViewStyleGrouped]; _myTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, kStatusBarHeight, kScreenWidth, kScreenHeight - bottomH - 49 - kStatusBarHeight) style:UITableViewStyleGrouped];
_myTableView.delegate = self; _myTableView.delegate = self;
_myTableView.dataSource = self; _myTableView.dataSource = self;
_myTableView.backgroundColor = [UIColor whiteColor]; _myTableView.backgroundColor = [UIColor whiteColor];
...@@ -342,7 +334,9 @@ static NSInteger seq = 0; ...@@ -342,7 +334,9 @@ static NSInteger seq = 0;
- (void)viewWillAppear:(BOOL)animated { - (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated]; [super viewWillAppear:animated];
[UIApplication sharedApplication].statusBarHidden = NO; [UIApplication sharedApplication].statusBarHidden = NO;
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
[self.navigationController.navigationBar setHidden:YES]; [self.navigationController.navigationBar setHidden:YES];
[self.tabBarController.tabBar setHidden:NO]; [self.tabBarController.tabBar setHidden:NO];
if ([[kUserDefaults valueForKey:@"isUploadLog"] integerValue]) { if ([[kUserDefaults valueForKey:@"isUploadLog"] integerValue]) {
NSArray *list = [ExpecptionModel findByCriteria:[NSString stringWithFormat:@"where uploadStatus <> 1"]]; NSArray *list = [ExpecptionModel findByCriteria:[NSString stringWithFormat:@"where uploadStatus <> 1"]];
...@@ -1032,7 +1026,7 @@ static NSInteger seq = 0; ...@@ -1032,7 +1026,7 @@ static NSInteger seq = 0;
//当没得校区的时候就判定为个人信息没有完善 //当没得校区的时候就判定为个人信息没有完善
NSLog(@"====%@",CacheCampusId); NSLog(@"====%@",CacheCampusId);
if ([CacheCampusId isEqualToString:@""]){ if ([CacheCampusId isEqualToString:@""] || [CacheCampusId isEqualToString:@"0"]){
_infoView = [[PerfectInformation alloc]initWithFrame:CGRectMake(0, 0, kWidth, kHeight)]; _infoView = [[PerfectInformation alloc]initWithFrame:CGRectMake(0, 0, kWidth, kHeight)];
__weak typeof (self) weakSelf=self; __weak typeof (self) weakSelf=self;
......
// //
...@@ -35,4 +35,7 @@ ...@@ -35,4 +35,7 @@
@property (nonatomic, assign) BOOL isExpan; @property (nonatomic, assign) BOOL isExpan;
//行数 //行数
@property (nonatomic, assign) NSInteger rows; @property (nonatomic, assign) NSInteger rows;
//是否显示了未支付订单蒙层(只针对公告)
@property (nonatomic, assign) BOOL isShowMask;
@end @end
// //
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
self.contentImageview = [[UIImageView alloc] init]; self.contentImageview = [[UIImageView alloc] init];
[self.contentView addSubview:self.contentImageview]; [self.contentView addSubview:self.contentImageview];
[self.contentImageview mas_makeConstraints:^(MASConstraintMaker *make) { [self.contentImageview mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.contentView).insets(UIEdgeInsetsMake(0, 15 * k6Scale, 5 * k6Scale, 15 * k6Scale)); make.edges.equalTo(self.contentView).insets(UIEdgeInsetsMake(5 * k6Scale, 5 * k6Scale, 5 * k6Scale, 5 * k6Scale));
}]; }];
self.contentImageview.layer.cornerRadius = 5; self.contentImageview.layer.cornerRadius = 5;
self.contentImageview.clipsToBounds = YES; self.contentImageview.clipsToBounds = YES;
......
// //
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
self.cycleScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0, kScreenWidth, 120 * k6Scale) shouldInfiniteLoop:YES imageNamesGroup:@[]]; self.cycleScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0, kScreenWidth, 120 * k6Scale) shouldInfiniteLoop:YES imageNamesGroup:@[]];
self.cycleScrollView.bannerImageViewContentMode = UIViewContentModeScaleAspectFill; self.cycleScrollView.bannerImageViewContentMode = UIViewContentModeScaleAspectFill;
self.cycleScrollView.autoScrollTimeInterval = 3; self.cycleScrollView.autoScrollTimeInterval = 5;
self.cycleScrollView.pageControlStyle = SDCycleScrollViewPageContolStyleClassic; self.cycleScrollView.pageControlStyle = SDCycleScrollViewPageContolStyleClassic;
[self.contentView addSubview:self.cycleScrollView]; [self.contentView addSubview:self.cycleScrollView];
......
// //
...@@ -9,9 +9,15 @@ ...@@ -9,9 +9,15 @@
#import "New_PublicCell.h" #import "New_PublicCell.h"
#import "GYRollingNoticeView.h" #import "GYRollingNoticeView.h"
#import "PublicScollCell.h" #import "PublicScollCell.h"
#import "ZXNotPay.h"
#import "enlargeClickRegionBtn.h"
#import "ZXOrderPayController.h"
@interface New_PublicCell() <GYRollingNoticeViewDataSource, GYRollingNoticeViewDelegate> @interface New_PublicCell() <GYRollingNoticeViewDataSource, GYRollingNoticeViewDelegate>
@property (nonatomic, strong) GYRollingNoticeView *noticeView; @property (nonatomic, strong) GYRollingNoticeView *noticeView;
@property (nonatomic, strong) UIView *notPayView;
@end @end
@implementation New_PublicCell @implementation New_PublicCell
...@@ -31,26 +37,14 @@ ...@@ -31,26 +37,14 @@
make.height.mas_equalTo(1); make.height.mas_equalTo(1);
}]; }];
UILabel *adLsabel = [[UILabel alloc] init]; UIImageView *adLsabel = [[UIImageView alloc] init];
adLsabel.textColor = [UIColor redColor];
[self addSubview:adLsabel]; [self addSubview:adLsabel];
adLsabel.text = @"公告"; adLsabel.image = [UIImage imageNamed:@"zx_ann_icon"];
adLsabel.font = kFontSize(14 * k6Scale);
[adLsabel mas_makeConstraints:^(MASConstraintMaker *make) { [adLsabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(self.mas_centerY); make.centerY.equalTo(self.mas_centerY);
make.left.equalTo(self.mas_left).offset(15 * k6Scale); make.left.equalTo(self.mas_left).offset(15 * k6Scale);
}]; }];
UIView *line = [[UIView alloc] init];
[self addSubview:line];
line.backgroundColor = [UIColor redColor];
[line mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(adLsabel.mas_right).offset(15 * k6Scale);
make.width.mas_equalTo(1);
make.height.mas_equalTo(20 * k6Scale);
make.centerY.equalTo(adLsabel);
}];
UIImageView *arrow = [[UIImageView alloc] init]; UIImageView *arrow = [[UIImageView alloc] init];
arrow.image = [UIImage imageNamed:@"查看全部@2x"]; arrow.image = [UIImage imageNamed:@"查看全部@2x"];
...@@ -78,9 +72,9 @@ ...@@ -78,9 +72,9 @@
[self.contentView addSubview:self.noticeView]; [self.contentView addSubview:self.noticeView];
self.noticeView.backgroundColor = [UIColor whiteColor]; self.noticeView.backgroundColor = [UIColor whiteColor];
[self.noticeView mas_makeConstraints:^(MASConstraintMaker *make) { [self.noticeView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(line.mas_right).offset(8 * k6Scale); make.left.equalTo(adLsabel.mas_right).offset(8 * k6Scale);
make.right.equalTo(checkAll.mas_left).offset(-8 * k6Scale); make.right.equalTo(checkAll.mas_left).offset(-8 * k6Scale);
make.top.equalTo(self.contentView.mas_top).offset(2); make.top.equalTo(self.contentView.mas_top).offset(4);
make.bottom.equalTo(self.contentView.mas_bottom).offset(-2); make.bottom.equalTo(self.contentView.mas_bottom).offset(-2);
}]; }];
...@@ -100,6 +94,17 @@ ...@@ -100,6 +94,17 @@
} }
}]; }];
self.notPayView = [[UIView alloc] init];
self.notPayView.backgroundColor = [UIColor clearColor];
[self.contentView addSubview:self.notPayView];
[self.notPayView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(adLsabel.mas_right);
make.right.equalTo(self.contentView.mas_right);
make.centerY.equalTo(self.contentView);
make.height.mas_equalTo(0);
}];
} }
return self; return self;
} }
...@@ -143,5 +148,113 @@ ...@@ -143,5 +148,113 @@
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self.noticeView reloadDataAndStartRoll]; [self.noticeView reloadDataAndStartRoll];
}); });
[self createNotPayOrderView:self.notPayView];
}
-(void) createNotPayOrderView:(UIView *) v {
if (self.section.isShowMask) {
return;
}
v.hidden = NO;
self.section.isShowMask = YES;
if ([ZXNotPay findAll].count) {
ZXNotPay *order = [ZXNotPay findAll].lastObject;
[self createNotPayViewBySuperView:v orderDetail:order.orderId alertStr:order.orderTitle];
return;
}
//请求未支付订单数据
NSString *url = [NSString stringWithFormat:@"%@/consumeOrder/getUnpaidOrder?customerId=%@", [kUserDefaults objectForKey:@"NEW_PAY"], CacheUserId];
[XMCenter sendRequest:^(XMRequest *request) {
request.url = [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
request.httpMethod = kXMHTTPMethodGET;
request.headers = @{@"token": CacheToken,@"reqSource":@"app", @"Content-Type":@"application/json"};
} onSuccess:^(id responseObject) {
if ([responseObject[@"code"] integerValue] == 1000) {
[ZXNotPay clearTable];
if ([responseObject[@"orderId"] isKindOfClass:[NSNull class]]) {
return ;
}
NSString *order = responseObject[@"title"];
NSInteger orderId = [responseObject[@"orderId"] integerValue];
if (order && ![order isKindOfClass:[NSNull class]]) {
dispatch_async(dispatch_get_main_queue(), ^{
ZXNotPay *p = [[ZXNotPay alloc] init];
p.orderId = orderId;
p.userId = CacheUserId;
p.orderTitle = order;
[p save];
[self createNotPayViewBySuperView:v orderDetail:orderId alertStr:order];
});
}
}
} onFailure:^(NSError *error) {
} onFinished:^(id responseObject, NSError *error) {
}];
}
- (void) createNotPayViewBySuperView:(UIView *) superView orderDetail:(NSInteger) orderId alertStr:(NSString *) alertStr {
for (UIView *v in superView.subviews) {
[v removeFromSuperview];
}
[superView mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(38);
}];
[ZXPayManager sharedZXPayManager].orderId = orderId;
UIView *backView = [[UIView alloc] init];
[superView addSubview:backView];
backView.backgroundColor = RGB(255, 186, 112);
backView.alpha = 0.9;
[backView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(superView).insets(UIEdgeInsetsMake(5 * k6Scale, kCellContentLeftMargin * k6Scale, 5 * k6Scale,kCellContentLeftMargin * k6Scale));
}];
kViewRadius(backView, 5);
UIImageView *iconImageView = [[UIImageView alloc] init];
[backView addSubview:iconImageView];
iconImageView.image = [UIImage imageNamed:@"home_tishi_icon"];
[iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(backView.mas_left).offset(10 * k6Scale);
make.width.height.mas_equalTo(15 * k6Scale);
make.centerY.equalTo(backView);
}];
UILabel *desc = [[UILabel alloc] init];
[backView addSubview:desc];
desc.font = kFontSize(12 * k6Scale);
desc.textColor = [UIColor whiteColor];
desc.text = alertStr?alertStr:@"您有一个待支付订单,请立即支付!";
[desc mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(iconImageView.mas_right).offset(10 * k6Scale);
make.centerY.equalTo(backView);
}];
enlargeClickRegionBtn *closeBtn = [[enlargeClickRegionBtn alloc] init];
[backView addSubview:closeBtn];
[closeBtn setImage:[UIImage imageNamed:@"home_guanbi_icon"] forState:UIControlStateNormal];
[[closeBtn rac_signalForControlEvents:UIControlEventTouchDown] subscribeNext:^(id x) {
[superView mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(0);
}];
}];
[closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(backView.mas_right).offset(-10 * k6Scale);
make.width.height.mas_equalTo(20 * k6Scale);
make.centerY.equalTo(backView);
}];
//收起
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] init];
[superView addGestureRecognizer:tap];
[[tap rac_gestureSignal] subscribeNext:^(id x) {
ZXOrderPayController *jumpPay = [[ZXOrderPayController alloc] init];
jumpPay.orderId = [ZXPayManager sharedZXPayManager].orderId;
kWeakSelf(superView);
jumpPay.paySuccess = ^{
kStrongSelf(superView);
superView.hidden = YES;
};
[[ZXTool getCurrentVC].navigationController pushViewController:jumpPay animated:YES];
}];
} }
@end @end
// //
...@@ -87,13 +87,18 @@ ...@@ -87,13 +87,18 @@
self.userCenterItem.campusName=@"请填写真实信息"; self.userCenterItem.campusName=@"请填写真实信息";
self.userCenterItem.schoolName=@"请填写真实信息"; self.userCenterItem.schoolName=@"请填写真实信息";
self.userCenterItem.enterSchoolDate=@"请填写真实信息";
} }
-(void)setViews{ -(void)setViews{
[self loadData]; [self loadData];
self.allSchoolModel=[FetchAllSchoolModel new]; self.allSchoolModel=[FetchAllSchoolModel new];
self.saveModel=[SaveUserInfoModel new]; self.saveModel=[SaveUserInfoModel new];
self.userCenterItem =[UserCenerModelItem new]; self.userCenterItem =[UserCenerModelItem new];
self.userCenterItem.username = [kUserDefaults objectForKey:@"username"];
self.userCenterItem.gender = [kUserDefaults objectForKey:@"gender"];
self.userCenterItem.studentNo = [kUserDefaults objectForKey:@"studentNo"];
self.userCenterItem.birthday = [kUserDefaults objectForKey:@"birthday"];
self.userCenterItem.enterSchoolDate = [kUserDefaults objectForKey:@"enterSchoolDate"];
[self registNotificationAndKVO]; [self registNotificationAndKVO];
_schoolArray = [[NSMutableArray alloc]init]; _schoolArray = [[NSMutableArray alloc]init];
_allDataArray = [[NSArray alloc]init]; _allDataArray = [[NSArray alloc]init];
...@@ -153,9 +158,10 @@ ...@@ -153,9 +158,10 @@
self.saveSuccess(); self.saveSuccess();
} } else {
else{ dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool showText:@"服务器内部错误,请联系管路员处理!"];
});
} }
} }
......
// //
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
// 自助页面 // 自助页面
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import <WebKit/WebKit.h>
@interface ZXSelfHelpViewController : UIViewController @interface ZXSelfHelpViewController : UIViewController
//广告链接 //广告链接
...@@ -16,12 +15,13 @@ ...@@ -16,12 +15,13 @@
@property (nonatomic, copy) NSString *selfHelpTitle; @property (nonatomic, copy) NSString *selfHelpTitle;
//自助类型 //自助类型
@property (nonatomic, copy) NSString *selfHelpType; @property (nonatomic, copy) NSString *selfHelpType;
@property (nonatomic, strong) WKWebView *webView;
@property (nonatomic, copy) NSString *jsStr;
//模式 1.条码,2扫码,3 混合 //模式 1.条码,2扫码,3 混合
@property (nonatomic, assign) NSInteger model; @property (nonatomic, assign) NSInteger model;
//混合模式下的默认使用方式(1.条码,2扫码) //混合模式下的默认使用方式(1.条码,2扫码)
@property (nonatomic, assign) NSInteger defaultModel; @property (nonatomic, assign) NSInteger defaultModel;
@property (nonatomic, copy) dispatch_block_t backAction;
@end @end
// //
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
@property (nonatomic, strong) UIImageView *adImageView; @property (nonatomic, strong) UIImageView *adImageView;
@property (nonatomic, strong) UIButton *startDrink; @property (nonatomic, strong) UIButton *startDrink;
@property (nonatomic, strong) ZXDrinkMerthinModel *currentMerthin; @property (nonatomic, strong) ZXDrinkMerthinModel *currentMerthin;
@property (nonatomic, strong) dispatch_source_t gcdTimer;
@end @end
@implementation ZXDrinkViewController @implementation ZXDrinkViewController
...@@ -270,7 +271,14 @@ ...@@ -270,7 +271,14 @@
self.currentMerthin = m; self.currentMerthin = m;
}]; }];
[ZXTool showNotPayOrderMaskView:self]; if (self.gcdTimer == nil) {
[self createTimer];
}
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
dispatch_cancel(self.gcdTimer);
self.gcdTimer = nil;
} }
#pragma mark - ========== UITableView/Delegate/Datasource ========== #pragma mark - ========== UITableView/Delegate/Datasource ==========
- (UITableView *)myTableView { - (UITableView *)myTableView {
...@@ -426,4 +434,16 @@ ...@@ -426,4 +434,16 @@
// } // }
// return _adImageView; // return _adImageView;
//} //}
#pragma mark - 创建定时器 10s一次请求当前是否有未支付订单
- (void) createTimer {
self.gcdTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_global_queue(0, 0));
dispatch_source_set_timer(self.gcdTimer, DISPATCH_TIME_NOW, 10.0 * NSEC_PER_SEC, 0.0 * NSEC_PER_SEC);
dispatch_source_set_event_handler(self.gcdTimer, ^{
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool showNotPayOrderMaskView:self];
});
});
// 启动任务,GCD计时器创建后需要手动启动
dispatch_resume(self.gcdTimer);
}
@end @end
// //
...@@ -702,7 +702,7 @@ static NSInteger seq = 0; ...@@ -702,7 +702,7 @@ static NSInteger seq = 0;
//当没得校区的时候就判定为个人信息没有完善 //当没得校区的时候就判定为个人信息没有完善
NSLog(@"====%@",CacheCampusId); NSLog(@"====%@",CacheCampusId);
if ([CacheCampusId isEqualToString:@""]){ if ([CacheCampusId isEqualToString:@""] || [CacheCampusId isEqualToString:@"0"]){
_infoView = [[PerfectInformation alloc]initWithFrame:CGRectMake(0, 0, kWidth, kHeight)]; _infoView = [[PerfectInformation alloc]initWithFrame:CGRectMake(0, 0, kWidth, kHeight)];
__weak typeof (self) weakSelf=self; __weak typeof (self) weakSelf=self;
......
// //
...@@ -902,8 +902,8 @@ void ProviderReleaseData (void *info, const void *data, size_t size){ ...@@ -902,8 +902,8 @@ void ProviderReleaseData (void *info, const void *data, size_t size){
make.height.mas_equalTo(0 * k6Scale); make.height.mas_equalTo(0 * k6Scale);
make.bottom.equalTo(superView.mas_bottom).offset(-bottomMargin); make.bottom.equalTo(superView.mas_bottom).offset(-bottomMargin);
}]; }];
[ZXPayManager sharedZXPayManager].notPayOrderView = notPayView; // [ZXPayManager sharedZXPayManager].notPayOrderView = notPayView;
[self createNotPayOrderView:notPayView];//创建广告view // [self createNotPayOrderView:notPayView];//创建广告view
} }
dispatch_async(dispatch_get_global_queue(0, 0), ^{ dispatch_async(dispatch_get_global_queue(0, 0), ^{
@weakify(self); @weakify(self);
...@@ -1027,34 +1027,40 @@ void ProviderReleaseData (void *info, const void *data, size_t size){ ...@@ -1027,34 +1027,40 @@ void ProviderReleaseData (void *info, const void *data, size_t size){
} }
#pragma mark - ========== 首页下拉刷新显示未支付订单 ========== #pragma mark - ========== 首页下拉刷新显示未支付订单 ==========
+(void) firstPageRefreshAddNotPayView:(UIView *) v { +(void) firstPageRefreshAddNotPayView:(UIView *) v {
if ([ZXPayManager sharedZXPayManager].notPayOrderView == nil) {
UIView *notPayView; //暂时注释掉
CGFloat bottomMargin = 49; // if ([ZXPayManager sharedZXPayManager].notPayOrderView == nil) {
if (iPhoneX) { // UIView *notPayView;
bottomMargin = 83; // CGFloat bottomMargin = 49;
} // if (iPhoneX) {
notPayView = [[UIView alloc] init]; // bottomMargin = 83;
notPayView.backgroundColor = [UIColor whiteColor]; // }
[v addSubview:notPayView]; // notPayView = [[UIView alloc] init];
[notPayView mas_makeConstraints:^(MASConstraintMaker *make) { // notPayView.backgroundColor = [UIColor whiteColor];
make.left.right.equalTo(v); // [v addSubview:notPayView];
make.height.mas_equalTo(0 * k6Scale); // [notPayView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(v.mas_bottom).offset(-bottomMargin); // make.left.right.equalTo(v);
}]; // make.height.mas_equalTo(0 * k6Scale);
[ZXPayManager sharedZXPayManager].notPayOrderView = notPayView; // make.bottom.equalTo(v.mas_bottom).offset(-bottomMargin);
[self createNotPayOrderView:notPayView];//创建广告view // }];
} // [ZXPayManager sharedZXPayManager].notPayOrderView = notPayView;
if ([ZXNotPay findByCriteria:[NSString stringWithFormat:@"where userId = '%@'", CacheUserId]].count) { // [self createNotPayOrderView:notPayView];//创建广告view
ZXNotPay *m = [ZXNotPay findByCriteria:[NSString stringWithFormat:@"where userId = '%@'", CacheUserId]].lastObject; // }
[ZXPayManager sharedZXPayManager].orderId = m.orderId; // if ([ZXNotPay findByCriteria:[NSString stringWithFormat:@"where userId = '%@'", CacheUserId]].count) {
dispatch_async(dispatch_get_main_queue(), ^{ // ZXNotPay *m = [ZXNotPay findByCriteria:[NSString stringWithFormat:@"where userId = '%@'", CacheUserId]].lastObject;
[[ZXPayManager sharedZXPayManager].notPayOrderView mas_updateConstraints:^(MASConstraintMaker *make) { // [ZXPayManager sharedZXPayManager].orderId = m.orderId;
make.height.mas_equalTo(50); // if ([ZXPayManager sharedZXPayManager].notPayOrderView.subviews.count) {
}]; // dispatch_async(dispatch_get_main_queue(), ^{
}); // [[ZXPayManager sharedZXPayManager].notPayOrderView mas_updateConstraints:^(MASConstraintMaker *make) {
} else { // make.height.mas_equalTo(50);
[self createNotPayOrderView:[ZXPayManager sharedZXPayManager].notPayOrderView]; // }];
} // });
// } else {
// [self createNotPayOrderView:[ZXPayManager sharedZXPayManager].notPayOrderView];
// }
// } else {
// [self createNotPayOrderView:[ZXPayManager sharedZXPayManager].notPayOrderView];
// }
} }
...@@ -1080,6 +1086,7 @@ void ProviderReleaseData (void *info, const void *data, size_t size){ ...@@ -1080,6 +1086,7 @@ void ProviderReleaseData (void *info, const void *data, size_t size){
ZXNotPay *p = [[ZXNotPay alloc] init]; ZXNotPay *p = [[ZXNotPay alloc] init];
p.orderId = orderId; p.orderId = orderId;
p.userId = CacheUserId; p.userId = CacheUserId;
p.orderTitle = order;
[p save]; [p save];
[self createNotPayViewBySuperView:v orderDetail:orderId alertStr:order]; [self createNotPayViewBySuperView:v orderDetail:orderId alertStr:order];
}); });
...@@ -1103,7 +1110,7 @@ void ProviderReleaseData (void *info, const void *data, size_t size){ ...@@ -1103,7 +1110,7 @@ void ProviderReleaseData (void *info, const void *data, size_t size){
[backView mas_makeConstraints:^(MASConstraintMaker *make) { [backView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(superView).insets(UIEdgeInsetsMake(5 * k6Scale, kCellContentLeftMargin * k6Scale, 5 * k6Scale,kCellContentLeftMargin * k6Scale)); make.edges.equalTo(superView).insets(UIEdgeInsetsMake(5 * k6Scale, kCellContentLeftMargin * k6Scale, 5 * k6Scale,kCellContentLeftMargin * k6Scale));
}]; }];
kViewRadius(backView, 4); kViewRadius(backView, 5);
UIImageView *iconImageView = [[UIImageView alloc] init]; UIImageView *iconImageView = [[UIImageView alloc] init];
[backView addSubview:iconImageView]; [backView addSubview:iconImageView];
iconImageView.image = [UIImage imageNamed:@"home_tishi_icon"]; iconImageView.image = [UIImage imageNamed:@"home_tishi_icon"];
......
// //
...@@ -203,7 +203,7 @@ ...@@ -203,7 +203,7 @@
NSArray *controllers = self.navigationController.childViewControllers; NSArray *controllers = self.navigationController.childViewControllers;
NSArray *res = [[controllers reverseObjectEnumerator] allObjects]; NSArray *res = [[controllers reverseObjectEnumerator] allObjects];
for (UIViewController *vc in res) { for (UIViewController *vc in res) {
if ([vc isKindOfClass:NSClassFromString(@"ZTHomeViewController")] || [vc isKindOfClass:NSClassFromString(@"ZXRSNewViewController")] || [vc isKindOfClass:NSClassFromString(@"ZXSimpleHomeController")] || [vc isKindOfClass:NSClassFromString(@"ZXNewPayOrderListViewController")] || [vc isKindOfClass:NSClassFromString(@"ZXSelfHelpViewController")] || [vc isKindOfClass:NSClassFromString(@"ZXDrinkViewController")]) { if ([vc isKindOfClass:NSClassFromString(@"ZTHomeViewController")] || [vc isKindOfClass:NSClassFromString(@"ZXRSNewViewController")] || [vc isKindOfClass:NSClassFromString(@"ZXSimpleHomeController")] || [vc isKindOfClass:NSClassFromString(@"ZXNewPayOrderListViewController")] || [vc isKindOfClass:NSClassFromString(@"ZXSelfHelpViewController")] || [vc isKindOfClass:NSClassFromString(@"ZXDrinkViewController")]|| [vc isKindOfClass:NSClassFromString(@"UserSettingViewController")]) {
[self.navigationController popToViewController:vc animated:YES]; [self.navigationController popToViewController:vc animated:YES];
} }
} }
......
// //
...@@ -59,9 +59,17 @@ ...@@ -59,9 +59,17 @@
[ZXNewPayLessMoneyModel saveObjects:accounts]; [ZXNewPayLessMoneyModel saveObjects:accounts];
if (dic && dic[@"paymentAndActiveInfos"]) { if (dic && dic[@"paymentAndActiveInfos"]) {
[self.payTypes removeAllObjects]; [self.payTypes removeAllObjects];
NSInteger defaultPayType = -1;//默认为-1
if (responseObject[@"defaultPayType"]) {
defaultPayType = [responseObject[@"defaultPayType"] integerValue];
}
NSArray *arr = [ZXNewPayTypeModel mj_objectArrayWithKeyValuesArray:dic[@"paymentAndActiveInfos"]]; NSArray *arr = [ZXNewPayTypeModel mj_objectArrayWithKeyValuesArray:dic[@"paymentAndActiveInfos"]];
for (ZXNewPayTypeModel *ty in arr) { for (ZXNewPayTypeModel *ty in arr) {
ty.payableMoney = self.order.payableMoney; ty.payableMoney = self.order.payableMoney;
if (([ty.payType integerValue] == defaultPayType)) {
ty.isSelect = YES;
self.currentPayType = ty;
}
if ([ty.payType isEqualToString:@"6"]) { if ([ty.payType isEqualToString:@"6"]) {
ty.sortIndex = 1; ty.sortIndex = 1;
} else if ([ty.payType isEqualToString:@"7"]) { } else if ([ty.payType isEqualToString:@"7"]) {
......
// //
...@@ -13,6 +13,8 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -13,6 +13,8 @@ NS_ASSUME_NONNULL_BEGIN
@interface ZXNotPay : JKDBModel @interface ZXNotPay : JKDBModel
@property (nonatomic, copy) NSString *userId; @property (nonatomic, copy) NSString *userId;
@property (nonatomic, assign) NSInteger orderId; @property (nonatomic, assign) NSInteger orderId;
@property (nonatomic, copy) NSString *orderTitle;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
{
"images" : [
{
"idiom" : "universal",
"filename" : "推送_开启关闭.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "推送_开启关闭@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "推送_开启关闭@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "icon_fangda.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "icon_fangda@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "icon_fangda@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "icon_suoxiao.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "icon_suoxiao@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "icon_suoxiao@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "pic_shuaxin.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "pic_shuaxin@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "pic_shuaxin@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment