2019独角兽公司重招Python工程师标准>>> #import 用途: 方法名和 mobileObj 必须和 js 里面的一样 附上js部分代码 #import "ServerJS.h"@implementation ServerJS- (void)wxLogin
{}
- (无效)忘记
{}
- (无效)toReg
{}- (BOOL)userLogin:(BOOL)nc_vok :(NSString *)csessionid :(NSString *)sig :(NSString *)token :(NSString *)场景 :(NSString *)tx_Usermobilenum :(NSString *)tx_UserPassword
{返回是;
}@结尾
- (void)webViewDidFinishLoad:(UIWebView *)webView{JSContext *context = [webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];ServerJS *js = [[ServerJS alloc] init];context[@"mobileObj"] = js;
}
document.getElementById("bt_login").onclick = function(){if (!mobileObj.userLogin(nc_vok,document.getElementById('csessionid').value,document.getElementById('sig').value ,document.getElementById('token').value,document.getElementById('scene').value,document.getElementById('tx_Usermobilenum').value,document.getElementById('tx_UserPassword').value)) {resetAliyunAfs() ;}
};document.getElementById("wxlogin").onclick = function(){mobileObj.wxLogin();
};document.getElementById("bt_forget").onclick = function(){mobileObj.toForget();
};document.getElementById("bt_reg").onclick = function(){mobileObj.toReg();
};
转载于:https://www.sychzs.cn/gwlCode/blog/1580860