|
@@ -677,14 +677,12 @@
|
|
|
"delivery": 10,
|
|
|
"address_id": addressId
|
|
|
}
|
|
|
- console.log(params)
|
|
|
const res = await orderPayment(params)
|
|
|
- console.log(res)
|
|
|
const {status, message, data} = res || {}
|
|
|
if (status === 200 || status === "200") {
|
|
|
window.open(data.payment.approval_link, "_blank");
|
|
|
- setInterval(function (){
|
|
|
- console.log('hahaha');
|
|
|
+ var interId = setInterval(function (){
|
|
|
+ fetchOrder(data.orderId, interId);
|
|
|
},2000)
|
|
|
} else if (status === 401 || status === "401") {
|
|
|
window.location.replace('../passport/logIn.html')
|
|
@@ -693,6 +691,18 @@
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+ function fetchOrder(orderId, interId){
|
|
|
+ $.get('/index/order/detail?orderId='+ orderId,function (res){
|
|
|
+ console.log(res.data.order.pay_status);
|
|
|
+ if (res.status == 200 && res.data.order.pay_status == 20){
|
|
|
+ clearInterval(interId);
|
|
|
+ $("#loadingModel").hide(0);
|
|
|
+ window.location.replace('/index/user/orderDetails.html?orderDetails=' + orderId)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
//支付
|
|
|
$(".checkoutButton").on(tap, async function () {
|
|
|
console.log("points")
|