Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
colorfulSchoolReconsitution
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘卓鑫
colorfulSchoolReconsitution
Commits
03a219ed
Commit
03a219ed
authored
Mar 12, 2019
by
liuZX
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重构版本现有bug修改
parent
0da18332
Hide whitespace changes
Inline
Side-by-side
Showing
60 changed files
with
1491 additions
and
935 deletions
+1491
-935
project.pbxproj
ColorfulSchool/ColorfulSchool.xcodeproj/project.pbxproj
+14
-8
UserInterfaceState.xcuserstate
...userdata/liuZX.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
Breakpoints_v2.xcbkptlist
...ta/liuZX.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
+1
-1
AppDelegate+Extension.m
ColorfulSchool/ColorfulSchool/AppDelegate+Extension.m
+8
-8
AppDelegate.m
ColorfulSchool/ColorfulSchool/AppDelegate.m
+2
-1
ZXSimpleADController.m
...Classes/11.20SimpleApp(极简版)/ADPage/ZXSimpleADController.m
+2
-1
ZXSimpleHomeController.m
...ses/11.20SimpleApp(极简版)/HomePage/ZXSimpleHomeController.m
+97
-46
ZXSimpleHomeHeaderCell.h
...ses/11.20SimpleApp(极简版)/HomePage/ZXSimpleHomeHeaderCell.h
+4
-3
ZXSimpleHomeHeaderCell.m
...ses/11.20SimpleApp(极简版)/HomePage/ZXSimpleHomeHeaderCell.m
+33
-13
ZXSimpleNewAdCell.m
.../Classes/11.20SimpleApp(极简版)/HomePage/ZXSimpleNewAdCell.m
+4
-2
ZXSimpleAccountViewController.h
...版)/HomePage/accountCenter/ZXSimpleAccountViewController.h
+3
-3
ZXSimpleChangeDeviceBindTelController.h
...omePage/changePwd/ZXSimpleChangeDeviceBindTelController.h
+3
-3
ZXSimpleChangeDeviceBindTelController.m
...omePage/changePwd/ZXSimpleChangeDeviceBindTelController.m
+19
-22
ZXSimpleChangeDevicePwdViewController.h
...omePage/changePwd/ZXSimpleChangeDevicePwdViewController.h
+3
-3
ZXSimpleChangeDevicePwdViewController.m
...omePage/changePwd/ZXSimpleChangeDevicePwdViewController.m
+25
-20
ZXSimpleChangeLoginPwdController.h
...简版)/HomePage/changePwd/ZXSimpleChangeLoginPwdController.h
+3
-3
ZXSimpleChangeLoginPwdController.m
...简版)/HomePage/changePwd/ZXSimpleChangeLoginPwdController.m
+20
-21
ZXSimpleCodeView.m
...11.20SimpleApp(极简版)/HomePage/changePwd/ZXSimpleCodeView.m
+11
-20
ZXSimpleUserCenterViewController.h
...版)/HomePage/userCenter/ZXSimpleUserCenterViewController.h
+4
-3
ZXSimpleUserCenterViewController.m
...版)/HomePage/userCenter/ZXSimpleUserCenterViewController.m
+51
-35
MulityAdCell.m
...rfulSchool/Classes/CustomViews(自定义)/ADTool/MulityAdCell.m
+3
-2
GraphicsCode.m
...ol/ColorfulSchool/Classes/CustomViews(自定义)/GraphicsCode.m
+33
-22
ZLControl.m
...chool/ColorfulSchool/Classes/CustomViews(自定义)/ZLControl.m
+6
-2
NSDictionary+Property.m
...fulSchool/Classes/Extension(分类扩展)/NSDictionary+Property.m
+3
-3
forgetPasswordViewController.h
.../ForgetPassword/Controller/forgetPasswordViewController.h
+2
-2
forgetPasswordViewController.m
.../ForgetPassword/Controller/forgetPasswordViewController.m
+61
-52
LoginView.m
...ulSchool/Classes/Login(登录注册)/Login/Controller/LoginView.m
+92
-3
ZXChooseSchoolViewController.h
...gin(登录注册)/Login/Controller/ZXChooseSchoolViewController.h
+3
-3
ZXChooseSchoolViewController.m
...gin(登录注册)/Login/Controller/ZXChooseSchoolViewController.m
+70
-57
ZXRegistorViewController.m
...s/Login(登录注册)/Login/Controller/ZXRegistorViewController.m
+52
-83
LoginModel.h
...lorfulSchool/Classes/Login(登录注册)/Login/Modle/LoginModel.h
+2
-2
LoginModel.m
...lorfulSchool/Classes/Login(登录注册)/Login/Modle/LoginModel.m
+22
-8
ZXNewSchool.h
...orfulSchool/Classes/Login(登录注册)/Login/Modle/ZXNewSchool.h
+3
-1
ZXUserModel.h
...orfulSchool/Classes/Login(登录注册)/Login/Modle/ZXUserModel.h
+47
-0
ZXUserModel.m
...orfulSchool/Classes/Login(登录注册)/Login/Modle/ZXUserModel.m
+14
-0
AboutUs.h
...chool/Classes/MineView(个人中心)/AboutUs/Controller/AboutUs.h
+3
-2
AboutUs.m
...chool/Classes/MineView(个人中心)/AboutUs/Controller/AboutUs.m
+57
-7
ZXConfirmPayViewController.m
...(个人中心)/AimiWallet/Controller/ZXConfirmPayViewController.m
+26
-5
FeedBackView.m
...Classes/MineView(个人中心)/FeedBack/Controller/FeedBackView.m
+5
-2
MineViewController.m
...MineView(个人中心)/UserCenter/Controller/MineViewController.m
+65
-37
UserInfoViewController.h
.../Classes/MineView(个人中心)/UserInfo/UserInfoViewController.h
+3
-3
UserInfoViewController.m
.../Classes/MineView(个人中心)/UserInfo/UserInfoViewController.m
+98
-159
updateViewController.m
.../ChangePasswordAndPhone/Controller/updateViewController.m
+152
-97
updateViewController.xib
...hangePasswordAndPhone/Controller/updateViewController.xib
+5
-41
UserSettingViewController.m
...serSetting/UserSet/Controller/UserSettingViewController.m
+117
-31
ZTHomeViewController.m
...ses/NewFirstPage(新版首页)/Controllers/ZTHomeViewController.m
+12
-8
ZXFirstPageService.m
...Classes/NewFirstPage(新版首页)/ViewModel/ZXFirstPageService.m
+5
-6
ZXSelfHelpViewController.m
.../Classes/Operation(自助服务)/2.0条码/ZXSelfHelpViewController.m
+17
-15
ZXRSNewViewController.m
...l/ColorfulSchool/Classes/RSAD(瑞狮)/ZXRSNewViewController.m
+3
-3
ZXTXAdTool.h
ColorfulSchool/ColorfulSchool/Classes/TX广告/ZXTXAdTool.h
+4
-1
ZXTXAdTool.m
ColorfulSchool/ColorfulSchool/Classes/TX广告/ZXTXAdTool.m
+86
-2
ZXTool.h
ColorfulSchool/ColorfulSchool/Classes/Tool(工具)/ZXTool.h
+2
-2
ZXTool.m
ColorfulSchool/ColorfulSchool/Classes/Tool(工具)/ZXTool.m
+44
-54
ZXNewConfirmPayViewController.m
...s/YWTPay(新版支付)/Controller/ZXNewConfirmPayViewController.m
+6
-2
Info.plist
ColorfulSchool/ColorfulSchool/Info.plist
+32
-0
MyTabViewController.m
.../ColorfulSchool/Main(入口)/Controller/MyTabViewController.m
+5
-2
Contents.json
...images.xcassets/newpay/icon_mianmi.imageset/Contents.json
+24
-0
icon_mianmi.png
...ages.xcassets/newpay/icon_mianmi.imageset/icon_mianmi.png
+0
-0
icon_mianmi@2x.png
...s.xcassets/newpay/icon_mianmi.imageset/icon_mianmi@2x.png
+0
-0
icon_mianmi@3x.png
...s.xcassets/newpay/icon_mianmi.imageset/icon_mianmi@3x.png
+0
-0
No files found.
ColorfulSchool/ColorfulSchool.xcodeproj/project.pbxproj
View file @
03a219ed
...
...
@@ -612,6 +612,7 @@
A7F3E1CC21B5359A00010E23
/* mztools.c in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
A7F3E1CB21B5359A00010E23
/* mztools.c */
;
};
A7F3E1CF21B535C000010E23
/* ioapi.c in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
A7F3E1CE21B535BF00010E23
/* ioapi.c */
;
};
A7F3E1D321B5360700010E23
/* ZipArchive.mm in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
A7F3E1D221B5360600010E23
/* ZipArchive.mm */
;
settings
=
{
COMPILER_FLAGS
=
"-fno-objc-arc"
;
};
};
A7F9BD1922267C8F0029B6DC
/* ZXUserModel.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
A7F9BD1822267C8F0029B6DC
/* ZXUserModel.m */
;
};
A7FA41D221B777010016C6BE
/* ZXRSReportViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
A7FA41D121B777010016C6BE
/* ZXRSReportViewController.m */
;
};
A7FE8D7020C8DD8C0028B721
/* ZTHomeViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
A7FE8D6F20C8DD8C0028B721
/* ZTHomeViewController.m */
;
};
A7FE8D7320C8F7B30028B721
/* New_BannerCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
A7FE8D7220C8F7B30028B721
/* New_BannerCell.m */
;
};
...
...
@@ -1765,6 +1766,8 @@
A7F3E1CE21B535BF00010E23
/* ioapi.c */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.c
;
path
=
ioapi.c
;
sourceTree
=
"<group>"
;
};
A7F3E1D021B535CC00010E23
/* ioapi.h */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
ioapi.h
;
sourceTree
=
"<group>"
;
};
A7F3E1D221B5360600010E23
/* ZipArchive.mm */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.cpp.objcpp
;
path
=
ZipArchive.mm
;
sourceTree
=
"<group>"
;
};
A7F9BD1722267C8F0029B6DC
/* ZXUserModel.h */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
ZXUserModel.h
;
sourceTree
=
"<group>"
;
};
A7F9BD1822267C8F0029B6DC
/* ZXUserModel.m */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
ZXUserModel.m
;
sourceTree
=
"<group>"
;
};
A7FA41D021B777010016C6BE
/* ZXRSReportViewController.h */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
ZXRSReportViewController.h
;
sourceTree
=
"<group>"
;
};
A7FA41D121B777010016C6BE
/* ZXRSReportViewController.m */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
ZXRSReportViewController.m
;
sourceTree
=
"<group>"
;
};
A7FE8D6E20C8DD8C0028B721
/* ZTHomeViewController.h */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
ZTHomeViewController.h
;
sourceTree
=
"<group>"
;
};
...
...
@@ -3277,6 +3280,8 @@
A75436B921D34566005584CC
/* LoginModel.m */
,
A748D724221CF96400777FFC
/* ZXNewSchool.h */
,
A748D723221CF96300777FFC
/* ZXNewSchool.m */
,
A7F9BD1722267C8F0029B6DC
/* ZXUserModel.h */
,
A7F9BD1822267C8F0029B6DC
/* ZXUserModel.m */
,
);
path
=
Modle
;
sourceTree
=
"<group>"
;
...
...
@@ -3357,21 +3362,21 @@
isa
=
PBXGroup
;
children
=
(
A756C57F21F9B58F0006E418
/* ZXNewPayHeaderTableViewCell.h */
,
A756C58821F9B58F0006E418
/* ZXNewPayHeaderTableViewCell.m */
,
A756C58321F9B58F0006E418
/* ZXNewPayOrderTableViewCell.m */
,
A756C58C21F9B58F0006E418
/* ZXNewPayOrderTableViewCell.h */
,
A756C58721F9B58F0006E418
/* ZXNewOtherPayTableViewCell.h */
,
A756C58021F9B58F0006E418
/* ZXNewOtherPayTableViewCell.m */
,
A756C58921F9B58F0006E418
/* ZXPMDView.h */
,
A756C58121F9B58F0006E418
/* ZXPMDView.m */
,
A756C58221F9B58F0006E418
/* ZXNewPayTypeTableViewCell.h */
,
A756C58321F9B58F0006E418
/* ZXNewPayOrderTableViewCell.m */
,
A756C58421F9B58F0006E418
/* ZXNewAmiPayTableViewCell.h */
,
A756C58B21F9B58F0006E418
/* ZXNewAmiPayTableViewCell.m */
,
A756C58E21F9B58F0006E418
/* ZXNewOrderDetailTableViewCell.h */
,
A756C58521F9B58F0006E418
/* ZXNewOrderDetailTableViewCell.m */
,
A756C58D21F9B58F0006E418
/* ZXNewPayTypeActivityTableViewCell.h */
,
A756C58621F9B58F0006E418
/* ZXNewPayTypeActivityTableViewCell.m */
,
A756C58721F9B58F0006E418
/* ZXNewOtherPayTableViewCell.h */
,
A756C58821F9B58F0006E418
/* ZXNewPayHeaderTableViewCell.m */
,
A756C58921F9B58F0006E418
/* ZXPMDView.h */
,
A756C58A21F9B58F0006E418
/* ZXNewPayTypeTableViewCell.m */
,
A756C58B21F9B58F0006E418
/* ZXNewAmiPayTableViewCell.m */
,
A756C58C21F9B58F0006E418
/* ZXNewPayOrderTableViewCell.h */
,
A756C58D21F9B58F0006E418
/* ZXNewPayTypeActivityTableViewCell.h */
,
A756C58E21F9B58F0006E418
/* ZXNewOrderDetailTableViewCell.h */
,
);
path
=
view
;
sourceTree
=
"<group>"
;
...
...
@@ -5278,6 +5283,7 @@
A71EF38020FC73860009EA37
/* ZXWisdomLatticeViewController.m in Sources */
,
A705BF7C21D47FB3004F1628
/* YYImageCoder.m in Sources */
,
A7F3E1B921B5330F00010E23
/* XDSReadSettingView.m in Sources */
,
A7F9BD1922267C8F0029B6DC
/* ZXUserModel.m in Sources */
,
A7F3E18721B5330F00010E23
/* XDSReadConfig.m in Sources */
,
22704B091F481B1100B8D786
/* ChangePhoneModel.m in Sources */
,
A705C05921D4B112004F1628
/* ALiImageShapeView.m in Sources */
,
...
...
ColorfulSchool/ColorfulSchool.xcworkspace/xcuserdata/liuZX.xcuserdatad/UserInterfaceState.xcuserstate
View file @
03a219ed
No preview for this file type
ColorfulSchool/ColorfulSchool.xcworkspace/xcuserdata/liuZX.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
View file @
03a219ed
...
...
@@ -9,7 +9,7 @@
shouldBeEnabled =
"Yes"
ignoreCount =
"0"
continueAfterRunningActions =
"No"
scope =
"
1
"
scope =
"
0
"
stopOnStyle =
"0"
>
</BreakpointContent>
</BreakpointProxy>
...
...
ColorfulSchool/ColorfulSchool/AppDelegate+Extension.m
View file @
03a219ed
...
...
@@ -72,7 +72,7 @@
// [userDefaults setObject:@"http://in-dev-3rd-laundry-api.168cad.top/dcxy/app/third/laundry"forKey:@"ZiyuWashApi"];
[
userDefaults
setObject
:
@"http://192.168.1.33:8033/dcxy/app/third/laundry"
forKey
:
@"ZiyuWashApi"
];
//智慧格子
[
userDefaults
setObject
:
@"http://ex-dev-locker.168cad.top
:8181
"
forKey
:
@"WisdomLatticeAPI"
];
[
userDefaults
setObject
:
@"http://ex-dev-locker.168cad.top"
forKey
:
@"WisdomLatticeAPI"
];
// [userDefaults setObject:@"http://192.168.1.145:8080" forKey:@"WisdomLatticeAPI"];
[
userDefaults
setObject
:
@"http://ex-dev-gx-app-server.168cad.top"
forKey
:
@"Drink"
];
...
...
@@ -84,12 +84,13 @@
[
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.102:8000" forKey:@"NEW_PAY"];
// [userDefaults setObject:@"http://192.168.1.102:9090" forKey:@"SX_MONEY"];
[
userDefaults
setObject
:
@"http://ex-dev-dcxy-base-app.168cad.top"
forKey
:
@"SX_MONEY"
];
//授信保证金
[
userDefaults
setValue
:
@"http://121.15.180.66:801/netpayment/BaseHttp.dll?
H5PayJsonSDK
"
forKey
:
@"YWT_PAY"
];
[
userDefaults
setValue
:
@"http://121.15.180.66:801/netpayment/BaseHttp.dll?
MB_EUserPay
"
forKey
:
@"YWT_PAY"
];
[
userDefaults
synchronize
];
break
;
}
...
...
@@ -123,7 +124,7 @@
[
userDefaults
setObject
:
@"http://internal-test-clmsmis.168cad.top/clmsmis/mt/entrance"
forKey
:
@"ExceptionUploadAPI"
];
[
userDefaults
setObject
:
@"http://in-test-3rd-laundry-api.168cad.top/dcxy/app/third/laundry"
forKey
:
@"ZiyuWashApi"
];
[
userDefaults
setObject
:
@"http://ex-test-locker.168cad.top
:8181
"
forKey
:
@"WisdomLatticeAPI"
];
[
userDefaults
setObject
:
@"http://ex-test-locker.168cad.top"
forKey
:
@"WisdomLatticeAPI"
];
[
userDefaults
setObject
:
@"http://ex-test-gx-app-server.168cad.top"
forKey
:
@"Drink"
];
//新充值
[
userDefaults
setObject
:
@"http://in-test-selfbase.168cad.top"
forKey
:
@"Recharge"
];
...
...
@@ -131,9 +132,8 @@
[
userDefaults
setObject
:
@"http://ex-test-dcxy-customer-app.168cad.top"
forKey
:
@"NEW_PAY"
];
// [userDefaults setObject:@"http://192.168.1.145:8081" forKey:@"NEW_PAY"];
[
userDefaults
setObject
:
@"http://ex-test-dcxy-base-app.168cad.top"
forKey
:
@"SX_MONEY"
];
//授信保证金
[
userDefaults
setValue
:
@"http
://121.15.180.66:801/netpayment/BaseHttp.dll?H5PayJsonSDK
"
forKey
:
@"YWT_PAY"
];
[
userDefaults
setValue
:
@"http
s://netpay.cmbchina.com/netpayment/BaseHttp.dll?MB_EUserPay
"
forKey
:
@"YWT_PAY"
];
[
userDefaults
synchronize
];
break
;
}
...
...
@@ -171,7 +171,7 @@
[
userDefaults
setObject
:
@"http://dcxy-base-app.dcrym.com"
forKey
:
@"SX_MONEY"
];
//授信保证金
[
userDefaults
setValue
:
@"https://netpay.cmbchina.com/netpayment/BaseHttp.dll?
H5PayJsonSDK
"
forKey
:
@"YWT_PAY"
];
[
userDefaults
setValue
:
@"https://netpay.cmbchina.com/netpayment/BaseHttp.dll?
MB_EUserPay
"
forKey
:
@"YWT_PAY"
];
[
userDefaults
synchronize
];
break
;
}
...
...
ColorfulSchool/ColorfulSchool/AppDelegate.m
View file @
03a219ed
...
...
@@ -84,6 +84,7 @@
if
(
CacheToken
&&!
[
CacheToken
isEqualToString
:
@""
])
//如果登录了
{
[
ZXTool
loginSuccessJump
:
^
(
NSString
*
jump
)
{
jump
=
@"DC_02"
;
if
([
jump
isEqualToString
:
@"NONE"
])
{
//先读取缓存
NSArray
*
list
=
[
LoginJump
findAll
];
...
...
@@ -138,7 +139,7 @@
-
(
void
)
applicationDidBecomeActive
:
(
UIApplication
*
)
application
{
[[
ZXTXAdTool
sharedZXTXAdTool
]
createLauchAdByPlacmentId
:
kTXAdPLACEMENTID
];
//请求最新的是否需要曝光配置
[
ZXTool
requestIsNeedExposure
];
//重新进入前台 所有首页条目全部改成未曝光
...
...
ColorfulSchool/ColorfulSchool/Classes/11.20SimpleApp(极简版)/ADPage/ZXSimpleADController.m
View file @
03a219ed
//
//
...
...
@@ -156,6 +156,7 @@
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
[
super
viewWillAppear
:
animated
];
self
.
navigationController
.
navigationBar
.
hidden
=
NO
;
self
.
tabBarController
.
tabBar
.
hidden
=
NO
;
[
self
.
tabBarController
.
tabBar
hideBadgeOnItemIndex
:
1
];
}
...
...
ColorfulSchool/ColorfulSchool/Classes/11.20SimpleApp(极简版)/HomePage/ZXSimpleHomeController.m
View file @
03a219ed
//
//
...
...
@@ -11,6 +11,7 @@
#import "ZXFirstPageService.h"
#import "New_OperationCell.h"
#import "ZXSections.h"
#import "AboutUs.h"
#import "ZXPopMenuViewController.h"
#import "ZXBannerJumpViewController.h"
#import "ZXDrinkViewController.h"
...
...
@@ -27,6 +28,7 @@
#import "ZXSimpleIsHasReplay.h"
#import "ZXNewsViewController.h"
#import "ZXSimpleGoRechargeViewController.h"
#import "ZXUserModel.h"
//========老版本部分内容-===============
#import "AnnouncementView.h"
#import "CampasVersionUpdateModel.h"
...
...
@@ -49,16 +51,13 @@
@property
(
nonatomic
,
strong
)
ZXFirstPageService
*
service
;
@property
(
nonatomic
,
strong
)
UITableView
*
myTableView
;
@property
(
nonatomic
,
strong
)
ZXUserModel
*
user
;
//==============老版本部分内容====================
/**
院校是否首充
*/
@property
(
strong
,
nonatomic
)
JudgeFirstTopUpModel
*
firstTopupModel
;
/**
用户信息
*/
@property
(
strong
,
nonatomic
)
UserCenterModel
*
userCenterModel
;
/**
...
...
@@ -101,20 +100,24 @@ static NSInteger seq = 0;
[
self
.
myTableView
reloadData
];
}];
});
//老版本部分数据
self
.
userCenterModel
=
[
UserCenterModel
new
];
[
self
refreshUserInfo
];
self
.
firstTopupModel
=
[
JudgeFirstTopUpModel
new
];
self
.
updateModel
=
[
CampasVersionUpdateModel
new
];
[
self
setAlias
];
//注册观察者
[
self
registNotificationAndKVO
];
}
-
(
ZXUserModel
*
)
user
{
if
(
_user
==
nil
)
{
_user
=
[
ZXUserModel
findAll
].
lastObject
;
}
return
_user
;
}
#pragma mark - ========== 查询一下用户最新的余额 ==========
-
(
void
)
refreshUserAccountInfo
{
[[
GetData
shareData
]
fetchAccoutDataSuccess
:
^
(
AFHTTPRequestOperation
*
operation
,
id
responseObject
)
{
NSString
*
money
=
responseObject
[
@"data"
][
@"aimiMoney"
];
self
.
user
CenterModel
.
userCenterItem
.
aimiMoney
=
money
;
self
.
user
.
aimiMoney
=
money
;
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
self
.
myTableView
reloadData
];
});
...
...
@@ -162,7 +165,7 @@ static NSInteger seq = 0;
[
self
.
myTableView
reloadData
];
}];
});
[
ZXTool
firstPageRefreshAddNotPayView
];
[
ZXTool
firstPageRefreshAddNotPayView
:
self
.
view
];
}
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
return
5
;
...
...
@@ -176,15 +179,19 @@ static NSInteger seq = 0;
cell
=
[[
ZXSimpleHomeHeaderCell
alloc
]
initWithStyle
:
0
reuseIdentifier
:
@"ZXSimpleHomeHeaderCell"
];
}
cell
.
paretnVc
=
self
;
//弱引用一下 为vc代码减点负
cell
.
item
=
self
.
user
CenterModel
.
userCenterItem
;
cell
.
item
=
self
.
user
;
@weakify
(
self
);
cell
.
refreshUserMsgAction
=
^
{
@strongify
(
self
);
dispatch_async
(
dispatch_get_global_queue
(
0
,
0
),
^
{
//获取最新的用户数据
[
self
.
userCenterModel
fetchUserCenterData
];
[
self
refreshUserInfo
];
});
};
cell
.
refreshHeaderAction
=
^
{
@strongify
(
self
);
[
self
.
myTableView
reloadData
];
};
return
cell
;
}
else
if
(
indexPath
.
row
==
1
)
{
//功能区
...
...
@@ -227,10 +234,10 @@ static NSInteger seq = 0;
for
(
ZXSections
*
sec
in
self
.
service
.
sections
)
{
if
([
sec
.
styleType
isEqualToString
:
@"SERVICE"
])
{
//功能区
if
(
sec
.
i
tems
.
count
<
8
)
{
return
8
7
.
5
*
k6Scale
;
if
(
sec
.
i
sExpan
)
{
return
8
5
*
k6Scale
*
sec
.
rows
;
}
return
17
5
*
k6Scale
;
return
8
5
*
k6Scale
;
}
}
}
else
if
(
indexPath
.
row
==
2
)
{
...
...
@@ -248,8 +255,73 @@ static NSInteger seq = 0;
bannaer
.
titleStr
=
@"公告"
;
bannaer
.
jumpUrl
=
jumpUrl
;
[
self
.
navigationController
pushViewController
:
bannaer
animated
:
YES
];
}
else
if
(
indexPath
.
row
==
3
)
{
//帮助中心
}
else
if
(
indexPath
.
row
==
4
)
{
AboutUs
*
VC
=
[
AboutUs
new
];
VC
.
isFromSimple
=
YES
;
VC
.
hidesBottomBarWhenPushed
=
YES
;
[
self
.
navigationController
pushViewController
:
VC
animated
:
YES
];
}
}
-
(
void
)
refreshUserInfo
{
NSString
*
token
=
[
kUserDefaults
valueForKey
:
@"token"
];
if
(
token
==
nil
)
{
token
=
@""
;
}
dispatch_async
(
dispatch_get_global_queue
(
0
,
0
),
^
{
@weakify
(
self
);
[
XMCenter
sendRequest
:
^
(
XMRequest
*
request
)
{
request
.
url
=
[[
NSString
stringWithFormat
:
@"%@/app/customer/login"
,
[
kUserDefaults
objectForKey
:
@"NEW_PAY"
]]
stringByAddingPercentEscapesUsingEncoding
:
NSUTF8StringEncoding
];
request
.
httpMethod
=
kXMHTTPMethodPOST
;
request
.
headers
=
@{
@"token"
:
token
,
@"reqSource"
:
@"app"
,
@"Content-Type"
:
@"application/json"
};
request
.
HttpBody
=
[[
ZXTool
dictionaryToJson
:@{
@"loginTime"
:
[
ZXTool
getCurrentTimeStamp
]}]
mj_JSONData
];
}
onSuccess
:
^
(
id
responseObject
)
{
CommonModel
*
common
=
[
CommonModel
mj_objectWithKeyValues
:
responseObject
];
@strongify
(
self
);
if
(
common
.
code
==
1000
)
{
ZXUserModel
*
user
=
[
ZXUserModel
mj_objectWithKeyValues
:
common
.
data
];
self
.
user
=
user
;
[
ZXUserModel
clearTable
];
[
user
save
];
[
self
saveUserInfo
:
user
];
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
self
.
myTableView
reloadData
];
});
}
}
onFailure
:^
(
NSError
*
error
)
{
}
onFinished
:^
(
id
responseObject
,
NSError
*
error
)
{
}];
});
}
-
(
void
)
saveUserInfo
:
(
ZXUserModel
*
)
user
{
NSUserDefaults
*
userDefaults
=
[
NSUserDefaults
standardUserDefaults
];
[
userDefaults
setObject
:[
NSString
stringWithFormat
:
@"%ld"
,
user
.
customerId
]
forKey
:
@"userId"
];
[
userDefaults
setObject
:
user
.
token
forKey
:
@"token"
];
[
userDefaults
setObject
:
user
.
customerPhone
forKey
:
@"account"
];
[
userDefaults
setObject
:[
NSString
stringWithFormat
:
@"%ld"
,
user
.
areaId
]
forKey
:
@"campusId"
];
[
userDefaults
setObject
:
user
.
version
forKey
:
@"version"
];
[
userDefaults
setObject
:
user
.
loginPwd
forKey
:
@"passWord"
];
[
userDefaults
setObject
:
user
.
idBar
forKey
:
@"idBar"
];
[
userDefaults
setObject
:[
NSString
stringWithFormat
:
@"%ld"
,
user
.
isFirstRecharge
]
forKey
:
@"rechargeStatus"
];
[
userDefaults
setObject
:
user
.
birthDay
forKey
:
@"birthday"
];
[
userDefaults
setObject
:
user
.
areaName
forKey
:
@"campusName"
];
[
userDefaults
setObject
:
user
.
entranceDate
forKey
:
@"enterSchoolDate"
];
[
userDefaults
setObject
:[
user
.
customerSex
isEqualToString
:
@"1"
]?
@"male"
:
@"female"
forKey
:
@"gender"
];
[
userDefaults
setObject
:[
NSString
stringWithFormat
:
@"%ld"
,
user
.
hardwareAccount
]
forKey
:
@"sbaccount"
];
// [userDefaults setObject:self.item.schoolId forKey:@"schoolId"];
// [userDefaults setObject:self.item.schoolName forKey:@"schoolName"];
[
userDefaults
setObject
:
user
.
studentNo
forKey
:
@"studentNo"
];
[
userDefaults
setObject
:
user
.
customerName
forKey
:
@"username"
];
[
userDefaults
setObject
:
@
(
!
user
.
hardwareState
)
forKey
:
@"devPassSwitch"
];
[
userDefaults
setObject
:
@
(
user
.
isUploadLog
)
forKey
:
@"isUploadLog"
];
[
userDefaults
synchronize
];
NSLog
(
@"====%@"
,
CacheUserId
);
}
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
[
super
viewWillAppear
:
animated
];
[
UIApplication
sharedApplication
].
statusBarStyle
=
0
;
...
...
@@ -261,6 +333,10 @@ static NSInteger seq = 0;
[
self
loadIsHasNewAd
];
//查询一下最新的回复
[
self
loadIsHasNewReplay
];
[
self
refreshUserAccountInfo
];
[
ZXTool
firstPageRefreshAddNotPayView
:
self
.
view
];
}
#pragma mark - ========== 是否有新的公告 ==========
-
(
void
)
loadIsHasNewAd
{
...
...
@@ -339,8 +415,6 @@ static NSInteger seq = 0;
if
([
CacherechargeStatus
isEqualToString
:
@"0"
])
{
[
self
.
firstTopupModel
JudgeFirstTopUp
];
}
//获取最新的用户数据
[
self
.
userCenterModel
fetchUserCenterData
];
});
}
#pragma mark 别名
...
...
@@ -366,8 +440,6 @@ static NSInteger seq = 0;
[
_firstTopupModel
addObserver
:
self
forKeyPath
:
@"isLoaded"
options
:
NSKeyValueObservingOptionNew
context
:
nil
];
[
_firstTopupModel
addObserver
:
self
forKeyPath
:
@"error"
options
:
NSKeyValueObservingOptionNew
context
:
nil
];
[
_userCenterModel
addObserver
:
self
forKeyPath
:
@"isLoaded"
options
:
NSKeyValueObservingOptionNew
context
:
nil
];
[
_userCenterModel
addObserver
:
self
forKeyPath
:
@"error"
options
:
NSKeyValueObservingOptionNew
context
:
nil
];
[
self
.
updateModel
addObserver
:
self
forKeyPath
:
@"isLoaded"
options
:
NSKeyValueObservingOptionNew
context
:
nil
];
[
self
.
updateModel
addObserver
:
self
forKeyPath
:
@"error"
options
:
NSKeyValueObservingOptionNew
context
:
nil
];
}
...
...
@@ -390,21 +462,7 @@ static NSInteger seq = 0;
}
-
(
void
)
observeValueForKeyPath
:
(
NSString
*
)
keyPath
ofObject
:
(
id
)
object
change
:
(
NSDictionary
<
NSKeyValueChangeKey
,
id
>
*
)
change
context
:
(
void
*
)
context
{
if
(
object
==
_userCenterModel
)
{
if
([
keyPath
isEqualToString
:
@"isLoaded"
])
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
//获取个人信息后判断用户是否有有完善信息;
[
self
judgePerfectInfoOrNot
];
});
[
self
refreshUserAccountInfo
];
}
else
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
//无网络状态将首页条码显示出来;
[
self
judgePerfectInfoOrNot
];
});
}
}
if
(
object
==
_firstTopupModel
)
{
if
([
keyPath
isEqualToString
:
@"isLoaded"
])
{
...
...
@@ -478,28 +536,21 @@ static NSInteger seq = 0;
if
([
CacheCampusId
isEqualToString
:
@""
]){
_infoView
=
[[
PerfectInformation
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
kWidth
,
kHeight
)];
__weak
typeof
(
self
)
weakSelf
=
self
;
@weakify
(
self
);
_infoView
.
saveSuccess
=^
{
@strongify
(
self
);
AppDelegate
*
appDelegate
=
(
AppDelegate
*
)[
UIApplication
sharedApplication
].
delegate
;
[
appDelegate
tokenLogin
];
[
weakSelf
.
infoView
removeFromSuperview
];
weakSelf
.
isComeFromPerfectInfo
=
YES
;
[
self
.
infoView
removeFromSuperview
];
NSLog
(
@"dddd%@"
,
CacherechargeStatus
)
;
self
.
isComeFromPerfectInfo
=
YES
;
if
([
CacherechargeStatus
isEqualToString
:
@"0"
])
{
//判断是否进行首充(解决当界面完善信息返回后没有判断首充的问题)
//再次获取个人信息将CacherechargeStatus进行缓存;
[
weakSelf
.
userCenterModel
fetchUserCenterData
];
[
self
refreshUserInfo
];
}
};
AppDelegate
*
app
=
(
AppDelegate
*
)[
UIApplication
sharedApplication
].
delegate
;
[
app
.
window
addSubview
:
_infoView
];
...
...
ColorfulSchool/ColorfulSchool/Classes/11.20SimpleApp(极简版)/HomePage/ZXSimpleHomeHeaderCell.h
View file @
03a219ed
//
//
...
...
@@ -7,13 +7,14 @@
//
#import <UIKit/UIKit.h>
#import "
UserCent
erModel.h"
#import "
ZXUs
erModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface
ZXSimpleHomeHeaderCell
:
UITableViewCell
@property
(
nonatomic
,
strong
)
UserCenerModelItem
*
item
;
@property
(
nonatomic
,
strong
)
ZXUserModel
*
item
;
@property
(
nonatomic
,
weak
)
UIViewController
*
paretnVc
;
@property
(
nonatomic
,
copy
)
dispatch_block_t
refreshUserMsgAction
;
@property
(
nonatomic
,
copy
)
dispatch_block_t
refreshHeaderAction
;
@end
NS_ASSUME_NONNULL_END
ColorfulSchool/ColorfulSchool/Classes/11.20SimpleApp(极简版)/HomePage/ZXSimpleHomeHeaderCell.m
View file @
03a219ed
//
//
...
...
@@ -147,14 +147,17 @@
}
return
self
;
}
-
(
void
)
setItem
:
(
UserCenerModelItem
*
)
item
{
-
(
void
)
setItem
:
(
ZXUserModel
*
)
item
{
_item
=
item
;
self
.
nameLabel
.
text
=
_item
.
username
;
self
.
phoneLabel
.
text
=
_item
.
account
;
self
.
campusLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@-%@"
,
_item
.
schoolName
,
_item
.
campusName
];
[
self
.
iconImageView
sd_setImageWithURL
:[
NSURL
URLWithString
:
_item
.
photo
]
placeholderImage
:[
UIImage
imageNamed
:
@"home_sel_bg_pic"
]];
self
.
moneyLabel
.
text
=
_item
.
aimiMoney
;
self
.
nameLabel
.
text
=
_item
.
customerName
;
self
.
phoneLabel
.
text
=
_item
.
customerPhone
;
self
.
campusLabel
.
text
=
_item
.
areaName
;
if
(
_item
.
customerHead
)
{
[
self
.
iconImageView
sd_setImageWithURL
:[
NSURL
URLWithString
:
_item
.
customerHead
]
placeholderImage
:[
UIImage
imageNamed
:
@"home_sel_bg_pic"
]];
}
if
(
_item
.
aimiMoney
)
{
self
.
moneyLabel
.
text
=
_item
.
aimiMoney
;
}
}
-
(
void
)
setSelected
:
(
BOOL
)
selected
animated
:
(
BOOL
)
animated
{
[
super
setSelected
:
selected
animated
:
animated
];
...
...
@@ -176,22 +179,39 @@
changeVc
.
user
=
self
.
item
;
[
self
.
paretnVc
.
navigationController
pushViewController
:
changeVc
animated
:
YES
];
}
closeDevice
:^
(
BOOL
on
)
{
GetData
*
data
=
[
GetData
shareData
];
[
data
AllowEquitLoginWithStatu
:[
NSString
stringWithFormat
:
@"%d"
,
!
on
]
success
:
^
(
AFHTTPRequestOperation
*
operation
,
id
responseObject
)
{
}
failure
:^
(
AFHTTPRequestOperation
*
operation
,
NSError
*
error
)
{
[
ZXTool
requestDataWithType
:
kXMHTTPMethodPUT
url
:[
NSString
stringWithFormat
:
@"%@/app/customer/switch/%@/%d"
,
[
kUserDefaults
valueForKey
:
@"NEW_PAY"
],
CacheUserId
,
on
]
para
:
nil
completed
:^
(
CommonModel
*
common
,
NSString
*
error
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
ZXTool
hideLoadingAnimation
];
if
(
error
)
{
[
ZXTool
showText
:
error
];
}
else
{
if
(
on
)
{
[
ZXTool
showText
:
@"关闭设备登录密码成功"
];
}
else
{
[
ZXTool
showText
:
@"开启设备登录密码成功"
];
}
}
});
}];
}
exitLogin
:^
{
//退出登录
[
ZXTool
backToLogin
];
}
isOn
:
[
self
.
item
.
devPassSwitch
isEqualToString
:
@"0"
]];
}
isOn
:
[
self
.
item
.
state
isEqualToString
:
@"0"
]];
[
settingVc
show
];
}
#pragma mark - ========== 点击了头像 ==========
-
(
void
)
tapIconImageView
{
ZXSimpleUserCenterViewController
*
userCenter
=
[[
ZXSimpleUserCenterViewController
alloc
]
init
];
userCenter
.
user
=
self
.
item
;
@weakify
(
self
);
userCenter
.
completed
=
^
{
@strongify
(
self
);
if
(
self
.
refreshHeaderAction
)
{
self
.
refreshHeaderAction
();
}
};
[
self
.
paretnVc
.
navigationController
pushViewController
:
userCenter
animated
:
YES
];
}
#pragma mark - ========== 点击了账户信息 ==========
...
...
ColorfulSchool/ColorfulSchool/Classes/11.20SimpleApp(极简版)/HomePage/ZXSimpleNewAdCell.m
View file @
03a219ed
//
//
...
...
@@ -34,9 +34,11 @@
self
.
contentLabel
.
font
=
[
UIFont
boldSystemFontOfSize
:
16
*
k6Scale
];
self
.
contentLabel
.
textColor
=
kRGB
(
255
,
255
,
255
);
[
self
.
contentView
addSubview
:
self
.
contentLabel
];
self
.
contentLabel
.
textAlignment
=
NSTextAlignmentCenter
;
[
self
.
contentLabel
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
top
.
equalTo
(
bgImageView
.
mas_top
).
offset
(
30
*
k6Scale
);
make
.
centerX
.
equalTo
(
bgImageView
.
mas_centerX
);
make
.
left
.
equalTo
(
bgImageView
.
mas_left
).
offset
(
10
*
k6Scale
);
make
.
right
.
equalTo
(
bgImageView
.
mas_right
).
offset
(
-
10
*
k6Scale
);
}];
self
.
dateLabel
=
[[
UILabel
alloc
]
init
];
...
...
ColorfulSchool/ColorfulSchool/Classes/11.20SimpleApp(极简版)/HomePage/accountCenter/ZXSimpleAccountViewController.h
View file @
03a219ed
//
//
...
...
@@ -7,11 +7,11 @@
//
#import <UIKit/UIKit.h>
#import "
UserCent
erModel.h"
#import "
ZXUs
erModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface
ZXSimpleAccountViewController
:
UIViewController
@property
(
nonatomic
,
strong
)
UserCenerModelItem
*
user
;
@property
(
nonatomic
,
strong
)
ZXUserModel
*
user
;
@end
NS_ASSUME_NONNULL_END
ColorfulSchool/ColorfulSchool/Classes/11.20SimpleApp(极简版)/HomePage/changePwd/ZXSimpleChangeDeviceBindTelController.h
View file @
03a219ed
//
//
...
...
@@ -7,11 +7,11 @@
//
#import <UIKit/UIKit.h>
#import "
UserCent
erModel.h"
#import "
ZXUs
erModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface
ZXSimpleChangeDeviceBindTelController
:
UIViewController
@property
(
nonatomic
,
strong
)
UserCenerModelItem
*
user
;
@property
(
nonatomic
,
strong
)
ZXUserModel
*
user
;
@end
NS_ASSUME_NONNULL_END
ColorfulSchool/ColorfulSchool/Classes/11.20SimpleApp(极简版)/HomePage/changePwd/ZXSimpleChangeDeviceBindTelController.m
View file @
03a219ed
//
//
...
...
@@ -79,10 +79,10 @@
//MARK:数据
nameLabel
.
text
=
self
.
user
.
usern
ame
;
phoneLabel
.
text
=
self
.
user
.
account
;
campusLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@-%@"
,
self
.
user
.
schoolName
,
self
.
user
.
campusName
]
;
[
iconImageView
sd_setImageWithURL
:[
NSURL
URLWithString
:
self
.
user
.
photo
]
placeholderImage
:[
UIImage
imageNamed
:
@"home_sel_bg_pic"
]];
nameLabel
.
text
=
self
.
user
.
customerN
ame
;
phoneLabel
.
text
=
self
.
user
.
customerPhone
;
campusLabel
.
text
=
self
.
user
.
areaName
;
[
iconImageView
sd_setImageWithURL
:[
NSURL
URLWithString
:
self
.
user
.
customerHead
]
placeholderImage
:[
UIImage
imageNamed
:
@"home_sel_bg_pic"
]];
UIView
*
old
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
130
*
k6Scale
,
kScreenWidth
,
10
*
k6Scale
)];
[
header
addSubview
:
old
];
...
...
@@ -301,29 +301,26 @@
[
ZXTool
showText
:
@"请输入验证码"
];
return
;
}
GetData
*
data
=
[
GetData
shareData
];
[
ZXTool
showLoadingAnimation
];
[
data
changePhoneWithPhoneNum
:
self
.
nowField
.
text
oldPwd
:
self
.
oldPwdField
.
text
checkCode
:
self
.
rePwdField
.
text
success
:^
(
AFHTTPRequestOperation
*
operation
,
id
responseObject
)
{
[
ZXTool
hideLoadingAnimation
];
NSDictionary
*
dic
=
responseObject
;
if
([
dic
[
@"code"
]
isEqualToString
:
@"0"
])
{
[
ZXTool
showText
:
@"更换手机账户成功"
];
[
ZXTool
backToLogin
];
}
else
{
if
(
dic
[
@"msg"
])
{
[
ZXTool
showText
:
dic
[
@"msg"
]];
[
ZXTool
requestDataWithType
:
kXMHTTPMethodPOST
url
:[
NSString
stringWithFormat
:
@"%@/app/customer/phone/account/"
,
[
kUserDefaults
valueForKey
:
@"NEW_PAY"
]]
para
:
@{
@"customerId"
:
CacheUserId
,
@"password"
:
self
.
oldPwdField
.
text
,
@"phoneAccount"
:
self
.
nowField
.
text
,
@"verification"
:
self
.
rePwdField
.
text
}
completed
:^
(
CommonModel
*
common
,
NSString
*
error
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
ZXTool
hideLoadingAnimation
];
if
(
error
)
{
[
ZXTool
showText
:
error
];
}
else
{
[
ZXTool
showText
:
@"更换手机账号成功"
];
[
ZXTool
backToLogin
];
}
}
}
failure
:^
(
AFHTTPRequestOperation
*
operation
,
NSError
*
error
)
{
[
ZXTool
hideLoadingAnimation
];
[
ZXTool
showText
:
error
.
userInfo
[
@"NSLocalizedDescription"
]];
});
}];
}
#pragma mark - ========== 忘记密码 ==========
-
(
void
)
forgetPwd
:
(
enlargeClickRegionBtn
*
)
sender
{
forgetPasswordViewController
*
forgetVc
=
[[
forgetPasswordViewController
alloc
]
init
];
@weakify
(
self
);
forgetVc
.
backBlock
=
^
{
@strongify
(
self
);
self
.
navigationController
.
navigationBar
.
translucent
=
NO
;
};
[
self
.
navigationController
pushViewController
:
forgetVc
animated
:
YES
];
}
#pragma mark - ========== UITableView/Delegate/Datasource ==========
...
...
ColorfulSchool/ColorfulSchool/Classes/11.20SimpleApp(极简版)/HomePage/changePwd/ZXSimpleChangeDevicePwdViewController.h
View file @
03a219ed
//
//
...
...
@@ -7,11 +7,11 @@
//
#import <UIKit/UIKit.h>
#import "
UserCent
erModel.h"
#import "
ZXUs
erModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface
ZXSimpleChangeDevicePwdViewController
:
UIViewController
@property
(
nonatomic
,
strong
)
UserCenerModelItem
*
user
;
@property
(
nonatomic
,
strong
)
ZXUserModel
*
user
;
@end
NS_ASSUME_NONNULL_END
ColorfulSchool/ColorfulSchool/Classes/11.20SimpleApp(极简版)/HomePage/changePwd/ZXSimpleChangeDevicePwdViewController.m
View file @
03a219ed
//
//
...
...
@@ -78,10 +78,10 @@
//MARK:数据
nameLabel
.
text
=
self
.
user
.
usern
ame
;
phoneLabel
.
text
=
self
.
user
.
account
;
campusLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@-%@"
,
self
.
user
.
schoolName
,
self
.
user
.
campusName
]
;
[
iconImageView
sd_setImageWithURL
:[
NSURL
URLWithString
:
self
.
user
.
photo
]
placeholderImage
:[
UIImage
imageNamed
:
@"home_sel_bg_pic"
]];
nameLabel
.
text
=
self
.
user
.
customerN
ame
;
phoneLabel
.
text
=
self
.
user
.
customerPhone
;
campusLabel
.
text
=
self
.
user
.
areaName
;
[
iconImageView
sd_setImageWithURL
:[
NSURL
URLWithString
:
self
.
user
.
customerHead
]
placeholderImage
:[
UIImage
imageNamed
:
@"home_sel_bg_pic"
]];
UIView
*
old
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
130
*
k6Scale
,
kScreenWidth
,
10
*
k6Scale
)];
[
header
addSubview
:
old
];
...
...
@@ -239,25 +239,30 @@
[
ZXTool
showText
:
@"2次输入密码不一致"
];
return
;
}
[
ZXTool
showLoadingAnimation
];
GetData
*
data
=
[
GetData
shareData
];
[
data
changeDevicePasswordWithOldPassword
:
self
.
oldPwdField
.
text
newPassword
:
self
.
nowField
.
text
success
:^
(
AFHTTPRequestOperation
*
operation
,
id
responseObject
)
{
[
ZXTool
hideLoadingAnimation
];
NSDictionary
*
dic
=
responseObject
;
if
([
dic
[
@"code"
]
isEqualToString
:
@"0"
])
{
[
ZXTool
showText
:
@"设备密码修改成功"
];
[
self
.
navigationController
popViewControllerAnimated
:
YES
];
}
else
{
[
ZXTool
showText
:
dic
[
@"msg"
]];
}
}
failure
:^
(
AFHTTPRequestOperation
*
operation
,
NSError
*
error
)
{
[
ZXTool
hideLoadingAnimation
];
[
ZXTool
showText
:
error
.
userInfo
[
@"NSLocalizedDescription"
]];
}];
[
ZXTool
requestDataWithType
:
kXMHTTPMethodPOST
url
:[
NSString
stringWithFormat
:
@"%@/app/customer/hardware/pwd"
,
[
kUserDefaults
valueForKey
:
@"NEW_PAY"
]]
para
:
@{
@"customerId"
:
CacheUserId
,
@"oldPassword"
:
self
.
oldPwdField
.
text
,
@"password"
:
self
.
nowField
.
text
}
completed
:^
(
CommonModel
*
common
,
NSString
*
error
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
ZXTool
hideLoadingAnimation
];
if
(
error
)
{
[
ZXTool
showText
:
error
];
}
else
{
[
ZXTool
showText
:
@"设备密码修改成功"
];
[
self
.
navigationController
popViewControllerAnimated
:
YES
];
}
});
}];
}
#pragma mark - ========== 忘记密码 ==========
-
(
void
)
forgetPwd
:
(
enlargeClickRegionBtn
*
)
sender
{
forgetPasswordViewController
*
forgetVc
=
[[
forgetPasswordViewController
alloc
]
init
];
@weakify
(
self
);
forgetVc
.
backBlock
=
^
{
@strongify
(
self
);
self
.
navigationController
.
navigationBar
.
translucent
=
NO
;
};
[
self
.
navigationController
pushViewController
:
forgetVc
animated
:
YES
];
}
#pragma mark - ========== UITableView/Delegate/Datasource ==========
...
...
ColorfulSchool/ColorfulSchool/Classes/11.20SimpleApp(极简版)/HomePage/changePwd/ZXSimpleChangeLoginPwdController.h
View file @
03a219ed
//
//
...
...
@@ -7,11 +7,11 @@
//
#import <UIKit/UIKit.h>
#import "
UserCent
erModel.h"
#import "
ZXUs
erModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface
ZXSimpleChangeLoginPwdController
:
UIViewController
@property
(
nonatomic
,
strong
)
UserCenerModelItem
*
user
;
@property
(
nonatomic
,
strong
)
ZXUserModel
*
user
;
@end
NS_ASSUME_NONNULL_END
ColorfulSchool/ColorfulSchool/Classes/11.20SimpleApp(极简版)/HomePage/changePwd/ZXSimpleChangeLoginPwdController.m
View file @
03a219ed
//
//
...
...
@@ -80,10 +80,10 @@
//MARK:数据
nameLabel
.
text
=
self
.
user
.
usern
ame
;
phoneLabel
.
text
=
self
.
user
.
account
;
campusLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@-%@"
,
self
.
user
.
schoolName
,
self
.
user
.
campusName
]
;
[
iconImageView
sd_setImageWithURL
:[
NSURL
URLWithString
:
self
.
user
.
photo
]
placeholderImage
:[
UIImage
imageNamed
:
@"home_sel_bg_pic"
]];
nameLabel
.
text
=
self
.
user
.
customerN
ame
;
phoneLabel
.
text
=
self
.
user
.
customerPhone
;
campusLabel
.
text
=
self
.
user
.
areaName
;
[
iconImageView
sd_setImageWithURL
:[
NSURL
URLWithString
:
self
.
user
.
customerHead
]
placeholderImage
:[
UIImage
imageNamed
:
@"home_sel_bg_pic"
]];
UIView
*
old
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
130
*
k6Scale
,
kScreenWidth
,
46
*
k6Scale
)];
[
header
addSubview
:
old
];
...
...
@@ -250,28 +250,27 @@
[
ZXTool
showText
:
@"2次输入密码不一致"
];
return
;
}
GetData
*
data
=
[
GetData
shareData
];
[
ZXTool
showLoadingAnimation
];
[
data
changePasswordWithOldPassword
:
self
.
oldPwdField
.
text
newPassword
:
self
.
nowField
.
text
success
:^
(
AFHTTPRequestOperation
*
operation
,
id
responseObject
)
{
[
ZXTool
hideLoadingAnimation
];
NSDictionary
*
dic
=
responseObject
;
if
([
dic
[
@"code"
]
isEqualToString
:
@"0"
])
{
[
ZXTool
showText
:
@"密码修改成功,请重新登录"
];
//退出登录
[
ZXTool
backToLogin
];
}
else
{
if
(
dic
[
@"msg"
])
{
[
ZXTool
showText
:
dic
[
@"msg"
]];
[
ZXTool
requestDataWithType
:
kXMHTTPMethodPOST
url
:[
NSString
stringWithFormat
:
@"%@/app/customer/old/pwd"
,[
kUserDefaults
valueForKey
:
@"NEW_PAY"
]]
para
:
@{
@"customerId"
:
CacheUserId
,
@"oldPassword"
:
self
.
oldPwdField
.
text
,
@"password"
:
self
.
nowField
.
text
}
completed
:^
(
CommonModel
*
common
,
NSString
*
error
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
ZXTool
hideLoadingAnimation
];
if
(
error
)
{
[
ZXTool
showText
:
error
];
}
else
{
[
ZXTool
showText
:
@"登录密码修改成功"
];
[
self
.
navigationController
popViewControllerAnimated
:
YES
];
}
}
}
failure
:^
(
AFHTTPRequestOperation
*
operation
,
NSError
*
error
)
{
[
ZXTool
hideLoadingAnimation
];
[
ZXTool
showText
:
error
.
userInfo
[
@"NSLocalizedDescription"
]];
});
}];
}
#pragma mark - ========== 忘记密码 ==========
-
(
void
)
forgetPwd
:
(
enlargeClickRegionBtn
*
)
sender
{
forgetPasswordViewController
*
forgetVc
=
[[
forgetPasswordViewController
alloc
]
init
];
@weakify
(
self
);
forgetVc
.
backBlock
=
^
{
@strongify
(
self
);
self
.
navigationController
.
navigationBar
.
translucent
=
NO
;
};
[
self
.
navigationController
pushViewController
:
forgetVc
animated
:
YES
];
}
#pragma mark - ========== UITableView/Delegate/Datasource ==========
...
...
ColorfulSchool/ColorfulSchool/Classes/11.20SimpleApp(极简版)/HomePage/changePwd/ZXSimpleCodeView.m
View file @
03a219ed
//
//
...
...
@@ -116,27 +116,18 @@
}
#pragma mark - ========== 刷新图形验证码 ==========
-
(
void
)
refreshCode
{
NSString
*
url
=
[
NSString
stringWithFormat
:
@"%@/dcxy/app/homepage/campus/getDynamicCode?account=%@"
,[
kUserDefaults
valueForKey
:
@"h5FirstPageAPI"
],
_phoneNum
];
NSString
*
url
=
[
NSString
stringWithFormat
:
@"%@/common/getCode?loginName=%@&codeNum=4"
,[
kUserDefaults
valueForKey
:
@"SX_MONEY"
],
_phoneNum
];
@weakify
(
self
);
[
XMCenter
sendRequest
:
^
(
XMRequest
*
request
)
{
request
.
url
=
url
;
request
.
httpMethod
=
kXMHTTPMethodGET
;
request
.
headers
=
@{
@"reqSource"
:
@"app"
,
@"Content-Type"
:
@"application/json"
};
}
onSuccess
:
^
(
id
responseObject
)
{
[
ZXTool
requestDataWithType
:
kXMHTTPMethodPOST
url
:
url
para
:
nil
completed
:^
(
CommonModel
*
common
,
NSString
*
error
)
{
@strongify
(
self
);
CommonModel
*
common
=
[
CommonModel
mj_objectWithKeyValues
:
responseObject
];
NSString
*
s
=
common
.
data
;
if
(
s
==
nil
||
s
.
length
==
0
)
{
[
ZXTool
showText
:
common
.
msg
];
}
else
{
[
self
.
graphCodeView
refreshVerCodeByStr
:
s
];
}
}
onFailure
:^
(
NSError
*
error
)
{
[
ZXTool
showText
:
error
.
userInfo
[
@"NSLocalizedDescription"
]];
}
onFinished
:^
(
id
responseObject
,
NSError
*
error
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
ZXTool
hideLoadingAnimation
];
if
(
error
)
{
[
ZXTool
showText
:
error
];
}
else
{
[
self
.
graphCodeView
refreshVerCodeByStr
:
common
.
data
];
}
});
}];
}
...
...
ColorfulSchool/ColorfulSchool/Classes/11.20SimpleApp(极简版)/HomePage/userCenter/ZXSimpleUserCenterViewController.h
View file @
03a219ed
//
//
...
...
@@ -7,11 +7,12 @@
//
#import <UIKit/UIKit.h>
#import "
UserCent
erModel.h"
#import "
ZXUs
erModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface
ZXSimpleUserCenterViewController
:
UIViewController
@property
(
nonatomic
,
strong
)
UserCenerModelItem
*
user
;
@property
(
nonatomic
,
strong
)
ZXUserModel
*
user
;
@property
(
nonatomic
,
copy
)
dispatch_block_t
completed
;
@end
NS_ASSUME_NONNULL_END
ColorfulSchool/ColorfulSchool/Classes/11.20SimpleApp(极简版)/HomePage/userCenter/ZXSimpleUserCenterViewController.m
View file @
03a219ed
//
//
...
...
@@ -78,7 +78,7 @@
self
.
iconImageView
.
layer
.
cornerRadius
=
27
.
5
*
k6Scale
;
self
.
iconImageView
.
layer
.
masksToBounds
=
YES
;
[
headerView
addSubview
:
self
.
iconImageView
];
[
self
.
iconImageView
sd_setImageWithURL
:[
NSURL
URLWithString
:
self
.
user
.
photo
]
placeholderImage
:[
UIImage
imageNamed
:
@"home_sel_bg_pic"
]];
[
self
.
iconImageView
sd_setImageWithURL
:[
NSURL
URLWithString
:
self
.
user
.
customerHead
]
placeholderImage
:[
UIImage
imageNamed
:
@"home_sel_bg_pic"
]];
enlargeClickRegionBtn
*
upload
=
[[
enlargeClickRegionBtn
alloc
]
init
];
[
upload
setBackgroundImage
:[
UIImage
imageNamed
:
@"pc_upload_icon"
]
forState
:
UIControlStateNormal
];
[
headerView
addSubview
:
upload
];
...
...
@@ -95,7 +95,7 @@
nameLabel
.
textColor
=
[
UIColor
colorWithHexString
:
@"#333333"
];
nameLabel
.
font
=
[
UIFont
boldSystemFontOfSize
:
23
*
k6Scale
];
[
headerView
addSubview
:
nameLabel
];
nameLabel
.
text
=
self
.
user
.
usern
ame
;
nameLabel
.
text
=
self
.
user
.
customerN
ame
;
[
nameLabel
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
top
.
equalTo
(
naBar
.
mas_bottom
).
offset
(
10
*
k6Scale
);
make
.
centerX
.
equalTo
(
headerView
);
...
...
@@ -254,7 +254,7 @@
self
.
nameField
.
textColor
=
[
UIColor
colorWithHexString
:
@"#666666"
];
self
.
nameField
.
font
=
kFontSize
(
16
*
k6Scale
);
[
headerView
addSubview
:
self
.
nameField
];
self
.
nameField
.
text
=
self
.
user
.
usern
ame
;
self
.
nameField
.
text
=
self
.
user
.
customerN
ame
;
[
self
.
nameField
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
right
.
equalTo
(
headerView
.
mas_right
).
offset
(
-
20
*
k6Scale
);
make
.
height
.
mas_equalTo
(
30
*
k6Scale
);
...
...
@@ -299,8 +299,8 @@
make
.
width
.
height
.
mas_equalTo
(
16
*
k6Scale
);
make
.
centerY
.
equalTo
(
manLabel
);
}];
self
.
manBtn
.
selected
=
[
self
.
user
.
gender
isEqualToString
:
@"Male
"
];
self
.
womanBtn
.
selected
=
!
[
self
.
user
.
gender
isEqualToString
:
@"Male
"
];
self
.
manBtn
.
selected
=
[
self
.
user
.
customerSex
isEqualToString
:
@"1
"
];
self
.
womanBtn
.
selected
=
!
[
self
.
user
.
customerSex
isEqualToString
:
@"1
"
];
[
self
.
manBtn
addTarget
:
self
action
:
@selector
(
chooseMan
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
self
.
womanBtn
addTarget
:
self
action
:
@selector
(
choosewWoman
)
forControlEvents
:
UIControlEventTouchUpInside
];
...
...
@@ -371,15 +371,15 @@
UITapGestureRecognizer
*
chooseJoinDate
=
[[
UITapGestureRecognizer
alloc
]
initWithTarget
:
self
action
:
@selector
(
chooseJoinSchoolDateAction
)];
[
self
.
joinSchollLabel
addGestureRecognizer
:
chooseJoinDate
];
self
.
birthDayLabel
.
text
=
self
.
user
.
birthday
;
self
.
birthDayLabel
.
text
=
[
self
.
user
.
birthDay
substringToIndex
:
10
]
;
//多彩校园账号
accountLabel
.
text
=
self
.
user
.
account
;
accountLabel
.
text
=
self
.
user
.
customerPhone
;
//设备账号
deviceAccountLabel
.
text
=
@"123"
;
schoolLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@-%@"
,
self
.
user
.
schoolName
,
self
.
user
.
campusName
]
;
schoolLabel
.
text
=
self
.
user
.
areaName
;
//学号
self
.
studyNumField
.
text
=
self
.
user
.
studentNo
;
self
.
joinSchollLabel
.
text
=
self
.
user
.
enterSchoolDate
;
self
.
joinSchollLabel
.
text
=
[
self
.
user
.
birthDay
substringToIndex
:
10
]
;
}
...
...
@@ -416,13 +416,13 @@
[
ZXTool
showText
:
@"出生日期未填写"
];
return
;
}
if
(
!
[
self
.
user
.
us
erType
isEqualToString
:
@"teacher"
])
{
if
(
!
[
self
.
user
.
custom
erType
isEqualToString
:
@"teacher"
])
{
if
([
self
.
studyNumField
.
text
isEqualToString
:
@""
])
{
[
ZXTool
showText
:
@"学号未填写"
];
return
;
}
}
if
(
!
[
self
.
user
.
us
erType
isEqualToString
:
@"teacher"
])
{
if
(
!
[
self
.
user
.
custom
erType
isEqualToString
:
@"teacher"
])
{
if
([
self
.
joinSchollLabel
.
text
isEqualToString
:
@""
])
{
[
ZXTool
showText
:
@"入学时间未填写"
];
return
;
...
...
@@ -437,43 +437,33 @@
return
;
}
if
(
self
.
manBtn
.
selected
)
{
self
.
user
.
gender
=
@"Male
"
;
self
.
user
.
customerSex
=
@"1
"
;
}
else
{
self
.
user
.
gender
=
@"Female
"
;
self
.
user
.
customerType
=
@"2
"
;
}
self
.
user
.
birth
d
ay
=
self
.
birthDayLabel
.
text
;
self
.
user
.
ent
erSchool
Date
=
self
.
joinSchollLabel
.
text
;
self
.
user
.
usern
ame
=
self
.
nameField
.
text
;
self
.
user
.
birth
D
ay
=
self
.
birthDayLabel
.
text
;
self
.
user
.
ent
rance
Date
=
self
.
joinSchollLabel
.
text
;
self
.
user
.
customerN
ame
=
self
.
nameField
.
text
;
self
.
user
.
studentNo
=
self
.
studyNumField
.
text
;
//教师账号默认给个时间数据
if
([
self
.
user
.
us
erType
isEqualToString
:
@"teacher"
])
{
if
([
self
.
user
.
custom
erType
isEqualToString
:
@"teacher"
])
{
NSDateFormatter
*
formatter
=
[[
NSDateFormatter
alloc
]
init
];
formatter
.
dateFormat
=
@"yyyyMMddHHmmss"
;
NSString
*
timeStr
=
[
formatter
stringFromDate
:[
NSDate
date
]];
self
.
user
.
ent
erSchool
Date
=
timeStr
;
self
.
user
.
ent
rance
Date
=
timeStr
;
}
GetData
*
data
=
[
GetData
shareData
];
[
ZXTool
showLoadingAnimation
];
[
data
saveUserInfoWithEnterSchoolDate
:
self
.
user
.
enterSchoolDate
campusId
:
self
.
user
.
campusId
userName
:
self
.
user
.
username
gender
:
self
.
user
.
gender
birthday
:
self
.
user
.
birthday
studentId
:
self
.
user
.
studentNo
schoolId
:
self
.
user
.
schoolId
userType
:
self
.
user
.
userType
success
:^
(
AFHTTPRequestOperation
*
operation
,
id
responseObject
)
{
NSDictionary
*
dic
=
responseObject
;
[
ZXTool
requestDataWithType
:
kXMHTTPMethodPOST
url
:[
NSString
stringWithFormat
:
@"%@/app/customer/perfection/customer"
,
[
kUserDefaults
valueForKey
:
@"NEW_PAY"
]]
para
:
@{
@"birthDay"
:
self
.
user
.
birthDay
,
@"customerId"
:
CacheUserId
,
@"customerName"
:
self
.
user
.
customerName
,
@"customerSex"
:
self
.
user
.
customerSex
,
@"entranceDate"
:
self
.
user
.
entranceDate
,
@"phoneAccount"
:
self
.
user
.
customerPhone
,
@"studentNo"
:
self
.
user
.
studentNo
}
completed
:^
(
CommonModel
*
common
,
NSString
*
error
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
ZXTool
hideLoadingAnimation
];
if
([
dic
[
@"code"
]
isEqualToString
:
@"0"
])
{
if
(
error
)
{
[
ZXTool
showText
:
error
];
}
else
{
[
ZXTool
showText
:
@"操作成功"
];
[
self
.
navigationController
popViewControllerAnimated
:
YES
];
}
else
{
if
(
dic
[
@"msg"
]
!=
nil
)
{
[
ZXTool
showText
:
dic
[
@"msg"
]];
}
}
});
}
failure
:^
(
AFHTTPRequestOperation
*
operation
,
NSError
*
error
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
ZXTool
hideLoadingAnimation
];
[
ZXTool
showText
:
error
.
userInfo
[
@"NSLocalizedDescription"
]];
});
}];
}
...
...
@@ -509,9 +499,8 @@
-
(
void
)
imageReshaperController
:
(
AliImageReshapeController
*
)
reshaper
didFinishPickingMediaWithInfo
:
(
UIImage
*
)
image
{
NSData
*
data
=
UIImageJPEGRepresentation
(
image
,
0
.
3
);
self
.
iconImageView
.
image
=
image
;
[
XMCenter
sendRequest
:
^
(
XMRequest
*
request
)
{
request
.
server
=
[
NSString
stringWithFormat
:
@"%@/
dcxy/api/customer/headPic?customerId=%@"
,
[
kUserDefaults
valueForKey
:
@"Recharge
"
],
[
kUserDefaults
valueForKey
:
@"userId"
]];
request
.
server
=
[
NSString
stringWithFormat
:
@"%@/
app/customer/headpic/upload?customerId=%@"
,
[
kUserDefaults
valueForKey
:
@"NEW_PAY
"
],
[
kUserDefaults
valueForKey
:
@"userId"
]];
request
.
requestType
=
kXMRequestUpload
;
[
request
addFormDataWithName
:
@"file"
fileName
:
@"file.jpeg"
mimeType
:
@"image/jpeg"
fileData
:
data
];
...
...
@@ -521,7 +510,12 @@
NSLog
(
@"onProgress: %f"
,
progress
.
fractionCompleted
);
}
}
onSuccess
:^
(
id
responseObject
)
{
if
([
responseObject
[
@"code"
]
integerValue
]
==
1000
)
{
self
.
user
.
customerHead
=
responseObject
[
@"data"
][
@"headPic"
];
[
self
.
user
update
];
}
dispatch_async
(
dispatch_get_main_queue
(),
^
{
self
.
completed
();
[
self
.
navigationController
popViewControllerAnimated
:
YES
];
});
NSLog
(
@"onSuccess: %@"
,
responseObject
);
...
...
@@ -532,6 +526,28 @@
}
onFinished
:^
(
id
responseObject
,
NSError
*
error
)
{
NSLog
(
@"onFinished"
);
}];
// [XMCenter sendRequest:^(XMRequest *request) {
// request.server = [NSString stringWithFormat:@"%@/dcxy/api/customer/headPic?customerId=%@", [kUserDefaults valueForKey:@"Recharge"], [kUserDefaults valueForKey:@"userId"]];
// request.requestType = kXMRequestUpload;
// [request addFormDataWithName:@"file" fileName:@"file.jpeg" mimeType:@"image/jpeg" fileData:data];
//
// } onProgress:^(NSProgress *progress) {
// // the progress block is running on the session queue.
// if (progress) {
// NSLog(@"onProgress: %f", progress.fractionCompleted);
// }
// } onSuccess:^(id responseObject) {
// dispatch_async(dispatch_get_main_queue(), ^{
// [self.navigationController popViewControllerAnimated:YES];
// });
// NSLog(@"onSuccess: %@", responseObject);
// } onFailure:^(NSError *error) {
// dispatch_async(dispatch_get_main_queue(), ^{
// [ZXTool showText:error.userInfo[@"NSLocalizedDescription"]];
// });
// } onFinished:^(id responseObject, NSError *error) {
// NSLog(@"onFinished");
// }];
...
...
ColorfulSchool/ColorfulSchool/Classes/CustomViews(自定义)/ADTool/MulityAdCell.m
View file @
03a219ed
//
//
...
...
@@ -67,8 +67,9 @@
v
.
obj
=
gg
;
});
}];
}
else
{
[
self
.
adImageView
sd_setImageWithURL
:[
NSURL
URLWithString
:
_model
.
uploadImg
]];
}
[
self
.
adImageView
sd_setImageWithURL
:[
NSURL
URLWithString
:
_model
.
uploadImg
]];
}
/**
* 拉取原生模板广告成功
...
...
ColorfulSchool/ColorfulSchool/Classes/CustomViews(自定义)/GraphicsCode.m
View file @
03a219ed
//
//
...
...
@@ -12,7 +12,7 @@
@interface
GraphicsCode
()
@property
(
nonatomic
,
strong
)
MQVerCodeImageView
*
graphCodeView
;
@property
(
nonatomic
,
copy
)
NSString
*
currentVioCode
;
@end
...
...
@@ -128,27 +128,19 @@
}
#pragma mark - ========== 刷新图形验证码 ==========
-
(
void
)
refreshCode
{
NSString
*
url
=
[
NSString
stringWithFormat
:
@"%@/dcxy/app/homepage/campus/getDynamicCode?account=%@"
,[
kUserDefaults
valueForKey
:
@"h5FirstPageAPI"
],
_phoneNum
];
NSString
*
url
=
[
NSString
stringWithFormat
:
@"%@/common/getCode?loginName=%@&codeNum=4"
,[
kUserDefaults
valueForKey
:
@"SX_MONEY"
],
_phoneNum
];
@weakify
(
self
);
[
XMCenter
sendRequest
:
^
(
XMRequest
*
request
)
{
request
.
url
=
url
;
request
.
httpMethod
=
kXMHTTPMethodGET
;
request
.
headers
=
@{
@"reqSource"
:
@"app"
,
@"Content-Type"
:
@"application/json"
};
}
onSuccess
:
^
(
id
responseObject
)
{
[
ZXTool
requestDataWithType
:
kXMHTTPMethodPOST
url
:
url
para
:
nil
completed
:^
(
CommonModel
*
common
,
NSString
*
error
)
{
@strongify
(
self
);
CommonModel
*
common
=
[
CommonModel
mj_objectWithKeyValues
:
responseObject
];
NSString
*
s
=
common
.
data
;
if
(
s
==
nil
||
s
.
length
==
0
)
{
[
ZXTool
showText
:
common
.
msg
];
}
else
{
[
self
.
graphCodeView
refreshVerCodeByStr
:
s
];
}
}
onFailure
:^
(
NSError
*
error
)
{
[
ZXTool
showText
:
error
.
userInfo
[
@"NSLocalizedDescription"
]];
}
onFinished
:^
(
id
responseObject
,
NSError
*
error
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
ZXTool
hideLoadingAnimation
];
if
(
error
)
{
[
ZXTool
showText
:
error
];
}
else
{
self
.
currentVioCode
=
common
.
data
;
[
self
.
graphCodeView
refreshVerCodeByStr
:
common
.
data
];
}
});
}];
}
...
...
@@ -157,9 +149,28 @@
*/
-
(
void
)
okBtnFuc
{
self
.
callBack
(
codeTextField
.
text
);
if
(
!
[
self
.
currentVioCode
isEqualToString
:
codeTextField
.
text
])
{
[
ZXTool
showText
:
@"图形验证码输入错误!"
];
return
;
}
[
self
reciveMsgCode
];
[
self
dismiss
];
}
-
(
void
)
reciveMsgCode
{
NSString
*
url
=
[
NSString
stringWithFormat
:
@"%@/common/sendMsgCode?cellphone=%@&codeNum=4"
,[
kUserDefaults
valueForKey
:
@"SX_MONEY"
],
_phoneNum
];
[
ZXTool
requestDataWithType
:
kXMHTTPMethodPOST
url
:
url
para
:
nil
completed
:^
(
CommonModel
*
common
,
NSString
*
error
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
ZXTool
hideLoadingAnimation
];
if
(
error
)
{
[
ZXTool
showText
:
error
];
}
else
{
[
ZXTool
showText
:
@"获取短信验证码成功"
];
self
.
callBack
(
@""
);
}
});
}];
}
/*
展示在当前的widow
*/
...
...
ColorfulSchool/ColorfulSchool/Classes/CustomViews(自定义)/ZLControl.m
View file @
03a219ed
//
//
...
...
@@ -94,7 +94,11 @@
UIButton
*
bt
=
[
UIButton
buttonWithType
:
UIButtonTypeCustom
];
bt
.
frame
=
frame
;
[
bt
setTitle
:
title
forState
:
UIControlStateNormal
];
NSString
*
st
=
title
;
if
(
title
.
length
>
10
&&
[
title
containsString
:
@"-"
]
&&
[
title
containsString
:
@":"
])
{
st
=
[
title
substringToIndex
:
10
];
}
[
bt
setTitle
:
st
forState
:
UIControlStateNormal
];
[
bt
setTitleColor
:
titleColor
forState
:
UIControlStateNormal
];
bt
.
backgroundColor
=
color
;
bt
.
titleLabel
.
font
=
font
;
...
...
ColorfulSchool/ColorfulSchool/Classes/Extension(分类扩展)/NSDictionary+Property.m
View file @
03a219ed
//
//
...
...
@@ -38,8 +38,8 @@
}];
NSLog
(
@"%@"
,
codes
);
//
NSLog(@"%@",codes);
}
-
(
void
)
userDefaultWithClassName
:
(
NSString
*
)
className
{
...
...
ColorfulSchool/ColorfulSchool/Classes/Login(登录注册)/ForgetPassword/Controller/forgetPasswordViewController.h
View file @
03a219ed
//
//
...
...
@@ -10,5 +10,5 @@
@interface
forgetPasswordViewController
:
UIViewController
@property
(
weak
,
nonatomic
)
IBOutlet
UIScrollView
*
scrollerView
;
@property
(
nonatomic
,
copy
)
dispatch_block_t
backBlock
;
@end
ColorfulSchool/ColorfulSchool/Classes/Login(登录注册)/ForgetPassword/Controller/forgetPasswordViewController.m
View file @
03a219ed
//
//
...
...
@@ -54,45 +54,37 @@
[
_forgetPwdModel
removeObserver
:
self
forKeyPath
:
@"error"
];
//
}
-
(
void
)
observeValueForKeyPath
:
(
NSString
*
)
keyPath
ofObject
:
(
id
)
object
change
:
(
NSDictionary
<
NSKeyValueChangeKey
,
id
>
*
)
change
context
:
(
void
*
)
context
{
if
(
object
==
_fetchCheckCodeModel
)
{
if
([
keyPath
isEqualToString
:
@"isLoaded"
])
{
if
(
timer
==
nil
)
{
_time
=
60
;
//当计时器开始计时时按钮点击是无效的;
self
.
fetchCodeBtn
.
userInteractionEnabled
=
NO
;
[
self
.
fetchCodeBtn
setTitle
:
@"(60)重新获取"
forState
:
UIControlStateNormal
];
timer
=
[
NSTimer
scheduledTimerWithTimeInterval
:
1
target
:
self
selector
:
@selector
(
changTimeShow
)
userInfo
:
nil
repeats
:
YES
];
}
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// [timer invalidate];
// timer = nil;
// });
}
else
{
}
}
if
(
object
==
_forgetPwdModel
)
{
if
([
keyPath
isEqualToString
:
@"isLoaded"
])
{
LoginView
*
VC
=
[
LoginView
new
];
[
self
.
navigationController
pushViewController
:
VC
animated
:
YES
];
}
else
{
}
}
}
//-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context{
// if (object == _fetchCheckCodeModel) {
// if ([keyPath isEqualToString:@"isLoaded"]) {
//
//
//// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
//// [timer invalidate];
//// timer = nil;
//// });
//
//
// }
// else{
//
//
// }
// }
// if (object==_forgetPwdModel) {
// if ([keyPath isEqualToString:@"isLoaded"]) {
//
// LoginView * VC=[LoginView new];
// [self.navigationController pushViewController:VC animated:YES];
// }
// else{
//
//
// }
//
// }
//
//}
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
...
...
@@ -122,6 +114,9 @@
-
(
void
)
viewWillDisappear
:
(
BOOL
)
animated
{
[
super
viewWillDisappear
:
animated
];
// self.navigationController.navigationBar.translucent = YES;
if
(
self
.
backBlock
)
{
self
.
backBlock
();
}
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
...
...
@@ -139,22 +134,24 @@
__weak
typeof
(
self
)
weakSelf
=
self
;
codeView
=
[[
GraphicsCode
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
kWidth
,
kHeight
)
phoneNum
:
_phoneNumTextFeild
.
text
];
codeView
.
callBack
=
^
(
NSString
*
code
)
{
/*
获取验证码 //isTest是否需要校验手机号码是否已经注册1、验证、0不验证,(注册的时候,修改手机号的时候传1,其它传0)
*/
if
([
code
isEqualToString
:
@""
])
{
[
SVProgressHUD
showErrorWithStatus
:
@"未输入图形验证码"
];
return
;
}
[
weakSelf
.
fetchCheckCodeModel
fetchCheckCodeWithPhoneNum
:
weakSelf
.
phoneNumTextFeild
.
text
picNumDinamicNum
:
code
isTest
:
@"0"
];
codeView
.
callBack
=
^
(
NSString
*
code
)
{
[
weakSelf
initTimer
];
};
[
codeView
show
:
self
];
}
-
(
void
)
initTimer
{
if
(
timer
==
nil
)
{
_time
=
60
;
//当计时器开始计时时按钮点击是无效的;
self
.
fetchCodeBtn
.
userInteractionEnabled
=
NO
;
[
self
.
fetchCodeBtn
setTitle
:
@"(60)重新获取"
forState
:
UIControlStateNormal
];
timer
=
[
NSTimer
scheduledTimerWithTimeInterval
:
1
target
:
self
selector
:
@selector
(
changTimeShow
)
userInfo
:
nil
repeats
:
YES
];
}
}
#pragma mark 计时器调用事件;
-
(
void
)
changTimeShow
{
...
...
@@ -225,7 +222,19 @@
//找回密码
[
self
.
forgetPwdModel
forgetPasswordWithPhoneNum
:
_phoneNumTextFeild
.
text
NewPwd
:
_passwordFeild
.
text
checkCode
:
_checkCodeField
.
text
];
// [self.forgetPwdModel forgetPasswordWithPhoneNum:_phoneNumTextFeild.text NewPwd:_passwordFeild.text checkCode:_checkCodeField.text];
[
ZXTool
requestDataWithType
:
kXMHTTPMethodPOST
url
:[
NSString
stringWithFormat
:
@"%@/app/customer/forget/pwd"
,
[
kUserDefaults
valueForKey
:
@"NEW_PAY"
]]
para
:
@{
@"loginAccount"
:
_phoneNumTextFeild
.
text
,
@"password"
:
_passwordFeild
.
text
,
@"verification"
:
_checkCodeField
.
text
}
completed
:^
(
CommonModel
*
common
,
NSString
*
error
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
ZXTool
hideLoadingAnimation
];
if
(
error
)
{
[
ZXTool
showText
:
error
];
}
else
{
[
ZXTool
showText
:
@"找回密码成功"
];
[
ZXTool
backToLogin
];
}
});
}];
}
-
(
void
)
showBtnFucWithShowBtn
:
(
UIButton
*
)
btn
textField
:
(
UITextField
*
)
textfeild
{
...
...
ColorfulSchool/ColorfulSchool/Classes/Login(登录注册)/Login/Controller/LoginView.m
View file @
03a219ed
//
//
...
...
@@ -13,7 +13,7 @@
#import "forgetPasswordViewController.h"
#import "ZXSimpleRootTabbarController.h"
#import "LoginJump.h"
#import "ZXUserModel.h"
@interface
LoginView
()
<
UITextFieldDelegate
>
@property
(
nonatomic
,
strong
)
LoginModel
*
loginModel
;
...
...
@@ -155,8 +155,97 @@
return
;
}
[[
UIApplication
sharedApplication
].
keyWindow
endEditing
:
YES
];
// [self.loginModel loginWithPhoneNum:self.userTF.text password:self.passWorldTF.text];
[
SVProgressHUD
showWithStatus
:
@" 正在登录 ,请稍后 "
];
[
self
.
loginModel
loginWithPhoneNum
:
self
.
userTF
.
text
password
:
self
.
passWorldTF
.
text
];
[
self
startLoginByAccount
:
self
.
userTF
.
text
password
:
self
.
passWorldTF
.
text
];
}
-
(
void
)
startLoginByAccount
:
(
NSString
*
)
accoun
password
:
(
NSString
*
)
password
{
NSString
*
token
=
[
kUserDefaults
valueForKey
:
@"token"
];
if
(
token
==
nil
)
{
token
=
@""
;
}
dispatch_async
(
dispatch_get_global_queue
(
0
,
0
),
^
{
@weakify
(
self
);
[
XMCenter
sendRequest
:
^
(
XMRequest
*
request
)
{
request
.
url
=
[[
NSString
stringWithFormat
:
@"%@/app/customer/login"
,
[
kUserDefaults
objectForKey
:
@"NEW_PAY"
]]
stringByAddingPercentEscapesUsingEncoding
:
NSUTF8StringEncoding
];
request
.
httpMethod
=
kXMHTTPMethodPOST
;
request
.
headers
=
@{
@"token"
:
token
,
@"reqSource"
:
@"app"
,
@"Content-Type"
:
@"application/json"
};
request
.
HttpBody
=
[[
ZXTool
dictionaryToJson
:@{
@"loginAccount"
:
accoun
,
@"password"
:
password
}]
mj_JSONData
];
}
onSuccess
:
^
(
id
responseObject
)
{
CommonModel
*
common
=
[
CommonModel
mj_objectWithKeyValues
:
responseObject
];
@strongify
(
self
);
if
(
common
.
code
==
1000
)
{
ZXUserModel
*
user
=
[
ZXUserModel
mj_objectWithKeyValues
:
common
.
data
];
[
ZXUserModel
clearTable
];
[
user
save
];
[
self
saveUserInfo
:
user
];
[
ZXTool
requestIsNeedExposure
];
//请求书否需要曝光
[
ZXTool
loginSuccessJump
:
^
(
NSString
*
jump
)
{
[
SVProgressHUD
dismiss
];
if
([
jump
isEqualToString
:
@"NONE"
])
{
//先读取缓存
NSArray
*
list
=
[
LoginJump
findAll
];
if
(
list
.
count
==
0
)
{
jump
=
@"DC_01"
;
}
else
{
LoginJump
*
m
=
list
.
lastObject
;
jump
=
m
.
modelCode
;
}
}
if
([
jump
isEqualToString
:
@"DC_02"
])
{
//跳转简单版
ZXSimpleRootTabbarController
*
simpleRoot
=
[[
ZXSimpleRootTabbarController
alloc
]
init
];
[
UIApplication
sharedApplication
].
keyWindow
.
rootViewController
=
simpleRoot
;
}
else
{
//跳转复杂版
MyTabViewController
*
tabRoot
=
[[
MyTabViewController
alloc
]
init
];
[
UIApplication
sharedApplication
].
keyWindow
.
rootViewController
=
tabRoot
;
}
}];
}
else
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
SVProgressHUD
dismiss
];
[
SVProgressHUD
showErrorWithStatus
:
common
.
msg
];
});
}
}
onFailure
:^
(
NSError
*
error
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
SVProgressHUD
dismiss
];
[
SVProgressHUD
showErrorWithStatus
:
error
.
userInfo
[
@"NSLocalizedDescription"
]];
});
}
onFinished
:^
(
id
responseObject
,
NSError
*
error
)
{
}];
});
}
-
(
void
)
saveUserInfo
:
(
ZXUserModel
*
)
user
{
[[
LoginModel
new
]
removeCache
];
NSUserDefaults
*
userDefaults
=
[
NSUserDefaults
standardUserDefaults
];
[
userDefaults
setObject
:[
NSString
stringWithFormat
:
@"%ld"
,
user
.
customerId
]
forKey
:
@"userId"
];
[
userDefaults
setObject
:
user
.
token
forKey
:
@"token"
];
[
userDefaults
setObject
:
user
.
customerPhone
forKey
:
@"account"
];
[
userDefaults
setObject
:[
NSString
stringWithFormat
:
@"%ld"
,
user
.
areaId
]
forKey
:
@"campusId"
];
[
userDefaults
setObject
:
user
.
version
forKey
:
@"version"
];
[
userDefaults
setObject
:
user
.
loginPwd
forKey
:
@"passWord"
];
[
userDefaults
setObject
:
user
.
idBar
forKey
:
@"idBar"
];
[
userDefaults
setObject
:[
NSString
stringWithFormat
:
@"%ld"
,
user
.
isFirstRecharge
]
forKey
:
@"rechargeStatus"
];
[
userDefaults
setObject
:
user
.
birthDay
forKey
:
@"birthday"
];
[
userDefaults
setObject
:
user
.
areaName
forKey
:
@"campusName"
];
[
userDefaults
setObject
:
user
.
entranceDate
forKey
:
@"enterSchoolDate"
];
[
userDefaults
setObject
:[
user
.
customerSex
isEqualToString
:
@"1"
]?
@"male"
:
@"female"
forKey
:
@"gender"
];
[
userDefaults
setObject
:[
NSString
stringWithFormat
:
@"%ld"
,
user
.
hardwareAccount
]
forKey
:
@"sbaccount"
];
// [userDefaults setObject:self.item.schoolId forKey:@"schoolId"];
// [userDefaults setObject:self.item.schoolName forKey:@"schoolName"];
[
userDefaults
setObject
:
user
.
studentNo
forKey
:
@"studentNo"
];
[
userDefaults
setObject
:
user
.
customerName
forKey
:
@"username"
];
[
userDefaults
setObject
:
@
(
!
user
.
hardwareState
)
forKey
:
@"devPassSwitch"
];
[
userDefaults
setObject
:
@
(
user
.
isUploadLog
)
forKey
:
@"isUploadLog"
];
[
userDefaults
synchronize
];
NSLog
(
@"====%@"
,
CacheUserId
);
}
-
(
IBAction
)
registerBtnFuc
:
(
id
)
sender
{
// [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
...
...
ColorfulSchool/ColorfulSchool/Classes/Login(登录注册)/Login/Controller/ZXChooseSchoolViewController.h
View file @
03a219ed
//
//
...
...
@@ -7,8 +7,8 @@
//
#import <UIKit/UIKit.h>
typedef
void
(
^
selectSchool
)(
NSString
*
name
);
#import "ZXNewSchool.h"
typedef
void
(
^
selectSchool
)(
ZXNewCampus
*
campus
);
@interface
ZXChooseSchoolViewController
:
UIViewController
...
...
ColorfulSchool/ColorfulSchool/Classes/Login(登录注册)/Login/Controller/ZXChooseSchoolViewController.m
View file @
03a219ed
//
//
...
...
@@ -118,19 +118,8 @@
}
[
self
.
myTableView
scrollToRowAtIndexPath
:[
NSIndexPath
indexPathForRow
:
0
inSection
:
index_T
]
atScrollPosition
:
UITableViewScrollPositionTop
animated
:
YES
];
}
else
{
[
self
loadNewDataCompleted
:
^
{
for
(
int
i
=
0
;
i
<
self
.
listDataSource
.
count
;
i
++
)
{
ZXBaseItem
*
it
=
self
.
listDataSource
[
i
];
//这里触发检索
NSPredicate
*
predicate
=
[
NSPredicate
predicateWithFormat
:[
NSString
stringWithFormat
:
@"fdName LIKE[cd] '*%@*'"
,
x
]];
NSArray
*
results
=
[
it
.
baseSchool
filteredArrayUsingPredicate
:
predicate
];
it
.
baseSchool
=
results
;
}
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
self
.
myTableView
reloadData
];
});
}];
NSArray
*
arr
=
[
ZXNewCampus
findByCriteria
:[
NSString
stringWithFormat
:
@"where areaName like '%%%@%%'"
,
weakfield
.
text
]];
[
self
sortResult
:
arr
];
}
}];
...
...
@@ -277,63 +266,87 @@
});
dispatch_async
(
dispatch_get_global_queue
(
0
,
0
),
^
{
[
XMCenter
sendRequest
:
^
(
XMRequest
*
request
)
{
request
.
url
=
[[
NSString
stringWithFormat
:
@"%@/
dcxy/api/campus/queryOrderList"
,
[
kUserDefaults
valueForKey
:
@"Recharge
"
]]
stringByAddingPercentEscapesUsingEncoding
:
NSUTF8StringEncoding
];
request
.
url
=
[[
NSString
stringWithFormat
:
@"%@/
area/queryAreaList"
,
[
kUserDefaults
valueForKey
:
@"SX_MONEY
"
]]
stringByAddingPercentEscapesUsingEncoding
:
NSUTF8StringEncoding
];
request
.
timeoutInterval
=
5
;
request
.
httpMethod
=
kXMHTTPMethodGET
;
}
onSuccess
:
^
(
id
responseObject
)
{
CommonModel
*
common
=
[
CommonModel
mj_objectWithKeyValues
:
responseObject
];
NSArray
*
arr
=
[
ZXBaseItem
mj_objectArrayWithKeyValuesArray
:
common
.
data
];
[
self
.
listDataSource
removeAllObjects
];
[
self
.
listDataSource
addObjectsFromArray
:
arr
];
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
ZXTool
hideLoadingAnimation
];
[
self
.
myTableView
.
mj_header
endRefreshing
];
[
self
.
myTableView
reloadData
];
[
self
.
indexListView
reloadData
];
});
NSArray
*
arr
=
[
ZXNewCampus
mj_objectArrayWithKeyValuesArray
:
common
.
data
];
[
ZXNewCampus
clearTable
];
[
ZXNewSchool
clearTable
];
for
(
ZXBaseItem
*
item
in
self
.
listDataSource
)
{
[
ZXNewSchool
saveObjects
:
item
.
baseSchool
];
for
(
ZXNewSchool
*
sch
in
item
.
baseSchool
)
{
[
ZXNewCampus
saveObjects
:
sch
.
list
];
}
}
dispatch_async
(
dispatch_get_global_queue
(
0
,
0
),
^
{
[
ZXNewCampus
saveObjects
:
arr
];
});
[
self
sortResult
:
arr
];
}
onFailure
:^
(
NSError
*
error
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
ZXTool
hideLoadingAnimation
];
[
self
.
myTableView
.
mj_header
endRefreshing
];
});
}
onFinished
:^
(
id
responseObject
,
NSError
*
error
)
{
}];
});
}
-
(
void
)
loadNewDataCompleted
:
(
dispatch_block_t
)
completed
{
dispatch_async
(
dispatch_get_global_queue
(
0
,
0
),
^
{
[
XMCenter
sendRequest
:
^
(
XMRequest
*
request
)
{
request
.
url
=
[[
NSString
stringWithFormat
:
@"%@/dcxy/api/campus/queryOrderList"
,
[
kUserDefaults
valueForKey
:
@"Recharge"
]]
stringByAddingPercentEscapesUsingEncoding
:
NSUTF8StringEncoding
];
request
.
timeoutInterval
=
5
;
request
.
httpMethod
=
kXMHTTPMethodGET
;
}
onSuccess
:
^
(
id
responseObject
)
{
dispatch_async
(
dispatch_get_global_queue
(
0
,
0
),
^
{
CommonModel
*
common
=
[
CommonModel
mj_objectWithKeyValues
:
responseObject
];
NSArray
*
arr
=
[
ZXBaseItem
mj_objectArrayWithKeyValuesArray
:
common
.
data
];
[
self
.
listDataSource
removeAllObjects
];
[
self
.
listDataSource
addObjectsFromArray
:
arr
];
dispatch_async
(
dispatch_get_main_queue
(),
^
{
completed
();
});
});
}
onFailure
:^
(
NSError
*
error
)
{
}
onFinished
:^
(
id
responseObject
,
NSError
*
error
)
{
}];
-
(
void
)
sortResult
:
(
NSArray
*
)
arr
{
NSArray
*
result
=
[
arr
sortedArrayUsingComparator
:
^
NSComparisonResult
(
ZXNewCampus
*
obj1
,
ZXNewCampus
*
obj2
)
{
return
[
obj1
.
initial
caseInsensitiveCompare
:
obj2
.
initial
];
}];
[
self
.
listDataSource
removeAllObjects
];
NSString
*
charter
=
@"A"
;
NSMutableArray
*
list
=
[[
NSMutableArray
alloc
]
init
];
for
(
int
i
=
0
;
i
<
result
.
count
;
i
++
)
{
ZXNewCampus
*
item
=
result
[
i
];
if
([
item
.
initial
isEqualToString
:
charter
])
{
[
list
addObject
:
item
];
}
else
{
ZXBaseItem
*
base
=
[[
ZXBaseItem
alloc
]
init
];
base
.
py
=
charter
;
base
.
baseSchool
=
list
.
mutableCopy
;
[
self
.
listDataSource
addObject
:
base
];
[
list
removeAllObjects
];
charter
=
item
.
initial
;
[
list
addObject
:
item
];
}
if
(
i
==
result
.
count
-
1
)
{
ZXBaseItem
*
base
=
[[
ZXBaseItem
alloc
]
init
];
base
.
py
=
charter
;
base
.
baseSchool
=
list
.
mutableCopy
;
[
self
.
listDataSource
addObject
:
base
];
}
}
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
ZXTool
hideLoadingAnimation
];
[
self
.
myTableView
.
mj_header
endRefreshing
];
[
self
.
myTableView
reloadData
];
[
self
.
indexListView
reloadData
];
});
}
//- (void) loadNewDataCompleted:(dispatch_block_t) completed {
//
// dispatch_async(dispatch_get_global_queue(0, 0), ^{
// [XMCenter sendRequest:^(XMRequest *request) {
// request.url = [[NSString stringWithFormat:@"%@/dcxy/api/campus/queryOrderList", [kUserDefaults valueForKey:@"Recharge"]] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
// request.timeoutInterval = 5;
// request.httpMethod = kXMHTTPMethodGET;
// } onSuccess:^(id responseObject) {
// dispatch_async(dispatch_get_global_queue(0, 0), ^{
// CommonModel *common = [CommonModel mj_objectWithKeyValues:responseObject];
// NSArray *arr = [ZXBaseItem mj_objectArrayWithKeyValuesArray:common.data];
// [self.listDataSource removeAllObjects];
// [self.listDataSource addObjectsFromArray:arr];
// dispatch_async(dispatch_get_main_queue(), ^{
// completed();
// });
// });
// } onFailure:^(NSError *error) {
//
// } onFinished:^(id responseObject, NSError *error) {
//
// }];
// });
//}
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
if
(
tableView
==
self
.
indexListView
)
{
return
self
.
listDataSource
.
count
;
...
...
@@ -364,8 +377,8 @@
return
cell
;
}
ZXBaseItem
*
item
=
self
.
listDataSource
[
indexPath
.
section
];
ZXNew
School
*
school
=
item
.
baseSchool
[
indexPath
.
row
];
cell
.
textLabel
.
text
=
school
.
fd
Name
;
ZXNew
Campus
*
cam
=
item
.
baseSchool
[
indexPath
.
row
];
cell
.
textLabel
.
text
=
cam
.
area
Name
;
return
cell
;
}
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForHeaderInSection
:
(
NSInteger
)
section
{
...
...
@@ -415,8 +428,8 @@
}
ZXBaseItem
*
item
=
self
.
listDataSource
[
indexPath
.
section
];
if
(
self
.
select
)
{
ZXNew
School
*
sch
=
item
.
baseSchool
[
indexPath
.
row
];
self
.
select
(
sch
.
fdName
);
ZXNew
Campus
*
campus
=
item
.
baseSchool
[
indexPath
.
row
];
self
.
select
(
campus
);
}
[
self
.
navigationController
popViewControllerAnimated
:
YES
];
}
...
...
ColorfulSchool/ColorfulSchool/Classes/Login(登录注册)/Login/Controller/ZXRegistorViewController.m
View file @
03a219ed
//
//
...
...
@@ -20,7 +20,7 @@
@interface
ZXRegistorViewController
()
<
UIScrollViewDelegate
>
@property
(
nonatomic
,
strong
)
dispatch_source_t
timer
;
@property
(
nonatomic
,
strong
)
UIView
*
naBar
;
@property
(
nonatomic
,
strong
)
ZXNewCampus
*
currentSelecCampus
;
@property
(
nonatomic
,
strong
)
enlargeClickRegionBtn
*
protocol
;
@property
(
nonatomic
,
strong
)
enlargeClickRegionBtn
*
maleBtn
;
@property
(
nonatomic
,
strong
)
enlargeClickRegionBtn
*
femaleBtn
;
...
...
@@ -35,7 +35,7 @@
@property
(
nonatomic
,
strong
)
UIButton
*
pwdSeeBtn
;
@property
(
nonatomic
,
strong
)
UIButton
*
rePwdSeeBtn
;
@property
(
nonatomic
,
strong
)
UITextField
*
schoolNameField
;
@property
(
nonatomic
,
strong
)
UITextField
*
schoolAreaNameField
;
//
@property (nonatomic, strong) UITextField *schoolAreaNameField;
@property
(
strong
,
nonatomic
)
FetchCheckCodeModel
*
fetchCheckCodeModel
;
...
...
@@ -175,6 +175,7 @@
self
.
nameField
=
[[
UITextField
alloc
]
init
];
self
.
nameField
.
font
=
kFontSize
(
14
*
k6Scale
);
self
.
nameField
.
placeholder
=
@"请输入姓名"
;
[
self
.
nameField
setValue
:
@30
forKey
:
@"limit"
];
[
bg
addSubview
:
self
.
nameField
];
[
self
.
nameField
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
equalTo
(
line1
.
mas_left
);
...
...
@@ -313,15 +314,15 @@
make
.
top
.
equalTo
(
icon2
.
mas_bottom
).
offset
(
40
*
k6Scale
);
}];
UIView
*
line7
=
[[
UIView
alloc
]
init
];
line7
.
backgroundColor
=
RGB
(
243
,
243
,
243
);
[
bg
addSubview
:
line7
];
[
line7
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
equalTo
(
bg
.
mas_left
).
offset
(
20
*
k6Scale
);
make
.
right
.
equalTo
(
bg
.
mas_right
).
offset
(
-
20
*
k6Scale
);
make
.
height
.
mas_equalTo
(
1
*
k6Scale
);
make
.
top
.
equalTo
(
line6
.
mas_bottom
).
offset
(
40
*
k6Scale
);
}];
//
UIView *line7 = [[UIView alloc] init];
//
line7.backgroundColor = RGB(243, 243, 243);
//
[bg addSubview:line7];
//
[line7 mas_makeConstraints:^(MASConstraintMaker *make) {
//
make.left.equalTo(bg.mas_left).offset(20 * k6Scale);
//
make.right.equalTo(bg.mas_right).offset(-20 * k6Scale);
//
make.height.mas_equalTo(1 * k6Scale);
//
make.top.equalTo(line6.mas_bottom).offset(40 * k6Scale);
//
}];
self
.
protocol
=
[[
enlargeClickRegionBtn
alloc
]
init
];
[
bg
addSubview
:
self
.
protocol
];
...
...
@@ -329,7 +330,7 @@
[
self
.
protocol
setBackgroundImage
:[
UIImage
imageNamed
:
@"login_check"
]
forState
:
UIControlStateSelected
];
[
self
.
protocol
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
equalTo
(
bg
.
mas_left
).
offset
(
20
*
k6Scale
);
make
.
top
.
equalTo
(
line
7
.
mas_bottom
).
offset
(
20
*
k6Scale
);
make
.
top
.
equalTo
(
line
6
.
mas_bottom
).
offset
(
20
*
k6Scale
);
make
.
width
.
height
.
mas_equalTo
(
14
*
k6Scale
);
}];
...
...
@@ -422,16 +423,16 @@
make
.
width
.
mas_equalTo
(
180
*
k6Scale
);
}];
self
.
schoolAreaNameField
=
[[
UITextField
alloc
]
init
];
self
.
schoolAreaNameField
.
font
=
kFontSize
(
14
*
k6Scale
);
self
.
schoolAreaNameField
.
placeholder
=
@"请选择所在校区"
;
[
bg
addSubview
:
self
.
schoolAreaNameField
];
[
self
.
schoolAreaNameField
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
equalTo
(
line7
.
mas_left
);
make
.
bottom
.
equalTo
(
line7
.
mas_bottom
);
make
.
height
.
mas_equalTo
(
25
*
k6Scale
);
make
.
right
.
equalTo
(
line7
.
mas_right
);
}];
//
self.schoolAreaNameField = [[UITextField alloc] init];
//
self.schoolAreaNameField.font = kFontSize(14 * k6Scale);
//
self.schoolAreaNameField.placeholder = @"请选择所在校区";
//
[bg addSubview:self.schoolAreaNameField];
//
[self.schoolAreaNameField mas_makeConstraints:^(MASConstraintMaker *make) {
//
make.left.equalTo(line7.mas_left);
//
make.bottom.equalTo(line7.mas_bottom);
//
make.height.mas_equalTo(25 * k6Scale);
//
make.right.equalTo(line7.mas_right);
//
}];
self
.
reciveCode
=
[[
UILabel
alloc
]
init
];
self
.
reciveCode
.
text
=
@"获取验证码"
;
[
bg
addSubview
:
self
.
reciveCode
];
...
...
@@ -501,36 +502,26 @@
}];
[
self
.
pwdSeeBtn
addTarget
:
self
action
:
@selector
(
pwdSee
:
)
forControlEvents
:
UIControlEventTouchDown
];
[
self
.
rePwdSeeBtn
addTarget
:
self
action
:
@selector
(
rePwdSee
:
)
forControlEvents
:
UIControlEventTouchDown
];
UIImageView
*
iiii
=
[[
UIImageView
alloc
]
init
];
[
bg
addSubview
:
iiii
];
[
iiii
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
right
.
equalTo
(
line7
.
mas_right
).
offset
(
-
5
*
k6Scale
);
make
.
centerY
.
equalTo
(
self
.
schoolAreaNameField
.
mas_centerY
);
}];
iiii
.
image
=
[
UIImage
imageNamed
:
@"login_drop-down-icon"
];
//
UIImageView *iiii = [[UIImageView alloc] init];
//
[bg addSubview:iiii];
//
[iiii mas_makeConstraints:^(MASConstraintMaker *make) {
//
make.right.equalTo(line7.mas_right).offset(-5 * k6Scale);
//
make.centerY.equalTo(self.schoolAreaNameField.mas_centerY);
//
}];
//
iiii.image = [UIImage imageNamed:@"login_drop-down-icon"];
self
.
pwdField
.
secureTextEntry
=
YES
;
self
.
rePwdField
.
secureTextEntry
=
YES
;
[
self
.
schoolNameField
addTarget
:
self
action
:
@selector
(
chooseSchool
)
forControlEvents
:
UIControlEventEditingDidBegin
];
[
self
.
schoolAreaNameField
addTarget
:
self
action
:
@selector
(
chooseSchoolArea
)
forControlEvents
:
UIControlEventEditingDidBegin
];
//
[self.schoolAreaNameField addTarget:self action:@selector(chooseSchoolArea) forControlEvents:UIControlEventEditingDidBegin];
[
self
maleClick
:
self
.
maleBtn
];
}
#pragma mark - ========== 获取验证码 ==========
-
(
void
)
reciveVioCode
{
GraphicsCode
*
codeView
=
[[
GraphicsCode
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
kWidth
,
kHeight
)
phoneNum
:
self
.
phoneField
.
text
];
@weakify
(
self
);
GraphicsCode
*
codeView
=
[[
GraphicsCode
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
kWidth
,
kHeight
)
phoneNum
:
self
.
phoneField
.
text
];
codeView
.
callBack
=
^
(
NSString
*
code
){
@strongify
(
self
);
/*
获取验证码 //isTest是否需要校验手机号码是否已经注册1、验证、0不验证,(注册的时候,修改手机号的时候传1,其它传0)
*/
if
([
code
isEqualToString
:
@""
])
{
[
SVProgressHUD
showErrorWithStatus
:
@"未输入图形验证码"
];
return
;
}
[
self
.
fetchCheckCodeModel
fetchCheckCodeWithPhoneNum
:
self
.
phoneField
.
text
picNumDinamicNum
:
code
isTest
:
@"1"
];
};
[
codeView
show
:
self
];
}
...
...
@@ -538,32 +529,16 @@
#pragma mark - ========== 选择学校 ==========
-
(
void
)
chooseSchool
{
@weakify
(
self
);
ZXChooseSchoolViewController
*
school
=
[[
ZXChooseSchoolViewController
alloc
]
initWithSchoolName
:
^
(
NSString
*
name
)
{
ZXChooseSchoolViewController
*
school
=
[[
ZXChooseSchoolViewController
alloc
]
initWithSchoolName
:
^
(
ZXNewCampus
*
campus
)
{
@strongify
(
self
);
self
.
schoolNameField
.
text
=
name
;
self
.
schoolAreaNameField
.
text
=
@""
;
self
.
currentSelecCampus
=
campus
;
self
.
schoolNameField
.
text
=
campus
.
areaName
;
}];
[
self
.
navigationController
pushViewController
:
school
animated
:
YES
];
[
self
.
schoolNameField
resignFirstResponder
];
}
#pragma mark - ========== 选择校区 ==========
-
(
void
)
chooseSchoolArea
{
if
([
self
.
schoolNameField
.
text
isEqualToString
:
@""
])
{
[
ZXTool
showText
:
@"请先选择学校"
];
[
self
.
schoolAreaNameField
resignFirstResponder
];
return
;
}
@weakify
(
self
);
ZXScollAreaChooseView
*
schoolArea
=
[[
ZXScollAreaChooseView
alloc
]
initWithFrame
:[
UIScreen
mainScreen
].
bounds
selectAction
:
^
(
NSString
*
campus
)
{
//拿到name
@strongify
(
self
);
self
.
schoolAreaNameField
.
text
=
campus
;
}];
schoolArea
.
schoolName
=
self
.
schoolNameField
.
text
;
[
self
.
view
addSubview
:
schoolArea
];
[
self
.
schoolAreaNameField
resignFirstResponder
];
}
#pragma mark - ========== 开/闭密码框 ==========
-
(
void
)
pwdSee
:
(
UIButton
*
)
btn
{
btn
.
selected
=
!
btn
.
selected
;
...
...
@@ -637,7 +612,7 @@
}
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
[
super
viewWillAppear
:
animated
];
[[
UIApplication
sharedApplication
].
keyWindow
endEditing
:
YES
];
self
.
navigationController
.
navigationBar
.
hidden
=
YES
;
[
UIApplication
sharedApplication
].
statusBarHidden
=
YES
;
}
...
...
@@ -671,10 +646,6 @@
[
ZXTool
showText
:
@"请先选择学校"
];
return
;
}
if
([
self
.
schoolAreaNameField
.
text
length
]
==
0
)
{
[
ZXTool
showText
:
@"请先选择校区!"
];
return
;
}
if
(
self
.
femaleBtn
.
enabled
&&
self
.
maleBtn
.
enabled
)
{
[
ZXTool
showText
:
@"请先选择性别!"
];
return
;
...
...
@@ -683,26 +654,24 @@
[
ZXTool
showText
:
@"请先阅读用户协议并同意"
];
return
;
}
ZXNewSchool
*
schoolItem
=
[
ZXNewSchool
findByCriteria
:[
NSString
stringWithFormat
:
@"where fdName = '%@'"
,
self
.
schoolNameField
.
text
]].
firstObject
;
ZXNewCampus
*
campusIte
=
[
ZXNewCampus
findByCriteria
:[
NSString
stringWithFormat
:
@"where schoolId = %ld and isSelect = 1"
,
schoolItem
.
id
]].
firstObject
;
NSDictionary
*
dic
=
@{
@"fd_gender"
:
self
.
maleBtn
.
enabled
?
@"Female"
:
@"Male"
,
@"fd_name"
:
self
.
nameField
.
text
,
@"fd_schoolId"
:
[
NSString
stringWithFormat
:
@"%ld"
,
schoolItem
.
id
],
@"fd_campusId"
:
[
NSString
stringWithFormat
:
@"%ld"
,
campusIte
.
id
],
@"account"
:
self
.
phoneField
.
text
,
@"password"
:
self
.
pwdField
.
text
,
@"checkCode"
:
self
.
violaField
.
text
};
[
ZXTool
showLoadingAnimation
];
[
GetData
RegisterWithDic
:
dic
success
:
^
(
AFHTTPRequestOperation
*
operation
,
id
responseObject
)
{
NSDictionary
*
dic
=
@{
@"customerName"
:
self
.
nameField
.
text
,
@"customerPhone"
:
self
.
phoneField
.
text
,
@"customerSex"
:
self
.
maleBtn
.
enabled
?
@"2"
:
@"1"
,
@"areaId"
:
@
(
self
.
currentSelecCampus
.
id
),
@"areaName"
:
self
.
currentSelecCampus
.
areaName
,
@"password"
:
self
.
pwdField
.
text
,
@"verificationCode"
:
self
.
violaField
.
text
};
[
ZXTool
requestDataWithType
:
kXMHTTPMethodPOST
url
:[
NSString
stringWithFormat
:
@"%@/app/customer/register"
,
[
kUserDefaults
objectForKey
:
@"NEW_PAY"
]]
para
:
dic
completed
:^
(
CommonModel
*
common
,
NSString
*
error
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
ZXTool
hideLoadingAnimation
];
if
([
responseObject
[
@"code"
]
isEqualToString
:
@"0"
])
{
[
ZXTool
showText
:
@"注册成功!"
];
[
self
.
navigationController
popViewControllerAnimated
:
YES
];
if
(
error
)
{
[
ZXTool
showText
:
error
];
}
else
{
[
ZXTool
showText
:
responseObject
[
@"msg"
]];
[
ZXTool
showText
:
@"注册成功"
];
[
self
.
navigationController
popViewControllerAnimated
:
YES
];
}
});
}
failure
:^
(
AFHTTPRequestOperation
*
operation
,
NSError
*
error
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
ZXTool
hideLoadingAnimation
];
[
ZXTool
showText
:
error
.
userInfo
[
@"NSLocalizedDescription"
]];
});
}];
}
@end
ColorfulSchool/ColorfulSchool/Classes/Login(登录注册)/Login/Modle/LoginModel.h
View file @
03a219ed
//
//
...
...
@@ -64,6 +64,6 @@
@property
(
nonatomic
,
strong
)
LoginModelItem
*
item
;
-
(
void
)
loginOut
;
-
(
void
)
removeCache
;
-
(
void
)
loginWithPhoneNum
:(
NSString
*
)
phoneNum
password
:(
NSString
*
)
password
;
@end
ColorfulSchool/ColorfulSchool/Classes/Login(登录注册)/Login/Modle/LoginModel.m
View file @
03a219ed
//
//
...
...
@@ -26,7 +26,7 @@
if
([
dic
[
@"code"
]
isEqualToString
:
@"0"
])
{
[
dic
[
@"data"
]
createPropertyCode
];
[
dic
[
@"data"
]
createPropertyCode
];
self
.
item
=
[
LoginModelItem
mj_objectWithKeyValues
:
dic
[
@"data"
]];
self
.
item
.
msg
=
dic
[
@"msg"
];
...
...
@@ -40,25 +40,25 @@
[
ZXTool
showText
:
dic
[
@"msg"
]];
self
.
error
=
YES
;
}
// [ZXTool hideLoadingAnimation];
// [ZXTool hideLoadingAnimation];
[
SVProgressHUD
dismiss
];
}
failure
:^
(
AFHTTPRequestOperation
*
operation
,
NSError
*
error
)
{
self
.
error
=
YES
;
[
SVProgressHUD
dismiss
];
// [ZXTool hideLoadingAnimation];
// [ZXTool hideLoadingAnimation];
}];
}
-
(
void
)
save
{
[
self
loginOut
];
[
self
removeCache
];
NSUserDefaults
*
userDefaults
=
[
NSUserDefaults
standardUserDefaults
];
[
userDefaults
setObject
:
self
.
item
.
userId
forKey
:
@"userId"
];
[
userDefaults
setObject
:
self
.
item
.
token
forKey
:
@"token"
];
[
userDefaults
setObject
:
self
.
item
.
account
forKey
:
@"account"
];
[
userDefaults
setObject
:
self
.
item
.
campusId
forKey
:
@"campusId"
];
[
userDefaults
setObject
:
self
.
item
.
version
forKey
:
@"version"
];
// [userDefaults setObject:self.item.password forKey:@"passWord"];
// [userDefaults setObject:self.item.password forKey:@"passWord"];
[
userDefaults
setObject
:
self
.
item
.
idBar
forKey
:
@"idBar"
];
[
userDefaults
setObject
:
self
.
item
.
rechargeStatus
forKey
:
@"rechargeStatus"
];
...
...
@@ -79,8 +79,7 @@
NSLog
(
@"====%@"
,
CacheUserId
);
}
-
(
void
)
loginOut
{
-
(
void
)
removeCache
{
@try
{
NSUserDefaults
*
userDefaults
=
[
NSUserDefaults
standardUserDefaults
];
[
userDefaults
removeObjectForKey
:
@"userId"
];
...
...
@@ -118,4 +117,19 @@
}
}
-
(
void
)
loginOut
{
NSString
*
token
=
[
kUserDefaults
valueForKey
:
@"token"
];
if
(
token
)
{
[
XMCenter
sendRequest
:
^
(
XMRequest
*
request
)
{
request
.
url
=
[[
NSString
stringWithFormat
:
@"%@/app/customer/login/out?token=%@"
,
[
kUserDefaults
objectForKey
:
@"NEW_PAY"
],
[
kUserDefaults
valueForKey
:
@"token"
]]
stringByAddingPercentEscapesUsingEncoding
:
NSUTF8StringEncoding
];
request
.
httpMethod
=
kXMHTTPMethodGET
;
request
.
headers
=
@{
@"token"
:
token
,
@"reqSource"
:
@"app"
,
@"Content-Type"
:
@"application/json"
};
}
onSuccess
:
^
(
id
responseObject
)
{
}
onFailure
:^
(
NSError
*
error
)
{
}
onFinished
:^
(
id
responseObject
,
NSError
*
error
)
{
}];
}
[
self
removeCache
];
}
@end
ColorfulSchool/ColorfulSchool/Classes/Login(登录注册)/Login/Modle/ZXNewSchool.h
View file @
03a219ed
//
//
...
...
@@ -31,5 +31,7 @@ NS_ASSUME_NONNULL_BEGIN
@property
(
nonatomic
,
assign
)
NSInteger
schoolId
;
@property
(
nonatomic
,
copy
)
NSString
*
campusName
;
@property
(
nonatomic
,
assign
)
BOOL
isSelect
;
@property
(
nonatomic
,
copy
)
NSString
*
initial
;
@property
(
nonatomic
,
copy
)
NSString
*
areaName
;
@end
NS_ASSUME_NONNULL_END
ColorfulSchool/ColorfulSchool/Classes/Login(登录注册)/Login/Modle/ZXUserModel.h
0 → 100644
View file @
03a219ed
//
//
// ZXUserModel.h
// ColorfulSchool
//
// Created by liuZX on 2019/2/27.
// Copyright © 2019 Colorful Any Door. All rights reserved.
//
#import "JKDBModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface
ZXUserModel
:
JKDBModel
@property
(
nonatomic
,
assign
)
NSInteger
areaId
;
@property
(
nonatomic
,
copy
)
NSString
*
areaName
;
@property
(
nonatomic
,
copy
)
NSString
*
birthDay
;
@property
(
nonatomic
,
copy
)
NSString
*
createAt
;
@property
(
nonatomic
,
copy
)
NSString
*
createLoginDate
;
@property
(
nonatomic
,
assign
)
NSInteger
customerId
;
@property
(
nonatomic
,
copy
)
NSString
*
customerName
;
@property
(
nonatomic
,
copy
)
NSString
*
customerPhone
;
@property
(
nonatomic
,
copy
)
NSString
*
customerSex
;
//1男
@property
(
nonatomic
,
copy
)
NSString
*
customerType
;
//
@property
(
nonatomic
,
copy
)
NSString
*
entranceDate
;
@property
(
nonatomic
,
copy
)
NSString
*
idBar
;
@property
(
nonatomic
,
assign
)
NSInteger
isFirstRecharge
;
@property
(
nonatomic
,
copy
)
NSString
*
lastLoginDate
;
@property
(
nonatomic
,
copy
)
NSString
*
loginAccount
;
@property
(
nonatomic
,
copy
)
NSString
*
loginPwd
;
@property
(
nonatomic
,
copy
)
NSString
*
loginState
;
@property
(
nonatomic
,
copy
)
NSString
*
state
;
@property
(
nonatomic
,
copy
)
NSString
*
studentNo
;
@property
(
nonatomic
,
copy
)
NSString
*
token
;
@property
(
nonatomic
,
copy
)
NSString
*
updateAt
;
@property
(
nonatomic
,
copy
)
NSString
*
updateLoginDate
;
@property
(
nonatomic
,
assign
)
NSInteger
hardwareAccount
;
@property
(
nonatomic
,
assign
)
NSInteger
hardwarePwd
;
@property
(
nonatomic
,
assign
)
NSInteger
hardwareState
;
@property
(
nonatomic
,
copy
)
NSString
*
version
;
@property
(
nonatomic
,
copy
)
NSString
*
customerHead
;
@property
(
nonatomic
,
assign
)
NSInteger
isUploadLog
;
@property
(
nonatomic
,
copy
)
NSString
*
aimiMoney
;
@end
NS_ASSUME_NONNULL_END
ColorfulSchool/ColorfulSchool/Classes/Login(登录注册)/Login/Modle/ZXUserModel.m
0 → 100644
View file @
03a219ed
//
//
// ZXUserModel.m
// ColorfulSchool
//
// Created by liuZX on 2019/2/27.
// Copyright © 2019 Colorful Any Door. All rights reserved.
//
#import "ZXUserModel.h"
@implementation
ZXUserModel
@end
ColorfulSchool/ColorfulSchool/Classes/MineView(个人中心)/AboutUs/Controller/AboutUs.h
View file @
03a219ed
//
//
...
...
@@ -9,5 +9,6 @@
#import <UIKit/UIKit.h>
#import "PrefixHeader.pch"
@interface
AboutUs
:
UIViewController
//极简版跳转
@property
(
nonatomic
,
assign
)
BOOL
isFromSimple
;
@end
ColorfulSchool/ColorfulSchool/Classes/MineView(个人中心)/AboutUs/Controller/AboutUs.m
View file @
03a219ed
//
//
...
...
@@ -10,6 +10,7 @@
#import <WebKit/WebKit.h>
#import "AboutUsModel.h"
#import "ServerViewController.h"
#import "enlargeClickRegionBtn.h"
@interface
AboutUs
()
<
WKNavigationDelegate
,
WKUIDelegate
,
UIGestureRecognizerDelegate
>
@property
(
nonatomic
,
strong
)
WKWebView
*
webView
;
@property
(
nonatomic
,
strong
)
AboutUsModel
*
aboutModel
;
...
...
@@ -73,7 +74,7 @@
WKWebViewConfiguration
*
config
=
[
WKWebViewConfiguration
new
];
config
.
preferences
.
minimumFontSize
=
10
;
_webView
=
[[
WKWebView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
self
.
view
.
bounds
.
size
.
width
,
self
.
view
.
bounds
.
size
.
height
-
64
)
configuration
:
config
];
_webView
=
[[
WKWebView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
self
.
isFromSimple
?
kTopHeight
:
0
,
self
.
view
.
bounds
.
size
.
width
,
self
.
view
.
bounds
.
size
.
height
-
64
)
configuration
:
config
];
_webView
.
scrollView
.
showsVerticalScrollIndicator
=
NO
;
}
...
...
@@ -90,11 +91,55 @@
[
self
registNotificationAndKVO
];
[
_aboutModel
aboutUs
];
[
SVProgressHUD
show
];
[
self
initNavButtons
];
if
(
self
.
isFromSimple
)
{
[
self
createNabar
];
}
else
{
[
self
initNavButtons
];
}
}
#pragma mark - ========== 创建导航栏 ==========
-
(
void
)
createNabar
{
[
UIApplication
sharedApplication
].
statusBarHidden
=
NO
;
[
UIApplication
sharedApplication
].
statusBarStyle
=
UIStatusBarStyleLightContent
;
UIImage
*
image
=
[
UIImage
imageNamed
:
@"wash-bg"
];
UIImageView
*
nabar
=
[[
UIImageView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
kScreenWidth
,
kScreenWidth
*
image
.
size
.
height
/
image
.
size
.
width
)];
nabar
.
backgroundColor
=
[
UIColor
whiteColor
];
nabar
.
userInteractionEnabled
=
YES
;
nabar
.
image
=
image
;
[
self
.
view
addSubview
:
nabar
];
UILabel
*
naTitle
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
0
,
kStatusBarHeight
,
kScreenWidth
,
kNavBarHeight
)];
naTitle
.
backgroundColor
=
[
UIColor
clearColor
];
naTitle
.
textAlignment
=
NSTextAlignmentCenter
;
naTitle
.
textColor
=
[
UIColor
whiteColor
];
naTitle
.
font
=
[
UIFont
boldSystemFontOfSize
:
17
*
k6Scale
];
naTitle
.
userInteractionEnabled
=
YES
;
[
nabar
addSubview
:
naTitle
];
naTitle
.
text
=
@"关于多彩"
;
enlargeClickRegionBtn
*
back
=
[[
enlargeClickRegionBtn
alloc
]
init
];
[
back
setImage
:[
UIImage
imageNamed
:
@"nav_return"
]
forState
:
UIControlStateNormal
];
[
naTitle
addSubview
:
back
];
[
back
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
equalTo
(
naTitle
.
mas_left
).
offset
(
5
*
k6Scale
);
make
.
width
.
height
.
mas_equalTo
(
30
*
k6Scale
);
make
.
centerY
.
equalTo
(
naTitle
);
}];
__weak
typeof
(
self
)
weakSelf
=
self
;
[[
back
rac_signalForControlEvents
:
UIControlEventTouchDown
]
subscribeNext
:
^
(
id
x
)
{
[
weakSelf
.
navigationController
popViewControllerAnimated
:
YES
];
}];
}
-
(
void
)
viewWillDisappear
:
(
BOOL
)
animated
{
[
super
viewWillDisappear
:
animated
];
if
(
self
.
isFromSimple
)
{
self
.
navigationController
.
navigationBar
.
hidden
=
NO
;
[
UIApplication
sharedApplication
].
statusBarStyle
=
0
;
}
}
-
(
void
)
tap
{
// self.tapCount++;
// if (_tapCount==5) {
...
...
@@ -107,9 +152,14 @@
}
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
[
super
viewWillAppear
:
animated
];
[
UIApplication
sharedApplication
].
statusBarStyle
=
UIStatusBarStyleLightContent
;
[[
UIApplication
sharedApplication
]
setStatusBarHidden
:
NO
withAnimation
:
NO
];
super
.
navigationController
.
navigationBar
.
hidden
=
NO
;
if
(
self
.
isFromSimple
)
{
// self.navigationController.navigationBar.hidden = YES;
// self.navigationController.navigationBar.translucent = NO;
}
else
{
[
UIApplication
sharedApplication
].
statusBarStyle
=
UIStatusBarStyleLightContent
;
[[
UIApplication
sharedApplication
]
setStatusBarHidden
:
NO
withAnimation
:
NO
];
super
.
navigationController
.
navigationBar
.
hidden
=
NO
;
}
}
-
(
void
)
initNavButtons
...
...
ColorfulSchool/ColorfulSchool/Classes/MineView(个人中心)/AimiWallet/Controller/ZXConfirmPayViewController.m
View file @
03a219ed
//
//
...
...
@@ -244,15 +244,36 @@
}
}
else
{
NSURL
*
myURL_APP_A
=
[
NSURL
URLWithString
:
@"alipay:"
];
if
(
[[
UIApplication
sharedApplication
]
canOpenURL
:
myURL_APP_A
])
{
if
([
kApplication
canOpenURL
:
myURL_APP_A
]){
//应用注册scheme,在AlixPayDemo-Info.plist定义URL types
[[
AlipaySDK
defaultService
]
payOrder
:
aliData
fromScheme
:
@"pxxycn"
callback
:^
(
NSDictionary
*
resultDic
)
{
NSLog
(
@"reslut = %@"
,
resultDic
);
}];
}
else
{
UIAlertView
*
alertView
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"提示"
message
:
@"您没有安装支付宝"
delegate
:
self
cancelButtonTitle
:
@"知道了"
otherButtonTitles
:
nil
,
nil
];
[
alertView
show
];
//应用注册scheme,在AlixPayDemo-Info.plist定义URL types
[[
AlipaySDK
defaultService
]
payOrder
:
aliData
fromScheme
:
@"pxxycn"
callback
:^
(
NSDictionary
*
resultDic
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
NSInteger
result
=
[
resultDic
[
@"resultStatus"
]
integerValue
];
if
(
result
==
9000
)
{
// 支付成功
//说明完成首充
[
kUserDefaults
setObject
:
@"1"
forKey
:
@"rechargeStatus"
];
[
kUserDefaults
synchronize
];
[
self
paySuccessAndRefreshUserInfo
];
}
else
if
(
result
==
8000
)
{
//正在处理中
[
SVProgressHUD
showSuccessWithStatus
:
@"正在处理中"
];
}
else
{
//支付失败
[
SVProgressHUD
showErrorWithStatus
:
@"支付失败"
];
}
});
}];
}
}
}
...
...
ColorfulSchool/ColorfulSchool/Classes/MineView(个人中心)/FeedBack/Controller/FeedBackView.m
View file @
03a219ed
//
//
...
...
@@ -9,7 +9,7 @@
#import "FeedBackView.h"
#import "EmotionAlertView.h"
#import <CommonCrypto/CommonDigest.h>
@interface
FeedBackView
()
<
UITextViewDelegate
>
@interface
FeedBackView
()
<
UITextViewDelegate
,
GDTMobBannerViewDelegate
>
@property
(
nonatomic
)
EmotionAlertView
*
alert
;
@property
(
nonatomic
)
UIButton
*
confirmBtn
;
@end
...
...
@@ -22,6 +22,8 @@
[
super
viewDidLoad
];
[
self
initNavButtons
];
[
self
setViews
];
[[
ZXTXAdTool
sharedZXTXAdTool
]
createBannerAdByPlacmentId
:
@"1090852550236628"
currentViewController
:
self
superView
:
self
.
view
];
}
-
(
void
)
setViews
{
...
...
@@ -253,4 +255,5 @@
//返回一个长度为32的字符串
return
ret
;
}
@end
ColorfulSchool/ColorfulSchool/Classes/MineView(个人中心)/UserCenter/Controller/MineViewController.m
View file @
03a219ed
//
//
...
...
@@ -14,7 +14,8 @@
#import "AboutUs.h"
#import "AimiWalletViewController.h"
#import "ZXWebViewManager.h"
#import "ZXUserModel.h"
#import "LoginModel.h"
@interface
MineViewController
()
<
UITableViewDelegate
,
UITableViewDataSource
>
{
UITextField
*
field
;
...
...
@@ -25,49 +26,20 @@
@property
(
strong
,
nonatomic
)
NSArray
*
dataArray
;
@property
(
strong
,
nonatomic
)
NSArray
*
imageArray
;
@property
(
strong
,
nonatomic
)
UserCenterModel
*
userCenterModel
;
@property
(
strong
,
nonatomic
)
ZXUserModel
*
user
;
@end
@implementation
MineViewController
-
(
void
)
dealloc
{
[
self
removeNotificationAndKVO
];
}
-
(
void
)
registNotificationAndKVO
{
[
_userCenterModel
addObserver
:
self
forKeyPath
:
@"isLoaded"
options
:
NSKeyValueObservingOptionNew
context
:
nil
];
[
_userCenterModel
addObserver
:
self
forKeyPath
:
@"error"
options
:
NSKeyValueObservingOptionNew
context
:
nil
];
}
-
(
void
)
removeNotificationAndKVO
{
[
_userCenterModel
removeObserver
:
self
forKeyPath
:
@"isLoaded"
];
[
_userCenterModel
removeObserver
:
self
forKeyPath
:
@"error"
];
}
-
(
void
)
observeValueForKeyPath
:
(
NSString
*
)
keyPath
ofObject
:
(
id
)
object
change
:
(
NSDictionary
<
NSKeyValueChangeKey
,
id
>
*
)
change
context
:
(
void
*
)
context
{
if
(
object
==
_userCenterModel
)
{
if
([
keyPath
isEqualToString
:
@"isLoaded"
])
{
self
.
nameLabel
.
text
=
_userCenterModel
.
userCenterItem
.
username
;
self
.
countLabel
.
text
=
_userCenterModel
.
userCenterItem
.
account
;
}
else
{
}
}
}
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
[
self
loadData
];
self
.
userCenterModel
=
[
UserCenterModel
new
];
[
self
registNotificationAndKVO
];
self
.
tableView
.
delegate
=
self
;
self
.
tableView
.
dataSource
=
self
;
...
...
@@ -80,14 +52,70 @@
[
UIApplication
sharedApplication
].
statusBarHidden
=
NO
;
[
UIApplication
sharedApplication
].
statusBarStyle
=
1
;
self
.
tabBarController
.
tabBar
.
hidden
=
NO
;
dispatch_async
(
dispatch_get_global_queue
(
0
,
0
),
^
{
[
self
.
userCenterModel
fetchUserCenterData
];
});
self
.
navigationController
.
navigationBar
.
hidden
=
YES
;
[
ZXTool
loadAdInfoByAdId
:
@"2"
topView
:
self
.
tableView
superView
:
self
.
view
fromVc
:
self
];
}
[
self
refreshUserInfo
];
}
-
(
void
)
refreshUserInfo
{
NSString
*
token
=
[
kUserDefaults
valueForKey
:
@"token"
];
if
(
token
==
nil
)
{
token
=
@""
;
}
dispatch_async
(
dispatch_get_global_queue
(
0
,
0
),
^
{
@weakify
(
self
);
[
XMCenter
sendRequest
:
^
(
XMRequest
*
request
)
{
request
.
url
=
[[
NSString
stringWithFormat
:
@"%@/app/customer/login"
,
[
kUserDefaults
objectForKey
:
@"NEW_PAY"
]]
stringByAddingPercentEscapesUsingEncoding
:
NSUTF8StringEncoding
];
request
.
httpMethod
=
kXMHTTPMethodPOST
;
request
.
headers
=
@{
@"token"
:
token
,
@"reqSource"
:
@"app"
,
@"Content-Type"
:
@"application/json"
};
request
.
HttpBody
=
[[
ZXTool
dictionaryToJson
:@{
@"loginTime"
:
[
ZXTool
getCurrentTimeStamp
]}]
mj_JSONData
];
}
onSuccess
:
^
(
id
responseObject
)
{
CommonModel
*
common
=
[
CommonModel
mj_objectWithKeyValues
:
responseObject
];
@strongify
(
self
);
if
(
common
.
code
==
1000
)
{
ZXUserModel
*
user
=
[
ZXUserModel
mj_objectWithKeyValues
:
common
.
data
];
self
.
user
=
user
;
[
ZXUserModel
clearTable
];
[
user
save
];
[
self
saveUserInfo
:
user
];
dispatch_async
(
dispatch_get_main_queue
(),
^
{
self
.
nameLabel
.
text
=
self
.
user
.
customerName
;
self
.
countLabel
.
text
=
self
.
user
.
customerPhone
;
});
}
}
onFailure
:^
(
NSError
*
error
)
{
}
onFinished
:^
(
id
responseObject
,
NSError
*
error
)
{
}];
});
}
-
(
void
)
saveUserInfo
:
(
ZXUserModel
*
)
user
{
NSUserDefaults
*
userDefaults
=
[
NSUserDefaults
standardUserDefaults
];
[
userDefaults
setObject
:[
NSString
stringWithFormat
:
@"%ld"
,
user
.
customerId
]
forKey
:
@"userId"
];
[
userDefaults
setObject
:
user
.
token
forKey
:
@"token"
];
[
userDefaults
setObject
:
user
.
customerPhone
forKey
:
@"account"
];
[
userDefaults
setObject
:[
NSString
stringWithFormat
:
@"%ld"
,
user
.
areaId
]
forKey
:
@"campusId"
];
[
userDefaults
setObject
:
user
.
version
forKey
:
@"version"
];
[
userDefaults
setObject
:
user
.
loginPwd
forKey
:
@"passWord"
];
[
userDefaults
setObject
:
user
.
idBar
forKey
:
@"idBar"
];
[
userDefaults
setObject
:[
NSString
stringWithFormat
:
@"%ld"
,
user
.
isFirstRecharge
]
forKey
:
@"rechargeStatus"
];
[
userDefaults
setObject
:
user
.
birthDay
forKey
:
@"birthday"
];
[
userDefaults
setObject
:
user
.
areaName
forKey
:
@"campusName"
];
[
userDefaults
setObject
:
user
.
entranceDate
forKey
:
@"enterSchoolDate"
];
[
userDefaults
setObject
:[
user
.
customerSex
isEqualToString
:
@"1"
]?
@"male"
:
@"female"
forKey
:
@"gender"
];
[
userDefaults
setObject
:[
NSString
stringWithFormat
:
@"%ld"
,
user
.
hardwareAccount
]
forKey
:
@"sbaccount"
];
// [userDefaults setObject:self.item.schoolId forKey:@"schoolId"];
// [userDefaults setObject:self.item.schoolName forKey:@"schoolName"];
[
userDefaults
setObject
:
user
.
studentNo
forKey
:
@"studentNo"
];
[
userDefaults
setObject
:
user
.
customerName
forKey
:
@"username"
];
[
userDefaults
setObject
:
@
(
!
user
.
hardwareState
)
forKey
:
@"devPassSwitch"
];
[
userDefaults
setObject
:
@
(
user
.
isUploadLog
)
forKey
:
@"isUploadLog"
];
[
userDefaults
synchronize
];
NSLog
(
@"====%@"
,
CacheUserId
);
}
-
(
void
)
initNavButtons
{
...
...
@@ -164,7 +192,7 @@
-
(
IBAction
)
gotoUserCenterClick
:
(
id
)
sender
{
UserInfoViewController
*
VC
=
[
UserInfoViewController
new
];
VC
.
hidesBottomBarWhenPushed
=
YES
;
VC
.
user
CenterItem
=
self
.
userCenterModel
.
userCenterItem
;
VC
.
user
=
self
.
user
;
[
self
.
navigationController
pushViewController
:
VC
animated
:
YES
];
}
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
...
...
ColorfulSchool/ColorfulSchool/Classes/MineView(个人中心)/UserInfo/UserInfoViewController.h
View file @
03a219ed
//
//
...
...
@@ -7,9 +7,9 @@
//
#import <UIKit/UIKit.h>
#import "
UserCent
erModel.h"
#import "
ZXUs
erModel.h"
@interface
UserInfoViewController
:
UIViewController
@property
(
nonatomic
)
UserCenerModelItem
*
userCenterItem
;
@property
(
nonatomic
)
ZXUserModel
*
user
;
@end
ColorfulSchool/ColorfulSchool/Classes/MineView(个人中心)/UserInfo/UserInfoViewController.m
View file @
03a219ed
//
//
...
...
@@ -11,7 +11,8 @@
#import "FetchAllSchoolModel.h"
#import "SaveUserInfoModel.h"
#import "EmotionAlertView.h"
#import "ZXUserModel.h"
#import "LoginModel.h"
@interface
UserInfoViewController
()
<
UITableViewDataSource
,
UITableViewDelegate
,
ZHPickViewDelegate
,
UITextFieldDelegate
>
{
NSMutableArray
*
dataArray
;
...
...
@@ -63,92 +64,31 @@
@property
(
nonatomic
,
strong
)
ZHPickView
*
campusPicker
;
@property
(
nonatomic
,
strong
)
NSArray
*
allDataArray
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
schoolArray
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
campusArray
;
@property
(
nonatomic
,
strong
)
FetchAllSchoolModel
*
allSchoolModel
;
@property
(
nonatomic
,
strong
)
SaveUserInfoModel
*
saveModel
;
@property
(
nonatomic
)
EmotionAlertView
*
emotionAlert
;
@end
@implementation
UserInfoViewController
-
(
void
)
dealloc
{
[
self
removeNotificationAndKVO
];
}
-
(
void
)
registNotificationAndKVO
{
[
self
.
allSchoolModel
addObserver
:
self
forKeyPath
:
@"isLoaded"
options
:
NSKeyValueObservingOptionNew
context
:
nil
];
[
self
.
allSchoolModel
addObserver
:
self
forKeyPath
:
@"error"
options
:
NSKeyValueObservingOptionNew
context
:
nil
];
[
self
.
saveModel
addObserver
:
self
forKeyPath
:
@"isLoaded"
options
:
NSKeyValueObservingOptionNew
context
:
nil
];
[
self
.
saveModel
addObserver
:
self
forKeyPath
:
@"error"
options
:
NSKeyValueObservingOptionNew
context
:
nil
];
}
-
(
void
)
removeNotificationAndKVO
{
[
self
.
allSchoolModel
removeObserver
:
self
forKeyPath
:
@"isLoaded"
];
[
self
.
allSchoolModel
removeObserver
:
self
forKeyPath
:
@"error"
];
[
self
.
saveModel
removeObserver
:
self
forKeyPath
:
@"isLoaded"
];
[
self
.
saveModel
removeObserver
:
self
forKeyPath
:
@"error"
];
}
-
(
void
)
observeValueForKeyPath
:
(
NSString
*
)
keyPath
ofObject
:
(
id
)
object
change
:
(
NSDictionary
<
NSKeyValueChangeKey
,
id
>
*
)
change
context
:
(
void
*
)
context
{
if
(
object
==
self
.
allSchoolModel
)
{
if
([
keyPath
isEqualToString
:
@"isLoaded"
])
{
[
self
.
allSchoolModel
.
AllSchooListArray
enumerateObjectsUsingBlock
:
^
(
id
_Nonnull
obj
,
NSUInteger
idx
,
BOOL
*
_Nonnull
stop
)
{
SchoolItem
*
item
=
obj
;
[
_schoolArray
addObject
:
item
.
schoolName
];
}];
dispatch_async
(
dispatch_get_main_queue
(),
^
{
_schoolPicker
=
nil
;
_schoolPicker
=
[[
ZHPickView
alloc
]
initPickviewWithArray
:
_schoolArray
isHaveNavControler
:
YES
];
_schoolPicker
.
delegate
=
self
;
_schoolPicker
.
frame
=
CGRectMake
(
0
,
kHeight
-
_schoolPicker
.
frame
.
size
.
height
,
kWidth
,
_schoolPicker
.
frame
.
size
.
height
);
self
.
nameLabel
.
text
=
self
.
userCenterItem
.
username
;
});
}
else
{
}
}
if
(
object
==
self
.
saveModel
)
{
if
([
keyPath
isEqualToString
:
@"isLoaded"
])
{
self
.
nameLabel
.
text
=
self
.
userCenterItem
.
username
;
}
else
{
}
}
}
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
[
self
loadData
];
self
.
allSchoolModel
=
[
FetchAllSchoolModel
new
];
self
.
saveModel
=
[
SaveUserInfoModel
new
];
[
self
registNotificationAndKVO
];
_schoolArray
=
[[
NSMutableArray
alloc
]
init
];
_allDataArray
=
[[
NSArray
alloc
]
init
];
[
self
.
allSchoolModel
fetChAllSchool
];
self
.
tableView
.
delegate
=
self
;
self
.
tableView
.
dataSource
=
self
;
self
.
tableView
.
tableFooterView
=
[
UIView
new
];
self
.
nameLabel
.
text
=
self
.
user
CenterItem
.
usern
ame
;
self
.
countLabel
.
text
=
self
.
user
CenterItem
.
account
;
self
.
nameLabel
.
text
=
self
.
user
.
customerN
ame
;
self
.
countLabel
.
text
=
self
.
user
.
customerPhone
;
[
self
creatPick
];
}
...
...
@@ -199,10 +139,10 @@
sectionTitle
=
[[
NSMutableArray
alloc
]
initWithObjects
:
@"基本资料"
,
@"学校信息"
,
nil
];
NSArray
*
group1
;
if
([
self
.
user
CenterItem
.
version
isEqualToString
:
@"2"
])
{
if
([
self
.
user
.
version
isEqualToString
:
@"2"
])
{
if
([
self
.
user
CenterItem
.
us
erType
isEqualToString
:
@"teacher"
])
{
if
([
self
.
user
.
custom
erType
isEqualToString
:
@"teacher"
])
{
//教师账号
group1
=
@[
@"姓 名"
,
@"性 别"
,
@"出生日期"
,
@"设备账号"
];
...
...
@@ -213,7 +153,7 @@
}
else
{
if
([
self
.
user
CenterItem
.
us
erType
isEqualToString
:
@"teacher"
])
{
if
([
self
.
user
.
custom
erType
isEqualToString
:
@"teacher"
])
{
//教师账号
group1
=
@[
@"姓 名"
,
@"性 别"
,
@"出生日期"
];
}
...
...
@@ -225,13 +165,13 @@
}
NSArray
*
group2
;
if
([
self
.
user
CenterItem
.
us
erType
isEqualToString
:
@"teacher"
])
{
if
([
self
.
user
.
custom
erType
isEqualToString
:
@"teacher"
])
{
group2
=
@[
@"学 校"
,
@"校 区"
];
}
else
{
group2
=
@[
@"
学 校"
,
@"
校 区"
,
@"入学时间"
];
group2
=
@[
@"校 区"
,
@"入学时间"
];
}
dataArray
=
[[
NSMutableArray
alloc
]
initWithObjects
:
group1
,
group2
,
nil
];
...
...
@@ -298,7 +238,7 @@ heightForFooterInSection:(NSInteger)section
UIView
*
view
=
[
cell
viewWithTag
:
CellTag
+
indexPath
.
row
];
[
view
removeFromSuperview
];
if
(
indexPath
.
row
==
0
)
{
UITextField
*
nameTF
=
[
ZLControl
createzlTextFieldfont
:[
UIFont
systemFontOfSize
:
15
]
frame
:
CGRectMake
(
120
,
0
,
kWidth
-
100
,
44
)
secureEntry
:
NO
clearButtonMode
:
UITextFieldViewModeNever
TextAlignment
:
NSTextAlignmentLeft
placehoder
:
@""
text
:
self
.
user
CenterItem
.
usern
ame
textColor
:
[
UIColor
colorWithHexString
:
@"#1e1e1e"
]];
UITextField
*
nameTF
=
[
ZLControl
createzlTextFieldfont
:[
UIFont
systemFontOfSize
:
15
]
frame
:
CGRectMake
(
120
,
0
,
kWidth
-
100
,
44
)
secureEntry
:
NO
clearButtonMode
:
UITextFieldViewModeNever
TextAlignment
:
NSTextAlignmentLeft
placehoder
:
@""
text
:
self
.
user
.
customerN
ame
textColor
:
[
UIColor
colorWithHexString
:
@"#1e1e1e"
]];
nameTF
.
tag
=
CellTag
+
indexPath
.
row
;
nameTF
.
delegate
=
self
;
[
cell
addSubview
:
nameTF
];
...
...
@@ -307,13 +247,13 @@ heightForFooterInSection:(NSInteger)section
if
(
indexPath
.
row
==
1
)
{
NSString
*
sexStr
=
self
.
user
CenterItem
.
gender
;
if
([
sexStr
isEqualToString
:
@"
Male
"
])
NSString
*
sexStr
=
self
.
user
.
customerSex
;
if
([
sexStr
isEqualToString
:
@"
1
"
])
{
_setString
=
@"男"
;
}
if
([
sexStr
isEqualToString
:
@"
Female
"
])
if
([
sexStr
isEqualToString
:
@"
2
"
])
{
_setString
=
@"女"
;
}
...
...
@@ -323,23 +263,23 @@ heightForFooterInSection:(NSInteger)section
[
cell
addSubview
:
sexButton
];
}
if
(
indexPath
.
row
==
2
)
{
UIButton
*
birthDayBtn
=
[
ZLControl
createzlButtonWithtitleColor
:[
UIColor
colorWithHexString
:
@"#1e1e1e"
]
target
:
self
sel
:
@selector
(
choiceBirthdayFuc
)
event
:
UIControlEventTouchUpInside
backGroundImage
:
nil
image
:
nil
backGrondColor
:
nil
font
:
nil
frame
:
CGRectMake
(
120
,
0
,
kWidth
-
100
,
44
)
title
:
self
.
user
CenterItem
.
birthd
ay
];
UIButton
*
birthDayBtn
=
[
ZLControl
createzlButtonWithtitleColor
:[
UIColor
colorWithHexString
:
@"#1e1e1e"
]
target
:
self
sel
:
@selector
(
choiceBirthdayFuc
)
event
:
UIControlEventTouchUpInside
backGroundImage
:
nil
image
:
nil
backGrondColor
:
nil
font
:
nil
frame
:
CGRectMake
(
120
,
0
,
kWidth
-
100
,
44
)
title
:
self
.
user
.
birthD
ay
];
birthDayBtn
.
tag
=
CellTag
+
indexPath
.
row
;
birthDayBtn
.
contentHorizontalAlignment
=
UIControlContentHorizontalAlignmentLeft
;
[
cell
addSubview
:
birthDayBtn
];
}
if
([
self
.
user
CenterItem
.
us
erType
isEqualToString
:
@"teacher"
])
{
if
([
self
.
user
.
custom
erType
isEqualToString
:
@"teacher"
])
{
//教师账号
if
(
indexPath
.
row
==
3
)
{
//设备账号
UILabel
*
userIdLabel
=
[
ZLControl
createzlLabelWithtextColor
:[
UIColor
colorWithHexString
:
@"#b4b4b4"
]
frame
:
CGRectMake
(
120
,
0
,
kWidth
-
100
,
44
)
font
:
nil
backGroundColor
:
[
UIColor
whiteColor
]
TextAlignment
:
NSTextAlignmentLeft
text
:
self
.
userCenterItem
.
sbaccount
];
UILabel
*
userIdLabel
=
[
ZLControl
createzlLabelWithtextColor
:[
UIColor
colorWithHexString
:
@"#b4b4b4"
]
frame
:
CGRectMake
(
120
,
0
,
kWidth
-
100
,
44
)
font
:
nil
backGroundColor
:
[
UIColor
whiteColor
]
TextAlignment
:
NSTextAlignmentLeft
text
:
[
NSString
stringWithFormat
:
@"%ld"
,
self
.
user
.
hardwareAccount
]
];
userIdLabel
.
tag
=
CellTag
+
indexPath
.
row
;
[
cell
addSubview
:
userIdLabel
];
}
}
else
{
if
(
indexPath
.
row
==
3
)
{
UITextField
*
studenNo
=
[
ZLControl
createzlTextFieldfont
:[
UIFont
systemFontOfSize
:
15
]
frame
:
CGRectMake
(
120
,
0
,
kWidth
-
100
,
44
)
secureEntry
:
NO
clearButtonMode
:
UITextFieldViewModeNever
TextAlignment
:
NSTextAlignmentLeft
placehoder
:
@""
text
:
self
.
user
CenterItem
.
studentNo
textColor
:
[
UIColor
colorWithHexString
:
@"#1e1e1e"
]];
UITextField
*
studenNo
=
[
ZLControl
createzlTextFieldfont
:[
UIFont
systemFontOfSize
:
15
]
frame
:
CGRectMake
(
120
,
0
,
kWidth
-
100
,
44
)
secureEntry
:
NO
clearButtonMode
:
UITextFieldViewModeNever
TextAlignment
:
NSTextAlignmentLeft
placehoder
:
@""
text
:
self
.
user
.
studentNo
textColor
:
[
UIColor
colorWithHexString
:
@"#1e1e1e"
]];
studenNo
.
keyboardType
=
UIKeyboardTypeNumberPad
;
studenNo
.
tag
=
CellTag
+
indexPath
.
row
;
studenNo
.
delegate
=
self
;
...
...
@@ -347,7 +287,7 @@ heightForFooterInSection:(NSInteger)section
}
if
(
indexPath
.
row
==
4
)
{
//设备账号
UILabel
*
userIdLabel
=
[
ZLControl
createzlLabelWithtextColor
:[
UIColor
colorWithHexString
:
@"#b4b4b4"
]
frame
:
CGRectMake
(
120
,
0
,
kWidth
-
100
,
44
)
font
:
nil
backGroundColor
:
[
UIColor
whiteColor
]
TextAlignment
:
NSTextAlignmentLeft
text
:
self
.
userCenterItem
.
sbaccount
];
UILabel
*
userIdLabel
=
[
ZLControl
createzlLabelWithtextColor
:[
UIColor
colorWithHexString
:
@"#b4b4b4"
]
frame
:
CGRectMake
(
120
,
0
,
kWidth
-
100
,
44
)
font
:
nil
backGroundColor
:
[
UIColor
whiteColor
]
TextAlignment
:
NSTextAlignmentLeft
text
:
[
NSString
stringWithFormat
:
@"%ld"
,
self
.
user
.
hardwareAccount
]
];
userIdLabel
.
tag
=
CellTag
+
indexPath
.
row
;
[
cell
addSubview
:
userIdLabel
];
}
...
...
@@ -359,26 +299,26 @@ heightForFooterInSection:(NSInteger)section
CellTag
=
2000
;
UIView
*
view
=
[
cell
viewWithTag
:
CellTag
+
indexPath
.
row
];
[
view
removeFromSuperview
];
// if (indexPath.row==0) {
//
// UIButton * schoolNameBtn=[ZLControl createzlButtonWithtitleColor:[UIColor colorWithHexString:@"#b4b4b4"] target:self sel:@selector(choiceSchoollFuc) event:UIControlEventTouchUpInside backGroundImage:nil image:nil backGrondColor:nil font:nil frame:CGRectMake(120, 0, kWidth-132, 44) title:self.userCenterItem.schoolName];
// schoolNameBtn.tag=CellTag+indexPath.row;
//// schoolNameBtn.enabled=NO;
// schoolNameBtn.contentHorizontalAlignment=UIControlContentHorizontalAlignmentLeft ;
// [cell addSubview:schoolNameBtn];
//
// }
if
(
indexPath
.
row
==
0
)
{
UIButton
*
schoolNameBtn
=
[
ZLControl
createzlButtonWithtitleColor
:[
UIColor
colorWithHexString
:
@"#b4b4b4"
]
target
:
self
sel
:
@selector
(
choiceSchoollFuc
)
event
:
UIControlEventTouchUpInside
backGroundImage
:
nil
image
:
nil
backGrondColor
:
nil
font
:
nil
frame
:
CGRectMake
(
120
,
0
,
kWidth
-
132
,
44
)
title
:
self
.
userCenterItem
.
schoolName
];
schoolNameBtn
.
tag
=
CellTag
+
indexPath
.
row
;
// schoolNameBtn.enabled=NO;
schoolNameBtn
.
contentHorizontalAlignment
=
UIControlContentHorizontalAlignmentLeft
;
[
cell
addSubview
:
schoolNameBtn
];
}
if
(
indexPath
.
row
==
1
)
{
UIButton
*
CampusNameBtn
=
[
ZLControl
createzlButtonWithtitleColor
:[
UIColor
colorWithHexString
:
@"#b4b4b4"
]
target
:
self
sel
:
@selector
(
choiceCampusFuc
)
event
:
UIControlEventTouchUpInside
backGroundImage
:
nil
image
:
nil
backGrondColor
:
nil
font
:
nil
frame
:
CGRectMake
(
120
,
0
,
kWidth
-
132
,
44
)
title
:
self
.
userCenterItem
.
campusName
];
UIButton
*
CampusNameBtn
=
[
ZLControl
createzlButtonWithtitleColor
:[
UIColor
colorWithHexString
:
@"#b4b4b4"
]
target
:
self
sel
:
@selector
(
choiceCampusFuc
)
event
:
UIControlEventTouchUpInside
backGroundImage
:
nil
image
:
nil
backGrondColor
:
nil
font
:
nil
frame
:
CGRectMake
(
120
,
0
,
kWidth
-
132
,
44
)
title
:
self
.
user
.
areaName
];
CampusNameBtn
.
tag
=
CellTag
+
indexPath
.
row
;
CampusNameBtn
.
contentHorizontalAlignment
=
UIControlContentHorizontalAlignmentLeft
;
[
cell
addSubview
:
CampusNameBtn
];
}
if
(
indexPath
.
row
==
2
)
{
if
(
indexPath
.
row
==
1
)
{
UIButton
*
enterSchoolBtn
=
[
ZLControl
createzlButtonWithtitleColor
:[
UIColor
colorWithHexString
:
@"#1e1e1e"
]
target
:
self
sel
:
@selector
(
choiceEntranceFuc
)
event
:
UIControlEventTouchUpInside
backGroundImage
:
nil
image
:
nil
backGrondColor
:
nil
font
:
nil
frame
:
CGRectMake
(
120
,
0
,
kWidth
-
100
,
44
)
title
:
self
.
user
CenterItem
.
enterSchool
Date
];
UIButton
*
enterSchoolBtn
=
[
ZLControl
createzlButtonWithtitleColor
:[
UIColor
colorWithHexString
:
@"#1e1e1e"
]
target
:
self
sel
:
@selector
(
choiceEntranceFuc
)
event
:
UIControlEventTouchUpInside
backGroundImage
:
nil
image
:
nil
backGrondColor
:
nil
font
:
nil
frame
:
CGRectMake
(
120
,
0
,
kWidth
-
100
,
44
)
title
:
self
.
user
.
entrance
Date
];
enterSchoolBtn
.
tag
=
CellTag
+
indexPath
.
row
;
enterSchoolBtn
.
contentHorizontalAlignment
=
UIControlContentHorizontalAlignmentLeft
;
[
cell
addSubview
:
enterSchoolBtn
];
...
...
@@ -474,7 +414,7 @@ heightForFooterInSection:(NSInteger)section
{
[
choiceSex
removeFromSuperview
];
self
.
user
CenterItem
.
gender
=
@"Male
"
;
self
.
user
.
customerSex
=
@"1
"
;
[
self
.
tableView
reloadData
];
}
/*
...
...
@@ -483,7 +423,7 @@ heightForFooterInSection:(NSInteger)section
-
(
void
)
womenBtnFuc
{
[
choiceSex
removeFromSuperview
];
self
.
user
CenterItem
.
gender
=
@"Female
"
;
self
.
user
.
customerSex
=
@"2
"
;
[
self
.
tableView
reloadData
];
}
/*
...
...
@@ -543,48 +483,15 @@ heightForFooterInSection:(NSInteger)section
-
(
void
)
toobarDonBtnHaveClick
:
(
ZHPickView
*
)
pickView
resultString
:
(
NSString
*
)
resultString
{
if
(
_birthdayPicker
==
pickView
){
self
.
user
CenterItem
.
birthd
ay
=
[
resultString
substringToIndex
:
10
];
self
.
user
.
birthD
ay
=
[
resultString
substringToIndex
:
10
];
}
if
(
_inschooltimePicker
==
pickView
){
self
.
user
CenterItem
.
enterSchool
Date
=
[
resultString
substringToIndex
:
10
];
self
.
user
.
entrance
Date
=
[
resultString
substringToIndex
:
10
];
}
//选择学校
if
(
_schoolPicker
==
pickView
){
[
self
.
allSchoolModel
.
AllSchooListArray
enumerateObjectsUsingBlock
:
^
(
id
_Nonnull
obj
,
NSUInteger
idx
,
BOOL
*
_Nonnull
stop
)
{
SchoolItem
*
item
=
obj
;
if
([
resultString
isEqualToString
:
item
.
schoolName
])
{
self
.
userCenterItem
.
schoolName
=
resultString
;
[
item
.
campusList
enumerateObjectsUsingBlock
:
^
(
id
_Nonnull
obj
,
NSUInteger
idx
,
BOOL
*
_Nonnull
stop
)
{
campusItem
*
campusitem
=
obj
;
_campusArray
=
[[
NSMutableArray
alloc
]
init
];
[
_campusArray
addObject
:
campusitem
.
campusName
];
NSLog
(
@"+++%@"
,
campusitem
.
campusName
);
}];
dispatch_async
(
dispatch_get_main_queue
(),
^
{
_campusPicker
=
nil
;
_campusPicker
=
[[
ZHPickView
alloc
]
initPickviewWithArray
:
_campusArray
isHaveNavControler
:
YES
];
_campusPicker
.
frame
=
CGRectMake
(
0
,
kHeight
-
_campusPicker
.
frame
.
size
.
height
,
kWidth
,
_campusPicker
.
frame
.
size
.
height
);
_campusPicker
.
delegate
=
self
;
});
return
;
}
}];
}
//选择校区
if
(
_campusPicker
==
pickView
)
{
self
.
userCenterItem
.
campusName
=
resultString
;
}
[
self
.
tableView
reloadData
];
}
...
...
@@ -595,21 +502,21 @@ heightForFooterInSection:(NSInteger)section
-
(
void
)
textFieldDidEndEditing
:
(
UITextField
*
)
textField
{
if
(
textField
.
tag
==
1000
)
{
self
.
user
CenterItem
.
usern
ame
=
textField
.
text
;
self
.
user
.
customerN
ame
=
textField
.
text
;
if
(
textField
.
text
.
length
>
20
)
{
textField
.
text
=
[
textField
.
text
substringToIndex
:
19
];
self
.
user
CenterItem
.
usern
ame
=
[
textField
.
text
substringToIndex
:
19
];
self
.
user
.
customerN
ame
=
[
textField
.
text
substringToIndex
:
19
];
}
}
else
if
(
textField
.
tag
==
1003
){
self
.
user
CenterItem
.
studentNo
=
textField
.
text
;
self
.
user
.
studentNo
=
textField
.
text
;
}
}
-
(
void
)
confirmBtnFuc
{
if
([
BYHelp
stringContainsEmoji
:
self
.
user
CenterItem
.
usern
ame
])
{
if
([
BYHelp
stringContainsEmoji
:
self
.
user
.
customerN
ame
])
{
NSLog
(
@"含有表情"
);
if
(
_emotionAlert
!=
nil
)
{
[
_emotionAlert
removeFromSuperview
];
...
...
@@ -633,24 +540,24 @@ heightForFooterInSection:(NSInteger)section
}
else
{
NSLog
(
@"不含有表情"
);
}
if
(
self
.
user
CenterItem
.
usern
ame
.
length
==
0
)
{
if
(
self
.
user
.
customerN
ame
.
length
==
0
)
{
[
ZXTool
showText
:
@"用户名未填写"
];
return
;
}
if
(
self
.
user
CenterItem
.
gender
.
length
==
0
)
{
if
(
self
.
user
.
customerSex
.
length
==
0
)
{
[
ZXTool
showText
:
@"性别未填写"
];
return
;
}
if
(
self
.
user
CenterItem
.
birthd
ay
.
length
==
0
)
{
if
(
self
.
user
.
birthD
ay
.
length
==
0
)
{
[
ZXTool
showText
:
@"出生日期未填写"
];
return
;
}
if
(
!
[
self
.
user
CenterItem
.
us
erType
isEqualToString
:
@"teacher"
])
{
if
(
!
[
self
.
user
.
custom
erType
isEqualToString
:
@"teacher"
])
{
if
(
self
.
user
CenterItem
.
studentNo
.
length
==
0
)
{
if
(
self
.
user
.
studentNo
.
length
==
0
)
{
[
ZXTool
showText
:
@"学号未填写"
];
return
;
...
...
@@ -658,21 +565,10 @@ heightForFooterInSection:(NSInteger)section
}
}
if
(
self
.
userCenterItem
.
schoolName
.
length
==
0
)
{
[
ZXTool
showText
:
@"学校未填写"
];
return
;
}
if
(
self
.
userCenterItem
.
campusName
.
length
==
0
)
{
[
ZXTool
showText
:
@"校区未填写"
];
return
;
}
if
(
!
[
self
.
userCenterItem
.
userType
isEqualToString
:
@"teacher"
])
{
if
(
!
[
self
.
user
.
customerType
isEqualToString
:
@"teacher"
])
{
if
(
self
.
user
CenterItem
.
enterSchool
Date
.
length
==
0
)
{
if
(
self
.
user
.
entrance
Date
.
length
==
0
)
{
[
ZXTool
showText
:
@"入学时间未填写"
];
return
;
...
...
@@ -680,16 +576,59 @@ heightForFooterInSection:(NSInteger)section
}
}
//教师账号默认给个时间数据
if
([
self
.
user
CenterItem
.
us
erType
isEqualToString
:
@"teacher"
])
{
if
([
self
.
user
.
custom
erType
isEqualToString
:
@"teacher"
])
{
NSDateFormatter
*
formatter
=
[[
NSDateFormatter
alloc
]
init
];
formatter
.
dateFormat
=
@"yyyyMMddHHmmss"
;
NSString
*
timeStr
=
[
formatter
stringFromDate
:[
NSDate
date
]];
self
.
userCenterItem
.
enterSchoolDate
=
timeStr
;
}
[
self
.
saveModel
saveUserInfoWith
:
self
.
userCenterItem
];
self
.
user
.
entranceDate
=
timeStr
;
}
[
ZXTool
requestDataWithType
:
kXMHTTPMethodPOST
url
:[
NSString
stringWithFormat
:
@"%@/app/customer/perfection/customer"
,
[
kUserDefaults
valueForKey
:
@"NEW_PAY"
]]
para
:
@{
@"birthDay"
:
self
.
user
.
birthDay
,
@"customerId"
:
CacheUserId
,
@"customerName"
:
self
.
user
.
customerName
,
@"customerSex"
:
self
.
user
.
customerSex
,
@"entranceDate"
:
self
.
user
.
entranceDate
,
@"phoneAccount"
:
self
.
user
.
customerPhone
,
@"studentNo"
:
self
.
user
.
studentNo
}
completed
:^
(
CommonModel
*
common
,
NSString
*
error
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
ZXTool
hideLoadingAnimation
];
if
(
error
)
{
[
ZXTool
showText
:
error
];
}
else
{
ZXUserModel
*
user
=
[
ZXUserModel
mj_objectWithKeyValues
:
common
.
data
];
[
ZXUserModel
clearTable
];
[
user
save
];
[
self
saveUserInfo
:
user
];
[
ZXTool
showText
:
@"保存成功"
];
self
.
nameLabel
.
text
=
self
.
user
.
customerName
;
[
self
.
navigationController
popViewControllerAnimated
:
YES
];
}
});
}];
// [self.saveModel saveUserInfoWith:self.userCenterItem];
}
-
(
void
)
saveUserInfo
:
(
ZXUserModel
*
)
user
{
[[
LoginModel
new
]
removeCache
];
NSUserDefaults
*
userDefaults
=
[
NSUserDefaults
standardUserDefaults
];
[
userDefaults
setObject
:[
NSString
stringWithFormat
:
@"%ld"
,
user
.
customerId
]
forKey
:
@"userId"
];
[
userDefaults
setObject
:
user
.
token
forKey
:
@"token"
];
[
userDefaults
setObject
:
user
.
customerPhone
forKey
:
@"account"
];
[
userDefaults
setObject
:[
NSString
stringWithFormat
:
@"%ld"
,
user
.
areaId
]
forKey
:
@"campusId"
];
[
userDefaults
setObject
:
user
.
version
forKey
:
@"version"
];
[
userDefaults
setObject
:
user
.
loginPwd
forKey
:
@"passWord"
];
[
userDefaults
setObject
:
user
.
idBar
forKey
:
@"idBar"
];
[
userDefaults
setObject
:[
NSString
stringWithFormat
:
@"%ld"
,
user
.
isFirstRecharge
]
forKey
:
@"rechargeStatus"
];
[
userDefaults
setObject
:
user
.
birthDay
forKey
:
@"birthday"
];
[
userDefaults
setObject
:
user
.
areaName
forKey
:
@"campusName"
];
[
userDefaults
setObject
:
user
.
entranceDate
forKey
:
@"enterSchoolDate"
];
[
userDefaults
setObject
:[
user
.
customerSex
isEqualToString
:
@"1"
]?
@"male"
:
@"female"
forKey
:
@"gender"
];
[
userDefaults
setObject
:[
NSString
stringWithFormat
:
@"%ld"
,
user
.
hardwareAccount
]
forKey
:
@"sbaccount"
];
// [userDefaults setObject:self.item.schoolId forKey:@"schoolId"];
// [userDefaults setObject:self.item.schoolName forKey:@"schoolName"];
[
userDefaults
setObject
:
user
.
studentNo
forKey
:
@"studentNo"
];
[
userDefaults
setObject
:
user
.
customerName
forKey
:
@"username"
];
[
userDefaults
setObject
:
@
(
!
user
.
hardwareState
)
forKey
:
@"devPassSwitch"
];
[
userDefaults
setObject
:
@
(
user
.
isUploadLog
)
forKey
:
@"isUploadLog"
];
[
userDefaults
synchronize
];
NSLog
(
@"====%@"
,
CacheUserId
);
}
-
(
BOOL
)
textField
:
(
UITextField
*
)
textField
shouldChangeCharactersInRange
:
(
NSRange
)
range
replacementString
:
(
NSString
*
)
string
{
...
...
ColorfulSchool/ColorfulSchool/Classes/MineView(个人中心)/UserSetting/ChangePasswordAndPhone/Controller/updateViewController.m
View file @
03a219ed
//
//
...
...
@@ -26,13 +26,14 @@
}
@property
(
strong
,
nonatomic
)
IBOutlet
UILabel
*
firstLabel
;
@property
(
weak
,
nonatomic
)
IBOutlet
UIButton
*
confirmBtn
;
@property
(
strong
,
nonatomic
)
IBOutlet
UITextField
*
currentPassword
;
@property
(
strong
,
nonatomic
)
IBOutlet
UIButton
*
currentShowBtn
;
@property
(
strong
,
nonatomic
)
IBOutlet
UILabel
*
secondBlockLabel
;
@property
(
strong
,
nonatomic
)
IBOutlet
UITextField
*
seconBlockTextFeild1
;
@property
(
strong
,
nonatomic
)
IBOutlet
NSLayoutConstraint
*
secondBlockShowbtn1
;
@property
(
strong
,
nonatomic
)
IBOutlet
UIButton
*
showbtn1
;
@property
(
strong
,
nonatomic
)
IBOutlet
UITextField
*
secondBlockTextFeild2
;
...
...
@@ -47,95 +48,97 @@
@property
(
strong
,
nonatomic
)
IBOutlet
UITextField
*
phoneNumTextFeild
;
@property
(
strong
,
nonatomic
)
IBOutlet
UITextField
*
checkCodeTextFeild
;
@property
(
strong
,
nonatomic
)
ChangePassWordModel
*
changePwdModel
;
@property
(
strong
,
nonatomic
)
FetchCheckCodeModel
*
fetchCheckCodeModel
;
@property
(
strong
,
nonatomic
)
ChangePhoneModel
*
changePhoneNumModel
;
@property
(
strong
,
nonatomic
)
ChangeDevicePasswordModel
*
changeDevicePwdModel
;
//
@property (strong, nonatomic) ChangePassWordModel *changePwdModel;
//
@property (strong, nonatomic) FetchCheckCodeModel *fetchCheckCodeModel;
//
@property (strong, nonatomic) ChangePhoneModel *changePhoneNumModel;
//
@property (strong, nonatomic) ChangeDevicePasswordModel * changeDevicePwdModel;
@end
@implementation
updateViewController
-
(
void
)
dealloc
{
[
self
removeNotificationAndKVO
];
}
-
(
void
)
registNotificationAndKVO
{
[
_changePwdModel
addObserver
:
self
forKeyPath
:
@"isLoaded"
options
:
NSKeyValueObservingOptionNew
context
:
nil
];
[
_changePwdModel
addObserver
:
self
forKeyPath
:
@"error"
options
:
NSKeyValueObservingOptionNew
context
:
nil
];
[
_fetchCheckCodeModel
addObserver
:
self
forKeyPath
:
@"isLoaded"
options
:
NSKeyValueObservingOptionNew
context
:
nil
];
[
_fetchCheckCodeModel
addObserver
:
self
forKeyPath
:
@"error"
options
:
NSKeyValueObservingOptionNew
context
:
nil
];
[
_changePhoneNumModel
addObserver
:
self
forKeyPath
:
@"isLoaded"
options
:
NSKeyValueObservingOptionNew
context
:
nil
];
[
_changePhoneNumModel
addObserver
:
self
forKeyPath
:
@"error"
options
:
NSKeyValueObservingOptionNew
context
:
nil
];
[
_changeDevicePwdModel
addObserver
:
self
forKeyPath
:
@"isLoaded"
options
:
NSKeyValueObservingOptionNew
context
:
nil
];
[
_changeDevicePwdModel
addObserver
:
self
forKeyPath
:
@"error"
options
:
NSKeyValueObservingOptionNew
context
:
nil
];
}
-
(
void
)
removeNotificationAndKVO
{
[
_changePwdModel
removeObserver
:
self
forKeyPath
:
@"isLoaded"
];
[
_changePwdModel
removeObserver
:
self
forKeyPath
:
@"error"
];
[
_fetchCheckCodeModel
removeObserver
:
self
forKeyPath
:
@"isLoaded"
];
[
_fetchCheckCodeModel
removeObserver
:
self
forKeyPath
:
@"error"
];
[
_changePhoneNumModel
removeObserver
:
self
forKeyPath
:
@"isLoaded"
];
[
_changePhoneNumModel
removeObserver
:
self
forKeyPath
:
@"error"
];
[
_changeDevicePwdModel
removeObserver
:
self
forKeyPath
:
@"isLoaded"
];
[
_changeDevicePwdModel
removeObserver
:
self
forKeyPath
:
@"error"
];
}
-
(
void
)
observeValueForKeyPath
:
(
NSString
*
)
keyPath
ofObject
:
(
id
)
object
change
:
(
NSDictionary
<
NSKeyValueChangeKey
,
id
>
*
)
change
context
:
(
void
*
)
context
{
if
(
object
==
_changePwdModel
||
object
==
_changeDevicePwdModel
||
object
==
_changePhoneNumModel
)
{
if
([
keyPath
isEqualToString
:
@"isLoaded"
])
{
[
self
.
navigationController
popViewControllerAnimated
:
YES
];
}
else
{
}
}
if
(
object
==
_fetchCheckCodeModel
)
{
if
([
keyPath
isEqualToString
:
@"isLoaded"
])
{
if
(
timer
==
nil
)
{
_time
=
60
;
//当计时器开始计时时按钮点击是无效的;
_fetchCodeBtn
.
userInteractionEnabled
=
NO
;
[
_fetchCodeBtn
setTitle
:
@"(60)重新获取"
forState
:
UIControlStateNormal
];
timer
=
[
NSTimer
scheduledTimerWithTimeInterval
:
1
target
:
self
selector
:
@selector
(
changTimeShow
)
userInfo
:
nil
repeats
:
YES
];
}
//- (void)dealloc{
// [self removeNotificationAndKVO];
//}
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// [timer invalidate];
// timer = nil;
// });
//-(void)registNotificationAndKVO{
// [_changePwdModel addObserver:self forKeyPath:@"isLoaded" options:NSKeyValueObservingOptionNew context:nil];
// [_changePwdModel addObserver:self forKeyPath:@"error" options:NSKeyValueObservingOptionNew context:nil];
// [_fetchCheckCodeModel addObserver:self forKeyPath:@"isLoaded" options:NSKeyValueObservingOptionNew context:nil];
// [_fetchCheckCodeModel addObserver:self forKeyPath:@"error" options:NSKeyValueObservingOptionNew context:nil];
// [_changePhoneNumModel addObserver:self forKeyPath:@"isLoaded" options:NSKeyValueObservingOptionNew context:nil];
// [_changePhoneNumModel addObserver:self forKeyPath:@"error" options:NSKeyValueObservingOptionNew context:nil];
// [_changeDevicePwdModel addObserver:self forKeyPath:@"isLoaded" options:NSKeyValueObservingOptionNew context:nil];
// [_changeDevicePwdModel addObserver:self forKeyPath:@"error" options:NSKeyValueObservingOptionNew context:nil];
//
//
//}
}
else
{
}
}
}
//-(void)removeNotificationAndKVO{
//
// [_changePwdModel removeObserver:self forKeyPath:@"isLoaded"];
// [_changePwdModel removeObserver:self forKeyPath:@"error"];
// [_fetchCheckCodeModel removeObserver:self forKeyPath:@"isLoaded"];
// [_fetchCheckCodeModel removeObserver:self forKeyPath:@"error"];
// [_changePhoneNumModel removeObserver:self forKeyPath:@"isLoaded"];
// [_changePhoneNumModel removeObserver:self forKeyPath:@"error"];
// [_changeDevicePwdModel removeObserver:self forKeyPath:@"isLoaded"];
// [_changeDevicePwdModel removeObserver:self forKeyPath:@"error"];
//}
//-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context{
// if (object == _changePwdModel||object==_changeDevicePwdModel||object==_changePhoneNumModel) {
// if ([keyPath isEqualToString:@"isLoaded"]) {
// [self.navigationController popViewControllerAnimated:YES];
//
// }
// else{
//
//
// }
// }
// if (object == _fetchCheckCodeModel) {
// if ([keyPath isEqualToString:@"isLoaded"]) {
// if (timer==nil) {
// _time=60;
// //当计时器开始计时时按钮点击是无效的;
//
// _fetchCodeBtn.userInteractionEnabled=NO;
// [_fetchCodeBtn setTitle:@"(60)重新获取" forState:UIControlStateNormal];
//
// timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(changTimeShow) userInfo:nil repeats:YES];
//
// }
//
//// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
//// [timer invalidate];
//// timer = nil;
//// });
//
//
// }
// else{
//
//
// }
// }
//
//}
-
(
void
)
touchesBegan
:(
NSSet
<
UITouch
*>
*
)
touches
withEvent
:(
UIEvent
*
)
event
{
[
self
.
view
endEditing
:
YES
];
}
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
_changePwdModel
=
[
ChangePassWordModel
new
];
_fetchCheckCodeModel
=
[
FetchCheckCodeModel
new
];
_changePhoneNumModel
=
[
ChangePhoneModel
new
];
_changeDevicePwdModel
=
[
ChangeDevicePasswordModel
new
];
[
self
registNotificationAndKVO
];
//
_changePwdModel=[ChangePassWordModel new];
//
_fetchCheckCodeModel=[FetchCheckCodeModel new];
//
_changePhoneNumModel=[ChangePhoneModel new];
//
_changeDevicePwdModel=[ChangeDevicePasswordModel new];
//
[self registNotificationAndKVO];
[
self
setViews
];
// Do any additional setup after loading the view from its nib.
}
-
(
void
)
setViews
{
[
self
initNavButtons
];
self
.
confirmBtn
.
layer
.
cornerRadius
=
6
;
self
.
confirmBtn
.
layer
.
masksToBounds
=
YES
;
self
.
phoneNumTextFeild
.
delegate
=
self
;
_checkCodeTextFeild
.
delegate
=
self
;
_seconBlockTextFeild1
.
delegate
=
self
;
...
...
@@ -166,8 +169,9 @@
}
-
(
void
)
initNavButtons
{
UILabel
*
titleLabel
=
[
MCCustomizeControl
customizeLabel
:
self
.
titleStr
backgroundColor
:[
UIColor
clearColor
]
font
:
[
UIFont
boldSystemFontOfSize
:
MC_NAVBAR_TITLE_FONT_SIZE
]
textColor
:
[
UIColor
colorWithHexString
:
@"#f3f3f3"
]
textAlignment
:
NSTextAlignmentCenter
lineBreakMode
:
NSLineBreakByWordWrapping
];
self
.
navigationItem
.
titleView
=
titleLabel
;
// UILabel* titleLabel = [MCCustomizeControl customizeLabel: self.titleStr backgroundColor:[UIColor clearColor] font:[UIFont boldSystemFontOfSize:MC_NAVBAR_TITLE_FONT_SIZE] textColor:[UIColor colorWithHexString:@"#f3f3f3"] textAlignment:NSTextAlignmentCenter lineBreakMode:NSLineBreakByWordWrapping];
// self.navigationItem.titleView = titleLabel;
self
.
title
=
self
.
titleStr
;
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
...
...
@@ -208,12 +212,17 @@
}
-
(
IBAction
)
forgetPassword
:
(
id
)
sender
{
forgetPasswordViewController
*
VC
=
[
forgetPasswordViewController
new
];
@weakify
(
self
);
VC
.
backBlock
=
^
{
@strongify
(
self
);
self
.
navigationController
.
navigationBar
.
translucent
=
NO
;
};
[
self
.
navigationController
pushViewController
:
VC
animated
:
YES
];
}
-
(
IBAction
)
sureBtnClick
:
(
id
)
sender
{
[
SVProgressHUD
showWithStatus
:
@"正在提交,请稍后"
];
//[SVProgressHUD showWithStatus:@"正在提交,请稍后"];
[[
UIApplication
sharedApplication
].
keyWindow
endEditing
:
YES
];
if
([
self
.
titleStr
isEqualToString
:
@"更换手机账户"
])
{
if
(
!
[
BYHelp
isMobileNumber
:
_phoneNumTextFeild
.
text
])
//如果手机号码不是11位
...
...
@@ -222,7 +231,6 @@
return
;
}
[
self
changePhoneNumberMethod
];
}
...
...
@@ -267,7 +275,19 @@
//去掉首尾字符串空格;
NSString
*
str
=
[
_seconBlockTextFeild1
.
text
stringByTrimmingCharactersInSet
:[
NSCharacterSet
whitespaceCharacterSet
]];
[
_changeDevicePwdModel
changeDevicePasswordWithOldPassword
:
_currentPassword
.
text
newPassword
:
str
];
// [_changeDevicePwdModel changeDevicePasswordWithOldPassword:_currentPassword.text newPassword:str];
[
ZXTool
requestDataWithType
:
kXMHTTPMethodPOST
url
:[
NSString
stringWithFormat
:
@"%@/app/customer/hardware/pwd"
,
[
kUserDefaults
valueForKey
:
@"NEW_PAY"
]]
para
:
@{
@"customerId"
:
CacheUserId
,
@"oldPassword"
:
_currentPassword
.
text
,
@"password"
:
self
.
seconBlockTextFeild1
.
text
}
completed
:^
(
CommonModel
*
common
,
NSString
*
error
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
ZXTool
hideLoadingAnimation
];
if
(
error
)
{
[
ZXTool
showText
:
error
];
}
else
{
[
ZXTool
showText
:
@"设备密码修改成功"
];
[
self
.
navigationController
popViewControllerAnimated
:
YES
];
}
});
}];
}
else
{
//去掉首尾字符串空格;
NSString
*
str1
=
[
_seconBlockTextFeild1
.
text
stringByTrimmingCharactersInSet
:[
NSCharacterSet
whitespaceCharacterSet
]];
...
...
@@ -285,7 +305,19 @@
return
;
}
[
_changePwdModel
changePasswordWithOldPassword
:
self
.
currentPassword
.
text
newPassword
:
str1
];
// [_changePwdModel changePasswordWithOldPassword:self.currentPassword.text newPassword:str1];
[
ZXTool
requestDataWithType
:
kXMHTTPMethodPOST
url
:[
NSString
stringWithFormat
:
@"%@/app/customer/old/pwd"
,
[
kUserDefaults
valueForKey
:
@"NEW_PAY"
]]
para
:
@{
@"customerId"
:
CacheUserId
,
@"oldPassword"
:
_currentPassword
.
text
,
@"password"
:
_seconBlockTextFeild1
.
text
}
completed
:^
(
CommonModel
*
common
,
NSString
*
error
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
ZXTool
hideLoadingAnimation
];
if
(
error
)
{
[
ZXTool
showText
:
error
];
}
else
{
[
ZXTool
showText
:
@"登录密码修改成功"
];
[
self
.
navigationController
popViewControllerAnimated
:
YES
];
}
});
}];
}
}
...
...
@@ -296,8 +328,20 @@
[
SVProgressHUD
showErrorWithStatus
:
@"你有内容没有填写"
];
return
;
}
[
_changePhoneNumModel
changePhoneWithPhoneNum
:
_phoneNumTextFeild
.
text
oldPwd
:
_currentPassword
.
text
checkCode
:
_checkCodeTextFeild
.
text
];
//
// [_changePhoneNumModel changePhoneWithPhoneNum:_phoneNumTextFeild.text oldPwd:_currentPassword.text checkCode:_checkCodeTextFeild.text];
[
ZXTool
requestDataWithType
:
kXMHTTPMethodPOST
url
:[
NSString
stringWithFormat
:
@"%@/app/customer/phone/account/"
,
[
kUserDefaults
valueForKey
:
@"NEW_PAY"
]]
para
:
@{
@"customerId"
:
CacheUserId
,
@"password"
:
_currentPassword
.
text
,
@"phoneAccount"
:
_phoneNumTextFeild
.
text
,
@"verification"
:
_checkCodeTextFeild
.
text
}
completed
:^
(
CommonModel
*
common
,
NSString
*
error
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
ZXTool
hideLoadingAnimation
];
if
(
error
)
{
[
ZXTool
showText
:
error
];
}
else
{
[
ZXTool
showText
:
@"更换手机账号成功"
];
[
ZXTool
backToLogin
];
}
});
}];
}
-
(
IBAction
)
fetchCode
:
(
id
)
sender
{
...
...
@@ -308,21 +352,34 @@
return
;
}
__weak
typeof
(
self
)
weakSelf
=
self
;
codeView
=
[[
GraphicsCode
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
kWidth
,
kHeight
)
phoneNum
:
_phoneNumTextFeild
.
text
];
__weak
typeof
(
self
)
weakself
=
self
;
codeView
.
callBack
=
^
(
NSString
*
code
)
{
/*
获取验证码 //isTest是否需要校验手机号码是否已经注册1、验证、0不验证,(注册的时候,修改手机号的时候传1,其它传0)
*/
if
([
code
isEqualToString
:
@""
])
{
[
SVProgressHUD
showErrorWithStatus
:
@"未输入图形验证码"
];
return
;
}
[
weakSelf
.
fetchCheckCodeModel
fetchCheckCodeWithPhoneNum
:
weakSelf
.
phoneNumTextFeild
.
text
picNumDinamicNum
:
code
isTest
:
@"1"
];
[
weakself
initTimer
];
};
[
codeView
show
:
self
];
}
-
(
void
)
initTimer
{
if
(
timer
==
nil
)
{
_time
=
60
;
//当计时器开始计时时按钮点击是无效的;
_fetchCodeBtn
.
userInteractionEnabled
=
NO
;
[
_fetchCodeBtn
setTitle
:
@"(60)重新获取"
forState
:
UIControlStateNormal
];
timer
=
[
NSTimer
scheduledTimerWithTimeInterval
:
1
target
:
self
selector
:
@selector
(
changTimeShow
)
userInfo
:
nil
repeats
:
YES
];
}
}
-
(
void
)
viewWillDisappear
:
(
BOOL
)
animated
{
[
super
viewWillDisappear
:
animated
];
if
(
timer
!=
nil
)
{
[
timer
invalidate
];
timer
=
nil
;
}
}
#pragma mark 计时器调用事件;
-
(
void
)
changTimeShow
...
...
@@ -357,9 +414,7 @@
else
{
return
YES
;
}
}
else
if
(
textField
==
self
.
currentPassword
)
{
}
else
if
(
textField
==
self
.
currentPassword
)
{
if
(
range
.
location
>=
20
||
textField
.
text
.
length
+
string
.
length
>
20
)
{
...
...
ColorfulSchool/ColorfulSchool/Classes/MineView(个人中心)/UserSetting/ChangePasswordAndPhone/Controller/updateViewController.xib
View file @
03a219ed
<?xml
version="1.0" encoding="UTF-8"?>
<?xml
version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.XIB"
version=
"3.0"
toolsVersion=
"1
2121"
systemVersion=
"16B2657
"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
colorMatched=
"YES"
>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.XIB"
version=
"3.0"
toolsVersion=
"1
4460.31
"
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=
"1
2089
"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"1
4460.20
"
/>
<capability
name=
"documents saved in the Xcode 8 format"
minToolsVersion=
"8.0"
/>
</dependencies>
<objects>
...
...
@@ -13,6 +13,7 @@
<connections>
<outlet
property=
"PassWordSecondBlock"
destination=
"a6l-PE-bLw"
id=
"cwa-CY-bch"
/>
<outlet
property=
"checkCodeTextFeild"
destination=
"SGu-fs-swA"
id=
"yuf-g9-wmd"
/>
<outlet
property=
"confirmBtn"
destination=
"hJ7-1T-wCc"
id=
"hXs-95-5NF"
/>
<outlet
property=
"currentPassword"
destination=
"wpg-Y6-lru"
id=
"B42-ci-wSo"
/>
<outlet
property=
"currentShowBtn"
destination=
"fv9-7t-QW5"
id=
"RL9-eq-DPy"
/>
<outlet
property=
"fetchCodeBtn"
destination=
"n6l-Xx-Ty1"
id=
"OLr-WO-cDZ"
/>
...
...
@@ -22,7 +23,6 @@
<outlet
property=
"seconBlockTextFeild1"
destination=
"jft-sw-4es"
id=
"jcw-xr-brJ"
/>
<outlet
property=
"secondBlockLabel"
destination=
"vvF-GM-iua"
id=
"NxP-BI-0pX"
/>
<outlet
property=
"secondBlockShowBtn2"
destination=
"yrw-hN-5O0"
id=
"Xmz-4n-ArE"
/>
<outlet
property=
"secondBlockShowbtn1"
destination=
"cUD-T3-guc"
id=
"m21-EN-bRe"
/>
<outlet
property=
"secondBlockTextFeild2"
destination=
"hSh-lC-u8k"
id=
"rlq-dx-zBn"
/>
<outlet
property=
"showbtn1"
destination=
"tNW-0q-Zey"
id=
"dhE-OW-Kzl"
/>
<outlet
property=
"view"
destination=
"i5M-Pr-FkT"
id=
"sfx-zR-JGt"
/>
...
...
@@ -77,12 +77,6 @@
<constraint
firstAttribute=
"height"
constant=
"50"
id=
"kQL-j9-OOd"
/>
<constraint
firstItem=
"fv9-7t-QW5"
firstAttribute=
"centerY"
secondItem=
"uXV-ST-haw"
secondAttribute=
"centerY"
id=
"ux1-JB-hdT"
/>
</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=
"0.0"
alpha=
"0.0"
colorSpace=
"calibratedWhite"
/>
...
...
@@ -140,12 +134,6 @@
<constraint
firstAttribute=
"trailing"
secondItem=
"jft-sw-4es"
secondAttribute=
"trailing"
constant=
"50"
id=
"seC-TG-YFq"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"tNW-0q-Zey"
secondAttribute=
"trailing"
constant=
"10"
id=
"ur2-dS-xMY"
/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute
type=
"number"
keyPath=
"layer.cornerRadius"
>
<integer
key=
"value"
value=
"4"
/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute
type=
"boolean"
keyPath=
"layer.masksToBounds"
value=
"YES"
/>
</userDefinedRuntimeAttributes>
</view>
<view
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"zDJ-CA-vjV"
>
<rect
key=
"frame"
x=
"0.0"
y=
"120"
width=
"351"
height=
"50"
/>
...
...
@@ -179,12 +167,6 @@
<constraint
firstAttribute=
"height"
constant=
"50"
id=
"v18-mf-k1A"
/>
<constraint
firstItem=
"yrw-hN-5O0"
firstAttribute=
"centerY"
secondItem=
"zDJ-CA-vjV"
secondAttribute=
"centerY"
id=
"wdK-vk-GaO"
/>
</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=
"0.0"
alpha=
"0.0"
colorSpace=
"calibratedWhite"
/>
...
...
@@ -231,12 +213,6 @@
<constraint
firstItem=
"gKm-y7-Acl"
firstAttribute=
"leading"
secondItem=
"f92-Uc-YmZ"
secondAttribute=
"leading"
constant=
"10"
id=
"xM7-xX-A5P"
/>
<constraint
firstItem=
"gKm-y7-Acl"
firstAttribute=
"height"
secondItem=
"f92-Uc-YmZ"
secondAttribute=
"height"
id=
"y0t-p4-iTI"
/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute
type=
"number"
keyPath=
"layer.cornerRadius"
>
<integer
key=
"value"
value=
"4"
/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute
type=
"boolean"
keyPath=
"layer.masksToBounds"
value=
"YES"
/>
</userDefinedRuntimeAttributes>
</view>
<view
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"IpC-Mw-WNV"
>
<rect
key=
"frame"
x=
"0.0"
y=
"120"
width=
"351"
height=
"50"
/>
...
...
@@ -283,12 +259,6 @@
<constraint
firstItem=
"n6l-Xx-Ty1"
firstAttribute=
"height"
secondItem=
"IpC-Mw-WNV"
secondAttribute=
"height"
id=
"kMv-fY-DJR"
/>
<constraint
firstItem=
"SGu-fs-swA"
firstAttribute=
"centerY"
secondItem=
"IpC-Mw-WNV"
secondAttribute=
"centerY"
id=
"oTH-Be-888"
/>
</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=
"0.0"
alpha=
"0.0"
colorSpace=
"calibratedWhite"
/>
...
...
@@ -323,12 +293,6 @@
</constraints>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"16"
/>
<state
key=
"normal"
title=
"确 认"
backgroundImage=
"确定按钮.png"
/>
<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=
"sureBtnClick:"
destination=
"-1"
eventType=
"touchUpInside"
id=
"Cyd-Vy-1KT"
/>
</connections>
...
...
@@ -355,7 +319,7 @@
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute
type=
"boolean"
keyPath=
"keyPath"
value=
"YES"
/>
</userDefinedRuntimeAttributes>
<point
key=
"canvasLocation"
x=
"
32.5"
y=
"105.5
"
/>
<point
key=
"canvasLocation"
x=
"
-126"
y=
"113
"
/>
</view>
</objects>
<resources>
...
...
ColorfulSchool/ColorfulSchool/Classes/MineView(个人中心)/UserSetting/UserSet/Controller/UserSettingViewController.m
View file @
03a219ed
//
//
...
...
@@ -21,7 +21,9 @@
UILabel
*
cacheNum
;
UISwitch
*
switchButton
;
UISwitch
*
free_switch_Button
;
}
@property
(
nonatomic
,
assign
)
NSInteger
isOpenFreePay
;
@property
(
nonatomic
,
assign
)
NSInteger
totalSize
;
@property
(
strong
,
nonatomic
)
IBOutlet
UITableView
*
tableView
;
@property
(
strong
,
nonatomic
)
AllowEequipCountLoginModel
*
allowModel
;
...
...
@@ -59,6 +61,7 @@
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
self
.
isOpenFreePay
=
0
;
[
self
loadCache
];
[
self
loadData
];
[
self
initNavButtons
];
...
...
@@ -68,6 +71,9 @@
self
.
tableView
.
dataSource
=
self
;
self
.
tableView
.
tableFooterView
=
[
UIView
new
];
[
ZXTool
loadAdInfoByAdId
:
@"5"
topView
:
self
.
tableView
superView
:
self
.
view
fromVc
:
self
];
[
self
loadIsOpenFreePay
];
}
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
...
...
@@ -114,24 +120,42 @@
{
NSArray
*
group1
;
BOOL
isOpenFreePay
=
[[
kUserDefaults
valueForKey
:
@"isOpenFreePay"
]
isEqualToString
:
@"yes"
];
if
([
CacheVersion
isEqualToString
:
@"2"
])
{
group1
=
@[
@"app登录密码"
,
@"设备密码"
,
@"更换手机账户"
,
@"开启设备登录密码"
];
if
(
isOpenFreePay
)
{
group1
=
@[
@"app登录密码"
,
@"设备密码"
,
@"更换手机账户"
,
@"开启设备登录密码"
,
@"开启余额支付"
];
}
else
{
group1
=
@[
@"app登录密码"
,
@"设备密码"
,
@"更换手机账户"
,
@"开启设备登录密码"
];
}
}
else
{
group1
=
@[
@"app登录密码"
,
@"更换手机账户"
,
@"开启设备登录密码"
];
if
(
isOpenFreePay
)
{
group1
=
@[
@"app登录密码"
,
@"更换手机账户"
,
@"开启设备登录密码"
,
@"开启余额支付"
];
}
else
{
group1
=
@[
@"app登录密码"
,
@"更换手机账户"
,
@"开启设备登录密码"
];
}
}
NSArray
*
group2
=
@[
@"清理缓存"
,
@"退出登录"
];
NSArray
*
imagegroup1
;
if
([
CacheVersion
isEqualToString
:
@"2"
])
{
imagegroup1
=
@[
@"Passwordtwo.png"
,
@"设备.png"
,
@"app.png"
,
@"set_bar_code"
];
if
(
isOpenFreePay
)
{
imagegroup1
=
@[
@"Passwordtwo.png"
,
@"设备.png"
,
@"app.png"
,
@"set_bar_code"
,
@"icon_mianmi"
];
}
else
{
imagegroup1
=
@[
@"Passwordtwo.png"
,
@"设备.png"
,
@"app.png"
,
@"set_bar_code"
];
}
}
else
{
imagegroup1
=
@[
@"Passwordtwo.png"
,
@"app.png"
,
@"set_bar_code"
];
if
(
isOpenFreePay
)
{
imagegroup1
=
@[
@"Passwordtwo.png"
,
@"app.png"
,
@"set_bar_code"
,
@"icon_mianmi"
];
}
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
];
}
...
...
@@ -191,13 +215,17 @@ heightForFooterInSection:(NSInteger)section
if
([
CacheVersion
isEqualToString
:
@"2"
])
{
if
(
indexPath
.
section
==
0
&&
indexPath
.
row
==
3
){
[
self
addSwithWithCell
:
cell
];
}
else
{
}
else
if
(
indexPath
.
section
==
0
&&
indexPath
.
row
==
4
)
{
[
self
addFreeSwithWithCell
:
cell
];
}
else
{
cell
.
accessoryType
=
UITableViewCellAccessoryDisclosureIndicator
;
}
}
else
{
if
(
indexPath
.
section
==
0
&&
indexPath
.
row
==
2
){
[
self
addSwithWithCell
:
cell
];
}
else
{
}
else
if
(
indexPath
.
section
==
0
&&
indexPath
.
row
==
3
)
{
[
self
addFreeSwithWithCell
:
cell
];
}
else
{
cell
.
accessoryType
=
UITableViewCellAccessoryDisclosureIndicator
;
}
}
...
...
@@ -222,6 +250,53 @@ heightForFooterInSection:(NSInteger)section
}
return
cell
;
}
-
(
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关
NSInteger
is
=
[[
kUserDefaults
valueForKey
:
@"IS_OPEN_FREE_PAY"
]
integerValue
];
if
(
is
)
{
[
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
];
}
-
(
void
)
freeSwitchAction
:
(
id
)
sender
{
UISwitch
*
switchButton
=
(
UISwitch
*
)
sender
;
BOOL
isButtonOn
=
[
switchButton
isOn
];
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
;
}
});
}];
}
#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
)
addSwithWithCell
:
(
UITableViewCell
*
)
cell
{
if
(
switchButton
)
{
[
switchButton
removeFromSuperview
];
...
...
@@ -244,15 +319,30 @@ heightForFooterInSection:(NSInteger)section
{
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"
];
}
[
ZXTool
requestDataWithType
:
kXMHTTPMethodPUT
url
:[
NSString
stringWithFormat
:
@"%@/app/customer/switch/%@/%d"
,
[
kUserDefaults
valueForKey
:
@"NEW_PAY"
],
CacheUserId
,
isButtonOn
]
para
:
nil
completed
:^
(
CommonModel
*
common
,
NSString
*
error
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
ZXTool
hideLoadingAnimation
];
if
(
error
)
{
[
ZXTool
showText
:
error
];
}
else
{
if
(
isButtonOn
)
{
[
ZXTool
showText
:
@"开启设备登录密码成功"
];
}
else
{
[
ZXTool
showText
:
@"关闭设备登录密码成功"
];
}
}
});
}];
// if (isButtonOn) {
//// showSwitchValue.text = @"是";
//// 0开1关
// [self.allowModel AllowEquitLoginWithStatu:@"0"];
//
// }else {
//// showSwitchValue.text = @"否";
// [self.allowModel AllowEquitLoginWithStatu:@"1"];
// }
}
-
(
UIImage
*
)
OriginImage
:
(
UIImage
*
)
image
scaleToSize
:
(
CGSize
)
size
{
...
...
@@ -289,20 +379,16 @@ heightForFooterInSection:(NSInteger)section
[
self
exitBtnFuc
];
}
}
else
if
(
indexPath
.
section
==
0
)
{
NS
Array
*
tempArr
;
tempArr
=
dataArray
[
indexPath
.
section
];
NSString
*
s
=
(
tempArr
)[
indexPath
.
row
];
if
([
s
isEqualToString
:
@"开启设备登录密码"
])
{
return
;
}
else
if
(
indexPath
.
section
==
0
)
{
NSArray
*
tempArr
=
dataArray
[
indexPath
.
section
];
NS
String
*
s
=
tempArr
[
indexPath
.
row
]
;
if
(
!
[
s
isEqualToString
:
@"开启设备登录密码"
]
||
[
s
isEqualToString
:
@"钱包免密支付"
])
{
//app登录密码
updateViewController
*
VC
=
[[
updateViewController
alloc
]
init
];
VC
.
titleStr
=
s
;
[
self
.
navigationController
pushViewController
:
VC
animated
:
YES
]
;
}
//app登录密码
updateViewController
*
VC
=
[[
updateViewController
alloc
]
init
];
VC
.
titleStr
=
s
;
[
self
.
navigationController
pushViewController
:
VC
animated
:
YES
];
}
}
/*
...
...
ColorfulSchool/ColorfulSchool/Classes/NewFirstPage(新版首页)/Controllers/ZTHomeViewController.m
View file @
03a219ed
//
//
...
...
@@ -336,20 +336,24 @@ static NSInteger seq = 0;
[
self
.
myTableView
reloadData
];
}];
});
[
ZXTool
firstPageRefreshAddNotPayView
];
[
ZXTool
firstPageRefreshAddNotPayView
:
self
.
view
];
}
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
[
super
viewWillAppear
:
animated
];
[
UIApplication
sharedApplication
].
statusBarHidden
=
NO
;
[
self
.
navigationController
.
navigationBar
setHidden
:
YES
];
[
self
.
tabBarController
.
tabBar
setHidden
:
NO
];
if
([[
kUserDefaults
valueForKey
:
@"isUploadLog"
]
integerValue
])
{
dispatch_async
(
dispatch_get_global_queue
(
0
,
0
),
^
{
NSArray
*
list
=
[
ExpecptionModel
findByCriteria
:[
NSString
stringWithFormat
:
@"where uploadStatus <> 1"
]];
if
(
list
.
count
)
{
[
self
uploadExpectionWithList
:
list
];
}
});
}
else
{
[
ExpecptionModel
clearTable
];
}
dispatch_async
(
dispatch_get_global_queue
(
0
,
0
),
^
{
NSArray
*
list
=
[
ExpecptionModel
findAll
];
if
([[
kUserDefaults
valueForKey
:
@"isUploadLog"
]
integerValue
]
&&
list
.
count
)
{
[
self
uploadExpectionWithList
:
list
];
}
});
[
self
oldVersion
];
}
...
...
ColorfulSchool/ColorfulSchool/Classes/NewFirstPage(新版首页)/ViewModel/ZXFirstPageService.m
View file @
03a219ed
//
//
...
...
@@ -131,7 +131,7 @@
}
#pragma mark - ========== 从网络拉取最新数据 并缓存 ==========
-
(
void
)
loadDataFromWeb
{
-
(
void
)
loadDataFromWeb
Completed
:
(
dispatch_block_t
)
completed
{
NSString
*
userId
=
[
kUserDefaults
valueForKey
:
@"userId"
];
NSString
*
campusId
=
[
kUserDefaults
valueForKey
:
@"campusId"
];
NSString
*
prefix
=
[
kUserDefaults
valueForKey
:
@"h5FirstPageAPI"
];
...
...
@@ -182,11 +182,10 @@
}
}
}
}
else
if
(([
responseObject
[
@"code"
]
integerValue
]
==
-
2
))
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
ZXTool
hideLoadingAnimation
];
[
self
exitLoginWithMsg
:
responseObject
[
@"msg"
]];
completed
();
});
}
else
if
(([
responseObject
[
@"code"
]
integerValue
]
==
-
2
))
{
}
}
onFailure
:^
(
NSError
*
error
)
{
...
...
@@ -222,7 +221,7 @@
}
[
self
.
sections
removeAllObjects
];
//清空
[
self
.
sections
addObjectsFromArray
:
list
];
[
self
loadDataFromWeb
];
//单独从网络拉取最新数据并缓存
[
self
loadDataFromWeb
Completed
:
completed
];
//单独从网络拉取最新数据并缓存
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
ZXTool
hideLoadingAnimation
];
completed
();
...
...
ColorfulSchool/ColorfulSchool/Classes/Operation(自助服务)/2.0条码/ZXSelfHelpViewController.m
View file @
03a219ed
//
//
...
...
@@ -58,20 +58,20 @@
CGFloat
brite
=
[[
kUserDefaults
objectForKey
:
@"defaultBright"
]
floatValue
];
[[
UIScreen
mainScreen
]
setBrightness
:
brite
];
[
self
removeNotificationAndKVO
];
// self.cycleScrollView = nil;
// self.barCodeModel = nil;
// functionView = nil;
// functionView1 = nil;
// self.changeBtn = nil;
// self.codeImageView = nil;
// self.codeImageView1 = nil;
// codeBarbackGroundImage = nil;
// codeBarbackGroundImage1 = nil;
// scaleBtnImageView = nil;
// scaleBtnImageView1 = nil;
// scaleBtn = nil;
// scaleBtn1 = nil;
// showCode = nil;
// self.cycleScrollView = nil;
// self.barCodeModel = nil;
// functionView = nil;
// functionView1 = nil;
// self.changeBtn = nil;
// self.codeImageView = nil;
// self.codeImageView1 = nil;
// codeBarbackGroundImage = nil;
// codeBarbackGroundImage1 = nil;
// scaleBtnImageView = nil;
// scaleBtnImageView1 = nil;
// scaleBtn = nil;
// scaleBtn1 = nil;
// showCode = nil;
NSLog
(
@"已经清理所有的绑定"
);
// @try {
...
...
@@ -165,6 +165,8 @@
}
@finally
{
}
}
-
(
void
)
observeValueForKeyPath
:
(
NSString
*
)
keyPath
ofObject
:
(
id
)
object
change
:
(
NSDictionary
<
NSKeyValueChangeKey
,
id
>
*
)
change
context
:
(
void
*
)
context
{
...
...
ColorfulSchool/ColorfulSchool/Classes/RSAD(瑞狮)/ZXRSNewViewController.m
View file @
03a219ed
//
//
...
...
@@ -165,7 +165,7 @@ static NSInteger seq = 0;
//发送通知
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
@"RS_SHOWMANAGERVIEWCONROLLER"
object
:
nil
];
}
[
ZXTool
firstPageRefreshAddNotPayView
:
self
.
view
];
//老版本部分
[
self
oldVersion
];
}
...
...
@@ -253,7 +253,7 @@ static NSInteger seq = 0;
self
.
offset
=
@""
;
[
self
loadNews
];
[
ZXTool
firstPageRefreshAddNotPayView
];
[
ZXTool
firstPageRefreshAddNotPayView
:
self
.
view
];
}
#pragma mark - ========== 加载广告内容 ==========
-
(
void
)
loadAdWithADCompleted
:
(
rsFristResponse
)
completed
{
...
...
ColorfulSchool/ColorfulSchool/Classes/TX广告/ZXTXAdTool.h
View file @
03a219ed
//
//
...
...
@@ -29,6 +29,9 @@ kSINGLETON_FOR_HEADER(ZXTXAdTool)
viewController
:
(
UIViewController
*
)
viewController
isFirstPage
:
(
BOOL
)
isFirstPage
isHasBottomMargin
:
(
BOOL
)
isHasBottomMargin
;
/**banner广告*/
-
(
void
)
createBannerAdByPlacmentId
:(
NSString
*
)
placenmentId
currentViewController
:
(
UIViewController
*
)
viewController
superView
:
(
UIView
*
)
superView
;
@property
(
nonatomic
,
copy
)
dispatch_block_t
closeAction
;
@property
(
nonatomic
,
copy
)
deleteRsAdBlock
closeRsAdAction
;
@end
...
...
ColorfulSchool/ColorfulSchool/Classes/TX广告/ZXTXAdTool.m
View file @
03a219ed
//
//
...
...
@@ -9,7 +9,7 @@
#import "ZXTXAdTool.h"
#import <GDTSDKDefines.h>
@interface
ZXTXAdTool
()
<
GDTSplashAdDelegate
,
GDTNativeExpressAdDelegete
>
@interface
ZXTXAdTool
()
<
GDTSplashAdDelegate
,
GDTNativeExpressAdDelegete
,
GDTMobBannerViewDelegate
>
//开屏广告
@property
(
strong
,
nonatomic
)
GDTSplashAd
*
splash
;
//原生广告
...
...
@@ -17,6 +17,8 @@
//原生广告内容
@property
(
nonatomic
,
strong
)
GDTNativeAdData
*
currentAdData
;
//banner广告
@property
(
nonatomic
,
strong
)
GDTMobBannerView
*
bannerView
;
@property
(
nonatomic
,
weak
)
UIView
*
adView
;
@property
(
nonatomic
,
weak
)
UIView
*
topView
;
...
...
@@ -323,4 +325,86 @@ kSINGLETON_FOR_CLASS(ZXTXAdTool)
}
}
#pragma mark - ========== banner广告部分 ==========
-
(
void
)
createBannerAdByPlacmentId
:
(
NSString
*
)
placenmentId
currentViewController
:
(
UIViewController
*
)
viewController
superView
:
(
UIView
*
)
superView
{
CGRect
rect
=
{
CGPointZero
,
GDTMOB_AD_SUGGEST_SIZE_320x50
};
self
.
bannerView
=
[[
GDTMobBannerView
alloc
]
initWithFrame
:
rect
appId
:
kTXAdAPPID
placementId
:
placenmentId
];
self
.
bannerView
.
currentViewController
=
viewController
;
self
.
bannerView
.
interval
=
40
;
self
.
bannerView
.
delegate
=
self
;
self
.
bannerView
.
showCloseBtn
=
YES
;
[
superView
addSubview
:
self
.
bannerView
];
[
superView
bringSubviewToFront
:
self
.
bannerView
];
[
self
.
bannerView
mas_remakeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
right
.
bottom
.
equalTo
(
superView
);
make
.
height
.
mas_equalTo
(
50
);
}];
[
self
loadBannerView
];
}
-
(
void
)
removeBannerAd
{
[
self
.
bannerView
removeFromSuperview
];
self
.
bannerView
=
nil
;
}
-
(
void
)
loadBannerView
{
[
self
.
bannerView
loadAdAndShow
];
}
#pragma mark - GDTMobBannerViewDelegate
// 请求广告条数据成功后调用
//
// 详解:当接收服务器返回的广告数据成功后调用该函数
-
(
void
)
bannerViewDidReceived
{
NSLog
(
@"banner Received"
);
}
// 请求广告条数据失败后调用
//
// 详解:当接收服务器返回的广告数据失败后调用该函数
-
(
void
)
bannerViewFailToReceived
:
(
NSError
*
)
error
{
NSLog
(
@"banner failed to Received : %@"
,
error
);
}
// 广告栏被点击后调用
//
// 详解:当接收到广告栏被点击事件后调用该函数
-
(
void
)
bannerViewClicked
{
NSLog
(
@"banner clicked"
);
}
// 应用进入后台时调用
//
// 详解:当点击下载或者地图类型广告时,会调用系统程序打开,
// 应用将被自动切换到后台
-
(
void
)
bannerViewWillLeaveApplication
{
NSLog
(
@"banner leave application"
);
}
-
(
void
)
bannerViewDidDismissFullScreenModal
{
NSLog
(
@"%s"
,
__FUNCTION__
);
}
-
(
void
)
bannerViewWillDismissFullScreenModal
{
NSLog
(
@"%s"
,
__FUNCTION__
);
}
-
(
void
)
bannerViewWillPresentFullScreenModal
{
NSLog
(
@"%s"
,
__FUNCTION__
);
}
-
(
void
)
bannerViewDidPresentFullScreenModal
{
NSLog
(
@"%s"
,
__FUNCTION__
);
}
@end
ColorfulSchool/ColorfulSchool/Classes/Tool(工具)/ZXTool.h
View file @
03a219ed
//
//
...
...
@@ -123,7 +123,7 @@ typedef void(^loginSuccessJump)(NSString *jump);
+
(
void
)
showNotPayOrderMaskView
:(
UIViewController
*
)
viewController
;
+
(
NSString
*
)
returnUserAgent
;
+
(
void
)
firstPageRefreshAddNotPayView
;
+
(
void
)
firstPageRefreshAddNotPayView
:(
UIView
*
)
v
;
+
(
NSString
*
)
formatNewDBDate
:(
NSString
*
)
dateStr
;
///*
...
...
ColorfulSchool/ColorfulSchool/Classes/Tool(工具)/ZXTool.m
View file @
03a219ed
//
//
...
...
@@ -602,7 +602,9 @@ void ProviderReleaseData (void *info, const void *data, size_t size){
+
(
void
)
requestDataWithType
:
(
XMHTTPMethodType
)
type
url
:
(
NSString
*
)
url
para
:
(
NSDictionary
*
)
p
completed
:
(
completed
)
completedBlock
{
NSString
*
token
=
[
kUserDefaults
valueForKey
:
@"token"
];
if
(
token
==
nil
)
{
token
=
@""
;
}
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
ZXTool
showLoadingAnimation
];
});
...
...
@@ -881,6 +883,7 @@ void ProviderReleaseData (void *info, const void *data, size_t size){
topView
:
(
UIView
*
)
topView
superView
:
(
UIView
*
)
superView
fromVc
:
(
UIViewController
*
)
viewController
{
NSArray
*
arr
=
@[
@"2"
,
@"3"
,
@"4"
,
@"5"
,
@"9"
];
BOOL
isFloat
=
!
[
arr
containsObject
:
adId
];
//是否悬浮广告
BOOL
isHasBottomMargin
=
([
adId
isEqualToString
:
@"2"
]
||
[
adId
isEqualToString
:
@"1"
]);
...
...
@@ -963,13 +966,12 @@ void ProviderReleaseData (void *info, const void *data, size_t size){
if
(
list
==
nil
||
list
.
count
==
0
)
{
return
;
}
dispatch_async
(
dispatch_get_main_queue
(),
^
{
for
(
UIView
*
v
in
superView
.
subviews
)
{
if
([
v
isKindOfClass
:[
ZXCustomAdView
class
]])
{
[
v
removeFromSuperview
];
}
for
(
UIView
*
v
in
superView
.
subviews
)
{
if
([
v
isKindOfClass
:[
ZXCustomAdView
class
]])
{
[
v
removeFromSuperview
];
}
}
);
}
ZXCustomAdView
*
ad
=
[[
ZXCustomAdView
alloc
]
initWithType
:
isFloat
items
:
list
];
if
(
isFloat
)
{
[
superView
addSubview
:
ad
];
...
...
@@ -990,28 +992,25 @@ void ProviderReleaseData (void *info, const void *data, size_t size){
make
.
bottom
.
equalTo
(
superView
.
mas_bottom
);
}];
}
return
;
}
if
([
topView
isKindOfClass
:[
UIButton
class
]])
{
if
([
topView
isKindOfClass
:[
UIButton
class
]]
||
[
topView
isKindOfClass
:
NSClassFromString
(
@"SDCycleScrollView"
)]
)
{
[
superView
addSubview
:
ad
];
[
ad
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
right
.
bottom
.
equalTo
(
superView
);
make
.
top
.
equalTo
(
topView
.
mas_bottom
).
offset
(
20
*
k6Scale
);
}];
}
else
if
([
topView
isKindOfClass
:[
WKWebView
class
]])
{
[
superView
addSubview
:
ad
];
[
ad
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
edges
.
equalTo
(
topView
);
make
.
top
.
equalTo
(
topView
.
mas_bottom
).
offset
(
10
*
k6Scale
);
}];
}
else
{
UITableView
*
tab
=
(
UITableView
*
)
topView
;
UITableView
*
tab
;
if
([
topView
isKindOfClass
:[
UITableView
class
]])
{
tab
=
(
UITableView
*
)
topView
;
}
UIView
*
v
=
[[
UIView
alloc
]
init
];
v
.
backgroundColor
=
[
UIColor
clearColor
];
[
superView
insertSubview
:
v
belowSubview
:
topView
];
[
v
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
right
.
bottom
.
equalTo
(
superView
);
make
.
top
.
equalTo
(
tab
.
tableFooterView
);
make
.
top
.
equalTo
(
tab
?
tab
.
tableFooterView
:
topView
.
mas_bottom
);
}];
[
v
layoutIfNeeded
];
if
(
isHasBottomMargin
)
{
...
...
@@ -1027,7 +1026,24 @@ void ProviderReleaseData (void *info, const void *data, size_t size){
}
}
#pragma mark - ========== 首页下拉刷新显示未支付订单 ==========
+
(
void
)
firstPageRefreshAddNotPayView
{
+
(
void
)
firstPageRefreshAddNotPayView
:
(
UIView
*
)
v
{
if
([
ZXPayManager
sharedZXPayManager
].
notPayOrderView
==
nil
)
{
UIView
*
notPayView
;
CGFloat
bottomMargin
=
49
;
if
(
iPhoneX
)
{
bottomMargin
=
83
;
}
notPayView
=
[[
UIView
alloc
]
init
];
notPayView
.
backgroundColor
=
[
UIColor
whiteColor
];
[
v
addSubview
:
notPayView
];
[
notPayView
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
right
.
equalTo
(
v
);
make
.
height
.
mas_equalTo
(
0
*
k6Scale
);
make
.
bottom
.
equalTo
(
v
.
mas_bottom
).
offset
(
-
bottomMargin
);
}];
[
ZXPayManager
sharedZXPayManager
].
notPayOrderView
=
notPayView
;
[
self
createNotPayOrderView
:
notPayView
];
//创建广告view
}
if
([
ZXNotPay
findByCriteria
:[
NSString
stringWithFormat
:
@"where userId = '%@'"
,
CacheUserId
]].
count
)
{
ZXNotPay
*
m
=
[
ZXNotPay
findByCriteria
:[
NSString
stringWithFormat
:
@"where userId = '%@'"
,
CacheUserId
]].
lastObject
;
[
ZXPayManager
sharedZXPayManager
].
orderId
=
m
.
orderId
;
...
...
@@ -1037,37 +1053,11 @@ void ProviderReleaseData (void *info, const void *data, size_t size){
}];
});
}
else
{
//请求未支付订单数据
NSString
*
url
=
[
NSString
stringWithFormat
:
@"%@/consumeOrder/getUnpaidOrder?customerId=%@"
,
[
kUserDefaults
objectForKey
:
@"NEW_PAY"
],
CacheUserId
];
[
XMCenter
sendRequest
:
^
(
XMRequest
*
request
)
{
request
.
url
=
[
url
stringByAddingPercentEscapesUsingEncoding
:
NSUTF8StringEncoding
];
request
.
httpMethod
=
kXMHTTPMethodGET
;
request
.
headers
=
@{
@"token"
:
CacheToken
,
@"reqSource"
:
@"app"
,
@"Content-Type"
:
@"application/json"
};
}
onSuccess
:
^
(
id
responseObject
)
{
if
([
responseObject
[
@"code"
]
integerValue
]
==
1000
)
{
[
ZXNotPay
clearTable
];
if
([
responseObject
[
@"orderId"
]
isKindOfClass
:[
NSNull
class
]])
{
return
;
}
NSString
*
order
=
responseObject
[
@"title"
];
NSInteger
orderId
=
[
responseObject
[
@"orderId"
]
integerValue
];
if
(
order
&&
!
[
order
isKindOfClass
:[
NSNull
class
]])
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
ZXNotPay
*
p
=
[[
ZXNotPay
alloc
]
init
];
p
.
orderId
=
orderId
;
p
.
userId
=
CacheUserId
;
[
p
save
];
[
self
firstPageRefreshAddNotPayView
];
});
}
}
}
onFailure
:^
(
NSError
*
error
)
{
}
onFinished
:^
(
id
responseObject
,
NSError
*
error
)
{
}];
[
self
createNotPayOrderView
:[
ZXPayManager
sharedZXPayManager
].
notPayOrderView
];
}
}
#pragma mark - ========== 创建未支付订单提示view ==========
+
(
void
)
createNotPayOrderView
:
(
UIView
*
)
v
{
...
...
@@ -1087,7 +1077,6 @@ void ProviderReleaseData (void *info, const void *data, size_t size){
NSInteger
orderId
=
[
responseObject
[
@"orderId"
]
integerValue
];
if
(
order
&&
!
[
order
isKindOfClass
:[
NSNull
class
]])
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
ZXNotPay
*
p
=
[[
ZXNotPay
alloc
]
init
];
p
.
orderId
=
orderId
;
p
.
userId
=
CacheUserId
;
...
...
@@ -1101,6 +1090,9 @@ void ProviderReleaseData (void *info, const void *data, size_t size){
}];
}
+
(
void
)
createNotPayViewBySuperView
:
(
UIView
*
)
superView
orderDetail
:
(
NSInteger
)
orderId
alertStr
:
(
NSString
*
)
alertStr
{
for
(
UIView
*
v
in
superView
.
subviews
)
{
[
v
removeFromSuperview
];
}
[
superView
mas_updateConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
height
.
mas_equalTo
(
50
);
}];
...
...
@@ -1707,13 +1699,11 @@ void ProviderReleaseData (void *info, const void *data, size_t size){
adType
:
(
NSString
*
)
adType
isFirstPage
:
(
BOOL
)
isFirstPage
isHasBottomMargin
:
(
BOOL
)
isHasBottomMargin
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
for
(
UIView
*
v
in
superView
.
subviews
)
{
if
([
v
isKindOfClass
:[
ZXCustomAdView
class
]])
{
[
v
removeFromSuperview
];
}
for
(
UIView
*
v
in
superView
.
subviews
)
{
if
([
v
isKindOfClass
:[
ZXCustomAdView
class
]])
{
[
v
removeFromSuperview
];
}
}
);
}
if
([
adType
isEqualToString
:
@"TXAD"
])
{
//拉取腾讯广告
[[
ZXTXAdTool
sharedZXTXAdTool
]
createNativieAdByView
:
superView
topView
:
topView
viewController
:
fromVc
isFirstPage
:
isFirstPage
isHasBottomMargin
:
isHasBottomMargin
];
...
...
ColorfulSchool/ColorfulSchool/Classes/YWTPay(新版支付)/Controller/ZXNewConfirmPayViewController.m
View file @
03a219ed
//
//
...
...
@@ -125,8 +125,12 @@
#pragma mark - ========== 确定支付事件 ==========
-
(
void
)
confirmBtnFuc
{
[
ZXTool
showLoadingAnimation
];
int
callType
=
1
;
BOOL
isCanOpenYWT
=
[
kApplication
canOpenURL
:[
NSURL
URLWithString
:
@"cmbmobilebank://"
]];
NSString
*
url
=
[
NSString
stringWithFormat
:
@"%@/consumeOrder/confirmPay?orderId=%ld&payType=%@&callType=%d&returnUrl=%@&paymentConfId=%ld"
,
[
kUserDefaults
objectForKey
:
@"NEW_PAY"
],(
long
)
self
.
order
.
id
,
self
.
payType
.
payType
,
isCanOpenYWT
?
1
:
2
,
isCanOpenYWT
?
@"colorfulSchool://"
:
@"http://colorfulSchool"
,
(
long
)
self
.
order
.
paymentConfId
];
if
([
self
.
payType
.
payType
isEqualToString
:
@"5"
]
&&
!
isCanOpenYWT
)
{
callType
=
2
;
}
NSString
*
url
=
[
NSString
stringWithFormat
:
@"%@/consumeOrder/confirmPay?orderId=%ld&payType=%@&callType=%d&returnUrl=%@&paymentConfId=%ld"
,
[
kUserDefaults
objectForKey
:
@"NEW_PAY"
],(
long
)
self
.
order
.
id
,
self
.
payType
.
payType
,
callType
,
isCanOpenYWT
?
@"colorfulSchool://"
:
@"http://colorfulSchool"
,
(
long
)
self
.
order
.
paymentConfId
];
@weakify
(
self
);
[
XMCenter
sendRequest
:
^
(
XMRequest
*
request
)
{
request
.
url
=
[
url
stringByAddingPercentEscapesUsingEncoding
:
NSUTF8StringEncoding
];
...
...
ColorfulSchool/ColorfulSchool/Info.plist
View file @
03a219ed
...
...
@@ -398,6 +398,38 @@
<
string
>
www.colorfulSchool.com
<
/string
>
<
/
a
rr
a
y
>
<
/
d
i
c
t
>
<
d
i
c
t
>
<
k
e
y
>
CFBundleTypeRole
<
/k
e
y
>
<
string
>
Editor
<
/string
>
<
k
e
y
>
CFBundleURLSchemes
<
/k
e
y
>
<
a
rr
a
y
>
<
string
>
wxff0ab56070f7f6c4
<
/string
>
<
/
a
rr
a
y
>
<
/
d
i
c
t
>
<
d
i
c
t
>
<
k
e
y
>
CFBundleTypeRole
<
/k
e
y
>
<
string
>
Editor
<
/string
>
<
k
e
y
>
CFBundleURLSchemes
<
/k
e
y
>
<
a
rr
a
y
>
<
string
>
wx36ec152a503f4390
<
/string
>
<
/
a
rr
a
y
>
<
/
d
i
c
t
>
<
d
i
c
t
>
<
k
e
y
>
CFBundleTypeRole
<
/k
e
y
>
<
string
>
Editor
<
/string
>
<
k
e
y
>
CFBundleURLSchemes
<
/k
e
y
>
<
a
rr
a
y
>
<
string
>
colorfulSchool
<
/string
>
<
/
a
rr
a
y
>
<
/
d
i
c
t
>
<
d
i
c
t
>
<
k
e
y
>
CFBundleTypeRole
<
/k
e
y
>
<
string
>
Editor
<
/string
>
<
k
e
y
>
CFBundleURLSchemes
<
/k
e
y
>
<
a
rr
a
y
>
<
string
>
wx059562472b73b5d9
<
/string
>
<
/
a
rr
a
y
>
<
/
d
i
c
t
>
<
/
a
rr
a
y
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
string
>
1.0
<
/string
>
...
...
ColorfulSchool/ColorfulSchool/Main(入口)/Controller/MyTabViewController.m
View file @
03a219ed
//
//
...
...
@@ -89,7 +89,7 @@
// self.gzstoreModel=[JudgegzStore new];
// [self registNotificationAndKVO];
// [self.gzstoreModel judgeGzStore];
[
kUserDefaults
setValue
:
@"isOpenFreePay"
forKey
:
@"no"
];
//默认是no
NSString
*
url
=
[
NSString
stringWithFormat
:
@"%@/area/switchs?areaId=%@"
,
[
kUserDefaults
objectForKey
:
@"SX_MONEY"
],
CacheCampusId
];
@weakify
(
self
);
[
XMCenter
sendRequest
:
^
(
XMRequest
*
request
)
{
...
...
@@ -105,6 +105,9 @@
if
([
dic
[
@"isEnabled"
]
integerValue
]
==
1
)
{
[
arr_type
addObject
:
dic
];
}
if
([
dic
[
@"type"
]
isEqualToString
:
@"3"
]
&&
[
dic
[
@"isEnabled"
]
integerValue
]
==
1
)
{
[
kUserDefaults
setValue
:
@"isOpenFreePay"
forKey
:
@"yes"
];
//默认是no
}
}
if
(
arr_type
.
count
==
2
)
{
self
.
showType
=
4
;
...
...
ColorfulSchool/ColorfulSchool/images.xcassets/newpay/icon_mianmi.imageset/Contents.json
0 → 100644
View file @
03a219ed
{
"images"
:
[
{
"idiom"
:
"universal"
,
"filename"
:
"icon_mianmi.png"
,
"scale"
:
"1x"
},
{
"idiom"
:
"universal"
,
"filename"
:
"icon_mianmi@2x.png"
,
"scale"
:
"2x"
},
{
"idiom"
:
"universal"
,
"filename"
:
"icon_mianmi@3x.png"
,
"scale"
:
"3x"
}
],
"info"
:
{
"version"
:
1
,
"author"
:
"xcode"
}
}
\ No newline at end of file
ColorfulSchool/ColorfulSchool/images.xcassets/newpay/icon_mianmi.imageset/icon_mianmi.png
0 → 100644
View file @
03a219ed
502 Bytes
ColorfulSchool/ColorfulSchool/images.xcassets/newpay/icon_mianmi.imageset/icon_mianmi@2x.png
0 → 100644
View file @
03a219ed
996 Bytes
ColorfulSchool/ColorfulSchool/images.xcassets/newpay/icon_mianmi.imageset/icon_mianmi@3x.png
0 → 100644
View file @
03a219ed
1.5 KB
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment