123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- /**
- * 这是与购物有关的业务逻辑的服务
- */
- export default class ProductService {
- constructor(AjaxService) {
- Object.assign(this, { AjaxService })
- this.name = 'ProductService'
- }
- /**
- * @查询搜索商品列表
- * @param:name 商品名称关键词
- * @param:pageNum 页码
- * @param:pageSize 条数
- */
- QueryProductList (data = {}) {
- return this.AjaxService.get({
- url:'/product/list',
- data,
- isLoading: false ,
- })
- }
- /**
- * @商品详情-查询商品详情
- * @param:userId 用户ID(未登录传0或者'')
- * @param:productIds 商品ID
- */
- QueryProductDetils (data = {}) {
- return this.AjaxService.get({
- url:'/product/details',
- data,
- isLoading: false ,
- })
- }
- /**
- * @加入购物车
- * @param:userId 用户ID(必填)
- * @param:productId 用户ID(必填)
- * @param:productCount 商品数量(必填)
- */
- shoppingAddCart (data = {}) {
- return this.AjaxService.post({
- url:'/shopping/add/cart',
- data,
- isLoading: false
- })
- }
- /**
- * @再次购买----一键加入购物车
- * @param:orderId 用户ID(必填)
- */
- ShoppingAgainCart (data = {}) {
- return this.AjaxService.get({
- url:'/shopping/addCart',
- data,
- isLoading: false
- })
- }
-
- /**
- * @购物车列表
- * @param:userId 用户ID(必填)
- */
- QueryShoppingCartList (data = {}) {
- return this.AjaxService.get({
- url:'/shopping/info',
- data,
- isLoading: false
- })
- }
- /**
- * @查询购物车数量
- * @param:userId 用户ID(必填)
- */
- QueryShoppingQuantity (data = {}) {
- return this.AjaxService.get({
- url:'/shopping/quantity',
- data,
- isLoading: false
- })
- }
- /**
- * @更新购物车商品增减
- * @param:cartId 购物车ID
- * @param:productCount 商品数量ID(必填)
- */
- ShoppingCartUpdate (data = {}) {
- return this.AjaxService.post({
- url:'/shopping/update',
- data,
- isLoading: true
- })
- }
- /**
- * @删除购物车商品
- * @param:cartIds 购物车ID(用','号拼接)
- */
- ShoppingCartDelete (data = {}) {
- return this.AjaxService.post({
- url:'/shopping/delete',
- data,
- isLoading: true
- })
- }
- /* 查询搜索历史记录 */
- GetProductSearchHistory (data = {}) {
- return this.AjaxService.get({
- url:'/product/search/history',
- data,
- isLoading: false ,
- })
- }
- /* 清除搜索历史记录 */
- GetDeleteProductSearchHistory (data = {}) {
- return this.AjaxService.get({
- url:'/product/delete/history',
- data,
- isLoading: false ,
- })
- }
- /* 搜索商品列表 */
- GetProductSearchList (data = {}) {
- return this.AjaxService.get({
- url:'/search/query/product',
- data,
- isLoading: true ,
- })
- }
- /* 活动专区 */
- GetProductActivityAreaList (data = {}) {
- return this.AjaxService.get({
- url:'/product/activityArea',
- data,
- isLoading: true ,
- })
- }
- /* 活动详情 */
- GetProductActivityDetails (data = {}) {
- return this.AjaxService.get({
- url:'/product/activity/details',
- data,
- isLoading: true ,
- })
- }
- }
|