/** * 这是与购物有关的业务逻辑的服务 */ 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 , }) } }