Commit 9bdaff85 by 宋毅

tj

parent 6f01c503
...@@ -105,8 +105,8 @@ class tmqueryCtl extends CtlBase { ...@@ -105,8 +105,8 @@ class tmqueryCtl extends CtlBase {
if (!result) { if (!result) {
return system.getResult(null, "处理请求失败"); return system.getResult(null, "处理请求失败");
} }
if (["jd"].indexOf(pobj.actionProcess).length >= 0 && pobj.actionType == "subTmOrder") { if (["jd"].indexOf(pobj.actionProcess) >= 0 && pobj.actionType == "subTmOrder") {
var opPayPageInfoResult = await opPayPageInfo(pobj); var opPayPageInfoResult = await this.opPayPageInfo(pobj);
return opPayPageInfoResult; return opPayPageInfoResult;
} }
return result; return result;
...@@ -243,11 +243,15 @@ class tmqueryCtl extends CtlBase { ...@@ -243,11 +243,15 @@ class tmqueryCtl extends CtlBase {
} }
async opPayPageInfo(pobj) { async opPayPageInfo(pobj) {
if (pobj.actionProcess == "jd") { if (pobj.actionProcess == "jd") {
var tmpResult = this.opJdOrder(); var tmpResult = await this.opJdOrder();
if (!tmpResult.success && tmpResult.success != true) { console.log(tmpResult,"tmpResult...........opPayPageInfo........$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$....");
//记录下来 if (tmpResult && tmpResult.result && tmpResult.result == true) {
var payDataResult = JSON.parse(tmpResult.data);
if (payDataResult && payDataResult.success && payDataResult.success == true) {
system.getResultSuccess({ payUrl: tmpResult.data.returnUrl });
}//成功
} }
return system.getResultSuccess({ payUrl: tmpResult.data.returnUrl }); return system.getResult(null, "pay page is error");
} }
return system.getResultSuccess() return system.getResultSuccess()
} }
...@@ -300,26 +304,52 @@ class tmqueryCtl extends CtlBase { ...@@ -300,26 +304,52 @@ class tmqueryCtl extends CtlBase {
} }
console.log("\n post options:\n", options); console.log("\n post options:\n", options);
console.log("\n tmpContent:\n", tmpContent); console.log("\n tmpContent:\n", tmpContent);
var reqResult = await new Promise(function (resolve, reject) {
var req = http.request(options, function (res) { let req = http.request(options, function (res) {
console.log("statusCode: ", res.statusCode); // res.setEncoding(encoding);
console.log("headers: ", res.headers); console.log("statusCode: ", res.statusCode);
var _data = ''; console.log("headers: ", res.headers);
res.on('data', function (chunk) { var _data = '';
_data += chunk; res.on('data', function (chunk) {
_data += chunk;
});
res.on('end', function () {
console.log("\n--req---成功->>\nresult:", _data)
resolve({ result: true, data: _data });
});
}); });
res.on('end', function () { req.on('error', (e) => {
console.log("\n--->>\nresult:", _data) console.error(`请求遇到问题-------------: ${e.message}`);
resolve({ result: false, errmsg: e.message });
}); });
req.write(tmpContent);
req.end();
}); });
req.on('error', (e) => {
console.error(`请求遇到问题-------------: ${e.message}`);
});
req.write(tmpContent);
req.end();
var tmd = 99;
return reqResult;
// var req = http.request(options, function (res) {
// console.log("statusCode: ", res.statusCode);
// console.log("headers: ", res.headers);
// var _data = '';
// res.on('data', function (chunk) {
// _data += chunk;
// });
// res.on('end', function () {
// console.log("\n--->>\nresult:", _data)
// });
// });
// req.on('error', (e) => {
// console.error(`请求遇到问题-------------: ${e.message}`);
// });
// req.write(tmpContent);
// req.end();
// var tmd = 99;
} catch (errorMsg) { } catch (errorMsg) {
console.log(errorMsg, "--jd>>>>>>>errorMsg..............................>>>>>>"); console.log(errorMsg, "--jd>>>>>>>errorMsg..............................>>>>>>");
return { success: false, code: -200, msg: errorMsg.stack };
} }
} }
async pushJdOrder(pushData, req) { async pushJdOrder(pushData, req) {
......
...@@ -1242,13 +1242,23 @@ ...@@ -1242,13 +1242,23 @@
apply: that.apply, apply: that.apply,
nclones: that.nclOne, nclones: that.nclOne,
itemCode: that.itemCode, itemCode: that.itemCode,
channelUser: {
channelUserId: that.$route.query.channelUserId
},
channelOrder: {
quantity: 1,
payStatus: "dfk"
}
}; };
var jdObj = that.$root.copyParams(obj, "subTmOrder", "/action/tmOrder/springBoard", "yes", "yes"); var jdObj = that.$root.copyParams(obj, "subTmOrder", "/action/tmOrder/springBoard", "yes", "yes");
that.$root.postReq("/web/trademark/tmqueryCtl/doPost", jdObj).then(function (d) { that.$root.postReq("/web/trademark/tmqueryCtl/doPost", jdObj).then(function (d) {
console.log(`///////////////////////////////`, d);
if (d.status == 0) { if (d.status == 0) {
console.log(`///////////////////////////////`, d); that.$message.warning("操作成功");
location.href = d.data.payUrl;
} else { } else {
console.log(d); console.log(d, "subTmOrder..........");
that.$message.warning(d.msg);
} }
}).catch(function (e) { }).catch(function (e) {
that.$message.warning("操作失败"); that.$message.warning("操作失败");
......
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