Commit 0441bb0f by 刘卓鑫

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

parent cd6c1a70
......@@ -86,9 +86,6 @@
[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://192.168.1.102:8000" forKey:@"NEW_PAY"];
[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 synchronize];
......
......@@ -8,6 +8,7 @@
#import "AppDelegate.h"
#import "AppDelegate+Extension.h"
#import "ZXOrderPayController.h"
#import "LoginView.h"
#import "MyTabViewController.h"
#import "XMGNavigationViewController.h"
......@@ -18,6 +19,7 @@
#import "XMGFileTool.h"
#import "LoginJump.h"
#import "FTUploader.h"
#import "ZXNewOrderDetailViewController.h"
#import <AFNetworkReachabilityManager.h>
// 引入JPush功能所需头文件
#import "JPUSHService.h"
......@@ -351,7 +353,7 @@
handleActionWithIdentifier:(NSString *)identifier
forRemoteNotification:(NSDictionary *)userInfo
completionHandler:(void (^)())completionHandler {
//MARK:点击通知触发的动作
}
- (void)application:(UIApplication *)application
didReceiveRemoteNotification:(NSDictionary *)userInfo
......@@ -428,23 +430,49 @@ fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
self.notifyDic=userInfo;
}
//跳转到指定界面;
[self goToMssageViewControllerWith:userInfo];
[self jumpNotPayView:userInfo];
}
else {
// 判断为本地通知
NSLog(@"iOS10 收到本地通知:{\nbody:%@,\ntitle:%@,\nsubtitle:%@,\nbadge:%@,\nsound:%@,\nuserInfo:%@\n}",body,title,subtitle,badge,sound,userInfo);
}
completionHandler(); // 系统要求执行这个方法
}
#pragma mark 通过通知跳转到指定界面;
- (void)goToMssageViewControllerWith:(NSDictionary*)msgDic{
#pragma mark - 点击推送 跳转未支付订单
- (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 - ========== 版本检测 ==========
//-(void)checkVersion{
// self.updateModel = [[UpdateVersionModel alloc] init];
......
//
//
......@@ -533,7 +533,7 @@ static NSInteger seq = 0;
//当没得校区的时候就判定为个人信息没有完善
NSLog(@"====%@",CacheCampusId);
if ([CacheCampusId isEqualToString:@""]){
if ([CacheCampusId isEqualToString:@""] || [CacheCampusId isEqualToString:@"0"]){
_infoView = [[PerfectInformation alloc]initWithFrame:CGRectMake(0, 0, kWidth, kHeight)];
@weakify(self);
......
//
//
......@@ -8,8 +8,8 @@
#import "AnnouncementView.h"
@interface AnnouncementView()<WKScriptMessageHandler>{
@interface AnnouncementView()<UIScrollViewDelegate>{
BOOL jugeAgreed;
}
@property (nonatomic, strong) NSArray *indentifierList;
......@@ -19,153 +19,20 @@
if (_webView==nil) {
WKWebViewConfiguration *config = [WKWebViewConfiguration new];
_webView = [[WKWebView alloc]initWithFrame:CGRectMake(0,0,kWidth-20, kHeight-2*87) configuration:config];
_webView.scrollView.delegate = self;
}
return _webView;
}
#pragma mark - ========== 注册方法列表 ==========
- (NSArray *)indentifierList {
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]]) {
/*京东支付*/
}
}
/*退出登录*/
- (void) exitLogin:(id) info {
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
if ([userDefaults objectForKey:@"userId"] == nil) {
return;
#pragma mark - scrollView协议
-(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
{
if (scrollView.contentSize.height - scrollView.contentOffset.y == self.webView.frame.size.height) {
//滚动到底部了
self.agreedBtn.hidden = NO;
}
[ZXTool showText:info];
[ZXTool backToLogin];
}
- (instancetype)init{
self = [super init];
......@@ -185,23 +52,24 @@
*)[nib firstObject];
self.frame=frame;
self.BgView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.4];
[self creatWebView];
[self creatWebView];
self.agreedBtn.hidden = YES;
}
return self;
}
-(void)setAnnounceItem:(AnnounceModelItem *)announceItem{
if ([announceItem.noticeType isEqualToString:@"3"]) {
self.nonoticeBgView.hidden=NO;
self.noNoticeHeightConstraint.constant=37;
self.noNoticeBgHeightConstraint.constant=125;
}else{
self.nonoticeBgView.hidden=YES;
self.noNoticeHeightConstraint.constant=0;
self.noNoticeBgHeightConstraint.constant=125-37;
}
self.titleLabel.text=announceItem.noticeTitle;
self.timeLabel.text=announceItem.updateDate;
......@@ -209,12 +77,11 @@
[self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[announceItem.noticeContent stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]]];
}
-(void)creatWebView{
[self.webBgView addSubview:self.webView];
[self.webView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.bottom. mas_equalTo(@(0));
}];
[self ba_JS_OC];
}
- (IBAction)agreeBtnClick:(id)sender {
......@@ -227,21 +94,14 @@
{
[_agreedBtn setImage:[UIImage imageNamed:@"条款未选中.png"] forState:UIControlStateNormal];
}
}
- (IBAction)confirmBtnClick:(id)sender {
if (self.ok) {
self.ok(jugeAgreed);
}
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end
//
//
......@@ -19,7 +19,7 @@
@implementation AboutUs
- (void)dealloc{
// [UIGestureRecognizer ]
[self removeNotificationAndKVO];
[self.webView removeObserver:self forKeyPath:@"loading"];
[self.webView removeObserver:self forKeyPath:@"estimatedProgress"];
......
//
//
......@@ -95,6 +95,9 @@
vc.adUrl = [NSString stringWithFormat:@"%@/static/outlink.html", [kUserDefaults valueForKey:@"h5FirstPage"]];
vc.selfHelpTitle = operation.remark;
vc.selfHelpType = operation.defaultValue.length==1?[@"0" stringByAppendingString:operation.defaultValue]:operation.defaultValue;
vc.backAction = ^{
[ZXTool firstPageRefreshAddNotPayView:self.view];
};
[self.navigationController pushViewController:vc animated:YES];
}
}
......@@ -114,6 +117,9 @@
vc.adUrl = @"";
vc.model = model;
vc.defaultModel = defaultValue;
vc.backAction = ^{
[ZXTool firstPageRefreshAddNotPayView:self.view];
};
[self.navigationController pushViewController:vc animated:YES];
break;
}
......@@ -136,6 +142,9 @@
vc.adUrl = @"";
vc.model = model;
vc.defaultModel = defaultValue;
vc.backAction = ^{
[ZXTool firstPageRefreshAddNotPayView:self.view];
};
[self.navigationController pushViewController:vc animated:YES];
} else {
ZXDrinkViewController *vc= [[ZXDrinkViewController alloc] init];
......@@ -161,6 +170,9 @@
vc.adUrl = @"";
vc.model = 1;
vc.defaultModel = 1;
vc.backAction = ^{
[ZXTool firstPageRefreshAddNotPayView:self.view];
};
[self.navigationController pushViewController:vc animated:YES];
}
break;
......
//
//
......@@ -146,20 +146,12 @@ static NSInteger seq = 0;
- (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];
}
......@@ -308,7 +300,7 @@ static NSInteger seq = 0;
if (iPhoneX) {
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.dataSource = self;
_myTableView.backgroundColor = [UIColor whiteColor];
......@@ -342,7 +334,9 @@ static NSInteger seq = 0;
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[UIApplication sharedApplication].statusBarHidden = NO;
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
[self.navigationController.navigationBar setHidden:YES];
[self.tabBarController.tabBar setHidden:NO];
if ([[kUserDefaults valueForKey:@"isUploadLog"] integerValue]) {
NSArray *list = [ExpecptionModel findByCriteria:[NSString stringWithFormat:@"where uploadStatus <> 1"]];
......@@ -1032,7 +1026,7 @@ static NSInteger seq = 0;
//当没得校区的时候就判定为个人信息没有完善
NSLog(@"====%@",CacheCampusId);
if ([CacheCampusId isEqualToString:@""]){
if ([CacheCampusId isEqualToString:@""] || [CacheCampusId isEqualToString:@"0"]){
_infoView = [[PerfectInformation alloc]initWithFrame:CGRectMake(0, 0, kWidth, kHeight)];
__weak typeof (self) weakSelf=self;
......
//
//
......@@ -35,4 +35,7 @@
@property (nonatomic, assign) BOOL isExpan;
//行数
@property (nonatomic, assign) NSInteger rows;
//是否显示了未支付订单蒙层(只针对公告)
@property (nonatomic, assign) BOOL isShowMask;
@end
//
//
......@@ -25,7 +25,7 @@
self.contentImageview = [[UIImageView alloc] init];
[self.contentView addSubview:self.contentImageview];
[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.clipsToBounds = YES;
......
//
//
......@@ -30,7 +30,7 @@
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
self.cycleScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0, kScreenWidth, 120 * k6Scale) shouldInfiniteLoop:YES imageNamesGroup:@[]];
self.cycleScrollView.bannerImageViewContentMode = UIViewContentModeScaleAspectFill;
self.cycleScrollView.autoScrollTimeInterval = 3;
self.cycleScrollView.autoScrollTimeInterval = 5;
self.cycleScrollView.pageControlStyle = SDCycleScrollViewPageContolStyleClassic;
[self.contentView addSubview:self.cycleScrollView];
......
//
//
......@@ -9,9 +9,15 @@
#import "New_PublicCell.h"
#import "GYRollingNoticeView.h"
#import "PublicScollCell.h"
#import "ZXNotPay.h"
#import "enlargeClickRegionBtn.h"
#import "ZXOrderPayController.h"
@interface New_PublicCell() <GYRollingNoticeViewDataSource, GYRollingNoticeViewDelegate>
@property (nonatomic, strong) GYRollingNoticeView *noticeView;
@property (nonatomic, strong) UIView *notPayView;
@end
@implementation New_PublicCell
......@@ -30,28 +36,16 @@
make.left.right.top.equalTo(self.contentView);
make.height.mas_equalTo(1);
}];
UILabel *adLsabel = [[UILabel alloc] init];
adLsabel.textColor = [UIColor redColor];
UIImageView *adLsabel = [[UIImageView alloc] init];
[self addSubview:adLsabel];
adLsabel.text = @"公告";
adLsabel.font = kFontSize(14 * k6Scale);
adLsabel.image = [UIImage imageNamed:@"zx_ann_icon"];
[adLsabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(self.mas_centerY);
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];
arrow.image = [UIImage imageNamed:@"查看全部@2x"];
[self.contentView addSubview:arrow];
......@@ -60,7 +54,7 @@
make.right.equalTo(self.contentView.mas_right).offset(-15 * k6Scale);
make.width.mas_equalTo(5.5 * k6Scale);
make.height.mas_equalTo(11 * k6Scale);
}];
UILabel *checkAll = [[UILabel alloc] init];
checkAll.textColor = kRGBColor(119, 119, 119, 1);
......@@ -71,19 +65,19 @@
make.centerY.equalTo(arrow.mas_centerY);
make.right.equalTo(arrow.mas_left).offset(-3 * k6Scale);
}];
self.noticeView = [[GYRollingNoticeView alloc]init];
self.noticeView.dataSource = self;
self.noticeView.delegate = self;
[self.contentView addSubview:self.noticeView];
self.noticeView.backgroundColor = [UIColor whiteColor];
[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.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);
}];
UIView *con = [UIView new];
con.backgroundColor = [UIColor clearColor];
[self.contentView addSubview:con];
......@@ -99,13 +93,24 @@
self.checkAll(jump);
}
}];
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;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
......@@ -117,12 +122,12 @@
- (NSInteger)numberOfRowsForRollingNoticeView:(GYRollingNoticeView *)rollingView
{
return self.items.count;
}
- (__kindof GYNoticeViewCell *)rollingNoticeView:(GYRollingNoticeView *)rollingView cellAtIndex:(NSUInteger)index
{
PublicScollCell *cell = [rollingView dequeueReusableCellWithIdentifier:@"PublicScollCell"];
if (cell == nil) {
cell = [[PublicScollCell alloc] initWithReuseIdentifier:@"PublicScollCell"];
......@@ -132,7 +137,7 @@
}
- (void)didClickRollingNoticeView:(GYRollingNoticeView *)rollingView forIndex:(NSUInteger)index
{
ZXInformation *info = self.items[index];
if (self.clickAction) {
self.clickAction(info);
......@@ -143,5 +148,113 @@
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[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
//
//
......@@ -87,13 +87,18 @@
self.userCenterItem.campusName=@"请填写真实信息";
self.userCenterItem.schoolName=@"请填写真实信息";
self.userCenterItem.enterSchoolDate=@"请填写真实信息";
}
-(void)setViews{
[self loadData];
self.allSchoolModel=[FetchAllSchoolModel new];
self.saveModel=[SaveUserInfoModel 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];
_schoolArray = [[NSMutableArray alloc]init];
_allDataArray = [[NSArray alloc]init];
......@@ -153,9 +158,10 @@
self.saveSuccess();
}
else{
} else {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool showText:@"服务器内部错误,请联系管路员处理!"];
});
}
}
......
//
//
......@@ -7,7 +7,6 @@
// 自助页面
#import <UIKit/UIKit.h>
#import <WebKit/WebKit.h>
@interface ZXSelfHelpViewController : UIViewController
//广告链接
......@@ -16,12 +15,13 @@
@property (nonatomic, copy) NSString *selfHelpTitle;
//自助类型
@property (nonatomic, copy) NSString *selfHelpType;
@property (nonatomic, strong) WKWebView *webView;
@property (nonatomic, copy) NSString *jsStr;
//模式 1.条码,2扫码,3 混合
@property (nonatomic, assign) NSInteger model;
//混合模式下的默认使用方式(1.条码,2扫码)
@property (nonatomic, assign) NSInteger defaultModel;
@property (nonatomic, copy) dispatch_block_t backAction;
@end
//
//
......@@ -23,6 +23,7 @@
@property (nonatomic, strong) UIImageView *adImageView;
@property (nonatomic, strong) UIButton *startDrink;
@property (nonatomic, strong) ZXDrinkMerthinModel *currentMerthin;
@property (nonatomic, strong) dispatch_source_t gcdTimer;
@end
@implementation ZXDrinkViewController
......@@ -270,7 +271,14 @@
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 ==========
- (UITableView *)myTableView {
......@@ -426,4 +434,16 @@
// }
// 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
//
//
......@@ -702,7 +702,7 @@ static NSInteger seq = 0;
//当没得校区的时候就判定为个人信息没有完善
NSLog(@"====%@",CacheCampusId);
if ([CacheCampusId isEqualToString:@""]){
if ([CacheCampusId isEqualToString:@""] || [CacheCampusId isEqualToString:@"0"]){
_infoView = [[PerfectInformation alloc]initWithFrame:CGRectMake(0, 0, kWidth, kHeight)];
__weak typeof (self) weakSelf=self;
......
//
//
......@@ -902,8 +902,8 @@ void ProviderReleaseData (void *info, const void *data, size_t size){
make.height.mas_equalTo(0 * k6Scale);
make.bottom.equalTo(superView.mas_bottom).offset(-bottomMargin);
}];
[ZXPayManager sharedZXPayManager].notPayOrderView = notPayView;
[self createNotPayOrderView:notPayView];//创建广告view
// [ZXPayManager sharedZXPayManager].notPayOrderView = notPayView;
// [self createNotPayOrderView:notPayView];//创建广告view
}
dispatch_async(dispatch_get_global_queue(0, 0), ^{
@weakify(self);
......@@ -1027,34 +1027,40 @@ void ProviderReleaseData (void *info, const void *data, size_t size){
}
#pragma mark - ========== 首页下拉刷新显示未支付订单 ==========
+(void) firstPageRefreshAddNotPayView:(UIView *) v {
if ([ZXPayManager sharedZXPayManager].notPayOrderView == nil) {
UIView *notPayView;
CGFloat bottomMargin = 49;
if (iPhoneX) {
bottomMargin = 83;
}
notPayView = [[UIView alloc] init];
notPayView.backgroundColor = [UIColor whiteColor];
[v addSubview:notPayView];
[notPayView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(v);
make.height.mas_equalTo(0 * k6Scale);
make.bottom.equalTo(v.mas_bottom).offset(-bottomMargin);
}];
[ZXPayManager sharedZXPayManager].notPayOrderView = notPayView;
[self createNotPayOrderView:notPayView];//创建广告view
}
if ([ZXNotPay findByCriteria:[NSString stringWithFormat:@"where userId = '%@'", CacheUserId]].count) {
ZXNotPay *m = [ZXNotPay findByCriteria:[NSString stringWithFormat:@"where userId = '%@'", CacheUserId]].lastObject;
[ZXPayManager sharedZXPayManager].orderId = m.orderId;
dispatch_async(dispatch_get_main_queue(), ^{
[[ZXPayManager sharedZXPayManager].notPayOrderView mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(50);
}];
});
} else {
[self createNotPayOrderView:[ZXPayManager sharedZXPayManager].notPayOrderView];
}
//暂时注释掉
// if ([ZXPayManager sharedZXPayManager].notPayOrderView == nil) {
// UIView *notPayView;
// CGFloat bottomMargin = 49;
// if (iPhoneX) {
// bottomMargin = 83;
// }
// notPayView = [[UIView alloc] init];
// notPayView.backgroundColor = [UIColor whiteColor];
// [v addSubview:notPayView];
// [notPayView mas_makeConstraints:^(MASConstraintMaker *make) {
// make.left.right.equalTo(v);
// make.height.mas_equalTo(0 * k6Scale);
// make.bottom.equalTo(v.mas_bottom).offset(-bottomMargin);
// }];
// [ZXPayManager sharedZXPayManager].notPayOrderView = notPayView;
// [self createNotPayOrderView:notPayView];//创建广告view
// }
// if ([ZXNotPay findByCriteria:[NSString stringWithFormat:@"where userId = '%@'", CacheUserId]].count) {
// ZXNotPay *m = [ZXNotPay findByCriteria:[NSString stringWithFormat:@"where userId = '%@'", CacheUserId]].lastObject;
// [ZXPayManager sharedZXPayManager].orderId = m.orderId;
// if ([ZXPayManager sharedZXPayManager].notPayOrderView.subviews.count) {
// dispatch_async(dispatch_get_main_queue(), ^{
// [[ZXPayManager sharedZXPayManager].notPayOrderView mas_updateConstraints:^(MASConstraintMaker *make) {
// make.height.mas_equalTo(50);
// }];
// });
// } 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){
ZXNotPay *p = [[ZXNotPay alloc] init];
p.orderId = orderId;
p.userId = CacheUserId;
p.orderTitle = order;
[p save];
[self createNotPayViewBySuperView:v orderDetail:orderId alertStr:order];
});
......@@ -1103,7 +1110,7 @@ void ProviderReleaseData (void *info, const void *data, size_t size){
[backView mas_makeConstraints:^(MASConstraintMaker *make) {
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];
[backView addSubview:iconImageView];
iconImageView.image = [UIImage imageNamed:@"home_tishi_icon"];
......
//
//
......@@ -203,7 +203,7 @@
NSArray *controllers = self.navigationController.childViewControllers;
NSArray *res = [[controllers reverseObjectEnumerator] allObjects];
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];
}
}
......
//
//
......@@ -59,9 +59,17 @@
[ZXNewPayLessMoneyModel saveObjects:accounts];
if (dic && dic[@"paymentAndActiveInfos"]) {
[self.payTypes removeAllObjects];
NSInteger defaultPayType = -1;//默认为-1
if (responseObject[@"defaultPayType"]) {
defaultPayType = [responseObject[@"defaultPayType"] integerValue];
}
NSArray *arr = [ZXNewPayTypeModel mj_objectArrayWithKeyValuesArray:dic[@"paymentAndActiveInfos"]];
for (ZXNewPayTypeModel *ty in arr) {
ty.payableMoney = self.order.payableMoney;
if (([ty.payType integerValue] == defaultPayType)) {
ty.isSelect = YES;
self.currentPayType = ty;
}
if ([ty.payType isEqualToString:@"6"]) {
ty.sortIndex = 1;
} else if ([ty.payType isEqualToString:@"7"]) {
......
//
//
......@@ -13,6 +13,8 @@ NS_ASSUME_NONNULL_BEGIN
@interface ZXNotPay : JKDBModel
@property (nonatomic, copy) NSString *userId;
@property (nonatomic, assign) NSInteger orderId;
@property (nonatomic, copy) NSString *orderTitle;
@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