order.js 2.5 KB

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