swal弹窗-ag凯发k8国际
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凯发k8国际为你收集整理的swal弹窗_swal() 弹出层的用法的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇:
- 下一篇: