sellerGoods.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. import { requestApi } from '../util/network'
  2. // 获取卖家商品列表
  3. export const getGoodsList =
  4. (controller, params, keyword, goods_type, search_type) =>
  5. requestApi(
  6. '/' + controller + '/goods_list',
  7. 'POST',
  8. {
  9. 'keyword': keyword,
  10. 'goods_type': goods_type,
  11. 'search_type': search_type,
  12. 'page': params.page,
  13. 'per_page': params.per_page,
  14. 'client_type': 'wap'
  15. },
  16. 'seller'
  17. )
  18. // 删除商品
  19. export const dropGoods =
  20. (controller, commonid) =>
  21. requestApi(
  22. '/' + controller + '/drop_goods',
  23. 'POST',
  24. {
  25. 'commonid': commonid,
  26. 'client_type': 'wap'
  27. },
  28. 'seller'
  29. )
  30. // 商品上架
  31. export const goodsShow =
  32. (controller, commonid) =>
  33. requestApi(
  34. '/' + controller + '/goods_show',
  35. 'POST',
  36. {
  37. 'commonid': commonid,
  38. 'client_type': 'wap'
  39. },
  40. 'seller'
  41. )
  42. // 商品下架
  43. export const goodsUnshow =
  44. (controller, commonid) =>
  45. requestApi(
  46. '/' + controller + '/goods_unshow',
  47. 'POST',
  48. {
  49. 'commonid': commonid,
  50. 'client_type': 'wap'
  51. },
  52. 'seller'
  53. )
  54. // 商品编辑
  55. export const goodsEdit =
  56. (controller, commonid) =>
  57. requestApi(
  58. '/' + controller + '/edit_goods',
  59. 'POST',
  60. {
  61. 'commonid': commonid
  62. },
  63. 'seller'
  64. )
  65. // 保存商品规格
  66. export const goodsSpecSave =
  67. (data) =>
  68. requestApi(
  69. '/Sellerspec/save_spec',
  70. 'POST',
  71. data,
  72. 'seller'
  73. )
  74. // 商品规格值
  75. export const goodsSpecAdd =
  76. (controller, name, gc_id, sp_id) =>
  77. requestApi(
  78. '/' + controller + '/add_spec',
  79. 'POST',
  80. {
  81. 'name': name,
  82. 'gc_id': gc_id,
  83. 'sp_id': sp_id
  84. },
  85. 'seller'
  86. )
  87. export const uploadInfoFile =
  88. (controller, file) =>
  89. requestApi(
  90. '/' + controller + '/image_upload',
  91. 'POST',
  92. file,
  93. 'seller',
  94. true
  95. )
  96. export const uploadVideo =
  97. (controller, file) =>
  98. requestApi(
  99. '/' + controller + '/video_upload',
  100. 'POST',
  101. file,
  102. 'seller',
  103. true
  104. )
  105. export const uploadResource =
  106. (file) =>
  107. requestApi(
  108. '/seller_resource/resource_upload',
  109. 'POST',
  110. file,
  111. 'seller',
  112. true
  113. )
  114. export const delResource =
  115. (data) =>
  116. requestApi(
  117. '/seller_resource/del_resource',
  118. 'POST',
  119. data,
  120. 'seller'
  121. )
  122. // 商品保存
  123. export const goodsSave =
  124. (controller, class_id, commonid, goods, goods_body, sgcate_id, spec, sp_name, sp_val, attr, g_fccount, g_fcprefix) =>
  125. requestApi(
  126. '/' + controller + '/save_goods',
  127. 'POST',
  128. {
  129. 'class_id': class_id,
  130. 'commonid': commonid,
  131. 'goods': goods,
  132. 'goods_body': goods_body,
  133. 'sgcate_id': sgcate_id,
  134. 'spec': spec,
  135. 'sp_name': sp_name,
  136. 'sp_val': sp_val,
  137. 'attr': attr,
  138. 'g_fcprefix': g_fcprefix,
  139. 'g_fccount': g_fccount
  140. },
  141. 'seller'
  142. )
  143. // 获取店铺商品分类公共数据
  144. export const getCommonData =
  145. (controller, class_id) =>
  146. requestApi(
  147. '/' + controller + '/get_common_data',
  148. 'POST',
  149. {
  150. 'class_id': class_id
  151. },
  152. 'seller'
  153. )
  154. // 图片编辑
  155. export const imageEdit =
  156. (controller, commonid) =>
  157. requestApi(
  158. '/' + controller + '/edit_image',
  159. 'POST',
  160. {
  161. 'commonid': commonid
  162. },
  163. 'seller'
  164. )
  165. // 图片保存
  166. export const imageSave =
  167. (controller, commonid, img) =>
  168. requestApi(
  169. '/' + controller + '/save_image',
  170. 'POST',
  171. {
  172. 'commonid': commonid,
  173. 'img': img
  174. },
  175. 'seller'
  176. )
  177. // 获取店铺经营分类
  178. export const getGoodsClass =
  179. (controller) =>
  180. requestApi(
  181. '/' + controller + '/goods_class',
  182. 'POST',
  183. {
  184. },
  185. 'seller'
  186. )