以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  weui中的按钮固定  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=192713)

--  作者:ycs5801
--  发布时间:2024/7/15 19:43:00
--  weui中的按钮固定

图片点击可在新窗口打开查看此主题相关图片如下:img_0529(20240714-214200).png
图片点击可在新窗口打开查看

图片点击可在新窗口打开查看此主题相关图片如下:222.png
图片点击可在新窗口打开查看

想把这三个按钮固定不动。
wb.InsertHTML("<style>form1{position: fixed;}</style>")

wb.AddForm("page1", "form1", "select.htm")

With wb.AddButtonGroup("form1", "btn", False)
    With .Add("btn1", "团课", "button") \'自定义按钮
        .Attribute = """
    End With 
    With .Add("btn2", "精品课", "button")
        .FormAction = ""
        .Attribute = """
    End With
    With .Add("btn3", "私教课", "button")
        .FormAction = ""
        .Attribute = """
    End With 
End With

--  作者:有点蓝
--  发布时间:2024/7/15 20:11:00
--  
整个页面完整代码发上来
--  作者:ycs5801
--  发布时间:2024/7/15 20:43:00
--  
Dim e As RequestEventArgs = args(0)
Dim wb As New weui


Dim openid As String = "oZASJ6FcC0KCnfJ-U9tZT8RU9iqs"

wb.AppendHTML("<link rel=\'stylesheet\' href=\'./weui/exweui.css\'/>", True) 
wb.AppendHTML("<script src=\'./weui/exweui.js\' ></script>", True)
wb.InsertHTML("<style>.weui_tabbar_item{background-color: #e5f2ff;}</style>") \'设置页面顶部颜色
\'wb.InsertHTML("<style>.weui_navbar{background-color:blue;}</style>") \'设置导航栏背景色
wb.InsertHTML("<style>.exui-scrolltab-item{background-color:#e5eeff;}</style>") \'设置侧边栏颜色
With wb.AddTabBar("", "tb1", 1) 
    .AddPage("page1", "欢迎选课").Attribute = "style=\'height:100%\'" \'这个style必须设置,不然无法返回页面
    .AddPage("page9", "历史信息")
    \'    .AddButton("bt1", "个人信息", "./images/user.png", "default.htm")  
End With

\'Functions.Execute("default", wb, e) \'执行主页面函数
wb.InsertHTML("<style>.weui_tabbar_label{font-size: 18px;color:green;}</style>") \'主标题字体大小
\'wb.InsertHTML("<style>form1{position: fixed;}</style>")

wb.AddForm("page1", "form1", "select.htm")

With wb.AddButtonGroup("form1", "btn", False)
    With .Add("btn1", "团课", "button") \'自定义按钮
        .Attribute = """
    End With 
    With .Add("btn2", "精品课", "button")
        .FormAction = ""
        .Attribute = """
    End With
    With .Add("btn3", "私教课", "button")
        .FormAction = ""
        .Attribute = """
    End With 
End With
 
Dim riqi(7) As Date
Dim st(7) As String
Dim xingqi(7) As String
For i As Integer = 1 To 7
    riqi(i) = Date.today.AddDays(i - 1)
    st(i) = format(riqi(i), "M.dd")
    xingqi(i) = riqi(i).DayOfWeek
  
Next 



Dim tab As ExWeUI.ExSideTab = ExWeUI.WebUI.AddSideTab("", "stab1", 1) 
tab.AddPage("st1", "今日", "renamecxtq.htm?type=tuanke&riqi=" & riqi(1), "./images/fish-and-chips.png", True)
tab.AddPage("st2", "明日", "renamecxtq.htm?type=tuanke&riqi=" & riqi(2), "./images/fish.png")
tab.AddPage("st3", st(3), "renamecxtq.htm?type=tuanke&riqi=" & riqi(3), "./images/vegetables.png")
tab.AddPage("st4", st(4), "renamecxtq.htm?type=tuanke&riqi=" & riqi(4), "./images/rice.png")
tab.AddPage("st5", st(5), "renamecxtq.htm?type=tuanke&riqi=" & riqi(5), "./images/alcoholic-drink.png")
tab.AddPage("st6", st(6), "renamecxtq.htm?type=tuanke&riqi=" & riqi(6), "./images/seafood.png")

tab.AddPage("st7", st(7), "renamecxtq.htm?type=tuanke&riqi=" & riqi(7), "./images/gift.png")

tab.AddPage("st8", "外卖", "renamecxtq.htm?type=tuanke&riqi=" & riqi(7), "./images/take-away.png")

\'tab.AddPage("st7", "返回首页", "default.htm", "./images/07.png") 
wb.InsertHTML("page1", tab.BuildHtml)
wb.AddPage("", "page3").Attribute = "style=\'position: fixed;bottom: 0;left: 0;right:0;z-index:9999;\'" \'增加两个page



 wb.InsertHTML("<style>.exui-list-mes{background-color: SteelBlue;}</style>") 
wb.AddToast("", "tst1", "正在发送", 1)
wb.AddToast("", "tst2", "发送成功", 0)
wb.AddToast("", "tst3", "发送失败", 0).Icon = "warn"

With ExWeUI.WebUI.AddPopup("pop01", "preview.htm", 3)
    .Height = "70%"
    wb.InsertHTML("", .BuildHtml) 
End With 

wb.AppendHTML("<script src=\'./lib/ajaxform.js\'></script>") \'引入脚本文件
\' wb.AppendHTML("<script >list3auto(\'" & id & "\')</script>")  带变量示例
\'wb.AppendHTML("<script >sendJsonObject(\'" & openid & "\',\'chushi\')</script>") \'进入界面后提取下端
wb.InsertHTML("<div id=\'p1\' style=\'margin:0.5em;z-index:9999;overflow:scroll;\'></div>") \'插入预览页面
wb.AppendHTML("<script>initExWeUI();</script>")

e.WriteString(wb.Build)

--  作者:有点蓝
--  发布时间:2024/7/15 21:21:00
--  
page嵌套page。把其它页面放到page1里面,类似

Select Case e.Path
    Case "test.htm"
        Dim wb As New WeUI
        Dim txt As String = "由各种物质组成的巨型球状天体,叫做星球.星球有一定的形状,有自己的运行轨道."
        \'增加三个页面,一个按钮
        With wb.AddTabBar("", "tb1", 1)
            .AddPage("page1", "微信", "./images/button.png")
            .AddPage("page2", "通讯录", "./images/msg.png")
            .AddPage("page3", "发现", "./images/article.png")
            .AddButton("bt1", "我", "./images/cell.png", "http://www.foxtable.com")
        End With
        \'为第一个页面增加内容
        With wb.AddButtonGroup("page1", "btg1")
            .Add("btn1", "按钮1", "button").Attribute = "onclick=""hide(\'page12\');hide(\'page13\');show(\'page11\')"""
            .Add("btn2", "按钮2", "button").Attribute = "onclick=""hide(\'page11\');hide(\'page13\');show(\'page12\')"""
            .Add("btn3", "按钮3", "button").Attribute = "onclick=""hide(\'page11\');hide(\'page12\');show(\'page13\')"""
        End With
        wb.AddPage("page1", "page11") 
        wb.AddPage("page1", "page12", False) 
        wb.AddPage("page1", "page13", False)

        
        With wb.AddButtonGroup("page11", "btg2")
            .Add("btn22", "这是第一页,点击显示第二页", "button").Attribute = "onclick=""hide(\'page11\');hide(\'page13\');show(\'page12\')"""
        End With

        
        With wb.AddButtonGroup("page12", "btg3")
            .Add("btn32", "这是第二页,点击显示第三页", "button").Attribute = "onclick=""hide(\'page11\');hide(\'page12\');show(\'page13\')"""
        End With

        
        With wb.AddButtonGroup("page13", "btg4")
            .Add("btn42", "这是第三页,点击显示第一页", "button").Attribute = "onclick=""hide(\'page12\');hide(\'page13\');show(\'page11\')"""
        End With
        e.WriteString(wb.Build)
End Select

--  作者:ycs5801
--  发布时间:2024/7/16 10:13:00
--  
老师,我的意思是不想让这3个按钮随滚动条上下滚动,您给的代码是这个意思吗?
--  作者:有点蓝
--  发布时间:2024/7/16 10:32:00
--  
不是。这种就很麻烦了,请上传实例测试