|
按照仿咸鱼弄了弄登录页面代码如下:
- define(function(require) {
- var $ = require("jquery");
- var justep = require("$UI/system/lib/justep");
- var Model = function() {
- this.callParent();
- };
- // 点击注册
- Model.prototype.regBtnClick = function(event) {
- var khdata2 = this.comp("baasData1");
- // var row = khdata2.getCurrentRow();
- var khid2 = this.comp("r_stuid").val();
- var khname2 = this.comp("r_name").val();
- var khpass2 = this.comp("r_pwd").val();
- var kha_pass2 = this.comp("r_a_pwd").val();
- var khemail2 = this.comp("r_email").val();
- var khtel2 = this.comp("r_tel").val();
- var khprovince2 = this.comp("r_province").val();
- var khuniversity2 = this.comp("r_university").val();
- var khcollege2 = this.comp("r_college").val();
-
- if(khid2 == "" || khpass2 == "" || kha_pass2 == ""){
- justep.Util.hint("用户名密码不能为空!");
- return;
- }
- if(khpass2 != kha_pass2){
- justep.Util.hint("密码不一致!");
- return;
- }
- var status = true;
- userData.each(function(param){
- if(khid2 == param.row.val('stuid')){
- justep.Util.hint("用户名已被占用!");
- status = false;
- return;
- }
-
- })if(status == true){
- baasData1.newData({
- defaultValues:[{
- stuid:khid2,
- name:khname2,
- pwd:khpass2,
- email:khemail2,
- tel:khtel2,
- province:khprovince2,
- university:khuniversity2,
- college:khcollege2,
- jurisdiction:1,
- }]
- });
- userData.saveData();
- justep.Shell.jurisdiction.set("1");
-
- /*
- var user = {};
- localStorage.setItem("userUUID", JSON.stringify(user));
- justep.Shell.showPage("main");*/
-
- /*
- khdata2.addValue("stuid", khid2);
- khdata2.addValue("name", khname2);
- khdata2.addValue("pwd", khpass2);
- khdata2.addValue("email", khemail2);
- khdata2.addValue("tel", khtel2);
- khdata2.addValue("province", khprovince2);
- khdata2.addValue("university", khuniversity2);
- khdata2.addValue("college", khcollege2);
- khdata2.addValue("jurisdiction", 1);
- if (!row) {
- var data = khdata2.newData();
- }*/
- justep.Util.hint("注册成功,正在跳转");
- //localStorage.setItem("r_id", khid2);
- //khdata2.saveData();
- justep.Shell.showPage({
- url : require.toUrl("./loginActivity.w")
- });
- }
- justep.Util.hint("注册失败");
- justep.Shell.showPage({
- url : require.toUrl("./st_registerActivity.w")
- });
-
- }
- return Model;
- });
复制代码
出现这个异常
JUSTEP230103 |
|