Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
9bdaff85
Commit
9bdaff85
authored
Dec 09, 2019
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
6f01c503
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
22 deletions
+62
-22
igirl-channel-jdweb/app/base/controller/impl/trademark/tmqueryCtl.js
+50
-20
igirl-channel-jdweb/app/front/vues/pages/selftmreg/selftmreg.js
+12
-2
No files found.
igirl-channel-jdweb/app/base/controller/impl/trademark/tmqueryCtl.js
View file @
9bdaff85
...
...
@@ -105,8 +105,8 @@ class tmqueryCtl extends CtlBase {
if
(
!
result
)
{
return
system
.
getResult
(
null
,
"处理请求失败"
);
}
if
([
"jd"
].
indexOf
(
pobj
.
actionProcess
)
.
length
>=
0
&&
pobj
.
actionType
==
"subTmOrder"
)
{
var
opPayPageInfoResult
=
await
opPayPageInfo
(
pobj
);
if
([
"jd"
].
indexOf
(
pobj
.
actionProcess
)
>=
0
&&
pobj
.
actionType
==
"subTmOrder"
)
{
var
opPayPageInfoResult
=
await
this
.
opPayPageInfo
(
pobj
);
return
opPayPageInfoResult
;
}
return
result
;
...
...
@@ -243,11 +243,15 @@ class tmqueryCtl extends CtlBase {
}
async
opPayPageInfo
(
pobj
)
{
if
(
pobj
.
actionProcess
==
"jd"
)
{
var
tmpResult
=
this
.
opJdOrder
();
if
(
!
tmpResult
.
success
&&
tmpResult
.
success
!=
true
)
{
//记录下来
var
tmpResult
=
await
this
.
opJdOrder
();
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
.
getResult
Success
({
payUrl
:
tmpResult
.
data
.
returnUrl
}
);
return
system
.
getResult
(
null
,
"pay page is error"
);
}
return
system
.
getResultSuccess
()
}
...
...
@@ -300,26 +304,52 @@ class tmqueryCtl extends CtlBase {
}
console
.
log
(
"
\
n post options:
\
n"
,
options
);
console
.
log
(
"
\
n tmpContent:
\
n"
,
tmpContent
);
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
;
var
reqResult
=
await
new
Promise
(
function
(
resolve
,
reject
)
{
let
req
=
http
.
request
(
options
,
function
(
res
)
{
// res.setEncoding(encoding);
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--req---成功->>
\
nresult:"
,
_data
)
resolve
({
result
:
true
,
data
:
_data
});
});
});
res
.
on
(
'end'
,
function
()
{
console
.
log
(
"
\
n--->>
\
nresult:"
,
_data
)
req
.
on
(
'error'
,
(
e
)
=>
{
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
)
{
console
.
log
(
errorMsg
,
"--jd>>>>>>>errorMsg..............................>>>>>>"
);
return
{
success
:
false
,
code
:
-
200
,
msg
:
errorMsg
.
stack
};
}
}
async
pushJdOrder
(
pushData
,
req
)
{
...
...
igirl-channel-jdweb/app/front/vues/pages/selftmreg/selftmreg.js
View file @
9bdaff85
...
...
@@ -1242,13 +1242,23 @@
apply
:
that
.
apply
,
nclones
:
that
.
nclOne
,
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"
);
that
.
$root
.
postReq
(
"/web/trademark/tmqueryCtl/doPost"
,
jdObj
).
then
(
function
(
d
)
{
console
.
log
(
`///////////////////////////////`
,
d
);
if
(
d
.
status
==
0
)
{
console
.
log
(
`///////////////////////////////`
,
d
);
that
.
$message
.
warning
(
"操作成功"
);
location
.
href
=
d
.
data
.
payUrl
;
}
else
{
console
.
log
(
d
);
console
.
log
(
d
,
"subTmOrder.........."
);
that
.
$message
.
warning
(
d
.
msg
);
}
}).
catch
(
function
(
e
)
{
that
.
$message
.
warning
(
"操作失败"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment