order.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. import request from '@/utils/request'
  2. import {upFilse} from '@/utils/request'
  3. // 订单确认
  4. export function confirm(data) {
  5. return request({
  6. url: '/api/order/confirm',
  7. method: 'post',
  8. data
  9. });
  10. }
  11. //获取可使用优惠券
  12. export function couponsOrder(data,price) {
  13. return request({
  14. url: '/api/coupons/order/'+price,
  15. method: 'get',
  16. data
  17. });
  18. }
  19. //获取优惠券列表
  20. export function getCouponsList(data,types) {
  21. //优惠券状态 0全部 1未使用 2已使用
  22. return request({
  23. url: '/api/coupons/user/'+types,
  24. method: 'get',
  25. data
  26. });
  27. }
  28. //提交评论
  29. export function order_comment(data) {
  30. return request({
  31. url: '/api/order/comment',
  32. method: 'post',
  33. data
  34. });
  35. }
  36. //订单产品信息
  37. export function product(data) {
  38. return request({
  39. url: '/api/order/product',
  40. method: 'post',
  41. data
  42. });
  43. }
  44. // 快递查询
  45. export function express_query(data) {
  46. return request({
  47. url: '/api/order/express_query',
  48. method: 'get',
  49. data
  50. });
  51. }
  52. //上传图片
  53. export function upload(data) {
  54. return upFilse({
  55. url: '/api/upload/image',
  56. method: 'post',
  57. data
  58. });
  59. }
  60. // 订单列表
  61. export function orderList(data) {
  62. return request({
  63. url: '/api/order/list',
  64. method: 'get',
  65. data
  66. });
  67. }
  68. // 订单详细
  69. export function orderDetail(data,orderid) {
  70. return request({
  71. url: '/api/order/detail/'+orderid,
  72. method: 'get',
  73. data
  74. });
  75. }
  76. // 取消订单
  77. export function orderCancel(data) {
  78. return request({
  79. url: '/api/order/cancel',
  80. method: 'post',
  81. data
  82. });
  83. }
  84. // 删除订单
  85. export function orderDel(data) {
  86. return request({
  87. url: '/api/order/del',
  88. method: 'get',
  89. data
  90. });
  91. }
  92. // 申请退款
  93. export function refund(data) {
  94. return request({
  95. url: '/api/order/refund/verify',
  96. method: 'post',
  97. data
  98. });
  99. }
  100. // 退款理由列表
  101. export function refundReason(data) {
  102. return request({
  103. url: '/api/order/refund/reason',
  104. method: 'get',
  105. data
  106. });
  107. }
  108. // 确认收货
  109. export function orderTake(data) {
  110. return request({
  111. url: '/api/order/take',
  112. method: 'post',
  113. data
  114. });
  115. }
  116. // 订单支付
  117. export function orderPay(data) {
  118. return request({
  119. url: '/api/order/pay',
  120. method: 'post',
  121. data
  122. });
  123. }
  124. // 创建订单
  125. export function createOrderkey(data,key) {
  126. return request({
  127. url: '/api/order/create/'+key,
  128. method: 'post',
  129. data
  130. });
  131. }
  132. // 统计订单金额
  133. export function computedOrderkey(data) {
  134. return request({
  135. url: '/api/order/computed/'+data.orderkey,
  136. method: 'post',
  137. data
  138. });
  139. }