order.js 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. // +----------------------------------------------------------------------
  2. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  3. // +----------------------------------------------------------------------
  4. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  5. // +----------------------------------------------------------------------
  6. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  7. // +----------------------------------------------------------------------
  8. // | Author: CRMEB Team <admin@crmeb.com>
  9. // +----------------------------------------------------------------------
  10. import request from "@/utils/request.js";
  11. /**
  12. * 获取购物车列表
  13. * @param numType boolean true 购物车数量,false=购物车产品数量
  14. */
  15. export function getCartCounts() {
  16. return request.get("user/cart/count");
  17. }
  18. /**
  19. * 获取购物车列表
  20. *
  21. */
  22. export function getCartList() {
  23. return request.get("user/cart/lst");
  24. }
  25. /**
  26. * 修改购物车数量
  27. * @param int cartId 购物车id
  28. * @param int number 修改数量
  29. */
  30. export function changeCartNum(cartId, data) {
  31. return request.post("user/cart/change/"+cartId,data);
  32. }
  33. /**
  34. * 清除购物车
  35. * @param object ids
  36. */
  37. export function cartDel(data){
  38. return request.post('user/cart/delete', data);
  39. }
  40. /**
  41. * 购物车商品属性
  42. * @param object ids
  43. */
  44. export function cartProductAttr(id){
  45. return request.get(`store/product/get_attr_value/${id}`);
  46. }
  47. /**
  48. * 订单列表
  49. * @param object data
  50. */
  51. export function getOrderList(data){
  52. return request.get('order/list',data);
  53. }
  54. /**
  55. * 订单产品信息
  56. * @param string unique
  57. */
  58. export function orderProduct(orderId){
  59. return request.get('reply/product/'+orderId);
  60. }
  61. /**
  62. * 订单评价
  63. * @param object data
  64. *
  65. */
  66. export function orderComment(id,data){
  67. return request.post('reply/'+id,data);
  68. }
  69. /**
  70. * 订单支付
  71. * @param object data
  72. */
  73. export function orderPay(id,data){
  74. return request.post('order/pay/'+id,data);
  75. }
  76. /**
  77. * 积分商品订单支付
  78. * @param object data
  79. */
  80. export function integralOrderPay(id,data){
  81. return request.post('order/points/pay/'+id,data);
  82. }
  83. /**
  84. * 订单统计数据
  85. */
  86. export function orderData(){
  87. return request.get('order/number')
  88. }
  89. /**
  90. * 订单取消
  91. * @param string id
  92. *
  93. */
  94. // export function orderCancel(id){
  95. // return request.post('order/cancel',{id:id});
  96. // }
  97. /**
  98. * 未支付订单取消
  99. * @param string id
  100. *
  101. */
  102. export function unOrderCancel(id){
  103. return request.post('order/cancel/'+id);
  104. }
  105. /**
  106. * 删除已完成订单
  107. * @param string uni
  108. *
  109. */
  110. export function orderDel(id){
  111. return request.post('order/del/'+id);
  112. }
  113. /**
  114. * 订单详情
  115. * @param string uni
  116. */
  117. export function getOrderDetail(uni){
  118. return request.get('order/detail/'+uni);
  119. }
  120. /**
  121. * 订单详情
  122. * @param string uni
  123. */
  124. export function groupOrderDetail(uni){
  125. return request.get('order/group_order_detail/'+uni);
  126. }
  127. // 支付状态订单
  128. export function getPayOrder(uni){
  129. return request.get('order/status/'+uni);
  130. }
  131. /**
  132. * 再次下单
  133. * @param string uni
  134. *
  135. */
  136. export function orderAgain(data){
  137. return request.post('user/cart/again',data);
  138. }
  139. /**
  140. * 订单收货
  141. * @param string uni
  142. *
  143. */
  144. export function orderTake(uni){
  145. return request.post('order/take/'+uni);
  146. }
  147. /**
  148. * 订单查询物流信息
  149. * @returns {*}
  150. */
  151. export function express(id) {
  152. return request.post("order/express/" + id);
  153. }
  154. /**
  155. * 退款单查询物流信息
  156. * @returns {*}
  157. */
  158. export function refundOrderExpress(merId,id) {
  159. return request.get(`server/${merId}/refund/express/${id}`);
  160. }
  161. /**
  162. * 获取退款理由
  163. *
  164. */
  165. export function ordeRefundReason(){
  166. return request.get('order/refund/reason');
  167. }
  168. /**
  169. * 订单退款审核
  170. * @param object data
  171. */
  172. export function orderRefundVerify(data){
  173. return request.post('order/refund/verify',data);
  174. }
  175. /**
  176. * 订单确认获取订单详细信息
  177. * @param string cartId
  178. */
  179. export function orderConfirm(data){
  180. return request.post('order/check', data);
  181. }
  182. /**
  183. * 订单确认获取订单详细信息
  184. * @param string cartId
  185. */
  186. export function getOrderConfirm(data){
  187. return request.post('v2/order/check', data);
  188. }
  189. /**
  190. * 获取当前金额能使用的优惠卷
  191. * @param string price
  192. *
  193. */
  194. export function getCouponsOrderPrice(price, data){
  195. return request.get('coupons/order/' + price, data)
  196. }
  197. /**
  198. * 计算订单金额
  199. * @param key
  200. * @param data
  201. * @returns {*}
  202. */
  203. export function postOrderComputed(key, data) {
  204. return request.post("/order/computed/" + key, data);
  205. }
  206. // 生成订单
  207. export function orderCreate(data) {
  208. return request.post("order/create",data,{ noAuth : true });
  209. }
  210. // 新的生成订单
  211. export function createOrder(data) {
  212. return request.post("v2/order/create",data,{ noAuth : true });
  213. }
  214. // 未支付订单
  215. export function groupOrderList(data) {
  216. return request.get("order/group_order_list",data,{ noAuth : true });
  217. }
  218. // 批量退款列表
  219. export function refundBatch(id) {
  220. return request.get("refund/batch_product/"+id,{ noAuth : true });
  221. }
  222. // 退款商品
  223. export function refundProduct(id,data) {
  224. return request.get("refund/product/"+id,data,{ noAuth : true });
  225. }
  226. // 申请退款
  227. export function refundApply(id,data) {
  228. return request.post("refund/apply/"+id,data,{ noAuth : true });
  229. }
  230. // 退款理由
  231. export function refundMessage() {
  232. return request.get("common/refund_message",{ noAuth : true });
  233. }
  234. // 退款列表
  235. export function refundList(data) {
  236. return request.get("refund/list",data,{ noAuth : true });
  237. }
  238. // 退款详情
  239. export function refundDetail(id) {
  240. return request.get("refund/detail/"+id,{ noAuth : true });
  241. }
  242. // 物流列表
  243. export function expressList() {
  244. return request.get("common/express");
  245. }
  246. // 退回商品提交
  247. export function refundBackGoods(id,data) {
  248. return request.post("refund/back_goods/"+id,data,{ noAuth : true });
  249. }
  250. // 退款记录删除
  251. export function refundDel(id) {
  252. return request.post("refund/del/"+id,{ noAuth : true });
  253. }
  254. // 退款记录删除
  255. export function refundExpress(id) {
  256. return request.get("refund/express/"+id,{ noAuth : true });
  257. }
  258. // 核销二维码
  259. export function verifyCode(id) {
  260. return request.get("order/verify_code/"+id);
  261. }
  262. /**
  263. * 预售尾款支付
  264. * @param object data
  265. */
  266. export function presellOrderPay(id,data){
  267. return request.post('presell/pay/'+id,data);
  268. }
  269. /**
  270. * 发票订单
  271. * @param object data
  272. */
  273. export function receiptOrder(data){
  274. return request.get('user/receipt/order',data);
  275. }
  276. /**
  277. * 发票订单
  278. * @param object data
  279. */
  280. export function getReceiptOrder(id){
  281. return request.get('user/receipt/order/'+id);
  282. }
  283. /**
  284. * 发票订单
  285. * @param object data
  286. */
  287. export function getCallBackUrlApi(key){
  288. return request.get('common/pay_key/'+key, {},{ noAuth : true});
  289. }
  290. /**
  291. * 发票订单
  292. * @param object data
  293. */
  294. export function develiveryDetail(id){
  295. return request.get(`order/delivery/${id}`);
  296. }
  297. /**
  298. * 订单申请开票
  299. * @param object data
  300. */
  301. export function applyInvoiceApi(id, data){
  302. return request.post(`order/receipt/${id}`, data);
  303. }
  304. /**
  305. * 退款单取消申请
  306. * @param object data
  307. */
  308. export function refundCancelApi(id){
  309. return request.post(`refund/cancel/${id}`);
  310. }