以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]tabbar内的页面如何控制返回的页面  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=103181)

--  作者:fslfyc
--  发布时间:2017/7/2 10:01:00
--  [求助]tabbar内的页面如何控制返回的页面

tabbar内的页面如何指定返回到的页面?

图片点击可在新窗口打开查看

如上图,tabbar有两个页面【未收料】和 【已收料】;
          【已收料】内有子页面【已收料单明细】;
          【已收料单明细】页面内有按钮<返回>;

           希望点击按钮返回到【已收料】页,而不是返回到【未收料】页。


图片点击可在新窗口打开查看


图片点击可在新窗口打开查看
[此贴子已经被作者于2017/7/2 10:16:46编辑过]

--  作者:有点甜
--  发布时间:2017/7/2 14:37:00
--  

加上下面的代码

 

wb.InsertHTML("<script>alert(3);document.getElementById(\'page1\').style.display=\'none\';document.getElementById(\'page2\').style.display=\'block\';document.getElementById(\'page1_btn name=\').setAttribute(\'class\',\'weui_tabbar_item\');document.getElementById(\'page2_btn name=\').setAttribute(\'class\',\'weui_tabbar_item weui_bar_item_on\');alert(4);</script>")


--  作者:fslfyc
--  发布时间:2017/7/2 15:57:00
--  
是不是加在子页面,要如何引用?
[此贴子已经被作者于2017/7/2 16:03:54编辑过]

--  作者:有点甜
--  发布时间:2017/7/2 16:54:00
--  

加在主页面。

 

点击切换到子页面之前,要用cookie记录好页面值,1、2、或3

 

返回的时候之后,会触发主页面生成代码,根据cookie的值,控制隐藏、显示哪个页面。


--  作者:fslfyc
--  发布时间:2017/7/3 8:45:00
--  
非常感谢,我试试看。
--  作者:xuezxz
--  发布时间:2017/7/19 21:39:00
--  
document.getElementById(\'page1_btn name=\').setAttribute(\'class\',\'weui_tabbar_item\');document.getElementById(\'page2_btn name=\').setAttribute(\'class\',\'weui_tabbar_item weui_bar_item_on\')
这一段是什么意思?能不能解释一下

--  作者:有点甜
--  发布时间:2017/7/19 21:53:00
--  
以下是引用xuezxz在2017/7/19 21:39:00的发言:
document.getElementById(\'page1_btn name=\').setAttribute(\'class\',\'weui_tabbar_item\');document.getElementById(\'page2_btn name=\').setAttribute(\'class\',\'weui_tabbar_item weui_bar_item_on\')
这一段是什么意思?能不能解释一下

 

为了找到id为红色字符的元素,然后设置其样式、属性等等操作。


--  作者:xuezxz
--  发布时间:2017/7/20 16:21:00
--  
设置其样式、属性等等操作  
这些资料是在什么地方可以找到?

--  作者:有点甜
--  发布时间:2017/7/20 16:24:00
--  
以下是引用xuezxz在2017/7/20 16:21:00的发言:
设置其样式、属性等等操作  
这些资料是在什么地方可以找到?

 

1、你首先要有html/css的基础

 

http://www.w3school.com.cn/

 

2、你要用浏览器的功能【查看元素】,分析网页的源码,才能修改


--  作者:xuezxz
--  发布时间:2017/7/20 17:26:00
--  
<div id=\'page1_btn name=\'page1_btn\' class=\'weui_navbar_item weui_bar_item_on\' data-tab-page=\'page1\' data-tab=\'tb1\'><p class=\'weui_tabbar_label\'>客户档案</p></div>
<div id=\'page2_btn name=\'page2_btn\' class=\'weui_navbar_item\' data-tab-page=\'page2\' data-tab=\'tb1\'><p class=\'weui_tabbar_label\'>回访日志</p></div>

甜版,红色字体是不是就是用于控制tabbar显示页面,是不是读cookie,判断是哪个页面就把这段红色字体加上去