product.js 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425
  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 '@/plugins/request';
  11. /**
  12. * @description 商品属性 -- 列表
  13. * @param {Object} param params {Object} 传值参数
  14. */
  15. export function ruleListApi(params) {
  16. return request({
  17. url: `product/product/rule`,
  18. method: 'GET',
  19. params
  20. });
  21. }
  22. /**
  23. * @description 商品属性 -- 添加
  24. * @param {Number} param id {Number} 属性id
  25. * @param {Object} param data {Object} 传值参数
  26. */
  27. export function ruleAddApi(data, id) {
  28. return request({
  29. url: `product/product/rule/${id}`,
  30. method: 'POST',
  31. data
  32. });
  33. }
  34. /**
  35. * @description 商品属性 -- 详情
  36. * @param {Number} param id {Number} 属性id
  37. */
  38. export function ruleInfoApi(id) {
  39. return request({
  40. url: `product/product/rule/${id}`,
  41. method: 'get'
  42. });
  43. }
  44. /**
  45. *商品列表-商品评价
  46. */
  47. export function productReplyApi(params) {
  48. return request({
  49. url: `product/reply`,
  50. method: 'get',
  51. params
  52. });
  53. }
  54. /**
  55. * 商品评论 -- 回复
  56. */
  57. export function setReplyApi(data, id) {
  58. return request({
  59. url: `product/reply/set_reply/${id}`,
  60. method: 'PUT',
  61. data
  62. });
  63. }
  64. /**
  65. *商品列表-获取列表
  66. */
  67. export function productListInfo(data) {
  68. return request({
  69. url: 'product/product',
  70. method: 'get',
  71. params: data
  72. });
  73. }
  74. /**
  75. *商品列表
  76. */
  77. export function productList(data) {
  78. return request({
  79. url: `/product/product/list`,
  80. method: 'get',
  81. params: data
  82. });
  83. }
  84. /**
  85. *商品列表-获取列表头
  86. */
  87. export function productHeaderInfo(data) {
  88. return request({
  89. url: 'product/type_header',
  90. method: 'get',
  91. params: data
  92. });
  93. }
  94. /**
  95. * @description 商品详情里面分类-- cascader
  96. */
  97. export function cascaderList(type) {
  98. return request({
  99. url: `product/category/cascader_list/${type}`,
  100. method: 'get'
  101. });
  102. }
  103. /**
  104. * @description 添加商品-- 商品标签
  105. */
  106. export function productStoreLabel() {
  107. return request({
  108. url: 'product/product_label',
  109. method: 'get'
  110. });
  111. }
  112. /**
  113. * 商品 -- 上下架
  114. */
  115. export function setShowApi(id, is_show) {
  116. return request({
  117. url: `product/product/set_show/${id}/${is_show}`,
  118. method: 'PUT'
  119. });
  120. }
  121. /**
  122. * @description 商品属性 -- 批量上下架
  123. * @param {Object} param data {Object} 传值对象
  124. */
  125. export function productShowApi(data) {
  126. return request({
  127. url: `product/product/product_show`,
  128. method: 'put',
  129. data
  130. });
  131. }
  132. /**
  133. * @description 商品属性 -- 批量下架
  134. * @param {Object} param data {Object} 传值对象
  135. */
  136. export function productUnshowApi(data) {
  137. return request({
  138. url: `product/product/product_unshow`,
  139. method: 'put',
  140. data
  141. });
  142. }
  143. /**
  144. * @description 商品 -- 获取运费模板
  145. */
  146. export function productGetTemplateApi() {
  147. return request({
  148. url: `product/product/get_template`,
  149. method: 'get'
  150. });
  151. }
  152. /**
  153. * @description 保存云端视频附件记录
  154. * @param {String} param ids {String}
  155. */
  156. export function videoAttachment (data) {
  157. return request({
  158. url: 'file/video_attachment',
  159. method: 'post',
  160. data
  161. });
  162. }
  163. /**
  164. * @description 自定义表单组件列表
  165. * @param {String} param ids {String}
  166. */
  167. export function allSystemForm () {
  168. return request({
  169. url: 'system/form/all_system_form',
  170. method: 'get'
  171. });
  172. }
  173. /**
  174. * 商品批量操作
  175. * @param {*} data
  176. * @returns
  177. */
  178. export function batchProcess(data) {
  179. return request({
  180. url: 'product/batch_process',
  181. method: 'post',
  182. data
  183. });
  184. }
  185. /**
  186. * @description 商品列表-- 详情
  187. */
  188. export function productInfoApi(id) {
  189. return request({
  190. url: `product/product/${id}`,
  191. method: 'get'
  192. });
  193. }
  194. /**
  195. * @description 商品管理-- 添加品牌-获取上级分类
  196. */
  197. export function brandCascader() {
  198. return request({
  199. url: 'product/brand/cascader_list',
  200. method: 'get'
  201. });
  202. }
  203. /**
  204. * @description 商品管理-- 提交添加品牌
  205. */
  206. export function productBrand(data) {
  207. return request({
  208. url: 'product/brand',
  209. method: 'POST',
  210. data
  211. });
  212. }
  213. /**
  214. * @description 商品管理-- 提交编辑品牌
  215. */
  216. export function productBrandrev(id,data) {
  217. return request({
  218. url: `product/brand/${id}`,
  219. method: 'put',
  220. data
  221. });
  222. }
  223. /**
  224. * @description 商品管理-- 提交
  225. */
  226. export function productAddApi(data) {
  227. return request({
  228. url: `product/product/${data.id}`,
  229. method: 'POST',
  230. data
  231. });
  232. }
  233. /**
  234. * @description 商品管理 -- 生成属性
  235. * @param {Object} param data {Object} 传值参数
  236. */
  237. export function generateAttrApi(data, id, type) {
  238. return request({
  239. url: `product/generate_attr/${id}/${type}`,
  240. method: 'POST',
  241. data
  242. });
  243. }
  244. /**
  245. * @description 商品属性 -- 获取规则属性模板
  246. */
  247. export function productGetRuleApi() {
  248. return request({
  249. url: `product/product/get_rule`,
  250. method: 'get'
  251. });
  252. }
  253. /**
  254. * @description 获取上传参数
  255. */
  256. export function productGetTempKeysApi(data) {
  257. return request({
  258. url: `product/product/get_temp_keys`,
  259. method: 'get',
  260. params: data,
  261. });
  262. }
  263. /**
  264. * @description 商品管理-- 临时保存
  265. */
  266. export function productCache() {
  267. return request({
  268. url: 'product/cache',
  269. method: 'get'
  270. });
  271. }
  272. /**
  273. * @description 商品管理-- 取消临时保存
  274. */
  275. export function cacheDelete() {
  276. return request({
  277. url: 'product/cache',
  278. method: 'delete'
  279. });
  280. }
  281. /**
  282. * @description 商品管理-- 添加商品品牌列表
  283. */
  284. export function brandList() {
  285. return request({
  286. url: `product/brand/cascader_list/2`,
  287. method: 'get'
  288. });
  289. }
  290. /**
  291. * @description 商品分类 -- 添加表单
  292. * @param {Object} param params {Object} 传值参数
  293. */
  294. export function productCreateApi() {
  295. return request({
  296. url: 'product/category/create',
  297. method: 'get'
  298. });
  299. }
  300. /**
  301. *添加商品-获取所有商品单位列表
  302. */
  303. export function productAllUnit(id) {
  304. return request({
  305. url: `product/get_all_unit`,
  306. method: 'get'
  307. });
  308. }
  309. /**
  310. *添加商品-商品单位添加表单
  311. */
  312. export function productUnitCreate(id) {
  313. return request({
  314. url: `product/unit/create`,
  315. method: 'get'
  316. });
  317. }
  318. /**
  319. * @description 商品添加编辑-- 获取上传视频类型
  320. */
  321. export function uploadType () {
  322. return request({
  323. url: 'file/upload_type',
  324. method: 'get'
  325. })
  326. }
  327. /**
  328. * @description 添加商品-- 商品标签
  329. */
  330. export function productAllEnsure() {
  331. return request({
  332. url: 'product/all_ensure',
  333. method: 'get'
  334. });
  335. }
  336. /**
  337. * @description 添加商品-- 添加商品标签
  338. */
  339. export function productLabelAdd() {
  340. return request({
  341. url: 'product/label/form',
  342. method: 'get'
  343. });
  344. }
  345. /**
  346. * @description 添加商品-- 添加商品参数
  347. */
  348. export function productAllSpecs() {
  349. return request({
  350. url: 'product/all_specs',
  351. method: 'get'
  352. });
  353. }
  354. /**
  355. * diy系统表单信息(详情)
  356. * @param {*} type
  357. * @returns
  358. */
  359. export function systemFormInfo(id,data) {
  360. return request({
  361. url: `/system/form/info/${id}`,
  362. method: 'get',
  363. params: data
  364. });
  365. }
  366. /**
  367. *商品列表-获取商品规格
  368. */
  369. export function productAttrsApi(id) {
  370. return request({
  371. url: `product/product/attrs/${id}`,
  372. method: 'get'
  373. });
  374. }
  375. /**
  376. *商品列表-提交商品规格库存
  377. */
  378. export function productSaveStocksApi(data, id) {
  379. return request({
  380. url: `product/product/saveStocks/${id}`,
  381. method: 'PUT',
  382. data
  383. });
  384. }