product.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. import request from '@/utils/request'
  2. export function getCateList(data) {
  3. return request({
  4. url: '/api/product/ify',
  5. method: 'get',
  6. data
  7. });
  8. }
  9. // 获取商品列表
  10. export function getProducts(data) {
  11. // {
  12. // 参数名称 是否必须 示例 备注
  13. // sid 否 二级分类编号
  14. // cid 否 一级分类编号(!)
  15. // keyword 否 搜索
  16. // priceOrder 否 价格排序
  17. // salesOrder 否 销量排序
  18. // news 否 是否新品
  19. // page 否 分页参数起始值
  20. // limit 否 分页数步长值
  21. // }
  22. return request({
  23. url: '/api/product/lst',
  24. method: 'get',
  25. data
  26. });
  27. }
  28. // 获取商品详情
  29. export function goodsDetail(data, id) {
  30. return request({
  31. url: '/api/product/' + id,
  32. method: 'get',
  33. data
  34. });
  35. }
  36. // 砍价列表
  37. export function getBargainList(data) {
  38. return request({
  39. url: '/api/bargain/list',
  40. method: 'get',
  41. data
  42. });
  43. }
  44. // 加入购物车
  45. export function cartAdd(data) {
  46. return request({
  47. url: '/api/store/cart/add',
  48. method: 'post',
  49. data
  50. });
  51. }
  52. export function getCartlist(data) {
  53. return request({
  54. url: '/api/store/cart',
  55. method: 'get',
  56. data
  57. });
  58. }
  59. export function cartNum(data) {
  60. return request({
  61. url: '/api/store/cart/num',
  62. method: 'post',
  63. data
  64. });
  65. }
  66. export function delCart(data) {
  67. return request({
  68. url: '/api/store/cart/del',
  69. method: 'post',
  70. data
  71. });
  72. }
  73. //compute
  74. export function cartCompute(data) {
  75. return request({
  76. url: '/api/store/cart/compute',
  77. method: 'get',
  78. data
  79. });
  80. }
  81. // 收藏商品
  82. export function collectAdd(data) {
  83. return request({
  84. url: '/api/collect/add',
  85. method: 'post',
  86. data
  87. });
  88. }
  89. // 取消收藏商品
  90. export function collectDel(data) {
  91. return request({
  92. url: '/api/collect/del',
  93. method: 'post',
  94. data
  95. });
  96. }
  97. // 获取搜搜关键字
  98. export function searchKeyword(data) {
  99. return request({
  100. url: '/api/search/keyword',
  101. method: 'get',
  102. data
  103. });
  104. }
  105. // 获取热门分类信息
  106. export function groomList(data, type) {
  107. // 获取产品类型 1 精品推荐 2 热门榜单 3首发新品 4促销单品
  108. return request({
  109. url: '/api/groom/list/' + type,
  110. method: 'get',
  111. data
  112. });
  113. }
  114. // 获取秒杀商品详细
  115. export function seckillGoods(data, id) {
  116. return request({
  117. url: '/api/seckill/detail/' + id,
  118. method: 'get',
  119. data
  120. });
  121. }
  122. // 获取拼团商品详细
  123. export function groupGoods(data, id) {
  124. return request({
  125. url: '/api/combination/detail/' + id,
  126. method: 'get',
  127. data
  128. });
  129. }
  130. // 获取商品分类
  131. export function getCategoryList(data) {
  132. return request({
  133. url: '/api/category',
  134. method: 'get',
  135. data
  136. });
  137. }
  138. // 获取拼团列表
  139. export function getCombinationList(data) {
  140. return request({
  141. url: '/api/combination/list',
  142. method: 'get',
  143. data
  144. });
  145. }
  146. //取消拼团
  147. export function getCombinationLisRemove(data, id) {
  148. return request({
  149. url: '/api/combination/remove' + id,
  150. method: 'get',
  151. data
  152. });
  153. }
  154. //拼团开团页面数据
  155. export function getCombinationLisPink(data, id) {
  156. return request({
  157. url: '/api/combination/pink/' + id,
  158. method: 'get',
  159. data
  160. });
  161. }
  162. // 获取拼团海报
  163. export function getCombinationPoster(data) {
  164. return request({
  165. url: '/api/combination/poster',
  166. method: 'post',
  167. data
  168. });
  169. }
  170. // 获取秒杀分类
  171. export function getSeckillClass(data) {
  172. return request({
  173. url: '/api/seckill/index',
  174. method: 'get',
  175. data
  176. });
  177. }
  178. // 获取秒杀列表
  179. export function getSeckillList(data, id) {
  180. return request({
  181. url: '/api/seckill/list/' + id,
  182. method: 'get',
  183. data
  184. });
  185. }
  186. // 产品评价数量和好评度
  187. export function reply_config(data, id) {
  188. return request({
  189. url: '/api/reply/config/' + id,
  190. method: 'get',
  191. data
  192. });
  193. }
  194. // 获取产品评论
  195. export function reply_list(data, id) {
  196. return request({
  197. url: '/api/reply/list/' + id,
  198. method: 'get',
  199. data
  200. });
  201. }
  202. // 分享海报
  203. export function poster(data) {
  204. return request({
  205. url: '/api/product/poster',
  206. method: 'post',
  207. data
  208. });
  209. }