日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

swal弹窗_swal() 弹出层的用法

發(fā)布時間:2024/10/14 编程问答 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 swal弹窗_swal() 弹出层的用法 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

swal()方法是一個提示框;

swal({

title: "",

text: "請掃描用戶手機上的付款碼",

type: "input",

showCancelButton: true,

closeOnConfirm: false,

cancelButtonText: "取消",

confirmButtonText: "確認",

imageUrl: "/assets/images/icon/scancode.gif",

inputPlaceholder: "請?zhí)顚懜犊畲a數(shù)字",

showLoaderOnConfirm: true

},function(inputValue){

if(inputValue){

if (inputValue === "") {

swal.showInputError("請?zhí)顚懜犊畲a數(shù)字");

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

總結(jié)

以上是生活随笔為你收集整理的swal弹窗_swal() 弹出层的用法的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。