Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
million
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
viitto
million
Commits
13a3ac79
Commit
13a3ac79
authored
Jun 28, 2023
by
youjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
48d9406a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
9 deletions
+55
-9
alipay.vue
src/components/pay/alipay.vue
+55
-9
No files found.
src/components/pay/alipay.vue
View file @
13a3ac79
...
...
@@ -23,6 +23,10 @@
<!--
<q-btn
v-if=
"isPay"
unelevated
dense
label=
"退款"
:loading=
"checkLoading"
color=
"primary"
class=
"q-px-md"
@
click=
"GetAliPayReturn"
></q-btn>
-->
<!--
<q-btn
v-if=
"!isPay"
unelevated
dense
label=
"支付"
:loading=
"checkLoading"
color=
"primary"
class=
"q-px-md"
@
click=
"Gotopay"
></q-btn>
-->
<!--
{{
min
&&
sec
?
min
+
'分'
+
sec
+
'秒'
:
min
==
0
&&
sec
?
sec
+
'秒'
:
'支付'
}}
-->
<q-btn
unelevated
dense
:label=
"KeepTimeTitle"
:loading=
"TimeLoading"
:disable=
"!TimeLoading"
color=
"primary"
class=
"q-px-md"
@
click=
"KeepTimeTitle=='刷新二维码'?initPayInfo(1):''"
></q-btn>
</div>
</div>
<div
class=
"q-ma-xl"
v-if=
"!orderNo && !loading"
>
...
...
@@ -39,14 +43,22 @@
<
script
>
import
QrcodeVue
from
'qrcode.vue'
import
{
date
}
from
'quasar'
export
default
{
data
()
{
return
{
TimeLoading
:
false
,
KeepTimeTitle
:
''
,
loading
:
true
,
showDialog
:
true
,
payUrl
:
''
,
checkLoading
:
false
,
isPay
:
true
isPay
:
true
,
formattedString
:
null
,
day
:
''
,
hr
:
''
,
min
:
''
,
sec
:
''
}
},
props
:{
...
...
@@ -67,22 +79,56 @@ export default {
},
methods
:
{
getIfram
(){
// var iframe = document.getElementById('aliIframe');
// var innerDoc = iframe.contentWindow.document.body.HTML;
// console.log(iframe,'000000')
// console.log(innerDoc,'----')
},
//倒计时
countdown
()
{
const
end
=
Date
.
parse
(
new
Date
(
this
.
formattedString
))
const
now
=
Date
.
parse
(
new
Date
())
const
msec
=
end
-
now
if
(
msec
<
0
)
return
;
let
day
=
parseInt
(
msec
/
1000
/
60
/
60
/
24
)
let
hr
=
parseInt
(
msec
/
1000
/
60
/
60
%
24
)
let
min
=
parseInt
(
msec
/
1000
/
60
%
60
)
let
sec
=
parseInt
(
msec
/
1000
%
60
)
this
.
day
=
day
this
.
hr
=
hr
>
9
?
hr
:
'0'
+
hr
this
.
min
=
min
>
9
?
min
:
'0'
+
min
this
.
sec
=
sec
>
9
?
sec
:
'0'
+
sec
this
.
KeepTimeTitle
=
'60秒'
const
that
=
this
if
(
min
>=
0
&&
sec
>=
0
){
//倒计时结束关闭订单
if
(
min
==
0
){
this
.
KeepTimeTitle
=
this
.
sec
+
'秒'
}
if
(
min
==
0
&&
sec
==
0
){
this
.
KeepTimeTitle
=
'刷新二维码'
return
}
setTimeout
(
function
()
{
that
.
countdown
()
},
1000
)
}
},
Gotopay
(){
this
.
OpenNewUrl
(
this
.
payUrl
)
},
initPayInfo
(){
initPayInfo
(
type
){
if
(
type
){
this
.
TimeLoading
=
true
}
this
.
apipost
(
"GetAliPayByOrderNo_post"
,{
OrderNo
:
this
.
orderNo
},
r
=>
{
if
(
r
.
data
.
resultCode
==
1
){
let
timeStamp
=
Date
.
now
()
timeStamp
=
timeStamp
+
(
1
*
1000
*
60
)
this
.
formattedString
=
date
.
formatDate
(
timeStamp
,
'YYYY-MM-DD HH:mm:ss'
)
this
.
countdown
()
this
.
payUrl
=
r
.
data
.
data
.
QrCode
this
.
checkPaySatausHandler
()
}
this
.
loading
=
false
this
.
loading
=
false
setTimeout
(()
=>
{
this
.
TimeLoading
=
false
},
500
)
})
},
checkPaySatausHandler
(
type
){
...
...
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