order.js 2.8 KB

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