new
@@ -14,6 +14,36 @@
|
||||
A9841F2C1C04357C00FB72AA /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A9841F2A1C04357C00FB72AA /* Main.storyboard */; };
|
||||
A9841F2E1C04357C00FB72AA /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A9841F2D1C04357C00FB72AA /* Assets.xcassets */; };
|
||||
A9841F311C04357C00FB72AA /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A9841F2F1C04357C00FB72AA /* LaunchScreen.storyboard */; };
|
||||
A986A3531C04C4DC00B55F38 /* BaseAPIClient.m in Sources */ = {isa = PBXBuildFile; fileRef = A986A3261C04C4DC00B55F38 /* BaseAPIClient.m */; };
|
||||
A986A3541C04C4DC00B55F38 /* BaseEntity.m in Sources */ = {isa = PBXBuildFile; fileRef = A986A3281C04C4DC00B55F38 /* BaseEntity.m */; };
|
||||
A986A3551C04C4DC00B55F38 /* BaseModel.m in Sources */ = {isa = PBXBuildFile; fileRef = A986A32A1C04C4DC00B55F38 /* BaseModel.m */; };
|
||||
A986A3561C04C4DC00B55F38 /* BaseWLService.m in Sources */ = {isa = PBXBuildFile; fileRef = A986A32C1C04C4DC00B55F38 /* BaseWLService.m */; };
|
||||
A986A3571C04C4DC00B55F38 /* LoginModel.m in Sources */ = {isa = PBXBuildFile; fileRef = A986A32E1C04C4DC00B55F38 /* LoginModel.m */; };
|
||||
A986A3581C04C4DC00B55F38 /* NSString+HXAddtions.m in Sources */ = {isa = PBXBuildFile; fileRef = A986A3301C04C4DC00B55F38 /* NSString+HXAddtions.m */; };
|
||||
A986A3591C04C4DC00B55F38 /* about_logo@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A986A3321C04C4DC00B55F38 /* about_logo@2x.png */; };
|
||||
A986A35A1C04C4DC00B55F38 /* brand.png in Resources */ = {isa = PBXBuildFile; fileRef = A986A3331C04C4DC00B55F38 /* brand.png */; };
|
||||
A986A35B1C04C4DC00B55F38 /* icon48.back.png in Resources */ = {isa = PBXBuildFile; fileRef = A986A3341C04C4DC00B55F38 /* icon48.back.png */; };
|
||||
A986A35C1C04C4DC00B55F38 /* icon48.scan.png in Resources */ = {isa = PBXBuildFile; fileRef = A986A3351C04C4DC00B55F38 /* icon48.scan.png */; };
|
||||
A986A35D1C04C4DC00B55F38 /* icon48.search.png in Resources */ = {isa = PBXBuildFile; fileRef = A986A3361C04C4DC00B55F38 /* icon48.search.png */; };
|
||||
A986A35E1C04C4DC00B55F38 /* icon512.wlian.png in Resources */ = {isa = PBXBuildFile; fileRef = A986A3371C04C4DC00B55F38 /* icon512.wlian.png */; };
|
||||
A986A35F1C04C4DC00B55F38 /* icon72.card.png in Resources */ = {isa = PBXBuildFile; fileRef = A986A3381C04C4DC00B55F38 /* icon72.card.png */; };
|
||||
A986A3601C04C4DC00B55F38 /* icon72.charge@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A986A3391C04C4DC00B55F38 /* icon72.charge@2x.png */; };
|
||||
A986A3611C04C4DC00B55F38 /* icon72.done.png in Resources */ = {isa = PBXBuildFile; fileRef = A986A33A1C04C4DC00B55F38 /* icon72.done.png */; };
|
||||
A986A3621C04C4DC00B55F38 /* icon72.home.png in Resources */ = {isa = PBXBuildFile; fileRef = A986A33B1C04C4DC00B55F38 /* icon72.home.png */; };
|
||||
A986A3631C04C4DC00B55F38 /* icon72.logout.png in Resources */ = {isa = PBXBuildFile; fileRef = A986A33C1C04C4DC00B55F38 /* icon72.logout.png */; };
|
||||
A986A3641C04C4DC00B55F38 /* icon72.refund.png in Resources */ = {isa = PBXBuildFile; fileRef = A986A33D1C04C4DC00B55F38 /* icon72.refund.png */; };
|
||||
A986A3651C04C4DC00B55F38 /* icon72.search.png in Resources */ = {isa = PBXBuildFile; fileRef = A986A33E1C04C4DC00B55F38 /* icon72.search.png */; };
|
||||
A986A3661C04C4DC00B55F38 /* icon72.update.png in Resources */ = {isa = PBXBuildFile; fileRef = A986A33F1C04C4DC00B55F38 /* icon72.update.png */; };
|
||||
A986A3671C04C4DC00B55F38 /* icon72.valid.png in Resources */ = {isa = PBXBuildFile; fileRef = A986A3401C04C4DC00B55F38 /* icon72.valid.png */; };
|
||||
A986A3681C04C4DC00B55F38 /* icon72.wait.png in Resources */ = {isa = PBXBuildFile; fileRef = A986A3411C04C4DC00B55F38 /* icon72.wait.png */; };
|
||||
A986A3691C04C4DC00B55F38 /* icon72.write.png in Resources */ = {isa = PBXBuildFile; fileRef = A986A3421C04C4DC00B55F38 /* icon72.write.png */; };
|
||||
A986A36A1C04C4DC00B55F38 /* titlebg.png in Resources */ = {isa = PBXBuildFile; fileRef = A986A3431C04C4DC00B55F38 /* titlebg.png */; };
|
||||
A986A36B1C04C4DC00B55F38 /* AWordDefault.m in Sources */ = {isa = PBXBuildFile; fileRef = A986A3461C04C4DC00B55F38 /* AWordDefault.m */; };
|
||||
A986A36C1C04C4DC00B55F38 /* MBProgressHUD+Util.m in Sources */ = {isa = PBXBuildFile; fileRef = A986A3491C04C4DC00B55F38 /* MBProgressHUD+Util.m */; };
|
||||
A986A36D1C04C4DC00B55F38 /* LoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A986A34C1C04C4DC00B55F38 /* LoginViewController.m */; };
|
||||
A986A36E1C04C4DC00B55F38 /* LoginViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A986A34D1C04C4DC00B55F38 /* LoginViewController.xib */; };
|
||||
A986A36F1C04C4DC00B55F38 /* BaseViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = A986A3501C04C4DC00B55F38 /* BaseViewModel.m */; };
|
||||
A986A3701C04C4DC00B55F38 /* LoginViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = A986A3521C04C4DC00B55F38 /* LoginViewModel.m */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
@@ -30,6 +60,49 @@
|
||||
A9841F2D1C04357C00FB72AA /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
A9841F301C04357C00FB72AA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
A9841F321C04357C00FB72AA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
A986A3231C04C4DC00B55F38 /* Common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Common.h; sourceTree = "<group>"; };
|
||||
A986A3251C04C4DC00B55F38 /* BaseAPIClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseAPIClient.h; sourceTree = "<group>"; };
|
||||
A986A3261C04C4DC00B55F38 /* BaseAPIClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BaseAPIClient.m; sourceTree = "<group>"; };
|
||||
A986A3271C04C4DC00B55F38 /* BaseEntity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseEntity.h; sourceTree = "<group>"; };
|
||||
A986A3281C04C4DC00B55F38 /* BaseEntity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BaseEntity.m; sourceTree = "<group>"; };
|
||||
A986A3291C04C4DC00B55F38 /* BaseModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseModel.h; sourceTree = "<group>"; };
|
||||
A986A32A1C04C4DC00B55F38 /* BaseModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BaseModel.m; sourceTree = "<group>"; };
|
||||
A986A32B1C04C4DC00B55F38 /* BaseWLService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseWLService.h; sourceTree = "<group>"; };
|
||||
A986A32C1C04C4DC00B55F38 /* BaseWLService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BaseWLService.m; sourceTree = "<group>"; };
|
||||
A986A32D1C04C4DC00B55F38 /* LoginModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoginModel.h; sourceTree = "<group>"; };
|
||||
A986A32E1C04C4DC00B55F38 /* LoginModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LoginModel.m; sourceTree = "<group>"; };
|
||||
A986A32F1C04C4DC00B55F38 /* NSString+HXAddtions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+HXAddtions.h"; sourceTree = "<group>"; };
|
||||
A986A3301C04C4DC00B55F38 /* NSString+HXAddtions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+HXAddtions.m"; sourceTree = "<group>"; };
|
||||
A986A3321C04C4DC00B55F38 /* about_logo@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "about_logo@2x.png"; sourceTree = "<group>"; };
|
||||
A986A3331C04C4DC00B55F38 /* brand.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = brand.png; sourceTree = "<group>"; };
|
||||
A986A3341C04C4DC00B55F38 /* icon48.back.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon48.back.png; sourceTree = "<group>"; };
|
||||
A986A3351C04C4DC00B55F38 /* icon48.scan.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon48.scan.png; sourceTree = "<group>"; };
|
||||
A986A3361C04C4DC00B55F38 /* icon48.search.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon48.search.png; sourceTree = "<group>"; };
|
||||
A986A3371C04C4DC00B55F38 /* icon512.wlian.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon512.wlian.png; sourceTree = "<group>"; };
|
||||
A986A3381C04C4DC00B55F38 /* icon72.card.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon72.card.png; sourceTree = "<group>"; };
|
||||
A986A3391C04C4DC00B55F38 /* icon72.charge@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon72.charge@2x.png"; sourceTree = "<group>"; };
|
||||
A986A33A1C04C4DC00B55F38 /* icon72.done.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon72.done.png; sourceTree = "<group>"; };
|
||||
A986A33B1C04C4DC00B55F38 /* icon72.home.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon72.home.png; sourceTree = "<group>"; };
|
||||
A986A33C1C04C4DC00B55F38 /* icon72.logout.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon72.logout.png; sourceTree = "<group>"; };
|
||||
A986A33D1C04C4DC00B55F38 /* icon72.refund.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon72.refund.png; sourceTree = "<group>"; };
|
||||
A986A33E1C04C4DC00B55F38 /* icon72.search.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon72.search.png; sourceTree = "<group>"; };
|
||||
A986A33F1C04C4DC00B55F38 /* icon72.update.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon72.update.png; sourceTree = "<group>"; };
|
||||
A986A3401C04C4DC00B55F38 /* icon72.valid.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon72.valid.png; sourceTree = "<group>"; };
|
||||
A986A3411C04C4DC00B55F38 /* icon72.wait.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon72.wait.png; sourceTree = "<group>"; };
|
||||
A986A3421C04C4DC00B55F38 /* icon72.write.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon72.write.png; sourceTree = "<group>"; };
|
||||
A986A3431C04C4DC00B55F38 /* titlebg.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = titlebg.png; sourceTree = "<group>"; };
|
||||
A986A3451C04C4DC00B55F38 /* AWordDefault.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AWordDefault.h; sourceTree = "<group>"; };
|
||||
A986A3461C04C4DC00B55F38 /* AWordDefault.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AWordDefault.m; sourceTree = "<group>"; };
|
||||
A986A3481C04C4DC00B55F38 /* MBProgressHUD+Util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MBProgressHUD+Util.h"; sourceTree = "<group>"; };
|
||||
A986A3491C04C4DC00B55F38 /* MBProgressHUD+Util.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MBProgressHUD+Util.m"; sourceTree = "<group>"; };
|
||||
A986A34B1C04C4DC00B55F38 /* LoginViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoginViewController.h; sourceTree = "<group>"; };
|
||||
A986A34C1C04C4DC00B55F38 /* LoginViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LoginViewController.m; sourceTree = "<group>"; };
|
||||
A986A34D1C04C4DC00B55F38 /* LoginViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LoginViewController.xib; sourceTree = "<group>"; };
|
||||
A986A34F1C04C4DC00B55F38 /* BaseViewModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseViewModel.h; sourceTree = "<group>"; };
|
||||
A986A3501C04C4DC00B55F38 /* BaseViewModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BaseViewModel.m; sourceTree = "<group>"; };
|
||||
A986A3511C04C4DC00B55F38 /* LoginViewModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoginViewModel.h; sourceTree = "<group>"; };
|
||||
A986A3521C04C4DC00B55F38 /* LoginViewModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LoginViewModel.m; sourceTree = "<group>"; };
|
||||
A986A3711C04C4EE00B55F38 /* PrefixHeader.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrefixHeader.pch; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -73,6 +146,12 @@
|
||||
A9841F201C04357C00FB72AA /* Doctor */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A986A3221C04C4DC00B55F38 /* Config */,
|
||||
A986A3241C04C4DC00B55F38 /* Model */,
|
||||
A986A3311C04C4DC00B55F38 /* Resource */,
|
||||
A986A3441C04C4DC00B55F38 /* Util */,
|
||||
A986A34A1C04C4DC00B55F38 /* View */,
|
||||
A986A34E1C04C4DC00B55F38 /* ViewModel */,
|
||||
A9841F241C04357C00FB72AA /* AppDelegate.h */,
|
||||
A9841F251C04357C00FB72AA /* AppDelegate.m */,
|
||||
A9841F271C04357C00FB72AA /* ViewController.h */,
|
||||
@@ -89,11 +168,104 @@
|
||||
A9841F211C04357C00FB72AA /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A986A3711C04C4EE00B55F38 /* PrefixHeader.pch */,
|
||||
A9841F221C04357C00FB72AA /* main.m */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
A986A3221C04C4DC00B55F38 /* Config */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A986A3231C04C4DC00B55F38 /* Common.h */,
|
||||
);
|
||||
path = Config;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
A986A3241C04C4DC00B55F38 /* Model */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A986A3251C04C4DC00B55F38 /* BaseAPIClient.h */,
|
||||
A986A3261C04C4DC00B55F38 /* BaseAPIClient.m */,
|
||||
A986A3271C04C4DC00B55F38 /* BaseEntity.h */,
|
||||
A986A3281C04C4DC00B55F38 /* BaseEntity.m */,
|
||||
A986A3291C04C4DC00B55F38 /* BaseModel.h */,
|
||||
A986A32A1C04C4DC00B55F38 /* BaseModel.m */,
|
||||
A986A32B1C04C4DC00B55F38 /* BaseWLService.h */,
|
||||
A986A32C1C04C4DC00B55F38 /* BaseWLService.m */,
|
||||
A986A32D1C04C4DC00B55F38 /* LoginModel.h */,
|
||||
A986A32E1C04C4DC00B55F38 /* LoginModel.m */,
|
||||
A986A32F1C04C4DC00B55F38 /* NSString+HXAddtions.h */,
|
||||
A986A3301C04C4DC00B55F38 /* NSString+HXAddtions.m */,
|
||||
);
|
||||
path = Model;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
A986A3311C04C4DC00B55F38 /* Resource */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A986A3321C04C4DC00B55F38 /* about_logo@2x.png */,
|
||||
A986A3331C04C4DC00B55F38 /* brand.png */,
|
||||
A986A3341C04C4DC00B55F38 /* icon48.back.png */,
|
||||
A986A3351C04C4DC00B55F38 /* icon48.scan.png */,
|
||||
A986A3361C04C4DC00B55F38 /* icon48.search.png */,
|
||||
A986A3371C04C4DC00B55F38 /* icon512.wlian.png */,
|
||||
A986A3381C04C4DC00B55F38 /* icon72.card.png */,
|
||||
A986A3391C04C4DC00B55F38 /* icon72.charge@2x.png */,
|
||||
A986A33A1C04C4DC00B55F38 /* icon72.done.png */,
|
||||
A986A33B1C04C4DC00B55F38 /* icon72.home.png */,
|
||||
A986A33C1C04C4DC00B55F38 /* icon72.logout.png */,
|
||||
A986A33D1C04C4DC00B55F38 /* icon72.refund.png */,
|
||||
A986A33E1C04C4DC00B55F38 /* icon72.search.png */,
|
||||
A986A33F1C04C4DC00B55F38 /* icon72.update.png */,
|
||||
A986A3401C04C4DC00B55F38 /* icon72.valid.png */,
|
||||
A986A3411C04C4DC00B55F38 /* icon72.wait.png */,
|
||||
A986A3421C04C4DC00B55F38 /* icon72.write.png */,
|
||||
A986A3431C04C4DC00B55F38 /* titlebg.png */,
|
||||
);
|
||||
path = Resource;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
A986A3441C04C4DC00B55F38 /* Util */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A986A3451C04C4DC00B55F38 /* AWordDefault.h */,
|
||||
A986A3461C04C4DC00B55F38 /* AWordDefault.m */,
|
||||
A986A3471C04C4DC00B55F38 /* MBProgressHUD */,
|
||||
);
|
||||
path = Util;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
A986A3471C04C4DC00B55F38 /* MBProgressHUD */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A986A3481C04C4DC00B55F38 /* MBProgressHUD+Util.h */,
|
||||
A986A3491C04C4DC00B55F38 /* MBProgressHUD+Util.m */,
|
||||
);
|
||||
path = MBProgressHUD;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
A986A34A1C04C4DC00B55F38 /* View */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A986A34B1C04C4DC00B55F38 /* LoginViewController.h */,
|
||||
A986A34C1C04C4DC00B55F38 /* LoginViewController.m */,
|
||||
A986A34D1C04C4DC00B55F38 /* LoginViewController.xib */,
|
||||
);
|
||||
path = View;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
A986A34E1C04C4DC00B55F38 /* ViewModel */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A986A34F1C04C4DC00B55F38 /* BaseViewModel.h */,
|
||||
A986A3501C04C4DC00B55F38 /* BaseViewModel.m */,
|
||||
A986A3511C04C4DC00B55F38 /* LoginViewModel.h */,
|
||||
A986A3521C04C4DC00B55F38 /* LoginViewModel.m */,
|
||||
);
|
||||
path = ViewModel;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
EE0E51118CD397393147ABC3 /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -163,9 +335,28 @@
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
A986A35F1C04C4DC00B55F38 /* icon72.card.png in Resources */,
|
||||
A986A35B1C04C4DC00B55F38 /* icon48.back.png in Resources */,
|
||||
A986A36E1C04C4DC00B55F38 /* LoginViewController.xib in Resources */,
|
||||
A986A3641C04C4DC00B55F38 /* icon72.refund.png in Resources */,
|
||||
A9841F311C04357C00FB72AA /* LaunchScreen.storyboard in Resources */,
|
||||
A986A3591C04C4DC00B55F38 /* about_logo@2x.png in Resources */,
|
||||
A986A36A1C04C4DC00B55F38 /* titlebg.png in Resources */,
|
||||
A986A35C1C04C4DC00B55F38 /* icon48.scan.png in Resources */,
|
||||
A986A3681C04C4DC00B55F38 /* icon72.wait.png in Resources */,
|
||||
A986A35E1C04C4DC00B55F38 /* icon512.wlian.png in Resources */,
|
||||
A986A3631C04C4DC00B55F38 /* icon72.logout.png in Resources */,
|
||||
A986A3661C04C4DC00B55F38 /* icon72.update.png in Resources */,
|
||||
A986A3691C04C4DC00B55F38 /* icon72.write.png in Resources */,
|
||||
A9841F2E1C04357C00FB72AA /* Assets.xcassets in Resources */,
|
||||
A986A35D1C04C4DC00B55F38 /* icon48.search.png in Resources */,
|
||||
A986A3651C04C4DC00B55F38 /* icon72.search.png in Resources */,
|
||||
A986A3611C04C4DC00B55F38 /* icon72.done.png in Resources */,
|
||||
A986A35A1C04C4DC00B55F38 /* brand.png in Resources */,
|
||||
A9841F2C1C04357C00FB72AA /* Main.storyboard in Resources */,
|
||||
A986A3671C04C4DC00B55F38 /* icon72.valid.png in Resources */,
|
||||
A986A3621C04C4DC00B55F38 /* icon72.home.png in Resources */,
|
||||
A986A3601C04C4DC00B55F38 /* icon72.charge@2x.png in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -224,9 +415,20 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
A986A3581C04C4DC00B55F38 /* NSString+HXAddtions.m in Sources */,
|
||||
A986A3551C04C4DC00B55F38 /* BaseModel.m in Sources */,
|
||||
A986A3571C04C4DC00B55F38 /* LoginModel.m in Sources */,
|
||||
A9841F291C04357C00FB72AA /* ViewController.m in Sources */,
|
||||
A986A3701C04C4DC00B55F38 /* LoginViewModel.m in Sources */,
|
||||
A986A36F1C04C4DC00B55F38 /* BaseViewModel.m in Sources */,
|
||||
A986A3541C04C4DC00B55F38 /* BaseEntity.m in Sources */,
|
||||
A986A36B1C04C4DC00B55F38 /* AWordDefault.m in Sources */,
|
||||
A986A36C1C04C4DC00B55F38 /* MBProgressHUD+Util.m in Sources */,
|
||||
A9841F261C04357C00FB72AA /* AppDelegate.m in Sources */,
|
||||
A986A36D1C04C4DC00B55F38 /* LoginViewController.m in Sources */,
|
||||
A986A3531C04C4DC00B55F38 /* BaseAPIClient.m in Sources */,
|
||||
A9841F231C04357C00FB72AA /* main.m in Sources */,
|
||||
A986A3561C04C4DC00B55F38 /* BaseWLService.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -337,6 +539,7 @@
|
||||
baseConfigurationReference = 039B3B8DE609FF96BF1F8983 /* Pods.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
GCC_PREFIX_HEADER = Doctor/PrefixHeader.pch;
|
||||
INFOPLIST_FILE = Doctor/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = ash.Doctor;
|
||||
@@ -349,6 +552,7 @@
|
||||
baseConfigurationReference = 1FF024B7A433F169D4A7C1DB /* Pods.release.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
GCC_PREFIX_HEADER = Doctor/PrefixHeader.pch;
|
||||
INFOPLIST_FILE = Doctor/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = ash.Doctor;
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
//
|
||||
// Common.h
|
||||
// Ash_AWord
|
||||
//
|
||||
// Created by xmfish on 15/3/30.
|
||||
// Copyright (c) 2015年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef Ash_AWord_Common_h
|
||||
#define Ash_AWord_Common_h
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifndef DLog
|
||||
# define DLog(fmt, ...) {NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);}
|
||||
#endif
|
||||
#ifndef ELog
|
||||
# define ELog(err) {if(err) DLog(@"%@", err)}
|
||||
#endif
|
||||
#else
|
||||
#ifndef DLog
|
||||
# define DLog(...)
|
||||
#endif
|
||||
#ifndef ELog
|
||||
# define ELog(err)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 系统版本
|
||||
*/
|
||||
#define iOSVersion ([[[UIDevice currentDevice] systemVersion] floatValue]) //系统版本
|
||||
#define iOS7AndLater ( [[[UIDevice currentDevice] systemVersion] compare:@"7.0"] != NSOrderedAscending )
|
||||
|
||||
#define isiPhone5 ([[UIScreen mainScreen] bounds].size.height == 568)
|
||||
#define isiPhone4s ([[UIScreen mainScreen] bounds].size.height == 480)
|
||||
|
||||
/**
|
||||
* 获取当前window宽高
|
||||
*/
|
||||
#define kScreenWidth ([[UIScreen mainScreen] bounds].size.width)
|
||||
#define kScreenHeight ([[UIScreen mainScreen] bounds].size.height)
|
||||
|
||||
#define kMainScreenFrame ([[UIScreen mainScreen] bounds])
|
||||
|
||||
|
||||
|
||||
|
||||
//文字标签
|
||||
#define kNetworkErrorTips @"网络连接失败"
|
||||
#define kSSoErrorTips @"授权失败,请重新授权"
|
||||
#define kLoginTips @"登录中"
|
||||
#define kLoadingTips @"加载中。。。"
|
||||
/**
|
||||
* 接口地址
|
||||
*/
|
||||
|
||||
#define WL_API_URL @"http://mapi.wlian.com/gateway/"
|
||||
#define WL_DEV_API_URL @"http://api.dev.wliantx.com/gateway/"
|
||||
|
||||
|
||||
#define DefaultUserIcon [UIImage imageNamed:@"defaultUserIcon"]
|
||||
|
||||
#define DefaultPageSize 20
|
||||
#endif
|
||||
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// BaseAPIClient.h
|
||||
// WlianWorld
|
||||
//
|
||||
// Created by xmfish on 15/11/13.
|
||||
// Copyright © 2015年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "AFHTTPRequestOperationManager.h"
|
||||
|
||||
|
||||
@interface BaseAPIClient : AFHTTPRequestOperationManager
|
||||
|
||||
+ (instancetype)sharedClient;
|
||||
+ (NSString *)getApiBaseString;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// BaseAPIClient.m
|
||||
// WlianWorld
|
||||
//
|
||||
// Created by xmfish on 15/11/13.
|
||||
// Copyright © 2015年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#import "BaseAPIClient.h"
|
||||
|
||||
@implementation BaseAPIClient
|
||||
|
||||
|
||||
+ (instancetype)sharedClient
|
||||
{
|
||||
static BaseAPIClient *_sharedClient = nil;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
_sharedClient = [[BaseAPIClient alloc] initWithBaseURL:[NSURL URLWithString:[self getApiBaseString]]];
|
||||
_sharedClient.securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone];
|
||||
|
||||
[_sharedClient.requestSerializer setValue:@"text/html" forHTTPHeaderField:@"Content-Type"];
|
||||
_sharedClient.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/html"];
|
||||
|
||||
});
|
||||
|
||||
return _sharedClient;
|
||||
}
|
||||
|
||||
+ (NSString *)getApiBaseString
|
||||
{
|
||||
return WL_DEV_API_URL;
|
||||
}
|
||||
@end
|
||||
@@ -0,0 +1,52 @@
|
||||
//
|
||||
// BaseEntity.h
|
||||
// WlianWorld
|
||||
//
|
||||
// Created by xmfish on 15/11/13.
|
||||
// Copyright © 2015年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
|
||||
typedef NS_ENUM(NSUInteger, HTTPRequestType) {
|
||||
HTTPRequestTypeWithGET = 0,
|
||||
HTTPRequestTypeWithPOST,
|
||||
HTTPRequestTypeWithPOSTDATA,
|
||||
};
|
||||
|
||||
@class responesOBJ,DCParserConfiguration;
|
||||
|
||||
@interface proFile : NSObject
|
||||
|
||||
@property (nonatomic, strong) NSData *data;
|
||||
@property (nonatomic, strong) NSString *name; //参数名称
|
||||
@property (nonatomic, strong) NSString *filePath;
|
||||
//@"image/jpeg"
|
||||
@property (nonatomic, strong) NSString *mimeType;
|
||||
|
||||
@property (nonatomic, strong) NSArray *img;
|
||||
|
||||
@end
|
||||
|
||||
//
|
||||
@interface BaseEntity : NSObject
|
||||
|
||||
@property (nonatomic, assign) HTTPRequestType requireType;
|
||||
@property (nonatomic, copy) NSString *reqURL;
|
||||
@property (nonatomic, copy) NSString *callback;
|
||||
@property (nonatomic, strong)NSString* cacheKey;
|
||||
@property (nonatomic, strong) id pro;
|
||||
@property (nonatomic, assign) Class responesOBJ;
|
||||
@property (nonatomic, strong)DCParserConfiguration* config;
|
||||
|
||||
@property (nonatomic, strong) proFile *pFile;
|
||||
//@property (nonatomic, strong) NSArray *img;
|
||||
|
||||
@property (nonatomic, assign) BOOL isCache;
|
||||
|
||||
@property (nonatomic, copy) NSString *localJsonFileName;
|
||||
|
||||
- (NSDictionary *)encodePro;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,100 @@
|
||||
//
|
||||
// BaseEntity.m
|
||||
// WlianWorld
|
||||
//
|
||||
// Created by xmfish on 15/11/13.
|
||||
// Copyright © 2015年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#import "BaseEntity.h"
|
||||
#import "BaseModel.h"
|
||||
#import "NSString+HXAddtions.h"
|
||||
#import "AWordDefault.h"
|
||||
@implementation proFile
|
||||
|
||||
@end
|
||||
static NSString* app_key = @"123456";
|
||||
static NSString* app_key_secret = @"z*~#@kR^*N";
|
||||
@implementation BaseEntity
|
||||
- (NSDictionary *)encodePro
|
||||
{
|
||||
|
||||
NSMutableDictionary* dic= [NSMutableDictionary dictionary];;
|
||||
|
||||
|
||||
[dic setObject:_callback forKey:@"callback"];
|
||||
if(_pro)
|
||||
{
|
||||
[dic setObject:_pro forKey:@"params"];
|
||||
}
|
||||
[dic setObject:@"1" forKey:@"devicecode"];
|
||||
|
||||
NSString* uid = [AWordDefault getUid];
|
||||
if (uid) {
|
||||
[dic setObject:uid forKey:@"uid"];
|
||||
}
|
||||
[dic setObject:@"shop1" forKey:@"username"];
|
||||
NSString* token = [AWordDefault getToken];
|
||||
if (token) {
|
||||
[dic setObject:token forKey:@"token"];
|
||||
}
|
||||
NSString* shopid = [AWordDefault getShopId];
|
||||
if (shopid) {
|
||||
[dic setObject:shopid forKey:@"shopid"];
|
||||
}
|
||||
NSTimeInterval timeStamp = [[NSDate date] timeIntervalSince1970];
|
||||
[dic setObject:[NSString stringWithFormat:@"%f", timeStamp] forKey:@"timestamp"];
|
||||
|
||||
[dic setObject:[self getSignWithDic:dic] forKey:@"sign"];
|
||||
|
||||
|
||||
DLog(@"参数是:%@",dic);
|
||||
NSString* jsonKey = [NSString jsonStringWithDictionary:(NSDictionary*)dic];
|
||||
NSData *nsdata = [jsonKey
|
||||
dataUsingEncoding:NSUTF8StringEncoding];
|
||||
NSString *baseKey = [nsdata base64EncodedStringWithOptions:0];
|
||||
NSMutableString *key = [[NSMutableString alloc]initWithString:baseKey];
|
||||
[key stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
|
||||
NSDictionary *resultDic = @{@"key":key};
|
||||
return resultDic;
|
||||
}
|
||||
|
||||
|
||||
-(NSString*)getSignWithDic:(NSDictionary*)dic
|
||||
{
|
||||
NSString* resultStr = [self getStrWithDic:dic];
|
||||
NSString* appkey = [NSString stringWithFormat:@"%@%@",app_key,app_key_secret];
|
||||
NSString* md5Appkey = [[appkey md5] substringWithRange:NSMakeRange(8, 18)];
|
||||
resultStr = [resultStr stringByAppendingString:md5Appkey];
|
||||
resultStr = [resultStr md5];
|
||||
return resultStr;
|
||||
}
|
||||
|
||||
-(NSString*)getStrWithDic:(NSDictionary*)dic
|
||||
{
|
||||
NSString* resultStr = @"";
|
||||
|
||||
for (NSString* key in [dic allKeys]) {
|
||||
NSObject* obj = [dic objectForKey:key];
|
||||
if ([obj isKindOfClass:[NSDictionary class]]) {
|
||||
obj = [self getStrWithDic:(NSDictionary*)obj];
|
||||
if ([resultStr isEqualToString:@""]) {
|
||||
resultStr = obj;
|
||||
|
||||
}else{
|
||||
resultStr = [NSString stringWithFormat:@"%@&%@",resultStr,obj];
|
||||
|
||||
} }else{
|
||||
if ([resultStr isEqualToString:@""]) {
|
||||
resultStr = [NSString stringWithFormat:@"%@=%@",key,obj];
|
||||
|
||||
}else{
|
||||
resultStr = [NSString stringWithFormat:@"%@&%@=%@",resultStr,key,obj];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return resultStr;
|
||||
}
|
||||
@end
|
||||
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// BaseModel.h
|
||||
// WlianWorld
|
||||
//
|
||||
// Created by xmfish on 15/11/16.
|
||||
// Copyright © 2015年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface BaseModel : MTLModel<MTLJSONSerializing>
|
||||
|
||||
@property (nonatomic,strong)NSString* title;
|
||||
@property (nonatomic,readonly)NSString* errorCode;
|
||||
@property (nonatomic,readonly)NSString* errorMessage;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,47 @@
|
||||
//
|
||||
// BaseModel.m
|
||||
// WlianWorld
|
||||
//
|
||||
// Created by xmfish on 15/11/16.
|
||||
// Copyright © 2015年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#import "BaseModel.h"
|
||||
|
||||
@implementation BaseModel
|
||||
+ (NSDictionary *)JSONKeyPathsByPropertyKey {
|
||||
return @{
|
||||
// @"errCode": @"ret",
|
||||
@"errorCode": @"errorCode",
|
||||
@"errorMessage": @"errorMessage",
|
||||
};
|
||||
}
|
||||
|
||||
+ (NSValueTransformer *)errorCodeJSONTransformer {
|
||||
return [MTLValueTransformer transformerUsingForwardBlock:^id(id value,BOOL *success, NSError *__autoreleasing *error) {
|
||||
|
||||
NSNumber *num = value;
|
||||
|
||||
NSString *tempStr = [NSString stringWithFormat:@"%@", num];
|
||||
|
||||
return tempStr;
|
||||
|
||||
} reverseBlock:^id(id value,BOOL *success, NSError *__autoreleasing *error) {
|
||||
|
||||
NSString *tempStr = value;
|
||||
|
||||
NSNumber *tempNum = @(tempStr.integerValue);
|
||||
|
||||
return tempNum;
|
||||
|
||||
}];
|
||||
}
|
||||
- (instancetype)initWithDictionary:(NSDictionary *)dictionaryValue error:(NSError **)error
|
||||
{
|
||||
self = [super initWithDictionary:dictionaryValue error:error];
|
||||
if (self != nil)
|
||||
{
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@end
|
||||
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// BaseWLService.h
|
||||
// WlianWorld
|
||||
//
|
||||
// Created by xmfish on 15/11/13.
|
||||
// Copyright © 2015年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <ReactiveCocoa/ReactiveCocoa.h>
|
||||
|
||||
@class BaseEntity;
|
||||
|
||||
@interface BaseWLService : NSObject
|
||||
|
||||
|
||||
+ (RACSignal *)requireWithProperty:(BaseEntity *)proper;
|
||||
@end
|
||||
@@ -0,0 +1,100 @@
|
||||
//
|
||||
// BaseWLService.m
|
||||
// WlianWorld
|
||||
//
|
||||
// Created by xmfish on 15/11/13.
|
||||
// Copyright © 2015年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#import "BaseWLService.h"
|
||||
|
||||
#import "BaseEntity.h"
|
||||
|
||||
#import "MTLJSONAdapter.h"
|
||||
#import "NSData+Godzippa.h"
|
||||
|
||||
#import "EGOCache.h"
|
||||
#import "BaseAPIClient.h"
|
||||
|
||||
@implementation BaseWLService
|
||||
|
||||
+ (void)saveCacheWithAPIKey:(NSString *)apiKey property:(BaseEntity *)proper data:(id)tweet{
|
||||
if (proper.isCache) {
|
||||
SEL selector = NSSelectorFromString(@"errCode");
|
||||
IMP imp = [tweet methodForSelector:selector];
|
||||
NSString* (*func)(id, SEL) = (void *)imp;
|
||||
NSString *tmpErrCode = func(tweet, selector);
|
||||
DLog(@"%@", tmpErrCode);
|
||||
|
||||
if (([tmpErrCode isKindOfClass:[NSString class]] && [tmpErrCode isEqualToString:@"0"] ) || ([tmpErrCode isKindOfClass:[NSNumber class]] && [tmpErrCode integerValue]==0)) {
|
||||
[[EGOCache globalCache] setObject:tweet forKey:apiKey];
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
+ (void)responseFromCacheWithAPIKey:(NSString *)apiKey property:(BaseEntity *)proper completionBlock:(id)subscriber{
|
||||
if (proper.isCache && [[EGOCache globalCache] hasCacheForKey:apiKey]) {
|
||||
[subscriber sendNext:[[EGOCache globalCache] objectForKey:apiKey]];
|
||||
[subscriber sendCompleted];
|
||||
}
|
||||
}
|
||||
|
||||
+(RACSignal*)requireWithProperty:(BaseEntity *)proper
|
||||
{
|
||||
|
||||
// if (proper.requireType == HTTPRequestTypeWithGET) {
|
||||
// return [self requireWithGetWithProperty:proper];
|
||||
// }
|
||||
// return nil;
|
||||
return [self requireWithGetWithProperty:proper];
|
||||
}
|
||||
+(RACSignal*)requireWithGetWithProperty:(BaseEntity*)proper
|
||||
{
|
||||
NSString *apiKey = proper.cacheKey;
|
||||
if (proper.pro && proper.pro[@"page"])
|
||||
{
|
||||
apiKey = [apiKey stringByAppendingFormat:@"%@",proper.pro[@"page"]];
|
||||
}
|
||||
|
||||
|
||||
|
||||
return [[RACSignal createSignal:^RACDisposable *(id<RACSubscriber> subscriber) {
|
||||
[[BaseAPIClient sharedClient] GET:[proper reqURL]
|
||||
parameters: [proper encodePro]
|
||||
success:^(AFHTTPRequestOperation * __unused task, id json) {
|
||||
DLog(@"%@", json);
|
||||
|
||||
if(json)
|
||||
{
|
||||
NSError *error = nil;
|
||||
id tweet = [MTLJSONAdapter modelOfClass:[proper.responesOBJ class] fromJSONDictionary:json error:&error];
|
||||
|
||||
|
||||
[subscriber sendNext:tweet];
|
||||
[subscriber sendCompleted];
|
||||
|
||||
[self saveCacheWithAPIKey:apiKey property:proper data:tweet];
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
[subscriber sendNext:nil];
|
||||
[subscriber sendCompleted];
|
||||
}
|
||||
}
|
||||
failure:^(AFHTTPRequestOperation *__unused task, NSError *error) {
|
||||
DLog(@"%@", error.description);
|
||||
|
||||
[subscriber sendError:error];
|
||||
|
||||
[self responseFromCacheWithAPIKey:apiKey property:proper completionBlock:subscriber];
|
||||
}];
|
||||
|
||||
return [RACDisposable disposableWithBlock:^{
|
||||
}];
|
||||
|
||||
}] replayLazily];
|
||||
|
||||
|
||||
}
|
||||
@end
|
||||
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// LoginModel.h
|
||||
// WlianWorld
|
||||
//
|
||||
// Created by xmfish on 15/11/16.
|
||||
// Copyright © 2015年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "BaseModel.h"
|
||||
@interface LoginModel : BaseModel
|
||||
|
||||
@property (nonatomic,readonly) NSNumber* status;
|
||||
@property (nonatomic, readonly) NSString *msg;
|
||||
@property (nonatomic,readonly) NSString* userid;
|
||||
@property (nonatomic, readonly) NSString *username;
|
||||
@property (nonatomic,readonly) NSString* shopid;
|
||||
@property (nonatomic, readonly) NSString *shopname;
|
||||
@property (nonatomic,readonly) NSString* token;
|
||||
- (RACSignal*)loginSignalWithAccount:(NSString*)account withPassword:(NSString*)password;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,61 @@
|
||||
//
|
||||
// LoginModel.m
|
||||
// WlianWorld
|
||||
//
|
||||
// Created by xmfish on 15/11/16.
|
||||
// Copyright © 2015年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#import "LoginModel.h"
|
||||
#import "LoginViewModel.h"
|
||||
@implementation LoginModel
|
||||
|
||||
|
||||
+ (NSDictionary *)JSONKeyPathsByPropertyKey {
|
||||
NSMutableDictionary* dic = [NSMutableDictionary dictionaryWithDictionary:[super JSONKeyPathsByPropertyKey]];
|
||||
[dic setObject:@"info.msg" forKey:@"msg"];
|
||||
[dic setObject:@"info.status" forKey:@"status"];
|
||||
[dic setObject:@"info.userinfo.userid" forKey:@"userid"];
|
||||
[dic setObject:@"info.userinfo.username" forKey:@"username"];
|
||||
[dic setObject:@"info.userinfo.shopid" forKey:@"shopid"];
|
||||
[dic setObject:@"info.userinfo.shopname" forKey:@"shopname"];
|
||||
[dic setObject:@"info.userinfo.token" forKey:@"token"];
|
||||
return dic;
|
||||
}
|
||||
- (instancetype)initWithDictionary:(NSDictionary *)dictionaryValue error:(NSError **)error
|
||||
{
|
||||
self = [super initWithDictionary:dictionaryValue error:error];
|
||||
if (self != nil)
|
||||
{
|
||||
}
|
||||
return self;
|
||||
}
|
||||
- (instancetype)init
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
if (self)
|
||||
{
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
-(RACSignal*)loginSignalWithAccount:(NSString *)account withPassword:(NSString *)password
|
||||
{
|
||||
RACSignal* singnal = [BaseWLService requireWithProperty:[self requireWithDic:[NSDictionary dictionaryWithObjectsAndKeys:account,@"username",password,@"password", nil] ]];
|
||||
|
||||
return singnal;
|
||||
}
|
||||
-(BaseEntity*)requireWithDic:(NSDictionary *)dic
|
||||
{
|
||||
BaseEntity *pro = [[BaseEntity alloc] init];
|
||||
pro.requireType = HTTPRequestTypeWithPOST;
|
||||
pro.responesOBJ = self.class;
|
||||
pro.reqURL = @"";
|
||||
pro.callback = @"user.login";
|
||||
pro.pro = dic;
|
||||
return pro;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// NSString+HXAddtions.h
|
||||
// HXWeb
|
||||
//
|
||||
// Created by hufeng on 12-2-13.
|
||||
// Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface NSString (HXAddtions)
|
||||
|
||||
+(NSString *) jsonStringWithDictionary:(NSDictionary *)dictionary;
|
||||
|
||||
+(NSString *) jsonStringWithArray:(NSArray *)array;
|
||||
|
||||
+(NSString *) jsonStringWithString:(NSString *) string;
|
||||
|
||||
+(NSString *) jsonStringWithObject:(id) object;
|
||||
|
||||
+(NSString *) jsonStringWithRTArray:(NSArray *)array;
|
||||
|
||||
- (NSString *)md5;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,125 @@
|
||||
//
|
||||
// NSString+HXAddtions.m
|
||||
// HXWeb
|
||||
//
|
||||
// Created by hufeng on 12-2-13.
|
||||
// Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import "NSString+HXAddtions.h"
|
||||
#import <CommonCrypto/CommonDigest.h>
|
||||
@implementation NSString (HXAddtions)
|
||||
|
||||
+(NSString *) jsonStringWithString:(NSString *) string
|
||||
{
|
||||
return [NSString stringWithFormat:@"\"%@\"",
|
||||
[[string stringByReplacingOccurrencesOfString:@"\n" withString:@"\\n"] stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""]
|
||||
];
|
||||
}
|
||||
|
||||
+(NSString *) jsonStringWithArray:(NSArray *)array
|
||||
{
|
||||
NSMutableString *reString = [NSMutableString string];
|
||||
[reString appendString:@"["];
|
||||
NSMutableArray *values = [NSMutableArray array];
|
||||
for (id valueObj in array) {
|
||||
NSString *value = [NSString jsonStringWithObject:valueObj];
|
||||
if (value) {
|
||||
[values addObject:[NSString stringWithFormat:@"%@",value]];
|
||||
}
|
||||
}
|
||||
[reString appendFormat:@"%@",[values componentsJoinedByString:@","]];
|
||||
[reString appendString:@"]"];
|
||||
return reString;
|
||||
}
|
||||
|
||||
+(NSString *) jsonStringWithDictionary:(NSDictionary *)dictionary
|
||||
{
|
||||
NSArray *keys = [dictionary allKeys];
|
||||
NSMutableString *reString = [NSMutableString string];
|
||||
[reString appendString:@"{"];
|
||||
NSMutableArray *keyValues = [NSMutableArray array];
|
||||
for (int i=0; i<[keys count]; i++) {
|
||||
NSString *name = [keys objectAtIndex:i];
|
||||
id valueObj = [dictionary objectForKey:name];
|
||||
NSString *value = [NSString jsonStringWithObject:valueObj];
|
||||
if (value)
|
||||
{
|
||||
[keyValues addObject:[NSString stringWithFormat:@"\"%@\":%@",name,value]];
|
||||
}
|
||||
}
|
||||
[reString appendFormat:@"%@",[keyValues componentsJoinedByString:@","]];
|
||||
[reString appendString:@"}"];
|
||||
return reString;
|
||||
}
|
||||
|
||||
+(NSString *) jsonStringWithObject:(id) object
|
||||
{
|
||||
NSString *value = nil;
|
||||
if (!object)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
if ([object isKindOfClass:[NSString class]])
|
||||
{
|
||||
value = [NSString jsonStringWithString:object];
|
||||
}
|
||||
else if([object isKindOfClass:[NSDictionary class]])
|
||||
{
|
||||
value = [NSString jsonStringWithDictionary:object];
|
||||
}
|
||||
else if([object isKindOfClass:[NSArray class]])
|
||||
{
|
||||
value = [NSString jsonStringWithArray:object];
|
||||
}
|
||||
else if([object isKindOfClass:[NSNumber class]])
|
||||
{
|
||||
value = [NSString jsonStringWithString:[object stringValue]];
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
+(NSString *) jsonStringWithRTArray:(NSArray *)array
|
||||
{
|
||||
NSMutableString *reString = [[NSMutableString alloc] init];
|
||||
[reString appendString:@"{"];
|
||||
NSMutableArray *values = [[NSMutableArray alloc] initWithArray:array];
|
||||
for (int i=0; i<[values count]; i++)
|
||||
{
|
||||
NSString *tempString = [values objectAtIndex:i];
|
||||
NSString *value = [NSString jsonStringWithString:tempString];
|
||||
if (i%2 == 0)
|
||||
{
|
||||
[reString appendFormat:@"%@:",value];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (i == [values count]-1)
|
||||
{
|
||||
[reString appendFormat:@"%@",value];
|
||||
}
|
||||
else
|
||||
{
|
||||
[reString appendFormat:@"%@,",value];
|
||||
}
|
||||
}
|
||||
}
|
||||
[reString appendFormat:@"}"];
|
||||
return reString;
|
||||
}
|
||||
|
||||
- (NSString *) md5
|
||||
{
|
||||
const char *cStr = [self UTF8String];
|
||||
unsigned char result[16];
|
||||
CC_MD5( cStr, strlen(cStr), result ); // This is the md5 call
|
||||
return [NSString stringWithFormat:
|
||||
@"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
|
||||
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]
|
||||
];
|
||||
}
|
||||
@end
|
||||
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// PrefixHeader.pch
|
||||
// WlianWorld
|
||||
//
|
||||
// Created by xmfish on 15/11/13.
|
||||
// Copyright © 2015年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef PrefixHeader_pch
|
||||
#define PrefixHeader_pch
|
||||
|
||||
// Include any system framework and library headers here that should be included in all compilation units.
|
||||
// You will also need to set the Prefix Header build setting of one or more of your targets to reference this file.
|
||||
#import <ReactiveCocoa/ReactiveCocoa.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <Mantle.h>
|
||||
#import "Common.h"
|
||||
#import "BaseEntity.h"
|
||||
#import "BaseWLService.h"
|
||||
#import <MBProgressHUD.h>
|
||||
#import "MBProgressHUD+Util.h"
|
||||
#endif /* PrefixHeader_pch */
|
||||
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 370 B |
|
After Width: | Height: | Size: 261 B |
|
After Width: | Height: | Size: 963 B |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 482 B |
|
After Width: | Height: | Size: 996 B |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 842 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 813 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 944 B |
|
After Width: | Height: | Size: 185 B |
@@ -0,0 +1,59 @@
|
||||
//
|
||||
// AWordDefault.h
|
||||
// Ash_AWord
|
||||
//
|
||||
// Created by xmfish on 15/4/1.
|
||||
// Copyright (c) 2015年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "LoginModel.h"
|
||||
|
||||
@interface AWordDefault : NSObject
|
||||
|
||||
|
||||
+(void)setShopId:(NSString *)isShopId;
|
||||
+(NSString*)getShopId;
|
||||
|
||||
+(void)setToken:(NSString *)isToken;
|
||||
+(NSString *)getToken;
|
||||
|
||||
+(void)setUserId:(NSString *)isUserId;
|
||||
+(NSString *)getUserId;
|
||||
|
||||
|
||||
//获取用户是否登录
|
||||
+(void)setIsLogin:(BOOL)isLogin;
|
||||
+(BOOL)getIsLogin;
|
||||
|
||||
//获取用户名
|
||||
+(void)setUserName:(NSString*)userName;
|
||||
+(NSString*)getUserName;
|
||||
|
||||
//获取uid
|
||||
+(void)setUid:(NSString*)uid;
|
||||
+(NSString*)getUid;
|
||||
|
||||
//获取用户头像
|
||||
+(void)setUserAvatar:(NSString*)userAvatar;
|
||||
+(NSString*)getUserAvatar;
|
||||
|
||||
//获取用户性别
|
||||
+(void)setUserGender:(NSString*)userGender;
|
||||
+(NSString*)getUserGender;
|
||||
|
||||
//获取最后更新时间
|
||||
+(void)setLastUpdateTime:(NSTimeInterval)date;
|
||||
+(NSTimeInterval)getLastUpdateTime;
|
||||
|
||||
//设置登录方式
|
||||
+(void)setLoginType:(NSInteger)loginType;
|
||||
+(NSInteger)getLoginType;
|
||||
|
||||
//设置个性签名
|
||||
+(void)setSignature:(NSString*)sinagure;
|
||||
+(NSString*)getSignature;
|
||||
//保存背景图片
|
||||
+(BOOL)setHeadBgImg:(UIImage *)headBgImg;
|
||||
+(UIImage*)getHeadBgImg;
|
||||
@end
|
||||
@@ -0,0 +1,138 @@
|
||||
//
|
||||
// AWordDefault.m
|
||||
// Ash_AWord
|
||||
//
|
||||
// Created by xmfish on 15/4/1.
|
||||
// Copyright (c) 2015年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#import "AWordDefault.h"
|
||||
|
||||
@implementation AWordDefault
|
||||
|
||||
|
||||
+(void)setShopId:(NSString *)isShopId
|
||||
{
|
||||
[[NSUserDefaults standardUserDefaults] setObject:isShopId forKey:@"shopid"];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
}
|
||||
+(NSString*)getShopId;
|
||||
{
|
||||
return [[NSUserDefaults standardUserDefaults] stringForKey:@"shopid"];
|
||||
}
|
||||
|
||||
+(void)setToken:(NSString *)isToken
|
||||
{
|
||||
[[NSUserDefaults standardUserDefaults] setObject:isToken forKey:@"isToken"];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
}
|
||||
+(NSString *)getToken
|
||||
{
|
||||
return [[NSUserDefaults standardUserDefaults] stringForKey:@"isToken"];
|
||||
}
|
||||
|
||||
+(void)setUserId:(NSString *)isUserId
|
||||
{
|
||||
[[NSUserDefaults standardUserDefaults] setObject:isUserId forKey:@"isUserId"];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
|
||||
}
|
||||
+(NSString *)getUserId
|
||||
{
|
||||
return [[NSUserDefaults standardUserDefaults] stringForKey:@"isUserId"];
|
||||
}
|
||||
|
||||
+(void)setIsLogin:(BOOL)isLogin
|
||||
{
|
||||
[[NSUserDefaults standardUserDefaults] setBool:isLogin forKey:@"islogin"];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
}
|
||||
+(BOOL)getIsLogin
|
||||
{
|
||||
return [[NSUserDefaults standardUserDefaults] boolForKey:@"islogin"];
|
||||
}
|
||||
|
||||
+(void)setUid:(NSString *)uid
|
||||
{
|
||||
[[NSUserDefaults standardUserDefaults] setObject:uid forKey:@"uid"];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
}
|
||||
+(NSString*)getUid
|
||||
{
|
||||
return [[NSUserDefaults standardUserDefaults] stringForKey:@"uid"];
|
||||
}
|
||||
|
||||
+(void)setUserName:(NSString *)userName
|
||||
{
|
||||
[[NSUserDefaults standardUserDefaults] setObject:userName forKey:@"username"];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
}
|
||||
+(NSString*)getUserName
|
||||
{
|
||||
return [[NSUserDefaults standardUserDefaults] stringForKey:@"username"];
|
||||
}
|
||||
|
||||
+(void)setUserAvatar:(NSString *)userAvatar
|
||||
{
|
||||
[[NSUserDefaults standardUserDefaults] setObject:userAvatar forKey:@"useravatar"];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
}
|
||||
+(NSString*)getUserAvatar
|
||||
{
|
||||
return [[NSUserDefaults standardUserDefaults] stringForKey:@"useravatar"];
|
||||
|
||||
}
|
||||
|
||||
+(void)setUserGender:(NSString *)userGender
|
||||
{
|
||||
[[NSUserDefaults standardUserDefaults] setObject:userGender forKey:@"usergender"];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
}
|
||||
+(NSString*)getUserGender
|
||||
{
|
||||
return [[NSUserDefaults standardUserDefaults] stringForKey:@"usergender"];
|
||||
|
||||
}
|
||||
+(void)setLastUpdateTime:(NSTimeInterval)date
|
||||
{
|
||||
[[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithDouble:date] forKey:@"updatetime"];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
}
|
||||
+(NSTimeInterval)getLastUpdateTime
|
||||
{
|
||||
return [[NSUserDefaults standardUserDefaults] doubleForKey:@"updatetime"];
|
||||
}
|
||||
+(void)setLoginType:(NSInteger)loginType
|
||||
{
|
||||
[[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithInteger:loginType] forKey:@"logintype"];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
}
|
||||
+(NSInteger)getLoginType
|
||||
{
|
||||
return [[NSUserDefaults standardUserDefaults] integerForKey:@"logintype"];
|
||||
}
|
||||
|
||||
+(void)setSignature:(NSString *)sinagure
|
||||
{
|
||||
[[NSUserDefaults standardUserDefaults] setObject:sinagure forKey:@"sinagure"];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
}
|
||||
+(NSString*)getSignature
|
||||
{
|
||||
return [[NSUserDefaults standardUserDefaults] stringForKey:@"sinagure"];
|
||||
|
||||
}
|
||||
+(BOOL)setHeadBgImg:(UIImage *)headBgImg
|
||||
{
|
||||
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES);
|
||||
NSString *filePath = [[paths objectAtIndex:0] stringByAppendingPathComponent:[NSString stringWithFormat:@"headbg.png"]]; // 保存文件的名称
|
||||
return [UIImagePNGRepresentation(headBgImg)writeToFile: filePath atomically:YES];
|
||||
}
|
||||
+(UIImage*)getHeadBgImg
|
||||
{
|
||||
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES);
|
||||
NSString *filePath = [[paths objectAtIndex:0] stringByAppendingPathComponent:[NSString stringWithFormat:@"headbg.png"]]; // 保存文件的名称
|
||||
UIImage *img = [UIImage imageWithContentsOfFile:filePath];
|
||||
return img;
|
||||
}
|
||||
@end
|
||||
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// MBProgressHUD+Util.h
|
||||
// ManagerDemo
|
||||
//
|
||||
// Created by xmfish on 14-8-12.
|
||||
// Copyright (c) 2014年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MBProgressHUD.h"
|
||||
|
||||
@interface MBProgressHUD (Util)
|
||||
/**
|
||||
* Finds all HUD subviews and returns them.
|
||||
*
|
||||
* @param view The view that is going to be searched.
|
||||
* @return All found HUD views (array of MBProgressHUD objects).
|
||||
*/
|
||||
|
||||
+ (void)hudWithView:(UIView *)view label:(NSString *)msg;
|
||||
|
||||
+ (void)errorHudWithView:(UIView *)view label:(NSString *)msg hidesAfter:(NSTimeInterval)delay;
|
||||
|
||||
+ (void)checkHudWithView:(UIView *)view label:(NSString *)msg hidesAfter:(NSTimeInterval)delay;
|
||||
@end
|
||||
@@ -0,0 +1,71 @@
|
||||
|
||||
#import "MBProgressHUD+Util.h"
|
||||
|
||||
static MBProgressHUD *activityHUD = nil;
|
||||
@implementation MBProgressHUD(Util)
|
||||
|
||||
|
||||
|
||||
|
||||
+ (void)hudWithView:(UIView *)view label:(NSString *)msg
|
||||
{
|
||||
if (view == nil)
|
||||
{
|
||||
view = [UIApplication sharedApplication].delegate.window;
|
||||
}
|
||||
|
||||
|
||||
MBProgressHUD *HUD = [[MBProgressHUD alloc] initWithView:view];
|
||||
|
||||
HUD.dimBackground = NO;
|
||||
HUD.animationType = MBProgressHUDAnimationFade;
|
||||
[view addSubview:HUD];
|
||||
HUD.mode = MBProgressHUDModeIndeterminate;
|
||||
HUD.labelText = msg;
|
||||
[HUD show:YES];
|
||||
activityHUD = HUD;
|
||||
}
|
||||
|
||||
+ (void)errorHudWithView:(UIView *)view label:(NSString *)msg hidesAfter:(NSTimeInterval)delay
|
||||
{
|
||||
if (view == nil)
|
||||
{
|
||||
view = [UIApplication sharedApplication].delegate.window;
|
||||
}
|
||||
[MBProgressHUD hideAllHUDsForView:view animated:YES];
|
||||
MBProgressHUD *HUD = [[MBProgressHUD alloc] initWithView:view];
|
||||
HUD.dimBackground = NO;
|
||||
HUD.animationType = MBProgressHUDAnimationFade;
|
||||
[view addSubview:HUD];
|
||||
HUD.customView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"errormark"]];
|
||||
HUD.mode = MBProgressHUDModeCustomView;
|
||||
HUD.labelText = msg;
|
||||
if (msg.length > 12) {
|
||||
// HUD.labelFont = [UIFont boldSystemFontOfSize:13];
|
||||
}
|
||||
|
||||
|
||||
[HUD show:YES];
|
||||
[HUD hide:YES afterDelay:delay];
|
||||
}
|
||||
|
||||
+ (void)checkHudWithView:(UIView *)view label:(NSString *)msg hidesAfter:(NSTimeInterval)delay
|
||||
{
|
||||
if (view == nil)
|
||||
{
|
||||
view = [UIApplication sharedApplication].delegate.window;
|
||||
}
|
||||
|
||||
[MBProgressHUD hideAllHUDsForView:view animated:YES];
|
||||
MBProgressHUD *HUD = [[MBProgressHUD alloc] initWithView:view];
|
||||
|
||||
HUD.dimBackground = NO;
|
||||
HUD.animationType = MBProgressHUDAnimationFade;
|
||||
[view addSubview:HUD];
|
||||
HUD.customView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"checkmark"]];
|
||||
HUD.mode = MBProgressHUDModeCustomView;
|
||||
HUD.labelText = msg;
|
||||
[HUD show:YES];
|
||||
[HUD hide:YES afterDelay:delay];
|
||||
}
|
||||
@end
|
||||
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// LoginViewController.h
|
||||
// WlianWorld
|
||||
//
|
||||
// Created by xmfish on 15/11/16.
|
||||
// Copyright © 2015年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@class LoginViewModel;
|
||||
@interface LoginViewController : UIViewController
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,106 @@
|
||||
//
|
||||
// LoginViewController.m
|
||||
// WlianWorld
|
||||
//
|
||||
// Created by xmfish on 15/11/16.
|
||||
// Copyright © 2015年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#import "LoginViewController.h"
|
||||
#import "LoginViewModel.h"
|
||||
#import "AWordDefault.h"
|
||||
@interface LoginViewController ()
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UIButton *sureBtn;
|
||||
@property (weak, nonatomic) IBOutlet UITextField *passwordTextField;
|
||||
@property (weak, nonatomic) IBOutlet UITextField *accountTextField;
|
||||
@property (nonatomic,strong)LoginViewModel* viewModel;
|
||||
@end
|
||||
|
||||
@implementation LoginViewController
|
||||
|
||||
-(id)init
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
if (self)
|
||||
{
|
||||
_viewModel = [[LoginViewModel alloc] init];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view from its nib.
|
||||
|
||||
[self bindViewModel];
|
||||
}
|
||||
|
||||
|
||||
-(void)bindViewModel
|
||||
{
|
||||
self.title = _viewModel.model.title;
|
||||
RAC(self.viewModel,account) = self.accountTextField.rac_textSignal;
|
||||
RAC(self.viewModel,password) = self.passwordTextField.rac_textSignal;
|
||||
self.sureBtn.rac_command = self.viewModel.executeLogin;
|
||||
|
||||
@weakify(self);
|
||||
RAC(self.sureBtn, backgroundColor) = [self.viewModel.validLoginSignal map:^id(NSNumber* value) {
|
||||
return[value boolValue] ? [UIColor redColor ]:[UIColor grayColor];
|
||||
}];
|
||||
|
||||
[self.viewModel.executeLogin.executionSignals subscribeNext:^(id result) {
|
||||
@strongify(self)
|
||||
[self.accountTextField resignFirstResponder];
|
||||
[self.passwordTextField resignFirstResponder];
|
||||
|
||||
}];
|
||||
[[self.sureBtn.rac_command executing] subscribeNext:^(NSNumber *executing) {
|
||||
@strongify(self)
|
||||
if([executing boolValue]){
|
||||
[MBProgressHUD showHUDAddedTo:self.view animated:YES].labelText = @"登陆中。。。";
|
||||
}
|
||||
}];
|
||||
[self.sureBtn.rac_command.executionSignals.flatten subscribeNext:^(id x) {
|
||||
@strongify(self)
|
||||
if (self.viewModel.model.status.intValue == 0) {
|
||||
[MBProgressHUD checkHudWithView:self.view label:self.viewModel.model.msg hidesAfter:1.0];
|
||||
//[nsde];
|
||||
}else
|
||||
{
|
||||
DLog(@"登陆成功,信息:%@",self.viewModel.model);
|
||||
|
||||
[AWordDefault setUid:self.viewModel.model.userid];
|
||||
[AWordDefault setToken:self.viewModel.model.token];
|
||||
[AWordDefault setShopId:self.viewModel.model.shopid];
|
||||
[MBProgressHUD hideHUDForView:self.view animated:YES];
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
|
||||
|
||||
}
|
||||
}];
|
||||
[self.sureBtn.rac_command.errors subscribeNext:^(id x) {
|
||||
@strongify(self)
|
||||
[MBProgressHUD errorHudWithView:self.view label:@"网络连接错误" hidesAfter:1.0];
|
||||
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
- (void)didReceiveMemoryWarning {
|
||||
[super didReceiveMemoryWarning];
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
/*
|
||||
#pragma mark - Navigation
|
||||
|
||||
// In a storyboard-based application, you will often want to do a little preparation before navigation
|
||||
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
|
||||
// Get the new view controller using [segue destinationViewController].
|
||||
// Pass the selected object to the new view controller.
|
||||
}
|
||||
*/
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,140 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9059" systemVersion="14F27" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9049"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="LoginViewController">
|
||||
<connections>
|
||||
<outlet property="accountTextField" destination="6iF-yp-Mfa" id="1O7-H6-jvB"/>
|
||||
<outlet property="passwordTextField" destination="nG7-dS-MjZ" id="AdY-qY-dG9"/>
|
||||
<outlet property="sureBtn" destination="GXL-sM-wuQ" id="tpp-XD-iCh"/>
|
||||
<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>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="SDS-tD-8Sg">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
||||
<subviews>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="brand.png" highlightedImage="brand.png" translatesAutoresizingMaskIntoConstraints="NO" id="Ppq-8c-LML">
|
||||
<rect key="frame" x="75" y="88" width="170" height="25"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="25" id="JRa-tQ-EC2"/>
|
||||
<constraint firstAttribute="width" constant="170" id="N0z-Ov-Guq"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="账号" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Yfd-u9-fXj">
|
||||
<rect key="frame" x="20" y="152" width="42" height="21"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="42" id="E2w-R3-AB9"/>
|
||||
<constraint firstAttribute="height" constant="21" id="m2q-tc-odA"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入门店账号" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="6iF-yp-Mfa">
|
||||
<rect key="frame" x="60" y="148" width="260" height="30"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="30" id="erd-Ht-BSu"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits"/>
|
||||
</textField>
|
||||
<view alpha="0.29999999999999999" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="7ya-P8-hbC">
|
||||
<rect key="frame" x="20" y="181" width="280" height="1"/>
|
||||
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="1" id="aG6-Yz-TTM"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="密码" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jkI-Tf-ReW">
|
||||
<rect key="frame" x="20" y="198" width="42" height="21"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="42" id="1rw-vw-QWN"/>
|
||||
<constraint firstAttribute="height" constant="21" id="cWC-lh-fZI"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入密码" textAlignment="natural" clearsOnBeginEditing="YES" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="nG7-dS-MjZ">
|
||||
<rect key="frame" x="60" y="194" width="260" height="30"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="30" id="Fx3-za-aPF"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits" secureTextEntry="YES"/>
|
||||
</textField>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="GXL-sM-wuQ">
|
||||
<rect key="frame" x="20" y="253" width="280" height="42"/>
|
||||
<color key="backgroundColor" red="0.98695849869999996" green="0.065447030540000006" blue="0.045327000780000001" alpha="0.59999999999999998" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="42" id="Qsu-lA-ppA"/>
|
||||
</constraints>
|
||||
<state key="normal" title="立即登陆">
|
||||
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<color key="titleShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
</button>
|
||||
<view alpha="0.30000001192092896" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4Ed-1z-Osj">
|
||||
<rect key="frame" x="20" y="227" width="280" height="1"/>
|
||||
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="1" id="ex2-ut-1Hs"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstItem="GXL-sM-wuQ" firstAttribute="leading" secondItem="SDS-tD-8Sg" secondAttribute="leading" constant="20" id="0eb-gh-ODZ"/>
|
||||
<constraint firstItem="6iF-yp-Mfa" firstAttribute="top" secondItem="Ppq-8c-LML" secondAttribute="bottom" constant="35" id="1mj-kx-c4J"/>
|
||||
<constraint firstItem="Ppq-8c-LML" firstAttribute="top" secondItem="SDS-tD-8Sg" secondAttribute="top" constant="88" id="5XA-u3-BH3"/>
|
||||
<constraint firstItem="6iF-yp-Mfa" firstAttribute="leading" secondItem="SDS-tD-8Sg" secondAttribute="leading" constant="60" id="Dkk-fs-DdV"/>
|
||||
<constraint firstItem="nG7-dS-MjZ" firstAttribute="trailing" secondItem="6iF-yp-Mfa" secondAttribute="trailing" id="EbT-V3-3zj"/>
|
||||
<constraint firstItem="nG7-dS-MjZ" firstAttribute="leading" secondItem="6iF-yp-Mfa" secondAttribute="leading" id="FZO-Te-BHs"/>
|
||||
<constraint firstItem="Yfd-u9-fXj" firstAttribute="top" secondItem="SDS-tD-8Sg" secondAttribute="top" constant="152" id="GrM-ey-qb9"/>
|
||||
<constraint firstItem="4Ed-1z-Osj" firstAttribute="leading" secondItem="SDS-tD-8Sg" secondAttribute="leading" constant="20" id="HlU-lY-AHE"/>
|
||||
<constraint firstAttribute="trailing" secondItem="6iF-yp-Mfa" secondAttribute="trailing" id="LaB-Hx-i27"/>
|
||||
<constraint firstItem="GXL-sM-wuQ" firstAttribute="top" secondItem="4Ed-1z-Osj" secondAttribute="bottom" constant="25" id="NZu-1W-E8S"/>
|
||||
<constraint firstItem="Ppq-8c-LML" firstAttribute="centerX" secondItem="SDS-tD-8Sg" secondAttribute="centerX" id="Raw-7h-ycR"/>
|
||||
<constraint firstAttribute="trailing" secondItem="7ya-P8-hbC" secondAttribute="trailing" constant="20" id="SlR-qy-muQ"/>
|
||||
<constraint firstItem="nG7-dS-MjZ" firstAttribute="top" secondItem="7ya-P8-hbC" secondAttribute="bottom" constant="12" id="YJY-cG-fRT"/>
|
||||
<constraint firstItem="4Ed-1z-Osj" firstAttribute="top" secondItem="nG7-dS-MjZ" secondAttribute="bottom" constant="3" id="aYW-f1-37M"/>
|
||||
<constraint firstItem="7ya-P8-hbC" firstAttribute="top" secondItem="6iF-yp-Mfa" secondAttribute="bottom" constant="3" id="d7V-n6-pib"/>
|
||||
<constraint firstAttribute="trailing" secondItem="GXL-sM-wuQ" secondAttribute="trailing" constant="20" id="fhi-jo-lnn"/>
|
||||
<constraint firstItem="Yfd-u9-fXj" firstAttribute="leading" secondItem="SDS-tD-8Sg" secondAttribute="leading" constant="20" id="gpx-rk-Ib5"/>
|
||||
<constraint firstAttribute="trailing" secondItem="4Ed-1z-Osj" secondAttribute="trailing" constant="20" id="mVU-Ni-MeS"/>
|
||||
<constraint firstItem="jkI-Tf-ReW" firstAttribute="top" secondItem="7ya-P8-hbC" secondAttribute="bottom" constant="16" id="onE-8A-KpC"/>
|
||||
<constraint firstItem="7ya-P8-hbC" firstAttribute="leading" secondItem="SDS-tD-8Sg" secondAttribute="leading" constant="20" id="qcU-hm-h93"/>
|
||||
<constraint firstItem="jkI-Tf-ReW" firstAttribute="leading" secondItem="Yfd-u9-fXj" secondAttribute="leading" id="ykr-n3-A3l"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="SDS-tD-8Sg" secondAttribute="bottom" id="Bjt-pE-Kek"/>
|
||||
<constraint firstAttribute="trailing" secondItem="SDS-tD-8Sg" secondAttribute="trailing" id="IdN-5U-DUJ"/>
|
||||
<constraint firstItem="SDS-tD-8Sg" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="OJt-td-x6b"/>
|
||||
<constraint firstAttribute="bottom" secondItem="SDS-tD-8Sg" secondAttribute="bottom" id="QdZ-tK-t8z"/>
|
||||
<constraint firstAttribute="trailing" secondItem="SDS-tD-8Sg" secondAttribute="trailing" id="awo-OA-viB"/>
|
||||
<constraint firstItem="SDS-tD-8Sg" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="eMp-kk-shN"/>
|
||||
<constraint firstItem="SDS-tD-8Sg" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="q2d-Ze-TpB"/>
|
||||
<constraint firstItem="SDS-tD-8Sg" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="vj2-dc-4PA"/>
|
||||
</constraints>
|
||||
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
|
||||
<nil key="simulatedBottomBarMetrics"/>
|
||||
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina4"/>
|
||||
<point key="canvasLocation" x="247" y="181"/>
|
||||
</view>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="brand.png" width="340" height="50"/>
|
||||
</resources>
|
||||
</document>
|
||||
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// BaseViewModel.h
|
||||
// WlianWorld
|
||||
//
|
||||
// Created by xmfish on 15/11/13.
|
||||
// Copyright © 2015年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class BaseModel;
|
||||
@interface BaseViewModel : NSObject
|
||||
|
||||
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// BaseViewModel.m
|
||||
// WlianWorld
|
||||
//
|
||||
// Created by xmfish on 15/11/13.
|
||||
// Copyright © 2015年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#import "BaseViewModel.h"
|
||||
#import "BaseModel.h"
|
||||
@implementation BaseViewModel
|
||||
|
||||
+(BaseEntity*)requireWithDic:(NSDictionary *)dic withModel:(BaseModel*)model
|
||||
{
|
||||
BaseEntity *pro = [[BaseEntity alloc] init];
|
||||
pro.requireType = HTTPRequestTypeWithGET;
|
||||
pro.responesOBJ = model.class;
|
||||
pro.reqURL = @"";
|
||||
pro.pro = dic;
|
||||
return pro;
|
||||
}
|
||||
@end
|
||||
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// LoginViewModel.h
|
||||
// WlianWorld
|
||||
//
|
||||
// Created by xmfish on 15/11/13.
|
||||
// Copyright © 2015年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#import "BaseViewModel.h"
|
||||
#import "LoginModel.h"
|
||||
@interface LoginViewModel : BaseViewModel
|
||||
|
||||
@property (nonatomic,strong) NSString* account;
|
||||
@property (nonatomic,strong) NSString* password;
|
||||
|
||||
@property (strong, nonatomic) RACCommand *executeLogin;
|
||||
@property (strong, nonatomic)RACSignal* validLoginSignal;
|
||||
|
||||
@property (nonatomic, strong)LoginModel* model;
|
||||
|
||||
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,55 @@
|
||||
//
|
||||
// LoginViewModel.m
|
||||
// WlianWorld
|
||||
//
|
||||
// Created by xmfish on 15/11/13.
|
||||
// Copyright © 2015年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#import "LoginViewModel.h"
|
||||
|
||||
@interface LoginViewModel()
|
||||
|
||||
@end
|
||||
|
||||
@implementation LoginViewModel
|
||||
|
||||
-(id)init
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
if (self)
|
||||
{
|
||||
self.model = [[LoginModel alloc] init];
|
||||
[self initialize];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
- (void)initialize
|
||||
{
|
||||
|
||||
self.model.title = @"登陆";
|
||||
|
||||
self.validLoginSignal = [[RACSignal combineLatest:@[RACObserve(self, account),RACObserve(self, password)] reduce:^id(NSString* account,NSString* password){
|
||||
return @( (account.length>1) && (password.length>1) );
|
||||
}] distinctUntilChanged];
|
||||
|
||||
|
||||
self.executeLogin = [[RACCommand alloc] initWithEnabled:self.validLoginSignal
|
||||
signalBlock:^RACSignal *(id input) {
|
||||
return [self executeSearchSignal];
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
- (RACSignal *)executeSearchSignal {
|
||||
|
||||
return [[self.model loginSignalWithAccount:self.account withPassword:self.password] doNext:^(id result) {
|
||||
self.model = result;
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||