new_store.js 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. // +----------------------------------------------------------------------
  2. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  3. // +----------------------------------------------------------------------
  4. // | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
  5. // +----------------------------------------------------------------------
  6. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  7. // +----------------------------------------------------------------------
  8. // | Author: CRMEB Team <admin@crmeb.com>
  9. // +----------------------------------------------------------------------
  10. import request from "@/utils/request.js";
  11. /**
  12. * 获取附近门店
  13. * @param int id
  14. *
  15. */
  16. export function getnearbyStore(data) {
  17. return request.get('nearby_store',data, {
  18. noAuth: true
  19. });
  20. }
  21. /**
  22. * 门店商品列表
  23. * @param int id
  24. *
  25. */
  26. export function getProducts(data) {
  27. return request.get('store/products' ,data, {
  28. noAuth: true
  29. });
  30. }
  31. /**
  32. * 获取门店客服列表
  33. * @param int id
  34. *
  35. */
  36. export function getCustomerList(store_id) {
  37. return request.get('store/customer/list/' + store_id, {},{
  38. noAuth: true
  39. });
  40. }
  41. /**
  42. * 获取门店客服详情
  43. * @param int id
  44. *
  45. */
  46. export function getCustomerInfo(store_id) {
  47. return request.get('store/customer/info/' + store_id, {},{
  48. noAuth: true
  49. });
  50. }
  51. /**
  52. * 门店商品分类
  53. * @param int id
  54. */
  55. export function getStoreCategory(data) {
  56. return request.get('store/category', data,{
  57. noAuth: true
  58. });
  59. }
  60. /**
  61. * 门店商品品牌
  62. * @param int id
  63. */
  64. export function getStoreBrand(data) {
  65. return request.get('store/brand', data,{
  66. noAuth: true
  67. });
  68. }
  69. /**
  70. * 附近门店列表
  71. * @param int data
  72. */
  73. export function getList( data) {
  74. return request.get('store/list',data, {
  75. noAuth: true
  76. });
  77. }
  78. /**
  79. * 删除收藏产品
  80. * @param int id
  81. * @param string category product=普通产品,product_seckill=秒杀产品
  82. */
  83. export function collectDel(id, category) {
  84. return request.post('collect/del', {
  85. id: id,
  86. category: category === undefined ? 'product' : category
  87. });
  88. }
  89. /**
  90. * 购车添加
  91. *
  92. */
  93. export function postCartAdd(data) {
  94. return request.post('cart/add', data);
  95. }
  96. /**
  97. * 获取分类列表
  98. *
  99. */
  100. export function getCategoryList() {
  101. return request.get('category', {}, {
  102. noAuth: true
  103. });
  104. }
  105. /**
  106. * 获取产品列表
  107. * @param object data
  108. */
  109. export function getProductslist(data) {
  110. return request.get('products', data, {
  111. noAuth: true
  112. });
  113. }
  114. /**
  115. * 获取推荐产品
  116. *
  117. */
  118. export function getProductHot(page, limit) {
  119. return request.get("product/hot", {
  120. page: page === undefined ? 1 : page,
  121. limit: limit === undefined ? 4 : limit
  122. }, {
  123. noAuth: true
  124. });
  125. }
  126. /**
  127. * 批量收藏
  128. *
  129. * @param object id 产品编号 join(',') 切割成字符串
  130. * @param string category
  131. */
  132. export function collectAll(id, category) {
  133. return request.post('collect/all', {
  134. id: id,
  135. category: category === undefined ? 'product' : category
  136. });
  137. }
  138. /**
  139. * 首页产品的轮播图和产品信息
  140. * @param int type
  141. *
  142. */
  143. export function getGroomList(type, data) {
  144. return request.get('groom/list/' + type, data, {
  145. noAuth: true
  146. });
  147. }
  148. /**
  149. * 获取收藏列表
  150. * @param object data
  151. */
  152. export function getCollectUserList(data) {
  153. return request.get('collect/user', data)
  154. }
  155. /**
  156. * 获取浏览记录列表
  157. * @param object data
  158. */
  159. export function getVisitList(data) {
  160. return request.get('user/visit_list', data)
  161. }
  162. /**
  163. * 获取浏览记录列表-删除
  164. * @param object data
  165. */
  166. export function deleteVisitList(data) {
  167. return request.delete('user/visit', data)
  168. }
  169. /**
  170. * 获取产品评论
  171. * @param int id
  172. * @param object data
  173. *
  174. */
  175. export function getReplyList(id, data) {
  176. return request.get('v2/reply/list/' + id, data,{noAuth: true})
  177. }
  178. /**
  179. * 产品评价数量和好评度
  180. * @param int id
  181. */
  182. export function getReplyConfig(id) {
  183. return request.get('reply/config/' + id,{},{noAuth: true});
  184. }
  185. /**
  186. * 评论点赞
  187. * @param int id
  188. */
  189. export function getReplyPraise(id) {
  190. return request.post('reply/reply_praise/' + id);
  191. }
  192. /**
  193. * 取消评论点赞
  194. * @param int id
  195. */
  196. export function getUnReplyPraise(id) {
  197. return request.post('reply/un_reply_praise/' + id);
  198. }
  199. /**
  200. * 获取评论详情
  201. * @param int id
  202. */
  203. export function getReplyInfo(id) {
  204. return request.get('reply/info/' + id);
  205. }
  206. /**
  207. * 获取评论回复列表
  208. * @param int id
  209. */
  210. export function getReplyComment(id,data) {
  211. return request.get('reply/comment/' + id,data);
  212. }
  213. /**
  214. * 评论回复点赞
  215. * @param int id
  216. */
  217. export function postReplyPraise(id) {
  218. return request.post('reply/praise/' + id);
  219. }
  220. /**
  221. * 取消评论回复点赞
  222. * @param int id
  223. */
  224. export function postUnReplyPraise(id) {
  225. return request.post('reply/un_praise/' + id);
  226. }
  227. /**
  228. * 保存商品评价回复
  229. * @param int id
  230. */
  231. export function replyComment(id,data) {
  232. return request.post('reply/comment/' + id,data);
  233. }
  234. /**
  235. * 获取搜索关键字获取
  236. *
  237. */
  238. export function getSearchKeyword() {
  239. return request.get('search/keyword', {}, {
  240. noAuth: true
  241. });
  242. }
  243. /**
  244. * 获取新人礼信息
  245. *
  246. */
  247. export function newcomerInfo() {
  248. return request.get('marketing/newcomer/info', {}, {
  249. noAuth: true
  250. });
  251. }
  252. /**
  253. * 新人专享商品
  254. *
  255. */
  256. export function newcomerList(data) {
  257. return request.get('marketing/newcomer/product_list', data, {
  258. noAuth: true
  259. });
  260. }
  261. /**
  262. * 新人大礼包弹窗
  263. *
  264. */
  265. export function newcomerGift(data) {
  266. return request.get('marketing/newcomer/gift');
  267. }