小程序端工程代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

150 lines
2.3 KiB

  1. /*
  2. * 订单确认
  3. * */
  4. import request from "@/utils/request";
  5. /**
  6. * 通过购物车 id 获取订单信息
  7. * @param cartId
  8. * @returns {*}
  9. */
  10. export function postOrderConfirm(cartId) {
  11. return request.post("/order/confirm", {
  12. cartId
  13. });
  14. }
  15. /**
  16. * 计算订单金额
  17. * @param key
  18. * @param data
  19. * @returns {*}
  20. */
  21. export function postOrderComputed(key, data) {
  22. return request.post("/order/computed/" + key, data);
  23. }
  24. /**
  25. * 获取指定金额可用优惠券
  26. * @param price
  27. * @returns {*}
  28. */
  29. export function getOrderCoupon(cartId) {
  30. return request.get("/coupons/order/" + cartId);
  31. }
  32. /**
  33. * 生成订单
  34. * @param key
  35. * @param data
  36. * @returns {*}
  37. */
  38. export function createOrder(key, data) {
  39. return request.post("/order/create/" + key, data || {});
  40. }
  41. /**
  42. * 订单统计数据
  43. * @returns {*}
  44. */
  45. export function getOrderData() {
  46. return request.get("/order/data");
  47. }
  48. /**
  49. * 订单列表
  50. * @returns {*}
  51. */
  52. export function getOrderList(data) {
  53. return request.get("/order/list", data);
  54. }
  55. /**
  56. * 取消订单
  57. * @returns {*}
  58. */
  59. export function cancelOrder(id) {
  60. return request.post("/order/cancel", {
  61. id
  62. });
  63. }
  64. /**
  65. * 订单详情
  66. * @returns {*}
  67. */
  68. export function orderDetail(id) {
  69. return request.get("/order/detail/" + id);
  70. }
  71. /**
  72. * 退款理由
  73. * @returns {*}
  74. */
  75. export function getRefundReason() {
  76. return request.get("/order/refund/reason");
  77. }
  78. /**
  79. * 提交退款
  80. * @returns {*}
  81. */
  82. export function postOrderRefund(data) {
  83. return request.post("/order/refund/verify", data);
  84. }
  85. /**
  86. * 确认收货
  87. * @returns {*}
  88. */
  89. export function takeOrder(uni) {
  90. return request.post("/order/take", {
  91. uni
  92. });
  93. }
  94. /**
  95. * 删除订单
  96. * @returns {*}
  97. */
  98. export function delOrder(uni) {
  99. return request.post("/order/del", {
  100. uni
  101. });
  102. }
  103. /**
  104. * 订单查询物流信息
  105. * @returns {*}
  106. */
  107. export function express(params) {
  108. return request.post("order/express", params);
  109. }
  110. /**
  111. * 订单查询物流信息
  112. * @returns {*}
  113. */
  114. export function payOrder(uni, paytype, from) {
  115. return request.post("order/pay", {
  116. uni,
  117. paytype,
  118. from
  119. });
  120. }
  121. /**
  122. * 订单核销
  123. * @returns {*}
  124. */
  125. export function orderVerific(verifyCode, isConfirm) {
  126. return request.post("order/order_verific", { verifyCode, isConfirm });
  127. }
  128. /**
  129. * 获取订阅消息ID
  130. * @param price
  131. * @returns {*}
  132. */
  133. export function getSubscribeTemplate() {
  134. return request.get("/order/getSubscribeTemplate");
  135. }