order.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  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 orderAdminDetail(data,orderid) {
  78. return request({
  79. url: '/api/admin/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. //管理orderList
  149. export function GetAdminOrderList(data) {
  150. return request({
  151. url: '/api/admin/order/list',
  152. method: 'get',
  153. data
  154. });
  155. }
  156. //同意退款
  157. export function aOrderRefund(data) {
  158. return request({
  159. url: '/api/admin/order/refund',
  160. method: 'post',
  161. data
  162. });
  163. }
  164. //退换押金
  165. export function backDeposit(data) {
  166. return request({
  167. url: '/api/admin/order/back_deposit',
  168. method: 'post',
  169. data
  170. });
  171. }
  172. export function orderData(data) {
  173. return request({
  174. url: '/api/order/data',
  175. method: 'get',
  176. data
  177. });
  178. }
  179. //order/give/:uni 赠送订单
  180. export function orderGive(data,uni) {
  181. return request({
  182. url: '/api/order/give/' + uni,
  183. method: 'post',
  184. data
  185. });
  186. }
  187. export function getUserList(data) {
  188. return request({
  189. url: '/api/user_list',
  190. method: 'get',
  191. data
  192. });
  193. }
  194. // 发货
  195. export function delivery(data) {
  196. return request({
  197. url:'/api/admin/order/delivery/keep',
  198. method: 'post',
  199. data
  200. })
  201. }
  202. // 获取我的兑换券列表
  203. export function getMyexchange(data) {
  204. return request({
  205. url:'/api/exchange/order_list',
  206. method: 'get',
  207. data
  208. })
  209. }
  210. //领取兑换券
  211. export function getGift(data,id) {
  212. return request({
  213. url:'/api/exchange_order/give/' + id,
  214. method: 'post',
  215. data
  216. })
  217. }
  218. // 获取admin/exchange
  219. export function getAdminExchangeList(data) {
  220. return request({
  221. url:'/api/admin/exchange_order/list',
  222. method: 'get',
  223. data
  224. })
  225. }
  226. // 退还兑换券押金
  227. export function backExchangeDeposit(data) {
  228. return request({
  229. url:'/api/admin/exchange_order/back_deposit',
  230. method: 'post',
  231. data
  232. })
  233. }