pay_win.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. var nowOrderId = null;
  2. var isSpell=getParam('isSpell'),isSpellstr='';
  3. if(isSpell==1){
  4. isSpellstr='&isSpell=1';
  5. }
  6. mui.ready(function() {
  7. var nowUrl = location.href;
  8. nowOrderId = getParam('orderId');
  9. selectUser(nowOrderId)
  10. });
  11. function selectUser(orderId) {
  12. var btnArray = ['否', '是'];
  13. $.ajax(base_path + '/cart/getShopOrderByOrderId', {
  14. data: {
  15. orderId:orderId
  16. },
  17. dataType: 'json',
  18. type: 'post',
  19. timeout: 15000,
  20. xhrFields: {
  21. withCredentials: true
  22. },
  23. crossDomain: true,
  24. success: function(dt) {
  25. if(dt.isRedirect) {
  26. location.href = dt.redirectURL;
  27. } else {
  28. if(dt.status) {
  29. var order = dt.data;
  30. $("#check-order-desc").attr("value", order.salesOrderid);
  31. if(isSpell==1){
  32. isSpellstr+='&productId='+order.orderItemList[0].itemProductId+'&colorId='+order.orderItemList[0].itemColorId
  33. if(typeof(order.salesSpellOrderId)!="undefined"){
  34. $("#check-order-desc").attr("href", "order_details.html?orderId=" + nowOrderId+isSpellstr)
  35. }else{
  36. location.href='pay_add_group.html?orderId='+nowOrderId+isSpellstr
  37. }
  38. }else{
  39. $("#check-order-desc").attr("href", "order_details.html?orderId=" + nowOrderId)
  40. }
  41. $(document).on('tap', '#check-order-desc', function() {
  42. location.href=$(this).attr('href');
  43. });
  44. document.querySelector('.loading-bg').style.display = 'none';
  45. } else {
  46. mui.confirm(dt.message + '是否刷新页面?', '提示', btnArray, function(e) {
  47. if(e.index == 1) {
  48. location.reload(true)
  49. }
  50. })
  51. }
  52. }
  53. },
  54. error: function(xhr, type, errorThrown) {
  55. console.log(xhr)
  56. }
  57. })
  58. };