detail.html 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <!-- <link href="__CDN__/assets/libs/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"> -->
  2. <script src="__CDN__/assets/libs/jquery/dist/jquery.min.js"></script>
  3. <script src="__CDN__/assets/libs/bootstrap/dist/js/bootstrap.min.js"></script>
  4. <script src="__CDN__/assets/libs/sweetalert/sweetalert.min.js"></script>
  5. <style>
  6. .confirm-btn {
  7. background-color: #f75444 !important;
  8. color: white !important;
  9. }
  10. </style>
  11. <table class="table table-striped">
  12. <thead>
  13. <tr>
  14. <th>{:__('订单ID')}</th>
  15. <th>{:__('订单号')}</th>
  16. <th>{:__('商品')}</th>
  17. <th>{:__('图片')}</th>
  18. <th>{:__('状态')}</th>
  19. </tr>
  20. </thead>
  21. <tbody>
  22. {volist name="row" id="vo" }
  23. <tr>
  24. <td>{$vo.id}</td>
  25. <td>{$vo.order_no}</td>
  26. <td>{$vo.zh_name|htmlentities}</td>
  27. <td><img src="{$vo.thum|htmlentities}" width="100px" height="80px"></td>
  28. <td>
  29. {switch name="vo.status"}
  30. {case value="0"}
  31. <span class="label label-success">{$vo.status_txt}</span>
  32. {/case}
  33. {case value="1"}
  34. <span class="label label-success">{$vo.status_txt}</span>
  35. {/case}
  36. {case value="2"}
  37. <span class="label label-success">{$vo.status_txt}</span>
  38. {/case}
  39. {case value="3"}
  40. <span class="label label-success">{$vo.status_txt}</span>
  41. {/case}
  42. {case value="4"}
  43. <span class="label label-danger">{$vo.status_txt}</span>
  44. {/case}
  45. {case value="5"}
  46. <span class="label label-default">{$vo.status_txt}</span>
  47. {/case}
  48. {case value="6"}
  49. <span class="label label-success">{$vo.status_txt}</span>
  50. {eq name="userpledge_status" value="0"}
  51. <a href="javascript:;" class="btn btn-xs btn-danger cancelStorage" data-id="{$vo.id}"
  52. data-userpledge_id="{$userpledge_id}">{:__('Cancel storage')}</a>
  53. {$userpledge_id}
  54. {/eq}
  55. {/case}
  56. {default /}
  57. {/switch}
  58. </td>
  59. </tr>
  60. {/volist}
  61. </tbody>
  62. </table>
  63. <div class="hide layer-footer">
  64. <label class="control-label col-xs-12 col-sm-2"></label>
  65. <div class="col-xs-12 col-sm-8">
  66. <button type="reset" class="btn btn-primary btn-embossed btn-close"
  67. onclick="Layer.closeAll();">{:__('Close')}</button>
  68. </div>
  69. </div>
  70. <script>
  71. $(function () {
  72. $(".cancelStorage").click(function () {
  73. var id = $(this).data('id');
  74. var userpledgeId = $(this).data('userpledge_id');
  75. swal({
  76. title: "取消存储",
  77. icon: "warning",
  78. buttons: {
  79. cancel: "取消",
  80. catch: {
  81. text: "确认",
  82. value: "catch",
  83. className: "confirm-btn"
  84. }
  85. },
  86. dangerMode: true,
  87. }
  88. )
  89. .then((willDelete) => {
  90. if (willDelete) {
  91. $.ajax({
  92. url: "user/Userpledge/cancelStorage",
  93. type: "POST",
  94. data: { id: id, userpledgeId: userpledgeId },
  95. dataType: "json",
  96. success: function (response) {
  97. let code = response.code;
  98. if (code == 1) {
  99. window.location.reload(); // 刷新父页面
  100. }
  101. },
  102. error: function (xhr, status, error) {
  103. console.error("请求失败", error);
  104. },
  105. complete: function () {
  106. console.log("请求完成(无论成功/失败)");
  107. }
  108. });
  109. } else {
  110. // console.log("取消")
  111. }
  112. });
  113. })
  114. })
  115. </script>