register.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. (function () {
  2. var page = {
  3. isScroll: true,
  4. init: function ($page) {
  5. $page.find('#saveuserinfo').on('tap', function () {
  6. if (!$('#registerform').lrformValid()) {
  7. return false;
  8. }
  9. var formdata = $('#registerform').lrformGet();
  10. if (formdata.password2 === formdata.password1) {
  11. var req = {
  12. FullName: formdata.username,
  13. Password: $.md5(formdata.password1),
  14. LicensePlate: formdata.licenseplate,
  15. IdCard: formdata.idcard,
  16. };
  17. renlian.layer.loading(true);
  18. // 访问后台修改密码
  19. //renlian.httppost(config.webapi + "renlian/adms/user/modifypw", req, function(data,info){
  20. renlian.http.post(config.webapi + '/?s=api/register', req, function(data,info){
  21. renlian.layer.loading(false);
  22. if (data.success === true) {// 表单数据保存成功,发起流程
  23. //renlian.layer.toast(info);
  24. //renlian.storage.set('logininfo', null);
  25. renlian.nav.go({ path: 'login', isBack: false, isHead: false });
  26. }else{
  27. renlian.layer.warning(data.message, function () { }, '提示', '关闭');
  28. }
  29. });
  30. }
  31. else {
  32. renlian.layer.toast('二次输入密码不同');
  33. }
  34. });
  35. }
  36. };
  37. return page;
  38. })();