以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  上传文件进度问题  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=160845)

--  作者:rjh4078
--  发布时间:2021/2/23 22:10:00
--  上传文件进度问题
上传代码 
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总是一闪而过,然后页面卡顿一会,突然结束,没有那种正在上传的动画效果



--  作者:有点蓝
--  发布时间:2021/2/23 22:47:00
--  
tst1关闭应该已经上传完毕了,卡顿估计是跳转到upload.htm的效果
--  作者:rjh4078
--  发布时间:2021/2/24 8:43:00
--  
有没有方法控制tst1的显示时间?让他多显示一会
--  作者:有点蓝
--  发布时间:2021/2/24 8:54:00
--  

Toast的属性有:

Visible逻辑型,打开网页后是否显示Toast,默认为False。
msec整数型,默认为0,用于设置Toast初始显示的毫秒数。
Icon字符型,指定Toast显示的图标,默认为"default"。

其他可选值有"success","info","warn",对应的图标分别是:
估计不是时间长短的问题,成功会显示tst2,失败tst3

if (result==\'OK\') {
        show("tst2");
        location="upload.htm";
    }
    else{
        show("tst3",2000);
    }