以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  AddGriD链接跳转,求助  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=174968)

--  作者:yifan3429
--  发布时间:2022/2/13 23:00:00
--  AddGriD链接跳转,求助
If DataTables.Contains("网页_导航") = False Then \'如果表C没有加载
    DataTables.Load("网页_导航") \'加载表C
End If
Dim b1 As String
wb.AddPageTitle("","pageheader","湖南城市之窗","全案产品选型库")
\'For Each s As String In DataTables("网页_导航").getvalues("分类","[分类] = \'按品牌查看\'", "排序")
    For Each s As String In DataTables("网页_导航").SQLgetvalues("分类","", "排序")
    wb.InsertHTML("<h3 align=\'center\'  style=\'margin-top:10px\'>" & s & "</h3>")
    With wb.AddGrid("","g" & s)
        For Each r As DataRow In DataTables("网页_导航").sqlSelect("分类=\'" & s & "\'","", "产品数量 Desc")
            With ExWeUI.WebUI.AddBadge("",r("产品数量"))
                \'.Square=True \'显示为方型
                .Attribute="style=\'background-color: rgb(169,169,169);color:rgb(248,248,255);\'" \'自定义背景色和文字颜色
                b1 = .BuildHtml
            End With
            .Add("c2",r("标题")& b1, r("ico"), r("path"))
        Next
    End With
Next
e.WriteString(wb.Build)


    \'If DataTables.Contains("产品库_活动家具") = False Then \'如果表C没有加载
        \'DataTables.Load("产品库_活动家具") \'加载表C
    \'End If
    \'Dim dr As DataRow = DataTables("网页_导航").SQLFind("链接=\'" & e.Path & "\'  ")
    \'If dr IsNot Nothing Then
        \'wb.AddPageTitle("","ph1","城市之窗","" & dr("品牌")& " &产品选型库")
        \'wb.AppendHTML("<link rel=\'stylesheet\' href=\'./weui/exweui.css\'/>",True)
        \'wb.AppendHTML("<script src=\'./weui/exweui.js\' ></script>",True)
        \'With ExWeUI.WebUI.AddListGroup("","lst01",2)
            \'For Each r As DataRow In DataTables("产品库_活动家具").sqlSelect("产品系列 = \'"& dr("标题") & "\'")
                \'\'For Each r As DataRow In DataTables("产品库_活动家具").sqlSelect("产品系列 = \'"& dr("品牌") & "\'" OrElse "产品名称 = \'"& dr("品牌") & "\' ")
                \'\'For Each r As DataRow In DataTables("产品库_活动家具").DataRows
                \'With .AddList(r("产品系列"),r("商品图片"))
                    \'With  .LeftFooter
                        \'.AddFoot("订货ID:"& r("产品_定货ID")).Attribute = "style=\'color:red;font-size:9px\'"
                        \'.AddFoot("¥ "&r("单价")).Attribute = "style=\'color:red;font-size:10px\'"
                        \'.AddFoot("¥ 9999999.00").Attribute = "style=\'font-size:8px;text-decoration: line-through;\'"
                    \'End With
                    \'.RightFooter.AddFoot("购买").Attribute = " style=\'color:blue;\'"
                    \'.RightFooter.AddFoot("详情").Attribute = " style=\'color:blue;\'"
                    \'\'.RightFooter.AddFoot("标签:11.22.33.44.55.66.77.88.99").Attribute = "style=\'color:MediumBlue;font-size:10px\'End With
            \'Next
            \'wb.InsertHTML(.BuildHtml)
            \'wb.InsertHTML(ExWeUI.WebUI.AddBackTop("bt01").BuildHtml)
            \'wb.AppendHTML("<script>initExWeUI();</script>")
        \'End With
        \'e.WriteString(wb.Build)
    \'End If
\'End Select

r("path"))黄色部分是动态的合成怎么跳转到明细页呢 请教老师 
[此贴子已经被作者于2022/2/13 23:04:49编辑过]

--  作者:有点蓝
--  发布时间:2022/2/13 23:11:00
--  
没看懂,r("path")存储的是什么数据?
--  作者:yifan3429
--  发布时间:2022/2/13 23:24:00
--  
是一个动态的链接地址
Select Case e.Path 
 Case "1.htm" 
Dim wb As New weui
If DataTables.Contains("网页_导航") = False Then \'如果表C没有加载
    DataTables.Load("网页_导航") \'加载表C
End If
Dim b1 As String
wb.AddPageTitle("","pageheader","湖南城市之窗","全案产品选型库")
\'For Each s As String In DataTables("网页_导航").getvalues("分类","[分类] = \'按品牌查看\'", "排序")
    For Each s As String In DataTables("网页_导航").SQLgetvalues("分类","", "排序")
    wb.InsertHTML("<h3 align=\'center\'  style=\'margin-top:10px\'>" & s & "</h3>")
    With wb.AddGrid("","g" & s)
        For Each r As DataRow In DataTables("网页_导航").sqlSelect("分类=\'" & s & "\'","", "数量 Desc")
            With ExWeUI.WebUI.AddBadge("",r("数量"))
                \'.Square=True \'显示为方型
                .Attribute="style=\'background-color: rgb(169,169,169);color:rgb(248,248,255);\'" \'自定义背景色和文字颜色
                b1 = .BuildHtml
            End With
            .Add("c2",r("标题")& b1, r("ico"), r("path"))
        Next
    End With
Next
e.WriteString(wb.Build)

Case Else
    \'If DataTables.Contains("产品库_活动家具") = False Then \'如果表C没有加载
        \'DataTables.Load("产品库_活动家具") \'加载表C
    \'End If
    Dim dr As DataRow = DataTables("网页_导航").SQLFind("path=\'" & e.Path & "\'  ")
    If dr IsNot Nothing Then
        wb.AddPageTitle("","ph1","城市之窗","" & dr("品牌")& " &产品选型库")
        wb.AppendHTML("<link rel=\'stylesheet\' href=\'./weui/exweui.css\'/>",True)
        wb.AppendHTML("<script src=\'./weui/exweui.js\' ></script>",True)
        With ExWeUI.WebUI.AddListGroup("","lst01",2)
            For Each r As DataRow In DataTables("产品库_活动家具").sqlSelect("产品系列 = \'"& dr("标题") & "\'")
                \'For Each r As DataRow In DataTables("产品库_活动家具").sqlSelect("产品系列 = \'"& dr("品牌") & "\'" OrElse "产品名称 = \'"& dr("品牌") & "\' ")
                \'For Each r As DataRow In DataTables("产品库_活动家具").DataRows
                With .AddList(r("产品系列"),r("商品图片"))
                    With  .LeftFooter
                        .AddFoot("订货ID:"& r("产品_定货ID")).Attribute = "style=\'color:red;font-size:9px\'"
                        .AddFoot("¥ "&r("单价")).Attribute = "style=\'color:red;font-size:10px\'"
                        .AddFoot("¥ 9999999.00").Attribute = "style=\'font-size:8px;text-decoration: line-through;\'"
                    End With
                    .RightFooter.AddFoot("购买").Attribute = " style=\'color:blue;\'"
                    .RightFooter.AddFoot("详情").Attribute = " style=\'color:blue;\'"
                    \'.RightFooter.AddFoot("标签:11.22.33.44.55.66.77.88.99").Attribute = "style=\'color:MediumBlue;font-size:10px\'viewport\' c>")
        sb.AppendLine("接收到的数据有:<br/><br/>")
        For Each key As String In e.PostValues.Keys
            sb.AppendLine(key & ":" & e.PostValues(key) & "<br/>")
        Next
        e.WriteString(sb.ToString)
上面的代码独立放在网络监视器是可以实现功能的
如何转接到这句代码上
 Dim dr As DataRow = DataTables("网页_导航").SQLFind("path=\'" & e.Path & "\'  ")


现在用的如下代码,不知道如何跳转链接了
    Select Case e.Path
    Case "testres.htm"
        Dim sb As New StringBuilder
        sb.AppendLine("<meta name=\'viewport\' c>")
        sb.AppendLine("接收到的数据有:<br/><br/>")
        For Each key As String In e.PostValues.Keys
            sb.AppendLine(key & ":" & e.PostValues(key) & "<br/>")
        Next
        e.WriteString(sb.ToString)
    Case Else
        Dim p As String = e.Path
        If p = "" Then p = "*"
        Dim dr As DataRow = DataTables("网页_顶层导航").SQLFind("path=\'" & p & "\' or \'" & p & "\' like path ")
        If dr IsNot Nothing Then
            Functions.Execute(dr("标题"),e)
        Else
            Dim wb As New weui
            wb.InsertHTML("<p>杯具!页面丢失了!! 联系渡哥吧!15116235557 </p>")
            wb.AppendHTML("<script>console.warn(\'" & e.Path & "不在httprequest表,请检查是否没有设置.\')</script>")
            e.WriteString(wb.Build)
        End If
End Select
[此贴子已经被作者于2022/2/13 23:35:18编辑过]

--  作者:有点蓝
--  发布时间:2022/2/14 8:34:00
--  
请上传实例测试
--  作者:yifan3429
--  发布时间:2022/2/15 12:53:00
--  

图片点击可在新窗口打开查看此主题相关图片如下:9a0580c43a0123abd48f30e741b5afd5.jpg
图片点击可在新窗口打开查看
主页面上有三个不同的分组
分组下面的链接分别渠道不同的页面
目前只能往一个链接指向
请老师协助
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:网页动态测试.foxdb



--  作者:有点蓝
--  发布时间:2022/2/15 14:00:00
--  
这个意思?

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:网页动态测试.zip



--  作者:yifan3429
--  发布时间:2022/2/15 14:37:00
--  
老师,不对的

Case "1123.htm"
        Dim b1 As String
        wb.AppendHTML("<link rel=\'stylesheet\' href=\'./weui/exweui.css\'/>",True)
        wb.AppendHTML("<script src=\'./weui/exweui.js\' ></script>",True)
        For Each s As String In DataTables("http").getvalues("分类","", "排序")
            \'For Each s As String In DataTables("http").getvalues("分类","[分类] = \'按客户分类\'", "排序")
            \'For Each s As String In DataTables("网页_导航").SQLgetvalues("分类","分类 <> \'首页\'", "排序")
            wb.InsertHTML("<h3 align=\'center\'  style=\'margin-top:10px\'>" & s & "</h3>")
            With wb.AddGrid("","g" & s)
                For Each r As DataRow In DataTables("http").sqlSelect("分类=\'" & s & "\'","", "数量 Desc")
                    With ExWeUI.WebUI.AddBadge("",r("数量"))
                        \'.Square=True \'显示为方型
                        .Attribute="style=\'background-color: rgb(169,169,169);color:rgb(248,248,255);\'" \'自定义背景色和文字颜色
                        b1 = .BuildHtml
                    End With
                    .Add("c2",r("function")& b1, r("ico"), r("path"))
                Next
            End With
        Next
        wb.AppendHTML("<script>initExWeUI();</script>")
        e.WriteString(wb.Build) 
      
     下面的实际是根据分组不同,调准到不同的筛选条件。通过 Case Else  只能去到一个筛选条件。
   
    Case Else  1
        
        Dim dr As DataRow = DataTables("http").SQLFind("path=\'" & e.Path & "\'  ")
        If dr IsNot Nothing Then
            wb.AddPageTitle("","ph1","测试网页","" & dr("function")& " 客户列表")
            wb.AppendHTML("<link rel=\'stylesheet\' href=\'./weui/exweui.css\'/>",True)
            wb.AppendHTML("<script src=\'./weui/exweui.js\' ></script>",True)
            With ExWeUI.WebUI.AddListGroup("","lst01",2)
                \'For Each r As DataRow In DataTables("订单").Select("客户 = \'"& dr("path") & "\'")
                For Each r As DataRow In DataTables("订单").DataRows
                    With .AddList("产品编号:" & r("产品"),"http://yifan9108.oicp.net/city-pic$/make/end.gif")
                        With  .LeftFooter
                            .AddFoot("单价 ¥ "&r("单价")).Attribute = "style=\'color:red;font-size:10px\'"
                            .AddFoot("原价 ¥ "&r("单价")).Attribute = "style=\'font-size:8px;text-decoration: line-through;\'"
                        End With
                    End With
                Next
                wb.InsertHTML(.BuildHtml)
            End With
        End If
        wb.AppendHTML("<script>initExWeUI();</script>")
        e.WriteString(wb.Build)


Case Else  2


Dim dr As DataRow = DataTables("http").SQLFind("path=\'" & e.Path & "\'  ")
        If dr IsNot Nothing Then
            wb.AddPageTitle("","ph1","测试网页","" & dr("function")& " 雇员列表")
            wb.AppendHTML("<link rel=\'stylesheet\' href=\'./weui/exweui.css\'/>",True)
            wb.AppendHTML("<script src=\'./weui/exweui.js\' ></script>",True)
            With ExWeUI.WebUI.AddListGroup("","lst01",2)                
                For Each r As DataRow In DataTables("订单").DataRows
                    With .AddList("产品编号:" & r("产品"),"http://yifan9108.oicp.net/city-pic$/make/end.gif")
                        With  .LeftFooter
                            .AddFoot("单价 ¥ "&r("单价")).Attribute = "style=\'color:red;font-size:10px\'"
                            .AddFoot("原价 ¥ "&r("单价")).Attribute = "style=\'font-size:8px;text-decoration: line-through;\'"
                        End With
                    End With
                Next
                wb.InsertHTML(.BuildHtml)
            End With
        End If
        wb.AppendHTML("<script>initExWeUI();</script>")
        e.WriteString(wb.Build)


.Add("c2",r("function")& b1, r("ico"), r("path"))
如何传达给下面代码,让他理解,跟他没关系就就换下一个代码执行,知道找到对应的条件打开网页
 Dim dr As DataRow = DataTables("http").SQLFind("path=\'" & e.Path & "\'  ")



[此贴子已经被作者于2022/2/15 14:40:11编辑过]

--  作者:有点蓝
--  发布时间:2022/2/15 15:01:00
--  
就是6楼的意思,把标题也放到表格里,根据查询的结果,动态改标题即可,和case else没有什么关系

wb.AddPageTitle("","ph1","测试网页","" & dr("function") & dr("分类或者标题列"))

--  作者:yifan3429
--  发布时间:2022/2/15 15:37:00
--  
原本标题就是在表格里面的。现在是如果主页面做一个分类是没问题的,但是多个分类就不知道怎么样子去链接了,会出现没有列表项的提示
--  作者:有点蓝
--  发布时间:2022/2/15 15:49:00
--  
多个分类想要怎么链接?请举例说明