store.js 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  1. import request from "@/utils/request.js";
  2. /**
  3. * 获取产品详情
  4. * @param int id
  5. *
  6. */
  7. export function getProductDetail(id) {
  8. return request.get('store/product/detail/' + id, {}, {
  9. noAuth: true
  10. });
  11. }
  12. /**
  13. * 产品分享二维码 推广员
  14. * @param int id
  15. */
  16. export function getProductCode(id, data) {
  17. return request.get('store/product/qrcode/' + id, data, {
  18. noAuth: true
  19. });
  20. }
  21. // #ifndef MP
  22. // export function getProductCode(id){
  23. // return request.get('store/product/qrcode/' + id, {type:'wechat'},{ noAuth : true });
  24. // }
  25. // #endif
  26. // #ifdef MP
  27. // export function getProductCode(id){
  28. // return request.get('store/product/qrcode/' + id, {type:'routine'},{ noAuth : true });
  29. // }
  30. // #endif
  31. /**
  32. * 添加收藏
  33. * @param int id
  34. * @param string category product=普通产品,product_seckill=秒杀产品
  35. */
  36. export function collectAdd(data) {
  37. return request.post('user/relation/create', data);
  38. }
  39. /**
  40. * 删除收藏产品
  41. * @param int id
  42. * @param string category product=普通产品,product_seckill=秒杀产品
  43. */
  44. export function collectDel(data) {
  45. return request.post('user/relation/delete', data);
  46. }
  47. /**
  48. * 购车添加
  49. *
  50. */
  51. export function postCartAdd(data) {
  52. return request.post('user/cart/create', data);
  53. }
  54. /**
  55. * 获取分类列表
  56. *
  57. */
  58. export function getCategoryList() {
  59. return request.get('store/product/category/lst', {}, {
  60. noAuth: true
  61. });
  62. }
  63. /**
  64. * 获取产品列表
  65. * @param object data
  66. */
  67. export function getProductslist(data) {
  68. if (data.brand_id && Array.isArray(data.brand_id)) {
  69. data = {
  70. ...data
  71. }
  72. data.brand_id = data.brand_id.toString()
  73. }
  74. return request.get('product/spu/lst', data, {
  75. noAuth: true
  76. });
  77. }
  78. /**
  79. * 获取品牌列表
  80. * @param object data
  81. */
  82. export function getBrandlist(data) {
  83. return request.get('store/product/brand/lst', data, {
  84. noAuth: true
  85. });
  86. }
  87. /**
  88. * 获取推荐产品
  89. *
  90. */
  91. export function getProductHot(page, limit) {
  92. return request.get("product/spu/recommend", {
  93. page: page === undefined ? 1 : page,
  94. limit: limit === undefined ? 10 : limit
  95. }, {
  96. noAuth: true
  97. });
  98. }
  99. /**
  100. * 批量收藏
  101. *
  102. * @param object id
  103. * @param string category
  104. */
  105. export function collectAll(data) {
  106. return request.post('user/relation/batch/create', data);
  107. }
  108. /**
  109. * 首页产品的轮播图和产品信息
  110. * @param int type
  111. *
  112. */
  113. export function getGroomList(type, data) {
  114. return request.get('product/spu/hot/' + type, data, {
  115. noAuth: true
  116. });
  117. }
  118. /**
  119. * 获取商品收藏列表
  120. * @param object data
  121. */
  122. export function getCollectUserList(data) {
  123. return request.get('user/relation/product/lst', data)
  124. }
  125. /**
  126. * 获取产品评论
  127. * @param int id
  128. * @param object data
  129. *
  130. */
  131. export function getReplyList(id, data) {
  132. return request.get('store/product/reply/lst/' + id, data, {
  133. noAuth: true
  134. })
  135. }
  136. /**
  137. * 产品评价数量和好评度
  138. * @param int id
  139. */
  140. export function getReplyConfig(id) {
  141. return request.get('reply/config/' + id);
  142. }
  143. /**
  144. * 获取搜索关键字获取
  145. *
  146. */
  147. export function getSearchKeyword() {
  148. return request.get('common/hot_keyword', {}, {
  149. noAuth: true
  150. });
  151. }
  152. /**
  153. * 门店列表
  154. * @returns {*}
  155. */
  156. export function storeListApi(data) {
  157. return request.get("store_list", data, {
  158. noAuth: true
  159. });
  160. }
  161. /**
  162. * 商户列表
  163. * @returns {*}
  164. */
  165. export function storeMerchantList(data) {
  166. return request.get("store/merchant/lst", data, {
  167. noAuth: true
  168. });
  169. }
  170. /**
  171. * 获取商铺详情
  172. * @param {Object} id 商铺id
  173. * @param {Object} data 商铺数据
  174. */
  175. export function getStoreDetail(id, data) {
  176. return request.get("store/merchant/detail/" + id, data, {
  177. noAuth: true
  178. });
  179. }
  180. /**
  181. * 获取商铺商品列表
  182. * @param {Object} id 商铺 id
  183. * @param {Object} data 商铺商品列表数据
  184. */
  185. export function getStoreGoods(id, data) {
  186. return request.get("product/spu/merchant/" + id, data, {
  187. noAuth: true
  188. });
  189. }
  190. /**
  191. * 获取商铺分类列表
  192. * @param {Object} id 商铺 id
  193. * @param {Object} data
  194. */
  195. export function getStoreCategory(id, data) {
  196. return request.get("store/merchant/category/lst/" + id, data, {
  197. noAuth: true
  198. });
  199. }
  200. /**
  201. * 关注商铺
  202. * @param {Object} type_id 商铺 id
  203. */
  204. export function followStore(type_id) {
  205. return request.post("user/relation/create", {
  206. type: 10,
  207. type_id: type_id
  208. });
  209. }
  210. /**
  211. * 取消商铺关注
  212. * @param {Object} type_id 商铺 id
  213. */
  214. export function unfollowStore(type_id) {
  215. return request.post("user/relation/delete", {
  216. type: 10,
  217. type_id: type_id
  218. });
  219. }
  220. /**
  221. * 获取商铺优惠券
  222. * @param {Object} id
  223. */
  224. export function getStoreCoupon(id) {
  225. return request.get("coupon/store/" + id, {
  226. noAuth: true
  227. });
  228. }
  229. /**
  230. * 获取商铺优惠券
  231. */
  232. export function getMerchantLst(data) {
  233. return request.get("user/relation/merchant/lst", data, {
  234. noAuth: true
  235. });
  236. }
  237. /**
  238. * 物流信息
  239. */
  240. export function express(id) {
  241. return request.post("ordero/express/" + id, {
  242. noAuth: true
  243. });
  244. }
  245. /**
  246. * 子集分类
  247. * @returns {*}
  248. */
  249. export function storeCategory(pid) {
  250. return request.get("store/product/category", pid, {
  251. noAuth: true
  252. });
  253. }
  254. /**
  255. * 分销说明
  256. * @returns {*}
  257. */
  258. export function bagExplain() {
  259. return request.get("store/product/bag/explain");
  260. }
  261. /**
  262. * 分销礼包推荐列表
  263. * @returns {*}
  264. */
  265. export function bagRecommend() {
  266. return request.get("product/spu/bag/recommend");
  267. }
  268. /**
  269. * 分销礼包列表
  270. * @returns {*}
  271. */
  272. export function productBag(data) {
  273. return request.get("product/spu/bag", data, {
  274. noAuth: true
  275. });
  276. }
  277. /**
  278. * 商铺二维码
  279. * @returns {*}
  280. */
  281. export function merchantQrcode(id, data) {
  282. return request.get("store/merchant/qrcode/" + id, data, {
  283. noAuth: true
  284. });
  285. }
  286. /**
  287. * 推荐商品
  288. * @returns {*}
  289. */
  290. export function merchantProduct(id, data) {
  291. if (data.brand_id && Array.isArray(data.brand_id)) {
  292. data = {
  293. ...data
  294. }
  295. data.brand_id = data.brand_id.toString()
  296. }
  297. return request.get("product/spu/merchant/" + id, data, {
  298. noAuth: true
  299. });
  300. }
  301. /**
  302. * 推荐商品banner
  303. * @returns {*}
  304. */
  305. export function getHotBanner(type) {
  306. return request.get("common/hot_banner/" + type, {}, {
  307. noAuth: true
  308. });
  309. }
  310. /**
  311. * 商户入驻表单
  312. * @returns {*}
  313. */
  314. export function create(data) {
  315. return request.post("intention/create", data);
  316. }
  317. /**
  318. * 商户入驻短信验证码
  319. * @returns {*}
  320. */
  321. export function verify(data) {
  322. return request.post("auth/verify", data);
  323. }
  324. /**
  325. * 获取秒杀商品详情
  326. * @param int id
  327. *
  328. */
  329. export function getSeckillProductDetail(id) {
  330. return request.get('store/product/seckill/detail/' + id, {}, {
  331. noAuth: true
  332. });
  333. }
  334. /**
  335. * 直播推荐列表
  336. * @returns {*}
  337. */
  338. export function getLiveList() {
  339. return request.get("broadcast/hot", {}, {
  340. noAuth: true
  341. });
  342. }
  343. /**
  344. * 直播列表
  345. * @returns {*}
  346. */
  347. export function getBroadcastListApi(data) {
  348. return request.get("broadcast/lst", data, {
  349. noAuth: true
  350. });
  351. }
  352. /**
  353. * 商户分类
  354. * @returns {*}
  355. */
  356. export function merClassifly() {
  357. return request.get("intention/cate");
  358. }
  359. /**
  360. * 获取预售商品详情
  361. * @param int id
  362. *
  363. */
  364. export function getPresellProductDetail(id) {
  365. return request.get('store/product/presell/detail/' + id, {}, {
  366. noAuth: true
  367. });
  368. }
  369. /**
  370. * 获取商户申请记录
  371. * @param int id
  372. *
  373. */
  374. export function getApplicationRecordList(data) {
  375. return request.get('intention/lst', data);
  376. }
  377. /**
  378. * 获取商户申请详情
  379. * @param int id
  380. *
  381. */
  382. export function getGoodsDetails(id) {
  383. return request.get('intention/detail/' + id, {});
  384. }
  385. /**
  386. * 修改入驻信息
  387. * @param int id
  388. *
  389. */
  390. export function updateGoodsRecord(id, data) {
  391. return request.post('intention/update/' + id, data);
  392. }
  393. /**
  394. * 获取定位详细地址
  395. * @param int id
  396. *
  397. */
  398. export function getGeocoder(data) {
  399. return request.get(`lbs/geocoder?location=${data.lat},${data.long}`, {}, {
  400. noAuth: true
  401. });
  402. }