编程问答
swal弹窗-凯发ag旗舰厅登录网址下载
swal()方法是一个提示框;
swal({
title: "",
text: "请扫描用户手机上的付款码",
type: "input",
showcancelbutton: true,
closeonconfirm: false,
cancelbuttontext: "取消",
confirmbuttontext: "确认",
imageurl: "/assets/images/icon/scancode.gif",
inputplaceholder: "请填写付款码数字",
showloaderonconfirm: true
},function(inputvalue){
if(inputvalue){
if (inputvalue === "") {
swal.showinputerror("请填写付款码数字");
return false
}else{
$("input[name='authcode']").val(inputvalue);
var form = cashierfrom.serialize();
$.post("/cashier/order", form, function(data) {
var result = $.parsejson(data);
if (result.code == 'success') {
swal({
title : "支付成功",
type : "success",
confirmbuttontext : "确定",
closeonconfirm : false
});
} else {
if(result.subcode=='user_paying'){
var html = '
取消';showloadalert('等待用户输入密码..',html);
var no = result.outtradeno;
queryinterval = self.setinterval("cashierorderquery('" no "',true)",3000);
}else{
swal({
title : "支付失败",
type : "error",
text : result.msg,
confirmbuttontext : "确定",
closeonconfirm : false
});
}
}
});
}
}
});
swal() 增加确认及取消的方法
swal({
title: "确认删除?",
text: "your will not be able to recover this imaginary file!",
type: "warning",
showcancelbutton: true,
confirmbuttoncolor: "#dd6b55",
confirmbuttontext: "确认",
cancelbuttontext: "取消",
closeonconfirm: false,
closeoncancel: false
},
function(isconfirm){
if (isconfirm) {
swal("deleted!", "your imaginary file has been deleted.", "success");
} else {
swal("cancelled", "your imaginary file is safe :)", "error");
}
});
可参考地址:
http://www.dglives.com
总结
以上是凯发ag旗舰厅登录网址下载为你收集整理的swal弹窗_swal() 弹出层的用法的全部内容,希望文章能够帮你解决所遇到的问题。
如果觉得凯发ag旗舰厅登录网址下载网站内容还不错,欢迎将凯发ag旗舰厅登录网址下载推荐给好友。
- 上一篇:
- 下一篇: