Commit 65a068ef by 刘卓鑫

同步3.7.3代码

parent 0441bb0f
......@@ -7,6 +7,9 @@
objects = {
/* Begin PBXBuildFile section */
1C5B26B8225B3B7B001B0E1B /* ZXSettingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C5B26B7225B3B7B001B0E1B /* ZXSettingViewController.m */; };
1C5B26BB225B3B85001B0E1B /* ZXUserSettingTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C5B26B9225B3B83001B0E1B /* ZXUserSettingTableViewCell.m */; };
1C5B26BE225B3B8F001B0E1B /* ZXUserSettingModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C5B26BC225B3B8E001B0E1B /* ZXUserSettingModel.m */; };
1C73BEEB22439B8D0078947F /* ZXBDTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C73BEEA22439B8D0078947F /* ZXBDTool.m */; };
1C73BEED22439F8D0078947F /* SafariServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1C73BEEC22439F8C0078947F /* SafariServices.framework */; };
1C73BEEF2243A0080078947F /* EventKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1C73BEEE2243A0070078947F /* EventKit.framework */; };
......@@ -14,6 +17,7 @@
1C73BEF722447BDD0078947F /* baidumobadsdk.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 1C73BEF522447BDC0078947F /* baidumobadsdk.bundle */; };
1C73BEFB22447DA90078947F /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1C73BEFA22447DA90078947F /* MessageUI.framework */; };
1C73BEFE22448E050078947F /* ZXBDADTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C73BEFD22448E050078947F /* ZXBDADTableViewCell.m */; };
1CA31627225C6AB2005ECF2B /* ZXAnnouncementView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1CA31626225C6AB2005ECF2B /* ZXAnnouncementView.m */; };
2215B61C1F95B12B00C37778 /* BYHelp.m in Sources */ = {isa = PBXBuildFile; fileRef = 2215B60C1F95B12300C37778 /* BYHelp.m */; };
2215B61D1F95B12B00C37778 /* GraphicsCode.m in Sources */ = {isa = PBXBuildFile; fileRef = 2215B60E1F95B12300C37778 /* GraphicsCode.m */; };
2215B61E1F95B12B00C37778 /* HYSegmentedControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 2215B6101F95B12300C37778 /* HYSegmentedControl.m */; };
......@@ -79,8 +83,6 @@
22704AC91F4816D600B8D786 /* ZHPickView.m in Sources */ = {isa = PBXBuildFile; fileRef = 22704AC81F4816D600B8D786 /* ZHPickView.m */; };
22704ACC1F4816E500B8D786 /* FetchAllSchoolModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 22704ACB1F4816E500B8D786 /* FetchAllSchoolModel.m */; };
22704ACF1F48170900B8D786 /* UserCenterModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 22704ACE1F48170900B8D786 /* UserCenterModel.m */; };
22704AF11F481A6600B8D786 /* UserSettingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 22704AEF1F481A6600B8D786 /* UserSettingViewController.m */; };
22704AF21F481A6600B8D786 /* UserSettingViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 22704AF01F481A6600B8D786 /* UserSettingViewController.xib */; };
22704B061F481B0A00B8D786 /* ChangeDevicePasswordModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 22704B021F481B0A00B8D786 /* ChangeDevicePasswordModel.m */; };
22704B071F481B0A00B8D786 /* ChangePassWordModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 22704B041F481B0A00B8D786 /* ChangePassWordModel.m */; };
22704B091F481B1100B8D786 /* ChangePhoneModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 22704B081F481B1100B8D786 /* ChangePhoneModel.m */; };
......@@ -88,8 +90,6 @@
22704B261F4827CB00B8D786 /* PerfectInformation.xib in Resources */ = {isa = PBXBuildFile; fileRef = 22704B251F4827CB00B8D786 /* PerfectInformation.xib */; };
22721FD81FBA954C0019D0B6 /* ServerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 22721FD61FBA954C0019D0B6 /* ServerViewController.m */; };
22721FD91FBA954C0019D0B6 /* ServerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 22721FD71FBA954C0019D0B6 /* ServerViewController.xib */; };
2278954C1FCD598E001AC3FA /* AnnouncementView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2278954B1FCD598E001AC3FA /* AnnouncementView.m */; };
2278954E1FCD599B001AC3FA /* AnnouncementView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2278954D1FCD599B001AC3FA /* AnnouncementView.xib */; };
2293F74E204D232B00604690 /* AllowEequipCountLoginModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 2293F74D204D232B00604690 /* AllowEequipCountLoginModel.m */; };
229A0E441F99D40700B2A8E3 /* UIView+Shadow.m in Sources */ = {isa = PBXBuildFile; fileRef = 229A0E431F99D40700B2A8E3 /* UIView+Shadow.m */; };
22D62B9F1F68D8A900134AC1 /* DeleteAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = 22D62B9E1F68D8A900134AC1 /* DeleteAlertView.m */; };
......@@ -668,6 +668,12 @@
/* Begin PBXFileReference section */
132BED71A20711521148E46B /* libPods-ColorfulSchool.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ColorfulSchool.a"; sourceTree = BUILT_PRODUCTS_DIR; };
1C5B26B6225B3B7B001B0E1B /* ZXSettingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZXSettingViewController.h; sourceTree = "<group>"; };
1C5B26B7225B3B7B001B0E1B /* ZXSettingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZXSettingViewController.m; sourceTree = "<group>"; };
1C5B26B9225B3B83001B0E1B /* ZXUserSettingTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZXUserSettingTableViewCell.m; sourceTree = "<group>"; };
1C5B26BA225B3B84001B0E1B /* ZXUserSettingTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZXUserSettingTableViewCell.h; sourceTree = "<group>"; };
1C5B26BC225B3B8E001B0E1B /* ZXUserSettingModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZXUserSettingModel.m; sourceTree = "<group>"; };
1C5B26BD225B3B8F001B0E1B /* ZXUserSettingModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZXUserSettingModel.h; sourceTree = "<group>"; };
1C73BEE922439B8D0078947F /* ZXBDTool.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ZXBDTool.h; sourceTree = "<group>"; };
1C73BEEA22439B8D0078947F /* ZXBDTool.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ZXBDTool.m; sourceTree = "<group>"; };
1C73BEEC22439F8C0078947F /* SafariServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SafariServices.framework; path = System/Library/Frameworks/SafariServices.framework; sourceTree = SDKROOT; };
......@@ -679,6 +685,8 @@
1C73BEFC22448E050078947F /* ZXBDADTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ZXBDADTableViewCell.h; sourceTree = "<group>"; };
1C73BEFD22448E050078947F /* ZXBDADTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ZXBDADTableViewCell.m; sourceTree = "<group>"; };
1C73BF002244A8160078947F /* BDADHeader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BDADHeader.h; sourceTree = "<group>"; };
1CA31625225C6AB2005ECF2B /* ZXAnnouncementView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZXAnnouncementView.h; sourceTree = "<group>"; };
1CA31626225C6AB2005ECF2B /* ZXAnnouncementView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZXAnnouncementView.m; sourceTree = "<group>"; };
2215B60B1F95B12300C37778 /* BYHelp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BYHelp.h; sourceTree = "<group>"; };
2215B60C1F95B12300C37778 /* BYHelp.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BYHelp.m; sourceTree = "<group>"; };
2215B60D1F95B12300C37778 /* GraphicsCode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GraphicsCode.h; sourceTree = "<group>"; };
......@@ -784,9 +792,6 @@
22704ACB1F4816E500B8D786 /* FetchAllSchoolModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FetchAllSchoolModel.m; sourceTree = "<group>"; };
22704ACD1F48170900B8D786 /* UserCenterModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserCenterModel.h; sourceTree = "<group>"; };
22704ACE1F48170900B8D786 /* UserCenterModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UserCenterModel.m; sourceTree = "<group>"; };
22704AEE1F481A6600B8D786 /* UserSettingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserSettingViewController.h; sourceTree = "<group>"; };
22704AEF1F481A6600B8D786 /* UserSettingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UserSettingViewController.m; sourceTree = "<group>"; };
22704AF01F481A6600B8D786 /* UserSettingViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = UserSettingViewController.xib; sourceTree = "<group>"; };
22704B011F481B0A00B8D786 /* ChangeDevicePasswordModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChangeDevicePasswordModel.h; sourceTree = "<group>"; };
22704B021F481B0A00B8D786 /* ChangeDevicePasswordModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChangeDevicePasswordModel.m; sourceTree = "<group>"; };
22704B031F481B0A00B8D786 /* ChangePassWordModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChangePassWordModel.h; sourceTree = "<group>"; };
......@@ -799,9 +804,6 @@
22721FD51FBA954C0019D0B6 /* ServerViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ServerViewController.h; sourceTree = "<group>"; };
22721FD61FBA954C0019D0B6 /* ServerViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ServerViewController.m; sourceTree = "<group>"; };
22721FD71FBA954C0019D0B6 /* ServerViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ServerViewController.xib; sourceTree = "<group>"; };
2278954A1FCD598E001AC3FA /* AnnouncementView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AnnouncementView.h; sourceTree = "<group>"; };
2278954B1FCD598E001AC3FA /* AnnouncementView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AnnouncementView.m; sourceTree = "<group>"; };
2278954D1FCD599B001AC3FA /* AnnouncementView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AnnouncementView.xib; sourceTree = "<group>"; };
2293F74C204D232B00604690 /* AllowEequipCountLoginModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AllowEequipCountLoginModel.h; sourceTree = "<group>"; };
2293F74D204D232B00604690 /* AllowEequipCountLoginModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AllowEequipCountLoginModel.m; sourceTree = "<group>"; };
229A0E431F99D40700B2A8E3 /* UIView+Shadow.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIView+Shadow.m"; sourceTree = "<group>"; };
......@@ -2194,6 +2196,8 @@
22704AE51F481A5500B8D786 /* View */ = {
isa = PBXGroup;
children = (
1C5B26BA225B3B84001B0E1B /* ZXUserSettingTableViewCell.h */,
1C5B26B9225B3B83001B0E1B /* ZXUserSettingTableViewCell.m */,
);
path = View;
sourceTree = "<group>";
......@@ -2201,9 +2205,8 @@
22704AE61F481A5500B8D786 /* Controller */ = {
isa = PBXGroup;
children = (
22704AEE1F481A6600B8D786 /* UserSettingViewController.h */,
22704AEF1F481A6600B8D786 /* UserSettingViewController.m */,
22704AF01F481A6600B8D786 /* UserSettingViewController.xib */,
1C5B26B6225B3B7B001B0E1B /* ZXSettingViewController.h */,
1C5B26B7225B3B7B001B0E1B /* ZXSettingViewController.m */,
);
path = Controller;
sourceTree = "<group>";
......@@ -2213,6 +2216,8 @@
children = (
2293F74C204D232B00604690 /* AllowEequipCountLoginModel.h */,
2293F74D204D232B00604690 /* AllowEequipCountLoginModel.m */,
1C5B26BD225B3B8F001B0E1B /* ZXUserSettingModel.h */,
1C5B26BC225B3B8E001B0E1B /* ZXUserSettingModel.m */,
);
path = Modle;
sourceTree = "<group>";
......@@ -2269,9 +2274,8 @@
227895421FCD5719001AC3FA /* View */ = {
isa = PBXGroup;
children = (
2278954A1FCD598E001AC3FA /* AnnouncementView.h */,
2278954B1FCD598E001AC3FA /* AnnouncementView.m */,
2278954D1FCD599B001AC3FA /* AnnouncementView.xib */,
1CA31625225C6AB2005ECF2B /* ZXAnnouncementView.h */,
1CA31626225C6AB2005ECF2B /* ZXAnnouncementView.m */,
);
path = View;
sourceTree = "<group>";
......@@ -4669,6 +4673,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
......@@ -4691,7 +4696,6 @@
files = (
A705C00421D4B067004F1628 /* ImageSelectedOn@3x.png in Resources */,
9194204D1F3804C90023BD5D /* like.caf in Resources */,
2278954E1FCD599B001AC3FA /* AnnouncementView.xib in Resources */,
A705C01021D4B067004F1628 /* PlayButtonOverlayLargeTap@3x.png in Resources */,
A705C01621D4B067004F1628 /* VideoOverlay.png in Resources */,
A7DECC9C2079F0E30039EC22 /* ss.gif in Resources */,
......@@ -4745,7 +4749,6 @@
A705C02221D4B067004F1628 /* README.md in Resources */,
1C73BEF722447BDD0078947F /* baidumobadsdk.bundle in Resources */,
A7F3E13721B5330F00010E23 /* README.md in Resources */,
22704AF21F481A6600B8D786 /* UserSettingViewController.xib in Resources */,
22D62BA11F68D8DF00134AC1 /* DeleteAlertView.xib in Resources */,
A7265BE820CA3AEF0084B814 /* menu-holder@2x.png in Resources */,
22E36C961F558D1B00073AC2 /* BeanCell.xib in Resources */,
......@@ -4865,6 +4868,7 @@
A7033D4721B129B800E407A4 /* ZXRGGModel.m in Sources */,
A7F3E17121B5330F00010E23 /* DDRange.m in Sources */,
A77F929F217577FE00D633B4 /* ZXCustomAdView.m in Sources */,
1CA31627225C6AB2005ECF2B /* ZXAnnouncementView.m in Sources */,
A705BF6D21D477BC004F1628 /* ZXMallViewController+Extension.m in Sources */,
A754367621D331EA005584CC /* ConfirmBuyModel.m in Sources */,
A745DC00210095BD00D0C648 /* ZXPayMoneyMenuCell.m in Sources */,
......@@ -4951,7 +4955,6 @@
A7FE8D8C20C8FB330028B721 /* JKDBHelper.m in Sources */,
A7F3E01821B530F500010E23 /* ZXTopListModel.m in Sources */,
A709275C21A5033400C4759C /* ZXSimpleChangeDevicePwdViewController.m in Sources */,
22704AF11F481A6600B8D786 /* UserSettingViewController.m in Sources */,
A7DECCE72079F7D40039EC22 /* HMScannerViewController.m in Sources */,
A705C01D21D4B067004F1628 /* MWPhotoBrowser.m in Sources */,
A726249E21BA64AE008DA637 /* LimitInput.m in Sources */,
......@@ -4994,6 +4997,7 @@
22E36C991F558D1B00073AC2 /* TopUpCell.m in Sources */,
A7F3E19E21B5330F00010E23 /* XDSMarkModel.m in Sources */,
A754367C21D331EA005584CC /* RateCell.m in Sources */,
1C5B26B8225B3B7B001B0E1B /* ZXSettingViewController.m in Sources */,
A77F92A62175C23100D633B4 /* ZXConfirmPayViewController.m in Sources */,
22E36CAA1F558D9800073AC2 /* EquipmentModel.m in Sources */,
A7DECC9E2079F0E30039EC22 /* ZXWebLoadingView.m in Sources */,
......@@ -5103,7 +5107,6 @@
A7DECCA22079F0E30039EC22 /* ZXPayManager.m in Sources */,
A75436EC21D346E7005584CC /* payModelItem.m in Sources */,
A7ED820220E613A000683D41 /* ZXWashOperationModel.m in Sources */,
2278954C1FCD598E001AC3FA /* AnnouncementView.m in Sources */,
A770521B211D231D00798513 /* ZXDrinkService.m in Sources */,
22E36C901F558D1B00073AC2 /* AimiWalletViewController.m in Sources */,
A705BF6A21D4746A004F1628 /* ZXMallViewController.m in Sources */,
......@@ -5164,6 +5167,7 @@
A7F3E1C321B5350600010E23 /* unzip.c in Sources */,
22704B071F481B0A00B8D786 /* ChangePassWordModel.m in Sources */,
A7265BF420CA45690084B814 /* GYRollingNoticeView.m in Sources */,
1C5B26BB225B3B85001B0E1B /* ZXUserSettingTableViewCell.m in Sources */,
A77DE2D720DB7BCC002FB903 /* ZXWashMyInvitorCell.m in Sources */,
A7F3E02321B530F500010E23 /* ZXBookTopCell.m in Sources */,
A7B7530220A13BF10056C8F9 /* ZXWebViewManager+CacheWebView.m in Sources */,
......@@ -5304,6 +5308,7 @@
A70F504A20CE0E3200F297BC /* NSString+Extension.m in Sources */,
A73BE53E21A67BA800381F9B /* ZXSimplePayItemCell.m in Sources */,
A7FA41D221B777010016C6BE /* ZXRSReportViewController.m in Sources */,
1C5B26BE225B3B8F001B0E1B /* ZXUserSettingModel.m in Sources */,
A7F3E1C721B5352900010E23 /* zip.c in Sources */,
A7F3E02121B530F500010E23 /* ZXBookracketCell.m in Sources */,
A7F3E13521B5330F00010E23 /* DALabeledCircularProgressView.m in Sources */,
......
......@@ -84,10 +84,11 @@
[userDefaults setObject:@"http://192.168.1.33:8080" forKey:@"Ad"];
[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-customer-app.168cad.top" forKey:@"NEW_PAY"];
[userDefaults setObject:@"http://192.168.1.33:8333" 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];
break;
}
......@@ -131,6 +132,7 @@
[userDefaults setObject:@"http://ex-test-dcxy-base-app.168cad.top" forKey:@"SX_MONEY"]; //授信保证金
[userDefaults setValue:@"https://netpay.cmbchina.com/netpayment/BaseHttp.dll?MB_EUserPay" forKey:@"YWT_PAY"];
[userDefaults synchronize];
break;
}
......@@ -169,6 +171,7 @@
[userDefaults setObject:@"http://dcxy-base-app.dcrym.com" forKey:@"SX_MONEY"]; //授信保证金
[userDefaults setValue:@"https://netpay.cmbchina.com/netpayment/BaseHttp.dll?MB_EUserPay" forKey:@"YWT_PAY"];
[userDefaults synchronize];
break;
}
......
......@@ -59,7 +59,7 @@
_isPlaying = NO;
[self defaultConfig];
//启动环境
[self configSystemAPIByEnvironment:ZXColorfulSchoolEnvironmentProduct];
[self configSystemAPIByEnvironment:ZXColorfulSchoolEnvironmentDevelop];
//极光推送
[self initPushWithOptions:launchOptions isProduct:kJPushIsProduct];
//网络监测
......@@ -89,6 +89,7 @@
if ([jump isEqualToString:@"NONE"]) {
//先读取缓存
NSArray *list = [LoginJump findAll];
if (list.count == 0) {
jump = @"DC_01";
......@@ -128,15 +129,20 @@
- (void)applicationDidEnterBackground:(UIApplication *)application {
CGFloat defaultBright = [[[NSUserDefaults standardUserDefaults] objectForKey:@"defaultBright"] floatValue];
[[UIScreen mainScreen] setBrightness:defaultBright];
if ([[ZXTool getCurrentVC] isKindOfClass:NSClassFromString(@"ZXSelfHelpViewController")] || [[ZXTool getCurrentVC] isKindOfClass:NSClassFromString(@"ZXDrinkViewController")]) {
CGFloat defaultBright = [[[NSUserDefaults standardUserDefaults] objectForKey:@"defaultBright"] floatValue];
[[UIScreen mainScreen] setBrightness:defaultBright];
[[NSNotificationCenter defaultCenter] postNotificationName:kSelf_help_destory_timer object:nil];
}
}
- (void)applicationWillEnterForeground:(UIApplication *)application {
[kUserDefaults setObject:[ZXTool getCurrentTimeStamp] forKey:@"uploadBatch"];
if ([[ZXTool getCurrentVC] isKindOfClass:NSClassFromString(@"ZXSelfHelpViewController")] || [[ZXTool getCurrentVC] isKindOfClass:NSClassFromString(@"ZXDrinkViewController")]) {
[[NSNotificationCenter defaultCenter] postNotificationName:kSelf_help_start_timer object:nil];
}
}
......@@ -314,6 +320,8 @@
});
}
}
#pragma mark 极光推送相关
-(void)initPushWithOptions:(NSDictionary *)launchOptions isProduct:(BOOL) isProduct {
//初始化消息推送
......@@ -348,35 +356,8 @@
}
//iOS7.0以上版本
- (void)application:(UIApplication *)application
handleActionWithIdentifier:(NSString *)identifier
forRemoteNotification:(NSDictionary *)userInfo
completionHandler:(void (^)())completionHandler {
}
- (void)application:(UIApplication *)application
didReceiveRemoteNotification:(NSDictionary *)userInfo
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
// 取得 APNs 标准信息内容,如果没需要可以不取
// NSString *content = [aps valueForKey:@"alert"]; //推送显示的内容
// NSInteger badge = [[aps valueForKey:@"badge"] integerValue];
// NSString *sound = [aps valueForKey:@"sound"]; //播放的声音
// 取得自定义字段内容,userInfo就是后台返回的JSON数据,是一个字典
[JPUSHService handleRemoteNotification:userInfo];
if ([[UIDevice currentDevice].systemVersion floatValue]<10.0 || application.applicationState>0) {
// [rootViewController addNotificationCount];
}
completionHandler(UIBackgroundFetchResultNewData);
//[self playSoundByUserInfo:userInfo];
}
//添加处理APNs通知回调方法
#pragma mark- JPUSHRegisterDelegate
// iOS 10 Support
- (void)jpushNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(NSInteger))completionHandler {
// Required
......
//
//
......@@ -156,6 +156,7 @@
-(void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
self.navigationController.navigationBar.hidden = NO;
self.navigationController.navigationBar.translucent = YES;
self.tabBarController.tabBar.hidden = NO;
[self.tabBarController.tabBar hideBadgeOnItemIndex:1];
}
......
//
//
......@@ -33,19 +33,19 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"反馈";
self.lastId = @"";
self.pageNum = 1;
[self.view addSubview:self.myTableView];
[self createMessageInput];
[self loadNewData];
//创建观察者,监听键盘的弹出
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardShowHandle:) name:UIKeyboardWillShowNotification object:nil];
//创建观察者,监听键盘的隐藏
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardHideHandle:) name:UIKeyboardWillHideNotification object:nil];
}
#pragma mark - ========== 键盘的弹起与隐藏 ==========
- (void) keyboardShowHandle:(NSNotification *) nof {
......@@ -105,8 +105,8 @@
make.centerY.equalTo(content);
}];
self.wordCountLabel.text = @"50/50";
self.field = [[ZXTextView alloc] init];
[content addSubview:self.field];
self.field.returnKeyType = UIReturnKeyDone;
......@@ -125,10 +125,10 @@
make.right.equalTo(self.wordCountLabel.mas_left).offset(-10 * k6Scale);
make.bottom.equalTo(content.mas_bottom).offset(-6 * k6Scale);
}];
}
- (void)textViewDidChange:(UITextView *)textView {
self.wordCountLabel.text = [NSString stringWithFormat:@"%ld/50", 50 - textView.text.length];
self.wordCountLabel.text = [NSString stringWithFormat:@"%ld/50", 50 - textView.text.length];
}
#pragma mark - ========== UITableView/Delegate/Datasource ==========
- (UITableView *)myTableView {
......@@ -152,13 +152,71 @@
_myTableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(loadNewData)];
_myTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
_myTableView.showsVerticalScrollIndicator = NO;
}
return _myTableView;
}
#pragma mark - ========== 获取反馈信息内容 ==========
- (void) loadNewData {
[ZXTool requestDataWithType:kXMHTTPMethodGET url:[NSString stringWithFormat:@"%@/dcxy/api/customer/feedBack?customerId=%@&pageNum=%ld&pageSize=10&lastId=%@", [kUserDefaults valueForKey:@"Recharge"],[kUserDefaults valueForKey:@"userId"], (long)self.pageNum, self.lastId] para:nil completed:^(CommonModel *common, NSString *error) {
// [ZXTool requestDataWithType:kXMHTTPMethodGET url:[NSString stringWithFormat:@"%@/dcxy/api/customer/feedBack?customerId=%@&pageNum=%ld&pageSize=10&lastId=%@", [kUserDefaults valueForKey:@"Recharge"],[kUserDefaults valueForKey:@"userId"], (long)self.pageNum, self.lastId] para:nil completed:^(CommonModel *common, NSString *error) {
// if (error != nil) {
// dispatch_async(dispatch_get_main_queue(), ^{
// [ZXTool hideLoadingAnimation];
// [ZXTool showText:error];
// [self.myTableView.mj_header endRefreshing];
// });
// }
// NSArray *list = common.data;
// if (list.count == 0) {
// dispatch_async(dispatch_get_main_queue(), ^{
// [ZXTool hideLoadingAnimation];
// [self.myTableView.mj_header endRefreshing];
// [self.myTableView reloadData];
// });
// return;
// }
// self.pageNum++;//页码+1
// self.lastId = [list firstObject][@"id"];
// NSInteger count = list.count;
// for (int i = 0; i < count; i++) {
// NSDictionary *dic = common.data[i];
// ZXSimpleChatModel *content = [[ZXSimpleChatModel alloc] init];
// content.content = dic[@"content"];
// content.time = dic[@"createDate"];
// content.id = dic[@"id"];
// content.isYouerself = YES;
// [self.dataSource addObject:content];
// if (dic[@"replay"] && ![dic[@"replay"] isKindOfClass:[NSNull class]]) {
// ZXSimpleChatModel *replay = [[ZXSimpleChatModel alloc] init];
// replay.content = dic[@"replay"];
// replay.time = dic[@"createDate"];
// replay.id = dic[@"id"];
// replay.isYouerself = NO;
// [self.dataSource addObject:replay];
// }
// if (i == count - 1) {
// [ZXSimpleIsHasReplay clearTable];
// ZXSimpleIsHasReplay *mm = [[ZXSimpleIsHasReplay alloc] init];
// mm.userId = [kUserDefaults valueForKey:@"userId"];
// mm.id = dic[@"id"];
// if (dic[@"replay"] && ![dic[@"replay"] isKindOfClass:[NSNull class]]) {
// mm.replay = dic[@"replay"];
// } else {
// mm.replay = @"";
// }
// [mm save];//保存标示
// }
// }
// dispatch_async(dispatch_get_main_queue(), ^{
// [ZXTool hideLoadingAnimation];
// [self.myTableView.mj_header endRefreshing];
// [self.myTableView reloadData];
// });
// }];
//
[ZXTool requestDataWithType:kXMHTTPMethodGET url:[NSString stringWithFormat:@"%@/dcxy/customerFeedback/customerFeedback?customerId=%@&pageSize=10&lastId=%@", [kUserDefaults valueForKey:@"NEW_PAY"],[kUserDefaults valueForKey:@"userId"], self.lastId] para:nil completed:^(CommonModel *common, NSString *error) {
if (error != nil) {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
......@@ -186,13 +244,15 @@
content.id = dic[@"id"];
content.isYouerself = YES;
[self.dataSource addObject:content];
if (dic[@"replay"] && ![dic[@"replay"] isKindOfClass:[NSNull class]]) {
ZXSimpleChatModel *replay = [[ZXSimpleChatModel alloc] init];
replay.content = dic[@"replay"];
replay.time = dic[@"createDate"];
replay.id = dic[@"id"];
replay.isYouerself = NO;
[self.dataSource addObject:replay];
if (dic[@"replayList"] && ![dic[@"replayList"] isKindOfClass:[NSNull class]]) {
for (NSDictionary *ddd in dic[@"replayList"]) {
ZXSimpleChatModel *replay = [[ZXSimpleChatModel alloc] init];
replay.content = ddd[@"replayContent"];
replay.time = dic[@"replayAt"];
replay.id = dic[@"feedbackId"];
replay.isYouerself = NO;
[self.dataSource addObject:replay];
}
}
if (i == count - 1) {
[ZXSimpleIsHasReplay clearTable];
......@@ -218,7 +278,7 @@
return self.dataSource.count;
}
- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
ZXSimpleChatModel *chat = self.dataSource[indexPath.row];
if (chat.isYouerself) {
ZXSimpleFeedbackOwnerCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ZXSimpleFeedbackOwnerCell"];
......@@ -242,8 +302,8 @@
return model.cellH;
}
CGSize sizeToFit = [model.content sizeWithFont:kFontSize(14 * k6Scale)
constrainedToSize:CGSizeMake(230 * k6Scale, CGFLOAT_MAX)
lineBreakMode:NSLineBreakByWordWrapping];
constrainedToSize:CGSizeMake(230 * k6Scale, CGFLOAT_MAX)
lineBreakMode:NSLineBreakByWordWrapping];
model.cellH = sizeToFit.height + 70 * k6Scale;
return model.cellH;
}
......@@ -251,7 +311,7 @@
- (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 40 * k6Scale)];
header.backgroundColor = kRGB(238, 238, 238);
UIView *holder = [[UIView alloc] init];
holder.backgroundColor = [UIColor colorWithHexString:@"#f93d3d"];
holder.layer.cornerRadius = 16 * k6Scale;
......@@ -271,19 +331,19 @@
make.edges.equalTo(holder).insets(UIEdgeInsetsMake(5 * k6Scale, 10 * k6Scale, 5 * k6Scale, 10 * k6Scale));
make.height.mas_equalTo(22 * k6Scale);
}];
return header;
}
- (CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
return 40 * k6Scale;
}
-(void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
self.navigationController.navigationBar.hidden = NO;
[self.tabBarController.tabBar hideBadgeOnItemIndex:2];
}
......@@ -293,7 +353,7 @@
[ZXTool showText:@"不能输入表情"];
return;
}
if (self.field.text.length < 1) {
[ZXTool showText:@"请输入反馈内容"];
return;
......@@ -302,40 +362,64 @@
[self uploadReplay:self.field];
}
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
return YES;
}
#pragma mark - ========== 提交反馈内容 ==========
- (void) uploadReplay:(UITextView *) textField {
[ZXTool requestDataWithType:kXMHTTPMethodPOST url:[NSString stringWithFormat:@"%@/dcxy/api/customer/join/feedBack", [kUserDefaults valueForKey:@"Recharge"]] para:@{@"userId":CacheUserId,@"account":CacheAccount, @"campusId":CacheCampusId, @"content":textField.text} completed:^(CommonModel *common, NSString *error) {
if (error != nil) {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
[ZXTool showText:error];
});
} else {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool showText:@" 反馈成功 "];
ZXSimpleChatModel *model = [[ZXSimpleChatModel alloc] init];
model.content = textField.text;
model.time = [self getCurrentTimes];
model.isYouerself = YES;
[textField resignFirstResponder];
textField.text = @"";
[ZXTool hideLoadingAnimation];
[self.dataSource addObject:model];
[self.myTableView reloadData];
});
}
// [ZXTool requestDataWithType:kXMHTTPMethodPOST url:[NSString stringWithFormat:@"%@/dcxy/api/customer/join/feedBack", [kUserDefaults valueForKey:@"Recharge"]] para:@{@"userId":CacheUserId,@"account":CacheAccount, @"campusId":CacheCampusId, @"content":textField.text} completed:^(CommonModel *common, NSString *error) {
// if (error != nil) {
// dispatch_async(dispatch_get_main_queue(), ^{
// [ZXTool hideLoadingAnimation];
// [ZXTool showText:error];
// });
// } else {
// dispatch_async(dispatch_get_main_queue(), ^{
// [ZXTool showText:@" 反馈成功 "];
// ZXSimpleChatModel *model = [[ZXSimpleChatModel alloc] init];
// model.content = textField.text;
// model.time = [self getCurrentTimes];
// model.isYouerself = YES;
// [textField resignFirstResponder];
// textField.text = @"";
// [ZXTool hideLoadingAnimation];
// [self.dataSource addObject:model];
// [self.myTableView reloadData];
// });
// }
// }];
[ZXTool requestDataWithType:kXMHTTPMethodPOST url:[NSString stringWithFormat:@"%@/dcxy/customerFeedback/customerFeedback", [kUserDefaults valueForKey:@"NEW_PAY"]] para:@{@"customerId":CacheUserId,@"content":textField.text} completed:^(CommonModel *common, NSString *error) {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
if (error != nil) {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
[ZXTool showText:error];
});
} else {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool showText:@" 反馈成功 "];
ZXSimpleChatModel *model = [[ZXSimpleChatModel alloc] init];
model.content = textField.text;
model.time = [self getCurrentTimes];
model.isYouerself = YES;
[textField resignFirstResponder];
textField.text = @"";
[ZXTool hideLoadingAnimation];
[self.dataSource addObject:model];
[self.myTableView reloadData];
});
}
});
}];
}
//获取当前的时间
-(NSString*)getCurrentTimes{
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
// ----------设置你想要的格式,hh与HH的区别:分别表示12小时制,24小时制
[formatter setDateFormat:@"YYYY-MM-dd HH:mm:ss"];
......@@ -345,7 +429,7 @@
NSString *currentTimeString = [formatter stringFromDate:datenow];
NSLog(@"currentTimeString = %@",currentTimeString);
return currentTimeString;
}
-(NSMutableArray *)dataSource {
if (!_dataSource) {
......
//
//
......@@ -30,7 +30,7 @@
#import "ZXSimpleGoRechargeViewController.h"
#import "ZXUserModel.h"
//========老版本部分内容-===============
#import "AnnouncementView.h"
#import "ZXAnnouncementView.h"
#import "CampasVersionUpdateModel.h"
#import "JudgeFirstTopUpModel.h"
#import "JudgeFirstTopUpModel.h"
......@@ -70,7 +70,7 @@
*/
@property (nonatomic, strong)PerfectInformation * infoView;
//强弹公告
@property (nonatomic, strong)AnnouncementView * announce;
@property (nonatomic, strong)ZXAnnouncementView * announce;
@property (nonatomic, strong)CampasVersionUpdateModel * updateModel;
@property (nonatomic,strong) UIAlertView * updateAlert;
@property (nonatomic, assign) BOOL isShowVersion;
......@@ -326,6 +326,7 @@ static NSInteger seq = 0;
[super viewWillAppear:animated];
[UIApplication sharedApplication].statusBarStyle = 0;
[UIApplication sharedApplication].statusBarHidden = NO; self.navigationController.navigationBar.hidden = YES;
self.navigationController.navigationBar.translucent = YES;
self.tabBarController.tabBar.hidden = NO;
[self oldVersion];
......@@ -614,31 +615,20 @@ static NSInteger seq = 0;
}
#pragma mark - ========== 显示公告 ==========
- (void) showPublishWithItem:(ZXInformation *) info {
if (_announce) {
if (self.announce) {
return;
}
NSString *jumpUrl = [NSString stringWithFormat:@"%@/Content/%ld?title=%@", [kUserDefaults valueForKey:@"h5FirstPage"], (long)info.id, info.title];
AnnounceModelItem *item = [[AnnounceModelItem alloc] init];
item.noticeTitle = info.title;
item.noticeContent = jumpUrl;
item.updateDate = info.createTime;
item.noticeType = @"3";
item.forceId = [NSString stringWithFormat:@"%ld", info.id];
_announce=[[AnnouncementView alloc]initWithFrame:CGRectMake(0, 0, kWidth, kHeight)];
_announce.announceItem=item;
@weakify(self);
_announce.ok = ^(BOOL noNotice) {
@strongify(self);
self.announce.hidden = YES;
[self.announce removeFromSuperview];
NSString *jumpUrl = [NSString stringWithFormat:@"%@/Content/%ld?title=%@", [kUserDefaults objectForKey:@"h5FirstPage"],(long)info.id, info.title];
kWeakSelf(self);
self.announce = [[ZXAnnouncementView alloc] initWithFrame:[UIScreen mainScreen].bounds jumpUrl:jumpUrl];
self.announce.comfirm = ^(BOOL isNotAlert) {
kStrongSelf(self);
self.announce = nil;
//访问不再提醒接口
if (noNotice==YES) {
if (isNotAlert==YES) {
[self.service notShowPublishMsgWithInfo:info];
}
};
[[ZXTool returnKeyWindow] addSubview:_announce];
[kAppWindow addSubview:self.announce];
}
#pragma mark - ========== 内存警告 ==========
......@@ -728,8 +718,7 @@ static NSInteger seq = 0;
webVc.isFromSimple = YES;
[self.navigationController pushViewController:webVc animated:YES];
} else if ([operation.defaultValue isEqualToString:@"997"]) {
ZXJTJYViewController *jtjyVc = [[ZXJTJYViewController alloc] init];
[self.navigationController pushViewController:jtjyVc animated:YES];
[self jtAction];
} else if ([operation.defaultValue isEqualToString:@"8"]) {
UIViewController *vc= [[NSClassFromString(@"ZXWisdomLatticeViewController") alloc] init];
[self.navigationController pushViewController:vc animated:YES];
......@@ -759,6 +748,8 @@ static NSInteger seq = 0;
ZXMallViewController *webVc = [[ZXMallViewController alloc] init];
webVc.isFromSimple = YES;
[self.navigationController pushViewController:webVc animated:YES];
} else if ([operation.defaultValue isEqualToString:@"997"]) {
[self jtAction];
} else if ([operation.defaultValue isEqualToString:@"8"]) {
UIViewController *vc= [[NSClassFromString(@"ZXWisdomLatticeViewController") alloc] init];
[self.navigationController pushViewController:vc animated:YES];
......@@ -774,7 +765,43 @@ static NSInteger seq = 0;
}
}
}
#pragma mark - ==========金图教育==========
- (void) jtAction {
//查询是否授权
[ZXTool requestDataWithType:kXMHTTPMethodGET url:[NSString stringWithFormat:@"%@/dcxy/app/jt/whether/grant?customerId=%@", [kUserDefaults valueForKey:@"h5FirstPageAPI"], CacheUserId] para:nil completed:^(CommonModel *common, NSString *error) {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
if (error) {
[ZXTool showText:error];
} else {
if ([common.data integerValue] == 0) {
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"您将授权使用第三方的精图教育服务,精图提供教资、考研、国考等精选课程;授权后精图将使用您的多彩相关信息!" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *ac1 = [UIAlertAction actionWithTitle:@"取消" style:0 handler:^(UIAlertAction * _Nonnull action) {
}];
UIAlertAction *ac2 = [UIAlertAction actionWithTitle:@"同意" style:0 handler:^(UIAlertAction * _Nonnull action) {
//金图教育
ZXJTJYViewController *jtjyVc = [[ZXJTJYViewController alloc] init];
[self.navigationController pushViewController:jtjyVc animated:YES];
[ZXTool requestDataWithType:kXMHTTPMethodGET url:[NSString stringWithFormat:@"%@/dcxy/app/jt/grant?customerId=%@&grant=1", [kUserDefaults valueForKey:@"h5FirstPageAPI"], CacheUserId] para:nil completed:^(CommonModel *common, NSString *error) {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
});
}];
}];
[alert addAction:ac1];
[alert addAction:ac2];
[self presentViewController:alert animated:YES completion:nil];
} else {
//金图教育
ZXJTJYViewController *jtjyVc = [[ZXJTJYViewController alloc] init];
[self.navigationController pushViewController:jtjyVc animated:YES];
}
}
});
}];
}
#pragma mark - ========== 壁挂跳转 ==========
- (void) jumpDrinkByOperation:(ZXOperation *) operation {
//获取配置信息
......
//
//
......@@ -45,6 +45,17 @@ static NSString *kFailurMsg = @"数据加载失败,请检查一下当前网络
/*一网通支付结果通知*/
#define kYWT_PAY_RESULT @"ywtPayResult"
//订单模式下 完成支付的通知
#define kOrder_Completed_Pay @"kOrder_Completed_Pay"
//订单模式下 立即刷新是否有待支付订单的通知
#define kOrder_CheckNopPay_Pay @"kOrder_CheckNopPay_Pay"
//自助服务页面 定时器销毁 (app退到后台)
#define kSelf_help_destory_timer @"kSelf_help_destory_timer"
//自助服务页面 定时器开启 (app进入前台)
#define kSelf_help_start_timer @"kSelf_help_start_timer"
/*首页的key和value--对应rootUrl*/
#define kMALL_IDENTIFIER_VALUE @"first_page_key"
#define kMALL_IDENTIFIER_KEY @"first_page_key_KEY"
......
//
//
......@@ -49,13 +49,17 @@
}
- (void)setModel:(ZXCoverAdModel *)model {
_model = model;
if (_model.isRender) {
return;
}
_model.isRender = YES;
if ([_model.adSource isEqualToString:@"TXAD"]) {
if (self.nativeAd == nil) {
self.nativeAd = [[GDTNativeExpressAd alloc] initWithAppId:kTXAdAPPID placementId:kTXAdPLACEMENTID adSize:CGSizeMake(kScreenWidth, kScreenWidth * 0.56)];
self.nativeAd.delegate = self;
}
[self.nativeAd loadAd:1];
} else if ([_model.adSource isEqualToString:@"TXAD"]) {
} else if ([_model.adSource isEqualToString:@"RSAD"]) {
//瑞狮广告
NSString *idfv = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
......@@ -80,7 +84,7 @@
[self.contentView addSubview:self.sharedAdView];
[self.sharedAdView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.contentView);
make.edges.equalTo(self.contentView).insets(UIEdgeInsetsMake(10 * k6Scale, 5 * k6Scale, 0, 5 * k6Scale));;
}];
self.sharedAdView.delegate = self;
......@@ -99,7 +103,7 @@
[expressView render];
[self.contentView addSubview:expressView];
[expressView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.contentView);
make.edges.equalTo(self.contentView).insets(UIEdgeInsetsMake(10 * k6Scale, 5 * k6Scale, 0, 5 * k6Scale));
}];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
......
//
//
......@@ -70,4 +70,8 @@
//曝光需要
@property (nonatomic, copy) NSString *adsenseName;
@property (nonatomic, assign) BOOL isRender;
@end
//
//
......@@ -39,60 +39,7 @@
}];
[_adImageView sd_setImageWithURL:[NSURL URLWithString:model.uploadImg]];
UIImageView *closeBg = [[UIImageView alloc] init];
[_adImageView addSubview:closeBg];
closeBg.userInteractionEnabled = YES;
closeBg.image = [UIImage imageNamed:@"wwww"];
[closeBg mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(_adImageView.mas_right).offset(-10 * k6Scale);
make.top.equalTo(_adImageView.mas_top).offset(10 * k6Scale);
}];
UILabel *closeLabel = [[UILabel alloc] init];
closeLabel.textColor = [UIColor colorWithHexString:@"#ffffff"];
[closeBg addSubview:closeLabel];
closeLabel.font = kFontSize(12 * k6Scale);
[closeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.centerY.equalTo(closeBg);
}];
__block int cou = model.showTime<3?3:(int)model.showTime;
closeLabel.text = [NSString stringWithFormat:@"%ld 跳过", (long)cou];
UITapGestureRecognizer *closeCountingDown = [[UITapGestureRecognizer alloc] init];
[closeBg addGestureRecognizer:closeCountingDown];
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, 1.0 * NSEC_PER_SEC, 0.0 * NSEC_PER_SEC);
dispatch_source_set_event_handler(self.gcdTimer, ^{
dispatch_async(dispatch_get_main_queue(), ^{
closeLabel.text = [NSString stringWithFormat:@"%d 跳过", (int)cou];
if(cou == 0) {
// 终止定时器
dispatch_cancel(self.gcdTimer);
self.gcdTimer = nil;
//移除广告
[self removeCoverAd:_adImageView];
}
cou --;
});
});
// 启动任务,GCD计时器创建后需要手动启动
dispatch_resume(self.gcdTimer);
@weakify(self);
[[closeCountingDown rac_gestureSignal] subscribeNext:^(id x) {
@strongify(self);
// 终止定时器
dispatch_cancel(self.gcdTimer);
self.gcdTimer = nil;
//移除广告
[self removeCoverAd:_adImageView];
}];
UITapGestureRecognizer *jump = [[UITapGestureRecognizer alloc] init];
[_adImageView addGestureRecognizer:jump];
[[jump rac_gestureSignal] subscribeNext:^(id x) {
@strongify(self);
[self action:model];
}];
[self addRemoveView:_adImageView model:model];
} else {
UITableView *tableView = [[UITableView alloc] init];
tableView.delegate = self;
......@@ -104,16 +51,84 @@
}];
tableView.tableFooterView = [UIView new];
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
ZXCoverAdModel *model = items.firstObject;
if (model.showTime > 0) {
[self addRemoveView:self model:model];
}
}
}
return self;
}
#pragma mark - ==========添加倒计时/移除广告view==========
/*
* superView 父视图
* model 单个浮动对应模型
*/
- (void) addRemoveView:(UIView *) superView
model:(ZXCoverAdModel *) model {
UIImageView *closeBg = [[UIImageView alloc] init];
[superView addSubview:closeBg];
closeBg.userInteractionEnabled = YES;
closeBg.image = [UIImage imageNamed:@"wwww"];
[closeBg mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(superView.mas_right).offset(-10 * k6Scale);
make.top.equalTo(superView.mas_top).offset(10 * k6Scale);
}];
UILabel *closeLabel = [[UILabel alloc] init];
closeLabel.textColor = [UIColor colorWithHexString:@"#ffffff"];
[closeBg addSubview:closeLabel];
closeLabel.font = kFontSize(12 * k6Scale);
[closeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.centerY.equalTo(closeBg);
}];
__block int cou = model.showTime<3?3:(int)model.showTime;
closeLabel.text = [NSString stringWithFormat:@"%ld 跳过", (long)cou];
UITapGestureRecognizer *closeCountingDown = [[UITapGestureRecognizer alloc] init];
[closeBg addGestureRecognizer:closeCountingDown];
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, 1.0 * NSEC_PER_SEC, 0.0 * NSEC_PER_SEC);
dispatch_source_set_event_handler(self.gcdTimer, ^{
dispatch_async(dispatch_get_main_queue(), ^{
closeLabel.text = [NSString stringWithFormat:@"%d 跳过", (int)cou];
if(cou == 0) {
// 终止定时器
dispatch_cancel(self.gcdTimer);
self.gcdTimer = nil;
//移除广告
[self removeCoverAd:superView];
}
cou --;
});
});
// 启动任务,GCD计时器创建后需要手动启动
dispatch_resume(self.gcdTimer);
@weakify(self);
[[closeCountingDown rac_gestureSignal] subscribeNext:^(id x) {
@strongify(self);
// 终止定时器
dispatch_cancel(self.gcdTimer);
self.gcdTimer = nil;
//移除广告
[self removeCoverAd:superView];
}];
if (model) {
UITapGestureRecognizer *jump = [[UITapGestureRecognizer alloc] init];
[superView addGestureRecognizer:jump];
[[jump rac_gestureSignal] subscribeNext:^(id x) {
@strongify(self);
[self action:model];
}];
}
}
#pragma mark - ========== 移除悬浮广告 ==========
- (void) removeCoverAd:(UIImageView *) imageView {
imageView.hidden = YES;
[imageView removeFromSuperview];
- (void) removeCoverAd:(UIView *) view {
view.hidden = YES;
[view removeFromSuperview];
self.hidden = YES;
[self removeFromSuperview];
}
......
//
++ /dev/null
//
// AnnouncementView.h
// ColorfulSchool
//
// Created by rym on 2017/11/28.
// Copyright © 2017年 Colorful Any Door. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <WebKit/WebKit.h>
#import "AnnounceModel.h"
@interface AnnouncementView : UIView<WKNavigationDelegate,WKUIDelegate>
@property(nonatomic,strong)WKWebView *webView;
@property (weak, nonatomic) IBOutlet UIView *webBgView;
@property (weak, nonatomic) IBOutlet UIView *BgView;
@property (strong, nonatomic) IBOutlet UIButton *agreedBtn;
@property (weak, nonatomic) IBOutlet UIButton *comfirmBtn;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *noNoticeHeightConstraint;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *bgViewBottomConstraint;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *bgViewTopConstraint;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *noNoticeBgHeightConstraint;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
@property (weak, nonatomic) IBOutlet UIView *nonoticeBgView;
@property (nonatomic)AnnounceModelItem * announceItem;
@property (nonatomic,copy)void(^ok)(BOOL noNotice);
@end
//
++ /dev/null
//
// AnnouncementView.m
// ColorfulSchool
//
// Created by rym on 2017/11/28.
// Copyright © 2017年 Colorful Any Door. All rights reserved.
//
#import "AnnouncementView.h"
@interface AnnouncementView()<UIScrollViewDelegate>{
BOOL jugeAgreed;
}
@property (nonatomic, strong) NSArray *indentifierList;
@end
@implementation AnnouncementView
-(WKWebView *)webView{
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 - scrollView协议
-(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
{
if (scrollView.contentSize.height - scrollView.contentOffset.y == self.webView.frame.size.height) {
//滚动到底部了
self.agreedBtn.hidden = NO;
}
}
- (instancetype)init{
self = [super init];
if (self) {
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"AnnouncementView" owner:self options:nil];
self = (AnnouncementView*)[nib firstObject];
self.BgView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.4];
[self creatWebView];
}
return self;
}
-(instancetype)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame];
if (self) {
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"AnnouncementView" owner:self options:nil];
self = (AnnouncementView
*)[nib firstObject];
self.frame=frame;
self.BgView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.4];
[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;
[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));
}];
}
- (IBAction)agreeBtnClick:(id)sender {
jugeAgreed = !jugeAgreed;
if (jugeAgreed)
{
[_agreedBtn setImage:[UIImage imageNamed:@"check.png"] forState:UIControlStateNormal];
}
else
{
[_agreedBtn setImage:[UIImage imageNamed:@"条款未选中.png"] forState:UIControlStateNormal];
}
}
- (IBAction)confirmBtnClick:(id)sender {
if (self.ok) {
self.ok(jugeAgreed);
}
}
@end
<?xml version="1.0" encoding="UTF-8"?>
++ /dev/null
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="AnnouncementView">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bje-iV-z3E">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="X0q-d4-raQ" userLabel="bg">
<rect key="frame" x="10" y="87" width="355" height="493"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="fCI-DF-260" userLabel="topbg">
<rect key="frame" x="0.0" y="0.0" width="355" height="0.0"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="uLf-gj-Btw" userLabel="TimeBgView">
<rect key="frame" x="0.0" y="0.0" width="355" height="0.0"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="O7S-zd-JUw" userLabel="sep">
<rect key="frame" x="12" y="-1" width="331" height="1"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="ElG-tm-Fxj"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="HX5-6G-rqV">
<rect key="frame" x="12" y="0.0" width="331" height="12"/>
<constraints>
<constraint firstAttribute="height" constant="12" id="Eil-Mx-DTv"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.70588235294117641" green="0.70588235294117641" blue="0.70588235294117641" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="O7S-zd-JUw" secondAttribute="trailing" constant="12" id="6et-NK-jQf"/>
<constraint firstAttribute="bottom" secondItem="O7S-zd-JUw" secondAttribute="bottom" id="D7i-Ag-ltN"/>
<constraint firstAttribute="trailing" secondItem="HX5-6G-rqV" secondAttribute="trailing" constant="12" id="E5S-hD-8nn"/>
<constraint firstItem="HX5-6G-rqV" firstAttribute="top" secondItem="uLf-gj-Btw" secondAttribute="top" id="ZOD-2U-x8z"/>
<constraint firstAttribute="height" id="aXr-tr-nvn"/>
<constraint firstItem="HX5-6G-rqV" firstAttribute="leading" secondItem="uLf-gj-Btw" secondAttribute="leading" constant="12" id="kY6-JY-hJC"/>
<constraint firstItem="O7S-zd-JUw" firstAttribute="leading" secondItem="uLf-gj-Btw" secondAttribute="leading" constant="12" id="qXg-xF-ebA"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xwW-ug-g5k">
<rect key="frame" x="12" y="0.0" width="331" height="0.0"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.11764705882352941" green="0.11764705882352941" blue="0.11764705882352941" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="uLf-gj-Btw" firstAttribute="top" secondItem="xwW-ug-g5k" secondAttribute="bottom" id="FPo-U9-lFt"/>
<constraint firstAttribute="trailing" secondItem="uLf-gj-Btw" secondAttribute="trailing" id="J0o-iy-I3R"/>
<constraint firstItem="xwW-ug-g5k" firstAttribute="top" secondItem="fCI-DF-260" secondAttribute="top" id="L7R-C5-TwX"/>
<constraint firstItem="uLf-gj-Btw" firstAttribute="leading" secondItem="fCI-DF-260" secondAttribute="leading" id="bTo-rU-GbO"/>
<constraint firstAttribute="trailing" secondItem="xwW-ug-g5k" secondAttribute="trailing" constant="12" id="ebE-Ei-bDS"/>
<constraint firstAttribute="bottom" secondItem="uLf-gj-Btw" secondAttribute="bottom" id="fG3-VO-ynJ"/>
<constraint firstAttribute="height" id="tEA-0s-3M6"/>
<constraint firstItem="xwW-ug-g5k" firstAttribute="leading" secondItem="fCI-DF-260" secondAttribute="leading" constant="12" id="y6n-GS-gC7"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ubv-5J-yt6" userLabel="bottomBg">
<rect key="frame" x="0.0" y="368" width="355" height="125"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="e4h-hV-Ud4">
<rect key="frame" x="12" y="55" width="331" height="50"/>
<color key="backgroundColor" red="0.50196081400000003" green="0.50196081400000003" blue="0.50196081400000003" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="AQD-5S-VoO"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<state key="normal" title="我知道了" backgroundImage="确定按钮"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="4"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
</userDefinedRuntimeAttributes>
<connections>
<action selector="confirmBtnClick:" destination="iN0-l3-epB" eventType="touchUpInside" id="3GA-i0-Vpr"/>
</connections>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="mv5-kx-0iw">
<rect key="frame" x="0.0" y="0.0" width="355" height="37"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="不再提醒" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gWw-15-05D">
<rect key="frame" x="32" y="21" width="57.5" height="14.5"/>
<constraints>
<constraint firstAttribute="height" constant="15" id="FJO-3o-9p4"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.99607843137254903" green="0.51372549019607838" blue="0.039215686274509803" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="f1V-vu-HXW">
<rect key="frame" x="12" y="8" width="70" height="40"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="3ga-kA-fbv"/>
<constraint firstAttribute="width" constant="70" id="EXB-ff-88b"/>
</constraints>
<state key="normal" image="条款未选中"/>
<connections>
<action selector="agreeBtnClick:" destination="iN0-l3-epB" eventType="touchUpInside" id="24k-nj-u7H"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="gWw-15-05D" firstAttribute="leading" secondItem="f1V-vu-HXW" secondAttribute="trailing" constant="-50" id="AOT-JL-ZxC"/>
<constraint firstItem="f1V-vu-HXW" firstAttribute="centerY" secondItem="mv5-kx-0iw" secondAttribute="centerY" constant="10" id="TM6-AH-ezy"/>
<constraint firstItem="f1V-vu-HXW" firstAttribute="leading" secondItem="mv5-kx-0iw" secondAttribute="leading" constant="12" id="f04-A3-bVg"/>
<constraint firstItem="gWw-15-05D" firstAttribute="centerY" secondItem="f1V-vu-HXW" secondAttribute="centerY" id="gln-I8-1C8"/>
<constraint firstAttribute="height" constant="37" id="rpT-ME-bqD"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="e4h-hV-Ud4" firstAttribute="leading" secondItem="Ubv-5J-yt6" secondAttribute="leading" constant="12" id="7XE-ew-7cu"/>
<constraint firstItem="e4h-hV-Ud4" firstAttribute="top" secondItem="mv5-kx-0iw" secondAttribute="bottom" constant="18" id="Pg1-3T-hzl"/>
<constraint firstItem="mv5-kx-0iw" firstAttribute="leading" secondItem="Ubv-5J-yt6" secondAttribute="leading" id="Sco-NJ-uPI"/>
<constraint firstAttribute="trailing" secondItem="e4h-hV-Ud4" secondAttribute="trailing" constant="12" id="VSD-gB-LLW"/>
<constraint firstAttribute="height" constant="125" id="fMo-S5-rmh"/>
<constraint firstAttribute="trailing" secondItem="mv5-kx-0iw" secondAttribute="trailing" id="o9m-6z-tUR"/>
<constraint firstItem="mv5-kx-0iw" firstAttribute="top" secondItem="Ubv-5J-yt6" secondAttribute="top" id="zME-Fa-dF5"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="x2W-uN-xDc">
<rect key="frame" x="0.0" y="0.0" width="355" height="368"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="fCI-DF-260" firstAttribute="top" secondItem="X0q-d4-raQ" secondAttribute="top" id="25O-RV-EOi"/>
<constraint firstAttribute="trailing" secondItem="fCI-DF-260" secondAttribute="trailing" id="5IX-d6-Uf6"/>
<constraint firstItem="Ubv-5J-yt6" firstAttribute="top" secondItem="x2W-uN-xDc" secondAttribute="bottom" id="DSn-b5-qla"/>
<constraint firstAttribute="trailing" secondItem="Ubv-5J-yt6" secondAttribute="trailing" id="M3n-R5-bYb"/>
<constraint firstAttribute="bottom" secondItem="Ubv-5J-yt6" secondAttribute="bottom" id="VL3-c0-bhe"/>
<constraint firstItem="fCI-DF-260" firstAttribute="leading" secondItem="X0q-d4-raQ" secondAttribute="leading" id="abj-gW-THh"/>
<constraint firstItem="x2W-uN-xDc" firstAttribute="leading" secondItem="X0q-d4-raQ" secondAttribute="leading" id="kfp-mR-41H"/>
<constraint firstItem="x2W-uN-xDc" firstAttribute="top" secondItem="fCI-DF-260" secondAttribute="bottom" id="q3V-UJ-jPM"/>
<constraint firstAttribute="trailing" secondItem="x2W-uN-xDc" secondAttribute="trailing" id="vfy-vJ-NUm"/>
<constraint firstItem="Ubv-5J-yt6" firstAttribute="leading" secondItem="X0q-d4-raQ" secondAttribute="leading" id="xHc-Sz-rIJ"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="4"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
</userDefinedRuntimeAttributes>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="X0q-d4-raQ" firstAttribute="top" secondItem="bje-iV-z3E" secondAttribute="top" constant="87" id="Bfi-7s-e25"/>
<constraint firstAttribute="trailing" secondItem="X0q-d4-raQ" secondAttribute="trailing" constant="10" id="WlJ-fh-HpE"/>
<constraint firstItem="X0q-d4-raQ" firstAttribute="leading" secondItem="bje-iV-z3E" secondAttribute="leading" constant="10" id="bG6-GQ-Fhr"/>
<constraint firstAttribute="bottom" secondItem="X0q-d4-raQ" secondAttribute="bottom" constant="87" id="lqA-nZ-8x6"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="bje-iV-z3E" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="RN7-xt-eiW"/>
<constraint firstAttribute="trailing" secondItem="bje-iV-z3E" secondAttribute="trailing" id="cNv-Zg-J9F"/>
<constraint firstItem="bje-iV-z3E" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="eKo-Xw-L5r"/>
<constraint firstAttribute="bottom" secondItem="bje-iV-z3E" secondAttribute="bottom" id="j3T-Xk-0XC"/>
</constraints>
<nil key="simulatedTopBarMetrics"/>
<nil key="simulatedBottomBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<connections>
<outlet property="BgView" destination="bje-iV-z3E" id="lvT-22-rtL"/>
<outlet property="agreedBtn" destination="f1V-vu-HXW" id="Ikf-Ba-yOR"/>
<outlet property="bgViewBottomConstraint" destination="lqA-nZ-8x6" id="a0V-IG-QYo"/>
<outlet property="bgViewTopConstraint" destination="Bfi-7s-e25" id="xoM-z7-twc"/>
<outlet property="comfirmBtn" destination="e4h-hV-Ud4" id="gYw-b1-Sv6"/>
<outlet property="noNoticeBgHeightConstraint" destination="fMo-S5-rmh" id="nrJ-VS-8Ae"/>
<outlet property="noNoticeHeightConstraint" destination="rpT-ME-bqD" id="Q62-0Y-mBG"/>
<outlet property="nonoticeBgView" destination="mv5-kx-0iw" id="Ud2-w2-qJ4"/>
<outlet property="timeLabel" destination="HX5-6G-rqV" id="ocs-SL-z4h"/>
<outlet property="titleLabel" destination="xwW-ug-g5k" id="BE5-GA-aQL"/>
<outlet property="webBgView" destination="x2W-uN-xDc" id="PmZ-wo-Pa3"/>
</connections>
<point key="canvasLocation" x="94.5" y="53.5"/>
</view>
</objects>
<resources>
<image name="条款未选中" width="16" height="16"/>
<image name="确定按钮" width="702" height="88"/>
</resources>
</document>
//
//
// ZXAnnouncementView.h
// ColorfulSchool
//
// Created by 刘卓鑫 on 2019/4/3.
// Copyright © 2019 Colorful Any Door. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
typedef void(^confirmAction)(BOOL isNotAlert);
@interface ZXAnnouncementView : UIView
- (instancetype) initWithFrame:(CGRect)frame jumpUrl:(NSString *) jumpUrl;
@property (nonatomic, copy) confirmAction comfirm;
@end
NS_ASSUME_NONNULL_END
//
//
// ZXAnnouncementView.m
// ColorfulSchool
//
// Created by 刘卓鑫 on 2019/4/3.
// Copyright © 2019 Colorful Any Door. All rights reserved.
//
#import "ZXAnnouncementView.h"
#import <WebKit/WebKit.h>
#import "JXLayoutButton.h"
@interface ZXAnnouncementView()<UIScrollViewDelegate, WKNavigationDelegate, WKUIDelegate>
@property (nonatomic, strong) WKWebView *webView;
@property (nonatomic, strong) JXLayoutButton *agreedBtn;
@end
@implementation ZXAnnouncementView
- (instancetype) initWithFrame:(CGRect)frame jumpUrl:(NSString *) jumpUrl {
if (self = [super initWithFrame:frame]) {
self.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:.2];
UIView *bgView = [[UIView alloc] initWithFrame:CGRectMake(15 * k6Scale, 85 * k6Scale, kScreenWidth - 30 * k6Scale, kScreenHeight - 170 * k6Scale)];
bgView.backgroundColor = [UIColor whiteColor];
bgView.layer.cornerRadius = 5 * k6Scale;
bgView.layer.masksToBounds = YES;
[self addSubview:bgView];
self.webView = [[WKWebView alloc] initWithFrame:CGRectMake(10 * k6Scale, 0, kScreenWidth - 50 * k6Scale, kScreenHeight - 295 * k6Scale)];
[bgView addSubview:self.webView];
self.webView.UIDelegate = self;
self.webView.navigationDelegate = self;
self.webView.scrollView.delegate = self;
[self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[jumpUrl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]]];
self.agreedBtn = [[JXLayoutButton alloc] init];
self.agreedBtn.layoutStyle = JXLayoutButtonStyleLeftImageRightTitle;
[self.agreedBtn setImage:[UIImage imageNamed:@"条款未选中"] forState:UIControlStateNormal];
[self.agreedBtn setImage:[UIImage imageNamed:@"check"] forState:UIControlStateSelected];
[self.agreedBtn setTitle:@"不再提示" forState:UIControlStateNormal];
[self.agreedBtn setTitleColor:[UIColor colorWithHexString:@"#ffa244"] forState:UIControlStateNormal];
self.agreedBtn.titleLabel.font = kFontSize(16 * k6Scale);
[bgView addSubview:self.agreedBtn];
[self.agreedBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(40 * k6Scale);
make.left.equalTo(bgView.mas_left).offset(20 * k6Scale);
make.top.equalTo(self.webView.mas_bottom);
make.width.mas_equalTo(70 * k6Scale);
}];
[self.agreedBtn addTarget:self action:@selector(notAlert:) forControlEvents:UIControlEventTouchDown];
UIButton *OKBtn = [[UIButton alloc] init];
[bgView addSubview:OKBtn];
kViewRadius(OKBtn, 5 * k6Scale);
[OKBtn setBackgroundImage:[UIImage imageNamed:@"确定按钮"] forState:UIControlStateNormal];
[OKBtn setTitle:@"我知道了" forState:UIControlStateNormal];
[OKBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self.webView);
make.height.mas_equalTo(50 * k6Scale);
make.top.equalTo(self.agreedBtn.mas_bottom).offset(12 * k6Scale);
}];
[OKBtn addTarget:self action:@selector(okAction:) forControlEvents:UIControlEventTouchDown];
self.agreedBtn.hidden = YES;
}
return self;
}
#pragma mark - ==========确定事件==========
- (void) okAction:(UIButton *) sender {
self.hidden =YES;
[self removeFromSuperview];
if (self.comfirm) {
self.comfirm(self.agreedBtn.selected);
}
}
#pragma mark - ==========不再提示事件==========
- (void) notAlert:(UIButton *) sender {
sender.selected = !sender.selected;
}
#pragma mark - scrollView协议
-(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
{
NSLog(@"%.2f -- %.2f --- %.2f",scrollView.contentSize.height, scrollView.contentOffset.y , self.webView.frame.size.height);
if (scrollView.contentSize.height - scrollView.contentOffset.y <= self.webView.frame.size.height + 50) {
//滚动到底部了
self.agreedBtn.hidden = NO;
}
}
@end
//
//
......@@ -11,6 +11,7 @@
#import "LoginJump.h"
#import "ZXSections.h"
#import "ZXInformation.h"
#import "ZXNotPay.h"
@implementation LoginModelItem
@end
......@@ -91,8 +92,11 @@
if ([kUserDefaults objectForKey:@"token"]) {
[kUserDefaults removeObjectForKey:@"token"];
}
[kUserDefaults removeObjectForKey:@"isOpenFreePay"];
[kUserDefaults removeObjectForKey:@"currentUserIsOpenJPush"];
[XMGFileTool removeDirectoryPath:CachePath];
[LoginJump clearTable];
[ZXNotPay clearTable];
[ExpecptionModel clearTable];
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
......
//
//
......@@ -241,19 +241,7 @@ static NSString * const ID = @"CollectionCell";
if ([item.serviceId isEqualToString:@"0"]) {
self.moneyLabel.text=[NSString stringWithFormat:@"%.2f", item.money];
self.aimiLabel.text = @"我的艾米币";
// if (item.money > 0) {
// self.moneyLabel.text=[NSString stringWithFormat:@"%.2f", item.money];
// self.aimiLabel.text = @"我的艾米币";
// } else {
// [self.sxMoneyLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
// make.left.mas_equalTo(self.view.mas_left).offset(23 * k6Scale);
// make.top.equalTo(self.backBtn.mas_bottom).offset(50 * k6Scale);
// }];
// [self.sxLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
// make.left.mas_equalTo(self.view.mas_left).offset(23 * k6Scale);
// make.bottom.equalTo(self.sxMoneyLabel.mas_top).offset(-5 * k6Scale);
// }];
// }
} else {
[self.moneyArray addObject:item];
}
......
//
//
......@@ -136,44 +136,18 @@
confirmBtn.enabled=YES;
return;
}
NSDictionary * dataDic = [[NSDictionary alloc]initWithObjectsAndKeys:CacheAccount,@"account",CacheUserId,@"userId",CacheCampusId,@"campusId",contentEnter.text,@"content",nil];
NSString * json=[self dictionaryToJson:dataDic];
NSString * postStr = [NSString stringWithFormat:@"%@%@%@",@"dc2017",@"MT_MOB_00037",json];
NSString * md5Str = [self md5:postStr];
NSString * dicstr=[BYHelp DataTOjsonString:dataDic];
NSString * token=CacheToken;
if (token==nil) {
token=@"";
}
NSDictionary * parametersDic = [[NSDictionary alloc]initWithObjectsAndKeys:@"MT_MOB_00037",@"sid",reqSource,@"reqSource",md5Str,@"key",token,@"token",dicstr,@"data",nil];
NSString * urlStr = [NSString stringWithFormat:@"%@",requestUrlStr];
NSLog(@"完善信息上传的是:%@",parametersDic);
[GetData request:urlStr type:@"POST" timer:10 parameters:parametersDic success:^(AFHTTPRequestOperation *operation, id responseObject)
{
NSString * code = [NSString stringWithFormat:@"%@",[responseObject objectForKey:@"code"]];
if ([code isEqualToString:@"0"])
{
[SVProgressHUD showSuccessWithStatus:@" 反馈成功 "];
[self performSelector:@selector(delayMethod) withObject:nil afterDelay:1.0f];
}
else
{
[SVProgressHUD showErrorWithStatus:@"反馈失败"];
confirmBtn.enabled=YES;
}
} failure:^(AFHTTPRequestOperation *operation, NSError *error)
{
confirmBtn.userInteractionEnabled = YES;
[SVProgressHUD showErrorWithStatus:@" 网络错误 "];
NSLog(@"输出接口错误:%@",error);
confirmBtn.enabled=YES;
}];
[ZXTool requestDataWithType:kXMHTTPMethodPOST url:[NSString stringWithFormat:@"%@/dcxy/customerFeedback/customerFeedback", [kUserDefaults valueForKey:@"NEW_PAY"]] para:@{@"customerId":CacheUserId,@"content":contentEnter.text} completed:^(CommonModel *common, NSString *error) {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
if (error) {
[SVProgressHUD showSuccessWithStatus:@" 反馈成功 "];
[self performSelector:@selector(delayMethod) withObject:nil afterDelay:1.0f];
}else{
[SVProgressHUD showErrorWithStatus:@"反馈失败"];
confirmBtn.enabled=YES;
}
});
}];
}
-(void)delayMethod
{
......
//
//
......@@ -7,7 +7,7 @@
//
#import "MineViewController.h"
#import "UserSettingViewController.h"
#import "ZXSettingViewController.h"
#import "UserCenterModel.h"
#import "UserInfoViewController.h"
#import "FeedBackView.h"
......@@ -206,7 +206,7 @@
VC.hidesBottomBarWhenPushed=YES;
[self.navigationController pushViewController:VC animated:YES];
}else if (indexPath.row==2){
UserSettingViewController * VC=[UserSettingViewController new];
ZXSettingViewController * VC=[ZXSettingViewController new];
VC.hidesBottomBarWhenPushed=YES;
[self.navigationController pushViewController:VC animated:YES];
}
......
//
++ /dev/null
//
// UserSettingViewController.m
// ColorfulSchool
//
// Created by Listen on 2017/8/9.
// Copyright © 2017年 rym. All rights reserved.
//
#import "UserSettingViewController.h"
#import "XMGFileTool.h"
#import "LoginView.h"
#import "updateViewController.h"
#import "AllowEequipCountLoginModel.h"
#import "LoginModel.h"
#import "FetchAccoutDataModel.h"
#import "ZXOrderPayController.h"
#import "AimiWalletViewController.h"
#define CachePath [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject]
typedef void(^isCanChange)(BOOL iCan);
@interface UserSettingViewController ()<UITableViewDataSource,UITableViewDelegate>
{
NSMutableArray * dataArray;
NSMutableArray * imageArray;
NSMutableArray * sectionTitle;
UILabel *cacheNum;
UISwitch * switchButton;
UISwitch * free_switch_Button;
UISwitch * push_switch_Button;
}
@property (nonatomic, assign) NSInteger totalSize;
@property (strong, nonatomic) IBOutlet UITableView *tableView;
@property (strong, nonatomic) AllowEequipCountLoginModel * allowModel;
@property (nonatomic, assign) NSInteger isOpenFreePay;
@property (nonatomic, assign) BOOL isCloseOrderPush;//是否关闭订单推送 NO不关闭 YES关闭
@end
@implementation UserSettingViewController
- (void)dealloc{
[self removeNotificationAndKVO];
}
-(void)registNotificationAndKVO{
[self.allowModel addObserver:self forKeyPath:@"isLoaded" options:NSKeyValueObservingOptionNew context:nil];
[self.allowModel addObserver:self forKeyPath:@"error" options:NSKeyValueObservingOptionNew context:nil];
}
-(void)removeNotificationAndKVO{
[self.allowModel removeObserver:self forKeyPath:@"isLoaded"];
[self.allowModel removeObserver:self forKeyPath:@"error"];
}
-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context{
if (object == self.allowModel) {
if ([keyPath isEqualToString:@"isLoaded"]) {
}
else{
}
}
}
- (void)viewDidLoad {
[super viewDidLoad];
self.isOpenFreePay = 0;
[self loadCache];
[self loadData];
[self initNavButtons];
self.allowModel=[AllowEequipCountLoginModel new];
[self registNotificationAndKVO];
self.tableView.delegate=self;
self.tableView.dataSource=self;
self.tableView.tableFooterView=[UIView new];
[self loadIsOpenFreePay];
[self checkCurrentUserIsOpenJPush];
[ZXTool loadAdInfoByAdId:@"5" topView:self.tableView superView:self.view fromVc:self];
}
- (void) viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
super.navigationController.navigationBar.hidden = NO;
}
//获取缓存尺寸
-(void)loadCache{
// 获取文件夹尺寸
// 文件夹非常小,如果我的文件非常大
[XMGFileTool getFileSize:CachePath completion:^(NSInteger totalSize) {
_totalSize = totalSize;
[self.tableView reloadData];
}];
}
// 获取缓存尺寸字符串
- (NSString *)sizeStr
{
NSInteger totalSize = _totalSize;
NSString *sizeStr = @"0.00B";
// MB KB B
if (totalSize > 1000 * 1000) {
// MB
CGFloat sizeF = totalSize / 1000.0 / 1000.0;
sizeStr = [NSString stringWithFormat:@"%.1fMB",sizeF];
} else if (totalSize > 1000) {
// KB
CGFloat sizeF = totalSize / 1000.0;
sizeStr = [NSString stringWithFormat:@"%.1fKB",sizeF];
} else if (totalSize > 0) {
// B
sizeStr = [NSString stringWithFormat:@"%.ldB",totalSize];
}
return sizeStr;
}
/*
设置视图
*/
-(void)loadData
{
NSArray* group1;
BOOL isOpenFreePay = [[kUserDefaults valueForKey:@"isOpenFreePay"] isEqualToString:@"yes"];
if ([CacheVersion isEqualToString:@"2"]) {
if (isOpenFreePay) {
group1=@[@"app登录密码",@"设备密码",@"更换手机账户",@"开启设备登录密码",@"开启系统自动扣费", @"开启订单推送"];
} else {
group1=@[@"app登录密码",@"设备密码",@"更换手机账户",@"开启设备登录密码"];
}
}
else{
if (isOpenFreePay) {
group1=@[@"app登录密码",@"更换手机账户",@"开启设备登录密码",@"开启系统自动扣费"];
} else {
group1=@[@"app登录密码",@"更换手机账户",@"开启设备登录密码"];
}
}
NSArray * group2=@[@"清理缓存",@"退出登录"];
NSArray * imagegroup1;
if ([CacheVersion isEqualToString:@"2"]) {
if (isOpenFreePay) {
imagegroup1=@[@"Passwordtwo.png",@"设备.png",@"app.png",@"set_bar_code",@"icon_mianmi",@"icon-push"];
} else {
imagegroup1=@[@"Passwordtwo.png",@"设备.png",@"app.png",@"set_bar_code"];
}
}
else{
if (isOpenFreePay) {
imagegroup1=@[@"Passwordtwo.png",@"app.png",@"set_bar_code",@"icon_mianmi",@"icon-push"];
} else {
imagegroup1=@[@"Passwordtwo.png",@"app.png",@"set_bar_code"];
}
}
NSArray * imagegroup2=@[@"Clear.png",@"Close.png"];
dataArray=[[NSMutableArray alloc]initWithObjects:group1,group2,nil];
imageArray=[[NSMutableArray alloc]initWithObjects:imagegroup1,imagegroup2,nil];
sectionTitle=[[NSMutableArray alloc]initWithObjects:@"密码与安全",@"其它",nil];
}
-(void)initNavButtons
{
UILabel* titleLabel = [MCCustomizeControl customizeLabel:@"个人设置"
backgroundColor:[UIColor clearColor] font:[UIFont boldSystemFontOfSize:MC_NAVBAR_TITLE_FONT_SIZE] textColor:[UIColor colorWithHexString:@"#f3f3f3"] textAlignment:NSTextAlignmentCenter lineBreakMode:NSLineBreakByWordWrapping];
self.navigationItem.titleView = titleLabel;
}
#pragma -mark UITableView delegate
//
- (CGFloat)tableView:(UITableView *)tableView
heightForFooterInSection:(NSInteger)section
{
return 0.1;
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return 50;
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return dataArray.count;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
NSArray * arr=dataArray[section];
return arr.count;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell * cell=[tableView dequeueReusableCellWithIdentifier:@"MCCMineCell"];
if (cell==nil) {
cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"MCCMineCell"];
}
NSArray * tempArr;
if (indexPath.section<dataArray.count) {
tempArr=dataArray[indexPath.section];
}
UIImage * image=[UIImage imageNamed:(imageArray[indexPath.section])[indexPath.row]];
cell.imageView.image=image;
cell.textLabel.text=(tempArr)[indexPath.row];
cell.selectionStyle= UITableViewCellSelectionStyleNone;
cell.separatorInset=UIEdgeInsetsMake(0, 10, 0, 0);
if (!(indexPath.section==1&&indexPath.row==0)) {
if ([CacheVersion isEqualToString:@"2"]) {
if (indexPath.section==0&&indexPath.row==3){
[self addSwithWithCell:cell];
} else if (indexPath.section==0&&indexPath.row==4) {
[self addFreeSwithWithCell:cell];
} else if (indexPath.section==0&&indexPath.row==5) {
[self addPushSwithWithCell:cell];
} else{
cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
}
}else{
if (indexPath.section==0&&indexPath.row==2){
[self addSwithWithCell:cell];
} else if (indexPath.section==0&&indexPath.row==3) {
[self addFreeSwithWithCell:cell];
} else if (indexPath.section==0&&indexPath.row==4) {
[self addPushSwithWithCell:cell];
} else{
cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
}
}
}
else{
if (cacheNum) {
[cacheNum removeFromSuperview];
cacheNum=nil;
}
/*
缓存大小
*/
cacheNum = [[UILabel alloc]initWithFrame:CGRectMake(kWidth-100, 10, 100, 24)];
cacheNum.font = [UIFont systemFontOfSize:15.0];
cacheNum.textColor = [UIColor colorWithRed:180/255.0 green:180/255.0 blue:180/255.0 alpha:1.0];
cacheNum.tag=2000;
cacheNum.text = [self sizeStr];
cacheNum.textAlignment = NSTextAlignmentCenter;
[cell addSubview:cacheNum];
}
return cell;
}
-(void)addSwithWithCell:(UITableViewCell *)cell {
if (switchButton) {
[switchButton removeFromSuperview];
switchButton=nil;
}
switchButton = [[UISwitch alloc] initWithFrame:CGRectMake(kWidth-70, 7, 100, 24)];
// 0开1关
if ([CacheDevPassSwitch isEqualToString:@"0"]) {
[switchButton setOn:YES];
}else{
[switchButton setOn:NO];
}
switchButton.onTintColor=[UIColor orangeColor];
[switchButton addTarget:self action:@selector(switchAction:) forControlEvents:UIControlEventValueChanged];
[cell addSubview:switchButton];
}
#pragma mark - ========== 单独加载是否开启绵密支付 ==========
- (void) loadIsOpenFreePay {
[ZXTool requestDataWithType:kXMHTTPMethodGET url:[NSString stringWithFormat:@"%@/app/customer/balance/state?customerId=%@", [kUserDefaults valueForKey:@"NEW_PAY"],CacheUserId] para:nil completed:^(CommonModel *common, NSString *error) {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
if (error==nil) {
self.isOpenFreePay = [common.data integerValue];
[self.tableView reloadData];
}
});
}];
}
-(void)addFreeSwithWithCell:(UITableViewCell *)cell {
if (free_switch_Button) {
[free_switch_Button removeFromSuperview];
free_switch_Button=nil;
}
free_switch_Button = [[UISwitch alloc] initWithFrame:CGRectMake(kWidth-70, 7, 100, 24)];
// 0开1关
if (self.isOpenFreePay) {
[free_switch_Button setOn:YES];
}else{
[free_switch_Button setOn:NO];
}
free_switch_Button.onTintColor=[UIColor orangeColor];
[free_switch_Button addTarget:self action:@selector(freeSwitchAction:) forControlEvents:UIControlEventValueChanged];
[cell addSubview:free_switch_Button];
}
#pragma mark - ===================查询是否开启推送==============================
- (void) checkCurrentUserIsOpenJPush {
[ZXTool requestDataWithType:kXMHTTPMethodGET url:[NSString stringWithFormat:@"%@/common/jpush/isOpen?customerId=%@", [kUserDefaults valueForKey:@"SX_MONEY"], CacheUserId] para:nil completed:^(CommonModel *common, NSString *error) {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
if (common.data) {
self.isCloseOrderPush = [common.data integerValue];
[self.tableView reloadData];
}
});
}];
}
- (BOOL)isUserNotificationEnable { // 判断用户是否允许接收通知
BOOL isEnable = NO;
if ([[UIDevice currentDevice].systemVersion floatValue] >= 8.0f) { // iOS版本 >=8.0 处理逻辑
UIUserNotificationSettings *setting = [[UIApplication sharedApplication] currentUserNotificationSettings];
isEnable = (UIUserNotificationTypeNone == setting.types) ? NO : YES;
} else { // iOS版本 <8.0 处理逻辑
UIRemoteNotificationType type = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
isEnable = (UIRemoteNotificationTypeNone == type) ? NO : YES;
}
return isEnable;
}
#pragma mark - ========开启/关闭激光推送============
-(void)jpushSwitchAction:(id)sender
{
UISwitch *switchButton = (UISwitch*)sender;
BOOL isButtonOn = [switchButton isOn];
if (isButtonOn) {
BOOL isOpen = [self isUserNotificationEnable];
if (isOpen == NO) {
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"当前应用未开启推送,请前往设置中打开" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *ac1 = [UIAlertAction actionWithTitle:@"取消" style:0 handler:^(UIAlertAction * _Nonnull action) {
}];
UIAlertAction *ac2 = [UIAlertAction actionWithTitle:@"设置" style:0 handler:^(UIAlertAction * _Nonnull action) {
NSURL * url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
[kApplication openURL:url];
}];
[alert addAction:ac1];
[alert addAction:ac2];
[self presentViewController:alert animated:YES completion:nil];
switchButton.on = !isButtonOn;//y还原
return;
}
}
self.isCloseOrderPush = isButtonOn;
[ZXTool requestDataWithType:kXMHTTPMethodPUT url:[NSString stringWithFormat:@"%@/common/jpush/isOpen?customerId=%@", [kUserDefaults valueForKey:@"SX_MONEY"], CacheUserId] para:nil completed:^(CommonModel *common, NSString *error) {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
if (error) {
switchButton.on = !isButtonOn;
}
});
}];
}
-(void)addPushSwithWithCell:(UITableViewCell *)cell {
if (push_switch_Button) {
[push_switch_Button removeFromSuperview];
push_switch_Button=nil;
}
push_switch_Button = [[UISwitch alloc] initWithFrame:CGRectMake(kWidth-70, 7, 100, 24)];
// 0开1关
if (self.isCloseOrderPush) {
[push_switch_Button setOn:NO];
}else{
[push_switch_Button setOn:YES];
}
push_switch_Button.onTintColor=[UIColor orangeColor];
[push_switch_Button addTarget:self action:@selector(jpushSwitchAction:) forControlEvents:UIControlEventValueChanged];
[cell addSubview:push_switch_Button];
}
-(void)freeSwitchAction:(id)sender
{
UISwitch *switchButton = (UISwitch*)sender;
BOOL isButtonOn = [switchButton isOn];
if (isButtonOn == NO) {
[ZXTool requestDataWithType:kXMHTTPMethodPOST url:[NSString stringWithFormat:@"%@/customerAccount/queryAccount", [kUserDefaults objectForKey:@"NEW_PAY"]] para:@{@"areaId":CacheCampusId, @"customerPhone":CacheAccount, @"id":CacheUserId} completed:^(CommonModel *common, NSString *error) {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
if (error) {
switchButton.on = !isButtonOn;
[ZXTool showText:error];
} else {
BOOL isCanChange = YES;
for (NSDictionary *dic in common.data) {
servicePeasListItem *item = [servicePeasListItem mj_objectWithKeyValues:dic];
if ([item.serviceId isEqualToString:@"0"]) {
isCanChange = item.money >= 0;
if (isCanChange == NO) {
switchButton.on = !isButtonOn;
//弹窗提示
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"你余额已经为负,无法完成此操作!请先完成充值!" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *ac1 = [UIAlertAction actionWithTitle:@"取消" style:0 handler:^(UIAlertAction * _Nonnull action) {
}];
UIAlertAction *ac2 = [UIAlertAction actionWithTitle:@"确定" style:0 handler:^(UIAlertAction * _Nonnull action) {
//余额太少 前往充值
AimiWalletViewController *wallet = [[AimiWalletViewController alloc] init];
[self.navigationController pushViewController:wallet animated:YES];
}];
[alert addAction:ac1];
[alert addAction:ac2];
[self presentViewController:alert animated:YES completion:nil];
return ;
}
break;
}
}
if (isCanChange) {
//需要先判断一下当前是否有待支付订单
kWeakSelf(self);
[self checkIsHasNotPayOrderIsCanChange:^(BOOL isCan) {
kStrongSelf(self);
if (isCan) {
//弹窗提示
[self changeSystemReduceMoney:switchButton isBtnOn:isButtonOn];
} else {
dispatch_async(dispatch_get_main_queue(), ^{
switchButton.on = !isButtonOn;
});
}
}];
} else {
dispatch_async(dispatch_get_main_queue(), ^{
switchButton.on = !isButtonOn;
});
}
}
});
}];
} else {
kWeakSelf(self);
[self checkIsHasNotPayOrderIsCanChange:^(BOOL isCan) {
kStrongSelf(self);
if (isCan) {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool showAlertText:@"开启后系统将按照消费自动抵扣艾米和余额,当账户余额<=0时,将无法自动扣费!"];
});
[self changeSystemReduceMoney:switchButton isBtnOn:isButtonOn];
} else {
dispatch_async(dispatch_get_main_queue(), ^{
switchButton.on = !isButtonOn;
});
}
}];
}
}
#pragma mark - ==========查询当前是否有待支付订单==========
- (void) checkIsHasNotPayOrderIsCanChange:(isCanChange) completed {
NSString *url = [NSString stringWithFormat:@"%@/consumeOrder/getUnpaidOrder?customerId=%@", [kUserDefaults objectForKey:@"NEW_PAY"], CacheUserId];
kWeakSelf(self);
[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) {
kStrongSelf(self);
if ([responseObject[@"code"] integerValue] == 1000) {
if ([responseObject[@"orderId"] isKindOfClass:[NSNull class]] || responseObject[@"orderId"]== nil) {
completed(YES);
return ;
}
completed(NO);
dispatch_async(dispatch_get_main_queue(), ^{
//弹窗提示
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"你有一个未支付订单,请先完成支付再打开!" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *ac1 = [UIAlertAction actionWithTitle:@"取消" style:0 handler:^(UIAlertAction * _Nonnull action) {
}];
UIAlertAction *ac2 = [UIAlertAction actionWithTitle:@"确定" style:0 handler:^(UIAlertAction * _Nonnull action) {
ZXOrderPayController *jumpPay = [[ZXOrderPayController alloc] init];
jumpPay.orderId = [responseObject[@"orderId"] integerValue];
[self.navigationController pushViewController:jumpPay animated:YES];
}];
[alert addAction:ac1];
[alert addAction:ac2];
[self presentViewController:alert animated:YES completion:nil];
});
} else {
completed(NO);
}
} onFailure:^(NSError *error) {
completed(NO);
} onFinished:^(id responseObject, NSError *error) {
}];
}
#pragma mark - ==========切换系统扣费事件==========
- (void) changeSystemReduceMoney:(UISwitch *) switchButton isBtnOn:(BOOL) isButtonOn{
self.isOpenFreePay = isButtonOn;
[ZXTool requestDataWithType:kXMHTTPMethodPUT url:[NSString stringWithFormat:@"%@/app/customer/swich/balance/%@/%d", [kUserDefaults valueForKey:@"NEW_PAY"],CacheUserId,isButtonOn] para:@{@"customerId":CacheUserId,@"isEnabled":@(isButtonOn)} completed:^(CommonModel *common, NSString *error) {
//
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
if (error) {
switchButton.on = !isButtonOn;
}
});
}];
}
-(void)switchAction:(id)sender
{
UISwitch *switchButton = (UISwitch*)sender;
BOOL isButtonOn = [switchButton isOn];
if (isButtonOn) {
// showSwitchValue.text = @"是";
// 0开1关
[self.allowModel AllowEquitLoginWithStatu:@"0"];
}else {
// showSwitchValue.text = @"否";
[self.allowModel AllowEquitLoginWithStatu:@"1"];
}
}
-(UIImage*) OriginImage:(UIImage *)image scaleToSize:(CGSize)size
{
UIGraphicsBeginImageContext(size); //size 为CGSize类型,即你所需要的图片尺寸
[image drawInRect:CGRectMake(0, 0, size.width, size.height)];
UIImage* scaledImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return scaledImage; //返回的就是已经改变的图片
}
-(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section{
return sectionTitle[section];
}
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
UIView * BgView=[[UIView alloc]initWithFrame:CGRectMake(0, 0, kWidth, 50)];
UILabel * sectionTitleLable = [[UILabel alloc]initWithFrame:CGRectMake(15, 0, kWidth, 50)];
sectionTitleLable.text = sectionTitle[section];
sectionTitleLable.font = [UIFont systemFontOfSize:14.0];
sectionTitleLable.textColor = [UIColor colorWithRed:0.39 green:0.39 blue:0.39 alpha:1.0];
[BgView addSubview:sectionTitleLable];
return BgView;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
// NSLog(@"%d-%d",indexPath.section,indexPath.row);
if (indexPath.section==1) {
if (indexPath.row==0) {
[self cacheBtnFuc];
}
else if (indexPath.row==1){
[self exitBtnFuc];
}
}
else if(indexPath.section==0)
{
NSArray * tempArr;
tempArr=dataArray[indexPath.section];
NSString *s = (tempArr)[indexPath.row];
if ([s isEqualToString:@"开启设备登录密码"] || [s isEqualToString:@"开启系统自动扣费"] || [s isEqualToString:@"开启订单推送"]) {
return;
}
//app登录密码
updateViewController * VC=[[updateViewController alloc] init];
VC.titleStr=s;
[self.navigationController pushViewController:VC animated:YES];
}
}
/*
清理缓存
*/
-(void)cacheBtnFuc
{
NSLog(@" 缓存");
// 清空缓存
// 删除文件夹里面所有文件
[XMGFileTool removeDirectoryPath:CachePath];
_totalSize = 0;
[self.tableView reloadData];
[SVProgressHUD showSuccessWithStatus:@"清除缓存成功"];
}
/*
退出按钮
*/
-(void)exitBtnFuc
{
[ZXTool backToLogin];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#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
<?xml version="1.0" encoding="UTF-8"?>
++ /dev/null
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12121" systemVersion="16B2657" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="UserSettingViewController">
<connections>
<outlet property="tableView" destination="Ptq-rZ-MwY" id="VOc-p8-pcg"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" bounces="NO" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="18" sectionFooterHeight="18" translatesAutoresizingMaskIntoConstraints="NO" id="Ptq-rZ-MwY">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
</tableView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="Ptq-rZ-MwY" secondAttribute="trailing" id="Bt4-Wo-y13"/>
<constraint firstAttribute="bottom" secondItem="Ptq-rZ-MwY" secondAttribute="bottom" id="Qkd-yX-XzK"/>
<constraint firstItem="Ptq-rZ-MwY" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="qvU-Ec-5Ki"/>
<constraint firstItem="Ptq-rZ-MwY" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="tyk-aI-AQu"/>
</constraints>
</view>
</objects>
</document>
//
//
//
// UserSettingViewController.h
// ZXSettingViewController.h
// ColorfulSchool
//
// Created by Listen on 2017/8/9.
// Copyright © 2017年 rym. All rights reserved.
// Created by 刘卓鑫 on 2019/4/8.
// Copyright © 2019 Colorful Any Door. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UserSettingViewController : UIViewController
NS_ASSUME_NONNULL_BEGIN
@interface ZXSettingViewController : UIViewController
@end
NS_ASSUME_NONNULL_END
//
//
// ZXSettingViewController.m
// ColorfulSchool
//
// Created by 刘卓鑫 on 2019/4/8.
// Copyright © 2019 Colorful Any Door. All rights reserved.
//
#import "ZXSettingViewController.h"
#import "XMGFileTool.h"
#import "LoginView.h"
#import "updateViewController.h"
#import "AllowEequipCountLoginModel.h"
#import "LoginModel.h"
#import "FetchAccoutDataModel.h"
#import "ZXOrderPayController.h"
#import "AimiWalletViewController.h"
#import "ZXUserSettingModel.h"
#import "ZXUserSettingTableViewCell.h"
#define CachePath [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject]
typedef void(^isCanChange)(BOOL iCan);
@interface ZXSettingViewController ()<UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) UITableView *myTableView;
@property (nonatomic, strong) NSMutableArray *sections1;
@property (nonatomic, strong) NSMutableArray *sections2;
@end
@implementation ZXSettingViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self createUI];
[self.view addSubview:self.myTableView];
if ([[kUserDefaults valueForKey:@"isOpenFreePay"] isEqualToString:@"yes"] && [CacheVersion isEqualToString:@"2"]) {
[self loadIsOpenFreePay];
[self checkCurrentUserIsOpenJPush];
}
}
- (NSMutableArray *)sections1 {
if (_sections1 == nil) {
_sections1 = [[NSMutableArray alloc] init];
if ([CacheVersion isEqualToString:@"2"]) {
if ([[kUserDefaults valueForKey:@"isOpenFreePay"] isEqualToString:@"yes"]) {
NSArray *group1=@[@"app登录密码",@"设备密码",@"更换手机账户",@"开启设备登录密码",@"开启系统自动扣费", @"开启订单推送"];
NSArray *imagegroup1=@[@"Passwordtwo.png",@"设备.png",@"app.png",@"set_bar_code",@"icon_mianmi",@"icon-push"];
ZXUserSettingModel *m1 = [[ZXUserSettingModel alloc] init];
ZXUserSettingModel *m2 = [[ZXUserSettingModel alloc] init];
ZXUserSettingModel *m3 = [[ZXUserSettingModel alloc] init];
ZXUserSettingModel *m4 = [[ZXUserSettingModel alloc] init];
ZXUserSettingModel *m5 = [[ZXUserSettingModel alloc] init];
ZXUserSettingModel *m6 = [[ZXUserSettingModel alloc] init];
m1.imageName = imagegroup1[0];
m1.name = group1[0];
m2.imageName = imagegroup1[1];
m2.name = group1[1];
m3.imageName = imagegroup1[2];
m3.name = group1[2];
m4.imageName = imagegroup1[3];
m4.name = group1[3];
m4.isHasSwitch = YES;
m4.switchIsOn = [CacheDevPassSwitch isEqualToString:@"0"];
m5.imageName = imagegroup1[4];
m5.name = group1[4];
m5.isHasSwitch = YES;
m5.switchIsOn = NO;
m6.imageName = imagegroup1[5];
m6.name = group1[5];
m6.isHasSwitch = YES;
m6.switchIsOn = NO;
m4.switchType = 1;
m5.switchType = 2;
m6.switchType = 3;
[_sections1 addObjectsFromArray:@[m1,m2,m3,m4,m5,m6]];
} else {
NSArray *group1=@[@"app登录密码",@"设备密码",@"更换手机账户",@"开启设备登录密码"];
NSArray *imagegroup1=@[@"Passwordtwo.png",@"设备.png",@"app.png",@"set_bar_code"];
ZXUserSettingModel *m1 = [[ZXUserSettingModel alloc] init];
ZXUserSettingModel *m2 = [[ZXUserSettingModel alloc] init];
ZXUserSettingModel *m3 = [[ZXUserSettingModel alloc] init];
ZXUserSettingModel *m4 = [[ZXUserSettingModel alloc] init];
m1.imageName = imagegroup1[0];
m1.name = group1[0];
m2.imageName = imagegroup1[1];
m2.name = group1[1];
m3.imageName = imagegroup1[2];
m3.name = group1[2];
m4.imageName = imagegroup1[3];
m4.name = group1[3];
m4.isHasSwitch = YES;
m4.switchIsOn = [CacheDevPassSwitch isEqualToString:@"0"];
m4.switchType = 1;
[_sections1 addObjectsFromArray:@[m1,m2,m3,m4]];
}
} else {
ZXUserSettingModel *m1 = [[ZXUserSettingModel alloc] init];
ZXUserSettingModel *m2 = [[ZXUserSettingModel alloc] init];
ZXUserSettingModel *m3 = [[ZXUserSettingModel alloc] init];
m1.name = @"app登录密码";
m2.name = @"更换手机账户";
m3.name = @"开启设备登录密码";
m1.imageName = @"Passwordtwo.png";
m2.imageName = @"app.png";
m3.imageName = @"set_bar_code";
m3.isHasSwitch = YES;
m3.switchIsOn = [CacheDevPassSwitch isEqualToString:@"0"];
m3.switchType = 1;
[_sections1 addObject:m1];
[_sections1 addObject:m2];
[_sections1 addObject:m3];
}
}
return _sections1;
}
- (NSMutableArray *)sections2 {
if (_sections2 == nil) {
_sections2 = [NSMutableArray new];
ZXUserSettingModel *m1 = [[ZXUserSettingModel alloc] init];
ZXUserSettingModel *m2 = [[ZXUserSettingModel alloc] init];
m1.name = @"清理缓存";
m1.isCleanCache = YES;
m2.name = @"退出登录";
m1.imageName = @"Clear.png";
m2.imageName = @"Close.png";
[_sections2 addObjectsFromArray:@[m1,m2]];
}
return _sections2;
}
#pragma mark - ==========UI==========
-(void) createUI {
self.title = @"个人设置";
self.view.backgroundColor = RGB(243, 243, 243);
}
- (UITableView *)myTableView {
if(!_myTableView) {
_myTableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight - kTopHeight) style:UITableViewStylePlain];
_myTableView.delegate =self;
_myTableView.dataSource =self;
_myTableView.tableFooterView = [UIView new];
}
return _myTableView;
}
#pragma mark - tableView delegate
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 2;
}
- (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 44 * k6Scale;
}
- (CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
return 35 * k6Scale;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return section?self.sections2.count:self.sections1.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *identify =@"cellIdentify";
ZXUserSettingTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identify];
if(!cell) {
cell = [[ZXUserSettingTableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identify];
}
ZXUserSettingModel *m = indexPath.section?self.sections2[indexPath.row]:self.sections1[indexPath.row];
cell.model = m;
@weakify(self);
cell.switchAction = ^(NSInteger switchType) {
@strongify(self);
switch (switchType) {
case 1: {
[[AllowEequipCountLoginModel new] AllowEquitLoginWithStatu:m.switchIsOn?@"0":@"1"];
break;
}
case 2: {
[self freeSwitchAction:m];
break;
}
case 3: {
if (m.switchIsOn) {
BOOL isOpen = [self isUserNotificationEnable];
if (isOpen == NO) {
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"当前应用未开启推送,请前往设置中打开" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *ac1 = [UIAlertAction actionWithTitle:@"取消" style:0 handler:^(UIAlertAction * _Nonnull action) {
}];
UIAlertAction *ac2 = [UIAlertAction actionWithTitle:@"设置" style:0 handler:^(UIAlertAction * _Nonnull action) {
NSURL * url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
[kApplication openURL:url];
}];
[alert addAction:ac1];
[alert addAction:ac2];
[self presentViewController:alert animated:YES completion:nil];
return;
}
}
[ZXTool requestDataWithType:kXMHTTPMethodPUT url:[NSString stringWithFormat:@"%@/dcxy/customerInfo/jpush/isOpen?customerId=%@", [kUserDefaults valueForKey:@"NEW_PAY"], CacheUserId] para:nil completed:^(CommonModel *common, NSString *error) {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
if (error) {
m.switchIsOn = !m.switchIsOn;
[self.myTableView reloadData];
} else {
[kUserDefaults setValue:m.switchIsOn?@"yes":@"no" forKey:@"currentUserIsOpenJPush"];
}
});
}];
break;
}
default:
break;
}
};
return cell;
}
-(void)freeSwitchAction:(ZXUserSettingModel *) m {
if (m.switchIsOn == NO) {
[ZXTool requestDataWithType:kXMHTTPMethodPOST url:[NSString stringWithFormat:@"%@/customerAccount/queryAccount", [kUserDefaults objectForKey:@"NEW_PAY"]] para:@{@"areaId":CacheCampusId, @"customerPhone":CacheAccount, @"id":CacheUserId} completed:^(CommonModel *common, NSString *error) {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
if (error) {
m.switchIsOn = !m.switchIsOn;
[ZXTool showText:error];
[self.myTableView reloadData];
} else {
BOOL isCanChange = YES;
for (NSDictionary *dic in common.data) {
servicePeasListItem *item = [servicePeasListItem mj_objectWithKeyValues:dic];
if ([item.serviceId isEqualToString:@"0"]) {
isCanChange = item.money >= 0;
if (isCanChange == NO) {
m.switchIsOn = !m.switchIsOn;
//弹窗提示
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"你余额已经为负,无法完成此操作!请先完成充值!" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *ac1 = [UIAlertAction actionWithTitle:@"取消" style:0 handler:^(UIAlertAction * _Nonnull action) {
}];
UIAlertAction *ac2 = [UIAlertAction actionWithTitle:@"确定" style:0 handler:^(UIAlertAction * _Nonnull action) {
//余额太少 前往充值
AimiWalletViewController *wallet = [[AimiWalletViewController alloc] init];
[self.navigationController pushViewController:wallet animated:YES];
}];
[alert addAction:ac1];
[alert addAction:ac2];
[self presentViewController:alert animated:YES completion:nil];
return ;
}
break;
}
}
if (isCanChange) {
//需要先判断一下当前是否有待支付订单
kWeakSelf(self);
[self checkIsHasNotPayOrderIsCanChange:^(BOOL isCan) {
kStrongSelf(self);
if (isCan) {
//
[self changeSystemReduceMoney:m];
} else {
dispatch_async(dispatch_get_main_queue(), ^{
m.switchIsOn = !m.switchIsOn;
});
}
}];
} else {
dispatch_async(dispatch_get_main_queue(), ^{
m.switchIsOn = !m.switchIsOn;
});
}
}
});
}];
} else {
kWeakSelf(self);
[self checkIsHasNotPayOrderIsCanChange:^(BOOL isCan) {
kStrongSelf(self);
if (isCan) {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool showAlertText:@"开启后系统将按订单金额自动扣除余额,平台建议使用单笔支付模式。关闭后将切换至订单单笔支付模式"];
});
[self changeSystemReduceMoney:m];
} else {
dispatch_async(dispatch_get_main_queue(), ^{
m.switchIsOn = !m.switchIsOn;
[self.myTableView reloadData];
});
}
}];
}
}
#pragma mark - ==========查询当前是否有待支付订单==========
- (void) checkIsHasNotPayOrderIsCanChange:(isCanChange) completed {
NSString *url = [NSString stringWithFormat:@"%@/consumeOrder/getUnpaidOrder?customerId=%@", [kUserDefaults objectForKey:@"NEW_PAY"], CacheUserId];
kWeakSelf(self);
[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) {
kStrongSelf(self);
if ([responseObject[@"code"] integerValue] == 1000) {
if ([responseObject[@"orderId"] isKindOfClass:[NSNull class]] || responseObject[@"orderId"]== nil) {
completed(YES);
return ;
}
completed(NO);
dispatch_async(dispatch_get_main_queue(), ^{
//弹窗提示
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"你有一个未支付订单,请先完成支付再打开!" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *ac1 = [UIAlertAction actionWithTitle:@"取消" style:0 handler:^(UIAlertAction * _Nonnull action) {
}];
UIAlertAction *ac2 = [UIAlertAction actionWithTitle:@"确定" style:0 handler:^(UIAlertAction * _Nonnull action) {
ZXOrderPayController *jumpPay = [[ZXOrderPayController alloc] init];
jumpPay.orderId = [responseObject[@"orderId"] integerValue];
[self.navigationController pushViewController:jumpPay animated:YES];
}];
[alert addAction:ac1];
[alert addAction:ac2];
[self presentViewController:alert animated:YES completion:nil];
});
} else {
completed(NO);
}
} onFailure:^(NSError *error) {
completed(NO);
} onFinished:^(id responseObject, NSError *error) {
}];
}
#pragma mark - ==========切换系统扣费事件==========
- (void) changeSystemReduceMoney:(ZXUserSettingModel *) m {
[ZXTool requestDataWithType:kXMHTTPMethodPUT url:[NSString stringWithFormat:@"%@/app/customer/swich/balance/%@/%d", [kUserDefaults valueForKey:@"NEW_PAY"],CacheUserId,m.switchIsOn] para:@{@"customerId":CacheUserId,@"isEnabled":@(m.switchIsOn)} completed:^(CommonModel *common, NSString *error) {
//
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
if (error) {
m.switchIsOn = !m.switchIsOn;
[self.myTableView reloadData];
} else {
if (m.switchIsOn) {
if (self.sections1.count == 6) {
[self.sections1 removeLastObject];
[self.myTableView reloadData];
}
} else {
if (self.sections1.count == 5) {
ZXUserSettingModel *m6 = [[ZXUserSettingModel alloc] init];
m6.imageName = @"icon-push";
m6.name = @"开启订单推送";
m6.isHasSwitch = YES;
m6.switchIsOn = [[kUserDefaults valueForKey:@"currentUserIsOpenJPush"] isEqualToString:@"yes"];
m6.switchType = 3;
[self.sections1 addObject:m6];
[self.myTableView reloadData];
}
}
}
});
}];
}
- (BOOL)isUserNotificationEnable { // 判断用户是否允许接收通知
BOOL isEnable = NO;
if ([[UIDevice currentDevice].systemVersion floatValue] >= 8.0f) { // iOS版本 >=8.0 处理逻辑
UIUserNotificationSettings *setting = [[UIApplication sharedApplication] currentUserNotificationSettings];
isEnable = (UIUserNotificationTypeNone == setting.types) ? NO : YES;
} else { // iOS版本 <8.0 处理逻辑
UIRemoteNotificationType type = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
isEnable = (UIRemoteNotificationTypeNone == type) ? NO : YES;
}
return isEnable;
}
- (NSString *) tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
return section?@"其他":@"密码与安全";
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section) {
switch (indexPath.row) {
case 0:{
[XMGFileTool removeDirectoryPath:CachePath];
[self.myTableView reloadData];
[SVProgressHUD showSuccessWithStatus:@"清除缓存成功"];
break;
}
case 1:{
[ZXTool backToLogin];
break;
}
default:
break;
}
} else {
if (indexPath.row <= 2) {
//app登录密码
updateViewController * VC=[[updateViewController alloc] init];
VC.titleStr=[self.sections1[indexPath.row] valueForKey:@"name"];
[self.navigationController pushViewController:VC animated:YES];
}
}
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
self.navigationController.navigationBar.hidden = NO;
}
#pragma mark - ========== 单独加载是否开启绵密支付 ==========
- (void) loadIsOpenFreePay {
[ZXTool requestDataWithType:kXMHTTPMethodGET url:[NSString stringWithFormat:@"%@/app/customer/balance/state?customerId=%@", [kUserDefaults valueForKey:@"NEW_PAY"],CacheUserId] para:nil completed:^(CommonModel *common, NSString *error) {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
if (error==nil) {
NSInteger status = [common.data integerValue];
if (status) {
if (self.sections1.count == 6) {
[self.sections1 removeLastObject];
[self.myTableView reloadData];
}
}
ZXUserSettingModel *m = self.sections1[4];
m.switchIsOn = status;
[self.myTableView reloadData];
}
});
}];
}
#pragma mark - ===================查询是否开启推送==============================
- (void) checkCurrentUserIsOpenJPush {
[ZXTool requestDataWithType:kXMHTTPMethodGET url:[NSString stringWithFormat:@"%@/dcxy/customerInfo/jpush/isOpen?customerId=%@", [kUserDefaults valueForKey:@"NEW_PAY"], CacheUserId] para:nil completed:^(CommonModel *common, NSString *error) {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
if (common.data) {
if (self.sections1.count == 6) {
ZXUserSettingModel *m = self.sections1[5];
m.switchIsOn = [common.data integerValue];
[kUserDefaults setValue:[common.data integerValue]?@"yes":@"no" forKey:@"currentUserIsOpenJPush"];
[self.myTableView reloadData];
}
} else {
if (self.sections1.count == 6) {
ZXUserSettingModel *m = self.sections1[5];
m.switchIsOn = [[kUserDefaults valueForKey:@"currentUserIsOpenJPush"] isEqualToString:@"yes"];
[self.myTableView reloadData];
}
}
});
}];
}
@end
//
//
// ZXUserSettingModel.h
// ColorfulSchool
//
// Created by 刘卓鑫 on 2019/4/8.
// Copyright © 2019 Colorful Any Door. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface ZXUserSettingModel : NSObject
@property (nonatomic, copy) NSString *imageName;
@property (nonatomic, copy) NSString *name;
@property (nonatomic, assign) BOOL isHasSwitch;
@property (nonatomic, assign) BOOL switchIsOn;
//开关的类型 1代表开启设备登录密码 2 开启系统自动扣费 3开启订单推送
@property (nonatomic, assign) NSInteger switchType;
@property (nonatomic, assign) BOOL isCleanCache; //是缓存清理
@end
NS_ASSUME_NONNULL_END
//
//
// ZXUserSettingModel.m
// ColorfulSchool
//
// Created by 刘卓鑫 on 2019/4/8.
// Copyright © 2019 Colorful Any Door. All rights reserved.
//
#import "ZXUserSettingModel.h"
@implementation ZXUserSettingModel
@end
//
//
// ZXUserSettingTableViewCell.h
// ColorfulSchool
//
// Created by 刘卓鑫 on 2019/4/8.
// Copyright © 2019 Colorful Any Door. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "ZXUserSettingModel.h"
NS_ASSUME_NONNULL_BEGIN
typedef void(^switchAction)(NSInteger switchType);
@interface ZXUserSettingTableViewCell : UITableViewCell
@property (nonatomic, strong) ZXUserSettingModel *model;
@property (nonatomic, copy) switchAction switchAction;
@end
NS_ASSUME_NONNULL_END
//
//
// ZXUserSettingTableViewCell.m
// ColorfulSchool
//
// Created by 刘卓鑫 on 2019/4/8.
// Copyright © 2019 Colorful Any Door. All rights reserved.
//
#import "ZXUserSettingTableViewCell.h"
#import "XMGFileTool.h"
typedef void(^totalSize)(NSString *size);
@interface ZXUserSettingTableViewCell()
@property (nonatomic, strong) UIImageView *iconImageView;
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UISwitch *mySwitch;
@property (nonatomic, strong) UILabel *cacheNumLalebl;
@end
@implementation ZXUserSettingTableViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
self.selectionStyle = UITableViewCellSelectionStyleNone;
self.iconImageView = [[UIImageView alloc] init];
[self.contentView addSubview:self.iconImageView];
[self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.contentView.mas_left).offset(15 * k6Scale);
make.width.height.mas_equalTo(15 * k6Scale);
make.centerY.equalTo(self.contentView);
}];
self.titleLabel = [[UILabel alloc] init];
self.titleLabel.font = kFontSize(15 * k6Scale);
self.titleLabel.textColor = [UIColor colorWithHexString:@"#333333"];
[self.contentView addSubview:self.titleLabel];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.iconImageView.mas_right).offset(15 * k6Scale);
make.centerY.equalTo(self.iconImageView);
}];
UIImageView *arrow = [[UIImageView alloc] init];
[self.contentView addSubview:arrow];
arrow.image = [UIImage imageNamed:@"更多"];
[arrow mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.contentView.mas_right).offset(-15 * k6Scale);
make.width.mas_equalTo(8 * k6Scale);
make.height.mas_equalTo(15);
make.centerY.equalTo(self.contentView.mas_centerY);
}];
self.mySwitch = [[UISwitch alloc] init];
[self.contentView addSubview:self.mySwitch];
self.mySwitch.onTintColor = [UIColor orangeColor];
self.mySwitch.backgroundColor = [UIColor whiteColor];
[self.mySwitch mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.contentView.mas_right).offset(-15 * k6Scale);
make.centerY.equalTo(self.contentView);
}];
[self.mySwitch addTarget:self action:@selector(switchActionss:) forControlEvents:UIControlEventValueChanged];
self.cacheNumLalebl = [[UILabel alloc]init];
self.cacheNumLalebl.font = [UIFont systemFontOfSize:15.0];
self.cacheNumLalebl.textColor = [UIColor colorWithRed:180/255.0 green:180/255.0 blue:180/255.0 alpha:1.0];
[self.contentView addSubview:self.cacheNumLalebl];
[self.cacheNumLalebl mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(arrow.mas_left).offset(-5 * k6Scale);
make.centerY.equalTo(arrow);
}];
self.cacheNumLalebl.hidden = YES;
}
return self;
}
//获取缓存尺寸
-(void)sizeStr:(totalSize) completed{
// 获取文件夹尺寸
// 文件夹非常小,如果我的文件非常大
[XMGFileTool getFileSize:CachePath completion:^(NSInteger totalSize) {
NSString *sizeStr = @"0.00B";
// MB KB B
if (totalSize > 1000 * 1000) {
// MB
CGFloat sizeF = totalSize / 1000.0 / 1000.0;
sizeStr = [NSString stringWithFormat:@"%.1fMB",sizeF];
} else if (totalSize > 1000) {
// KB
CGFloat sizeF = totalSize / 1000.0;
sizeStr = [NSString stringWithFormat:@"%.1fKB",sizeF];
} else if (totalSize > 0) {
// B
sizeStr = [NSString stringWithFormat:@"%.ldB",totalSize];
}
completed(sizeStr);
}];
}
- (void) switchActionss:(UISwitch *) sender {
_model.switchIsOn = !_model.switchIsOn;
if (self.switchAction) {
self.switchAction(self.model.switchType);
}
}
- (void)setModel:(ZXUserSettingModel *)model {
_model = model;
self.iconImageView.image = [UIImage imageNamed:_model.imageName];
self.titleLabel.text = _model.name;
self.mySwitch.hidden = !_model.isHasSwitch;
[self.mySwitch setOn:_model.switchIsOn];
self.cacheNumLalebl.hidden = YES;
if (_model.isCleanCache) {
self.cacheNumLalebl.hidden = NO;
[self sizeStr:^(NSString *size) {
self.cacheNumLalebl.text = size;
}];
}
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
//
......@@ -50,8 +50,7 @@
}
} else if ([operation.defaultValue isEqualToString:@"997"]) {
//金图教育
ZXJTJYViewController *jtjyVc = [[ZXJTJYViewController alloc] init];
[self.navigationController pushViewController:jtjyVc animated:YES];
[self jtAction];
} else if ([operation.defaultValue isEqualToString:@"8"]) {
UIViewController *vc= [[NSClassFromString(@"ZXWisdomLatticeViewController") alloc] init];
[self.navigationController pushViewController:vc animated:YES];
......@@ -82,8 +81,7 @@
}
} else if ([operation.defaultValue isEqualToString:@"997"]) {
//金图教育
ZXJTJYViewController *jtjyVc = [[ZXJTJYViewController alloc] init];
[self.navigationController pushViewController:jtjyVc animated:YES];
[self jtAction];
} else if ([operation.defaultValue isEqualToString:@"8"]) {
UIViewController *vc= [[NSClassFromString(@"ZXWisdomLatticeViewController") alloc] init];
[self.navigationController pushViewController:vc animated:YES];
......@@ -102,7 +100,43 @@
}
}
}
#pragma mark - ==========金图教育==========
- (void) jtAction {
//查询是否授权
[ZXTool requestDataWithType:kXMHTTPMethodGET url:[NSString stringWithFormat:@"%@/dcxy/app/jt/whether/grant?customerId=%@", [kUserDefaults valueForKey:@"h5FirstPageAPI"], CacheUserId] para:nil completed:^(CommonModel *common, NSString *error) {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
if (error) {
[ZXTool showText:error];
} else {
if ([common.data integerValue] == 0) {
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"您将授权使用第三方的精图教育服务,精图提供教资、考研、国考等精选课程;授权后精图将使用您的多彩相关信息!" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *ac1 = [UIAlertAction actionWithTitle:@"取消" style:0 handler:^(UIAlertAction * _Nonnull action) {
}];
UIAlertAction *ac2 = [UIAlertAction actionWithTitle:@"同意" style:0 handler:^(UIAlertAction * _Nonnull action) {
//金图教育
ZXJTJYViewController *jtjyVc = [[ZXJTJYViewController alloc] init];
[self.navigationController pushViewController:jtjyVc animated:YES];
[ZXTool requestDataWithType:kXMHTTPMethodGET url:[NSString stringWithFormat:@"%@/dcxy/app/jt/grant?customerId=%@&grant=1", [kUserDefaults valueForKey:@"h5FirstPageAPI"], CacheUserId] para:nil completed:^(CommonModel *common, NSString *error) {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
});
}];
}];
[alert addAction:ac1];
[alert addAction:ac2];
[self presentViewController:alert animated:YES completion:nil];
} else {
//金图教育
ZXJTJYViewController *jtjyVc = [[ZXJTJYViewController alloc] init];
[self.navigationController pushViewController:jtjyVc animated:YES];
}
}
});
}];
}
#pragma mark - ========== 壁挂跳转 ==========
- (void) jumpDrinkByOperation:(ZXOperation *) operation {
//获取配置信息
......
//
//
......@@ -42,7 +42,7 @@
#import "ZXFirstPageService.h"
#import "NSString+Extension.h"
//========老版本部分内容-===============
#import "AnnouncementView.h"
#import "ZXAnnouncementView.h"
#import "CampasVersionUpdateModel.h"
#import "JudgeFirstTopUpModel.h"
#import "JudgeFirstTopUpModel.h"
......@@ -90,7 +90,7 @@
*/
@property (nonatomic, strong)PerfectInformation * infoView;
//强弹公告
@property (nonatomic, strong)AnnouncementView * announce;
@property (nonatomic, strong)ZXAnnouncementView * announce;
@property (nonatomic, strong)CampasVersionUpdateModel * updateModel;
@property (nonatomic,strong) UIAlertView * updateAlert;
@property (nonatomic, assign) BOOL isShowVersion;
......@@ -1116,31 +1116,20 @@ static NSInteger seq = 0;
}
#pragma mark - ========== 显示公告 ==========
- (void) showPublishWithItem:(ZXInformation *) info {
if (_announce) {
if (self.announce) {
return;
}
NSString *jumpUrl = [NSString stringWithFormat:@"%@/Content/%ld?title=%@", [kUserDefaults valueForKey:@"h5FirstPage"], (long)info.id, info.title];
AnnounceModelItem *item = [[AnnounceModelItem alloc] init];
item.noticeTitle = info.title;
item.noticeContent = jumpUrl;
item.updateDate = info.createTime;
item.noticeType = @"3";
item.forceId = [NSString stringWithFormat:@"%ld", info.id];
_announce=[[AnnouncementView alloc]initWithFrame:CGRectMake(0, 0, kWidth, kHeight)];
_announce.announceItem=item;
@weakify(self);
_announce.ok = ^(BOOL noNotice) {
@strongify(self);
self.announce.hidden = YES;
[self.announce removeFromSuperview];
NSString *jumpUrl = [NSString stringWithFormat:@"%@/Content/%ld?title=%@", [kUserDefaults objectForKey:@"h5FirstPage"],(long)info.id, info.title];
kWeakSelf(self);
self.announce = [[ZXAnnouncementView alloc] initWithFrame:[UIScreen mainScreen].bounds jumpUrl:jumpUrl];
self.announce.comfirm = ^(BOOL isNotAlert) {
kStrongSelf(self);
self.announce = nil;
//访问不再提醒接口
if (noNotice==YES) {
if (isNotAlert==YES) {
[self.service notShowPublishMsgWithInfo:info];
}
};
[[ZXTool returnKeyWindow] addSubview:_announce];
[kAppWindow addSubview:self.announce];
}
#pragma mark - ========== 内存警告 ==========
......
//
//
......@@ -105,6 +105,17 @@
make.height.mas_equalTo(0);
}];
//收到订单完成支付的通知
kWeakSelf(self);
[[[NSNotificationCenter defaultCenter] rac_addObserverForName:kOrder_Completed_Pay object:nil] subscribeNext:^(id x) {
kStrongSelf(self);
self.notPayView.hidden = YES;
}];
[[[NSNotificationCenter defaultCenter] rac_addObserverForName:kOrder_CheckNopPay_Pay object:nil] subscribeNext:^(id x) {
kStrongSelf(self);
self.section.isShowMask = NO;
[self createNotPayOrderView:self.notPayView];
}];
}
return self;
}
......@@ -155,9 +166,10 @@
if (self.section.isShowMask) {
return;
}
v.hidden = NO;
self.section.isShowMask = YES;
if ([ZXNotPay findAll].count) {
v.hidden = NO;
ZXNotPay *order = [ZXNotPay findAll].lastObject;
[self createNotPayViewBySuperView:v orderDetail:order.orderId alertStr:order.orderTitle];
return;
......@@ -183,6 +195,7 @@
p.userId = CacheUserId;
p.orderTitle = order;
[p save];
v.hidden = NO;
[self createNotPayViewBySuperView:v orderDetail:orderId alertStr:order];
});
}
......@@ -221,7 +234,10 @@
[backView addSubview:desc];
desc.font = kFontSize(12 * k6Scale);
desc.textColor = [UIColor whiteColor];
desc.text = alertStr?alertStr:@"您有一个待支付订单,请立即支付!";
if (alertStr == nil || [alertStr isEqualToString:@""]) {
alertStr = @"您有一个待支付订单,请立即支付!";
}
desc.text = alertStr;
[desc mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(iconImageView.mas_right).offset(10 * k6Scale);
......
//
//
......@@ -88,10 +88,10 @@
[list addObject:info];
_items = list.mutableCopy;
}
CGFloat W = kScreenWidth / 2.0f;
CGFloat W = (kScreenWidth-10 * k6Scale) / 2.0f;
for (int i = 0; i < count; i++) {
for (int j = 0; j < 2; j++) {
UIImageView *imageV = [[UIImageView alloc] initWithFrame:CGRectMake(W * j, 110 * k6Scale * i, W, 110 * k6Scale)];
UIImageView *imageV = [[UIImageView alloc] initWithFrame:CGRectMake(W * j + 5 * k6Scale, 110 * k6Scale * i, W, 110 * k6Scale)];
[self.contentView addSubview:imageV];
UIView *line = [UIView new];
[imageV addSubview:line];
......
//
//
......@@ -39,8 +39,10 @@
CGFloat brite = [[kUserDefaults objectForKey:@"defaultBright"] floatValue];
[[UIScreen mainScreen] setBrightness:brite];
[self removeNotificationAndKVO];
dispatch_cancel(self.gcdTimer);
self.gcdTimer = nil;
if (self.gcdTimer) {
dispatch_cancel(self.gcdTimer);
self.gcdTimer = nil;
}
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
......@@ -69,7 +71,18 @@
[self createBannerView];
[self createCodeView];
@weakify(self);
[[[NSNotificationCenter defaultCenter] rac_addObserverForName:kSelf_help_start_timer object:nil] subscribeNext:^(id x) {
@strongify(self);
[self createTimer];
}];
[[[NSNotificationCenter defaultCenter] rac_addObserverForName:kSelf_help_destory_timer object:nil] subscribeNext:^(id x) {
@strongify(self);
if (self.gcdTimer) {
dispatch_cancel(self.gcdTimer);
self.gcdTimer = nil;
}
}];
}
#pragma mark - ===================创建条码view==============================
- (void) createBarCodeView {
......@@ -245,6 +258,7 @@
}];
__weak typeof(self) weakSelf = self;
[[back rac_signalForControlEvents:UIControlEventTouchDown] subscribeNext:^(id x) {
[[NSNotificationCenter defaultCenter] postNotificationName:kOrder_CheckNopPay_Pay object:nil];
for (UIViewController *vc in weakSelf.navigationController.childViewControllers) {
if ([vc isKindOfClass:NSClassFromString(@"ZTHomeViewController")] || [vc isKindOfClass:NSClassFromString(@"ZXSimpleHomeController")] || [vc isKindOfClass:NSClassFromString(@"ZXRSNewViewController")]) {
[weakSelf.navigationController popToViewController:vc animated:YES];
......@@ -340,17 +354,19 @@
#pragma mark - 创建定时器 5s一次请求当前是否有未支付订单
#pragma mark - 创建定时器 15s一次请求当前是否有未支付订单
- (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, 5.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];
[ZXTool codePageIsNeedCheckNotPayOrder:^{
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, 15.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);
// 启动任务,GCD计时器创建后需要手动启动
dispatch_resume(self.gcdTimer);
}];
}
......
//
//
......@@ -35,18 +35,23 @@
[self createNabar];
[self.view addSubview:self.myTableView];
[self createHeader];
// //加载广告信息
// @weakify(self);
// [self.service loadADListCompleted:^{
// @strongify(self);
// if (self.service.adList.count) {
// ZXDrinkAdModel *ad = self.service.adList.firstObject;
// [self.adImageView sd_setImageWithURL:[NSURL URLWithString:ad.imgUrl]];
// }
// }];
[ZXTool loadAdInfoByAdId:@"8" topView:nil superView:self.view fromVc:self];
//加载最新数据
[self loadNewData];
@weakify(self);
[[[NSNotificationCenter defaultCenter] rac_addObserverForName:kSelf_help_start_timer object:nil] subscribeNext:^(id x) {
@strongify(self);
[self createTimer];
}];
[[[NSNotificationCenter defaultCenter] rac_addObserverForName:kSelf_help_destory_timer object:nil] subscribeNext:^(id x) {
@strongify(self);
if (self.gcdTimer) {
dispatch_cancel(self.gcdTimer);
self.gcdTimer = nil;
}
}];
}
#pragma mark - ========== 创建导航栏 ==========
......@@ -77,11 +82,13 @@
make.left.equalTo(naTitle.mas_left).offset(12 * k6Scale);
make.centerY.equalTo(naTitle);
}];
__weak typeof(self) weakSelf = self;
@weakify(self);
[[back rac_signalForControlEvents:UIControlEventTouchDown] subscribeNext:^(id x) {
@strongify(self);
[[NSNotificationCenter defaultCenter] postNotificationName:kOrder_CheckNopPay_Pay object:nil];
for (UIViewController *vc in self.navigationController.childViewControllers) {
if ([vc isKindOfClass:NSClassFromString(@"ZTHomeViewController")] || [vc isKindOfClass:NSClassFromString(@"ZXRSNewViewController")] || [vc isKindOfClass:NSClassFromString(@"ZXSimpleHomeController")]) {
[weakSelf.navigationController popToViewController:vc animated:YES];
[self.navigationController popToViewController:vc animated:YES];
}
}
}];
......@@ -93,7 +100,6 @@
make.right.equalTo(naTitle.mas_right).offset(-12 * k6Scale);
make.centerY.equalTo(naTitle);
}];
@weakify(self);
[[scan rac_signalForControlEvents:UIControlEventTouchDown] subscribeNext:^(id x) {
@strongify(self);
if (self.currentMerthin && self.startDrink.selected) {
......@@ -277,8 +283,10 @@
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
dispatch_cancel(self.gcdTimer);
self.gcdTimer = nil;
if (self.gcdTimer) {
dispatch_cancel(self.gcdTimer);
self.gcdTimer = nil;
}
}
#pragma mark - ========== UITableView/Delegate/Datasource ==========
- (UITableView *)myTableView {
......@@ -434,16 +442,18 @@
// }
// return _adImageView;
//}
#pragma mark - 创建定时器 10s一次请求当前是否有未支付订单
#pragma mark - 创建定时器 5s一次请求当前是否有未支付订单
- (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];
[ZXTool codePageIsNeedCheckNotPayOrder:^{
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, 15.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);
// 启动任务,GCD计时器创建后需要手动启动
dispatch_resume(self.gcdTimer);
}];
}
@end
//
//
......@@ -12,6 +12,8 @@
#import "HMScannerMaskView.h"
#import "HMScanner.h"
#import "enlargeClickRegionBtn.h"
#import "JXLayoutButton.h"
#import <AVFoundation/AVFoundation.h>//调用闪光灯需要导入该框架
/// 控件间距
#define kControlMarginWash 92.0
......@@ -200,6 +202,48 @@
if (self.model) {
[self createCard];
} else {
JXLayoutButton *open = [[JXLayoutButton alloc] init];
[self.view addSubview:open];
[open mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(scannerBorder.mas_bottom).offset(20 * k6Scale);
make.width.mas_equalTo(150 * k6Scale);
make.height.mas_equalTo(80 * k6Scale);
make.centerX.equalTo(scannerBorder.mas_centerX);
}];
open.imageSize =CGSizeMake(10 * k6Scale, 22 * k6Scale);
open.layoutStyle = JXLayoutButtonStyleUpImageDownTitle;
open.midSpacing = 3 * k6Scale;
open.titleLabel.font = kFontSize(12 * k6Scale);
[open setTitle:@"打开闪光灯" forState:UIControlStateNormal];
[open setTitle:@"关闭闪光灯" forState:UIControlStateSelected];
[open setImage:[UIImage imageNamed:@"icon_off"] forState:UIControlStateNormal];
[open setImage:[UIImage imageNamed:@"icon_on"] forState:UIControlStateSelected];
[open setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[open setTitleColor:[UIColor colorWithHexString:@"#456beb"] forState:UIControlStateSelected];
[[open rac_signalForControlEvents:UIControlEventTouchDown] subscribeNext:^(UIButton *x) {
x.selected = !x.selected;
if (x.isSelected == YES) { //打开闪光灯
AVCaptureDevice *captureDevice = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
NSError *error = nil;
if ([captureDevice hasTorch]) {
BOOL locked = [captureDevice lockForConfiguration:&error];
if (locked) {
captureDevice.torchMode = AVCaptureTorchModeOn;
[captureDevice unlockForConfiguration];
}
}
}else{//关闭闪光灯
AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
if ([device hasTorch]) {
[device lockForConfiguration:nil];
[device setTorchMode: AVCaptureTorchModeOff];
[device unlockForConfiguration];
}
}
}];
}
if ([self.cardName isEqualToString:@""] || self.cardName ==nil) {
......
//
//
......@@ -21,7 +21,7 @@
self.webView = [[WKWebView alloc] initWithFrame:[UIScreen mainScreen].bounds];
[self.view addSubview:self.webView];
[self.webView addObserver:self forKeyPath:@"estimatedProgress" options:NSKeyValueObservingOptionNew context:nil];
[self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.jumpUrl]]];
[self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[self.jumpUrl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]]];
}
......
//
//
......@@ -14,7 +14,7 @@
#import "ZXInformation.h"
#import "ZXRSTableHeader.h"
//========老版本部分内容-===============
#import "AnnouncementView.h"
#import "ZXAnnouncementView.h"
#import "AnnounceModel.h"
#import "ZXPopMenuViewController.h"
#import "ZXBannerJumpViewController.h"
......@@ -33,7 +33,7 @@
@property (nonatomic, strong) SDCycleScrollView *cycleScrollView;
@property (nonatomic, strong) ZXFirstPageService *service;
//强弹公告
@property (nonatomic, strong)AnnouncementView * announce;
@property (nonatomic, strong)ZXAnnouncementView * announce;
@property (nonatomic, assign) BOOL isExpan;
......@@ -127,31 +127,20 @@
}
#pragma mark - ========== 显示公告 ==========
- (void) showPublishWithItem:(ZXInformation *) info {
if (_announce) {
if (self.announce) {
return;
}
NSString *jumpUrl = [NSString stringWithFormat:@"%@/Content/%ld?title=%@", [kUserDefaults valueForKey:@"h5FirstPage"], (long)info.id, info.title];
AnnounceModelItem *item = [[AnnounceModelItem alloc] init];
item.noticeTitle = info.title;
item.noticeContent = jumpUrl;
item.updateDate = info.createTime;
item.noticeType = @"3";
item.forceId = [NSString stringWithFormat:@"%ld", (long)info.id];
_announce=[[AnnouncementView alloc]initWithFrame:CGRectMake(0, 0, kWidth, kHeight)];
_announce.announceItem=item;
@weakify(self);
_announce.ok = ^(BOOL noNotice) {
@strongify(self);
self.announce.hidden = YES;
[self.announce removeFromSuperview];
NSString *jumpUrl = [NSString stringWithFormat:@"%@/Content/%ld?title=%@", [kUserDefaults objectForKey:@"h5FirstPage"],(long)info.id, info.title];
kWeakSelf(self);
self.announce = [[ZXAnnouncementView alloc] initWithFrame:[UIScreen mainScreen].bounds jumpUrl:jumpUrl];
self.announce.comfirm = ^(BOOL isNotAlert) {
kStrongSelf(self);
self.announce = nil;
//访问不再提醒接口
if (noNotice==YES) {
if (isNotAlert==YES) {
[self.service notShowPublishMsgWithInfo:info];
}
};
[[ZXTool returnKeyWindow] addSubview:_announce];
[kAppWindow addSubview:self.announce];
}
- (void) createMenuViewByList:(NSArray *) list {
......
//
//
......@@ -24,7 +24,7 @@
#import "ZXNewsViewController.h"
#import "ZXRSNewsManagerController.h"
//========老版本部分内容-===============
#import "AnnouncementView.h"
#import "ZXAnnouncementView.h"
#import "CampasVersionUpdateModel.h"
#import "JudgeFirstTopUpModel.h"
#import "JudgeFirstTopUpModel.h"
......@@ -72,7 +72,7 @@
*/
@property (nonatomic, strong)PerfectInformation * infoView;
//强弹公告
@property (nonatomic, strong)AnnouncementView * announce;
@property (nonatomic, strong)ZXAnnouncementView * announce;
@property (nonatomic, strong)CampasVersionUpdateModel * updateModel;
@property (nonatomic,strong) UIAlertView * updateAlert;
@property (nonatomic, assign) BOOL isShowVersion;
......@@ -792,31 +792,20 @@ static NSInteger seq = 0;
}
#pragma mark - ========== 显示公告 ==========
- (void) showPublishWithItem:(ZXInformation *) info {
if (_announce) {
if (self.announce) {
return;
}
NSString *jumpUrl = [NSString stringWithFormat:@"%@/Content/%ld?title=%@", [kUserDefaults valueForKey:@"h5FirstPage"], (long)info.id, info.title];
AnnounceModelItem *item = [[AnnounceModelItem alloc] init];
item.noticeTitle = info.title;
item.noticeContent = jumpUrl;
item.updateDate = info.createTime;
item.noticeType = @"3";
item.forceId = [NSString stringWithFormat:@"%ld", info.id];
_announce=[[AnnouncementView alloc]initWithFrame:CGRectMake(0, 0, kWidth, kHeight)];
_announce.announceItem=item;
@weakify(self);
_announce.ok = ^(BOOL noNotice) {
@strongify(self);
self.announce.hidden = YES;
[self.announce removeFromSuperview];
NSString *jumpUrl = [NSString stringWithFormat:@"%@/Content/%ld?title=%@", [kUserDefaults objectForKey:@"h5FirstPage"],(long)info.id, info.title];
kWeakSelf(self);
self.announce = [[ZXAnnouncementView alloc] initWithFrame:[UIScreen mainScreen].bounds jumpUrl:jumpUrl];
self.announce.comfirm = ^(BOOL isNotAlert) {
kStrongSelf(self);
self.announce = nil;
//访问不再提醒接口
if (noNotice==YES) {
if (isNotAlert==YES) {
[self.service notShowPublishMsgWithInfo:info];
}
};
[[ZXTool returnKeyWindow] addSubview:_announce];
[kAppWindow addSubview:self.announce];
}
#pragma mark - ========== 内存警告 ==========
......
//
//
......@@ -150,4 +150,6 @@ typedef void(^loginSuccessJump)(NSString *jump);
adType:(NSString *) adType
isFirstPage:(BOOL) isFirstPage
isHasBottomMargin:(BOOL) isHasBottomMargin;
+(void) codePageIsNeedCheckNotPayOrder:(dispatch_block_t) completed;
@end
//
//
......@@ -1767,4 +1767,53 @@ void ProviderReleaseData (void *info, const void *data, size_t size){
[[ZXBDTool sharedZXBDTool] createNativieAdByView:superView topView:topView viewController:fromVc isFirstPage:isFirstPage isHasBottomMargin:isHasBottomMargin];
}
}
#pragma mark - ==========是否需要在条码页轮训待支付订单==========
+(void) codePageIsNeedCheckNotPayOrder:(dispatch_block_t) completed {
[ZXTool requestDataWithType:kXMHTTPMethodGET url:[NSString stringWithFormat:@"%@/dcxy/api/operationModeConf?areaId=%@", [kUserDefaults objectForKey:@"SX_MONEY"], CacheCampusId] para:nil completed:^(CommonModel *common, NSString *error) {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
if (error==nil) {
}
});
}];
NSString *url = [NSString stringWithFormat:@"%@/dcxy/api/operationModeConf?areaId=%@", [kUserDefaults objectForKey:@"SX_MONEY"], CacheCampusId];
[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) {
if (responseObject[@"data"]) {
if ([responseObject[@"data"][@"mode"] integerValue] == 1 || [responseObject[@"data"][@"mode"] integerValue] == 2) {
//单独加载是否是订单模式
NSString *url2 = [NSString stringWithFormat:@"%@/app/customer/balance/state?customerId=%@", [kUserDefaults valueForKey:@"NEW_PAY"],CacheUserId];
[XMCenter sendRequest:^(XMRequest *request) {
request.url = [url2 stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
request.httpMethod = kXMHTTPMethodGET;
request.headers = @{@"token": CacheToken,@"reqSource":@"app", @"Content-Type":@"application/json"};
} onSuccess:^(id responseObject) {
if ([responseObject[@"code"] integerValue] == 1000) {
if (responseObject[@"data"]) {
NSInteger status = [responseObject[@"data"] integerValue];
if (status == 0) {
completed();
}
}
}
} onFailure:^(NSError *error) {
} onFinished:^(id responseObject, NSError *error) {
}];
}
}
}
} onFailure:^(NSError *error) {
} onFinished:^(id responseObject, NSError *error) {
}];
}
@end
//
//
......@@ -180,6 +180,13 @@
}
}];
});
} else if ([responseObject[@"code"] integerValue] == 1006) {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXNotPay clearTable];
[ZXTool hideLoadingAnimation];
[self paySuccessAndBackToRoot];
[ZXTool showText:responseObject[@"msg"]];
});
} else {
dispatch_async(dispatch_get_main_queue(), ^{
[ZXTool hideLoadingAnimation];
......@@ -199,6 +206,7 @@
if (self.paySuccess) {
self.paySuccess();
}
[[NSNotificationCenter defaultCenter] postNotificationName:kOrder_Completed_Pay object:nil];
dispatch_async(dispatch_get_main_queue(), ^{
NSArray *controllers = self.navigationController.childViewControllers;
NSArray *res = [[controllers reverseObjectEnumerator] allObjects];
......
//
//
......@@ -60,7 +60,7 @@
if (dic && dic[@"paymentAndActiveInfos"]) {
[self.payTypes removeAllObjects];
NSInteger defaultPayType = -1;//默认为-1
if (responseObject[@"defaultPayType"]) {
if (responseObject[@"defaultPayType"] && ![responseObject[@"defaultPayType"] isKindOfClass:[NSNull class]]) {
defaultPayType = [responseObject[@"defaultPayType"] integerValue];
}
NSArray *arr = [ZXNewPayTypeModel mj_objectArrayWithKeyValuesArray:dic[@"paymentAndActiveInfos"]];
......@@ -192,6 +192,7 @@
@weakify(self);
[[back rac_signalForControlEvents:UIControlEventTouchDown] subscribeNext:^(id x) {
@strongify(self);
[[NSNotificationCenter defaultCenter] postNotificationName:kOrder_CheckNopPay_Pay object:nil];
for (UIViewController *vc in self.navigationController.childViewControllers) {
if ([vc isKindOfClass:NSClassFromString(@"ZTHomeViewController")] || [vc isKindOfClass:NSClassFromString(@"ZXRSNewViewController")] || [vc isKindOfClass:NSClassFromString(@"ZXSimpleHomeController")] || [vc isKindOfClass:NSClassFromString(@"ZXNewPayOrderListViewController")]) {
[self.navigationController popToViewController:vc animated:YES];
......
//
//
......@@ -82,14 +82,8 @@
#pragma mark - 生命周期方法
- (void)viewDidLoad {
[super viewDidLoad];
// self.hasGzstore=NO;
// 判断是否有格子铺
// self.gzstoreModel=[JudgegzStore new];
// [self registNotificationAndKVO];
// [self.gzstoreModel judgeGzStore];
[kUserDefaults setValue:@"isOpenFreePay" forKey:@"no"];//默认是no
[kUserDefaults setValue:@"no" forKey:@"isOpenFreePay"];//默认是no
NSString *url = [NSString stringWithFormat:@"%@/area/switchs?areaId=%@", [kUserDefaults objectForKey:@"SX_MONEY"], CacheCampusId];
@weakify(self);
[XMCenter sendRequest:^(XMRequest *request) {
......@@ -102,11 +96,11 @@
NSArray *arr = responseObject[@"areaSwitchs"];
NSMutableArray *arr_type = [[NSMutableArray alloc] init];
for (NSDictionary *dic in arr) {
if ([dic[@"isEnabled"] integerValue] == 1) {
if ([dic[@"isEnabled"] integerValue] == 1 && ![dic[@"type"] isEqualToString:@"4"]) {
[arr_type addObject:dic];
}
if ([dic[@"type"] isEqualToString:@"3"] && [dic[@"isEnabled"] integerValue] == 1) {
[kUserDefaults setValue:@"isOpenFreePay" forKey:@"yes"];//默认是no
if ([dic[@"type"] isEqualToString:@"4"] && [dic[@"isEnabled"] integerValue] == 1) {
[kUserDefaults setValue:@"yes" forKey:@"isOpenFreePay"];//默认是no
}
}
if (arr_type.count == 2) {
......
{
"images" : [
{
"idiom" : "universal",
"filename" : "icon_off.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "icon_off@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "icon_off@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "icon_on.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "icon_on@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "icon_on@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