Dim ipg As ExWeUI.ExInputGroup = ExWeUI.WebUI.AddInputGroup("", "ipg" & dr("菜品名称"), "")
With ipg.AddSpinner("sp_" & dr("菜品名称"), "数量")
.max = 20
.min = 0
' .Attribute = "style='color:red;font-size:10px'"
.width = 65 '整体控件的宽度(含加减按钮)
.Attribute = "style=""width:30px;color:red;font-size:15px""" '数值框的宽度,不含加减按钮,加减按钮每个宽度30
.Attribute = "on change=""submitAjaxFileds('接收页面.htm','','订单编号控件ID','加减控件ID',false);"""
End With
这两个如果想合并到一起怎么写?目前这样无法使用
.Attribute = "style=""width:30px;color:red;font-size:15px"" onchange=""submitAjaxFileds('接收页面.htm','','订单编号控件ID','加减控件ID',false);"""
With ExWeUI.WebUI.AddListGroup("page1", "lst01", 1)
wb.AppendHTML("<style>.exui-list-other{width: 100%;}</style>") '为了显示内容的横向底色可以满屏幕(1)共5步,在js文件中还有一个函数
For Each dr As DataRow In drs
Dim txt As String = "<p>发布日期:" & dr("发布日期") & "<br/>"
With .AddList(dr("菜品名称"), "./Attachments/" & dr("菜品图片") , "renamecx_name.htm?name=" & dr("_Identify"))
.TextStyle = "color:black;font-size:17px;text-align: center;" '字体颜色,字体大小
.ImageWidth = 100 '图片大小
With .LeftFooter
.AddFoot(dr("菜品价格") & "元" & dr("单位")).Attribute = "style='color:red;font-size:13px'"
End With
'插入传送数据
Dim ipg As ExWeUI.ExInputGroup = ExWeUI.WebUI.AddInputGroup("", "ipg" & dr("菜品名称"), "")
With ipg.AddSpinner("sp_" & dr("菜品名称"), "数量")
.max = 20
.min = 0
' .Attribute = "style='color:red;font-size:10px'"
.width = 65 '整体控件的宽度(含加减按钮)
.Attribute = "style=""width:30px;color:red;font-size:15px"" on change=""submitAjaxFileds('receive.htm','','订单编号控件ID','加减控件ID',false);"""
End With
' .RightFooter.AddFoot("").Attribute = ipg.BuildHtml
.RightFooter.AddFoot(ipg.BuildHtml)
End With
Next
这个地方我如果我还想传送一些变量该怎么传?比如想传送一下openid,我想手动增加,比如: .AddHiddenValue("订单编号", openid),可以吗?应该怎么增加?
.Attribute = "style=""width:30px;color:red;font-size:15px"" onchange=""submitAjaxFileds('接收页面.htm','','订单编号控件ID','加减控件ID','订单编号',false);"""
[此贴子已经被作者于2024/5/28 16:21:30编辑过]
wb.AddForm("","form1","test.htm")
With wb.AddInputGroup("form1","ipg1","订单编辑")
.AddHiddenValue("订单编号","123")
.AddInput("客户","客户","text")
.AddInput("产品","产品","text")
.AddInput("数量","数量","number")
.AddInput("单价","单价","number").Step= "0.01"
End
With
我这里没有addform,这时addhiddenvalue应该怎么添加?
必须添加到表单里,才能使用submitAjaxFileds
那我这种情况该怎么处理?既需要传输表单中的值,又需要传输一些变量值
我自己想了一个方法,看看哪里不对: .Attribute = "style=""width:30px;color:red;font-size:10px"" on change=""sendJsonObject('" & openid & "','" & dr("菜品名称") & "')"""
js文件:
function sendJsonObject(openid,cpmc){ //向后台发送数据
var obj=new Object();
obj.openid = openid;
obj.cpmc=cpmc;
var cpsl = document.getElementById("sp_"+cpmc); //菜品数量
console.log(cpsl);
obj.cpsl=cpsl;
var result = sendAjaxJSON(obj,"receive.htm","",false);
}
receive函数:
Dim e As RequestEventArgs = args(0)
Dim wb As New weui
Dim sb As New StringBuilder
Dim jo As JObject = JObject.Parse(e.PlainText) '解析JSON数据
Dim openid As String = jo("openid").ToString()
Dim cpmc As String = jo("cpmc").ToString()
messagebox.Show(jo("cpsl").ToString())
Dim cpsl As String = jo("cpsl").ToString()
e.WriteString(sb.ToString())
现在黄色部分这里显示出一个花括号,应该是这句 var cpsl = document.getElementById("sp_"+cpmc); //菜品数量 没有提取到表单中的数量。