product.js 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  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. */
  14. export function productLstApi(merId, data) {
  15. return request.get(`server/${merId}/product/lst`, data, { login: true });
  16. }
  17. /**
  18. * 商品列表 -- 删除
  19. */
  20. export function productDeleteApi(merId, id) {
  21. return request.post(`server/${merId}/product/delete/${id}`, {}, { login: true });
  22. }
  23. /**
  24. * 商品列表 -- 上下架
  25. */
  26. export function productOffApi(merId, id, data) {
  27. return request.post(`server/${merId}/product/status/${id}`, data, { login: true });
  28. }
  29. /*
  30. 售罄商品 -- 列表头部
  31. */
  32. export function productTitle(merId, data) {
  33. return request.get(`server/${merId}/product/title`, data, { login: true });
  34. }
  35. /*
  36. 回收站商品,彻底删除
  37. */
  38. export function productDestory(merId, id, data) {
  39. return request.post(`server/${merId}/product/destory/${id}`, data, { login: true });
  40. }
  41. /*
  42. 还原
  43. */
  44. export function productRestore(merId, id) {
  45. return request.post(`server/${merId}/product/restore/${id}`, {}, { login: true });
  46. }
  47. /*
  48. 添加或修改商品, 获取商品品牌
  49. */
  50. export function categoryBrandlist(merId) {
  51. return request.get(`server/${merId}/category/brandlist`, {}, { login: true });
  52. }
  53. /*
  54. 添加修改商品, 获取商户分类
  55. */
  56. export function categorySelect(merId) {
  57. return request.get(`server/${merId}/category/select`, {}, { login: true })
  58. }
  59. /*
  60. 添加修改商品, 获取平台分类
  61. */
  62. export function categoryList(merId) {
  63. return request.get(`server/${merId}/category/list`, {}, { login: true })
  64. }
  65. /*
  66. 商品管理, 添加商品
  67. */
  68. export function productCreate(merId, data) {
  69. return request.post(`server/${merId}/product/create`, data, { login: true })
  70. }
  71. /**
  72. * 商品列表 -- 设置推荐
  73. */
  74. export function productRecommendApi(merId, id, data) {
  75. return request.post(`server/${merId}/product/good/${id}`, data, { login: true });
  76. }
  77. /*
  78. 获取规格列表
  79. */
  80. export function attrList(merId, data) {
  81. return request.get(`server/${merId}/attr/lst`, data, { login: true })
  82. }
  83. /*
  84. 请求运费模板
  85. */
  86. export function templateList(merId, data) {
  87. return request.get(`server/${merId}/template/lst`, data, { login: true })
  88. }
  89. /*
  90. 运费模板 -- 删除
  91. */
  92. export function templateDelete(merId, data) {
  93. return request.post(`server/${merId}/template/delete`, data, { login: true })
  94. }
  95. /**
  96. * 运费模板 -- 详情
  97. */
  98. export function templateDetail(merId, id) {
  99. return request.get(`server/${merId}/template/detail/${id}`, {}, { login: true });
  100. }
  101. /*
  102. 运费模板 -- 添加
  103. */
  104. export function templateCreate(merId, data) {
  105. return request.post(`server/${merId}/template/create`, data, { login: true });
  106. }
  107. /*
  108. 运费模板 -- 编辑
  109. */
  110. export function templateUpdate(merId, id, data) {
  111. return request.post(`server/${merId}/template/update/${id}`, data, { login: true });
  112. }
  113. /**
  114. * 店铺分类 -- 列表
  115. */
  116. export function storeClassifyLst(merId) {
  117. return request.get(`server/${merId}/category/lst`, {}, { login: true });
  118. }
  119. /**
  120. * 店铺分类 -- 列表(删除)
  121. */
  122. export function storeClassifyDel(merId, id) {
  123. return request.post(`server/${merId}/category/delete/${id}`, {}, { login: true });
  124. }
  125. /**
  126. * 上级分类 -- 商户列表
  127. */
  128. export function merClassifyLst(merId) {
  129. return request.get(`server/${merId}/category/select`, {}, { login: true });
  130. }
  131. /**
  132. * 店铺分类 -- 添加
  133. */
  134. export function merClassifyAdd(merId, data) {
  135. return request.post(`server/${merId}/category/create`, data, { login: true });
  136. }
  137. /**
  138. * 店铺分类 -- 详情
  139. */
  140. export function merClassifyDetail(merId, id) {
  141. return request.get(`server/${merId}/category/detail/${id}`, {}, { login: true });
  142. }
  143. /**
  144. * 店铺分类 -- 编辑
  145. */
  146. export function merClassifyUpdate(merId, id, data) {
  147. return request.post(`server/${merId}/category/update/${id}`, data, { login: true });
  148. }
  149. /**
  150. * 商品规格项目 -- 列表
  151. */
  152. export function specificationLst(merId, data) {
  153. return request.get(`server/${merId}/attr/lst`, data, { login: true });
  154. }
  155. /**
  156. * 商品规格项目 -- 删除
  157. */
  158. export function specificationDel(merId, data) {
  159. return request.post(`server/${merId}/attr/delete`, data, { login: true });
  160. }
  161. /**
  162. * 商品规格项目 -- 添加
  163. */
  164. export function specificationAdd(merId, data) {
  165. return request.post(`server/${merId}/attr/create`, data, { login: true });
  166. }
  167. /**
  168. * 商品规格项目 -- 编辑
  169. */
  170. export function specificationUpdate(merId, id, data) {
  171. return request.post(`server/${merId}/attr/update/${id}`, data, { login: true });
  172. }
  173. /**
  174. * 商品规格项目 -- 详情
  175. */
  176. export function specificationDetail(merId, id) {
  177. return request.get(`server/${merId}/attr/detail/${id}`, {}, { login: true });
  178. }
  179. /*
  180. 请求商品详情
  181. */
  182. export function productDetail(merId, id) {
  183. return request.get(`server/${merId}/product/detail/${id}`, {}, {login: true});
  184. }
  185. /*
  186. 编辑商品
  187. */
  188. export function productUpdate(merId, id, data) {
  189. return request.post(`server/${merId}/product/update/${id}`, data, { login: true });
  190. }
  191. /*
  192. 添加商品 -- 获取送货方式信息
  193. */
  194. export function getDeliveryType(merId) {
  195. return request.get(`server/${merId}/product/config`, {}, { login: true });
  196. }