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
bcc8ce0a
Commit
bcc8ce0a
authored
Apr 11, 2023
by
youjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
eebde973
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
113 additions
and
14 deletions
+113
-14
alipay.vue
src/components/pay/alipay.vue
+101
-0
pay.vue
src/pages/pay/pay.vue
+12
-14
No files found.
src/components/pay/alipay.vue
0 → 100644
View file @
bcc8ce0a
<
template
>
<div>
<q-dialog
v-model=
"$q.platform.is.desktop"
persistent
>
<q-card
flat
class=
"q-pa-lg"
style=
"width:600px !important;max-width:600px !important"
>
<div
class=
"text-h6 text-weight-bold q-mb-lg"
>
支付宝支付
</div>
<div
class=
"text-center"
>
<q-inner-loading
:showing=
"loading"
label=
"正在加載中"
></q-inner-loading>
<div
v-if=
"$q.platform.is.desktop && orderNo && payUrl!='' && !loading"
>
<div
class=
"row justify-center"
>
<!--
<QrcodeVue
level=
"H"
size=
"200"
:value=
"payUrl"
class=
"light-shadow"
></QrcodeVue>
<img
src=
"../../assets/img/pay/wx_tip.jpg"
class=
"q-ml-md"
style=
"height:200px;"
>
-->
</div>
<div
class=
"text-body2 q-mt-lg text-grey-6"
>
請點擊支付,前往支付寶(Alipay)支付,使用支付寶[掃一掃]掃描二維碼進行支付
</div>
<div
class=
"q-mt-lg text-right"
>
<q-btn
outline
dense
label=
"取消支付"
color=
"primary"
class=
"q-px-md q-mr-md"
@
click=
"cancelPayHandler"
></q-btn>
<q-btn
v-if=
"isPay"
unelevated
dense
label=
"已完成付款"
:loading=
"checkLoading"
color=
"primary"
class=
"q-px-md q-mr-md"
@
click=
"checkPaySatausHandler(1)"
></q-btn>
<q-btn
v-if=
"!isPay"
unelevated
dense
label=
"支付"
:loading=
"checkLoading"
color=
"primary"
class=
"q-px-md"
@
click=
"Gotopay"
></q-btn>
</div>
</div>
<div
class=
"q-ma-xl"
v-if=
"!orderNo && !loading"
>
創建付款連接失敗,請刷新頁面重試
</div>
</div>
</q-card>
</q-dialog>
</div>
</
template
>
<
script
>
import
QrcodeVue
from
'qrcode.vue'
export
default
{
data
()
{
return
{
loading
:
true
,
showDialog
:
true
,
payUrl
:
'weixin://wxpay/bizpayurl?pr=CDXqaD1zz'
,
checkLoading
:
false
,
isPay
:
true
}
},
props
:{
orderNo
:{
type
:
String
,
required
:
true
}
},
components
:{
QrcodeVue
},
created
()
{
if
(
this
.
orderNo
){
this
.
initPayInfo
()
}
else
{
this
.
loading
=
false
}
},
methods
:
{
Gotopay
(){
this
.
OpenNewUrl
(
this
.
payUrl
)
},
initPayInfo
(){
this
.
apipost
(
"GetAliPayByOrderNo_post"
,{
OrderNo
:
this
.
orderNo
},
r
=>
{
if
(
r
.
data
.
resultCode
==
1
){
this
.
payUrl
=
r
.
data
.
data
.
QrCode
this
.
checkPaySatausHandler
()
}
this
.
loading
=
false
})
},
checkPaySatausHandler
(
type
){
this
.
apipost
(
"GetAliPayByOrderNo_post"
,{
OrderNo
:
this
.
orderNo
},
r
=>
{
if
(
r
.
data
.
resultCode
==
1
){
if
(
r
.
data
.
data
.
OrderStatus
==
2
||
r
.
data
.
data
.
OrderStatus
==
3
){
this
.
CommonJump
(
"/paysuccess/"
+
this
.
orderNo
,
{});
}
else
{
this
.
isPay
=
false
if
(
type
==
1
){
this
.
$message
.
error
(
"當前訂單未支付,請您繼續完成訂單支付"
)
}
}
}
else
{
location
.
reload
()
}
},
e
=>
{
})
},
cancelPayHandler
(){
this
.
$emit
(
"cancel"
)
}
},
}
</
script
>
<
style
>
</
style
>
\ No newline at end of file
src/pages/pay/pay.vue
View file @
bcc8ce0a
...
...
@@ -77,6 +77,7 @@
</div>
<div
class=
"q-mt-md"
v-if=
"showPay != ''"
>
<wechatpay
@
cancel=
"cancelPayHandler"
v-if=
"showPay == 'wechat'"
:order-no=
"orderNo"
></wechatpay>
<alichatpay
@
cancel=
"cancelPayHandler"
v-if=
"showPay == 'alipay'"
:order-no=
"orderNo"
></alichatpay>
</div>
</q-card>
...
...
@@ -116,6 +117,7 @@
<
script
>
import
wechatpay
from
"../../components/pay/wepay"
;
import
alichatpay
from
"../../components/pay/alipay"
;
import
NoneData
from
"src/components/common/noneData.vue"
;
export
default
{
data
()
{
...
...
@@ -127,29 +129,25 @@ export default {
orderInfo
:
null
};
},
components
:
{
wechatpay
,
NoneData
},
components
:
{
wechatpay
,
alichatpay
,
NoneData
},
created
()
{
this
.
checkParamsHandler
()
},
methods
:
{
showPayFormHandler
(
payStr
)
{
this
.
showPay
=
payStr
;
//
支付宝支付
if
(
this
.
showPay
&&
this
.
showPay
==
'alipay'
){
this
.
checkPaySatausHandler
()
}
//
打开支付宝二维码支付界面
//
if(this.showPay&&this.showPay=='alipay'){
// this.getAliPay
()
//
}
},
checkPaySatausHandler
(){
getAliPay
(){
this
.
apipost
(
"GetAliPayByOrderNo_post"
,{
OrderNo
:
this
.
orderNo
},
r
=>
{
if
(
r
.
data
.
resultCode
==
1
){
if
(
r
.
data
.
data
.
OrderStatus
==
2
||
r
.
data
.
data
.
OrderStatus
==
3
){
this
.
CommonJump
(
"/paysuccess/"
+
this
.
orderNo
,
{});
}
else
{
let
url
=
r
.
data
.
data
.
QrCode
if
(
url
){
this
.
OpenNewUrl
(
url
)
}
}
let
url
=
r
.
data
.
data
.
QrCode
if
(
url
){
this
.
OpenNewUrl
(
url
)
}
}
else
{
location
.
reload
()
}
...
...
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