You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
shop-app/common/api/goods.js

54 lines
1.4 KiB

3 years ago
/*
* @Author: ch
* @Date: 2022-04-02 09:54:53
* @LastEditors: ch
* @LastEditTime: 2022-04-09 15:28:08
3 years ago
* @Description: file content
*/
import {ToAsyncAwait, MsbRequest} from '@/common/utils';
const BASE_URL = '/mall/product';
3 years ago
/**
* 获取商品瀑布流
* @param {*} params
*/
export const ApiGetGoodsList = (params) =>
ToAsyncAwait(MsbRequest.get(`${BASE_URL}/app/product/page`, params));
/**
* 获取推荐商品
* @param {*} params
*/
export const ApiGetRecommendedGoodsList = (params) =>
ToAsyncAwait(MsbRequest.get(`${BASE_URL}/app/product/recommended`, params));
3 years ago
/**
* 获取商品详情
* @param {*} params
*/
export const ApiGetGoodsDetail = (params) =>
ToAsyncAwait(MsbRequest.get(`${BASE_URL}/app/product/${params.id}`));
3 years ago
/**
* 获取商品sku信息
* @param {*} productId
*/
export const ApiGetGoodsSkus = (params) =>
3 years ago
ToAsyncAwait(MsbRequest.get(`${BASE_URL}/app/product/sku`,params));
/**
* 获取首页分类导航
*/
export const ApiGetCategoryNav = () =>
ToAsyncAwait(MsbRequest.get(`${BASE_URL}/app/product/categoryNavigation`));
/**
* 获取一级分类列表
*/
export const ApiGetCategoryOneList = () =>
ToAsyncAwait(MsbRequest.get(`${BASE_URL}/app/productCategory/levelOne`));
/**
* 获取二级分类和商品列表
*/
export const ApiGetCategoryTwoAndGoods = (params) =>
ToAsyncAwait(MsbRequest.get(`${BASE_URL}/app/productCategory/listCategoryAndProduct/${params.categoryId}`));