上传代码
Dim e As RequestEventArgs = args(0)
Dim wb As New weui
wb.AddForm("","form1","receive.htm").attribute= """
With wb.AddInputGroup("form1","ipg1","回单图片上传")
With .AddInput("销售发货单号","发货单号:","text")
If e.getValues.ContainsKey("dh") Then
.Value = e.GetValues("dh")
End If
End With
With .AddUploader("up128","照片")
.AllowDelete = True '允许删除
.Accept = "image/*"
.Incremental = True
.ScaleWidth = tpgd
End With
End With
With wb.AddButtonGroup("form1","btg1",True)
.Add("btn1", "确定", "button").Attribute= "" '调用js函数上传
End With
wb.AddToast("","tst1", "正在上传",1)
wb.AddToast("","tst2", "上传成功",0)
wb.AddToast("","tst3", "单号不存在!",0).Icon= "warn"
wb.AddToast("","tst4", "单号不能为空!",0).Icon= "warn"
wb.AppendHTML("<script src='./lib/wj.js'></script>") '引入脚本文件
e.WriteString(wb.Build)
e.Handled=True
JS代码
function submitWithProgress(){
var result =
submitAjaxForm('form1','afterSubmit',true,'tst1');
}
function
afterSubmit(result){
hide("tst1");
if (result=='OK') {
show("tst2");
location="upload.htm";
}
else{
show("tst3",2000);
}
}
上传时tst1总是一闪而过,然后页面卡顿一会,突然结束,没有那种正在上传的动画效果