本帖最后由 tree_fly 于 2019-2-16 11:36 编辑
前段时间看了市面上微信免验证登录,之后也试着写了一个,这是第一步
[Objective-C] 纯文本查看 复制代码 CHMethod0(void, WCAccountMainLoginViewController, onNext)
{
// CHSuper0(WCAccountMainLoginViewController, onNext);
unsigned long long LoginType = CHIvar(self, _enLoginType, unsigned long long);
if(LoginType == 2)
{
WCAccountTextFieldItem * UserNameItem = CHIvar(self,_textFieldUserNameItem,__strong WCAccountTextFieldItem *);
WCUITextField * UserNameField = [UserNameItem getTextField];
NSString* UserName = [UserNameField text];
WCAccountTextFieldItem * textFieldUserPwdItem = CHIvar(self,_textFieldUserPwdItem,__strong WCAccountTextFieldItem *);
WCUITextField * UserPwdField = [textFieldUserPwdItem getTextField];
NSString* UserPwd = [UserPwdField text];
[self vcResignFirstResponder];
id mydelegate = CHIvar(self,_delegate,__strong id);
[mydelegate onMainLoginUserName:UserName Pwd:UserPwd];
}else if(LoginType == 1) {
WCAccountTextFieldItem* CountryCodeItem = CHIvar(self,_textFieldCountryCodeItem,__strong WCAccountTextFieldItem*);
WCUITextField *CodeItemField = [CountryCodeItem getTextField];
NSString* CodeItem = [CodeItemField text];
// +86区号
WCAccountTextFieldItem* PhoneNumberItem = CHIvar(self,_textFieldPhoneNumberItem,__strong WCAccountTextFieldItem*);
WCUITextField *PhoneNumberField = [PhoneNumberItem getTextField];
NSString* PhoneNumber = [PhoneNumberField text];
id mydelegate = CHIvar(self,_delegate,__strong id);
[self vcResignFirstResponder];
[mydelegate onMainLoginNext:CodeItem phoneNumber:PhoneNumber];
}else{
return;
}
}
|