You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

store.js 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. import request from "@/utils/request.js";
  2. /**
  3. * 获取产品详情
  4. * @param int id
  5. *
  6. */
  7. export function getProductDetail(id,data) {
  8. return request.get('product/detail/' + id, data, {
  9. noAuth: true
  10. });
  11. }
  12. /**
  13. * 产品分享二维码 推广员
  14. * @param int id
  15. */
  16. // #ifdef H5 || APP-PLUS
  17. export function getProductCode(id) {
  18. return request.get('product/code/' + id, {});
  19. }
  20. // #endif
  21. // #ifdef MP
  22. export function getProductCode(id) {
  23. return request.get('product/code/' + id, {
  24. user_type: 'routine'
  25. });
  26. }
  27. // #endif
  28. /**
  29. * 添加收藏
  30. * @param int id
  31. * @param string category product=普通产品,product_seckill=秒杀产品
  32. */
  33. export function collectAdd(id, category) {
  34. return request.post('collect/add', {
  35. id: id,
  36. 'category': category === undefined ? 'product' : category
  37. });
  38. }
  39. /**
  40. * 删除收藏产品
  41. * @param int id
  42. * @param string category product=普通产品,product_seckill=秒杀产品
  43. */
  44. export function collectDel(id, category) {
  45. return request.post('collect/del', {
  46. id: id,
  47. category: category === undefined ? 'product' : category
  48. });
  49. }
  50. /**
  51. * 购车添加
  52. *
  53. */
  54. export function postCartAdd(data) {
  55. return request.post('cart/add', data);
  56. }
  57. /**
  58. * 获取分类列表
  59. *
  60. */
  61. export function getCategoryList() {
  62. return request.get('category', {}, {
  63. noAuth: true
  64. });
  65. }
  66. /**
  67. * 获取产品列表
  68. * @param object data
  69. */
  70. export function getProductslist(data) {
  71. return request.get('products', data, {
  72. noAuth: true
  73. });
  74. }
  75. /**
  76. * 获取推荐产品
  77. *
  78. */
  79. export function getProductHot(page, limit) {
  80. return request.get("product/hot", {
  81. page: page === undefined ? 1 : page,
  82. limit: limit === undefined ? 4 : limit
  83. }, {
  84. noAuth: true
  85. });
  86. }
  87. /**
  88. * 批量收藏
  89. *
  90. * @param object id 产品编号 join(',') 切割成字符串
  91. * @param string category
  92. */
  93. export function collectAll(id, category) {
  94. return request.post('collect/all', {
  95. id: id,
  96. category: category === undefined ? 'product' : category
  97. });
  98. }
  99. /**
  100. * 首页产品的轮播图和产品信息
  101. * @param int type
  102. *
  103. */
  104. export function getGroomList(type, data) {
  105. return request.get('groom/list/' + type, data, {
  106. noAuth: true
  107. });
  108. }
  109. /**
  110. * 获取收藏列表
  111. * @param object data
  112. */
  113. export function getCollectUserList(data) {
  114. return request.get('collect/user', data)
  115. }
  116. /**
  117. * 获取浏览记录列表
  118. * @param object data
  119. */
  120. export function getVisitList(data) {
  121. return request.get('user/visit_list', data)
  122. }
  123. /**
  124. * 获取浏览记录列表-删除
  125. * @param object data
  126. */
  127. export function deleteVisitList(data) {
  128. return request.delete('user/visit', data)
  129. }
  130. /**
  131. * 获取产品评论
  132. * @param int id
  133. * @param object data
  134. *
  135. */
  136. export function getReplyList(id, data) {
  137. return request.get('v2/reply/list/' + id, data,{noAuth: true})
  138. }
  139. /**
  140. * 产品评价数量和好评度
  141. * @param int id
  142. */
  143. export function getReplyConfig(id) {
  144. return request.get('reply/config/' + id,{},{noAuth: true});
  145. }
  146. /**
  147. * 评论点赞
  148. * @param int id
  149. */
  150. export function getReplyPraise(id) {
  151. return request.post('reply/reply_praise/' + id);
  152. }
  153. /**
  154. * 取消评论点赞
  155. * @param int id
  156. */
  157. export function getUnReplyPraise(id) {
  158. return request.post('reply/un_reply_praise/' + id);
  159. }
  160. /**
  161. * 获取评论详情
  162. * @param int id
  163. */
  164. export function getReplyInfo(id) {
  165. return request.get('reply/info/' + id);
  166. }
  167. /**
  168. * 获取评论回复列表
  169. * @param int id
  170. */
  171. export function getReplyComment(id,data) {
  172. return request.get('reply/comment/' + id,data);
  173. }
  174. /**
  175. * 评论回复点赞
  176. * @param int id
  177. */
  178. export function postReplyPraise(id) {
  179. return request.post('reply/praise/' + id);
  180. }
  181. /**
  182. * 取消评论回复点赞
  183. * @param int id
  184. */
  185. export function postUnReplyPraise(id) {
  186. return request.post('reply/un_praise/' + id);
  187. }
  188. /**
  189. * 保存商品评价回复
  190. * @param int id
  191. */
  192. export function replyComment(id,data) {
  193. return request.post('reply/comment/' + id,data);
  194. }
  195. /**
  196. * 获取搜索关键字获取
  197. *
  198. */
  199. export function getSearchKeyword() {
  200. return request.get('search/keyword', {}, {
  201. noAuth: true
  202. });
  203. }
  204. /**
  205. * 门店列表
  206. * @returns {*}
  207. */
  208. export function storeListApi(data) {
  209. return request.get("store_list", data, {
  210. noAuth: true
  211. });
  212. }
  213. /**
  214. * 套餐列表
  215. * @param int id
  216. *
  217. */
  218. export function storeDiscountsList(id) {
  219. return request.get('store_discounts/list/' + id, {}, {
  220. noAuth: true
  221. });
  222. }
  223. /**
  224. * 购车添加、减少、修改
  225. *
  226. */
  227. export function postCartNum(data) {
  228. return request.post('v2/set_cart_num', data);
  229. }
  230. /**
  231. * 获取首页的属性
  232. * @returns {*}
  233. */
  234. export function getAttr(id,type) {
  235. return request.get("v2/get_attr/"+id+"/"+type);
  236. }
  237. /**
  238. * 获取店员推广微信会员卡二维码
  239. */
  240. export function storeCardApi() {
  241. return request.get("store/staff/card/code");
  242. }
  243. /**
  244. * 分类列表-品牌列表
  245. */
  246. export function brand(data) {
  247. return request.get("brand",data,{
  248. noAuth: true
  249. });
  250. }