Foxtable(狐表)用户栏目专家坐堂 → weui中的按钮固定


  共有1538人关注过本帖树形打印复制链接

主题:weui中的按钮固定

帅哥哟,离线,有人找我吗?
ycs5801
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:五尾狐 帖子:1065 积分:7598 威望:0 精华:0 注册:2009/6/24 9:44:00
weui中的按钮固定  发帖心情 Post By:2024/7/15 19:43:00 [只看该作者]


图片点击可在新窗口打开查看此主题相关图片如下: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

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110544 积分:562604 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2024/7/15 20:11:00 [只看该作者]

整个页面完整代码发上来

 回到顶部
帅哥哟,离线,有人找我吗?
ycs5801
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:五尾狐 帖子:1065 积分:7598 威望:0 精华:0 注册:2009/6/24 9:44:00
  发帖心情 Post By: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)

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110544 积分:562604 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By: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
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:五尾狐 帖子:1065 积分:7598 威望:0 精华:0 注册:2009/6/24 9:44:00
  发帖心情 Post By:2024/7/16 10:13:00 [只看该作者]

老师,我的意思是不想让这3个按钮随滚动条上下滚动,您给的代码是这个意思吗?

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110544 积分:562604 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2024/7/16 10:32:00 [只看该作者]

不是。这种就很麻烦了,请上传实例测试

 回到顶部