common.service.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. /**
  2. * 这是所有模块公用业务逻辑的服务
  3. */
  4. export default class CommonService {
  5. constructor(AjaxService) {
  6. Object.assign(this, { AjaxService })
  7. this.name = 'CommonService'
  8. }
  9. /* 首页导航模块商品列表 */
  10. GetHomeClassify (data = {}) {
  11. return this.AjaxService.get({
  12. url:'/home/classify',
  13. data,
  14. isLoading: true ,
  15. })
  16. }
  17. /* 首页初始化 */
  18. GetHomeModulesDataInfo (data = {}) {
  19. return this.AjaxService.get({
  20. url:'/home/modules',
  21. data,
  22. isLoading: false ,
  23. })
  24. }
  25. /* 首页楼层数据 */
  26. GetHomeDataInfo (data = {}) {
  27. return this.AjaxService.get({
  28. url:'/commodity/home/floor',
  29. data,
  30. isLoading: false ,
  31. isHost:true
  32. })
  33. }
  34. /* 首页楼层查看更多数据 */
  35. GetHomeFloorContentDetails (data = {}) {
  36. return this.AjaxService.get({
  37. url:'/commodity/page/floor/details',
  38. data,
  39. isLoading: false ,
  40. isHost:true
  41. })
  42. }
  43. /* 二级页楼层查看更多数据 */
  44. GePageFloorContentDetails (data = {}) {
  45. return this.AjaxService.get({
  46. url:'/commodity/page/floor/centre',
  47. data,
  48. isLoading: false ,
  49. isHost:true
  50. })
  51. }
  52. /* 首页顶部三个模块数据 */
  53. GetHomeTopDataInfo (data = {}) {
  54. return this.AjaxService.get({
  55. url:'/home/top/data',
  56. data,
  57. isLoading: false ,
  58. })
  59. }
  60. /* 获取其他服务信息 */
  61. QueryAfterSale (data = {}) {
  62. return this.AjaxService.get({
  63. url:'/home/afterSale',
  64. data,
  65. isLoading: false ,
  66. })
  67. }
  68. /* 首页金刚区分类 */
  69. // GetHomeInit (data = {}) {
  70. // return this.AjaxService.get({
  71. // url:'/home/init',
  72. // data,
  73. // isLoading: false ,
  74. // })
  75. // }
  76. GetHomeInit (data = {}) {
  77. return this.AjaxService.get({
  78. url:'/commodity/home/init',
  79. data,
  80. isLoading: false ,
  81. isHost:true
  82. })
  83. }
  84. /* 首页金刚区二级分类 */
  85. GetHomeSubMenu (data = {}) {
  86. return this.AjaxService.get({
  87. url:'/home/subMenu',
  88. data,
  89. isLoading: false ,
  90. })
  91. }
  92. /* 首页楼层 */
  93. GetHomeFloorInfo (data = {}) {
  94. return this.AjaxService.get({
  95. url:'/home/floor',
  96. data,
  97. isLoading: false ,
  98. })
  99. }
  100. /* 直播专题页图片 */
  101. GetHomeLiveAdvertising (data = {}) {
  102. return this.AjaxService.get({
  103. url:'/home/live/advertising',
  104. data,
  105. isLoading: false ,
  106. })
  107. }
  108. /* 搜索热门关键词 */
  109. GetHomeHotSearchTerms (data = {}) {
  110. return this.AjaxService.get({
  111. url:'/home/hotSearchTerms',
  112. data,
  113. isLoading: false ,
  114. })
  115. }
  116. /* 二级列表楼层 */
  117. GetInstrumentPageData (data = {}) {
  118. return this.AjaxService.get({
  119. url:'/commodity/classify/product',
  120. data,
  121. isLoading: false ,
  122. isHost:true
  123. })
  124. }
  125. /* 一级分类 */
  126. GetFirstClassly (data = {}) {
  127. return this.AjaxService.get({
  128. url:'/commodity/classify',
  129. data,
  130. isLoading: false ,
  131. isHost:true
  132. })
  133. }
  134. /* 根据一级分类获取二、三级分类 */
  135. GetProductChildrenClassly (data = {}) {
  136. return this.AjaxService.get({
  137. url:'/product/bigType/classify',
  138. data,
  139. isLoading: false ,
  140. })
  141. }
  142. /* 根据一、二、三级分类ID查询单条分类 */
  143. GetProductOneClassly (data = {}) {
  144. return this.AjaxService.get({
  145. url:'/commodity/type/id',
  146. data,
  147. isLoading: false ,
  148. isHost:true
  149. })
  150. }
  151. /*活动页面获取楼层*/
  152. GetActivityFloorData (data = {}) {
  153. return this.AjaxService.get({
  154. url:'/commodity/page/floor',
  155. data,
  156. isLoading: false ,
  157. isHost:true
  158. })
  159. }
  160. }