product.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820
  1. import request from '@/plugins/request';
  2. /*
  3. * 获取商品表单头数量;
  4. * */
  5. export function getGoodHeade(data) {
  6. return request({
  7. url: 'product/product/type_header',
  8. method: 'get',
  9. params: data
  10. });
  11. }
  12. /*
  13. * 获取商品表单头数量;
  14. * */
  15. export function getGoodsCategory(data) {
  16. return request({
  17. url: '/goods/goods_category',
  18. method: 'get',
  19. params: data
  20. });
  21. }
  22. /**
  23. * @description 商品管理-- 列表
  24. */
  25. export function getGoods(params) {
  26. return request({
  27. url: 'product/product',
  28. method: 'get',
  29. params
  30. });
  31. }
  32. /**
  33. * @description 商品管理-- 上下架
  34. */
  35. export function PostgoodsIsShow(id, isShow) {
  36. return request({
  37. url: `product/product/set_show/${id}/${isShow}`,
  38. method: 'put'
  39. });
  40. }
  41. /**
  42. * @description 商品属性 -- 批量上下架
  43. * @param {Object} param data {Object} 传值对象
  44. */
  45. export function productShowApi(data) {
  46. return request({
  47. url: `product/product/product_show`,
  48. method: 'put',
  49. data
  50. });
  51. }
  52. /**
  53. * @description 商品属性 -- 批量下架
  54. * @param {Object} param data {Object} 传值对象
  55. */
  56. export function productUnshowApi(data) {
  57. return request({
  58. url: `product/product/product_unshow`,
  59. method: 'put',
  60. data
  61. });
  62. }
  63. /**
  64. * @description 商品列表 -- 批量添加配送方式
  65. * @param {Object} param data {Object} 传值对象
  66. */
  67. export function setDeliveryType(data) {
  68. return request({
  69. url: `product/product/setDeliveryType`,
  70. method: 'put',
  71. data
  72. });
  73. }
  74. /**
  75. * @description 商品管理-- 审核
  76. */
  77. export function productReviewApi(id) {
  78. return request({
  79. url: `/product/product/verify/${id}`,
  80. method: 'get'
  81. });
  82. }
  83. /**
  84. * @description 商品管理-- 强制下架
  85. */
  86. export function forcedRemovalApi(id) {
  87. return request({
  88. url: `/product/product/remove/${id}`,
  89. method: 'get'
  90. });
  91. }
  92. /**
  93. * @description 商品管理-- 分类
  94. */
  95. export function treeListApi(type) {
  96. return request({
  97. url: `product/category/tree/${type}`,
  98. method: 'get'
  99. });
  100. }
  101. /**
  102. * @description 商品管理-- 详情
  103. */
  104. export function productInfoApi(id) {
  105. return request({
  106. url: `product/product/${id}`,
  107. method: 'get'
  108. });
  109. }
  110. /**
  111. * @description 商品管理-- 提交
  112. */
  113. export function productAddApi(data) {
  114. return request({
  115. url: `product/product/${data.id}`,
  116. method: 'POST',
  117. data
  118. });
  119. }
  120. /**
  121. * @description 商品分类 -- 列表
  122. * @param {Object} param params {Object} 传值参数
  123. */
  124. export function productListApi(params) {
  125. return request({
  126. url: 'product/category',
  127. method: 'get',
  128. params
  129. });
  130. }
  131. /**
  132. * @description 商品分类 -- 添加表单
  133. * @param {Object} param params {Object} 传值参数
  134. */
  135. export function productCreateApi() {
  136. return request({
  137. url: 'product/category/create',
  138. method: 'get'
  139. });
  140. }
  141. /**
  142. * @description 商品分类 -- 编辑表单
  143. * @param {Object} param params {Object} 传值参数
  144. */
  145. export function productEditApi(id) {
  146. return request({
  147. url: `product/category/${id}`,
  148. method: 'get'
  149. });
  150. }
  151. /**
  152. * @description 商品分类 -- 修改状态
  153. * @param {Object} param params {Object} 传值参数
  154. */
  155. export function setShowApi(data) {
  156. return request({
  157. url: `product/category/set_show/${data.id}/${data.is_show}`,
  158. method: 'PUT'
  159. });
  160. }
  161. /**
  162. * @description 选择商品 -- 列表
  163. */
  164. export function changeListApi(params) {
  165. return request({
  166. url: `product/product/list`,
  167. method: 'GET',
  168. params
  169. });
  170. }
  171. /**
  172. * @description 选择商品 -- 列表-标签
  173. */
  174. export function allLabelApi(params) {
  175. return request({
  176. url: `product/all_label`,
  177. method: 'get',
  178. params
  179. });
  180. }
  181. /**
  182. * @description 商品评论 -- 列表
  183. * @param {Object} param params {Object} 传值参数
  184. */
  185. export function replyListApi(params) {
  186. return request({
  187. url: `product/reply`,
  188. method: 'get',
  189. params
  190. });
  191. }
  192. /**
  193. * @description 商品评论 -- 回复
  194. * @param {Object} param data {Object} 传值参数
  195. */
  196. export function setReplyApi(data, id) {
  197. return request({
  198. url: `product/reply/set_reply/${id}`,
  199. method: 'PUT',
  200. data
  201. });
  202. }
  203. /**
  204. * @description 获取复制商品配置
  205. */
  206. export function copyConfigApi() {
  207. return request({
  208. url: `product/copy_config`,
  209. method: 'get'
  210. })
  211. }
  212. /**
  213. * @description 商品管理 -- 获取京东、淘宝商品数据
  214. * @param {Object} param data {Object} 传值参数
  215. */
  216. export function crawlFromApi(data) {
  217. return request({
  218. url: `product/copy`,
  219. method: 'POST',
  220. data
  221. });
  222. }
  223. /**
  224. * @description 商品管理 -- 京东、淘宝商品数据提交
  225. * @param {Object} param data {Object} 传值参数
  226. */
  227. export function crawlSaveApi(data) {
  228. return request({
  229. url: `product/crawl/save`,
  230. method: 'POST',
  231. data
  232. });
  233. }
  234. /**
  235. * @description 商品管理 -- 生成属性
  236. * @param {Object} param data {Object} 传值参数
  237. */
  238. export function generateAttrApi(data, id, type) {
  239. return request({
  240. url: `product/generate_attr/${id}/${type}`,
  241. method: 'POST',
  242. data
  243. });
  244. }
  245. /**
  246. * @description 商品属性 -- 列表
  247. * @param {Object} param params {Object} 传值参数
  248. */
  249. export function ruleListApi(params) {
  250. return request({
  251. url: `product/product/rule`,
  252. method: 'GET',
  253. params
  254. });
  255. }
  256. /**
  257. * @description 商品属性 -- 添加
  258. * @param {Number} param id {Number} 属性id
  259. * @param {Object} param data {Object} 传值参数
  260. */
  261. export function ruleAddApi(data, id) {
  262. return request({
  263. url: `product/product/rule/${id}`,
  264. method: 'POST',
  265. data
  266. });
  267. }
  268. /**
  269. * @description 商品属性 -- 详情
  270. * @param {Number} param id {Number} 属性id
  271. */
  272. export function ruleInfoApi(id) {
  273. return request({
  274. url: `product/product/rule/${id}`,
  275. method: 'get'
  276. });
  277. }
  278. /**
  279. * @description 商品评价 -- 虚拟评价
  280. * @id--产品id;
  281. */
  282. export function fictitiousReply(id) {
  283. return request({
  284. url: `product/reply/fictitious_reply/${id}`,
  285. method: 'get'
  286. });
  287. }
  288. /**
  289. * @description 商品属性 -- 获取规则属性模板
  290. */
  291. export function productGetRuleApi() {
  292. return request({
  293. url: `product/product/get_rule`,
  294. method: 'get'
  295. });
  296. }
  297. /**
  298. * @description 商品 -- 获取运费模板
  299. */
  300. export function productGetTemplateApi(data) {
  301. return request({
  302. url: `product/product/get_template`,
  303. method: 'get',
  304. params: data
  305. });
  306. }
  307. /**
  308. * @description 获取上传参数
  309. */
  310. export function productGetTempKeysApi(data) {
  311. return request({
  312. url: `product/product/get_temp_keys`,
  313. method: 'get',
  314. params: data,
  315. });
  316. }
  317. /**
  318. * @description 商铺产品 -- 导出
  319. */
  320. export function storeProductApi(data) {
  321. return request({
  322. url: `export/storeProduct`,
  323. method: 'get',
  324. params: data
  325. });
  326. }
  327. /**
  328. * @description 添加商品 -- 检测活动存在
  329. */
  330. export function checkActivityApi(id) {
  331. return request({
  332. url: `product/product/check_activity/${id}`,
  333. method: 'get'
  334. });
  335. }
  336. /**
  337. * @description 商品添加编辑-- 用户标签
  338. */
  339. export function labelListApi() {
  340. return request({
  341. url: 'user/user_label',
  342. method: 'get'
  343. });
  344. }
  345. /**
  346. * @description 商品分类-- cascader
  347. */
  348. export function cascaderListApi(type) {
  349. return request({
  350. url: `product/category/cascader_list/${type}`,
  351. method: 'get'
  352. });
  353. }
  354. /**
  355. * @description 商品管理-- 临时保存
  356. */
  357. export function productCache() {
  358. return request({
  359. url: 'product/cache',
  360. method: 'get'
  361. });
  362. }
  363. /**
  364. * @description 商品管理-- 取消临时保存
  365. */
  366. export function cacheDelete() {
  367. return request({
  368. url: 'product/cache',
  369. method: 'delete'
  370. });
  371. }
  372. /**
  373. * @description 商品管理-- 取消临时保存
  374. */
  375. export function getProductAttr(id) {
  376. return request({
  377. url: 'product/product/get_attr/' + id,
  378. method: 'get'
  379. });
  380. }
  381. /**
  382. * @description 商品管理-- 关联用户标签
  383. */
  384. export function productUserLabel() {
  385. return request({
  386. url: 'product/user_label',
  387. method: 'get'
  388. });
  389. }
  390. /**
  391. * @description 添加商品-- 商品标签
  392. */
  393. export function productStoreLabel() {
  394. return request({
  395. url: 'product/product_label',
  396. method: 'get'
  397. });
  398. }
  399. /**
  400. * @description 添加商品-- 商品标签
  401. */
  402. export function productAllEnsure() {
  403. return request({
  404. url: 'product/all_ensure',
  405. method: 'get'
  406. });
  407. }
  408. /**
  409. * @description 添加商品-- 添加商品标签
  410. */
  411. export function productLabelAdd() {
  412. return request({
  413. url: 'product/label/form',
  414. method: 'get'
  415. });
  416. }
  417. /**
  418. * @description 添加商品-- 添加商品参数
  419. */
  420. export function productAllSpecs() {
  421. return request({
  422. url: 'product/all_specs',
  423. method: 'get'
  424. });
  425. }
  426. /**
  427. * @description 商品管理-- 添加品牌-获取上级分类
  428. */
  429. export function brandCascader() {
  430. return request({
  431. url: 'product/brand/cascader_list',
  432. method: 'get'
  433. });
  434. }
  435. /**
  436. * @description 商品管理-- 提交添加品牌
  437. */
  438. export function productBrand(data) {
  439. return request({
  440. url: 'product/brand',
  441. method: 'POST',
  442. data
  443. });
  444. }
  445. /**
  446. * @description 商品管理-- 提交添加品牌
  447. */
  448. export function productBrandlist(data) {
  449. return request({
  450. url: 'product/brand',
  451. method: 'get',
  452. params: data
  453. });
  454. }
  455. /**
  456. * @description 商品管理-- 提交编辑品牌
  457. */
  458. export function productBrandrev(id,data) {
  459. return request({
  460. url: `product/brand/${id}`,
  461. method: 'put',
  462. data
  463. });
  464. }
  465. /**
  466. * @description 商品管理-- 修改品牌状态
  467. */
  468. export function productBrandShow(id,show) {
  469. return request({
  470. url: `product/brand/set_show/${id}/${show}`,
  471. method: 'put'
  472. });
  473. }
  474. /**
  475. * @description 商品管理-- 添加商品品牌列表
  476. */
  477. export function brandList() {
  478. return request({
  479. url: `product/brand/cascader_list/2`,
  480. method: 'get'
  481. });
  482. }
  483. /**
  484. *商品列表-获取商品规格
  485. */
  486. export function productAttrsApi(id) {
  487. return request({
  488. url: `product/product/attrs/${id}`,
  489. method: 'get'
  490. });
  491. }
  492. /**
  493. *商品列表-提交商品规格库存
  494. */
  495. export function productSaveStocksApi(data,id) {
  496. return request({
  497. url: `product/product/saveStocks/${id}`,
  498. method: 'PUT',
  499. data
  500. });
  501. }
  502. /**
  503. *添加商品-获取所有商品单位列表
  504. */
  505. export function productAllUnit(id) {
  506. return request({
  507. url: `product/get_all_unit`,
  508. method: 'get'
  509. });
  510. }
  511. /**
  512. *添加商品-商品单位添加表单
  513. */
  514. export function productUnitCreate(id) {
  515. return request({
  516. url: `product/unit/create`,
  517. method: 'get'
  518. });
  519. }
  520. /**
  521. * @description 商品添加编辑-- 获取上传视频类型
  522. */
  523. export function uploadType () {
  524. return request({
  525. url: 'file/upload_type',
  526. method: 'get'
  527. })
  528. }
  529. /**
  530. * @description 商品添加编辑-- 商品单位列表
  531. */
  532. export function productUnit (data) {
  533. return request({
  534. url: 'product/unit',
  535. method: 'get',
  536. params: data
  537. })
  538. }
  539. /**
  540. * @description 商品添加编辑-- 编辑单位
  541. */
  542. export function productUnitEdit(id) {
  543. return request({
  544. url: `product/unit/${id}/edit`,
  545. method: 'get'
  546. })
  547. }
  548. /**
  549. * @description 商品添加编辑-- 倒入卡密
  550. */
  551. export function importCard (data) {
  552. return request({
  553. url: 'product/product/import_card',
  554. method: 'get',
  555. params: data
  556. })
  557. }
  558. /**
  559. * @description 商品添加编辑-- 下载卡密
  560. */
  561. export function exportProductCard (data) {
  562. return request({
  563. url: 'export/storeProductCardTemplate',
  564. method: 'get'
  565. })
  566. }
  567. /**
  568. * @description 商品标签组-- 添加
  569. */
  570. export function labelCateCreate () {
  571. return request({
  572. url: 'product/label_cate/create',
  573. method: 'get'
  574. })
  575. }
  576. /**
  577. * @description 商品标签组-- 列表
  578. */
  579. export function productLabelCate (data) {
  580. return request({
  581. url: 'product/label_cate',
  582. method: 'get',
  583. params: data
  584. })
  585. }
  586. /**
  587. * @description 商品标签组-- 编辑
  588. */
  589. export function productLabelEdit(id) {
  590. return request({
  591. url: `product/label_cate/${id}/edit`,
  592. method: 'get'
  593. })
  594. }
  595. /**
  596. * @description 商品标签-- 保存标签
  597. */
  598. export function productLabel(data) {
  599. return request({
  600. url: `product/label/${data.id}`,
  601. method: 'post',
  602. data
  603. })
  604. }
  605. /**
  606. * @description 商品服务保障- 添加
  607. */
  608. export function productEnsureCreate() {
  609. return request({
  610. url: `product/ensure/create`,
  611. method: 'get',
  612. })
  613. }
  614. /**
  615. * @description 商品保障服务-- 列表
  616. */
  617. export function productEnsure (data) {
  618. return request({
  619. url: 'product/ensure',
  620. method: 'get',
  621. params: data
  622. })
  623. }
  624. /**
  625. * @description 商品保障服务-- 编辑
  626. */
  627. export function productEnsureEdit(id) {
  628. return request({
  629. url: `product/ensure/${id}/edit`,
  630. method: 'get'
  631. })
  632. }
  633. /**
  634. * @description 商品保障服务--是否显示
  635. */
  636. export function ensureSetShow(data) {
  637. return request({
  638. url: `product/ensure/set_show/${data.id}/${data.is_show}`,
  639. method: 'put'
  640. })
  641. }
  642. /**
  643. * @description 商品参数-- 编辑
  644. */
  645. export function productSpecs(data) {
  646. return request({
  647. url: `product/specs/${data.id}`,
  648. method: 'post',
  649. data
  650. })
  651. }
  652. /**
  653. * @description 商品参数-- 列表
  654. */
  655. export function productSpecsList (data) {
  656. return request({
  657. url: 'product/specs',
  658. method: 'get',
  659. params: data
  660. })
  661. }
  662. /**
  663. * @description 商品参数-- 获取单个商品参数模版信息
  664. */
  665. export function productSpecsInfo (id) {
  666. return request({
  667. url: `product/specs/${id}`,
  668. method: 'get'
  669. })
  670. }
  671. /**
  672. * @description 商品评价-- 回复评价列表
  673. */
  674. export function productReplycomment (data,id) {
  675. return request({
  676. url: `product/reply/comment/${id}`,
  677. method: 'get',
  678. params: data
  679. })
  680. }
  681. /**
  682. * @description 商品评价-- 保存管理员回复
  683. */
  684. export function productReplySave (data,replyId,id) {
  685. return request({
  686. url: `product/reply/save_comment/${replyId}/${id}`,
  687. method: 'post',
  688. data:data
  689. })
  690. }
  691. /**
  692. * @description 保存云端视频附件记录
  693. * @param {String} param ids {String}
  694. */
  695. export function videoAttachment (data) {
  696. return request({
  697. url: 'file/video_attachment',
  698. method: 'post',
  699. data
  700. });
  701. }
  702. /**
  703. * 添加虚拟评论
  704. * @param {*} data
  705. * @returns
  706. */
  707. export function saveFictitiousReply(data) {
  708. return request({
  709. url: 'product/reply/save_fictitious_reply',
  710. method: 'post',
  711. data
  712. });
  713. }
  714. /**
  715. * 商品批量操作
  716. * @param {*} data
  717. * @returns
  718. */
  719. export function batchProcess(data) {
  720. return request({
  721. url: 'product/batch_process',
  722. method: 'post',
  723. data
  724. });
  725. }
  726. /**
  727. * diy系统表单列表(全部)
  728. * @param {*} type
  729. * @returns
  730. */
  731. export function allSystemForm() {
  732. return request({
  733. url: `/system/form/all_system_form`,
  734. method: 'get'
  735. });
  736. }
  737. export function productBindLevel(data) {
  738. return request({
  739. url: `/product/product/bind`,
  740. method: 'post',
  741. data,
  742. });
  743. }