起步软件技术论坛
搜索
 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1654|回复: 2

[结贴] 页面跳转问题求解答

[复制链接]

30

主题

145

帖子

248

积分

中级会员

Rank: 3Rank: 3

积分
248
QQ
发表于 2016-9-23 14:02:02 | 显示全部楼层 |阅读模式
QQ截图20160923135905.png
点击登陆后,提示登录成功但是没有跳转,附上JS代码:
  1.         Model.prototype.loginIsmBtn = function(event) {
  2.                 var nameInput = this.comp("nameInput").val();
  3.                 localStorage.name = nameInput;
  4.                 var passwordInput = this.comp("passwordInput").val();

  5.                 var userData = this.comp("userData");
  6.                 userData.clear();
  7.             userData.setFilter("f1", "tsjb_user.fname = '"+nameInput+"'");
  8.         userData.setFilter("f2", "tsjb_user.fpassword = '" + passwordInput+"'");
  9.         userData.refreshData();
  10.                 if (userData.count()> 0) {
  11.                         justep.Shell.userName.set(nameInput);
  12.                         localStorage.removeItem("userUUID");

  13.                         var user = {};
  14.                         user.userid = nameInput;
  15.                         //user.accountType = "ISM";
  16.                         user.name = nameInput || "NONAME";
  17.                         //把json对象转化成字符串
  18.                         localStorage.setItem("userUUID", JSON.stringify(user));
  19.             justep.Util.hint("登录成功!");
  20.                         justep.Shell.showPage(require.toUrl("./index_main.w"));
  21.                 } else {
  22.                         justep.Util.hint("用户名或密码有误!", {
  23.                                 "type" : "danger"
  24.                         });
  25.                 }

  26.         };
复制代码
这是我在index.w页面写的页面对应的代码:
  1.         var Model = function() {
  2.                 this.callParent();
  3.                 var shellImpl = new ShellImpl(this, {
  4.                         "contentsXid" : "pages",
  5.                         "wingXid" : "wing",
  6.                         "pageMappings" : {
  7.                                 "login" : {
  8.                                         url : require.toUrl('./login.w')
  9.                                 },
  10.                                 "index_main" : {
  11.                                         url : require.toUrl('./index_main.w')
  12.                                 },
  13.                                 "registerMobile" : {
  14.                                         url : require.toUrl('./registerMobile.w')
  15.                                 },
  16.                                 "registerEmail" : {
  17.                                         url : require.toUrl('./registerEmail.w')
  18.                                 },
  19.                         }
  20.                 });
  21.         };
复制代码




1

主题

3232

帖子

1174

积分

金牌会员

Rank: 6Rank: 6

积分
1174
QQ
发表于 2016-9-23 15:58:07 | 显示全部楼层
没有调转?看代码,应该是可以执行到你那句调转页面的代码的,具体为什么没有调转 你在 justep.Shell.showPage(require.toUrl("./index_main.w")); 这句代码之前 打一个debugger,看一下,走不走这句话
在问题解决后,希望大家可以吧解决方法也分享一下,这样可以让更多的X5开发者共同进步,谢谢大家的知识共享
回复 支持 反对

使用道具 举报

30

主题

145

帖子

248

积分

中级会员

Rank: 3Rank: 3

积分
248
QQ
 楼主| 发表于 2016-9-23 16:00:54 | 显示全部楼层
闰土 发表于 2016-9-23 15:58
没有调转?看代码,应该是可以执行到你那句调转页面的代码的,具体为什么没有调转 你在 justep.Shell.showP ...

走的,我打开登录的页面用了dialog,然后登录成功的页面跳转我用了showpage,才出错的。我把打开登录的方法改成showpage就好使了,可以结贴了
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|X3技术论坛|Justep Inc.    

GMT+8, 2025-6-17 16:52 , Processed in 0.061975 second(s), 27 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表