|
楼主 |
发表于 2016-8-27 10:52:02
|
显示全部楼层
本帖最后由 墨格 于 2016-8-27 10:53 编辑
- <P> define(function(require){
- var $ = require("jquery");
- var justep = require("$UI/system/lib/justep");
- require("cordova!org.apache.cordova.device");
- var Model = function(){
- this.callParent();
- };
-
- Model.prototype.openPage = function(event){
- var url = event.source.$domNode.attr('url');
- if(url.substr(0,1) == "/")
- url = '$UI' + url;
- justep.Shell.showPage(require.toUrl(url));
- };</P>
- <P> Model.prototype.regAction = function(event){
- var user = this.comp("userData");
- var sname = this.comp("sname").val();
- var password = this.comp("password").val();
- user.clear();
- user.setFilter("fileter1", "sname = '" + sname + "'");
- user.refreshData();
- alert(user.getCount());
- if (user.Count() === 0) {
- this.comp("userData").newData({
- defaultValues : [ {
- "sname" : sname,
- "password" : password
- } ]
- });</P>
- <P> alert(sname);
- this.comp("userData").saveData();
- justep.Util.hint("用户注册成功");
- //justep.Shell.showPage("login.w");</P>
- <P> } else {
- justep.Util.hint("用户名已存在请重新输入");
- this.comp("sname").val("");
- this.comp("password").val("");
- }
- };
- return Model;
- });</P>
复制代码
|
|