diff --git a/ManagerDemo.xcodeproj/project.pbxproj b/ManagerDemo.xcodeproj/project.pbxproj index 45d9985..0c37d95 100644 --- a/ManagerDemo.xcodeproj/project.pbxproj +++ b/ManagerDemo.xcodeproj/project.pbxproj @@ -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 = ""; }; A94FE51D199C9C3C00626DE5 /* MoveSocialCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MoveSocialCellView.m; sourceTree = ""; }; A94FE51F199C9C6800626DE5 /* MoveSocialCellView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MoveSocialCellView.xib; sourceTree = ""; }; + A9548ED11A104ED9008B5A3D /* OpenUDID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OpenUDID.h; sourceTree = ""; }; + A9548ED21A104ED9008B5A3D /* OpenUDID.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OpenUDID.m; sourceTree = ""; }; + A9548ED31A104ED9008B5A3D /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.md; sourceTree = ""; }; + A9548ED61A105DB0008B5A3D /* YiBaoMessageViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YiBaoMessageViewController.h; sourceTree = ""; }; + A9548ED71A105DB0008B5A3D /* YiBaoMessageViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YiBaoMessageViewController.m; sourceTree = ""; }; + A9548ED81A105DB0008B5A3D /* YiBaoMessageViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = YiBaoMessageViewController.xib; sourceTree = ""; }; A95CEA3119B754A800D4605F /* MessageCenterViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MessageCenterViewController.h; sourceTree = ""; }; A95CEA3219B754A800D4605F /* MessageCenterViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MessageCenterViewController.m; sourceTree = ""; }; A95CEA3319B754A800D4605F /* MessageCenterViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MessageCenterViewController.xib; sourceTree = ""; }; @@ -346,6 +371,16 @@ A95EAEE219C9BE2E00D1592B /* FundCaculateViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = FundCaculateViewController.xib; sourceTree = ""; }; A9623E2D19CBEB1A004F7D9D /* NSDictionary+ChangeNull.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+ChangeNull.h"; sourceTree = ""; }; A9623E2E19CBEB1A004F7D9D /* NSDictionary+ChangeNull.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+ChangeNull.m"; sourceTree = ""; }; + A96ACD811A0FD49C00DEFF7B /* CardBindViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardBindViewController.h; sourceTree = ""; }; + A96ACD821A0FD49C00DEFF7B /* CardBindViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CardBindViewController.mm; sourceTree = ""; }; + A96ACD831A0FD49C00DEFF7B /* CardBindViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CardBindViewController.xib; sourceTree = ""; }; + A96ACD871A0FE43900DEFF7B /* IPAddress.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = IPAddress.c; sourceTree = ""; }; + A96ACD891A0FE46C00DEFF7B /* IPAddress.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IPAddress.h; sourceTree = ""; }; + A96ACD8A1A0FE65C00DEFF7B /* IPGet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IPGet.cpp; sourceTree = ""; }; + A96ACD8B1A0FE65C00DEFF7B /* IPGet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IPGet.h; sourceTree = ""; }; + A96ACD8D1A0FEDED00DEFF7B /* daidaitong01@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "daidaitong01@2x.png"; sourceTree = ""; }; + A96ACD8E1A0FEDED00DEFF7B /* daidaitong02@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "daidaitong02@2x.png"; sourceTree = ""; }; + A96ACD8F1A0FEDED00DEFF7B /* daidaitong03@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "daidaitong03@2x.png"; sourceTree = ""; }; A96F2A7A199D008200608237 /* UIButton+Bootstrap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIButton+Bootstrap.h"; sourceTree = ""; }; A96F2A7B199D008200608237 /* UIButton+Bootstrap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIButton+Bootstrap.m"; sourceTree = ""; }; A96F2A7D199D01C000608237 /* NSString+FontAwesome.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+FontAwesome.h"; sourceTree = ""; }; @@ -423,6 +458,16 @@ A9A59E8E19D2C4DE00D7DC4F /* fund_abount_icon_1@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "fund_abount_icon_1@2x.png"; sourceTree = ""; }; A9A59E8F19D2C4DE00D7DC4F /* fund_abount_icon_2@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "fund_abount_icon_2@2x.png"; sourceTree = ""; }; A9A59E9019D2C4DE00D7DC4F /* fund_abount_icon_3@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "fund_abount_icon_3@2x.png"; sourceTree = ""; }; + A9A5A3391A0F4C70004AD234 /* CardSelectViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardSelectViewController.h; sourceTree = ""; }; + A9A5A33A1A0F4C70004AD234 /* CardSelectViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CardSelectViewController.m; sourceTree = ""; }; + A9A5A33B1A0F4C70004AD234 /* CardSelectViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CardSelectViewController.xib; sourceTree = ""; }; + A9A5A33E1A0F5D07004AD234 /* daidaitong_03.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = daidaitong_03.jpg; sourceTree = ""; }; + A9A5A33F1A0F5D07004AD234 /* daidaitong_06.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = daidaitong_06.jpg; sourceTree = ""; }; + A9A5A3401A0F5D07004AD234 /* daidaitong_13.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = daidaitong_13.jpg; sourceTree = ""; }; + A9A5A3441A0F5EB8004AD234 /* check_mark@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "check_mark@2x.png"; sourceTree = ""; }; + A9A5A3461A0F603B004AD234 /* CardAddViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CardAddViewController.h; sourceTree = ""; }; + A9A5A3471A0F603B004AD234 /* CardAddViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CardAddViewController.m; sourceTree = ""; }; + A9A5A3481A0F603B004AD234 /* CardAddViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CardAddViewController.xib; sourceTree = ""; }; A9A6AD2C19CB1C7000626B48 /* MainOrderViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainOrderViewController.h; sourceTree = ""; }; A9A6AD2D19CB1C7000626B48 /* MainOrderViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainOrderViewController.m; sourceTree = ""; }; A9A6AD2E19CB1C7000626B48 /* MainOrderViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainOrderViewController.xib; sourceTree = ""; }; @@ -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 = ""; @@ -719,6 +776,27 @@ path = MoveView; sourceTree = ""; }; + A9548ED01A104ED9008B5A3D /* OpenUDID */ = { + isa = PBXGroup; + children = ( + A9548ED11A104ED9008B5A3D /* OpenUDID.h */, + A9548ED21A104ED9008B5A3D /* OpenUDID.m */, + A9548ED31A104ED9008B5A3D /* README.md */, + ); + path = OpenUDID; + sourceTree = ""; + }; + A96ACD861A0FE42000DEFF7B /* IP */ = { + isa = PBXGroup; + children = ( + A96ACD871A0FE43900DEFF7B /* IPAddress.c */, + A96ACD891A0FE46C00DEFF7B /* IPAddress.h */, + A96ACD8A1A0FE65C00DEFF7B /* IPGet.cpp */, + A96ACD8B1A0FE65C00DEFF7B /* IPGet.h */, + ); + path = IP; + sourceTree = ""; + }; 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; diff --git a/ManagerDemo.xcworkspace/xcshareddata/ManagerDemo.xccheckout b/ManagerDemo.xcworkspace/xcshareddata/ManagerDemo.xccheckout index f6462b3..68c9b2a 100644 --- a/ManagerDemo.xcworkspace/xcshareddata/ManagerDemo.xccheckout +++ b/ManagerDemo.xcworkspace/xcshareddata/ManagerDemo.xccheckout @@ -5,7 +5,7 @@ IDESourceControlProjectFavoriteDictionaryKey IDESourceControlProjectIdentifier - 7DF83542-E9D0-478B-AF8C-E271ADCDB5F5 + 15C51D19-A4BE-42F8-AB81-A76CAEEC4119 IDESourceControlProjectName ManagerDemo IDESourceControlProjectOriginsDictionary diff --git a/ManagerDemo.xcworkspace/xcuserdata/xmfish.xcuserdatad/UserInterfaceState.xcuserstate b/ManagerDemo.xcworkspace/xcuserdata/xmfish.xcuserdatad/UserInterfaceState.xcuserstate index c5bd10b..9313898 100644 Binary files a/ManagerDemo.xcworkspace/xcuserdata/xmfish.xcuserdatad/UserInterfaceState.xcuserstate and b/ManagerDemo.xcworkspace/xcuserdata/xmfish.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ManagerDemo/Common/IP/IPAddress.c b/ManagerDemo/Common/IP/IPAddress.c new file mode 100644 index 0000000..c125f58 --- /dev/null +++ b/ManagerDemo/Common/IP/IPAddress.c @@ -0,0 +1,216 @@ +// +// IPAddress.c +// ManagerDemo +// +// Created by xmfish on 14/11/10. +// Copyright (c) 2014年 ash. All rights reserved. +// + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#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; iifr_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; iifr_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; iifr_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); +} diff --git a/ManagerDemo/Common/IP/IPAddress.h b/ManagerDemo/Common/IP/IPAddress.h new file mode 100644 index 0000000..3c97597 --- /dev/null +++ b/ManagerDemo/Common/IP/IPAddress.h @@ -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 diff --git a/ManagerDemo/Common/IP/IPGet.cpp b/ManagerDemo/Common/IP/IPGet.cpp new file mode 100644 index 0000000..6cd166c --- /dev/null +++ b/ManagerDemo/Common/IP/IPGet.cpp @@ -0,0 +1,217 @@ +// +// IPGet.cpp +// ManagerDemo +// +// Created by xmfish on 14/11/10. +// Copyright (c) 2014年 ash. All rights reserved. +// + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#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; iifr_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; iifr_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; iifr_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); +} + diff --git a/ManagerDemo/Common/IP/IPGet.h b/ManagerDemo/Common/IP/IPGet.h new file mode 100644 index 0000000..4e582e0 --- /dev/null +++ b/ManagerDemo/Common/IP/IPGet.h @@ -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 +#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__) */ diff --git a/ManagerDemo/Common/OpenUDID/OpenUDID.h b/ManagerDemo/Common/OpenUDID/OpenUDID.h new file mode 100755 index 0000000..a09e313 --- /dev/null +++ b/ManagerDemo/Common/OpenUDID/OpenUDID.h @@ -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 + +// +// 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 diff --git a/ManagerDemo/Common/OpenUDID/OpenUDID.m b/ManagerDemo/Common/OpenUDID/OpenUDID.m new file mode 100755 index 0000000..b03d3c6 --- /dev/null +++ b/ManagerDemo/Common/OpenUDID/OpenUDID.m @@ -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 // Need to import for CC_MD5 access +#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR +#import +#import +#else +#import +#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; n0)? [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 diff --git a/ManagerDemo/Common/OpenUDID/README.md b/ManagerDemo/Common/OpenUDID/README.md new file mode 100755 index 0000000..9a60d24 --- /dev/null +++ b/ManagerDemo/Common/OpenUDID/README.md @@ -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. + +![image](http://appsfire.com/images/misc/OpenUDID_Industry_supporters_2.png) + +####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 +![image](http://appsfire.com/images/misc/openudid_seal_large.png) +![image](http://appsfire.com/images/misc/openudid_seal_medium.png) +![image](http://appsfire.com/images/misc/openudid_seal_small.png) diff --git a/ManagerDemo/MainView/ProductView/CardAddViewController.h b/ManagerDemo/MainView/ProductView/CardAddViewController.h new file mode 100644 index 0000000..a723d60 --- /dev/null +++ b/ManagerDemo/MainView/ProductView/CardAddViewController.h @@ -0,0 +1,21 @@ +// +// CardAddViewController.h +// ManagerDemo +// +// Created by xmfish on 14/11/9. +// Copyright (c) 2014年 ash. All rights reserved. +// + +#import + +@interface CardAddViewController : UIViewController +@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 diff --git a/ManagerDemo/MainView/ProductView/CardAddViewController.m b/ManagerDemo/MainView/ProductView/CardAddViewController.m new file mode 100644 index 0000000..0d24e23 --- /dev/null +++ b/ManagerDemo/MainView/ProductView/CardAddViewController.m @@ -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 diff --git a/ManagerDemo/MainView/ProductView/CardAddViewController.xib b/ManagerDemo/MainView/ProductView/CardAddViewController.xib new file mode 100644 index 0000000..f777e93 --- /dev/null +++ b/ManagerDemo/MainView/ProductView/CardAddViewController.xib @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ManagerDemo/MainView/ProductView/CardBindViewController.h b/ManagerDemo/MainView/ProductView/CardBindViewController.h new file mode 100644 index 0000000..5b0b1d2 --- /dev/null +++ b/ManagerDemo/MainView/ProductView/CardBindViewController.h @@ -0,0 +1,31 @@ +// +// CardBindViewController.h +// ManagerDemo +// +// Created by xmfish on 14/11/10. +// Copyright (c) 2014年 ash. All rights reserved. +// + +#import + +@interface CardBindViewController : UIViewController + +@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 diff --git a/ManagerDemo/MainView/ProductView/CardBindViewController.mm b/ManagerDemo/MainView/ProductView/CardBindViewController.mm new file mode 100644 index 0000000..c7f4517 --- /dev/null +++ b/ManagerDemo/MainView/ProductView/CardBindViewController.mm @@ -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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ManagerDemo/MainView/ProductView/CardSelectViewController.h b/ManagerDemo/MainView/ProductView/CardSelectViewController.h new file mode 100644 index 0000000..d475b07 --- /dev/null +++ b/ManagerDemo/MainView/ProductView/CardSelectViewController.h @@ -0,0 +1,15 @@ +// +// CardSelectViewController.h +// ManagerDemo +// +// Created by xmfish on 14/11/9. +// Copyright (c) 2014年 ash. All rights reserved. +// + +#import + +@interface CardSelectViewController : UIViewController +@property (weak, nonatomic) IBOutlet UITableView *tableView; +@property (assign, nonatomic)NSInteger amount; +@property (strong, nonatomic)NSString* proId; +@end diff --git a/ManagerDemo/MainView/ProductView/CardSelectViewController.m b/ManagerDemo/MainView/ProductView/CardSelectViewController.m new file mode 100644 index 0000000..06587ee --- /dev/null +++ b/ManagerDemo/MainView/ProductView/CardSelectViewController.m @@ -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 diff --git a/ManagerDemo/MainView/ProductView/CardSelectViewController.xib b/ManagerDemo/MainView/ProductView/CardSelectViewController.xib new file mode 100644 index 0000000..f6a16fd --- /dev/null +++ b/ManagerDemo/MainView/ProductView/CardSelectViewController.xib @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ManagerDemo/MainView/ProductView/MainOrderViewController.m b/ManagerDemo/MainView/ProductView/MainOrderViewController.m index 718fe05..12e5b34 100644 --- a/ManagerDemo/MainView/ProductView/MainOrderViewController.m +++ b/ManagerDemo/MainView/ProductView/MainOrderViewController.m @@ -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]; diff --git a/ManagerDemo/MainView/ProductView/OrderPassWordViewController.h b/ManagerDemo/MainView/ProductView/OrderPassWordViewController.h index 37716b0..1f8ea88 100644 --- a/ManagerDemo/MainView/ProductView/OrderPassWordViewController.h +++ b/ManagerDemo/MainView/ProductView/OrderPassWordViewController.h @@ -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; diff --git a/ManagerDemo/MainView/ProductView/OrderPassWordViewController.mm b/ManagerDemo/MainView/ProductView/OrderPassWordViewController.mm index 4b313a8..574b9ad 100644 --- a/ManagerDemo/MainView/ProductView/OrderPassWordViewController.mm +++ b/ManagerDemo/MainView/ProductView/OrderPassWordViewController.mm @@ -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 diff --git a/ManagerDemo/MainView/ProductView/OrderPassWordViewController.xib b/ManagerDemo/MainView/ProductView/OrderPassWordViewController.xib index a271849..36da8ba 100644 --- a/ManagerDemo/MainView/ProductView/OrderPassWordViewController.xib +++ b/ManagerDemo/MainView/ProductView/OrderPassWordViewController.xib @@ -1,11 +1,12 @@ - + + @@ -17,7 +18,7 @@ - + @@ -34,6 +35,13 @@ + diff --git a/ManagerDemo/MainView/ProductView/WYDProductViewController.m b/ManagerDemo/MainView/ProductView/WYDProductViewController.m index f347188..38a3482 100644 --- a/ManagerDemo/MainView/ProductView/WYDProductViewController.m +++ b/ManagerDemo/MainView/ProductView/WYDProductViewController.m @@ -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]; diff --git a/ManagerDemo/MainView/ProductView/YiBaoMessageViewController.h b/ManagerDemo/MainView/ProductView/YiBaoMessageViewController.h new file mode 100644 index 0000000..6cd273a --- /dev/null +++ b/ManagerDemo/MainView/ProductView/YiBaoMessageViewController.h @@ -0,0 +1,17 @@ +// +// YiBaoMessageViewController.h +// ManagerDemo +// +// Created by xmfish on 14/11/10. +// Copyright (c) 2014年 ash. All rights reserved. +// + +#import + +@interface YiBaoMessageViewController : UIViewController +@property (weak, nonatomic) IBOutlet UITextField *orderId; +@property (weak, nonatomic) IBOutlet UITextField *ybVerCode; +- (IBAction)completeBtnClick:(id)sender; +@property (weak, nonatomic) IBOutlet UIButton *completeBtn; + +@end diff --git a/ManagerDemo/MainView/ProductView/YiBaoMessageViewController.m b/ManagerDemo/MainView/ProductView/YiBaoMessageViewController.m new file mode 100644 index 0000000..588f111 --- /dev/null +++ b/ManagerDemo/MainView/ProductView/YiBaoMessageViewController.m @@ -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 diff --git a/ManagerDemo/MainView/ProductView/YiBaoMessageViewController.xib b/ManagerDemo/MainView/ProductView/YiBaoMessageViewController.xib new file mode 100644 index 0000000..e7654bc --- /dev/null +++ b/ManagerDemo/MainView/ProductView/YiBaoMessageViewController.xib @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ManagerDemo/Resource/check_mark@2x.png b/ManagerDemo/Resource/check_mark@2x.png new file mode 100644 index 0000000..6fa6c15 Binary files /dev/null and b/ManagerDemo/Resource/check_mark@2x.png differ diff --git a/ManagerDemo/Resource/daidaitong01@2x.png b/ManagerDemo/Resource/daidaitong01@2x.png new file mode 100644 index 0000000..5ea9df9 Binary files /dev/null and b/ManagerDemo/Resource/daidaitong01@2x.png differ diff --git a/ManagerDemo/Resource/daidaitong02@2x.png b/ManagerDemo/Resource/daidaitong02@2x.png new file mode 100644 index 0000000..e06a7eb Binary files /dev/null and b/ManagerDemo/Resource/daidaitong02@2x.png differ diff --git a/ManagerDemo/Resource/daidaitong03@2x.png b/ManagerDemo/Resource/daidaitong03@2x.png new file mode 100644 index 0000000..1e3c2d5 Binary files /dev/null and b/ManagerDemo/Resource/daidaitong03@2x.png differ diff --git a/ManagerDemo/Resource/daidaitong_03.jpg b/ManagerDemo/Resource/daidaitong_03.jpg new file mode 100644 index 0000000..b908823 Binary files /dev/null and b/ManagerDemo/Resource/daidaitong_03.jpg differ diff --git a/ManagerDemo/Resource/daidaitong_06.jpg b/ManagerDemo/Resource/daidaitong_06.jpg new file mode 100644 index 0000000..b5ccf2e Binary files /dev/null and b/ManagerDemo/Resource/daidaitong_06.jpg differ diff --git a/ManagerDemo/Resource/daidaitong_13.jpg b/ManagerDemo/Resource/daidaitong_13.jpg new file mode 100644 index 0000000..9b9354a Binary files /dev/null and b/ManagerDemo/Resource/daidaitong_13.jpg differ