sellse.service.js 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. /**
  2. * explain: 这是协销用户业务的服务
  3. * Author: zhjy
  4. * Time: 2020-09-24
  5. */
  6. export default class SellerService {
  7. constructor(AjaxService) {
  8. Object.assign(this, { AjaxService })
  9. this.name = 'SellerService'
  10. }
  11. /**
  12. *@协销登录
  13. *@param mobile 手机号
  14. *@param password 密码
  15. */
  16. SellerLogin (data={}){
  17. return this.AjaxService.post({
  18. url:'/user/login/seller',
  19. data,
  20. isLoading: true ,
  21. isHost:true
  22. })
  23. }
  24. /**
  25. *@协销账户中心
  26. *@param userID 协销ID
  27. */
  28. GetSellerHome (data = {}) {
  29. return this.AjaxService.get({ url:'/seller/home', data, isLoading: true })
  30. }
  31. /**
  32. *@协销拉机构上线(资料填写)
  33. *@param userID 协销ID
  34. */
  35. SellerClubTemporary (data={}){
  36. return this.AjaxService.post({
  37. url:'/user/register/club/temporary',
  38. data,
  39. isLoading: true ,
  40. isHost:true
  41. })
  42. }
  43. /**
  44. *@协销拉机构上线
  45. *@param userID 协销ID
  46. */
  47. SellerClubRegister (data={}){
  48. return this.AjaxService.post({
  49. url:'/user/register/club/online',
  50. data,
  51. isLoading: true ,
  52. isHost:true
  53. })
  54. }
  55. /**
  56. *@协销拉机构上线检测手机号和邮箱
  57. *@param mobileOrEmail 手机号和邮箱
  58. */
  59. SellerClubCheck (data={}){
  60. return this.AjaxService.get({
  61. url:'/user/register/check',
  62. data,
  63. isLoading: true,
  64. isHost:true
  65. })
  66. }
  67. /**
  68. *@协销机构列表
  69. *@param name 机构名字关键字(搜索用)
  70. *@param pageNum 页码
  71. *@param pageSize 条数
  72. *@param spId 协销ID
  73. *@param status 机构状态
  74. */
  75. GetSellerClubList (data = {}) {
  76. return this.AjaxService.get({
  77. url:'/user/seller/club/list',
  78. data,
  79. isLoading: true ,
  80. isHost:true
  81. })
  82. }
  83. /**
  84. *@协销机构列表
  85. *@param name 机构名字关键字(搜索用)
  86. *@param pageNum 页码
  87. *@param pageSize 条数
  88. */
  89. GetFindAllClubList (data = {}) {
  90. return this.AjaxService.get({
  91. url:'/seller/findAllClub',
  92. data,
  93. isLoading: true ,
  94. })
  95. }
  96. /**
  97. *@协销订单列表(搜索订单)
  98. *@param listType 订单类型
  99. *@param orderNo 订单号
  100. *@param pageNum 页码
  101. *@param pageSize 条数
  102. *@param serviceProviderId 协销ID
  103. */
  104. GetSellerOrderList (data = {}) {
  105. return this.AjaxService.get({
  106. url:'/order/seller/list',
  107. data,
  108. isLoading: true ,
  109. isHost:true
  110. })
  111. }
  112. /**
  113. *@协销下机构订单列表
  114. *@param clubID 机构ID
  115. *@param pageNum 页码
  116. *@param pageSize 条数
  117. */
  118. GetSellerClubOrderList (data = {}) {
  119. return this.AjaxService.get({
  120. url:'/order/seller/list/club',
  121. data,
  122. isLoading: true ,
  123. isHost:true
  124. })
  125. }
  126. /**
  127. *@协销-关键词搜索订单
  128. *@param userId:商品ID(数字类型,必传)
  129. *@param pageNum:机构会所ID(同之前)
  130. *@param pageSize:协销ID(同之前)
  131. */
  132. getSellerOrderList (data={}){
  133. return this.AjaxService.get({
  134. url:'/order/seller/search',
  135. data,
  136. isLoading: true ,
  137. isHost:true
  138. })
  139. }
  140. // 协销订单列表/再来一单
  141. SellerCreateOrderAgain (data = {}) {
  142. return this.AjaxService.post({
  143. url:'/order/seller/cart/again',
  144. data,
  145. isLoading: true ,
  146. isHost:true
  147. })
  148. }
  149. /**
  150. *@协销-二手下单商品列表
  151. *@param 二手商品分类 secondHandType 1二手仪器,2临期产品,3其他 【必传】
  152. *@param 二手仪器分类的类型 instrumentType 1轻光电、2重光电、3耗材配件【不传默认全部】
  153. *@param 搜索关键词 searchKeyword 【选传】
  154. */
  155. GetOrderSecondHandProductList (data = {}) {
  156. return this.AjaxService.get({
  157. url:'/commodity/second/order/products',
  158. data,
  159. isLoading: true ,
  160. isHost:true
  161. })
  162. }
  163. /**
  164. *@协销-二手去结算接口
  165. *@param productId:商品ID(数字类型,必传)
  166. *@param clubId:机构会所ID(同之前)
  167. *@param serviceProviderId:协销ID(同之前)
  168. *@param productCount:二手购买数量
  169. */
  170. GetSettlementBySencondProduct (data = {}) {
  171. return this.AjaxService.get({
  172. url:'/order/seller/second/settlement',
  173. data,
  174. isLoading: true ,
  175. isHost:true
  176. })
  177. }
  178. /**
  179. *@协销-二手商品推荐
  180. *@param productId:商品ID(数字类型,必传)
  181. */
  182. ProductRecommend (data={}){//相关推荐
  183. return this.AjaxService.get({ url:'/product/getSecondHandProductRecommend', data, isLoading: true })
  184. }
  185. /*协销下单购物车->api*/
  186. /**
  187. *@单一商品加入购物车
  188. *@param clubId 会所的ID
  189. *@param serviceProviderId 协销ID
  190. */
  191. ShoppingCartAddCart (data = {}) {
  192. return this.AjaxService.post({
  193. url:'/order/seller/cart/add',
  194. data,
  195. isLoading: true ,
  196. isHost:true
  197. })
  198. }
  199. /**
  200. *@组合商品加入购物车
  201. *@param clubId 会所的ID
  202. *@param serviceProviderId 协销ID
  203. */
  204. ShoppingCartBatchAddCart (data = {}) {
  205. return this.AjaxService.post({
  206. url:'/order/seller/cart/add',
  207. data,
  208. isLoading: true ,
  209. isHost:true
  210. })
  211. }
  212. /**
  213. *@协销帮机构下单获取购物车数量
  214. *@param clubId 会所的ID
  215. *@param serviceProviderId 协销ID
  216. */
  217. GetSellerProductNum (data = {}) {
  218. return this.AjaxService.get({
  219. url:'/order/seller/cart/count',
  220. data,
  221. isLoading: false ,
  222. isHost:true
  223. })
  224. }
  225. /**
  226. *@协销帮机构下单购物车商品加减数量
  227. *@param clubId 机构的clubId
  228. *@param serviceProviderId 协销ID
  229. */
  230. SellerAddProductNum (data = {}) {
  231. return this.AjaxService.post({
  232. url:'/order/seller/cart/update',
  233. data,
  234. isLoading: true ,
  235. isHost:true
  236. })
  237. }
  238. /**
  239. *@协销帮机构下单购物车删除商品
  240. *@param sellerCartIds 购物车ID
  241. */
  242. DeleteSellerCart (data = {}) {
  243. return this.AjaxService.post({
  244. url:'/order/seller/cart/delete',
  245. data,
  246. isLoading: true ,
  247. isHost:true
  248. })
  249. }
  250. /**
  251. *@协销帮机构下单获取购物车列表
  252. *@param clubId 会所的ID
  253. *@param serviceProviderId 协销ID
  254. */
  255. GetSellerShoppingInfo (data = {}) {
  256. return this.AjaxService.get({
  257. url:'/order/seller/cart/list',
  258. data,
  259. isLoading: false ,
  260. isHost:true
  261. })
  262. }
  263. /*协销下单订单->api*/
  264. /**
  265. *@协销帮机构下单去结算初始化
  266. *@param clubId 机构ID
  267. *@param serviceProviderId 协销ID
  268. *@param productIds 商品ID
  269. */
  270. SellerSettlement (data = {}) {
  271. return this.AjaxService.get({
  272. url:'/order/seller/cart/settlement',
  273. data,
  274. isLoading: true ,
  275. isHost:true
  276. })
  277. }
  278. /**
  279. *@协销下定金商品订单初始化
  280. *@param productIds 商品ID
  281. */
  282. SellerProductRechargeGoods (data = {}) {
  283. return this.AjaxService.get({
  284. url:'/product/rechargeGoods',
  285. data,
  286. isLoading: true ,
  287. })
  288. }
  289. /**
  290. *@协销帮机构下定金商品订单提交
  291. *@param productIds 商品ID
  292. */
  293. SellerSubmitRechargeOrder (data = {}) {
  294. return this.AjaxService.post({
  295. url:'/order/submit/recharge',
  296. data,
  297. isLoading: true,
  298. isHost:true
  299. })
  300. }
  301. /**
  302. *@协销帮机构下单提交订单
  303. */
  304. SellerCreateOrderSubmit (data = {}) {
  305. return this.AjaxService.post({
  306. url:'/order/submit/generate',
  307. data,
  308. isLoading: true ,
  309. isHost:true
  310. })
  311. }
  312. // 协销购物车清空失效列表
  313. SellerCartdelete (data = {}) {
  314. return this.AjaxService.post({ url:'/seller/deleteSellerCart', data, isLoading: true })
  315. }
  316. }