...
|
...
|
@@ -7,6 +7,9 @@ |
|
|
const api = global.yoho.API;
|
|
|
const config = global.yoho.config;
|
|
|
|
|
|
/**
|
|
|
* 商品的 banner
|
|
|
*/
|
|
|
const getProductBannerAsync = (pid) => {
|
|
|
return api.get('', {
|
|
|
method: 'web.productBanner.data',
|
...
|
...
|
@@ -15,7 +18,10 @@ const getProductBannerAsync = (pid) => { |
|
|
|
|
|
};
|
|
|
|
|
|
const sizeInfoAsync = skn => {
|
|
|
/**
|
|
|
* 商品尺寸
|
|
|
*/
|
|
|
const sizeInfoAsync = (skn) => {
|
|
|
return api.get('', {
|
|
|
method: 'h5.product.intro',
|
|
|
productskn: skn
|
...
|
...
|
@@ -23,15 +29,20 @@ const sizeInfoAsync = skn => { |
|
|
|
|
|
};
|
|
|
|
|
|
// 退换支持
|
|
|
const isSupportReturnedSale = skn => {
|
|
|
/**
|
|
|
* 特殊商品退换货
|
|
|
*/
|
|
|
const isSupportReturnedSale = (skn) => {
|
|
|
return api.get('', {
|
|
|
method: 'app.product.refundExchange',
|
|
|
product_skn: skn
|
|
|
}, config.apiCache);
|
|
|
};
|
|
|
|
|
|
const getProductComfortAsync = pid => {
|
|
|
/**
|
|
|
* 商品舒适度
|
|
|
*/
|
|
|
const getProductComfortAsync = (pid) => {
|
|
|
return api.get('', {
|
|
|
method: 'web.productComfort.data',
|
|
|
product_id: pid
|
...
|
...
|
@@ -39,14 +50,20 @@ const getProductComfortAsync = pid => { |
|
|
|
|
|
};
|
|
|
|
|
|
const getProductModelCardAsync = pid => {
|
|
|
/**
|
|
|
* 模特卡
|
|
|
*/
|
|
|
const getProductModelCardAsync = (pid) => {
|
|
|
return api.get('', {
|
|
|
method: 'web.productModelcard.list',
|
|
|
product_id: pid
|
|
|
}, config.apiCache);
|
|
|
};
|
|
|
|
|
|
const getProductModelTryAsync = skn => {
|
|
|
/**
|
|
|
* 模特试穿
|
|
|
*/
|
|
|
const getProductModelTryAsync = (skn) => {
|
|
|
return api.get('', {
|
|
|
method: 'web.productModelTry.data',
|
|
|
product_skn: skn
|
...
|
...
|
@@ -55,8 +72,6 @@ const getProductModelTryAsync = skn => { |
|
|
|
|
|
/**
|
|
|
* 获得产品信息
|
|
|
* @param pid
|
|
|
* @returns {Promise.<type>}
|
|
|
*/
|
|
|
const getProductAsync = (pid, uid, isStudents, vipLevel) => {
|
|
|
let params = {
|
...
|
...
|
@@ -78,6 +93,9 @@ const getProductAsync = (pid, uid, isStudents, vipLevel) => { |
|
|
return api.get('', params, config.apiCache);
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 促销信息
|
|
|
*/
|
|
|
const getPromotionAsync = (skn) => {
|
|
|
let params = {
|
|
|
method: 'app.product.promotion',
|
...
|
...
|
@@ -87,6 +105,9 @@ const getPromotionAsync = (skn) => { |
|
|
return api.get('', params, config.apiCache);
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 限购商品
|
|
|
*/
|
|
|
const getLimitedProductStatusAsync = (code, uid, skn) => {
|
|
|
let params = {
|
|
|
method: 'app.limitProduct.productStatus',
|
...
|
...
|
@@ -105,9 +126,7 @@ const getLimitedProductStatusAsync = (code, uid, skn) => { |
|
|
};
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
* @param skn product_skn
|
|
|
* @param sid shop_id
|
|
|
* 店铺推荐
|
|
|
*/
|
|
|
const getShopRecommendAsync = (skn, page, limit) => {
|
|
|
return api.get('', {
|
...
|
...
|
@@ -118,6 +137,16 @@ const getShopRecommendAsync = (skn, page, limit) => { |
|
|
});
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 套餐和量贩
|
|
|
*/
|
|
|
const getBundleAsync = (skn) => {
|
|
|
return api.get('', {
|
|
|
method: 'query.product.bundleSkn',
|
|
|
product_skn: skn
|
|
|
});
|
|
|
};
|
|
|
|
|
|
module.exports = {
|
|
|
getProductBannerAsync,
|
|
|
sizeInfoAsync,
|
...
|
...
|
@@ -128,5 +157,6 @@ module.exports = { |
|
|
getPromotionAsync,
|
|
|
isSupportReturnedSale,
|
|
|
getLimitedProductStatusAsync,
|
|
|
getShopRecommendAsync
|
|
|
getShopRecommendAsync,
|
|
|
getBundleAsync
|
|
|
}; |
...
|
...
|
|