marketing.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867
  1. // +----------------------------------------------------------------------
  2. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  3. // +----------------------------------------------------------------------
  4. // | Copyright (c) 2016~2023 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 '@/libs/request';
  11. /**
  12. * @description 优惠券制作--列表
  13. * @param {Object} param params {Object} 传值参数
  14. */
  15. export function couponListApi(params) {
  16. return request({
  17. url: 'marketing/coupon/list',
  18. method: 'get',
  19. params,
  20. });
  21. }
  22. /**
  23. * @description 优惠券制作--新增表单
  24. * type:添加优惠券类型0:通用,1:品类,2:商品
  25. */
  26. export function couponCreateApi(type) {
  27. return request({
  28. url: `marketing/coupon/create/${type}`,
  29. method: 'get',
  30. });
  31. }
  32. /**
  33. * @description 优惠券制作--编辑表单
  34. */
  35. export function couponEditeApi(id) {
  36. return request({
  37. url: `marketing/coupon/${id}/edit`,
  38. method: 'get',
  39. });
  40. }
  41. /**
  42. * @description 优惠券制作--发布优惠券表单
  43. * @param {Number} param id {Number} 优惠券id
  44. */
  45. export function couponSendApi(id) {
  46. return request({
  47. url: `marketing/coupon/issue/${id}`,
  48. method: 'get',
  49. });
  50. }
  51. /**
  52. * @description 已发布管理--列表
  53. * @param {Object} param params {Object} 传值参数
  54. */
  55. export function releasedListApi(params) {
  56. return request({
  57. url: 'marketing/coupon/released',
  58. method: 'get',
  59. params,
  60. });
  61. }
  62. /**
  63. * @description 已发布管理--领取记录
  64. * @param {Number} param id {Number} 已发布优惠券id
  65. */
  66. export function releasedissueLogApi(id, params) {
  67. return request({
  68. url: `marketing/coupon/released/issue_log/${id}`,
  69. method: 'get',
  70. params,
  71. });
  72. }
  73. /**
  74. * @description 已发布管理--修改状态表单
  75. * @param {Number} param id {Number} 已发布优惠券id
  76. */
  77. export function releaseStatusApi(id) {
  78. return request({
  79. url: `marketing/coupon/released/${id}/status`,
  80. method: 'get',
  81. });
  82. }
  83. /**
  84. * @description 优惠券列表--是否开启
  85. * @param {*} data
  86. */
  87. export function couponStatusApi(data) {
  88. return request({
  89. url: `marketing/coupon/status/${data.id}/${data.status}`,
  90. method: 'get',
  91. });
  92. }
  93. /**
  94. * @description 优惠券制作--品类
  95. * @param {*} type 默认 1
  96. */
  97. export function couponCategoryApi(type) {
  98. return request({
  99. url: `product/category/tree/${type}`,
  100. method: 'get',
  101. });
  102. }
  103. /**
  104. * @description 优惠券制作--保存
  105. */
  106. export function couponSaveApi(data) {
  107. return request({
  108. url: `marketing/coupon/save_coupon`,
  109. method: 'post',
  110. data,
  111. });
  112. }
  113. /**
  114. * @description 优惠券
  115. * @param {*} id
  116. */
  117. export function couponDetailApi(id) {
  118. return request({
  119. url: `marketing/coupon/copy/${id}`,
  120. method: 'get',
  121. });
  122. }
  123. /**
  124. * @description 会员领取记录 -- 列表
  125. * @param {Object} param params {Object} 传值参数
  126. */
  127. export function userListApi(params) {
  128. return request({
  129. url: `/marketing/coupon/user`,
  130. method: 'get',
  131. params,
  132. });
  133. }
  134. /**
  135. * @description 砍价商品 -- 列表
  136. * @param {Object} param params {Object} 传值参数
  137. */
  138. export function bargainListApi(params) {
  139. return request({
  140. url: `marketing/bargain`,
  141. method: 'get',
  142. params,
  143. });
  144. }
  145. /**
  146. * @description 砍价商品 -- 详情
  147. * @param {Number} param id {Number} 砍价商品id
  148. */
  149. export function bargainInfoApi(id) {
  150. return request({
  151. url: `marketing/bargain/${id}`,
  152. method: 'get',
  153. });
  154. }
  155. /**
  156. * @description 砍价商品 -- 保存编辑
  157. * @param {Object} param data {Object} 传值参数
  158. */
  159. export function bargainCreatApi(data) {
  160. return request({
  161. url: `marketing/bargain/${data.id}`,
  162. method: 'POST',
  163. data,
  164. });
  165. }
  166. /**
  167. * @description 砍价商品 -- 修改状态
  168. * @param {Object} param data {Object} 传值参数
  169. */
  170. export function bargainSetStatusApi(data) {
  171. return request({
  172. url: `marketing/bargain/set_status/${data.id}/${data.status}`,
  173. method: 'PUT',
  174. });
  175. }
  176. /**
  177. * @description 预售商品 -- 修改状态
  178. * @param {Object} param data {Object} 传值参数
  179. */
  180. export function advanceSetStatusApi(data) {
  181. return request({
  182. url: `marketing/advance/set_status/${data.id}/${data.status}`,
  183. method: 'PUT',
  184. });
  185. }
  186. /**
  187. * @description 预售商品 -- 列表
  188. * @param {Object} param params {Object} 传值参数
  189. */
  190. export function presellListApi(params) {
  191. return request({
  192. url: `marketing/advance/index`,
  193. method: 'get',
  194. params,
  195. });
  196. }
  197. /**
  198. * @description 预售商品 -- 保存编辑
  199. * @param {Object} param data {Object} 传值参数
  200. */
  201. export function presellCreatApi(data) {
  202. return request({
  203. url: `marketing/advance/save/${data.id}`,
  204. method: 'POST',
  205. data,
  206. });
  207. }
  208. /**
  209. * @description 预售商品 -- 详情
  210. * @param {Number} param id {Number} 拼团商品id
  211. */
  212. export function presellInfoApi(id) {
  213. return request({
  214. url: `marketing/advance/info/${id}`,
  215. method: 'get',
  216. });
  217. }
  218. /**
  219. * @description 拼团商品 -- 列表
  220. * @param {Object} param data {Object} 传值参数
  221. */
  222. export function combinationListApi(params) {
  223. return request({
  224. url: `marketing/combination`,
  225. method: 'get',
  226. params,
  227. });
  228. }
  229. /**
  230. * @description 拼团商品 -- 修改状态
  231. * @param {Object} param data {Object} 传值参数
  232. */
  233. export function combinationSetStatusApi(data) {
  234. return request({
  235. url: `marketing/combination/set_status/${data.id}/${data.status}`,
  236. method: 'PUT',
  237. });
  238. }
  239. /**
  240. * @description 拼团商品 -- 拼团统计
  241. * @param {Object} param data {Object} 传值参数
  242. */
  243. export function statisticsApi() {
  244. return request({
  245. url: `marketing/combination/statistics`,
  246. method: 'GET',
  247. });
  248. }
  249. /**
  250. * @description 拼团商品 -- 详情
  251. * @param {Number} param id {Number} 拼团商品id
  252. */
  253. export function combinationInfoApi(id) {
  254. return request({
  255. url: `marketing/combination/${id}`,
  256. method: 'get',
  257. });
  258. }
  259. /**
  260. * @description 拼团商品 -- 保存编辑
  261. * @param {Object} param data {Object} 传值参数
  262. */
  263. export function combinationCreatApi(data) {
  264. return request({
  265. url: `marketing/combination/${data.id}`,
  266. method: 'POST',
  267. data,
  268. });
  269. }
  270. /**
  271. * @description 拼团商品 -- 拼团列表
  272. */
  273. export function combineListApi(params) {
  274. return request({
  275. url: `marketing/combination/combine/list`,
  276. method: 'GET',
  277. params,
  278. });
  279. }
  280. /**
  281. * @description 拼团商品 -- 拼团人列表
  282. * @param {Number} param id {Number} 拼团商品id
  283. */
  284. export function orderPinkListApi(id) {
  285. return request({
  286. url: `marketing/combination/order_pink/${id}`,
  287. method: 'GET',
  288. });
  289. }
  290. /**
  291. * @description 秒杀商品 -- 列表
  292. */
  293. export function seckillListApi(params) {
  294. return request({
  295. url: `marketing/seckill`,
  296. method: 'GET',
  297. params,
  298. });
  299. }
  300. /**
  301. * @description 秒杀商品 -- 详情
  302. */
  303. export function seckillInfoApi(id) {
  304. return request({
  305. url: `marketing/seckill/${id}`,
  306. method: 'GET',
  307. });
  308. }
  309. /**
  310. * @description 秒杀商品 -- 保存编辑
  311. */
  312. export function seckillAddApi(data) {
  313. return request({
  314. url: `marketing/seckill/${data.id}`,
  315. method: 'post',
  316. data,
  317. });
  318. }
  319. /**
  320. * @description 秒杀商品 -- 修改状态
  321. */
  322. export function seckillStatusApi(data) {
  323. return request({
  324. url: `marketing/seckill/set_status/${data.id}/${data.status}`,
  325. method: 'put',
  326. });
  327. }
  328. /**
  329. * @description 积分日志 -- 列表
  330. */
  331. export function integralListApi(params) {
  332. return request({
  333. url: `marketing/integral`,
  334. method: 'GET',
  335. params,
  336. });
  337. }
  338. /**
  339. * @description 积分日志 -- 头部
  340. */
  341. export function integralStatisticsApi(params) {
  342. return request({
  343. url: `marketing/integral/statistics`,
  344. method: 'GET',
  345. params,
  346. });
  347. }
  348. /**
  349. * @description 积分日志 -- 头部
  350. */
  351. export function seckillTimeListApi() {
  352. return request({
  353. url: `marketing/seckill/time_list`,
  354. method: 'GET',
  355. });
  356. }
  357. /**
  358. * @description 商品列表 -- 头部
  359. */
  360. export function productAttrsApi(id, type) {
  361. return request({
  362. url: `product/product/attrs/${id}/${type}`,
  363. method: 'GET',
  364. });
  365. }
  366. /**
  367. * @description 砍价商品 -- 列表
  368. * @param {Object} param params {Object} 传值参数
  369. */
  370. export function bargainUserListApi(params) {
  371. return request({
  372. url: `marketing/bargain_list`,
  373. method: 'get',
  374. params,
  375. });
  376. }
  377. /**
  378. * @description 砍价商品 -- 列表
  379. * @param {Object} param params {Object} 传值参数
  380. */
  381. export function bargainUserInfoApi(id) {
  382. return request({
  383. url: `marketing/bargain_list_info/${id}`,
  384. method: 'get',
  385. });
  386. }
  387. /**
  388. * @description 已发布管理 -- 删除
  389. */
  390. export function delCouponReleased(id) {
  391. return request({
  392. url: `marketing/coupon/released/${id}`,
  393. method: 'DELETE',
  394. });
  395. }
  396. /**
  397. * @description 积分日志 -- 导出
  398. */
  399. export function userPointApi(data) {
  400. return request({
  401. url: `export/userPoint`,
  402. method: 'get',
  403. params: data,
  404. });
  405. }
  406. /**
  407. * @description 商铺砍价活动 -- 导出
  408. */
  409. export function stroeBargainApi(data) {
  410. return request({
  411. url: `export/storeBargain`,
  412. method: 'get',
  413. params: data,
  414. });
  415. }
  416. /**
  417. * @description 商铺拼团 -- 导出
  418. */
  419. export function storeCombinationApi(data) {
  420. return request({
  421. url: `export/storeCombination`,
  422. method: 'get',
  423. params: data,
  424. });
  425. }
  426. /**
  427. * @description 商铺秒杀 -- 导出
  428. */
  429. export function storeSeckillApi(data) {
  430. return request({
  431. url: `export/storeSeckill`,
  432. method: 'get',
  433. params: data,
  434. });
  435. }
  436. /**
  437. * @description 积分商品 -- 列表
  438. */
  439. export function integralProductListApi(params) {
  440. return request({
  441. url: `marketing/integral_product`,
  442. method: 'GET',
  443. params,
  444. });
  445. }
  446. /**
  447. * @description 积分商品 -- 保存编辑
  448. */
  449. export function integralAddApi(data) {
  450. return request({
  451. url: `marketing/integral/${data.id}`,
  452. method: 'post',
  453. data,
  454. });
  455. }
  456. /**
  457. * @description 积分商品 -- (多个) 保存
  458. */
  459. export function integralAddBatch(data) {
  460. return request({
  461. url: `marketing/integral/batch`,
  462. method: 'post',
  463. data,
  464. });
  465. }
  466. /**
  467. * @description 积分商品 -- 详情
  468. */
  469. export function integralInfoApi(id) {
  470. return request({
  471. url: `marketing/integral/${id}`,
  472. method: 'GET',
  473. });
  474. }
  475. /**
  476. * @description 积分商品 -- 修改状态
  477. */
  478. export function integralIsShowApi(data) {
  479. return request({
  480. url: `marketing/integral/set_show/${data.id}/${data.is_show}`,
  481. method: 'put',
  482. });
  483. }
  484. /**
  485. * @description 积分订单管理--列表
  486. * @param {Object} param data {Object} 传值参数
  487. */
  488. export function integralOrderList(data) {
  489. return request({
  490. url: 'marketing/integral/order/list',
  491. method: 'get',
  492. params: data,
  493. });
  494. }
  495. /**
  496. * @description 积分订单数据--列表
  497. * @param {Object} param data {Object} 传值参数
  498. */
  499. export function integralGetOrdes(data) {
  500. return request({
  501. url: 'marketing/integral/order/chart',
  502. method: 'get',
  503. params: data,
  504. });
  505. }
  506. /**
  507. * @description 订单物流信息
  508. * @param {Number} param id {Number} 订单id
  509. */
  510. export function getExpress(id) {
  511. return request({
  512. url: `marketing/integral/order/express/${id}`,
  513. method: 'get',
  514. });
  515. }
  516. /**
  517. * @description 获取快递公司
  518. */
  519. export function getExpressData(status) {
  520. return request({
  521. url: `marketing/integral/order/express_list?status=` + status,
  522. method: 'get',
  523. });
  524. }
  525. /**
  526. * @description 订单表单详情数据
  527. * @param {Number} param id {Number} 订单id
  528. */
  529. export function getIntegralOrderDataInfo(id) {
  530. return request({
  531. url: `marketing/integral/order/info/${id}`,
  532. method: 'get',
  533. });
  534. }
  535. /**
  536. * @description 配送信息表单
  537. * @param {Number} param id {Number} 订单id
  538. */
  539. export function getIntegralOrderDistribution(id) {
  540. return request({
  541. url: `marketing/integral/order/distribution/${id}`,
  542. method: 'get',
  543. });
  544. }
  545. /**
  546. * @description 获取订单记录
  547. * @param {Number} param data.id {Number} 订单id
  548. * @param {String} param data.datas {String} 分页参数
  549. */
  550. export function getIntegralOrderRecord(data) {
  551. return request({
  552. url: `marketing/integral/order/status/${data.id}`,
  553. method: 'get',
  554. params: data.datas,
  555. });
  556. }
  557. /**
  558. * @description 发送货提交表单
  559. * @param {Number} param data.id {Number} 订单id
  560. * @param {Object} param data.datas {Object} 表单信息
  561. */
  562. export function integralOrderPutDelivery(data) {
  563. return request({
  564. url: `marketing/integral/order/delivery/${data.id}`,
  565. method: 'put',
  566. data: data.datas,
  567. });
  568. }
  569. /**
  570. * @description 修改备注信息
  571. * @param {Number} param data.id {Number} 订单id
  572. * @param {String} param data.remark {String} 备注信息
  573. */
  574. export function integralOrderPutRemarkData(data) {
  575. return request({
  576. url: `marketing/integral/order/remark/${data.id}`,
  577. method: 'put',
  578. data: data.remark,
  579. });
  580. }
  581. /**
  582. * @description 积分备注
  583. * @param {Number} param data.id {Number} 订单id
  584. * @param {String} param data.remark {String} 备注信息
  585. */
  586. export function setPointRecordMark(id, data) {
  587. return request({
  588. url: `marketing/point_record/remark/${id}`,
  589. method: 'post',
  590. data,
  591. });
  592. }
  593. /**
  594. * 订单时获取所有配送员列表
  595. */
  596. export function orderDeliveryList() {
  597. return request({
  598. url: 'marketing/integral/order/delivery/list',
  599. method: 'get',
  600. });
  601. }
  602. /**
  603. * 电子面单模板
  604. * @param {com} data 快递公司编号
  605. */
  606. export function orderExpressTemp(data) {
  607. return request({
  608. url: 'marketing/integral/order/express/temp',
  609. method: 'get',
  610. params: data,
  611. });
  612. }
  613. /**
  614. * 积分统计列表
  615. * @param {com} data
  616. */
  617. export function pointRecordList(data) {
  618. return request({
  619. url: 'marketing/point_record',
  620. method: 'get',
  621. params: data,
  622. });
  623. }
  624. /**
  625. * 积分统计列表 备注
  626. * @param {com} data
  627. */
  628. export function pointRecordRemark(id, data) {
  629. return request({
  630. url: `marketing/point_record/remark/${id}`,
  631. method: 'post',
  632. data,
  633. });
  634. }
  635. export function orderSheetInfo() {
  636. return request({
  637. url: 'marketing/integral/order/sheet_info',
  638. method: 'get',
  639. });
  640. }
  641. /**
  642. * 积分统计顶部
  643. * @param {com} data
  644. */
  645. export function getPointBasic(data) {
  646. return request({
  647. url: 'marketing/point/get_basic',
  648. method: 'get',
  649. params: data,
  650. });
  651. }
  652. /**
  653. * 积分统计 折线图
  654. * @param {com} data
  655. */
  656. export function getPointTrend(data) {
  657. return request({
  658. url: 'marketing/point/get_trend',
  659. method: 'get',
  660. params: data,
  661. });
  662. }
  663. /**
  664. * @description 积分来源分析
  665. * @param {Object} param data {Object} 传值参数
  666. */
  667. export function getChannel(params) {
  668. return request({
  669. url: '/marketing/point/get_channel',
  670. method: 'get',
  671. params,
  672. });
  673. }
  674. /**
  675. * @description 积分消耗分析
  676. * @param {Object} param data {Object} 传值参数
  677. */
  678. export function getType(params) {
  679. return request({
  680. url: '/marketing/point/get_type',
  681. method: 'get',
  682. params,
  683. });
  684. }
  685. /**
  686. * 秒杀统计
  687. * @param {*} id
  688. * @param {*} params
  689. * @returns
  690. */
  691. export function getseckillStatistics(id, params) {
  692. return request({
  693. url: `marketing/seckill/statistics/head/${id}`,
  694. method: 'get',
  695. params,
  696. });
  697. }
  698. /**
  699. * 秒杀参与人
  700. * @param {*} id
  701. * @param {*} params
  702. * @returns
  703. */
  704. export function getseckillStatisticsPeople(id, params) {
  705. return request({
  706. url: `marketing/seckill/statistics/people/${id}`,
  707. method: 'get',
  708. params,
  709. });
  710. }
  711. /**
  712. * 秒杀订单
  713. * @param {*} id
  714. * @param {*} params
  715. * @returns
  716. */
  717. export function getseckillStatisticsOrder(id, params) {
  718. return request({
  719. url: `marketing/seckill/statistics/order/${id}`,
  720. method: 'get',
  721. params,
  722. });
  723. }
  724. /**
  725. * 拼团统计
  726. * @param {*} id
  727. * @param {*} params
  728. * @returns
  729. */
  730. export function getcombinationStatistics(id, params) {
  731. return request({
  732. url: `marketing/combination/statistics/head/${id}`,
  733. method: 'get',
  734. params,
  735. });
  736. }
  737. /**
  738. * 拼团列表
  739. * @param {*} id
  740. * @param {*} params
  741. * @returns
  742. */
  743. export function getcombinationStatisticsPeople(id, params) {
  744. return request({
  745. url: `marketing/combination/statistics/list/${id}`,
  746. method: 'get',
  747. params,
  748. });
  749. }
  750. /**
  751. * 拼团订单
  752. * @param {*} id
  753. * @param {*} params
  754. * @returns
  755. */
  756. export function getcombinationStatisticsOrder(id, params) {
  757. return request({
  758. url: `marketing/combination/statistics/order/${id}`,
  759. method: 'get',
  760. params,
  761. });
  762. }
  763. /**
  764. * 砍价统计
  765. * @param {*} id
  766. * @param {*} params
  767. * @returns
  768. */
  769. export function getbargainStatistics(id, params) {
  770. return request({
  771. url: `marketing/bargain/statistics/head/${id}`,
  772. method: 'get',
  773. params,
  774. });
  775. }
  776. /**
  777. * 砍价列表
  778. * @param {*} id
  779. * @param {*} params
  780. * @returns
  781. */
  782. export function getbargainStatisticsPeople(id, params) {
  783. return request({
  784. url: `marketing/bargain/statistics/list/${id}`,
  785. method: 'get',
  786. params,
  787. });
  788. }
  789. /**
  790. * 砍价订单
  791. * @param {*} id
  792. * @param {*} params
  793. * @returns
  794. */
  795. export function getbargainStatisticsOrder(id, params) {
  796. return request({
  797. url: `marketing/bargain/statistics/order/${id}`,
  798. method: 'get',
  799. params,
  800. });
  801. }