shop.service.js 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. /**
  2. * 这是与购物有关的业务逻辑的服务
  3. */
  4. export default class ShopService {
  5. constructor(AjaxService) {
  6. Object.assign(this, { AjaxService })
  7. this.name = 'ShopService'
  8. }
  9. /* 小程序-供应商注册第一步 */
  10. SupplierAppletsRegistered (data = {}) {
  11. return this.AjaxService.post({
  12. url:'/user/register/shop',
  13. data,
  14. isLoading: true,
  15. isHost:true
  16. })
  17. }
  18. /* 小程序-搜索供应商列表 */
  19. GetSearchSupplierList (data = {}) {
  20. return this.AjaxService.get({
  21. url:'/commodity/search/query/shop',
  22. data,
  23. isLoading: true ,
  24. isHost:true
  25. })
  26. }
  27. /* 小程序供应商个人中心 */
  28. GetHomePageData (data = {}) {
  29. return this.AjaxService.get({ url:'/supplier/homePageData', data, isLoading: true })
  30. }
  31. /* 小程序供应商我的商品 */
  32. GetSupplierPyProduct (data = {}) {
  33. return this.AjaxService.get({
  34. url:'/commodity/shop/product/list',
  35. data,
  36. isLoading: true ,
  37. isHost:true
  38. })
  39. }
  40. /* 小程序供应商操作添加删除主推商品 */
  41. SupplierSwitchFeaturedyProduct (data = {}) {
  42. return this.AjaxService.post({
  43. url:'/commodity/shop/featured/switch',
  44. data,
  45. isLoading: true ,
  46. isHost:true
  47. })
  48. }
  49. /* 小程序供应商操作下架商品 */
  50. SupplierSoldOutProduct (data = {}) {
  51. return this.AjaxService.post({
  52. url:'/commodity/shop/product/offline',
  53. data,
  54. isLoading: true ,
  55. isHost:true
  56. })
  57. }
  58. /* 小程序供应商我的店铺详情 */
  59. GetSupplierHomeDeatils (data = {}) {
  60. return this.AjaxService.get({
  61. url:'/supplier/home/detail',
  62. data,
  63. isLoading: true ,
  64. })
  65. }
  66. /* 小程序供应商我的店铺banner */
  67. GetSupplierHomeBanner (data = {}) {
  68. return this.AjaxService.get({
  69. url:'/supplier/home/images',
  70. data,
  71. isLoading: true ,
  72. })
  73. }
  74. /* 小程序供应商我的店铺主推商品 */
  75. GetSupplierHomeProduct (data = {}) {
  76. return this.AjaxService.get({
  77. url:'/commodity/shop/product/main',
  78. data,
  79. isLoading: true ,
  80. isHost:true
  81. })
  82. }
  83. /* 小程序供应商我的店铺全部商品 */
  84. GetSupplierHomeProductList (data = {}) {
  85. return this.AjaxService.get({
  86. url:'/commodity/search/query/product/shop',
  87. data,
  88. isLoading: false ,
  89. isHost:true
  90. })
  91. }
  92. /* 发货-添加商品资质初始化查询商品 */
  93. GetSupplierLogisticsRecord (data = {}) {
  94. return this.AjaxService.get({
  95. url:'/order/shop/ship/logistics/record',
  96. data,
  97. isLoading: false ,
  98. isHost:true
  99. })
  100. }
  101. /* 发货-商品资质回显 */
  102. GetSupplierQualificationData (data = {}) {
  103. return this.AjaxService.get({
  104. url:'/order/shop/qualification/list',
  105. data,
  106. isLoading: false ,
  107. isHost:true
  108. })
  109. }
  110. /* 发货-保存商品资质 */
  111. GetSupplierQualificationUpdata (data = {}) {
  112. return this.AjaxService.post({
  113. url:'/order/shop/qualification/save',
  114. data,
  115. isLoading: false ,
  116. isHost:true
  117. })
  118. }
  119. /* 小程序供应商我的订单 */
  120. GetSupplierMyOrderList (data = {}) {
  121. return this.AjaxService.get({
  122. url:'/order/shop/list',
  123. data,
  124. isLoading: true ,
  125. isHost:true
  126. })
  127. }
  128. /* 小程序发货-权限控制 */
  129. MiniShipments (data = {}) {
  130. return this.AjaxService.get({
  131. url:'/order/shop/share/code/check',
  132. data,
  133. isLoading: true ,
  134. isHost:true
  135. })
  136. }
  137. /* 小程序发货-查询供应商子订单详情 */
  138. GetShopOrderDetails (data = {}) {
  139. return this.AjaxService.get({
  140. url:'/order/shop/detail',
  141. data,
  142. isLoading: true ,
  143. isHost:true
  144. })
  145. }
  146. /* 小程序发货-供应商订单详情获取订单分享码 */
  147. ShopOrderShareCode (data = {}) {
  148. return this.AjaxService.get({
  149. url:'/order/shop/share/code',
  150. data,
  151. isLoading: false ,
  152. isHost:true
  153. })
  154. }
  155. /* 小程序发货-供应商订单发货商品查询 */
  156. ShopOrderShipmentsInfo (data = {}) {
  157. return this.AjaxService.get({
  158. url:'/order/shop/ship/info',
  159. data,
  160. isLoading: true ,
  161. isHost:true
  162. })
  163. }
  164. /* 小程序发货-物流公司查询 */
  165. GetLogisticsCompany (data = {}) {
  166. return this.AjaxService.get({
  167. url:'/order/shop/ship/company',
  168. data,
  169. isLoading: true ,
  170. isHost:true
  171. })
  172. }
  173. /* 小程序发货-查看发货记录物流信息 */
  174. GetLogisticsInfo (data = {}) {
  175. return this.AjaxService.get({
  176. url:'/order/shop/ship/logistics/info',
  177. data,
  178. isLoading: true ,
  179. isHost:true
  180. })
  181. }
  182. /* 小程序发货-查看发货记录-添加物流 */
  183. ShopAddLogisticsInfo (data = {}) {
  184. return this.AjaxService.post({
  185. url:'/order/shop/ship/logistics/add',
  186. data,
  187. isLoading: true,
  188. isHost:true
  189. })
  190. }
  191. /* 小程序发货-扫码获取物流公司信息 */
  192. GetExpressInformation (data = {}) {
  193. return this.AjaxService.post({
  194. url:'/order/shop/ship/logistics/scan',
  195. data,
  196. isLoading: false,
  197. isHost:true
  198. })
  199. }
  200. /* 小程序发货-确认发货 */
  201. ShopAddLogistics (data = {}) {
  202. return this.AjaxService.post({
  203. url:'/order/shop/ship/delivery',
  204. data,
  205. isLoading: true ,
  206. isHost:true
  207. })
  208. }
  209. /* 小程序发货-发货记录 */
  210. ShopShipmentsRecord (data = {}) {
  211. return this.AjaxService.get({
  212. url:'/order/shop/ship/delivery/record',
  213. data,
  214. isLoading: true ,
  215. isHost:true
  216. })
  217. }
  218. /* 小程序发货-撤销发货 */
  219. ShopCancelShipment (data = {}) {
  220. return this.AjaxService.post({
  221. url:'/order/shop/ship/delivery/cancel',
  222. data,
  223. isLoading: true ,
  224. isHost:true
  225. })
  226. }
  227. /* 一级分类 */
  228. GetPrimaryClassification (data = {}) {
  229. return this.AjaxService.get({
  230. url:'/supplier/primaryClassification',
  231. data,
  232. isLoading: false ,
  233. })
  234. }
  235. /* 二级级分类 */
  236. GetPrimarySecondaryClassification (data = {}) {
  237. return this.AjaxService.get({
  238. url:'/supplier/secondaryClassification',
  239. data,
  240. isLoading: false ,
  241. })
  242. }
  243. /* 三级分类 */
  244. GetPrimaryThreeLevelClassification (data = {}) {
  245. return this.AjaxService.get({
  246. url:'/supplier/threeLevelClassification',
  247. data,
  248. isLoading: false ,
  249. })
  250. }
  251. }