Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
A
accord-with-name
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
malin
accord-with-name
Commits
d15b7930
Commit
d15b7930
authored
Apr 15, 2021
by
malin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
t
parent
37fb11e5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
59 deletions
+59
-59
PayInfo.vue
src/views/Pay/child_cpn/PayInfo.vue
+53
-54
index.vue
src/views/Result/index.vue
+6
-5
No files found.
src/views/Pay/child_cpn/PayInfo.vue
View file @
d15b7930
...
...
@@ -67,7 +67,11 @@
class=
"row-center-center fc-f fs-36 ff-pp fw-5"
style=
"margin-top: 0.66rem; position: relative"
>
<div
ref=
"payBtn"
class=
"pay-btn row-center-center"
@
click=
"_payment"
>
<div
ref=
"payBtn"
class=
"pay-btn row-center-center"
@
click
.
once=
"_payment"
>
<div>
立即支付
</div>
<div
v-if=
"loading"
class=
"loading"
></div>
...
...
@@ -140,61 +144,56 @@ export default {
async
_payment
()
{
this
.
$refs
.
payBtn
.
style
.
opacity
=
"0.5"
;
this
.
loading
=
true
;
setTimeout
(()
=>
{
const
h5LogsObj
=
JSON
.
parse
(
decodeURI
(
utils
.
getCookie
(
"h5LogsObj"
)));
let
link
=
decodeURI
(
utils
.
getCookie
(
"link"
));
let
params_createorder
=
{
zygt
:
"hzwz"
,
tgtk
:
1
,
uid
:
122193
,
pkg
:
"com.h5game.peidui"
,
source
:
h5LogsObj
.
source
?
h5LogsObj
.
source
:
"toutiao"
,
};
// 获取订单号
let
res_order
=
await
API
.
API_createorder
(
params_createorder
,
this
.
baseInfo
);
const
orderId
=
res_order
.
result
.
data
.
orderId
;
utils
.
setCookie
(
"orderId"
,
orderId
,
0
);
// 将orderId放入cookie中
// 上报-- > 信息收集;
API
.
API_h5Logs
({
outTradeNo
:
orderId
,
link
:
link
,
clickId
:
h5LogsObj
.
clickid
,
source
:
h5LogsObj
.
source
,
pkg
:
h5LogsObj
.
pkg
,
}).
then
((
res
)
=>
{
console
.
log
(
"收集数据==="
,
res
);
});
// 支付
API
.
API_gatewayCreateorder
({
payPlatform
:
1
,
payType
:
2
,
wxType
:
"H5Page"
,
orderType
:
5
,
// pkg: h5LogsObj.pkg,
pkg
:
h5LogsObj
.
pkg
?
h5LogsObj
.
pkg
:
"com.h5game.peidui"
,
outTradeNo
:
orderId
,
totalFee
:
1
,
}).
then
((
res
)
=>
{
this
.
$refs
.
payBtn
.
style
.
opacity
=
"1"
;
this
.
loading
=
false
;
},
4000
);
if
(
this
.
loading
)
{
const
h5LogsObj
=
JSON
.
parse
(
decodeURI
(
utils
.
getCookie
(
"h5LogsObj"
)));
let
link
=
decodeURI
(
utils
.
getCookie
(
"link"
));
let
params_createorder
=
{
zygt
:
"hzwz"
,
tgtk
:
1
,
uid
:
122193
,
pkg
:
"com.h5game.peidui"
,
source
:
h5LogsObj
.
source
?
h5LogsObj
.
source
:
"toutiao"
,
};
// 获取订单号
let
res_order
=
await
API
.
API_createorder
(
params_createorder
,
this
.
baseInfo
);
const
orderId
=
res_order
.
result
.
data
.
orderId
;
utils
.
setCookie
(
"orderId"
,
orderId
,
0
);
// 将orderId放入cookie中
// 上报-- > 信息收集;
API
.
API_h5Logs
({
outTradeNo
:
orderId
,
link
:
link
,
clickId
:
h5LogsObj
.
clickid
,
source
:
h5LogsObj
.
source
,
pkg
:
h5LogsObj
.
pkg
,
}).
then
((
res
)
=>
{
console
.
log
(
"收集数据==="
,
res
);
});
// 支付
API
.
API_gatewayCreateorder
({
payPlatform
:
1
,
payType
:
2
,
wxType
:
"H5Page"
,
orderType
:
5
,
// pkg: h5LogsObj.pkg,
pkg
:
h5LogsObj
.
pkg
?
h5LogsObj
.
pkg
:
"com.h5game.peidui"
,
outTradeNo
:
orderId
,
totalFee
:
1
,
}).
then
((
res
)
=>
{
this
.
$refs
.
payBtn
.
style
.
opacity
=
"1"
;
this
.
loading
=
false
;
let
mwebUrl
=
res
.
result
.
data
.
wakeup
.
mwebUrl
;
let
tempUrl
=
window
.
location
.
href
;
tempUrl
=
tempUrl
.
replace
(
"pay"
,
"result"
);
window
.
location
.
href
=
`
${
mwebUrl
}
&redirect_url=
${
tempUrl
}
?pay_cb=1`
;
});
}
let
mwebUrl
=
res
.
result
.
data
.
wakeup
.
mwebUrl
;
let
tempUrl
=
window
.
location
.
href
;
tempUrl
=
tempUrl
.
replace
(
"pay"
,
"result"
);
window
.
location
.
href
=
`
${
mwebUrl
}
&redirect_url=
${
tempUrl
}
?pay_cb=1`
;
});
},
// 倒计时
...
...
src/views/Result/index.vue
View file @
d15b7930
...
...
@@ -137,7 +137,7 @@ export default {
}
else
{
return
this
.
_fetchInfo
();
}
},
2
000
);
},
1
000
);
return
;
}
});
...
...
@@ -169,12 +169,13 @@ export default {
}
else
{
// 支付不成功
setTimeout
(()
=>
{
if
(
this
.
countdown
==
1
)
{
if
(
this
.
countdown
>
1
)
{
return
this
.
$router
.
push
({
path
:
"/pay"
,
query
:
this
.
baseInfo
});
}
else
{
this
.
countdown
+=
1
;
this
.
_queryOrder
();
}
this
.
countdown
+=
1
;
this
.
_queryOrder
();
},
2000
);
},
1000
);
}
});
},
...
...
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