난 단지 소요 한 Sweetalert 가지고 Ok
와 Cancle
. 경우 ok
는 그에 따라 옵션을 수행합니다.
두 가지 옵션이 필요합니다 : With Payment
및 Without Payment
. 사용자가 선택 With Payment
하면 사용자에게 금액을 입력하고 다른 페이지로 보내도록 요청합니다.
내 현재 order.list.js
페이지는 다음과 같습니다.
function completeOrder(orderID) {
var obj = {
order: order,
page: page,
customer: $("#customers_" + from).val(),
sdate: $("#sdate_" + from).val(),
edate: $("#edate_" + from).val(),
Status: Status
};
swal({
title: "Are you sure?",
text: "You want to complete this order Without Payment !!",
icon: "warning",
buttons: true,
dangerMode: true,
}).then((willDelete) => {
if (willDelete) {
$.ajax({
url: "process/order-process.php",
type: "POST",
data: {
orderID: orderID,
status: "Completed",
payment: "Not Paid"
},
beforeSend: function() {},
success: function(response) {
if (response.indexOf("success") >= 0) {
swal("Good job! Your order has been completed!", {
icon: "success",
});
getResult(true, 'process/order-list.php', "POST", JSON.stringify(obj), from);
} else {
swal("Error!", "Something went wrong!", "error");
}
}
});
} else {}
});
}
아래와 같은 것을 시도해 보셨습니까?
swal("Place the order?", {
title: "Are you sure?",
text: "You want to complete this order Without Payment !!",
icon: "warning",
buttons: {
withPayment: "With Payment",
withOutPayment: "With out Payment",
}
})
.then((value) => {
switch (value) {
case "withPayment":
// Proceed with payment
break;
case "withOutPayment":
// Proceed without payment
break;
}
});
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다