sellse.service.js 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  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:'/user/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 serviceProviderId 协销ID
  86. *@param pageNum 页码
  87. *@param pageSize 条数
  88. */
  89. GetOrderCount (data = {}) {
  90. return this.AjaxService.get({
  91. url:'/order/seller/count',
  92. data,
  93. isLoading: true ,
  94. })
  95. }
  96. /**
  97. *@协销机构列表
  98. *@param name 机构名字关键字(搜索用)
  99. *@param pageNum 页码
  100. *@param pageSize 条数
  101. */
  102. GetFindAllClubList (data = {}) {
  103. return this.AjaxService.get({
  104. url:'/user/seller/club/all',
  105. data,
  106. isLoading: true ,
  107. })
  108. }
  109. /**
  110. *@协销订单列表(搜索订单)
  111. *@param listType 订单类型
  112. *@param orderNo 订单号
  113. *@param pageNum 页码
  114. *@param pageSize 条数
  115. *@param serviceProviderId 协销ID
  116. */
  117. GetSellerOrderList (data = {}) {
  118. return this.AjaxService.get({
  119. url:'/order/seller/list',
  120. data,
  121. isLoading: true ,
  122. isHost:true
  123. })
  124. }
  125. /**
  126. *@协销下机构订单列表
  127. *@param clubID 机构ID
  128. *@param pageNum 页码
  129. *@param pageSize 条数
  130. */
  131. GetSellerClubOrderList (data = {}) {
  132. return this.AjaxService.get({
  133. url:'/order/seller/list/club',
  134. data,
  135. isLoading: true ,
  136. isHost:true
  137. })
  138. }
  139. /**
  140. *@协销-关键词搜索订单
  141. *@param userId:商品ID(数字类型,必传)
  142. *@param pageNum:机构会所ID(同之前)
  143. *@param pageSize:协销ID(同之前)
  144. */
  145. getSellerOrderList (data={}){
  146. return this.AjaxService.get({
  147. url:'/order/seller/search',
  148. data,
  149. isLoading: true ,
  150. isHost:true
  151. })
  152. }
  153. // 协销订单列表/再来一单
  154. SellerCreateOrderAgain (data = {}) {
  155. return this.AjaxService.post({
  156. url:'/order/seller/cart/again',
  157. data,
  158. isLoading: true ,
  159. isHost:true
  160. })
  161. }
  162. /**
  163. *@协销-二手下单商品列表
  164. *@param 二手商品分类 secondHandType 1二手仪器,2临期产品,3其他 【必传】
  165. *@param 二手仪器分类的类型 instrumentType 1轻光电、2重光电、3耗材配件【不传默认全部】
  166. *@param 搜索关键词 searchKeyword 【选传】
  167. */
  168. GetOrderSecondHandProductList (data = {}) {
  169. return this.AjaxService.get({
  170. url:'/commodity/second/order/products',
  171. data,
  172. isLoading: true ,
  173. isHost:true
  174. })
  175. }
  176. /**
  177. *@协销-二手去结算接口
  178. *@param productId:商品ID(数字类型,必传)
  179. *@param clubId:机构会所ID(同之前)
  180. *@param serviceProviderId:协销ID(同之前)
  181. *@param productCount:二手购买数量
  182. */
  183. GetSettlementBySencondProduct (data = {}) {
  184. return this.AjaxService.get({
  185. url:'/order/seller/second/settlement',
  186. data,
  187. isLoading: true ,
  188. isHost:true
  189. })
  190. }
  191. /**
  192. *@协销-二手商品推荐
  193. *@param productId:商品ID(数字类型,必传)
  194. */
  195. ProductRecommend (data={}){//相关推荐
  196. return this.AjaxService.get({ url:'/commodity/second/recommend', data, isLoading: true })
  197. }
  198. /*协销下单购物车->api*/
  199. /**
  200. *@单一商品加入购物车
  201. *@param clubId 会所的ID
  202. *@param serviceProviderId 协销ID
  203. */
  204. ShoppingCartAddCart (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. ShoppingCartBatchAddCart (data = {}) {
  218. return this.AjaxService.post({
  219. url:'/order/seller/cart/add',
  220. data,
  221. isLoading: true ,
  222. isHost:true
  223. })
  224. }
  225. /**
  226. *@协销帮机构下单获取购物车数量
  227. *@param clubId 会所的ID
  228. *@param serviceProviderId 协销ID
  229. */
  230. GetSellerProductNum (data = {}) {
  231. return this.AjaxService.get({
  232. url:'/order/seller/cart/count',
  233. data,
  234. isLoading: false ,
  235. isHost:true
  236. })
  237. }
  238. /**
  239. *@协销帮机构下单购物车商品加减数量
  240. *@param clubId 机构的clubId
  241. *@param serviceProviderId 协销ID
  242. */
  243. SellerAddProductNum (data = {}) {
  244. return this.AjaxService.post({
  245. url:'/order/seller/cart/update',
  246. data,
  247. isLoading: true ,
  248. isHost:true
  249. })
  250. }
  251. /**
  252. *@协销帮机构下单购物车删除商品
  253. *@param sellerCartIds 购物车ID
  254. */
  255. DeleteSellerCart (data = {}) {
  256. return this.AjaxService.post({
  257. url:'/order/seller/cart/delete',
  258. data,
  259. isLoading: true ,
  260. isHost:true
  261. })
  262. }
  263. /**
  264. *@协销帮机构下单获取购物车列表
  265. *@param clubId 会所的ID
  266. *@param serviceProviderId 协销ID
  267. */
  268. GetSellerShoppingInfo (data = {}) {
  269. return this.AjaxService.get({
  270. url:'/order/seller/cart/list',
  271. data,
  272. isLoading: false ,
  273. isHost:true
  274. })
  275. }
  276. /*协销下单订单->api*/
  277. /**
  278. *@协销帮机构下单去结算初始化
  279. *@param clubId 机构ID
  280. *@param serviceProviderId 协销ID
  281. *@param productIds 商品ID
  282. */
  283. SellerSettlement (data = {}) {
  284. return this.AjaxService.get({
  285. url:'/order/seller/cart/settlement',
  286. data,
  287. isLoading: true ,
  288. isHost:true
  289. })
  290. }
  291. /**
  292. *@协销下定金商品订单初始化
  293. *@param productIds 商品ID
  294. */
  295. SellerProductRechargeGoods (data = {}) {
  296. return this.AjaxService.get({
  297. url:'/product/rechargeGoods',
  298. data,
  299. isLoading: true ,
  300. })
  301. }
  302. /**
  303. *@协销帮机构下定金商品订单提交
  304. *@param productIds 商品ID
  305. */
  306. SellerSubmitRechargeOrder (data = {}) {
  307. return this.AjaxService.post({
  308. url:'/order/submit/recharge',
  309. data,
  310. isLoading: true,
  311. isHost:true
  312. })
  313. }
  314. /**
  315. *@协销帮机构下单提交订单
  316. */
  317. SellerCreateOrderSubmit (data = {}) {
  318. return this.AjaxService.post({
  319. url:'/order/submit/generate',
  320. data,
  321. isLoading: true ,
  322. isHost:true
  323. })
  324. }
  325. // 协销购物车清空失效列表
  326. SellerCartdelete (data = {}) {
  327. return this.AjaxService.post({ url:'/seller/deleteSellerCart', data, isLoading: true })
  328. }
  329. }