store.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  1. // +----------------------------------------------------------------------
  2. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  3. // +----------------------------------------------------------------------
  4. // | Copyright (c) 2016~2024 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 getProductDetail(id) {
  17. return request.get('store/product/detail/' + id, {}, {
  18. noAuth: true
  19. });
  20. }
  21. /**
  22. * 获取产品详情参数
  23. * @param int id
  24. *
  25. */
  26. export function getProductParmas(id) {
  27. return request.get('store/product/show/' + id, {}, {
  28. noAuth: true
  29. });
  30. }
  31. /**
  32. * 获取店铺推荐商品
  33. * @param int id
  34. *
  35. */
  36. export function getStoreRecommend(id) {
  37. return request.get('store/product/good_list/' + id, {}, {
  38. noAuth: true
  39. });
  40. }
  41. /**
  42. * 获取预览商品详情
  43. * @param int id
  44. *
  45. */
  46. export function getPreviewProDetail(data) {
  47. return request.get('store/product/preview', data, {
  48. noAuth: true
  49. });
  50. }
  51. /**
  52. * 产品分享二维码 推广员
  53. * @param int id
  54. */
  55. export function getProductCode(id, data) {
  56. return request.get('store/product/qrcode/' + id, data, {
  57. noAuth: true
  58. });
  59. }
  60. /**
  61. * 添加收藏
  62. * @param int id
  63. * @param string category product=普通产品,product_seckill=秒杀产品
  64. */
  65. export function collectAdd(data) {
  66. return request.post('user/relation/create', data);
  67. }
  68. /**
  69. * 删除收藏产品
  70. * @param int id
  71. * @param string category product=普通产品,product_seckill=秒杀产品
  72. */
  73. export function collectDel(data) {
  74. return request.post('user/relation/delete', data);
  75. }
  76. /**
  77. * 购车添加
  78. *
  79. */
  80. export function postCartAdd(data) {
  81. return request.post('user/cart/create', data);
  82. }
  83. /**
  84. * 获取分类列表
  85. *
  86. */
  87. export function getCategoryList() {
  88. return request.get('store/product/category/lst', {}, {
  89. noAuth: true
  90. });
  91. }
  92. /**
  93. * 获取产品列表
  94. * @param object data
  95. */
  96. export function getProductslist(data) {
  97. if (data.brand_id && Array.isArray(data.brand_id)) {
  98. data = {
  99. ...data
  100. }
  101. data.brand_id = data.brand_id.toString()
  102. }
  103. return request.get('product/spu/lst', data, {
  104. noAuth: true
  105. });
  106. }
  107. /**
  108. * 获取优惠券商品列表
  109. * @param object data
  110. */
  111. export function getCouponProductlist(data) {
  112. if (data.brand_id && Array.isArray(data.brand_id)) {
  113. data = {
  114. ...data
  115. }
  116. data.brand_id = data.brand_id.toString()
  117. }
  118. return request.get('product/spu/coupon_product', data, {
  119. noAuth: true
  120. });
  121. }
  122. /**
  123. * 获取品牌列表
  124. * @param object data
  125. */
  126. export function getBrandlist(data) {
  127. return request.get('store/product/brand/lst', data, {
  128. noAuth: true
  129. });
  130. }
  131. /**
  132. * 获取推荐产品
  133. *
  134. */
  135. export function getProductHot(page, limit) {
  136. return request.get("product/spu/recommend", {
  137. page: page === undefined ? 1 : page,
  138. limit: limit === undefined ? 10 : limit
  139. }, {
  140. noAuth: true
  141. });
  142. }
  143. /**
  144. * 获取商户推荐产品
  145. *
  146. */
  147. export function getMerProductHot(id,data) {
  148. return request.get(`product/spu/recommend`, {
  149. page: data.page === undefined ? 1 : data.page,
  150. limit: data.limit === undefined ? 10 : data.limit,
  151. mer_id: id || ''
  152. }, {
  153. noAuth: true
  154. });
  155. }
  156. /**
  157. * 批量收藏
  158. *
  159. * @param object id
  160. * @param string category
  161. */
  162. export function collectAll(data) {
  163. return request.post('user/relation/batch/create', data);
  164. }
  165. /**
  166. * 首页产品的轮播图和产品信息
  167. * @param int type
  168. *
  169. */
  170. export function getGroomList(type, data) {
  171. return request.get('product/spu/hot/' + type, data, {
  172. noAuth: true
  173. });
  174. }
  175. /**
  176. * 获取商品收藏列表
  177. * @param object data
  178. */
  179. export function getCollectUserList(data) {
  180. return request.get('user/relation/product/lst', data)
  181. }
  182. /**
  183. * 获取商品收藏列表 -- 删除
  184. * @param object data
  185. */
  186. export function userCollectDel(data) {
  187. return request.post('user/relation/batch/delete', data)
  188. }
  189. /**
  190. * 获取产品评论
  191. * @param int id
  192. * @param object data
  193. *
  194. */
  195. export function getReplyList(id, data) {
  196. return request.get('store/product/reply/lst/' + id, data, {
  197. noAuth: true
  198. })
  199. }
  200. /**
  201. * 产品评价数量和好评度
  202. * @param int id
  203. */
  204. export function getReplyConfig(id) {
  205. return request.get('reply/config/' + id);
  206. }
  207. /**
  208. * 获取搜索关键字获取
  209. *
  210. */
  211. export function getSearchKeyword() {
  212. return request.get('common/hot_keyword', {}, {
  213. noAuth: true
  214. });
  215. }
  216. /**
  217. * 今日热搜列表
  218. *
  219. */
  220. export function getTodayHotSearch() {
  221. return request.get('product/spu/hot_lst', {}, {
  222. noAuth: true
  223. });
  224. }
  225. /**
  226. * 热销排行分类
  227. *
  228. */
  229. export function getHotRanking() {
  230. return request.get('product/spu/hot_top', {}, {
  231. noAuth: true
  232. });
  233. }
  234. /**
  235. * 商户列表
  236. * @returns {*}
  237. */
  238. export function storeMerchantList(data) {
  239. return request.get("store/merchant/lst", data, {
  240. noAuth: true
  241. });
  242. }
  243. /**
  244. * 获取商铺详情
  245. * @param {Object} id 商铺id
  246. * @param {Object} data 商铺数据
  247. */
  248. export function getStoreDetail(id, data) {
  249. return request.get("store/merchant/detail/" + id, data, {
  250. noAuth: true
  251. });
  252. }
  253. /**
  254. * 获取商铺商品列表
  255. * @param {Object} id 商铺 id
  256. * @param {Object} data 商铺商品列表数据
  257. */
  258. export function getStoreGoods(id, data) {
  259. return request.get("product/spu/merchant/" + id, data, {
  260. noAuth: true
  261. });
  262. }
  263. /**
  264. * 获取商铺分类列表
  265. * @param {Object} id 商铺 id
  266. * @param {Object} data
  267. */
  268. export function getStoreCategory(id, data) {
  269. return request.get("store/merchant/category/lst/" + id, data, {
  270. noAuth: true
  271. });
  272. }
  273. /**
  274. * 关注商铺
  275. * @param {Object} type_id 商铺 id
  276. */
  277. export function followStore(type_id) {
  278. return request.post("user/relation/create", {
  279. type: 10,
  280. type_id: type_id
  281. });
  282. }
  283. /**
  284. * 取消商铺关注
  285. * @param {Object} type_id 商铺 id
  286. */
  287. export function unfollowStore(type_id) {
  288. return request.post("user/relation/delete", {
  289. type: 10,
  290. type_id: type_id
  291. });
  292. }
  293. /**
  294. * 获取商铺优惠券
  295. * @param {Object} id
  296. */
  297. export function getStoreCoupon(id) {
  298. return request.get("coupon/store/" + id, {
  299. noAuth: true
  300. });
  301. }
  302. /**
  303. * 获取商铺优惠券
  304. */
  305. export function getMerchantLst(data) {
  306. return request.get("user/relation/merchant/lst", data, {
  307. noAuth: true
  308. });
  309. }
  310. /**
  311. * 物流信息
  312. */
  313. export function express(id) {
  314. return request.post("ordero/express/" + id, {
  315. noAuth: true
  316. });
  317. }
  318. /**
  319. * 子集分类
  320. * @returns {*}
  321. */
  322. export function storeCategory(pid) {
  323. return request.get("store/product/category", pid, {
  324. noAuth: true
  325. });
  326. }
  327. /**
  328. * 分销说明
  329. * @returns {*}
  330. */
  331. export function bagExplain() {
  332. return request.get("store/product/bag/explain");
  333. }
  334. /**
  335. * 分销礼包推荐列表
  336. * @returns {*}
  337. */
  338. export function bagRecommend() {
  339. return request.get("product/spu/bag/recommend");
  340. }
  341. /**
  342. * 分销礼包列表
  343. * @returns {*}
  344. */
  345. export function productBag(data) {
  346. return request.get("product/spu/bag", data, {
  347. noAuth: true
  348. });
  349. }
  350. /**
  351. * 商铺二维码
  352. * @returns {*}
  353. */
  354. export function merchantQrcode(id, data) {
  355. return request.get("store/merchant/qrcode/" + id, data, {
  356. noAuth: true
  357. });
  358. }
  359. /**
  360. * 推荐商品
  361. * @returns {*}
  362. */
  363. export function merchantProduct(id, data) {
  364. if (data.brand_id && Array.isArray(data.brand_id)) {
  365. data = {
  366. ...data
  367. }
  368. data.brand_id = data.brand_id.toString()
  369. }
  370. return request.get("product/spu/merchant/" + id, data, {
  371. noAuth: true
  372. });
  373. }
  374. /**
  375. * 推荐商品banner
  376. * @returns {*}
  377. */
  378. export function getHotBanner(type) {
  379. return request.get("common/hot_banner/" + type, {}, {
  380. noAuth: true
  381. });
  382. }
  383. /**
  384. * 商户入驻表单
  385. * @returns {*}
  386. */
  387. export function create(data) {
  388. return request.post("intention/create", data);
  389. }
  390. /**
  391. * 商户入驻短信验证码
  392. * @returns {*}
  393. */
  394. export function verify(data) {
  395. return request.post("auth/verify", data);
  396. }
  397. /**
  398. * 获取秒杀商品详情
  399. * @param int id
  400. *
  401. */
  402. export function getSeckillProductDetail(id,data) {
  403. return request.get('store/product/seckill/detail/' + id, data, {
  404. noAuth: true
  405. });
  406. }
  407. /**
  408. * 获取秒杀商品详情参数
  409. * @param int id
  410. *
  411. */
  412. // export function getSeckillProductParmas(id) {
  413. // return request.get('store/product/seckill/show/' + id, {}, {
  414. // noAuth: true
  415. // });
  416. // }
  417. /**
  418. * 直播推荐列表
  419. * @returns {*}
  420. */
  421. export function getLiveList(data) {
  422. return request.get(`broadcast/hot`, data, {
  423. noAuth: true
  424. });
  425. }
  426. /**
  427. * 直播列表
  428. * @returns {*}
  429. */
  430. export function getBroadcastListApi(data) {
  431. return request.get("broadcast/lst", data, {
  432. noAuth: true
  433. });
  434. }
  435. /**
  436. * 商户分类
  437. * @returns {*}
  438. */
  439. export function merClassifly() {
  440. return request.get("intention/cate", {}, {
  441. noAuth: true
  442. });
  443. }
  444. /**
  445. * 获取预售商品详情
  446. * @param int id
  447. *
  448. */
  449. export function getPresellProductDetail(id) {
  450. return request.get('store/product/presell/detail/' + id, {}, {
  451. noAuth: true
  452. });
  453. }
  454. /**
  455. * 获取商户申请记录
  456. * @param int id
  457. *
  458. */
  459. export function getApplicationRecordList(data) {
  460. return request.get('intention/lst', data);
  461. }
  462. /**
  463. * 获取商户申请详情
  464. * @param int id
  465. *
  466. */
  467. export function getGoodsDetails(id) {
  468. return request.get('intention/detail/' + id, {});
  469. }
  470. /**
  471. * 修改入驻信息
  472. * @param int id
  473. *
  474. */
  475. export function updateGoodsRecord(id, data) {
  476. return request.post('intention/update/' + id, data);
  477. }
  478. /**
  479. * 获取定位详细地址
  480. * @param int id
  481. *
  482. */
  483. export function getGeocoder(data) {
  484. return request.get(`lbs/geocoder?location=${data.lat},${data.long}`, {}, {
  485. noAuth: true
  486. });
  487. }
  488. /**
  489. * 获取店铺类型
  490. * @param int id
  491. *
  492. */
  493. export function getStoreTypeApi(data) {
  494. return request.get('intention/type', data, {
  495. noAuth: true
  496. });
  497. }
  498. /**
  499. * 获取参数列表
  500. * @param int id
  501. *
  502. */
  503. export function getParmasList(data) {
  504. return request.get('product/spu/params', data, {
  505. noAuth: true
  506. });
  507. }
  508. /**
  509. * 获取参数值列表
  510. * @param int id
  511. *
  512. */
  513. export function getParmasValue(id) {
  514. return request.get(`product/spu/params_value/${id}`, {}, {
  515. noAuth: true
  516. });
  517. }
  518. /**
  519. * 到货通知
  520. *
  521. */
  522. export function arrivalNoticeApi(data) {
  523. return request.post('store/product/increase_take',data);
  524. }
  525. /*
  526. 获取图片验证码
  527. */
  528. export function getCaptcha() {
  529. return request.get('captcha');
  530. }
  531. /*
  532. 获取店铺资质
  533. */
  534. export function storeCertificate(data) {
  535. return request.post(`store/certificate/${data.merId}`, data)
  536. }
  537. /**
  538. * 本地服务列表
  539. * @returns {*}
  540. */
  541. export function storeServiceList(id, data) {
  542. return request.get(`product/spu/local/${id}`, data, {
  543. noAuth: true
  544. });
  545. }
  546. /**
  547. * 复制口令
  548. * @returns {*}
  549. */
  550. export function copyPasswordApi(data) {
  551. return request.get(`product/spu/copy`, data, {
  552. noAuth: true
  553. });
  554. }
  555. /**
  556. * 口令搜索
  557. * @returns {*}
  558. */
  559. export function copyPasswordSearch(data) {
  560. return request.get(`command/copy`, data, {
  561. noAuth: true
  562. });
  563. }
  564. /**
  565. * 套餐列表
  566. * @returns {*}
  567. */
  568. export function getDiscountsLst(data) {
  569. return request.get(`discounts/lst`, data, {
  570. noAuth: true
  571. });
  572. }
  573. /**
  574. * 套餐--立即购买
  575. * @returns {*}
  576. */
  577. export function discountsCartAdd(data) {
  578. return request.post('user/cart/batchCreate', data);
  579. }
  580. /**
  581. * 商品--价格说明
  582. * @returns {*}
  583. */
  584. export function priceRuleApi(id) {
  585. return request.get(`store/product/price_rule/${id}`, {}, {
  586. noAuth: true
  587. });
  588. }