123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559 |
- /**
- * 这是与购物有关的业务逻辑的服务
- */
- export default class ProductService {
- constructor(AjaxService) {
- Object.assign(this, { AjaxService })
- this.name = 'ProductService'
- }
- /**
- * @商城首页-常用商品列表
- * @param:userId 用户ID(未登录传0或者''),
- * @param:preferredFlag 新品上线(001) 优惠商品(010) 常用商品(100),,
- * @param:pageNum 页码
- * @param:pageSize 每页条数
- */
- queryProductPreferred (data = {}) {
- return this.AjaxService.get({ url:'/product/preferred', data, isLoading: false })
- }
- /**
- * @分类-商品列表
- * @param:userId 用户ID(未登录传0或者''),
- * @param:bigTypeID
- * @param:smallTypeID,
- * @param:tinyTypeID
- * @param:sortType
- * @param:pageNum 页码
- * @param:pageSize 每页条数
- */
- GetProductListByTypeID(data = {}) {
- return this.AjaxService.get({ url:'/product/listByTypeID', data, isLoading: false })
- }
- /**
- * @商品列表-查询商品价格
- * @param:userId 用户ID(未登录传0或者'')
- * @param:productID 商品ID','符号拼接
- */
- querySearchProductPrice (data = {}) {
- return this.AjaxService.get({
- url:'/commodity/price/list',
- data,
- isLoading: false ,
-
- })
- }
-
- /**
- * @查询凑单商品页初始化
- * @param:promotionsId 促销ID
- */
- queryProductPromotionInfo (data = {}) {
- return this.AjaxService.get({
- url:'/commodity/promotions/info',
- data,
- isLoading: false ,
-
- })
- }
- /**
- * @查询凑单商品列表
- * @param:promotionsId 促销ID
- * @param:pageSize 查询条数
- * @param:pageNum 查询页数
- */
- queryProductPromotionList (data = {}) {
- return this.AjaxService.get({
- url:'/commodity/promotions/product',
- data,
- isLoading: true ,
-
- })
- }
-
- /**
- * @商品详情-查询商品详情
- * @param:userId 用户ID(未登录传0或者'')
- * @param:productIds 商品ID
- */
- QueryProductDetils (data = {}) {
- return this.AjaxService.get({
- url:'/commodity/product/details',
- data,
- isLoading: false ,
-
- })
- }
- /**
- * @商品详情-查看相关优惠券
- * @param:userId 用户ID(未登录传0或者'')
- * @param:productId 商品ID
- * @param:source 来源 1 WWW 2小程序
- * @param:status 优惠券领取状态 1 未领取 2 已领取
- */
- QueryProductDetilsCoupons (data = {}) {
- return this.AjaxService.get({
- url:'/commodity/coupon/details/coupons',
- data,
- isLoading: true ,
-
- })
- }
- /**
- * @商品详情-相关推荐
- * @param:productIds 商品ID
- */
- queryProductDetilsRelevant (data = {}) {
- return this.AjaxService.get({
- url:'/commodity/detail/recommend',
- data,
- isLoading: false ,
- })
- }
-
- /**
- * @加入购物车
- * @param:userId 用户ID(必填)
- * @param:productID 用户ID(必填)
- * @param:productCount 商品数量(必填)
- */
- shoppingAddCart (data = {}) {
- return this.AjaxService.post({
- url:'/order/club/cart/add',
- data,
- isLoading: true ,
-
- })
- }
- /**
- * @批量加入购物车
- * @param:userId 用户ID(必填)
- * @param:productInfo 商品及数量信息:[// 商品Id 数量]
- */
- ShoppingAddCarts (data = {}) {
- return this.AjaxService.post({
- url:'/order/club/cart/add/bulk',
- data,
- isLoading: true ,
-
- })
- }
- /**
- * @机构添加购物车替换Sku
- * @param:userId 用户ID(必填)
- */
- ShoppingCheckSku (data = {}) {
- return this.AjaxService.get({
- url:'/order/club/check/sku',
- data,
- isLoading: false ,
-
- })
- }
- /**
- * @查询购物车数量
- * @param:userId 用户ID(必填)
- */
- ProductCartNumber (data = {}) {
- return this.AjaxService.get({
- url:'/order/club/cart/count',
- data,
- isLoading: false ,
- })
- }
-
- /**
- * @购物车列表
- * @param:userId 用户ID(必填)
- */
- QueryShoppingCartList (data = {}) {
- return this.AjaxService.get({
- url:'/order/club/cart/list',
- data,
- isLoading: false ,
-
- })
- }
-
- /**
- * @更新购物车加减数量
- * @param:userId 用户ID(必填)
- */
- ShoppingCartUpdate (data = {}) {
- return this.AjaxService.post({
- url:'/order/club/cart/update',
- data,
- isLoading: false ,
-
- })
- }
-
- /**
- * @购物车领券弹窗优惠券列表
- * @param:userId 用户ID(必填)
- * @param:shopId 供应商ID(必填)
- * @param:source 来源 1 WWW 2小程序
- * @param:status 状态 1 未领取 2已领取
- */
- ShoppingCartGetCoupon(data = {}) {
- return this.AjaxService.get({
- url:'/order/club/coupon',
- data,
- isLoading: true ,
-
- })
- }
- /**
- * @删除购物车商品
- * @param:userId 用户ID(必填)
- * @param:productIDs 商品ID(用','号拼接)
- */
- ShoppingCartDelete (data = {}) {
- return this.AjaxService.post({
- url:'/order/club/cart/delete',
- data,
- isLoading: true ,
-
- })
- }
- /* 二级列表 */
- GetPageTopic (data = {}) {
- return this.AjaxService.get({ url:'/commodity/page/floor', data, isLoading: false })
- }
- /* 二级列表banner */
- GetPageTopicBanner (data = {}) {
- return this.AjaxService.get({ url:'/commodity/page/floor', data, isLoading: false })
- }
- /* 活动专题列表 */
- GetPromotionsrList (data = {}) {
- return this.AjaxService.get({
- url:'/commodity/promotions/list',
- data,
- isLoading: true ,
-
- })
- }
- /* 搜索项目仪器列表 */
- GetSearchEquipmentList (data = {}) {
- return this.AjaxService.get({
- url:'/commodity/search/query/equipment',
- data,
- isLoading: true ,
-
- })
- }
- /* 项目仪器详情 */
- GetEquipmentDetails (data = {}) {
- return this.AjaxService.get({
- url:'/commodity/equipment/details',
- data,
- isLoading: true ,
-
- })
- }
- /* 查询搜索历史记录 */
- GetProductSearchHistory (data = {}) {
- return this.AjaxService.get({
- url:'/commodity/search/query/history',
- data,
- isLoading: false ,
- })
- }
- /* 添加搜索历史记录 */
- GetAddProductSearchHistory (data = {}) {
- return this.AjaxService.get({
- url:'/commodity/search/query/history/add',
- data,
- isLoading: true ,
- })
- }
- /* 清除搜索历史记录 */
- GetDeleteProductSearchHistory (data = {}) {
- return this.AjaxService.get({
- url:'/commodity/search/query/history/delete',
- data,
- isLoading: false ,
- })
- }
- /* 搜索商品列表 */
- GetProductSearchList (data = {}) {
- return this.AjaxService.get({
- url:'/commodity/search/query/product',
- data,
- isLoading: true ,
-
- })
- }
- /* 搜索分类商品列表 */
- GetSearchProductTypeData (data = {}) {
- return this.AjaxService.get({
- url:'/commodity/search/query/product/type',
- data,
- isLoading: true,
-
- })
- }
- /* 搜索分类商品列表 */
- GetSearchCombinationProduct (data = {}) {
- return this.AjaxService.get({
- url:'/commodity/seller/product/combination',
- data,
- isLoading: true,
-
- })
- }
- /* 获取商品评价 */
- GetProductEvaluate (data = {}) {
- return this.AjaxService.get({ url:'/product/evaluate', data, isLoading: false })
- }
- /* 获取再次购买商品列表 */
- GetRepeatBuyAgainProductList (data = {}) {
- return this.AjaxService.get({
- url:'/commodity/product/repeat',
- data,
- isLoading: true ,
-
- })
- }
- /* 新商品搜索查询商品阶梯价格 */
- GetSearchProductLadderPrice (data = {}) {
- return this.AjaxService.get({
- url:'/commodity/price/ladder',
- data,
- isLoading: false,
-
- })
- }
- /* 获取分类导航 */
- GetProductClassify (data = {}) {
- return this.AjaxService.get({ url:'/product/classify', data, isLoading: true })
- }
- /* 获取小程序三个模块商品列表 */
- GetProductPreferred (data = {}) {
- return this.AjaxService.get({ url:'/product/preferred', data, isLoading: true })
- }
- /* 发票信息回显 */
- GetPersonalCenterFindInvoice (data = {}) {
- return this.AjaxService.get({ url:'/personalCenter/findInvoice', data, isLoading: false })
- }
- /* 发票信息保存 */
- GetPersonalCenterInvoice (data = {}) {
- return this.AjaxService.post({ url:'/personalCenter/invoice', data, isLoading: true })
- }
- /**
- * @优惠券-是定商品活动页列表
- * @param:userId 用户userId(未登录传0)
- * @param:pageNum 页码
- * @param:pageSize 每页条数
- * @param:couponId 优惠券ID
- */
- QueryCouponActivityList (data = {}) {
- return this.AjaxService.get({
- url:'/commodity/coupon/activity/page',
- data,
- isLoading: true,
-
- })
- }
- /**
- * @优惠券-个人中心优惠券列表
- * @param:userId 用户userId(必传)
- * @param:pageNum 页码
- * @param:pageSize 每页条数
- * @param:status 使用状态 1未使用 2已使用 3已失效
- */
- QueryCouponCenter (data = {}) {
- return this.AjaxService.get({
- url:'/commodity/coupon/center',
- data,
- isLoading: false ,
-
- })
- }
- /**
- * @优惠券-领取中心优惠券列表
- * @param:userId 用户userId(未登录传0)
- * @param:pageNum 每页页码
- * @param:pageSize 条数
- */
- QueryCouponCollarList (data = {}) {
- return this.AjaxService.get({
- url:'/commodity/coupon/collar/list',
- data,
- isLoading: false ,
-
- })
- }
- /**
- * @优惠券-美博会优惠券列表
- * @param:userId 用户userId(未登录传0)
- * @param:pageNum 每页页码
- * @param:pageSize 条数
- */
- QueryCouponCenterList (data = {}) {
- return this.AjaxService.get({
- url:'/commodity/coupon/center/list',
- data,
- isLoading: false ,
-
- })
- }
- /**
- * @优惠券-协销价值优惠券列表
- * @param:pageNum 每页页码
- * @param:pageSize 条数
- */
- QueryMoneyCouponList (data = {}) {
- return this.AjaxService.get({
- url:'/commodity/coupon/money/coupon/list',
- data,
- isLoading: true ,
-
- })
- }
- /**
- * @优惠券-根据优惠券查询优惠券详细信息
- * @param:couponId 优惠券Id
- */
- QueryCouponDetail (data = {}) {
- return this.AjaxService.get({
- url:'/commodity/coupon/coupon/detail',
- data,
- isLoading: true ,
-
- })
- }
- /**
- * @优惠券-领取优惠券
- * @param:userId 用户userId
- * @param:couponId 优惠券Id
- * @param:source 来源: 1WWW 2小程序
- */
- ReceiveCoupon (data = {}) {
- return this.AjaxService.post({
- url:'/commodity/coupon/collar',
- data,
- isLoading: true ,
-
- })
- }
- /**
- * @优惠券-兑换优惠券
- * @param:userId 用户userId
- * @param:redemptionCode 优惠券兑换码
- * @param:source 来源: 1WWW 2小程序
- */
- ExchangeCoupon (data = {}) {
- return this.AjaxService.post({
- url:'/commodity/coupon/redeem',
- data,
- isLoading: true ,
-
- })
- }
- /**
- * @优惠券-我的优惠券数量统计
- * @param:userId 用户userId(必传)
- */
- QueryCouponsCount (data = {}) {
- return this.AjaxService.get({
- url:'/commodity/coupon/coupons/count',
- data,
- isLoading: false ,
-
- })
- }
- /**
- * @商品收藏-操作
- * @param:userId 用户userId(必传)
- * @param:productId 商品Id
- */
- getProductUserLike (data = {}) {
- return this.AjaxService.get({
- url:'/commodity/userLike/likeOne',
- data,
- isLoading: false ,
-
- })
- }
- /**
- * @商品收藏-列表
- * @param:userId 用户userId(必传)
- * @param:pageNum 页码
- * @param:pageSize 条数
- */
- getProductUserLikeList (data = {}) {
- return this.AjaxService.get({
- url:'/commodity/userLike/likeList',
- data,
- isLoading: false ,
-
- })
- }
- /**
- * @商品收藏-取消收藏
- * @param:userId 用户userId(必传)
- * @param:productIDs 商品Id字符串逗号隔开
- */
- getDeleteUserLike (data = {}) {
- return this.AjaxService.get({
- url:'/commodity/userLike/deleteList',
- data,
- isLoading: false ,
-
- })
- }
- /**
- * @会员优惠商品
- * @param:userId 用户userId(必传)
- * @param:productIDs 商品Id字符串逗号隔开
- */
- getSvipProductPage (data = {}) {
- return this.AjaxService.get({
- url:'/commodity/svip/product/page',
- data,
- isLoading: true ,
-
- })
- }
- /**
- * @商品详情组合商品列表
- * @param:userId 用户userId(必传)
- * @param:productId 商品Id字符串逗号隔开
- * @param:source 来源 1 网站 2 小程序
- */
- getCommodityCombinationList (data = {}) {
- return this.AjaxService.get({
- url:'/commodity/seller/combination/list',
- data,
- isLoading: true ,
-
- })
- }
- /**
- * @搜索筛选项查询商品品牌
- * @param:keyword 关键词
- * @param:id 分类id
- * @param:idtype 1 一级分类 2 二级分类 3 三级分类
- * @param:identity
- */
- getCommoditySearchQUeryBrand (data = {}) {
- return this.AjaxService.get({
- url:'/commodity/search/query/brand',
- data,
- isloading: true ,
-
- })
- }
- /**
- * @数据统计
- * @param:TypeId 1:首页banner;2:直播模块;3:最新活动;4:热门文章;5:新品橱窗;6:活动列表
- */
- sYsStatisticsTypesSatisticsNumber (data = {}) {
- return this.AjaxService.get({
- url:'/commodity/StatisticsType/statisticsNumber',
- data,
- isLoading: false ,
-
- })
- }
- }
|