Commit 64ef0608 by xsren@gongsibao.com

工商H5

parent c27bcea7
......@@ -31,9 +31,11 @@ class ProductAPI extends WEBBase {
case "getProductDetail"://根据渠道产品编码获取产品详情
opResult = await this.utilsProductSve.getProductDetail(pobj, pobj.actionBody);
break;
case "getProductPrice":
opResult = await this.utilsProductSve.getProductPrice(pobj,pobj.actionBody)
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
}
return opResult;
}
......
......@@ -32,6 +32,9 @@ class Need extends APIBase {
case "submitNeed"://提交需求
opResult = await this.utilsNeedSve.submitNeed(pobj, pobj.actionBody);
break;
case "submitNeedH5"://提交需求
opResult = await this.utilsNeedSve.submitNeedH5(pobj, pobj.actionBody);
break;
case "needClose"://关闭需求
opResult = await this.utilsNeedSve.needClose(pobj, pobj.actionBody);
break;
......
......@@ -66,6 +66,59 @@ class UtilsNeedService extends AppServiceBase {
var data = JSON.parse(rtn.stdout);
return data;
}
/**
* 提交需求
* @param {*} pobj
* @param {*} actionBody
*/
async submitNeedH5(pobj, actionBody) {
var sobj = pobj;
sobj.actionType = "getProductTypeInfo";
var url = settings.centerAppUrl() + "action/opProduct/springBoard";
var rtn = await this.execClient.execPost(sobj, url);
if (!rtn || !rtn.stdout) {
return system.getResultFail(-5015, "需求類型查询失败");
}
var data = JSON.parse(rtn.stdout);
if (data.status != 0) {
return system.getResultFail(-5015, "需求類型查询失败");
}
pobj.actionBody.type_code = data.data.type_code;
pobj.actionBody.type_name = data.data.type_name;
pobj.actionBody.channel_type_code = data.data.channel_type_code;
pobj.actionBody.channel_type_name = data.data.channel_type_name;
pobj.actionType = "submitNeedH5";
var reqUrl = this.centerOrderUrl + "action/need/springBoard";
var result = await this.restPostUrl(pobj, reqUrl);
if (result.status == 0) {
if(pobj.actionBody.channel_type_code=="esp.companyreg"){
this.utilsPushSve.aliBusiness2Fq(pobj, "pushNeedBusiness");
}
// else{
// if(pobj.actionBody.channel_type_code==5){
// pobj.actionBody.regType="ali.icp";
// }else{
// pobj.actionBody.regType="ali.edi";
// }
// this.utilsPushSve.aliBusiness2Fq(pobj, "intention");
// }
}
return result;
}
//调用center-order icp需求反馈
async reqCenterOrderApi(pobj, reqUrl) {
var url = this.centerOrderUrl + "action/icpapi/springBoard";
if (reqUrl) {
var url = this.centerOrderUrl + reqUrl;
}
pobj.actionType = "receiveIcpFeedback";
var rtn = await this.execClient.execPost(pobj, url);
var data = JSON.parse(rtn.stdout);
return data;
}
/**
* 获取需求详情
* @param {*} pobj
......
......@@ -38,6 +38,17 @@ class UtilsProductService extends AppServiceBase {
//--------------------------------应用中心获取产品信息--end----------------------------------------------------
/**
* 产品询价
* @param pobj.actionType ='getProductPrice'
* @param actionBody
* @returns {Promise<{msg: *, data, bizmsg: *|string, status: number}>}
*/
async getProductPrice(pobj,actionBody){
pobj.actionType = 'getProductPrice'
let url = settings.centerAppUrl() + "action/opProduct/springBoard";
return await this.restPostUrl(pobj, url);
}
}
module.exports = UtilsProductService;
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