易宝支付
@@ -58,6 +58,10 @@
|
||||
A93F8806199A077F00875287 /* OtherListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A93F87FF199A077F00875287 /* OtherListViewController.m */; };
|
||||
A94FE51E199C9C3C00626DE5 /* MoveSocialCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = A94FE51D199C9C3C00626DE5 /* MoveSocialCellView.m */; };
|
||||
A94FE520199C9C6800626DE5 /* MoveSocialCellView.xib in Resources */ = {isa = PBXBuildFile; fileRef = A94FE51F199C9C6800626DE5 /* MoveSocialCellView.xib */; };
|
||||
A9548ED41A104ED9008B5A3D /* OpenUDID.m in Sources */ = {isa = PBXBuildFile; fileRef = A9548ED21A104ED9008B5A3D /* OpenUDID.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
||||
A9548ED51A104ED9008B5A3D /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = A9548ED31A104ED9008B5A3D /* README.md */; };
|
||||
A9548ED91A105DB0008B5A3D /* YiBaoMessageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A9548ED71A105DB0008B5A3D /* YiBaoMessageViewController.m */; };
|
||||
A9548EDA1A105DB0008B5A3D /* YiBaoMessageViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9548ED81A105DB0008B5A3D /* YiBaoMessageViewController.xib */; };
|
||||
A95CEA3419B754A800D4605F /* MessageCenterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A95CEA3219B754A800D4605F /* MessageCenterViewController.m */; };
|
||||
A95CEA3519B754A800D4605F /* MessageCenterViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A95CEA3319B754A800D4605F /* MessageCenterViewController.xib */; };
|
||||
A95CEA3919B755C000D4605F /* MessageCenterTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A95CEA3719B755C000D4605F /* MessageCenterTableViewCell.m */; };
|
||||
@@ -68,6 +72,13 @@
|
||||
A95EAEE319C9BE2E00D1592B /* FundCaculateViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A95EAEE119C9BE2E00D1592B /* FundCaculateViewController.m */; };
|
||||
A95EAEE419C9BE2E00D1592B /* FundCaculateViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A95EAEE219C9BE2E00D1592B /* FundCaculateViewController.xib */; };
|
||||
A9623E2F19CBEB1A004F7D9D /* NSDictionary+ChangeNull.m in Sources */ = {isa = PBXBuildFile; fileRef = A9623E2E19CBEB1A004F7D9D /* NSDictionary+ChangeNull.m */; };
|
||||
A96ACD841A0FD49C00DEFF7B /* CardBindViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = A96ACD821A0FD49C00DEFF7B /* CardBindViewController.mm */; };
|
||||
A96ACD851A0FD49C00DEFF7B /* CardBindViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A96ACD831A0FD49C00DEFF7B /* CardBindViewController.xib */; };
|
||||
A96ACD881A0FE43900DEFF7B /* IPAddress.c in Sources */ = {isa = PBXBuildFile; fileRef = A96ACD871A0FE43900DEFF7B /* IPAddress.c */; };
|
||||
A96ACD8C1A0FE65C00DEFF7B /* IPGet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A96ACD8A1A0FE65C00DEFF7B /* IPGet.cpp */; };
|
||||
A96ACD901A0FEDED00DEFF7B /* daidaitong01@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A96ACD8D1A0FEDED00DEFF7B /* daidaitong01@2x.png */; };
|
||||
A96ACD911A0FEDED00DEFF7B /* daidaitong02@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A96ACD8E1A0FEDED00DEFF7B /* daidaitong02@2x.png */; };
|
||||
A96ACD921A0FEDED00DEFF7B /* daidaitong03@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A96ACD8F1A0FEDED00DEFF7B /* daidaitong03@2x.png */; };
|
||||
A96F2A7C199D008200608237 /* UIButton+Bootstrap.m in Sources */ = {isa = PBXBuildFile; fileRef = A96F2A7B199D008200608237 /* UIButton+Bootstrap.m */; };
|
||||
A96F2A7F199D01C000608237 /* NSString+FontAwesome.m in Sources */ = {isa = PBXBuildFile; fileRef = A96F2A7E199D01C000608237 /* NSString+FontAwesome.m */; };
|
||||
A970886219D273E700F880C1 /* OtherCaculateViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A970886019D273E700F880C1 /* OtherCaculateViewController.m */; };
|
||||
@@ -124,6 +135,14 @@
|
||||
A9A59E9119D2C4DE00D7DC4F /* fund_abount_icon_1@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9A59E8E19D2C4DE00D7DC4F /* fund_abount_icon_1@2x.png */; };
|
||||
A9A59E9219D2C4DE00D7DC4F /* fund_abount_icon_2@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9A59E8F19D2C4DE00D7DC4F /* fund_abount_icon_2@2x.png */; };
|
||||
A9A59E9319D2C4DE00D7DC4F /* fund_abount_icon_3@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9A59E9019D2C4DE00D7DC4F /* fund_abount_icon_3@2x.png */; };
|
||||
A9A5A33C1A0F4C70004AD234 /* CardSelectViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A9A5A33A1A0F4C70004AD234 /* CardSelectViewController.m */; };
|
||||
A9A5A33D1A0F4C70004AD234 /* CardSelectViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9A5A33B1A0F4C70004AD234 /* CardSelectViewController.xib */; };
|
||||
A9A5A3411A0F5D08004AD234 /* daidaitong_03.jpg in Resources */ = {isa = PBXBuildFile; fileRef = A9A5A33E1A0F5D07004AD234 /* daidaitong_03.jpg */; };
|
||||
A9A5A3421A0F5D08004AD234 /* daidaitong_06.jpg in Resources */ = {isa = PBXBuildFile; fileRef = A9A5A33F1A0F5D07004AD234 /* daidaitong_06.jpg */; };
|
||||
A9A5A3431A0F5D08004AD234 /* daidaitong_13.jpg in Resources */ = {isa = PBXBuildFile; fileRef = A9A5A3401A0F5D07004AD234 /* daidaitong_13.jpg */; };
|
||||
A9A5A3451A0F5EB8004AD234 /* check_mark@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9A5A3441A0F5EB8004AD234 /* check_mark@2x.png */; };
|
||||
A9A5A3491A0F603B004AD234 /* CardAddViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A9A5A3471A0F603B004AD234 /* CardAddViewController.m */; };
|
||||
A9A5A34A1A0F603B004AD234 /* CardAddViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9A5A3481A0F603B004AD234 /* CardAddViewController.xib */; };
|
||||
A9A6AD2F19CB1C7000626B48 /* MainOrderViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A9A6AD2D19CB1C7000626B48 /* MainOrderViewController.m */; };
|
||||
A9A6AD3019CB1C7000626B48 /* MainOrderViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9A6AD2E19CB1C7000626B48 /* MainOrderViewController.xib */; };
|
||||
A9A6AD3419CB26FD00626B48 /* OrderPassWordViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = A9A6AD3219CB26FD00626B48 /* OrderPassWordViewController.mm */; };
|
||||
@@ -331,6 +350,12 @@
|
||||
A94FE51C199C9C3C00626DE5 /* MoveSocialCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MoveSocialCellView.h; sourceTree = "<group>"; };
|
||||
A94FE51D199C9C3C00626DE5 /* MoveSocialCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MoveSocialCellView.m; sourceTree = "<group>"; };
|
||||
A94FE51F199C9C6800626DE5 /* MoveSocialCellView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MoveSocialCellView.xib; sourceTree = "<group>"; };
|
||||
A9548ED11A104ED9008B5A3D /* OpenUDID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OpenUDID.h; sourceTree = "<group>"; };
|
||||
A9548ED21A104ED9008B5A3D /* OpenUDID.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OpenUDID.m; sourceTree = "<group>"; };
|
||||
A9548ED31A104ED9008B5A3D /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.md; sourceTree = "<group>"; };
|
||||
A9548ED61A105DB0008B5A3D /* YiBaoMessageViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YiBaoMessageViewController.h; sourceTree = "<group>"; };
|
||||
A9548ED71A105DB0008B5A3D /* YiBaoMessageViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YiBaoMessageViewController.m; sourceTree = "<group>"; };
|
||||
A9548ED81A105DB0008B5A3D /* YiBaoMessageViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = YiBaoMessageViewController.xib; sourceTree = "<group>"; };
|
||||
A95CEA3119B754A800D4605F /* MessageCenterViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MessageCenterViewController.h; sourceTree = "<group>"; };
|
||||
A95CEA3219B754A800D4605F /* MessageCenterViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MessageCenterViewController.m; sourceTree = "<group>"; };
|
||||
A95CEA3319B754A800D4605F /* MessageCenterViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MessageCenterViewController.xib; sourceTree = "<group>"; };
|
||||
@@ -346,6 +371,16 @@
|
||||
A95EAEE219C9BE2E00D1592B /* FundCaculateViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = FundCaculateViewController.xib; sourceTree = "<group>"; };
|
||||
A9623E2D19CBEB1A004F7D9D /* NSDictionary+ChangeNull.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+ChangeNull.h"; sourceTree = "<group>"; };
|
||||
A9623E2E19CBEB1A004F7D9D /* NSDictionary+ChangeNull.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+ChangeNull.m"; sourceTree = "<group>"; };
|
||||
A96ACD811A0FD49C00DEFF7B /* CardBindViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardBindViewController.h; sourceTree = "<group>"; };
|
||||
A96ACD821A0FD49C00DEFF7B /* CardBindViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CardBindViewController.mm; sourceTree = "<group>"; };
|
||||
A96ACD831A0FD49C00DEFF7B /* CardBindViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CardBindViewController.xib; sourceTree = "<group>"; };
|
||||
A96ACD871A0FE43900DEFF7B /* IPAddress.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = IPAddress.c; sourceTree = "<group>"; };
|
||||
A96ACD891A0FE46C00DEFF7B /* IPAddress.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IPAddress.h; sourceTree = "<group>"; };
|
||||
A96ACD8A1A0FE65C00DEFF7B /* IPGet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IPGet.cpp; sourceTree = "<group>"; };
|
||||
A96ACD8B1A0FE65C00DEFF7B /* IPGet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IPGet.h; sourceTree = "<group>"; };
|
||||
A96ACD8D1A0FEDED00DEFF7B /* daidaitong01@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "daidaitong01@2x.png"; sourceTree = "<group>"; };
|
||||
A96ACD8E1A0FEDED00DEFF7B /* daidaitong02@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "daidaitong02@2x.png"; sourceTree = "<group>"; };
|
||||
A96ACD8F1A0FEDED00DEFF7B /* daidaitong03@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "daidaitong03@2x.png"; sourceTree = "<group>"; };
|
||||
A96F2A7A199D008200608237 /* UIButton+Bootstrap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIButton+Bootstrap.h"; sourceTree = "<group>"; };
|
||||
A96F2A7B199D008200608237 /* UIButton+Bootstrap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIButton+Bootstrap.m"; sourceTree = "<group>"; };
|
||||
A96F2A7D199D01C000608237 /* NSString+FontAwesome.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+FontAwesome.h"; sourceTree = "<group>"; };
|
||||
@@ -423,6 +458,16 @@
|
||||
A9A59E8E19D2C4DE00D7DC4F /* fund_abount_icon_1@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "fund_abount_icon_1@2x.png"; sourceTree = "<group>"; };
|
||||
A9A59E8F19D2C4DE00D7DC4F /* fund_abount_icon_2@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "fund_abount_icon_2@2x.png"; sourceTree = "<group>"; };
|
||||
A9A59E9019D2C4DE00D7DC4F /* fund_abount_icon_3@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "fund_abount_icon_3@2x.png"; sourceTree = "<group>"; };
|
||||
A9A5A3391A0F4C70004AD234 /* CardSelectViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardSelectViewController.h; sourceTree = "<group>"; };
|
||||
A9A5A33A1A0F4C70004AD234 /* CardSelectViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CardSelectViewController.m; sourceTree = "<group>"; };
|
||||
A9A5A33B1A0F4C70004AD234 /* CardSelectViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CardSelectViewController.xib; sourceTree = "<group>"; };
|
||||
A9A5A33E1A0F5D07004AD234 /* daidaitong_03.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = daidaitong_03.jpg; sourceTree = "<group>"; };
|
||||
A9A5A33F1A0F5D07004AD234 /* daidaitong_06.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = daidaitong_06.jpg; sourceTree = "<group>"; };
|
||||
A9A5A3401A0F5D07004AD234 /* daidaitong_13.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = daidaitong_13.jpg; sourceTree = "<group>"; };
|
||||
A9A5A3441A0F5EB8004AD234 /* check_mark@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "check_mark@2x.png"; sourceTree = "<group>"; };
|
||||
A9A5A3461A0F603B004AD234 /* CardAddViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardAddViewController.h; sourceTree = "<group>"; };
|
||||
A9A5A3471A0F603B004AD234 /* CardAddViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CardAddViewController.m; sourceTree = "<group>"; };
|
||||
A9A5A3481A0F603B004AD234 /* CardAddViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CardAddViewController.xib; sourceTree = "<group>"; };
|
||||
A9A6AD2C19CB1C7000626B48 /* MainOrderViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainOrderViewController.h; sourceTree = "<group>"; };
|
||||
A9A6AD2D19CB1C7000626B48 /* MainOrderViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainOrderViewController.m; sourceTree = "<group>"; };
|
||||
A9A6AD2E19CB1C7000626B48 /* MainOrderViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainOrderViewController.xib; sourceTree = "<group>"; };
|
||||
@@ -657,6 +702,18 @@
|
||||
A9A59E8719D2BB2600D7DC4F /* ComPanyAboutViewController.h */,
|
||||
A9A59E8819D2BB2600D7DC4F /* ComPanyAboutViewController.m */,
|
||||
A9A59E8919D2BB2600D7DC4F /* ComPanyAboutViewController.xib */,
|
||||
A9A5A3391A0F4C70004AD234 /* CardSelectViewController.h */,
|
||||
A9A5A33A1A0F4C70004AD234 /* CardSelectViewController.m */,
|
||||
A9A5A33B1A0F4C70004AD234 /* CardSelectViewController.xib */,
|
||||
A9A5A3461A0F603B004AD234 /* CardAddViewController.h */,
|
||||
A9A5A3471A0F603B004AD234 /* CardAddViewController.m */,
|
||||
A9A5A3481A0F603B004AD234 /* CardAddViewController.xib */,
|
||||
A96ACD811A0FD49C00DEFF7B /* CardBindViewController.h */,
|
||||
A96ACD821A0FD49C00DEFF7B /* CardBindViewController.mm */,
|
||||
A96ACD831A0FD49C00DEFF7B /* CardBindViewController.xib */,
|
||||
A9548ED61A105DB0008B5A3D /* YiBaoMessageViewController.h */,
|
||||
A9548ED71A105DB0008B5A3D /* YiBaoMessageViewController.m */,
|
||||
A9548ED81A105DB0008B5A3D /* YiBaoMessageViewController.xib */,
|
||||
);
|
||||
path = ProductView;
|
||||
sourceTree = "<group>";
|
||||
@@ -719,6 +776,27 @@
|
||||
path = MoveView;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
A9548ED01A104ED9008B5A3D /* OpenUDID */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A9548ED11A104ED9008B5A3D /* OpenUDID.h */,
|
||||
A9548ED21A104ED9008B5A3D /* OpenUDID.m */,
|
||||
A9548ED31A104ED9008B5A3D /* README.md */,
|
||||
);
|
||||
path = OpenUDID;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
A96ACD861A0FE42000DEFF7B /* IP */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A96ACD871A0FE43900DEFF7B /* IPAddress.c */,
|
||||
A96ACD891A0FE46C00DEFF7B /* IPAddress.h */,
|
||||
A96ACD8A1A0FE65C00DEFF7B /* IPGet.cpp */,
|
||||
A96ACD8B1A0FE65C00DEFF7B /* IPGet.h */,
|
||||
);
|
||||
path = IP;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
A96F2A79199D007700608237 /* UIButtonUtil */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -905,6 +983,8 @@
|
||||
A9AF6C4A19949B510076C0EE /* Common */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A9548ED01A104ED9008B5A3D /* OpenUDID */,
|
||||
A96ACD861A0FE42000DEFF7B /* IP */,
|
||||
A9C3539C1A0C711000EE8247 /* GesturePassword */,
|
||||
A9A6AD3619CB30E400626B48 /* UPPay */,
|
||||
A9354F5819B870B900FDCB52 /* BaseView */,
|
||||
@@ -932,6 +1012,12 @@
|
||||
A9AF6C4D19949CAD0076C0EE /* Resource */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A96ACD8D1A0FEDED00DEFF7B /* daidaitong01@2x.png */,
|
||||
A96ACD8E1A0FEDED00DEFF7B /* daidaitong02@2x.png */,
|
||||
A96ACD8F1A0FEDED00DEFF7B /* daidaitong03@2x.png */,
|
||||
A9A5A33E1A0F5D07004AD234 /* daidaitong_03.jpg */,
|
||||
A9A5A33F1A0F5D07004AD234 /* daidaitong_06.jpg */,
|
||||
A9A5A3401A0F5D07004AD234 /* daidaitong_13.jpg */,
|
||||
A9A59E7719D299EA00D7DC4F /* tab_fund_list_bg@2x.png */,
|
||||
A9A59E7819D299EA00D7DC4F /* tab_fund_list_p_bg@2x.png */,
|
||||
A9A59E7919D299EA00D7DC4F /* tab_home_bg@2x.png */,
|
||||
@@ -983,6 +1069,7 @@
|
||||
A9C69441199BB7B100B2CECE /* icon_person_take_image@2x.png */,
|
||||
A93F87811999BB1D00875287 /* red_line_and_shadow@2x.png */,
|
||||
A904E4A819BEF18A0014F694 /* about_copyright@2x.png */,
|
||||
A9A5A3441A0F5EB8004AD234 /* check_mark@2x.png */,
|
||||
A904E4A919BEF18A0014F694 /* about_logo@2x.png */,
|
||||
A9C69449199BD14D00B2CECE /* more_icon_2@2x.png */,
|
||||
A9C6944A199BD14D00B2CECE /* more_icon_3@2x.png */,
|
||||
@@ -1277,6 +1364,7 @@
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
A9A5A3431A0F5D08004AD234 /* daidaitong_13.jpg in Resources */,
|
||||
A9AF6C43199498C40076C0EE /* MyViewController.xib in Resources */,
|
||||
A919055D19B02A6E002575DF /* icon_color_key@2x.png in Resources */,
|
||||
A9EAA04719986DC3001A872A /* fund_cell_label_bg_green@2x.png in Resources */,
|
||||
@@ -1316,6 +1404,7 @@
|
||||
A9C6945A199BD16000B2CECE /* more_icon_1@2x.png in Resources */,
|
||||
A9EC95B819B54F6E00681678 /* LoginViewController.xib in Resources */,
|
||||
A99FDB0B19CAC16E00D2B3D3 /* SetPassWordViewController.xib in Resources */,
|
||||
A9A5A3451A0F5EB8004AD234 /* check_mark@2x.png in Resources */,
|
||||
A9A59E8419D299EA00D7DC4F /* tab_mine_p_bg@2x.png in Resources */,
|
||||
A9EAA05F1998BB82001A872A /* about_dot@2x.png in Resources */,
|
||||
A93320C819C0227F0090D640 /* MyHoldAmountViewController.xib in Resources */,
|
||||
@@ -1327,6 +1416,7 @@
|
||||
A9AF6C6219949CD30076C0EE /* icon_dock_rt_actived@2x.png in Resources */,
|
||||
A98626A019B4241400FF9E2C /* ActivityCenterTableViewCell.xib in Resources */,
|
||||
A9EC95C019B5501B00681678 /* icon_phone@2x.png in Resources */,
|
||||
A9A5A33D1A0F4C70004AD234 /* CardSelectViewController.xib in Resources */,
|
||||
A9AF6C781994B5890076C0EE /* icon_share_default.png in Resources */,
|
||||
A9AF6C741994B5890076C0EE /* icon_indicate_add_module@2x.png in Resources */,
|
||||
A919055F19B02A72002575DF /* icon_color_bank@2x.png in Resources */,
|
||||
@@ -1351,6 +1441,7 @@
|
||||
A91C6D4019AB8E9C00AEBF4D /* p2c_alert@2x.png in Resources */,
|
||||
A9A59E8D19D2C40100D7DC4F /* hw@2x.png in Resources */,
|
||||
A9A59E8319D299EA00D7DC4F /* tab_mine_bg@2x.png in Resources */,
|
||||
A9548EDA1A105DB0008B5A3D /* YiBaoMessageViewController.xib in Resources */,
|
||||
A904E4AB19BEF18A0014F694 /* about_logo@2x.png in Resources */,
|
||||
A9AF6C6019949CD30076C0EE /* icon_dock_mine_actived@2x.png in Resources */,
|
||||
A95CEA3C19B7667400D4605F /* icon_success@2x.png in Resources */,
|
||||
@@ -1360,26 +1451,33 @@
|
||||
A97F9D1A19B592FD0073E7E6 /* login_button_s@2x.png in Resources */,
|
||||
A9E76DD619AB378A00C0D232 /* hk_home_icon2@2x.png in Resources */,
|
||||
A9AF6C6419949CD30076C0EE /* icon_dock_service_actived@2x.png in Resources */,
|
||||
A9A5A3421A0F5D08004AD234 /* daidaitong_06.jpg in Resources */,
|
||||
A904E4A719BEF11F0014F694 /* AboutViewController.xib in Resources */,
|
||||
A9A59E7619D299DE00D7DC4F /* sale_red_icon@2x.png in Resources */,
|
||||
A96ACD911A0FEDED00DEFF7B /* daidaitong02@2x.png in Resources */,
|
||||
A9A59E8B19D2BB2600D7DC4F /* ComPanyAboutViewController.xib in Resources */,
|
||||
A9E76DD719AB378A00C0D232 /* hk_home_icon3@2x.png in Resources */,
|
||||
A9AF6C791994B5890076C0EE /* tabbarShadowImage@2x.png in Resources */,
|
||||
A9A59E7519D299DE00D7DC4F /* sale_gray_icon@2x.png in Resources */,
|
||||
A9E76DD519AB378A00C0D232 /* hk_home_icon1@2x.png in Resources */,
|
||||
A9D7A71C19C913A60029911F /* sale_blue_icon@2x.png in Resources */,
|
||||
A9548ED51A104ED9008B5A3D /* README.md in Resources */,
|
||||
A919055B19B02A5F002575DF /* icon_color_idcard@2x.png in Resources */,
|
||||
A9C69453199BD14D00B2CECE /* more_icon_4@2x.png in Resources */,
|
||||
A91C6D4119AB8E9C00AEBF4D /* p2c_datesum@2x.png in Resources */,
|
||||
A9A59E8219D299EA00D7DC4F /* tab_home_p_bg@2x.png in Resources */,
|
||||
A9C69442199BB7B100B2CECE /* icon_person_take_image@2x.png in Resources */,
|
||||
A96ACD851A0FD49C00DEFF7B /* CardBindViewController.xib in Resources */,
|
||||
A9C69457199BD14D00B2CECE /* more_icon_9@2x.png in Resources */,
|
||||
A90BEC07199DDAFB00230242 /* WYDInfoHeadView.xib in Resources */,
|
||||
A97F9D1619B592E90073E7E6 /* get_ver_button_red_s@2x.png in Resources */,
|
||||
A9B2507519B4C796003E8855 /* HelpCenterTableViewCell.xib in Resources */,
|
||||
A95EAEE419C9BE2E00D1592B /* FundCaculateViewController.xib in Resources */,
|
||||
A919056119B02A83002575DF /* icon_color_name@2x.png in Resources */,
|
||||
A9A5A3411A0F5D08004AD234 /* daidaitong_03.jpg in Resources */,
|
||||
A95CEA3519B754A800D4605F /* MessageCenterViewController.xib in Resources */,
|
||||
A9A5A34A1A0F603B004AD234 /* CardAddViewController.xib in Resources */,
|
||||
A96ACD921A0FEDED00DEFF7B /* daidaitong03@2x.png in Resources */,
|
||||
A9AF6BF719947DD00076C0EE /* InfoPlist.strings in Resources */,
|
||||
A9AF6C761994B5890076C0EE /* icon_indicate_more_down@2x.png in Resources */,
|
||||
A904E4AA19BEF18A0014F694 /* about_copyright@2x.png in Resources */,
|
||||
@@ -1403,6 +1501,7 @@
|
||||
A95CEA4119B766F400D4605F /* MessageDetailViewController.xib in Resources */,
|
||||
A986269619B413D600FF9E2C /* DailyIncomeTableViewCell.xib in Resources */,
|
||||
A9A7948419C8AC4E00516C60 /* FundAmountTableViewCell.xib in Resources */,
|
||||
A96ACD901A0FEDED00DEFF7B /* daidaitong01@2x.png in Resources */,
|
||||
A9AF6C2F199483520076C0EE /* MainViewController.xib in Resources */,
|
||||
A9C69452199BD14D00B2CECE /* more_icon_3@2x.png in Resources */,
|
||||
A9C69455199BD14D00B2CECE /* more_icon_7@2x.png in Resources */,
|
||||
@@ -1477,9 +1576,11 @@
|
||||
A9AF6C961994C5700076C0EE /* UIView+Extension.m in Sources */,
|
||||
A99FDB0219CAACA400D2B3D3 /* InputVerificationViewController.m in Sources */,
|
||||
A99EBEC419CBB47C005E1AA0 /* HelpCenterViewController.m in Sources */,
|
||||
A96ACD841A0FD49C00DEFF7B /* CardBindViewController.mm in Sources */,
|
||||
A9AF6C921994C5700076C0EE /* MJRefreshFooterView.m in Sources */,
|
||||
A9202B8719C95B97009932C2 /* ProFitCaculateViewController.m in Sources */,
|
||||
A9C353A81A0C711000EE8247 /* GesturePasswordButton.m in Sources */,
|
||||
A96ACD8C1A0FE65C00DEFF7B /* IPGet.cpp in Sources */,
|
||||
A93F87CA1999E62000875287 /* AdjustableUILable.m in Sources */,
|
||||
A93F8803199A077F00875287 /* LoanListCell.m in Sources */,
|
||||
A9C353A91A0C711000EE8247 /* GesturePasswordController.m in Sources */,
|
||||
@@ -1489,6 +1590,7 @@
|
||||
A9AF6C3D199486CA0076C0EE /* ProductListViewController.m in Sources */,
|
||||
A904E4A619BEF11F0014F694 /* AboutViewController.m in Sources */,
|
||||
A93F87741999AA8300875287 /* ManagerUtil.m in Sources */,
|
||||
A9548ED91A105DB0008B5A3D /* YiBaoMessageViewController.m in Sources */,
|
||||
A9AF6C941994C5700076C0EE /* UIScrollView+Extension.m in Sources */,
|
||||
A9E8589D19AC2AAE001996DF /* DaiDaiTongApi.m in Sources */,
|
||||
A96F2A7C199D008200608237 /* UIButton+Bootstrap.m in Sources */,
|
||||
@@ -1534,6 +1636,7 @@
|
||||
A95CEA3919B755C000D4605F /* MessageCenterTableViewCell.m in Sources */,
|
||||
A9F1E18619ACB63100B6A441 /* DTCoreTextTableViewCell.m in Sources */,
|
||||
A9AF6BF919947DD00076C0EE /* main.m in Sources */,
|
||||
A96ACD881A0FE43900DEFF7B /* IPAddress.c in Sources */,
|
||||
A970886219D273E700F880C1 /* OtherCaculateViewController.m in Sources */,
|
||||
A99FDAFE19CA683100D2B3D3 /* DaiDaiTongTestApi.m in Sources */,
|
||||
A90BEC05199DDACA00230242 /* WYDInfoHeadView.m in Sources */,
|
||||
@@ -1548,14 +1651,17 @@
|
||||
A9971D7519B8BC410079F143 /* DailyProfitViewController.m in Sources */,
|
||||
A9AF6C901994C5700076C0EE /* MJRefreshBaseView.m in Sources */,
|
||||
A99EBEA919CB9ABB005E1AA0 /* TransactionRecordsViewController.m in Sources */,
|
||||
A9548ED41A104ED9008B5A3D /* OpenUDID.m in Sources */,
|
||||
A9C0540519ADBCB2002331A5 /* FundProductInfoViewController.m in Sources */,
|
||||
A94FE51E199C9C3C00626DE5 /* MoveSocialCellView.m in Sources */,
|
||||
A93F8806199A077F00875287 /* OtherListViewController.m in Sources */,
|
||||
A9BA324619D338C500B48A8F /* ModifyPassWordViewController.m in Sources */,
|
||||
A9A5A3491A0F603B004AD234 /* CardAddViewController.m in Sources */,
|
||||
A99FDB0A19CAC16E00D2B3D3 /* SetPassWordViewController.m in Sources */,
|
||||
A9AF6C2E199483520076C0EE /* MainViewController.m in Sources */,
|
||||
A9EE5EE719C20CDA004E7A2C /* WYDAmountTableViewCell.m in Sources */,
|
||||
A9C353AB1A0C711000EE8247 /* KeychainItemWrapper.m in Sources */,
|
||||
A9A5A33C1A0F4C70004AD234 /* CardSelectViewController.m in Sources */,
|
||||
A9AF6C42199498C40076C0EE /* MyViewController.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
|
||||
<false/>
|
||||
<key>IDESourceControlProjectIdentifier</key>
|
||||
<string>7DF83542-E9D0-478B-AF8C-E271ADCDB5F5</string>
|
||||
<string>15C51D19-A4BE-42F8-AB81-A76CAEEC4119</string>
|
||||
<key>IDESourceControlProjectName</key>
|
||||
<string>ManagerDemo</string>
|
||||
<key>IDESourceControlProjectOriginsDictionary</key>
|
||||
|
||||
@@ -0,0 +1,216 @@
|
||||
//
|
||||
// IPAddress.c
|
||||
// ManagerDemo
|
||||
//
|
||||
// Created by xmfish on 14/11/10.
|
||||
// Copyright (c) 2014年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/sockio.h>
|
||||
#include <net/if.h>
|
||||
#include <errno.h>
|
||||
#include <net/if_dl.h>
|
||||
#include <net/ethernet.h>
|
||||
#include "IPAddress.h"
|
||||
|
||||
#define min(a,b) ((a) < (b) ? (a) : (b))
|
||||
#define max(a,b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
#define BUFFERSIZE 4000
|
||||
|
||||
char *if_names[MAXADDRS];
|
||||
char *ip_names[MAXADDRS];
|
||||
char *hw_addrs[MAXADDRS];
|
||||
unsigned long ip_addrs[MAXADDRS];
|
||||
|
||||
static int nextAddr = 0;
|
||||
|
||||
void InitAddresses()
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<MAXADDRS; ++i)
|
||||
{
|
||||
if_names[i] = ip_names[i] = hw_addrs[i] = NULL;
|
||||
ip_addrs[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void FreeAddresses()
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<MAXADDRS; ++i)
|
||||
{
|
||||
if (if_names[i] != 0) free(if_names[i]);
|
||||
if (ip_names[i] != 0) free(ip_names[i]);
|
||||
if (hw_addrs[i] != 0) free(hw_addrs[i]);
|
||||
ip_addrs[i] = 0;
|
||||
}
|
||||
InitAddresses();
|
||||
}
|
||||
|
||||
void GetIPAddresses()
|
||||
{
|
||||
int i, len, flags;
|
||||
char buffer[BUFFERSIZE], *ptr, lastname[IFNAMSIZ], *cptr;
|
||||
struct ifconf ifc;
|
||||
struct ifreq *ifr, ifrcopy;
|
||||
struct sockaddr_in *sin;
|
||||
|
||||
char temp[80];
|
||||
|
||||
int sockfd;
|
||||
|
||||
for (i=0; i<MAXADDRS; ++i)
|
||||
{
|
||||
if_names[i] = ip_names[i] = NULL;
|
||||
ip_addrs[i] = 0;
|
||||
}
|
||||
|
||||
sockfd = socket(AF_INET, SOCK_DGRAM, 0);
|
||||
if (sockfd < 0)
|
||||
{
|
||||
perror("socket failed");
|
||||
return;
|
||||
}
|
||||
|
||||
ifc.ifc_len = BUFFERSIZE;
|
||||
ifc.ifc_buf = buffer;
|
||||
|
||||
if (ioctl(sockfd, SIOCGIFCONF, &ifc) < 0)
|
||||
{
|
||||
perror("ioctl error");
|
||||
return;
|
||||
}
|
||||
|
||||
lastname[0] = 0;
|
||||
|
||||
for (ptr = buffer; ptr < buffer + ifc.ifc_len; )
|
||||
{
|
||||
ifr = (struct ifreq *)ptr;
|
||||
len = max(sizeof(struct sockaddr), ifr->ifr_addr.sa_len);
|
||||
ptr += sizeof(ifr->ifr_name) + len; // for next one in buffer
|
||||
|
||||
if (ifr->ifr_addr.sa_family != AF_INET)
|
||||
{
|
||||
continue; // ignore if not desired address family
|
||||
}
|
||||
|
||||
if ((cptr = (char *)strchr(ifr->ifr_name, ':')) != NULL)
|
||||
{
|
||||
*cptr = 0; // replace colon will null
|
||||
}
|
||||
|
||||
if (strncmp(lastname, ifr->ifr_name, IFNAMSIZ) == 0)
|
||||
{
|
||||
continue; /* already processed this interface */
|
||||
}
|
||||
|
||||
memcpy(lastname, ifr->ifr_name, IFNAMSIZ);
|
||||
|
||||
ifrcopy = *ifr;
|
||||
ioctl(sockfd, SIOCGIFFLAGS, &ifrcopy);
|
||||
flags = ifrcopy.ifr_flags;
|
||||
if ((flags & IFF_UP) == 0)
|
||||
{
|
||||
continue; // ignore if interface not up
|
||||
}
|
||||
|
||||
if_names[nextAddr] = (char *)malloc(strlen(ifr->ifr_name)+1);
|
||||
if (if_names[nextAddr] == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
strcpy(if_names[nextAddr], ifr->ifr_name);
|
||||
|
||||
sin = (struct sockaddr_in *)&ifr->ifr_addr;
|
||||
strcpy(temp, inet_ntoa(sin->sin_addr));
|
||||
|
||||
ip_names[nextAddr] = (char *)malloc(strlen(temp)+1);
|
||||
if (ip_names[nextAddr] == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
strcpy(ip_names[nextAddr], temp);
|
||||
|
||||
ip_addrs[nextAddr] = sin->sin_addr.s_addr;
|
||||
|
||||
++nextAddr;
|
||||
}
|
||||
|
||||
close(sockfd);
|
||||
}
|
||||
|
||||
void GetHWAddresses()
|
||||
{
|
||||
struct ifconf ifc;
|
||||
struct ifreq *ifr;
|
||||
int i, sockfd;
|
||||
char buffer[BUFFERSIZE], *cp, *cplim;
|
||||
char temp[80];
|
||||
|
||||
for (i=0; i<MAXADDRS; ++i)
|
||||
{
|
||||
hw_addrs[i] = NULL;
|
||||
}
|
||||
|
||||
sockfd = socket(AF_INET, SOCK_DGRAM, 0);
|
||||
if (sockfd < 0)
|
||||
{
|
||||
perror("socket failed");
|
||||
return;
|
||||
}
|
||||
|
||||
ifc.ifc_len = BUFFERSIZE;
|
||||
ifc.ifc_buf = buffer;
|
||||
|
||||
if (ioctl(sockfd, SIOCGIFCONF, (char *)&ifc) < 0)
|
||||
{
|
||||
perror("ioctl error");
|
||||
close(sockfd);
|
||||
return;
|
||||
}
|
||||
|
||||
ifr = ifc.ifc_req;
|
||||
|
||||
cplim = buffer + ifc.ifc_len;
|
||||
|
||||
for (cp=buffer; cp < cplim; )
|
||||
{
|
||||
ifr = (struct ifreq *)cp;
|
||||
if (ifr->ifr_addr.sa_family == AF_LINK)
|
||||
{
|
||||
struct sockaddr_dl *sdl = (struct sockaddr_dl *)&ifr->ifr_addr;
|
||||
int a,b,c,d,e,f;
|
||||
int i;
|
||||
|
||||
strcpy(temp, (char *)ether_ntoa((const struct ether_addr *)LLADDR(sdl)));
|
||||
sscanf(temp, "%x:%x:%x:%x:%x:%x", &a, &b, &c, &d, &e, &f);
|
||||
sprintf(temp, "%02X:%02X:%02X:%02X:%02X:%02X",a,b,c,d,e,f);
|
||||
|
||||
for (i=0; i<MAXADDRS; ++i)
|
||||
{
|
||||
if ((if_names[i] != NULL) && (strcmp(ifr->ifr_name, if_names[i]) == 0))
|
||||
{
|
||||
if (hw_addrs[i] == NULL)
|
||||
{
|
||||
hw_addrs[i] = (char *)malloc(strlen(temp)+1);
|
||||
strcpy(hw_addrs[i], temp);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
cp += sizeof(ifr->ifr_name) + max(sizeof(ifr->ifr_addr), ifr->ifr_addr.sa_len);
|
||||
}
|
||||
close(sockfd);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// IPAddress.h
|
||||
// ManagerDemo
|
||||
//
|
||||
// Created by xmfish on 14/11/10.
|
||||
// Copyright (c) 2014年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef ManagerDemo_IPAddress_h
|
||||
#define ManagerDemo_IPAddress_h
|
||||
|
||||
#define MAXADDRS 32
|
||||
|
||||
extern char *if_names[MAXADDRS];
|
||||
extern char *ip_names[MAXADDRS];
|
||||
extern char *hw_addrs[MAXADDRS];
|
||||
extern unsigned long ip_addrs[MAXADDRS];
|
||||
|
||||
// Function prototypes
|
||||
|
||||
void InitAddresses();
|
||||
void FreeAddresses();
|
||||
void GetIPAddresses();
|
||||
void GetHWAddresses();
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,217 @@
|
||||
//
|
||||
// IPGet.cpp
|
||||
// ManagerDemo
|
||||
//
|
||||
// Created by xmfish on 14/11/10.
|
||||
// Copyright (c) 2014年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/sockio.h>
|
||||
#include <net/if.h>
|
||||
#include <errno.h>
|
||||
#include <net/if_dl.h>
|
||||
#include <net/ethernet.h>
|
||||
#include "IPGet.h"
|
||||
|
||||
#define min(a,b) ((a) < (b) ? (a) : (b))
|
||||
#define max(a,b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
#define BUFFERSIZE 4000
|
||||
|
||||
char *if_names[MAXADDRS];
|
||||
char *ip_names[MAXADDRS];
|
||||
char *hw_addrs[MAXADDRS];
|
||||
unsigned long ip_addrs[MAXADDRS];
|
||||
|
||||
static int nextAddr = 0;
|
||||
|
||||
void InitAddresses()
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<MAXADDRS; ++i)
|
||||
{
|
||||
if_names[i] = ip_names[i] = hw_addrs[i] = NULL;
|
||||
ip_addrs[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void FreeAddresses()
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<MAXADDRS; ++i)
|
||||
{
|
||||
if (if_names[i] != 0) free(if_names[i]);
|
||||
if (ip_names[i] != 0) free(ip_names[i]);
|
||||
if (hw_addrs[i] != 0) free(hw_addrs[i]);
|
||||
ip_addrs[i] = 0;
|
||||
}
|
||||
InitAddresses();
|
||||
}
|
||||
|
||||
void GetIPAddresses()
|
||||
{
|
||||
int i, len, flags;
|
||||
char buffer[BUFFERSIZE], *ptr, lastname[IFNAMSIZ], *cptr;
|
||||
struct ifconf ifc;
|
||||
struct ifreq *ifr, ifrcopy;
|
||||
struct sockaddr_in *sin;
|
||||
|
||||
char temp[80];
|
||||
|
||||
int sockfd;
|
||||
|
||||
for (i=0; i<MAXADDRS; ++i)
|
||||
{
|
||||
if_names[i] = ip_names[i] = NULL;
|
||||
ip_addrs[i] = 0;
|
||||
}
|
||||
|
||||
sockfd = socket(AF_INET, SOCK_DGRAM, 0);
|
||||
if (sockfd < 0)
|
||||
{
|
||||
perror("socket failed");
|
||||
return;
|
||||
}
|
||||
|
||||
ifc.ifc_len = BUFFERSIZE;
|
||||
ifc.ifc_buf = buffer;
|
||||
|
||||
if (ioctl(sockfd, SIOCGIFCONF, &ifc) < 0)
|
||||
{
|
||||
perror("ioctl error");
|
||||
return;
|
||||
}
|
||||
|
||||
lastname[0] = 0;
|
||||
|
||||
for (ptr = buffer; ptr < buffer + ifc.ifc_len; )
|
||||
{
|
||||
ifr = (struct ifreq *)ptr;
|
||||
len = max(sizeof(struct sockaddr), ifr->ifr_addr.sa_len);
|
||||
ptr += sizeof(ifr->ifr_name) + len; // for next one in buffer
|
||||
|
||||
if (ifr->ifr_addr.sa_family != AF_INET)
|
||||
{
|
||||
continue; // ignore if not desired address family
|
||||
}
|
||||
|
||||
if ((cptr = (char *)strchr(ifr->ifr_name, ':')) != NULL)
|
||||
{
|
||||
*cptr = 0; // replace colon will null
|
||||
}
|
||||
|
||||
if (strncmp(lastname, ifr->ifr_name, IFNAMSIZ) == 0)
|
||||
{
|
||||
continue; /* already processed this interface */
|
||||
}
|
||||
|
||||
memcpy(lastname, ifr->ifr_name, IFNAMSIZ);
|
||||
|
||||
ifrcopy = *ifr;
|
||||
ioctl(sockfd, SIOCGIFFLAGS, &ifrcopy);
|
||||
flags = ifrcopy.ifr_flags;
|
||||
if ((flags & IFF_UP) == 0)
|
||||
{
|
||||
continue; // ignore if interface not up
|
||||
}
|
||||
|
||||
if_names[nextAddr] = (char *)malloc(strlen(ifr->ifr_name)+1);
|
||||
if (if_names[nextAddr] == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
strcpy(if_names[nextAddr], ifr->ifr_name);
|
||||
|
||||
sin = (struct sockaddr_in *)&ifr->ifr_addr;
|
||||
strcpy(temp, inet_ntoa(sin->sin_addr));
|
||||
|
||||
ip_names[nextAddr] = (char *)malloc(strlen(temp)+1);
|
||||
if (ip_names[nextAddr] == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
strcpy(ip_names[nextAddr], temp);
|
||||
|
||||
ip_addrs[nextAddr] = sin->sin_addr.s_addr;
|
||||
|
||||
++nextAddr;
|
||||
}
|
||||
|
||||
close(sockfd);
|
||||
}
|
||||
|
||||
void GetHWAddresses()
|
||||
{
|
||||
struct ifconf ifc;
|
||||
struct ifreq *ifr;
|
||||
int i, sockfd;
|
||||
char buffer[BUFFERSIZE], *cp, *cplim;
|
||||
char temp[80];
|
||||
|
||||
for (i=0; i<MAXADDRS; ++i)
|
||||
{
|
||||
hw_addrs[i] = NULL;
|
||||
}
|
||||
|
||||
sockfd = socket(AF_INET, SOCK_DGRAM, 0);
|
||||
if (sockfd < 0)
|
||||
{
|
||||
perror("socket failed");
|
||||
return;
|
||||
}
|
||||
|
||||
ifc.ifc_len = BUFFERSIZE;
|
||||
ifc.ifc_buf = buffer;
|
||||
|
||||
if (ioctl(sockfd, SIOCGIFCONF, (char *)&ifc) < 0)
|
||||
{
|
||||
perror("ioctl error");
|
||||
close(sockfd);
|
||||
return;
|
||||
}
|
||||
|
||||
ifr = ifc.ifc_req;
|
||||
|
||||
cplim = buffer + ifc.ifc_len;
|
||||
|
||||
for (cp=buffer; cp < cplim; )
|
||||
{
|
||||
ifr = (struct ifreq *)cp;
|
||||
if (ifr->ifr_addr.sa_family == AF_LINK)
|
||||
{
|
||||
struct sockaddr_dl *sdl = (struct sockaddr_dl *)&ifr->ifr_addr;
|
||||
int a,b,c,d,e,f;
|
||||
int i;
|
||||
|
||||
strcpy(temp, (char *)ether_ntoa((const struct ether_addr *)LLADDR(sdl)));
|
||||
sscanf(temp, "%x:%x:%x:%x:%x:%x", &a, &b, &c, &d, &e, &f);
|
||||
sprintf(temp, "%02X:%02X:%02X:%02X:%02X:%02X",a,b,c,d,e,f);
|
||||
|
||||
for (i=0; i<MAXADDRS; ++i)
|
||||
{
|
||||
if ((if_names[i] != NULL) && (strcmp(ifr->ifr_name, if_names[i]) == 0))
|
||||
{
|
||||
if (hw_addrs[i] == NULL)
|
||||
{
|
||||
hw_addrs[i] = (char *)malloc(strlen(temp)+1);
|
||||
strcpy(hw_addrs[i], temp);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
cp += sizeof(ifr->ifr_name) + max(sizeof(ifr->ifr_addr), ifr->ifr_addr.sa_len);
|
||||
}
|
||||
close(sockfd);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// IPGet.h
|
||||
// ManagerDemo
|
||||
//
|
||||
// Created by xmfish on 14/11/10.
|
||||
// Copyright (c) 2014年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef __ManagerDemo__IPGet__
|
||||
#define __ManagerDemo__IPGet__
|
||||
|
||||
#include <iostream>
|
||||
#define MAXADDRS 32
|
||||
|
||||
extern char *if_names[MAXADDRS];
|
||||
extern char *ip_names[MAXADDRS];
|
||||
extern char *hw_addrs[MAXADDRS];
|
||||
extern unsigned long ip_addrs[MAXADDRS];
|
||||
|
||||
// Function prototypes
|
||||
|
||||
void InitAddresses();
|
||||
void FreeAddresses();
|
||||
void GetIPAddresses();
|
||||
void GetHWAddresses();
|
||||
#endif /* defined(__ManagerDemo__IPGet__) */
|
||||
@@ -0,0 +1,65 @@
|
||||
//
|
||||
// OpenUDID.h
|
||||
// openudid
|
||||
//
|
||||
// initiated by Yann Lechelle (cofounder @Appsfire) on 8/28/11.
|
||||
// Copyright 2011 OpenUDID.org
|
||||
//
|
||||
// Main branches
|
||||
// iOS code: https://github.com/ylechelle/OpenUDID
|
||||
//
|
||||
|
||||
/*
|
||||
!!! IMPORTANT !!!
|
||||
|
||||
IF YOU ARE GOING TO INTEGRATE OpenUDID INSIDE A (STATIC) LIBRARY,
|
||||
PLEASE MAKE SURE YOU REFACTOR THE OpenUDID CLASS WITH A PREFIX OF YOUR OWN,
|
||||
E.G. ACME_OpenUDID. THIS WILL AVOID CONFUSION BY DEVELOPERS WHO ARE ALSO
|
||||
USING OpenUDID IN THEIR OWN CODE.
|
||||
|
||||
!!! IMPORTANT !!!
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
http://en.wikipedia.org/wiki/Zlib_License
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
//
|
||||
// Usage:
|
||||
// #include "OpenUDID.h"
|
||||
// NSString* openUDID = [OpenUDID value];
|
||||
//
|
||||
|
||||
#define kOpenUDIDErrorNone 0
|
||||
#define kOpenUDIDErrorOptedOut 1
|
||||
#define kOpenUDIDErrorCompromised 2
|
||||
|
||||
@interface OpenUDID : NSObject {
|
||||
}
|
||||
+ (NSString*) value;
|
||||
+ (NSString*) valueWithError:(NSError**)error;
|
||||
+ (void) setOptOut:(BOOL)optOutValue;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,383 @@
|
||||
//
|
||||
// OpenUDID.m
|
||||
// openudid
|
||||
//
|
||||
// initiated by Yann Lechelle (cofounder @Appsfire) on 8/28/11.
|
||||
// Copyright 2011 OpenUDID.org
|
||||
//
|
||||
// Initiators/root branches
|
||||
// iOS code: https://github.com/ylechelle/OpenUDID
|
||||
// Android code: https://github.com/vieux/OpenUDID
|
||||
//
|
||||
// Contributors:
|
||||
// https://github.com/ylechelle/OpenUDID/contributors
|
||||
//
|
||||
|
||||
/*
|
||||
http://en.wikipedia.org/wiki/Zlib_License
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
*/
|
||||
|
||||
#if __has_feature(objc_arc)
|
||||
#error This file uses the classic non-ARC retain/release model; hints below...
|
||||
// to selectively compile this file as non-ARC, do as follows:
|
||||
// https://img.skitch.com/20120717-g3ag5h9a6ehkgpmpjiuen3qpwp.png
|
||||
#endif
|
||||
|
||||
#import "OpenUDID.h"
|
||||
#import <CommonCrypto/CommonDigest.h> // Need to import for CC_MD5 access
|
||||
#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
|
||||
#import <UIKit/UIPasteboard.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
#else
|
||||
#import <AppKit/NSPasteboard.h>
|
||||
#endif
|
||||
|
||||
#define OpenUDIDLog(fmt, ...)
|
||||
//#define OpenUDIDLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
|
||||
//#define OpenUDIDLog(fmt, ...) NSLog((@"[Line %d] " fmt), __LINE__, ##__VA_ARGS__);
|
||||
|
||||
static NSString * kOpenUDIDSessionCache = nil;
|
||||
static NSString * const kOpenUDIDKey = @"OpenUDID";
|
||||
static NSString * const kOpenUDIDSlotKey = @"OpenUDID_slot";
|
||||
static NSString * const kOpenUDIDAppUIDKey = @"OpenUDID_appUID";
|
||||
static NSString * const kOpenUDIDTSKey = @"OpenUDID_createdTS";
|
||||
static NSString * const kOpenUDIDOOTSKey = @"OpenUDID_optOutTS";
|
||||
static NSString * const kOpenUDIDDomain = @"org.OpenUDID";
|
||||
static NSString * const kOpenUDIDSlotPBPrefix = @"org.OpenUDID.slot.";
|
||||
static int const kOpenUDIDRedundancySlots = 100;
|
||||
|
||||
@interface OpenUDID (Private)
|
||||
+ (void) _setDict:(id)dict forPasteboard:(id)pboard;
|
||||
+ (NSMutableDictionary*) _getDictFromPasteboard:(id)pboard;
|
||||
+ (NSString*) _generateFreshOpenUDID;
|
||||
@end
|
||||
|
||||
@implementation OpenUDID
|
||||
|
||||
// Archive a NSDictionary inside a pasteboard of a given type
|
||||
// Convenience method to support iOS & Mac OS X
|
||||
//
|
||||
+ (void) _setDict:(id)dict forPasteboard:(id)pboard {
|
||||
#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
|
||||
[pboard setData:[NSKeyedArchiver archivedDataWithRootObject:dict] forPasteboardType:kOpenUDIDDomain];
|
||||
#else
|
||||
[pboard setData:[NSKeyedArchiver archivedDataWithRootObject:dict] forType:kOpenUDIDDomain];
|
||||
#endif
|
||||
}
|
||||
|
||||
// Retrieve an NSDictionary from a pasteboard of a given type
|
||||
// Convenience method to support iOS & Mac OS X
|
||||
//
|
||||
+ (NSMutableDictionary*) _getDictFromPasteboard:(id)pboard {
|
||||
#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
|
||||
id item = [pboard dataForPasteboardType:kOpenUDIDDomain];
|
||||
#else
|
||||
id item = [pboard dataForType:kOpenUDIDDomain];
|
||||
#endif
|
||||
if (item) {
|
||||
@try{
|
||||
item = [NSKeyedUnarchiver unarchiveObjectWithData:item];
|
||||
} @catch(NSException* e) {
|
||||
OpenUDIDLog(@"Unable to unarchive item %@ on pasteboard!", [pboard name]);
|
||||
item = nil;
|
||||
}
|
||||
}
|
||||
|
||||
// return an instance of a MutableDictionary
|
||||
return [NSMutableDictionary dictionaryWithDictionary:(item == nil || [item isKindOfClass:[NSDictionary class]]) ? item : nil];
|
||||
}
|
||||
|
||||
// Private method to create and return a new OpenUDID
|
||||
// Theoretically, this function is called once ever per application when calling [OpenUDID value] for the first time.
|
||||
// After that, the caching/pasteboard/redundancy mechanism inside [OpenUDID value] returns a persistent and cross application OpenUDID
|
||||
//
|
||||
+ (NSString*) _generateFreshOpenUDID {
|
||||
|
||||
NSString* _openUDID = nil;
|
||||
|
||||
// August 2011: One day, this may no longer be allowed in iOS. When that is, just comment this line out.
|
||||
// March 25th 2012: this day has come, let's remove this "outlawed" call...
|
||||
#if TARGET_OS_IPHONE
|
||||
// if([UIDevice instancesRespondToSelector:@selector(uniqueIdentifier)]){
|
||||
// _openUDID = [[UIDevice currentDevice] uniqueIdentifier];
|
||||
// }
|
||||
#endif
|
||||
// Next we generate a UUID.
|
||||
// UUIDs (Universally Unique Identifiers), also known as GUIDs (Globally Unique Identifiers) or IIDs
|
||||
// (Interface Identifiers), are 128-bit values guaranteed to be unique. A UUID is made unique over
|
||||
// both space and time by combining a value unique to the computer on which it was generated—usually the
|
||||
// Ethernet hardware address—and a value representing the number of 100-nanosecond intervals since
|
||||
// October 15, 1582 at 00:00:00.
|
||||
// We then hash this UUID with md5 to get 32 bytes, and then add 4 extra random bytes
|
||||
// Collision is possible of course, but unlikely and suitable for most industry needs (e.g. aggregate tracking)
|
||||
//
|
||||
if (_openUDID==nil) {
|
||||
CFUUIDRef uuid = CFUUIDCreate(kCFAllocatorDefault);
|
||||
CFStringRef cfstring = CFUUIDCreateString(kCFAllocatorDefault, uuid);
|
||||
const char *cStr = CFStringGetCStringPtr(cfstring,CFStringGetFastestEncoding(cfstring));
|
||||
unsigned char result[16];
|
||||
CC_MD5( cStr, strlen(cStr), result );
|
||||
CFRelease(uuid);
|
||||
|
||||
_openUDID = [NSString stringWithFormat:
|
||||
@"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%08x",
|
||||
result[0], result[1], result[2], result[3],
|
||||
result[4], result[5], result[6], result[7],
|
||||
result[8], result[9], result[10], result[11],
|
||||
result[12], result[13], result[14], result[15],
|
||||
(NSUInteger)(arc4random() % NSUIntegerMax)];
|
||||
}
|
||||
|
||||
// Call to other developers in the Open Source community:
|
||||
//
|
||||
// feel free to suggest better or alternative "UDID" generation code above.
|
||||
// NOTE that the goal is NOT to find a better hash method, but rather, find a decentralized (i.e. not web-based)
|
||||
// 160 bits / 20 bytes random string generator with the fewest possible collisions.
|
||||
//
|
||||
|
||||
return _openUDID;
|
||||
}
|
||||
|
||||
|
||||
// Main public method that returns the OpenUDID
|
||||
// This method will generate and store the OpenUDID if it doesn't exist, typically the first time it is called
|
||||
// It will return the null udid (forty zeros) if the user has somehow opted this app out (this is subject to 3rd party implementation)
|
||||
// Otherwise, it will register the current app and return the OpenUDID
|
||||
//
|
||||
+ (NSString*) value {
|
||||
return [OpenUDID valueWithError:nil];
|
||||
}
|
||||
|
||||
+ (NSString*) valueWithError:(NSError **)error {
|
||||
|
||||
if (kOpenUDIDSessionCache!=nil) {
|
||||
if (error!=nil)
|
||||
*error = [NSError errorWithDomain:kOpenUDIDDomain
|
||||
code:kOpenUDIDErrorNone
|
||||
userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"OpenUDID in cache from first call",@"description", nil]];
|
||||
return kOpenUDIDSessionCache;
|
||||
}
|
||||
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
// The AppUID will uniquely identify this app within the pastebins
|
||||
//
|
||||
NSString * appUID = (NSString *) [defaults objectForKey:kOpenUDIDAppUIDKey];
|
||||
if(appUID == nil)
|
||||
{
|
||||
// generate a new uuid and store it in user defaults
|
||||
CFUUIDRef uuid = CFUUIDCreate(NULL);
|
||||
appUID = (NSString *) CFUUIDCreateString(NULL, uuid);
|
||||
CFRelease(uuid);
|
||||
}
|
||||
|
||||
NSString* openUDID = nil;
|
||||
NSString* myRedundancySlotPBid = nil;
|
||||
NSDate* optedOutDate = nil;
|
||||
BOOL optedOut = NO;
|
||||
BOOL saveLocalDictToDefaults = NO;
|
||||
BOOL isCompromised = NO;
|
||||
|
||||
// Do we have a local copy of the OpenUDID dictionary?
|
||||
// This local copy contains a copy of the openUDID, myRedundancySlotPBid (and unused in this block, the local bundleid, and the timestamp)
|
||||
//
|
||||
id localDict = [defaults objectForKey:kOpenUDIDKey];
|
||||
if ([localDict isKindOfClass:[NSDictionary class]]) {
|
||||
localDict = [NSMutableDictionary dictionaryWithDictionary:localDict]; // we might need to set/overwrite the redundancy slot
|
||||
openUDID = [localDict objectForKey:kOpenUDIDKey];
|
||||
myRedundancySlotPBid = [localDict objectForKey:kOpenUDIDSlotKey];
|
||||
optedOutDate = [localDict objectForKey:kOpenUDIDOOTSKey];
|
||||
optedOut = optedOutDate!=nil;
|
||||
OpenUDIDLog(@"localDict = %@",localDict);
|
||||
}
|
||||
|
||||
// Here we go through a sequence of slots, each of which being a UIPasteboard created by each participating app
|
||||
// The idea behind this is to both multiple and redundant representations of OpenUDIDs, as well as serve as placeholder for potential opt-out
|
||||
//
|
||||
NSString* availableSlotPBid = nil;
|
||||
NSMutableDictionary* frequencyDict = [NSMutableDictionary dictionaryWithCapacity:kOpenUDIDRedundancySlots];
|
||||
for (int n=0; n<kOpenUDIDRedundancySlots; n++) {
|
||||
NSString* slotPBid = [NSString stringWithFormat:@"%@%d",kOpenUDIDSlotPBPrefix,n];
|
||||
#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
|
||||
UIPasteboard* slotPB = [UIPasteboard pasteboardWithName:slotPBid create:NO];
|
||||
#else
|
||||
NSPasteboard* slotPB = [NSPasteboard pasteboardWithName:slotPBid];
|
||||
#endif
|
||||
OpenUDIDLog(@"SlotPB name = %@",slotPBid);
|
||||
if (slotPB==nil) {
|
||||
// assign availableSlotPBid to be the first one available
|
||||
if (availableSlotPBid==nil) availableSlotPBid = slotPBid;
|
||||
} else {
|
||||
NSDictionary* dict = [OpenUDID _getDictFromPasteboard:slotPB];
|
||||
NSString* oudid = [dict objectForKey:kOpenUDIDKey];
|
||||
OpenUDIDLog(@"SlotPB dict = %@",dict);
|
||||
if (oudid==nil) {
|
||||
// availableSlotPBid could inside a non null slot where no oudid can be found
|
||||
if (availableSlotPBid==nil) availableSlotPBid = slotPBid;
|
||||
} else {
|
||||
// increment the frequency of this oudid key
|
||||
int count = [[frequencyDict valueForKey:oudid] intValue];
|
||||
[frequencyDict setObject:[NSNumber numberWithInt:++count] forKey:oudid];
|
||||
}
|
||||
// if we have a match with the app unique id,
|
||||
// then let's look if the external UIPasteboard representation marks this app as OptedOut
|
||||
NSString* gid = [dict objectForKey:kOpenUDIDAppUIDKey];
|
||||
if (gid!=nil && [gid isEqualToString:appUID]) {
|
||||
myRedundancySlotPBid = slotPBid;
|
||||
// the local dictionary is prime on the opt-out subject, so ignore if already opted-out locally
|
||||
if (optedOut) {
|
||||
optedOutDate = [dict objectForKey:kOpenUDIDOOTSKey];
|
||||
optedOut = optedOutDate!=nil;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// sort the Frequency dict with highest occurence count of the same OpenUDID (redundancy, failsafe)
|
||||
// highest is last in the list
|
||||
//
|
||||
NSArray* arrayOfUDIDs = [frequencyDict keysSortedByValueUsingSelector:@selector(compare:)];
|
||||
NSString* mostReliableOpenUDID = (arrayOfUDIDs!=nil && [arrayOfUDIDs count]>0)? [arrayOfUDIDs lastObject] : nil;
|
||||
OpenUDIDLog(@"Freq Dict = %@\nMost reliable %@",frequencyDict,mostReliableOpenUDID);
|
||||
|
||||
// if openUDID was not retrieved from the local preferences, then let's try to get it from the frequency dictionary above
|
||||
//
|
||||
if (openUDID==nil) {
|
||||
if (mostReliableOpenUDID==nil) {
|
||||
// this is the case where this app instance is likely to be the first one to use OpenUDID on this device
|
||||
// we create the OpenUDID, legacy or semi-random (i.e. most certainly unique)
|
||||
//
|
||||
openUDID = [OpenUDID _generateFreshOpenUDID];
|
||||
} else {
|
||||
// or we leverage the OpenUDID shared by other apps that have already gone through the process
|
||||
//
|
||||
openUDID = mostReliableOpenUDID;
|
||||
}
|
||||
// then we create a local representation
|
||||
//
|
||||
if (localDict==nil) {
|
||||
localDict = [NSMutableDictionary dictionaryWithCapacity:4];
|
||||
[localDict setObject:openUDID forKey:kOpenUDIDKey];
|
||||
[localDict setObject:appUID forKey:kOpenUDIDAppUIDKey];
|
||||
[localDict setObject:[NSDate date] forKey:kOpenUDIDTSKey];
|
||||
if (optedOut) [localDict setObject:optedOutDate forKey:kOpenUDIDTSKey];
|
||||
saveLocalDictToDefaults = YES;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Sanity/tampering check
|
||||
//
|
||||
if (mostReliableOpenUDID!=nil && ![mostReliableOpenUDID isEqualToString:openUDID])
|
||||
isCompromised = YES;
|
||||
}
|
||||
|
||||
// Here we store in the available PB slot, if applicable
|
||||
//
|
||||
OpenUDIDLog(@"Available Slot %@ Existing Slot %@",availableSlotPBid,myRedundancySlotPBid);
|
||||
if (availableSlotPBid!=nil && (myRedundancySlotPBid==nil || [availableSlotPBid isEqualToString:myRedundancySlotPBid])) {
|
||||
#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
|
||||
UIPasteboard* slotPB = [UIPasteboard pasteboardWithName:availableSlotPBid create:YES];
|
||||
[slotPB setPersistent:YES];
|
||||
#else
|
||||
NSPasteboard* slotPB = [NSPasteboard pasteboardWithName:availableSlotPBid];
|
||||
#endif
|
||||
|
||||
// save slotPBid to the defaults, and remember to save later
|
||||
//
|
||||
if (localDict) {
|
||||
[localDict setObject:availableSlotPBid forKey:kOpenUDIDSlotKey];
|
||||
saveLocalDictToDefaults = YES;
|
||||
}
|
||||
|
||||
// Save the local dictionary to the corresponding UIPasteboard slot
|
||||
//
|
||||
if (openUDID && localDict)
|
||||
[OpenUDID _setDict:localDict forPasteboard:slotPB];
|
||||
}
|
||||
|
||||
// Save the dictionary locally if applicable
|
||||
//
|
||||
if (localDict && saveLocalDictToDefaults)
|
||||
[defaults setObject:localDict forKey:kOpenUDIDKey];
|
||||
|
||||
// If the UIPasteboard external representation marks this app as opted-out, then to respect privacy, we return the ZERO OpenUDID, a sequence of 40 zeros...
|
||||
// This is a *new* case that developers have to deal with. Unlikely, statistically low, but still.
|
||||
// To circumvent this and maintain good tracking (conversion ratios, etc.), developers are invited to calculate how many of their users have opted-out from the full set of users.
|
||||
// This ratio will let them extrapolate convertion ratios more accurately.
|
||||
//
|
||||
if (optedOut) {
|
||||
if (error!=nil) *error = [NSError errorWithDomain:kOpenUDIDDomain
|
||||
code:kOpenUDIDErrorOptedOut
|
||||
userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"Application with unique id %@ is opted-out from OpenUDID as of %@",appUID,optedOutDate],@"description", nil]];
|
||||
|
||||
kOpenUDIDSessionCache = [[NSString stringWithFormat:@"%040x",0] retain];
|
||||
return kOpenUDIDSessionCache;
|
||||
}
|
||||
|
||||
// return the well earned openUDID!
|
||||
//
|
||||
if (error!=nil) {
|
||||
if (isCompromised)
|
||||
*error = [NSError errorWithDomain:kOpenUDIDDomain
|
||||
code:kOpenUDIDErrorCompromised
|
||||
userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"Found a discrepancy between stored OpenUDID (reliable) and redundant copies; one of the apps on the device is most likely corrupting the OpenUDID protocol",@"description", nil]];
|
||||
else
|
||||
*error = [NSError errorWithDomain:kOpenUDIDDomain
|
||||
code:kOpenUDIDErrorNone
|
||||
userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"OpenUDID succesfully retrieved",@"description", nil]];
|
||||
}
|
||||
kOpenUDIDSessionCache = [openUDID retain];
|
||||
return kOpenUDIDSessionCache;
|
||||
}
|
||||
|
||||
+ (void) setOptOut:(BOOL)optOutValue {
|
||||
|
||||
// init call
|
||||
[OpenUDID value];
|
||||
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
// load the dictionary from local cache or create one
|
||||
id dict = [defaults objectForKey:kOpenUDIDKey];
|
||||
if ([dict isKindOfClass:[NSDictionary class]]) {
|
||||
dict = [NSMutableDictionary dictionaryWithDictionary:dict];
|
||||
} else {
|
||||
dict = [NSMutableDictionary dictionaryWithCapacity:2];
|
||||
}
|
||||
|
||||
// set the opt-out date or remove key, according to parameter
|
||||
if (optOutValue)
|
||||
[dict setObject:[NSDate date] forKey:kOpenUDIDOOTSKey];
|
||||
else
|
||||
[dict removeObjectForKey:kOpenUDIDOOTSKey];
|
||||
|
||||
// store the dictionary locally
|
||||
[defaults setObject:dict forKey:kOpenUDIDKey];
|
||||
|
||||
OpenUDIDLog(@"Local dict after opt-out = %@",dict);
|
||||
|
||||
// reset memory cache
|
||||
kOpenUDIDSessionCache = nil;
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,58 @@
|
||||
IMPORTANT: IF YOU ARE GOING TO INTEGRATE OpenUDID INSIDE A (STATIC) LIBRARY,
|
||||
PLEASE MAKE SURE YOU REFACTOR THE OpenUDID CLASS WITH A PREFIX OF YOUR OWN,
|
||||
E.G. ACME_OpenUDID. THIS WILL AVOID CONFUSION BY DEVELOPERS WHO ARE ALSO
|
||||
USING OpenUDID IN THEIR OWN CODE.
|
||||
|
||||

|
||||
|
||||
####Follow OpenUDID on Twitter
|
||||
http://twitter.com/OpenUDID
|
||||
|
||||
####Who is behind OpenUDID
|
||||
The project was initiated by Yann Lechelle (co-founder Appsfire) on 8/28/11
|
||||
|
||||
- https://github.com/ylechelle
|
||||
|
||||
Many have joined the effort since. Please browse this github projects to discover the many contributors (discussions, code, pull requests, alternative branches, etc…)
|
||||
|
||||
- https://github.com/ylechelle/OpenUDID/network
|
||||
- https://github.com/ylechelle/OpenUDID/contributors
|
||||
- https://github.com/ylechelle/OpenUDID/issues
|
||||
|
||||
####Master Branches & ports to other OSes
|
||||
- iOS / MacOS code: https://github.com/ylechelle/OpenUDID
|
||||
- Android code: https://github.com/vieux/OpenUDID
|
||||
- CSharp.Net & SilverLight: https://github.com/jasonlamkk/OpenUDID.Net
|
||||
|
||||
####Usage
|
||||
|
||||
#include "OpenUDID.h"
|
||||
NSString* openUDID = [OpenUDID value];
|
||||
|
||||
####Synopsis
|
||||
OpenUDID is a drop-in replacement for the deprecated uniqueIdentifier property of the UIDevice class on iOS (a.k.a. UDID) and otherwise is an industry-friendly equivalent for iOS and Android, **and most recently Windows C# and Silverlight (see links above)**.
|
||||
|
||||
The agenda for this community driven project is to:
|
||||
- Provide a reliable proxy and replacement for a universal unique device identifier. That is, persistent and sufficiently unique, on a per device basis.
|
||||
- NOT use an obvious other sensitive unique identifier (like the MAC address) to avoid further deprecation and to protect device-level privacy concerns
|
||||
- Enable the same OpenUDID to be accessed by any app on the same device
|
||||
- Supply open-source code to generate and access the OpenUDID, for iOS and Android
|
||||
- Incorporate, from the beginning, a system that will enable user opt-out to match Apple’s initial intent
|
||||
|
||||
####Context
|
||||
If you’re not already familiar with UDID’s, it’s a critical piece of information used for analytics or CRM purposes. A developer could use a UDID as a means to track how much time a user spent in his free app before upgrading to the paid version. UDIDs are also helpful for tracking the source of a download when advertising on an ad network. This is a fairly universal need in a thriving ecosystem: developers need the traceability from clicks to downloads to ensure that they pay the right price for their promotion. Proper tracking and funnel conversion is what has made the web a better place, with healthy competition and quantifiable metrics.
|
||||
|
||||
In the wake of Apple’s decision to deprecate UDID, some ad networks have already introduced their own proprietary solutions or worse adopted a low hanging fruit like the MAC address. The main motivation here was to find a UDID replacement not owned by any single provider, not bound to the device in the hardware sense. This open source initiative is to enable a better solution for thousands of other mobile app developers.
|
||||
|
||||
#####Version History
|
||||
- August 2011: launch of the initiative
|
||||
- Sept. 9 2011: v1.0 of the code meeting all requirements
|
||||
- March. 25 2012: removing all traces of the offending call on iOS
|
||||
|
||||
####Contributions needed
|
||||
Equivalent OpenUDID systems on Blackberry, other platforms, etc...
|
||||
|
||||
####Seals to add on your sites if you use OpenUDID
|
||||

|
||||

|
||||

|
||||
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// CardAddViewController.h
|
||||
// ManagerDemo
|
||||
//
|
||||
// Created by xmfish on 14/11/9.
|
||||
// Copyright (c) 2014年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface CardAddViewController : UIViewController<UITableViewDelegate,UITableViewDataSource>
|
||||
@property (weak, nonatomic) IBOutlet UITableView *tableView;
|
||||
@property (strong, nonatomic) IBOutlet UITableViewCell *cardTableViewCell;
|
||||
@property (strong, nonatomic) IBOutlet UITableViewCell *nextTableViewCell;
|
||||
@property (assign, nonatomic)NSInteger amount;
|
||||
@property (strong, nonatomic)NSString* proId;
|
||||
|
||||
- (IBAction)nextBtnClick:(id)sender;
|
||||
@property (weak, nonatomic) IBOutlet UITextField *cardTextField;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,106 @@
|
||||
//
|
||||
// CardAddViewController.m
|
||||
// ManagerDemo
|
||||
//
|
||||
// Created by xmfish on 14/11/9.
|
||||
// Copyright (c) 2014年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#import "CardAddViewController.h"
|
||||
#import "OrderPassWordViewController.h"
|
||||
#import "CardBindViewController.h"
|
||||
@interface CardAddViewController ()
|
||||
|
||||
@end
|
||||
|
||||
@implementation CardAddViewController
|
||||
|
||||
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
|
||||
{
|
||||
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
||||
if (self) {
|
||||
// Custom initialization
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view from its nib.
|
||||
self.navigationItem.title = @"输入银行卡";
|
||||
_tableView.delegate = self;
|
||||
_tableView.dataSource = self;
|
||||
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
}
|
||||
|
||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
||||
{
|
||||
|
||||
return 1;
|
||||
}
|
||||
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
UITableViewCell* cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
|
||||
switch (indexPath.section) {
|
||||
case 0:
|
||||
_cardTableViewCell.textLabel.text = @"卡号";
|
||||
return _cardTableViewCell;
|
||||
break;
|
||||
case 1:
|
||||
return _nextTableViewCell;
|
||||
break;
|
||||
default:
|
||||
return cell;
|
||||
break;
|
||||
}
|
||||
return cell;
|
||||
}
|
||||
- (void)didReceiveMemoryWarning
|
||||
{
|
||||
[super didReceiveMemoryWarning];
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
- (IBAction)nextBtnClick:(id)sender {
|
||||
if ([_cardTextField.text isEqualToString:@""]) {
|
||||
[MBProgressHUD errorHudWithView:self.view label:@"请输入卡号" hidesAfter:1.0];
|
||||
return;
|
||||
}
|
||||
[MBProgressHUD hudWithView:self.view label:@"安全加载中"];
|
||||
DaiDaiTongTestApi* daiDaiTongTestApi = [DaiDaiTongTestApi shareInstance];
|
||||
[daiDaiTongTestApi getApiWithParam:@{@"cardNo": _cardTextField.text} withApiType:@"bankCardCheck" completionBlock:^(id jsonRes) {
|
||||
if ([[jsonRes objectForKey:@"resultflag"] integerValue] == 1) {
|
||||
[MBProgressHUD errorHudWithView:self.view label:[jsonRes objectForKey:@"resultMsg"] hidesAfter:1.0];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC*1.0), dispatch_get_main_queue(), ^{
|
||||
});
|
||||
|
||||
}else{
|
||||
[MBProgressHUD hideAllHUDsForView:self.view animated:YES];
|
||||
if([[jsonRes objectForKey:@"resultflag"] integerValue] == 2){
|
||||
CardBindViewController* cardBindViewController = [[CardBindViewController alloc] init];
|
||||
cardBindViewController.amount = _amount;
|
||||
cardBindViewController.proId = _proId;
|
||||
cardBindViewController.cardNo = _cardTextField.text;
|
||||
cardBindViewController.type = [[jsonRes objectForKey:@"cardtype"] integerValue];
|
||||
[self.navigationController pushViewController:cardBindViewController animated:YES];
|
||||
}else{
|
||||
OrderPassWordViewController* orderPassWordViewController = [[OrderPassWordViewController alloc] init];
|
||||
orderPassWordViewController.amount = _amount;
|
||||
orderPassWordViewController.proId = _proId;
|
||||
orderPassWordViewController.type = 1;
|
||||
orderPassWordViewController.cardNo = _cardTextField.text;
|
||||
orderPassWordViewController.bindid = [[jsonRes objectForKey:@"bindid"] integerValue];
|
||||
[self.navigationController pushViewController:orderPassWordViewController animated:YES];
|
||||
}
|
||||
|
||||
}
|
||||
} failedBlock:^(NSError *error) {
|
||||
[MBProgressHUD errorHudWithView:self.view label:@"网络出错" hidesAfter:0.5];
|
||||
}];
|
||||
}
|
||||
@end
|
||||
@@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="5056" systemVersion="14A389" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="CardAddViewController">
|
||||
<connections>
|
||||
<outlet property="cardTableViewCell" destination="NWJ-1v-E7b" id="y9T-Z1-a0s"/>
|
||||
<outlet property="cardTextField" destination="5bo-Lc-xQu" id="RMX-y9-yBr"/>
|
||||
<outlet property="nextTableViewCell" destination="A3y-S2-mUM" id="iS5-bC-aIf"/>
|
||||
<outlet property="tableView" destination="GFw-nB-CfQ" id="qPD-BM-hMv"/>
|
||||
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
|
||||
</connections>
|
||||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<tableView appearanceType="aqua" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="10" sectionFooterHeight="10" id="GFw-nB-CfQ">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
|
||||
</tableView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
|
||||
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina4"/>
|
||||
</view>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" id="NWJ-1v-E7b">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="NWJ-1v-E7b" id="MIp-Pl-iRr">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<textField appearanceType="aqua" opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="输入银行卡号" minimumFontSize="17" id="5bo-Lc-xQu">
|
||||
<rect key="frame" x="66" y="0.0" width="254" height="43"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits" keyboardType="numberPad"/>
|
||||
</textField>
|
||||
</subviews>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" id="A3y-S2-mUM">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="A3y-S2-mUM" id="mmt-hV-2Qj">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<button appearanceType="aqua" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="QI2-Eg-cTx">
|
||||
<rect key="frame" x="52" y="0.0" width="217" height="43"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="0.71372549019999998" green="0.14901960780000001" blue="0.1764705882" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<state key="normal" title="下一步">
|
||||
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="nextBtnClick:" destination="-1" eventType="touchUpInside" id="bU0-c5-XS5"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
</tableViewCellContentView>
|
||||
<color key="backgroundColor" red="0.92156862745098034" green="0.92156862745098034" blue="0.94509803921568625" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<inset key="separatorInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// CardBindViewController.h
|
||||
// ManagerDemo
|
||||
//
|
||||
// Created by xmfish on 14/11/10.
|
||||
// Copyright (c) 2014年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface CardBindViewController : UIViewController<UITextFieldDelegate,UITableViewDelegate,UITableViewDataSource>
|
||||
|
||||
@property (assign, nonatomic)NSInteger amount;
|
||||
@property (strong, nonatomic)NSString* proId;
|
||||
@property (strong, nonatomic)NSString* cardNo;
|
||||
@property (assign, nonatomic)NSInteger type;
|
||||
|
||||
- (IBAction)nextBtnClick:(id)sender;
|
||||
@property (weak, nonatomic) IBOutlet UITableView *tableView;
|
||||
@property (strong, nonatomic) IBOutlet UITableViewCell *firstTableViewCell;
|
||||
@property (strong, nonatomic) IBOutlet UITableViewCell *secondTableViewCell;
|
||||
@property (strong, nonatomic) IBOutlet UITableViewCell *thirdTableViewCell;
|
||||
@property (strong, nonatomic) IBOutlet UITableViewCell *nextTableViewCell;
|
||||
@property (weak, nonatomic) IBOutlet UITextField *firstTextField;
|
||||
@property (strong, nonatomic) IBOutlet UITableViewCell *pwdTableViewCell;
|
||||
@property (weak, nonatomic) IBOutlet UITextField *pwdTextField;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UITextField *secondTextField;
|
||||
@property (weak, nonatomic) IBOutlet UITextField *thirdTextField;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,185 @@
|
||||
//
|
||||
// CardBindViewController.m
|
||||
// ManagerDemo
|
||||
//
|
||||
// Created by xmfish on 14/11/10.
|
||||
// Copyright (c) 2014年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#import "CardBindViewController.h"
|
||||
#import "IPGet.h"
|
||||
#import "OpenUDID.h"
|
||||
#import "YiBaoMessageViewController.h"
|
||||
@interface CardBindViewController ()
|
||||
|
||||
@end
|
||||
|
||||
@implementation CardBindViewController
|
||||
|
||||
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
|
||||
{
|
||||
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
||||
if (self) {
|
||||
// Custom initialization
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view from its nib.
|
||||
self.navigationItem.title = @"银行卡信息";
|
||||
_tableView.delegate = self;
|
||||
_tableView.dataSource = self;
|
||||
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
_pwdTextField.delegate = self;
|
||||
|
||||
if (_type == 1) {
|
||||
self.navigationItem.title = @"银行卡信息";
|
||||
_firstTableViewCell.textLabel.text = @"身份证";
|
||||
_secondTableViewCell.textLabel.text = @"姓名";
|
||||
_thirdTableViewCell.textLabel.text = @"手机号";
|
||||
}
|
||||
else if(_type==2){
|
||||
self.navigationItem.title = @"信用卡信息";
|
||||
_firstTableViewCell.textLabel.text = @"有效期";
|
||||
_secondTableViewCell.textLabel.text = @"cvv2";
|
||||
_thirdTableViewCell.textLabel.text = @"手机号";
|
||||
}
|
||||
}
|
||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
||||
{
|
||||
if (section == 0) {
|
||||
return 3;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
UITableViewCell* cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
|
||||
if (indexPath.section == 2) {
|
||||
return _nextTableViewCell;
|
||||
}else if (indexPath.section == 1) {
|
||||
return _pwdTableViewCell;
|
||||
}else if(indexPath.section == 0){
|
||||
if (indexPath.row == 0) {
|
||||
|
||||
return _firstTableViewCell;
|
||||
}
|
||||
if (indexPath.row == 1) {
|
||||
|
||||
return _secondTableViewCell;
|
||||
}
|
||||
if (indexPath.row == 2) {
|
||||
|
||||
return _thirdTableViewCell;
|
||||
}
|
||||
}
|
||||
return cell;
|
||||
}
|
||||
-(NSString*)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
|
||||
{
|
||||
if (section == 0) {
|
||||
if (_type == 1) {
|
||||
return @"输入银行卡信息";
|
||||
}else if(_type == 2)
|
||||
{
|
||||
return @"输入信用卡信息";
|
||||
}
|
||||
|
||||
}
|
||||
return @"";
|
||||
}
|
||||
- (void)didReceiveMemoryWarning
|
||||
{
|
||||
[super didReceiveMemoryWarning];
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
#pragma mark UITextFieldDelegate
|
||||
-(BOOL)textFieldShouldBeginEditing:(UITextField *)textField
|
||||
{
|
||||
CGRect frame = _tableView.frame;
|
||||
frame.origin.y = -120;
|
||||
[UIView animateWithDuration:0.3 delay:0 options:0 animations:^(){
|
||||
_tableView.frame = frame;
|
||||
} completion:^(BOOL finished)
|
||||
{
|
||||
|
||||
}];
|
||||
return YES;
|
||||
}
|
||||
|
||||
-(void)scrollViewDidScroll:(UIScrollView *)scrollView
|
||||
{
|
||||
CGRect frame = _tableView.frame;
|
||||
frame.origin.y = 0;
|
||||
[UIView animateWithDuration:0.3 delay:0 options:0 animations:^(){
|
||||
_tableView.frame = frame;
|
||||
} completion:^(BOOL finished)
|
||||
{
|
||||
|
||||
}];
|
||||
|
||||
[_firstTextField resignFirstResponder];
|
||||
[_secondTextField resignFirstResponder];
|
||||
[_thirdTextField resignFirstResponder];
|
||||
[_pwdTextField resignFirstResponder];
|
||||
}
|
||||
- (IBAction)nextBtnClick:(id)sender {
|
||||
|
||||
if (_firstTextField.text.length<=0 || _secondTextField.text.length<=0 || _thirdTextField.text.length<=0 ||
|
||||
_pwdTextField.text.length<=0) {
|
||||
[MBProgressHUD errorHudWithView:self.view label:@"请输入完整信息" hidesAfter:1.0];
|
||||
}
|
||||
[MBProgressHUD hudWithView:self.view label:@"安全加载中"];
|
||||
DaiDaiTongTestApi* daiDaiTongTestApi = [DaiDaiTongTestApi shareInstance];
|
||||
[daiDaiTongTestApi getApiWithParam:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInteger:_amount],@"amount", [ManagerUtil md5:_pwdTextField.text],@"tradePsw",_proId, @"proId", _thirdTextField.text,@"phone",_cardNo, @"cardNo",_firstTextField.text,@"idcard",_secondTextField.text,@"name",[NSNumber numberWithInteger:3],@"terminaltype",@"192.168.1.1",@"userip",[OpenUDID value],@"terminalid",[NSString stringWithFormat:@"%ld",_type],@"payType",_firstTextField.text,@"validthru",_secondTextField.text,@"cvv2",@"",@"bankName",nil] withApiType:@"buyProductYb" completionBlock:^(id jsonRes) {
|
||||
[MBProgressHUD hideAllHUDsForView:self.view animated:YES];
|
||||
|
||||
if ([[jsonRes objectForKey:@"resultflag"] integerValue] == 1) {
|
||||
[MBProgressHUD errorHudWithView:self.view label:[jsonRes objectForKey:@"resultMsg"] hidesAfter:1.0];
|
||||
}else if([[jsonRes objectForKey:@"resultflag"] integerValue] == 3){
|
||||
YiBaoMessageViewController* yibaoMessageViewController = [[YiBaoMessageViewController alloc] init];
|
||||
[self.navigationController pushViewController:yibaoMessageViewController animated:YES];
|
||||
}else if([[jsonRes objectForKey:@"resultflag"] integerValue] == 0){
|
||||
[MBProgressHUD errorHudWithView:self.view label:[jsonRes objectForKey:@"resultMsg"] hidesAfter:1.0];
|
||||
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC*1.0), dispatch_get_main_queue(), ^{
|
||||
[self.navigationController popToRootViewControllerAnimated:YES];
|
||||
});
|
||||
|
||||
}
|
||||
} failedBlock:^(NSError *error) {
|
||||
[MBProgressHUD errorHudWithView:self.view label:@"网络出错" hidesAfter:1.0];
|
||||
}];
|
||||
[self getIPAddress];
|
||||
|
||||
}
|
||||
- (void)getIPAddress
|
||||
{
|
||||
InitAddresses();
|
||||
GetIPAddresses();
|
||||
GetIPAddresses();
|
||||
|
||||
int i;
|
||||
NSString *deviceIP = nil;
|
||||
for (i=0; i<MAXADDRS; ++i)
|
||||
{
|
||||
static unsigned long localHost = 0x7F000001; // 127.0.0.1
|
||||
unsigned long theAddr;
|
||||
|
||||
theAddr = ip_addrs[i];
|
||||
|
||||
if (theAddr == 0) break;
|
||||
if (theAddr == localHost) continue;
|
||||
|
||||
NSLog(@"Name: %s MAC: %s IP: %s\n", if_names[i], hw_addrs[i], ip_names[i]);
|
||||
}
|
||||
}
|
||||
@end
|
||||
@@ -0,0 +1,149 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="5056" systemVersion="14A389" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="CardBindViewController">
|
||||
<connections>
|
||||
<outlet property="firstTableViewCell" destination="zHE-a1-SvV" id="8Gm-c0-TKx"/>
|
||||
<outlet property="firstTextField" destination="fEm-Rq-rrR" id="PJX-Mu-6cx"/>
|
||||
<outlet property="nextTableViewCell" destination="va2-2P-UvA" id="U0J-l0-btD"/>
|
||||
<outlet property="pwdTableViewCell" destination="hhd-61-LV2" id="8gc-tF-AGK"/>
|
||||
<outlet property="pwdTextField" destination="1NC-JY-hJc" id="etY-DO-PRZ"/>
|
||||
<outlet property="secondTableViewCell" destination="t3N-sN-WXO" id="Q7A-90-Dcf"/>
|
||||
<outlet property="secondTextField" destination="dIH-HX-PBi" id="eua-rP-B76"/>
|
||||
<outlet property="tableView" destination="REm-AV-V46" id="XIv-mz-QKo"/>
|
||||
<outlet property="thirdTableViewCell" destination="YrX-uV-YCq" id="Jhc-5C-CG8"/>
|
||||
<outlet property="thirdTextField" destination="VDs-9C-Vuq" id="pzt-Af-vgc"/>
|
||||
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
|
||||
</connections>
|
||||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<tableView appearanceType="aqua" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="10" sectionFooterHeight="10" id="REm-AV-V46">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
|
||||
<color key="sectionIndexBackgroundColor" red="0.92156862745098034" green="0.92156862745098034" blue="0.94509803921568625" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</tableView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
|
||||
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina4"/>
|
||||
</view>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" id="zHE-a1-SvV">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="zHE-a1-SvV" id="aN9-1a-ozU">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<textField appearanceType="aqua" opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" minimumFontSize="17" id="fEm-Rq-rrR">
|
||||
<rect key="frame" x="73" y="0.0" width="247" height="43"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits"/>
|
||||
</textField>
|
||||
<view appearanceType="aqua" contentMode="scaleToFill" id="INa-Hn-UGS">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="1"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="0.86274509803921573" green="0.86274509803921573" blue="0.87450980392156863" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</view>
|
||||
<view appearanceType="aqua" contentMode="scaleToFill" id="dw8-7K-XkI">
|
||||
<rect key="frame" x="20" y="43" width="300" height="1"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="0.86274509799999999" green="0.86274509799999999" blue="0.87450980389999999" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</view>
|
||||
</subviews>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" id="t3N-sN-WXO">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="t3N-sN-WXO" id="caS-YS-mq0">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<textField appearanceType="aqua" opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" minimumFontSize="17" id="dIH-HX-PBi">
|
||||
<rect key="frame" x="73" y="0.0" width="247" height="43"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits"/>
|
||||
</textField>
|
||||
<view appearanceType="aqua" contentMode="scaleToFill" id="pOw-Fg-6tI">
|
||||
<rect key="frame" x="20" y="43" width="300" height="1"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="0.86274509799999999" green="0.86274509799999999" blue="0.87450980389999999" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</view>
|
||||
</subviews>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" id="YrX-uV-YCq">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="YrX-uV-YCq" id="qw1-Gt-PSp">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<textField appearanceType="aqua" opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" minimumFontSize="17" id="VDs-9C-Vuq">
|
||||
<rect key="frame" x="73" y="0.0" width="247" height="43"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits"/>
|
||||
</textField>
|
||||
<view appearanceType="aqua" contentMode="scaleToFill" id="3eG-nK-itx">
|
||||
<rect key="frame" x="0.0" y="43" width="320" height="1"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="0.86274509799999999" green="0.86274509799999999" blue="0.87450980389999999" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</view>
|
||||
</subviews>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" id="va2-2P-UvA">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="va2-2P-UvA" id="AzD-kG-aRx">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<button appearanceType="aqua" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="RzF-oH-Ylu">
|
||||
<rect key="frame" x="52" y="0.0" width="217" height="43"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="0.71372549019999998" green="0.14901960780000001" blue="0.1764705882" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<state key="normal" title="下一步">
|
||||
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="nextBtnClick:" destination="-1" eventType="touchUpInside" id="9S8-QX-zcR"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.92156862750000001" green="0.92156862750000001" blue="0.94509803920000002" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</tableViewCellContentView>
|
||||
<color key="backgroundColor" red="0.90196078431372551" green="0.90196078431372551" blue="0.93333333333333335" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</tableViewCell>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="hhd-61-LV2">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="hhd-61-LV2" id="CGd-R3-HPg">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<textField appearanceType="aqua" opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="输入交易密码" minimumFontSize="17" id="1NC-JY-hJc">
|
||||
<rect key="frame" x="62" y="7" width="197" height="30"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits" secureTextEntry="YES"/>
|
||||
</textField>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</tableViewCellContentView>
|
||||
<color key="backgroundColor" red="0.92156862745098034" green="0.92156862745098034" blue="0.94509803921568625" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// CardSelectViewController.h
|
||||
// ManagerDemo
|
||||
//
|
||||
// Created by xmfish on 14/11/9.
|
||||
// Copyright (c) 2014年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface CardSelectViewController : UIViewController<UITableViewDataSource,UITableViewDelegate>
|
||||
@property (weak, nonatomic) IBOutlet UITableView *tableView;
|
||||
@property (assign, nonatomic)NSInteger amount;
|
||||
@property (strong, nonatomic)NSString* proId;
|
||||
@end
|
||||
@@ -0,0 +1,158 @@
|
||||
//
|
||||
// CardSelectViewController.m
|
||||
// ManagerDemo
|
||||
//
|
||||
// Created by xmfish on 14/11/9.
|
||||
// Copyright (c) 2014年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#import "CardSelectViewController.h"
|
||||
#import "OrderPassWordViewController.h"
|
||||
#import "CardAddViewController.h"
|
||||
@interface CardSelectViewController ()
|
||||
{
|
||||
NSArray* bankList;
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation CardSelectViewController
|
||||
|
||||
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
|
||||
{
|
||||
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
||||
if (self) {
|
||||
// Custom initialization
|
||||
bankList = nil;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view from its nib.
|
||||
self.navigationItem.title = @"我的银行卡";
|
||||
_tableView.delegate = self;
|
||||
_tableView.dataSource = self;
|
||||
[self initData];
|
||||
}
|
||||
|
||||
-(void)initData
|
||||
{
|
||||
[MBProgressHUD hudWithView:self.view label:@"安全加载中"];
|
||||
DaiDaiTongTestApi* daiDaiTongTestApi = [DaiDaiTongTestApi shareInstance];
|
||||
[daiDaiTongTestApi getApiWithParam:nil withApiType:@"getBindBankList" completionBlock:^(id jsonRes) {
|
||||
if ([[jsonRes objectForKey:@"resultflag"] integerValue] == 1) {
|
||||
[MBProgressHUD errorHudWithView:self.view label:[jsonRes objectForKey:@"resultMsg"] hidesAfter:1.0];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC*1.0), dispatch_get_main_queue(), ^{
|
||||
});
|
||||
|
||||
}else{
|
||||
[MBProgressHUD hideAllHUDsForView:self.view animated:YES];
|
||||
bankList = [jsonRes objectForKey:@"bankList"];
|
||||
[_tableView reloadData];
|
||||
}
|
||||
} failedBlock:^(NSError *error) {
|
||||
[MBProgressHUD errorHudWithView:self.view label:@"网络出错" hidesAfter:0.5];
|
||||
}];
|
||||
|
||||
}
|
||||
#pragma mark UITableViewDelegate
|
||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
||||
{
|
||||
if(section == 0){
|
||||
if(bankList.count>0){
|
||||
return bankList.count;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
static NSString* cellIdentifier = @"cell";
|
||||
UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
|
||||
if (!cell) {
|
||||
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
|
||||
}
|
||||
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
|
||||
if (indexPath.section == 0) {
|
||||
if(bankList.count == 0){
|
||||
cell.textLabel.text = @"还未绑定银行卡";
|
||||
cell.accessoryType = UITableViewCellAccessoryNone;
|
||||
}else{
|
||||
NSString* cardNo = [[bankList objectAtIndex:indexPath.row] objectForKey:@"cardNo"];
|
||||
cell.textLabel.text = [NSString stringWithFormat:@"尾数后四位为%@的银行卡",[cardNo substringFromIndex:cardNo.length-4]];
|
||||
cell.textLabel.font = Font_Black(12);
|
||||
}
|
||||
|
||||
cell.textLabel.textColor = [UIColor grayColor];
|
||||
cell.imageView.image = [UIImage imageNamed:@"daidaitong03"];
|
||||
|
||||
}
|
||||
if (indexPath.section == 1) {
|
||||
cell.imageView.image = [UIImage imageNamed:@"daidaitong01"];
|
||||
}
|
||||
if (indexPath.section == 2) {
|
||||
cell.imageView.image = [UIImage imageNamed:@"daidaitong02"];
|
||||
}
|
||||
return cell;
|
||||
}
|
||||
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:NO];
|
||||
|
||||
if(indexPath.section == 0){
|
||||
|
||||
[MBProgressHUD hudWithView:self.view label:@"安全加载中"];
|
||||
DaiDaiTongTestApi* daiDaiTongTestApi = [DaiDaiTongTestApi shareInstance];
|
||||
[daiDaiTongTestApi getApiWithParam:@{@"cardNo": [[bankList objectAtIndex:indexPath.row] objectForKey:@"cardNo"]} withApiType:@"bankCardCheck" completionBlock:^(id jsonRes) {
|
||||
if ([[jsonRes objectForKey:@"resultflag"] integerValue] == 1) {
|
||||
[MBProgressHUD errorHudWithView:self.view label:[jsonRes objectForKey:@"resultMsg"] hidesAfter:1.0];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC*1.0), dispatch_get_main_queue(), ^{
|
||||
});
|
||||
|
||||
}else{
|
||||
[MBProgressHUD hideAllHUDsForView:self.view animated:YES];
|
||||
if([[jsonRes objectForKey:@"resultflag"] integerValue] == 2){
|
||||
OrderPassWordViewController* orderPassWordViewController = [[OrderPassWordViewController alloc] init];
|
||||
orderPassWordViewController.amount = _amount;
|
||||
orderPassWordViewController.proId = _proId;
|
||||
orderPassWordViewController.type = 1;
|
||||
orderPassWordViewController.cardNo = [[bankList objectAtIndex:indexPath.row] objectForKey:@"cardNo"];
|
||||
orderPassWordViewController.bindid = [[jsonRes objectForKey:@"bindid"] integerValue];
|
||||
[self.navigationController pushViewController:orderPassWordViewController animated:YES];
|
||||
}
|
||||
|
||||
}
|
||||
} failedBlock:^(NSError *error) {
|
||||
[MBProgressHUD errorHudWithView:self.view label:@"网络出错" hidesAfter:0.5];
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
if (indexPath.section == 1) {
|
||||
CardAddViewController* cardAddViewController = [[CardAddViewController alloc] init];
|
||||
cardAddViewController.amount = _amount;
|
||||
cardAddViewController.proId = _proId;
|
||||
[self.navigationController pushViewController:cardAddViewController animated:YES];
|
||||
}
|
||||
if (indexPath.section == 2) {
|
||||
|
||||
OrderPassWordViewController* orderPassWordViewController = [[OrderPassWordViewController alloc] init];
|
||||
orderPassWordViewController.amount = _amount;
|
||||
orderPassWordViewController.proId = _proId;
|
||||
[self.navigationController pushViewController:orderPassWordViewController animated:YES];
|
||||
}
|
||||
}
|
||||
- (void)didReceiveMemoryWarning
|
||||
{
|
||||
[super didReceiveMemoryWarning];
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="5056" systemVersion="14A389" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="CardSelectViewController">
|
||||
<connections>
|
||||
<outlet property="tableView" destination="tkE-We-zFb" id="OHM-dV-9DM"/>
|
||||
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
|
||||
</connections>
|
||||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<tableView appearanceType="aqua" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="10" sectionFooterHeight="10" id="tkE-We-zFb">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
|
||||
</tableView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
|
||||
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina4"/>
|
||||
</view>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -9,6 +9,7 @@
|
||||
#import "MainOrderViewController.h"
|
||||
#import "OrderPassWordViewController.h"
|
||||
#import "SetPassWordViewController.h"
|
||||
#import "CardSelectViewController.h"
|
||||
@interface MainOrderViewController ()
|
||||
|
||||
@end
|
||||
@@ -38,12 +39,12 @@
|
||||
[_completeBtn setBackgroundImage:[ManagerUtil buttonImageFromColor:[UIColor lightGrayColor] withFrame:_completeBtn.frame] forState:UIControlStateDisabled];
|
||||
|
||||
_nameLabel.text = _productName;
|
||||
_startBuyLabel.text = [NSString stringWithFormat:@"%d元",_startBuy];
|
||||
_startBuyLabel.text = [NSString stringWithFormat:@"%ld元",_startBuy];
|
||||
if (_type == 0) {
|
||||
_timeLimit.text = [NSString stringWithFormat:@"限%d个月",_timeLimitNum];
|
||||
_timeLimit.text = [NSString stringWithFormat:@"限%ld个月",_timeLimitNum];
|
||||
_infoLabel.hidden = NO;
|
||||
_infoLabel.text = [NSString stringWithFormat:@"投标金额:%d的整数倍",_startBuy];
|
||||
_orderAmountTextField.placeholder = [NSString stringWithFormat:@"投标金额≥%d",_startBuy];
|
||||
_infoLabel.text = [NSString stringWithFormat:@"投标金额:%ld的整数倍",_startBuy];
|
||||
_orderAmountTextField.placeholder = [NSString stringWithFormat:@"投标金额≥%ld",_startBuy];
|
||||
}else{
|
||||
_timeLimit.text = @"随买随卖";
|
||||
_orderAmountTextField.placeholder = @"建议100元以上,以便收益计算";
|
||||
@@ -115,12 +116,11 @@
|
||||
|
||||
- (IBAction)completeBtnClick:(id)sender {
|
||||
|
||||
|
||||
[MBProgressHUD hudWithView:self.view label:@"安全加载中"];
|
||||
DaiDaiTongTestApi* daiDaiTongTestApi = [DaiDaiTongTestApi shareInstance];
|
||||
[daiDaiTongTestApi getApiWithParam:nil withApiType:@"hasTradePsw" completionBlock:^(id jsonRes) {
|
||||
if ([[jsonRes objectForKey:@"resultflag"] integerValue] == 1) {
|
||||
[MBProgressHUD errorHudWithView:self.view label:@"还没设置交易密码" hidesAfter:1.0];
|
||||
[MBProgressHUD errorHudWithView:self.view label:[jsonRes objectForKey:@"resultMsg"] hidesAfter:1.0];
|
||||
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC*1.0), dispatch_get_main_queue(), ^{
|
||||
SetPassWordViewController* setPassWordViewController = [[SetPassWordViewController alloc] init];
|
||||
@@ -130,10 +130,10 @@
|
||||
|
||||
}else{
|
||||
[MBProgressHUD hideAllHUDsForView:self.view animated:YES];
|
||||
OrderPassWordViewController* orderPassWordViewController = [[OrderPassWordViewController alloc] init];
|
||||
orderPassWordViewController.amount = [_orderAmountTextField.text integerValue];
|
||||
orderPassWordViewController.proId = _productId;
|
||||
[self.navigationController pushViewController:orderPassWordViewController animated:YES];
|
||||
CardSelectViewController* cardSelectViewController = [[CardSelectViewController alloc] init];
|
||||
cardSelectViewController.amount = [_orderAmountTextField.text integerValue];
|
||||
cardSelectViewController.proId = _productId;
|
||||
[self.navigationController pushViewController:cardSelectViewController animated:YES];
|
||||
}
|
||||
} failedBlock:^(NSError *error) {
|
||||
[MBProgressHUD errorHudWithView:self.view label:@"网络出错" hidesAfter:0.5];
|
||||
|
||||
@@ -15,7 +15,11 @@
|
||||
}
|
||||
@property (assign, nonatomic)NSInteger amount;
|
||||
@property (strong, nonatomic)NSString* proId;
|
||||
@property (strong, nonatomic)NSString* cardNo;
|
||||
@property (assign, nonatomic)NSInteger type;
|
||||
@property (assign, nonatomic)NSInteger bindid;
|
||||
@property (weak, nonatomic) IBOutlet UITextField *passwordTextField;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *cardNoLabel;
|
||||
- (IBAction)completeBtnClick:(id)sender;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *completeBtn;
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#import "OrderPassWordViewController.h"
|
||||
#import "UPPayPlugin.h"
|
||||
#import "AuthenticationViewController.h"
|
||||
#import "OpenUDID.h"
|
||||
#import "YiBaoMessageViewController.h"
|
||||
@interface OrderPassWordViewController ()
|
||||
|
||||
@end
|
||||
@@ -20,6 +22,7 @@
|
||||
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
||||
if (self) {
|
||||
// Custom initialization
|
||||
_type = 0;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@@ -36,6 +39,14 @@
|
||||
|
||||
_completeBtn.enabled = NO;
|
||||
[_completeBtn setBackgroundImage:[ManagerUtil buttonImageFromColor:[UIColor lightGrayColor] withFrame:_completeBtn.frame] forState:UIControlStateDisabled];
|
||||
|
||||
if(_type == 1){
|
||||
_cardNoLabel.hidden = NO;
|
||||
_cardNoLabel.text = [NSString stringWithFormat:@"尾数后四位为%@的银行卡",[_cardNo substringFromIndex:_cardNo.length-4]];
|
||||
|
||||
}else{
|
||||
_cardNoLabel.hidden = YES;
|
||||
}
|
||||
}
|
||||
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
|
||||
{
|
||||
@@ -85,26 +96,49 @@
|
||||
- (IBAction)completeBtnClick:(id)sender {
|
||||
|
||||
[MBProgressHUD hudWithView:self.view label:@"安全加载中"];
|
||||
DaiDaiTongTestApi* daiDaiTongTestApi = [DaiDaiTongTestApi shareInstance];
|
||||
[daiDaiTongTestApi getApiWithParam:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInteger:_amount],@"amount", [ManagerUtil md5:_passwordTextField.text],@"tradePsw",_proId, @"proId", nil] withApiType:@"buyProduct" completionBlock:^(id jsonRes) {
|
||||
[MBProgressHUD hideAllHUDsForView:self.view animated:YES];
|
||||
|
||||
if ([[jsonRes objectForKey:@"resultflag"] integerValue] == 1) {
|
||||
[MBProgressHUD errorHudWithView:self.view label:[jsonRes objectForKey:@"resultMsg"] hidesAfter:1.0];
|
||||
}else if([[jsonRes objectForKey:@"resultflag"] integerValue] == 2){
|
||||
AuthenticationViewController* authenticationViewController = [[AuthenticationViewController alloc] init];
|
||||
[self.navigationController pushViewController:authenticationViewController animated:YES];
|
||||
}else if([[jsonRes objectForKey:@"resultflag"] integerValue] == 0){
|
||||
NSString* tn = [jsonRes objectForKey:@"tn"];
|
||||
if (tn) {
|
||||
[UPPayPlugin startPay:tn mode:@"01" viewController:self delegate:self];
|
||||
|
||||
if(_type == 1){
|
||||
DaiDaiTongTestApi* daiDaiTongTestApi = [DaiDaiTongTestApi shareInstance];
|
||||
[daiDaiTongTestApi getApiWithParam:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInteger:_amount],@"amount", [ManagerUtil md5:_passwordTextField.text],@"tradePsw",_proId, @"proId", _cardNo, @"cardNo",[NSNumber numberWithInteger:3],@"terminaltype",@"192.168.1.1",@"userip",[OpenUDID value],@"terminalid",[NSString stringWithFormat:@"%d",3],@"payType",@"",@"bankName",[NSNumber numberWithInteger:_bindid],@"bindid",nil] withApiType:@"buyProductYb" completionBlock:^(id jsonRes) {
|
||||
[MBProgressHUD hideAllHUDsForView:self.view animated:YES];
|
||||
|
||||
if ([[jsonRes objectForKey:@"resultflag"] integerValue] == 1) {
|
||||
[MBProgressHUD errorHudWithView:self.view label:[jsonRes objectForKey:@"resultMsg"] hidesAfter:1.0];
|
||||
}else if([[jsonRes objectForKey:@"resultflag"] integerValue] == 3){
|
||||
YiBaoMessageViewController* yibaoMessageViewController = [[YiBaoMessageViewController alloc] init];
|
||||
[self.navigationController pushViewController:yibaoMessageViewController animated:YES];
|
||||
}else if([[jsonRes objectForKey:@"resultflag"] integerValue] == 0){
|
||||
[MBProgressHUD errorHudWithView:self.view label:[jsonRes objectForKey:@"resultMsg"] hidesAfter:1.0];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC*1.0), dispatch_get_main_queue(), ^{
|
||||
[self.navigationController popToRootViewControllerAnimated:YES];
|
||||
});
|
||||
|
||||
}
|
||||
} failedBlock:^(NSError *error) {
|
||||
[MBProgressHUD errorHudWithView:self.view label:@"网络出错" hidesAfter:1.0];
|
||||
}];
|
||||
}else{
|
||||
DaiDaiTongTestApi* daiDaiTongTestApi = [DaiDaiTongTestApi shareInstance];
|
||||
[daiDaiTongTestApi getApiWithParam:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInteger:_amount],@"amount", [ManagerUtil md5:_passwordTextField.text],@"tradePsw",_proId, @"proId", nil] withApiType:@"buyProduct" completionBlock:^(id jsonRes) {
|
||||
[MBProgressHUD hideAllHUDsForView:self.view animated:YES];
|
||||
|
||||
|
||||
}
|
||||
} failedBlock:^(NSError *error) {
|
||||
[MBProgressHUD errorHudWithView:self.view label:@"网络出错" hidesAfter:1.0];
|
||||
}];
|
||||
if ([[jsonRes objectForKey:@"resultflag"] integerValue] == 1) {
|
||||
[MBProgressHUD errorHudWithView:self.view label:[jsonRes objectForKey:@"resultMsg"] hidesAfter:1.0];
|
||||
}else if([[jsonRes objectForKey:@"resultflag"] integerValue] == 2){
|
||||
AuthenticationViewController* authenticationViewController = [[AuthenticationViewController alloc] init];
|
||||
[self.navigationController pushViewController:authenticationViewController animated:YES];
|
||||
}else if([[jsonRes objectForKey:@"resultflag"] integerValue] == 0){
|
||||
NSString* tn = [jsonRes objectForKey:@"tn"];
|
||||
if (tn) {
|
||||
[UPPayPlugin startPay:tn mode:@"00" viewController:self delegate:self];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
} failedBlock:^(NSError *error) {
|
||||
[MBProgressHUD errorHudWithView:self.view label:@"网络出错" hidesAfter:1.0];
|
||||
}];
|
||||
}
|
||||
|
||||
}
|
||||
#pragma mark UPPayPluginResult
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="5056" systemVersion="13E28" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="5056" systemVersion="14A389" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="OrderPassWordViewController">
|
||||
<connections>
|
||||
<outlet property="cardNoLabel" destination="Jix-Gc-yhC" id="2lA-jp-fai"/>
|
||||
<outlet property="completeBtn" destination="moZ-Vg-3YB" id="sEE-Xf-aJz"/>
|
||||
<outlet property="passwordTextField" destination="mf7-eF-dZg" id="Csn-ze-mm6"/>
|
||||
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
|
||||
@@ -17,7 +18,7 @@
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="line" placeholder="请输入交易密码" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="mf7-eF-dZg">
|
||||
<rect key="frame" x="15" y="68" width="285" height="43"/>
|
||||
<rect key="frame" x="15" y="96" width="285" height="43"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits" secureTextEntry="YES"/>
|
||||
@@ -34,6 +35,13 @@
|
||||
<action selector="completeBtnClick:" destination="-1" eventType="touchUpInside" id="H5c-rt-Wza"/>
|
||||
</connections>
|
||||
</button>
|
||||
<label hidden="YES" appearanceType="aqua" opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="尾数为0000的银行卡" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Jix-Gc-yhC">
|
||||
<rect key="frame" x="15" y="67" width="285" height="21"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
self.navigationItem.title = [jsonRes objectForKey:@"fundName"];
|
||||
[_wydInfoHedaView setInfoWithDic:jsonRes];
|
||||
_infoDic = [NSDictionary dictionaryWithDictionary:jsonRes];
|
||||
if ([[[jsonRes objectForKey:@"proInfo"] objectForKey:@"state"] integerValue] == 1) {
|
||||
if ([[[jsonRes objectForKey:@"proInfo"] objectForKey:@"state"] integerValue] == 1 || [[[jsonRes objectForKey:@"proInfo"] objectForKey:@"state"] integerValue] == 0) {
|
||||
[_toolBarView setEnable:YES];
|
||||
}else{
|
||||
[_toolBarView setEnable:NO];
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// YiBaoMessageViewController.h
|
||||
// ManagerDemo
|
||||
//
|
||||
// Created by xmfish on 14/11/10.
|
||||
// Copyright (c) 2014年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface YiBaoMessageViewController : UIViewController<UITextFieldDelegate>
|
||||
@property (weak, nonatomic) IBOutlet UITextField *orderId;
|
||||
@property (weak, nonatomic) IBOutlet UITextField *ybVerCode;
|
||||
- (IBAction)completeBtnClick:(id)sender;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *completeBtn;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,121 @@
|
||||
//
|
||||
// YiBaoMessageViewController.m
|
||||
// ManagerDemo
|
||||
//
|
||||
// Created by xmfish on 14/11/10.
|
||||
// Copyright (c) 2014年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#import "YiBaoMessageViewController.h"
|
||||
|
||||
@interface YiBaoMessageViewController ()
|
||||
|
||||
@end
|
||||
|
||||
@implementation YiBaoMessageViewController
|
||||
|
||||
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
|
||||
{
|
||||
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
||||
if (self) {
|
||||
// Custom initialization
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view from its nib.
|
||||
self.navigationItem.title = @"短信验证";
|
||||
|
||||
_orderId.leftViewMode = UITextFieldViewModeAlways;
|
||||
_orderId.layer.masksToBounds=YES;
|
||||
_orderId.layer.borderColor = [[UIColor lightGrayColor]CGColor];
|
||||
_orderId.layer.borderWidth= 1.0f;
|
||||
_orderId.clearButtonMode = UITextFieldViewModeWhileEditing;
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textFieldTextDidChange:) name:UITextFieldTextDidChangeNotification object:_orderId];
|
||||
_orderId.delegate = self;
|
||||
|
||||
_ybVerCode.leftViewMode = UITextFieldViewModeAlways;
|
||||
_ybVerCode.layer.masksToBounds=YES;
|
||||
_ybVerCode.layer.borderColor = [[UIColor lightGrayColor]CGColor];
|
||||
_ybVerCode.layer.borderWidth= 1.0f;
|
||||
_ybVerCode.clearButtonMode = UITextFieldViewModeWhileEditing;
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textFieldTextDidChange:) name:UITextFieldTextDidChangeNotification object:_ybVerCode];
|
||||
_ybVerCode.delegate = self;
|
||||
|
||||
_completeBtn.enabled = NO;
|
||||
[_completeBtn setBackgroundImage:[ManagerUtil buttonImageFromColor:[UIColor lightGrayColor] withFrame:_completeBtn.frame] forState:UIControlStateDisabled];
|
||||
}
|
||||
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
|
||||
{
|
||||
|
||||
[super touchesMoved:touches withEvent:event];
|
||||
[_orderId resignFirstResponder];
|
||||
[_ybVerCode resignFirstResponder];
|
||||
_orderId.layer.borderColor = [[UIColor grayColor] CGColor];
|
||||
_ybVerCode.layer.borderColor = [[UIColor grayColor] CGColor];
|
||||
|
||||
}
|
||||
#pragma mark UITextFieldDelegate
|
||||
-(BOOL)textFieldShouldBeginEditing:(UITextField *)textField
|
||||
{
|
||||
_orderId.layer.borderColor = [[UIColor grayColor] CGColor];
|
||||
_ybVerCode.layer.borderColor = [[UIColor grayColor] CGColor];
|
||||
textField.layer.borderColor = [[UIColor orangeColor]CGColor];
|
||||
return YES;
|
||||
}
|
||||
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
|
||||
{
|
||||
|
||||
if (range.location >= 12)
|
||||
return NO; // return NO to not change text
|
||||
|
||||
return YES;
|
||||
}
|
||||
-(void)textFieldTextDidChange:(NSNotification *)sender
|
||||
{
|
||||
|
||||
if ([_orderId.text isEqualToString:@""] || [_ybVerCode.text isEqualToString:@""] ) {
|
||||
_completeBtn.enabled = NO;
|
||||
|
||||
}else{
|
||||
_completeBtn.enabled = YES;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
-(BOOL)textFieldShouldEndEditing:(UITextField *)textField
|
||||
{
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
- (void)didReceiveMemoryWarning
|
||||
{
|
||||
[super didReceiveMemoryWarning];
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
- (IBAction)completeBtnClick:(id)sender {
|
||||
|
||||
[MBProgressHUD hudWithView:self.view label:@"安全加载中"];
|
||||
DaiDaiTongTestApi* daiDaiTongTestApi = [DaiDaiTongTestApi shareInstance];
|
||||
[daiDaiTongTestApi getApiWithParam:@{@"orderid": _orderId.text,@"ybVerCode":_ybVerCode.text} withApiType:@"ybConfirmPay" completionBlock:^(id jsonRes) {
|
||||
if ([[jsonRes objectForKey:@"resultflag"] integerValue] == 1) {
|
||||
[MBProgressHUD errorHudWithView:self.view label:[jsonRes objectForKey:@"resultMsg"] hidesAfter:1.0];
|
||||
|
||||
}else{
|
||||
[MBProgressHUD errorHudWithView:self.view label:[jsonRes objectForKey:@"resultMsg"] hidesAfter:1.0];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC*1.0), dispatch_get_main_queue(), ^{
|
||||
[self.navigationController popToRootViewControllerAnimated:YES];
|
||||
});
|
||||
}
|
||||
} failedBlock:^(NSError *error) {
|
||||
[MBProgressHUD errorHudWithView:self.view label:@"网络出错" hidesAfter:0.5];
|
||||
}];
|
||||
|
||||
}
|
||||
@end
|
||||
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="5056" systemVersion="14A389" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="YiBaoMessageViewController">
|
||||
<connections>
|
||||
<outlet property="completeBtn" destination="6th-Fo-fL5" id="CSi-Hm-Sdb"/>
|
||||
<outlet property="orderId" destination="l40-yx-UJX" id="8dL-i2-UJi"/>
|
||||
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
|
||||
<outlet property="ybVerCode" destination="xbD-FM-Xpd" id="oqq-Aw-ygv"/>
|
||||
</connections>
|
||||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="line" placeholder="短信验证码" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="xbD-FM-Xpd">
|
||||
<rect key="frame" x="20" y="138" width="280" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits" keyboardType="numberPad"/>
|
||||
</textField>
|
||||
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="line" placeholder="订单号" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="l40-yx-UJX">
|
||||
<rect key="frame" x="20" y="69" width="280" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits" keyboardType="numberPad"/>
|
||||
</textField>
|
||||
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6th-Fo-fL5">
|
||||
<rect key="frame" x="20" y="206" width="280" height="42"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<state key="normal" title="完成">
|
||||
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="completeBtnClick:" destination="-1" eventType="touchUpInside" id="OOj-eo-JW4"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
|
||||
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina4"/>
|
||||
</view>
|
||||
</objects>
|
||||
</document>
|
||||
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 5.3 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 18 KiB |