麻烦老师帮忙看看TabBar:
1、怎么实现tabbar跟随任何页面都显示在底部
2、怎么实现页面打开后,指定的tabbar对应的卡片栏被选择 比如page3_btn默认被点击 (下述代码并没有实现默认点击page3_btn)
当前代码app页面如下:
Dim e As RequestEventArgs = args(0)
Dim wb As New weui
wb.AddForm("","form1","app.htm")
With wb.AddTabBar("", "tb1", 0)
.AddPage("page1","线索举报","./images/h11.ico").Attribute = "style='height: 100%;'"
.AddPage("page2","线索征集","./images/f5.ico").Attribute = "style='height: 100%;'"
.AddPage("page3","法制宣传","./images/f2.ico").Attribute = "style='height: 100%;'"
.AddPage("page4","个人中心","/images/f8.ico").Attribute = "style='height: 100%;'"
End With
wb.InsertHTML("page1","<div id='divpage1'></div>")
wb.InsertHTML("<script>document.getElementById('page1_btn').click();</script>")
wb.AppendHTML("<script>document.getElementById('page1_btn').addEventListener('click',function(){document.getElementById('divpage1').innerHTML=sendAjaxText('ceshi','ceshi.htm','',false);},false);</script>")
wb.InsertHTML("page2","<div id='divpage2'></div>")
wb.InsertHTML("<script>document.getElementById('page2_btn').click();</script>")
wb.AppendHTML("<script>document.getElementById('page2_btn').addEventListener('click',function(){document.getElementById('divpage2').innerHTML=sendAjaxText('zhengji','zhengji.htm','',false);},false);</script>")
wb.InsertHTML("page3","<div id='divpage3'></div>")
wb.InsertHTML("<script>document.getElementById('page3_btn').click();</script>")
wb.AppendHTML("<script>document.getElementById('page3_btn').addEventListener('click',function(){document.getElementById('divpage3').innerHTML=sendAjaxText('fzyemian','fzyemian.htm','',false);},false);document.getElementById('page3_btn').click();</script>")
wb.InsertHTML("page4","<div id='divpage4'></div>")
wb.InsertHTML("<script>document.getElementById('page4_btn').click();</script>")
wb.AppendHTML("<script>document.getElementById('page4_btn').addEventListener('click',function(){document.getElementById('divpage4').innerHTML=sendAjaxText('login','login.htm','',false);},false);</script>")
e.WriteString(wb.Build)
[此贴子已经被作者于2021/9/1 17:16:18编辑过]