Commit 3b9cad34 by xsren@gongsibao.com

tj

parent 17a8686e
...@@ -28,6 +28,9 @@ class ProductAPI extends WEBBase { ...@@ -28,6 +28,9 @@ class ProductAPI extends WEBBase {
case "getProductList"://通过产品类别编码路径获取产品列表 case "getProductList"://通过产品类别编码路径获取产品列表
opResult = await this.utilsProductSve.getProductList(pobj, pobj.actionBody); opResult = await this.utilsProductSve.getProductList(pobj, pobj.actionBody);
break; break;
case "getProductListH5"://通过产品类别编码路径获取产品列表
opResult = await this.utilsProductSve.getProductListH5(pobj, pobj.actionBody);
break;
case "getProductDetail"://根据渠道产品编码获取产品详情 case "getProductDetail"://根据渠道产品编码获取产品详情
opResult = await this.utilsProductSve.getProductDetail(pobj, pobj.actionBody); opResult = await this.utilsProductSve.getProductDetail(pobj, pobj.actionBody);
break; break;
......
...@@ -23,6 +23,34 @@ class UtilsProductService extends AppServiceBase { ...@@ -23,6 +23,34 @@ class UtilsProductService extends AppServiceBase {
var url = settings.centerAppUrl() + "action/opProduct/springBoard"; var url = settings.centerAppUrl() + "action/opProduct/springBoard";
return await this.restPostUrl(pobj, url); return await this.restPostUrl(pobj, url);
} }
/**
* 获取产品列表及最低价
* @param pobj
* @param actionBody
* @returns {Promise<{msg: *, data, bizmsg: *|string, status: number}|any>}
*/
async getProductListH5(pobj, actionBody) {
if (!actionBody.pathCode) {
return system.getResult(null, "actionBody.pathCode can not be empty,100330");
}
pobj.actionType = 'getProductList';
pobj.actionBody.pathCode = "/" + actionBody.pathCode + "/";
var url = settings.centerAppUrl() + "action/opProduct/springBoard";
let list = await this.restPostUrl(pobj, url);
if(!list.data){
return system.getResult(null,'product data is empty')
}
for(let item of list.data){
pobj.actionType = 'getMinPrice';
pobj.actionBody = {
product_id:item.product_id
}
let re = await this.restPostUrl(pobj,url);
item.price = re.data.price;
}
return list;
}
/** /**
* 获取产品详情 * 获取产品详情
* @param {*} pobj * @param {*} pobj
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment