Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
U
uni-pdtravel
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
panyongping
uni-pdtravel
Commits
44040ee8
Commit
44040ee8
authored
Jun 02, 2022
by
潘永坪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
反扫开发
parent
da281927
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
3 deletions
+42
-3
orderPayment.vue
pages/payment/orderPayment/orderPayment.vue
+42
-3
No files found.
pages/payment/orderPayment/orderPayment.vue
View file @
44040ee8
...
@@ -97,6 +97,7 @@
...
@@ -97,6 +97,7 @@
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
enterUrl
:
''
,
//进入页面路由
merchantName
:
''
,
//商户名称
merchantName
:
''
,
//商户名称
productName
:
''
,
//产品名称
productName
:
''
,
//产品名称
orderList
:
''
,
//订单列表
orderList
:
''
,
//订单列表
...
@@ -113,6 +114,7 @@
...
@@ -113,6 +114,7 @@
package
:
''
,
package
:
''
,
signType
:
''
,
signType
:
''
,
paySign
:
''
,
paySign
:
''
,
orderInfo
:
''
,
//支付宝订单号
background
:
''
,
//去支付的背景颜色
background
:
''
,
//去支付的背景颜色
orderId
:
''
,
//订单Id
orderId
:
''
,
//订单Id
openid
:
''
,
//用户Id
openid
:
''
,
//用户Id
...
@@ -121,7 +123,18 @@
...
@@ -121,7 +123,18 @@
}
}
},
},
onLoad
(
option
){
onLoad
(
option
){
//#ifdef MP-WEIXIN
this
.
enterUrl
=
option
.
q
//#endif
//#ifdef MP-ALIPAY
this
.
enterUrl
=
uni
.
getStorageSync
(
'alipayQrCode'
)
//#endif
if
(
this
.
enterUrl
){
this
.
orderId
=
this
.
getUrlKey
(
'orderId'
)
}
else
{
this
.
orderId
=
option
.
orderId
this
.
orderId
=
option
.
orderId
}
this
.
ifyukuaiCode
=
option
.
ifyukuaiCode
this
.
ifyukuaiCode
=
option
.
ifyukuaiCode
this
.
afterBuyUrl
=
option
.
afterBuyUrl
||
'/pages/my/order/orderList/orderList'
this
.
afterBuyUrl
=
option
.
afterBuyUrl
||
'/pages/my/order/orderList/orderList'
this
.
openid
=
uni
.
getStorageSync
(
'openid'
)
||
''
this
.
openid
=
uni
.
getStorageSync
(
'openid'
)
||
''
...
@@ -193,6 +206,8 @@
...
@@ -193,6 +206,8 @@
this
.
package
=
res
.
data
.
package
this
.
package
=
res
.
data
.
package
this
.
signType
=
res
.
data
.
signType
this
.
signType
=
res
.
data
.
signType
this
.
paySign
=
res
.
data
.
sign
this
.
paySign
=
res
.
data
.
sign
//支付宝入参
this
.
orderInfo
=
res
.
data
.
payInfo
||
''
//支付参数结束
//支付参数结束
this
.
pdOrderMoney
=
res
.
data
.
pdOrderMoney
this
.
pdOrderMoney
=
res
.
data
.
pdOrderMoney
if
(
this
.
pdOrderMoney
==
0
&&
res
.
data
.
subOrderType
==
-
1
){
//0元购直接跳电子门票页面
if
(
this
.
pdOrderMoney
==
0
&&
res
.
data
.
subOrderType
==
-
1
){
//0元购直接跳电子门票页面
...
@@ -234,6 +249,8 @@
...
@@ -234,6 +249,8 @@
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
background
=
'f9690e'
this
.
background
=
'f9690e'
},
1000
)
},
1000
)
// #ifdef MP-WEIXIN
uni
.
requestPayment
({
uni
.
requestPayment
({
provider
:
'wxpay'
,
provider
:
'wxpay'
,
timeStamp
:
this
.
timeStamp
,
timeStamp
:
this
.
timeStamp
,
...
@@ -253,7 +270,29 @@
...
@@ -253,7 +270,29 @@
})
})
}
}
})
})
//#endif
// #ifdef MP-ALIPAY
uni
.
requestPayment
({
provider
:
'alipay'
,
// 服务提供商 支付宝支付: alipay 微信支付: wxpay
orderInfo
:
this
.
orderInfo
,
// 支付宝订单号
success
:
function
(
res
)
{
uni
.
navigateTo
({
url
:
_this
.
afterBuyUrl
+
'?orderId='
+
_this
.
orderId
+
'&ifyukuaiCode='
+
_this
.
ifyukuaiCode
})
},
fail
:
function
(
err
)
{
uni
.
showToast
({
title
:
err
.
errMsg
,
icon
:
'none'
})
}
}
})
// #endif
},
getUrlKey
(
name
){
//---------------------------------------------------------------获取url
return
(
new
RegExp
(
'[?|&]'
+
name
+
'='
+
'([^&;]+?)(&|#|;|$)'
).
exec
(
decodeURIComponent
(
this
.
enterUrl
))
||
[,
''
])[
1
].
replace
(
/
\+
/g
,
'%20'
)
||
''
},
}
}
}
}
</
script
>
</
script
>
...
...
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