Dim e As RequestEventArgs = args(0)
Dim wb As New weui
''设置分页
Dim dt As DataTable = cmd.ExecuteReader
wb.AppendHTML("<link rel='stylesheet' href='./weui/exweui.css'/>", True) '引入样式2文件
wb.AppendHTML("<script src='./weui/exweui.js' ></script>", True) '引入框架文件
wb.AddPage("", "page1").Attribute = "style=width:100%;" '增加1个page
Dim p1Div = ExWeUI.WebUI.AddHtmlTag("", "", "div")
Dim p1Div1 = ExWeUI.WebUI.AddHtmlTag("", "", "div", , "style='display: flex;flex-direction: column;height: 100%;'")
With ExWeUI.WebUI.AddSearchBar("bar01", "关键字") '添加一个搜索条
.DataFunc = "test"
.CancelFunc = "testcancel"
p1Div.InnerHtml = p1Div.InnerHtml & .BuildHtml
End With
p1Div1.InnerHtml = p1Div.buildhtml
Dim drs As List(Of DataRow) = dt.Select("")
If drs.Count > 0 Then
' messagebox.show(drs.count)
With ExWeUI.WebUI.AddListGroup("page1", "lst01", 1)
Dim color1 As String = "style='background-color:#f69797'" '暗红色,未检疫
Dim color2 As String = "style='background-color:#d9a738'" '淡黄色,正在检疫
Dim color3 As String = "style='background-color:#198d65'" '淡绿色,已检疫
Dim color As String
For Each dr As DataRow In drs
If dr("是否离轮") = True or dr("电讯检疫") =true Then '已检疫
color = color3
ElseIf dr("卫检登轮") = true And dr("是否离轮") <> true Then '检疫中
color = color2
ElseIf dr("卫检登轮") <> true Then
color = color1
End If
Dim txt As String = "<p " & color & ">中文船名:" & dr("中文船名") & "<br/>"
txt = txt & "入境时间:" & dr("入境时间") & "<br/>"
txt = txt & "船  籍:" & dr("船籍") & "<br/>"
txt = txt & "IMO号:" & dr("IMO号") & "</p>"
Dim s As String = dr("船舶资料")
If s.length > 10 Then
txt = txt & "<p>船舶资料:" & s.substring(0, 10) & "......" & "</p>"
Else
txt = txt & "<p>船舶资料:" & dr("船舶资料") & "</p>"
End If
With .AddList(dr("中文船名") & "(" & dr("检查类别") & ")", "")
.TextStyle = "color:red;font-size:20px" '字体颜色,字体大小
.ImageWidth = 2 '图片大小
With .LeftFooter
.AddFoot(txt).Attribute = "style='color:white;background-color:#f69797';font-size:17px'"
If e.Cookies("用户类别") = "企业" Then
.AddFoot("详细信息").Attribute = " & dr("_Identify") & "'"" style='color:blue;font-size:20px'"
Else
.AddFoot("详细信息").Attribute = " & dr("_Identify") & "'"" style='color:blue;font-size:20px'"
End If
End With
With .rightFooter
If e.Cookies("用户类别") = "企业" And dr("检查类别") = "进检" Then
' .AddFoot("申报出检").Attribute = " & dr("_Identify") & "'"" style='color:green;font-size:20px'"
.AddFoot("申报出检").Attribute = " & dr("_Identify") & "'"" style='color:green;font-size:20px'"
ElseIf e.Cookies("用户类别") <> "企业" then
.AddFoot("拨打电话").Attribute = " & dr("手机号") & "'"" style='color:green;font-size:20px'"
End If
End With
End With
Next
p1Div1.InnerHtml = p1Div.InnerHtml & ExWeUI.WebUI.AddHtmlTag("", "p1", "div", .BuildHtml, "class=""exui-scrollview""").buildhtml
End With
wb.InsertHTML("<div style='height:50px'></div>")
wb.InsertHTML("page1", p1Div1.buildhtml)
wb.InsertHTML("</div>")
wb.InsertHTML("<div style='height:50px'></div>")
wb.AddPage("", "page3").Attribute = "style='position: fixed;bottom: 0;right: 0;left: 0'" '增加两个page
With wb.AddButtonGroup("page3", "btg1", False)
.Add("btn1", "返回首页", "", "default.htm")
If page > 0 Then
.Add("btnPrev", "上一页", "", "renamecx.htm?page=" & page - 1)
End If
If Endrow < count Then
.Add("btnNext", "下一页", "", "renamecx.htm?page=" & page + 1)
End If
.Add("btn2", "清除查询", "button", "Renamecx.htm")
End With
wb.AppendHTML("<script src='./lib/test.js'></script>")
wb.AppendHTML("<script>initExWeUI();</script>")
e.WriteString(wb.Build)
Else
With wb.AddMsgPage("", "msgpage", "查询完成", "没有查询到相关数据!")
.icon = "info" '改变图标"success","info","warn",对应的图标分别是
' .AddButton("btn1", "返回查询", "renamecx.htm")
' .AddButton("btn22", "返回首页", "default.htm")
End With
e.WriteString(wb.Build)
Return Nothing '必须返回
End If
假如要把黄色部分做成一个函数 怎么做