order.js 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  1. // +----------------------------------------------------------------------
  2. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  3. // +----------------------------------------------------------------------
  4. // | Copyright (c) 2016~2021 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(numType,storeId) {
  16. return request.get("cart/count", {
  17. numType: numType === undefined ? 0 : numType,
  18. store_id:storeId
  19. });
  20. }
  21. /**
  22. * 获取购物车列表
  23. *
  24. */
  25. export function getCartList(data) {
  26. return request.get("cart/list", data);
  27. }
  28. /**
  29. * 购物车计算
  30. *
  31. */
  32. export function cartCompute(data) {
  33. return request.post("cart/compute", data);
  34. }
  35. /**
  36. * 修改购物车
  37. *
  38. */
  39. export function getResetCart(data) {
  40. return request.post("v2/reset_cart", data);
  41. }
  42. /**
  43. * 修改购物车数量
  44. * @param int cartId 购物车id
  45. * @param int number 修改数量
  46. */
  47. export function changeCartNum(cartId, number) {
  48. return request.post("cart/num", {
  49. id: cartId,
  50. number: number
  51. });
  52. }
  53. /**
  54. * 清除购物车
  55. * @param object ids join(',') 切割成字符串
  56. */
  57. export function cartDel(ids,storeId) {
  58. if (typeof ids === 'object')
  59. ids = ids.join(',');
  60. return request.post('cart/del', {
  61. ids: ids,
  62. store_id: storeId
  63. });
  64. }
  65. /**
  66. * 订单列表
  67. * @param object data
  68. */
  69. export function getOrderList(data) {
  70. return request.get('order/list', data);
  71. }
  72. /**
  73. * 新订单列表 2.1版本
  74. * @param object data
  75. */
  76. export function getNewOrderList(data) {
  77. return request.get('order/refund/list', data);
  78. }
  79. /**
  80. * 订单产品信息
  81. * @param string unique
  82. */
  83. export function orderProduct(unique) {
  84. return request.post('order/product', {
  85. unique: unique
  86. });
  87. }
  88. /**
  89. * 订单评价
  90. * @param object data
  91. *
  92. */
  93. export function orderComment(data) {
  94. return request.post('order/comment', data);
  95. }
  96. /**
  97. * 订单支付
  98. * @param object data
  99. */
  100. export function orderPay(data) {
  101. return request.post('order/pay', data);
  102. }
  103. /**
  104. * 订单统计数据
  105. */
  106. export function orderData() {
  107. return request.get('order/data')
  108. }
  109. /**
  110. * 订单取消
  111. * @param string id
  112. *
  113. */
  114. export function orderCancel(id) {
  115. return request.post('order/cancel', {
  116. id: id
  117. });
  118. }
  119. /**
  120. * 删除已完成订单
  121. * @param string uni
  122. *
  123. */
  124. export function orderDel(uni) {
  125. return request.post('order/del', {
  126. uni: uni
  127. });
  128. }
  129. /**
  130. * 删除已退款和拒绝退款的订单
  131. * @param string uni
  132. *
  133. */
  134. export function refundOrderDel(uni) {
  135. return request.get('order/refund/del/' + uni, {});
  136. }
  137. /**
  138. * 订单详情
  139. * @param string uni
  140. */
  141. export function getOrderDetail(uni) {
  142. return request.get('order/detail/' + uni);
  143. }
  144. /**
  145. * 退款订单详情
  146. * @param string uni
  147. */
  148. export function getRefundOrderDetail(uni) {
  149. return request.get('order/refund/detail/' + uni);
  150. }
  151. /**
  152. * 放弃申请退款
  153. * @param string uni
  154. */
  155. export function cancelRefundOrder(uni) {
  156. return request.post('order/refund/cancel/' + uni);
  157. }
  158. /**
  159. * 再次下单
  160. * @param string uni
  161. *
  162. */
  163. export function orderAgain(uni) {
  164. return request.post('order/again', {
  165. uni: uni
  166. });
  167. }
  168. /**
  169. * 订单收货
  170. * @param string uni
  171. *
  172. */
  173. export function orderTake(uni) {
  174. return request.post('order/take', {
  175. uni: uni
  176. });
  177. }
  178. /**
  179. * 订单查询物流信息
  180. * @returns {*}
  181. */
  182. export function express(uni, type) {
  183. return request.get("order/express/" + uni + (type ? '/' + type : ''));
  184. }
  185. /**
  186. * 获取退款理由
  187. *
  188. */
  189. export function ordeRefundReason() {
  190. return request.get('order/refund/reason');
  191. }
  192. /**
  193. * 订单退款审核
  194. * @param object data
  195. */
  196. export function orderRefundVerify(data) {
  197. return request.post('order/refund/verify', data);
  198. }
  199. /**
  200. * 订单确认获取订单详细信息
  201. * @param string cartId
  202. */
  203. export function orderConfirm(cartId, news, addressId, shippingType, store_id, couponId, luckRecordId) {
  204. return request.post('order/confirm', {
  205. cartId,
  206. 'new': news,
  207. addressId,
  208. 'shipping_type': shippingType,
  209. store_id,
  210. 'couponId':couponId,
  211. luckRecordId
  212. });
  213. }
  214. /**
  215. * 获取当前金额能使用的优惠卷
  216. * @param string price
  217. *
  218. */
  219. export function getCouponsServeOrderPrice(price, data) {
  220. return request.post('coupons/subscribe_coupon_list/' + price, data)
  221. }
  222. /**
  223. * 获取当前金额服务卡能使用的优惠卷
  224. * @param string price
  225. *
  226. */
  227. export function getCouponsOrderPrice(price, data) {
  228. return request.get('coupons/order/' + price, data)
  229. }
  230. /**
  231. * 订单创建
  232. * @param string key
  233. * @param object data
  234. *
  235. */
  236. export function orderCreate(key, data) {
  237. return request.post('order/create/' + key, data);
  238. }
  239. /**
  240. * 计算订单金额
  241. * @param key
  242. * @param data
  243. * @returns {*}
  244. */
  245. export function postOrderComputed(key, data) {
  246. return request.post("order/computed/" + key, data);
  247. }
  248. /**
  249. * 订单优惠券
  250. * @param key
  251. * @param data
  252. * @returns {*}
  253. */
  254. export function orderCoupon(orderId) {
  255. return request.post("v2/order/product_coupon/" + orderId);
  256. }
  257. /**
  258. * 计算会员线下付款金额
  259. * @param {Object} data
  260. */
  261. export function offlineCheckPrice(data) {
  262. return request.post("order/offline/check/price", data);
  263. }
  264. /**
  265. * 线下扫码付款
  266. * @param {Object} data
  267. */
  268. export function offlineCreate(data) {
  269. return request.post("order/offline/create", data);
  270. }
  271. /**
  272. * 支付方式开关
  273. */
  274. export function orderOfflinePayType() {
  275. return request.get('order/offline/pay/type');
  276. }
  277. /**
  278. * 开票记录
  279. */
  280. export function orderInvoiceList(data) {
  281. return request.get('v2/order/invoice_list', data);
  282. }
  283. /**
  284. * 开票订单详情
  285. * @param {Object} id
  286. */
  287. export function orderInvoiceDetail(id) {
  288. return request.get(`v2/order/invoice_detail/${id}`);
  289. }
  290. /**
  291. * 支付宝支付
  292. * @param {Object} key
  293. * @param {Object} quitUrl
  294. */
  295. export function aliPay(key, quitUrl) {
  296. return request.get('ali_pay', {
  297. key,
  298. quitUrl
  299. }, {
  300. noAuth: true
  301. });
  302. }
  303. /**
  304. * 退货物流单号提交
  305. * @param {Object} data
  306. */
  307. export function refundExpress(data) {
  308. return request.post("order/refund/express", data);
  309. }
  310. /**
  311. * 分类购物车列表
  312. */
  313. export function vcartList(data) {
  314. return request.get("v2/cart_list",data);
  315. }
  316. /**
  317. * 支付订单
  318. */
  319. export function payCashier(storeId) {
  320. return request.get(`order/pay_cashier?store_id=${storeId}`);
  321. }
  322. /**
  323. * 退款商品列表
  324. */
  325. export function refundGoodsList(orderId) {
  326. return request.get(`order/refund/cart_info/${orderId}`);
  327. }
  328. /**
  329. * 申请退款商品列表
  330. */
  331. export function postRefundGoods(data) {
  332. return request.post(`order/refund/cart_info`, data);
  333. }
  334. /**
  335. * 退款商品提交
  336. */
  337. export function returnGoodsSubmit(id, data) {
  338. return request.post(`order/refund/apply/${id}`, data);
  339. }
  340. /**
  341. * 确认订单详情(是否显示快递配送)
  342. */
  343. export function checkShipping(data) {
  344. return request.post(`order/check_shipping`, data);
  345. }
  346. /**
  347. * 配送订单详情
  348. */
  349. export function deliveryDetail(id) {
  350. return request.get(`delivery_order/detail/${id}`);
  351. }
  352. /**
  353. * 订单核销记录
  354. * @param {Object} id
  355. */
  356. export function orderWriteRecords(id, data) {
  357. return request.get(`order/write/records/${id}`, data);
  358. }
  359. //计算服务项目
  360. export function computedServe(data) {
  361. return request.get(`v2/Subscribe/cart`, data);
  362. }
  363. //创建服务项目
  364. export function SubscribeCreate(data) {
  365. return request.post(`v2/Subscribe/create`, data);
  366. }
  367. // 服务项目退款申请
  368. export function storecompleteSubscribe(data) {
  369. return request.post(`store/order/complete_subscribe`, data);
  370. }
  371. //提交退款申请
  372. export function SqRefund(data) {
  373. return request.post(`v2/Subscribe/refund_order`, data);
  374. }
  375. //打赏
  376. export function ds(data) {
  377. return request.post(`reward/create`, data);
  378. }
  379. //投诉
  380. export function ts(data) {
  381. return request.post(`complaint/create`, data);
  382. }