pay_win.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. var nowOrderId = null;
  2. mui.ready(function() {
  3. var nowUrl = location.href;
  4. var orderId = nowUrl.split("?")[1].split("&")[0].split("=")[1];
  5. nowOrderId = orderId;
  6. // selectUser({
  7. // "orderId": orderId
  8. // });
  9. //getCartNum();
  10. $(document).on('tap', '#check-order-desc', function() {
  11. location.href='order_details.html?orderId='+nowOrderId
  12. });
  13. document.querySelector('.loading-bg').style.display = 'none'
  14. });
  15. function selectUser(orderId) {
  16. var btnArray = ['否', '是'];
  17. $.ajax(base_path + '/order/getOrderInfo', {
  18. data: orderId,
  19. dataType: 'json',
  20. type: 'post',
  21. timeout: 15000,
  22. xhrFields: {
  23. withCredentials: true
  24. },
  25. crossDomain: true,
  26. success: function(dt) {
  27. if(dt.isRedirect) {
  28. location.href = dt.redirectURL;
  29. } else {
  30. if(dt.status) {
  31. var order = dt.data;
  32. $("#pay-money-total").html((order.salesYetAmount / 100).toFixed(2));
  33. $("#orderid-span").html(order.salesOrderid);
  34. $("#check-order-desc").attr("value", order.salesOrderid);
  35. $('#check-luck-draw').attr("value", order.salesOrderid);
  36. var date = new Date(order.salesTransactionDate);
  37. var str = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + (date.getSeconds() + 1);
  38. $("#pay-date-span").html(str);
  39. $("#show-div-data").show();
  40. $("#now-load-data-div-bg").hide();
  41. $("#check-order-desc").attr("href", "order_details.html?orderId=" + nowOrderId)
  42. } else {
  43. mui.confirm(dt.message + '是否刷新页面?', '提示', btnArray, function(e) {
  44. if(e.index == 1) {
  45. location.reload(true)
  46. }
  47. })
  48. }
  49. }
  50. },
  51. error: function(xhr, type, errorThrown) {
  52. console.log(xhr)
  53. }
  54. })
  55. };