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
5c5c61ca
Commit
5c5c61ca
authored
Jun 02, 2023
by
潘永坪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支付页面参数修改
parent
3ad0f954
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
441 additions
and
430 deletions
+441
-430
App.vue
App.vue
+71
-70
login.vue
pages/login/login.vue
+17
-15
orderPayment.vue
pages/payment/orderPayment/orderPayment.vue
+13
-11
ourPayment.vue
pages/payment/ourPayment/ourPayment.vue
+339
-333
paySuccess.vue
pages/payment/paySuccess/paySuccess.vue
+1
-1
No files found.
App.vue
View file @
5c5c61ca
<
script
>
<
script
>
// 1、uni-app的页面生命周期仅在page页面有效,而单独封装的组件中【页面周期无效】,
// 1、uni-app的页面生命周期仅在page页面有效,而单独封装的组件中【页面周期无效】,
//但是Vue的生命周期依然有效 【Vue的生命周期在任何地方都是有效的,即你仍然可以在uni-app项目中使用Vue生命周期,但是不建议这么做】
//但是Vue的生命周期依然有效 【Vue的生命周期在任何地方都是有效的,即你仍然可以在uni-app项目中使用Vue生命周期,但是不建议这么做】
// 2、推荐使用uni-app里面的onLoad 代替 vue 里面的 created
// 2、推荐使用uni-app里面的onLoad 代替 vue 里面的 created
// 3、推荐使用uni-app里面的onReady 代替 vue 里面的 mounted
// 3、推荐使用uni-app里面的onReady 代替 vue 里面的 mounted
//4.setStorageSync与setStorage的区别:如果后续的操作需要使用更新storage后保存的data,则使用setStorageSync使用异步性能更好,使用同步数据更安全
//4.setStorageSync与setStorage的区别:如果后续的操作需要使用更新storage后保存的data,则使用setStorageSync使用异步性能更好,使用同步数据更安全
export
default
{
export
default
{
onLaunch
:
function
(
options
)
{
//初始化完成时触发(全局只触发一次
onLaunch
:
function
(
options
)
{
//初始化完成时触发(全局只触发一次
let
today
=
this
.
$commonjs
.
today
()
let
today
=
this
.
$commonjs
.
today
()
let
oldDate
=
uni
.
getStorageSync
(
'oldDate'
)
let
oldDate
=
uni
.
getStorageSync
(
'oldDate'
)
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
//#endif
//#endif
//#ifdef MP-ALIPAY
//#ifdef MP-ALIPAY
uni
.
setStorageSync
(
'appid'
,
'2021001194629244'
)
if
(
options
.
query
&&
options
.
query
.
qrCode
)
{
if
(
options
.
query
&&
options
.
query
.
qrCode
)
{
uni
.
setStorageSync
(
'alipayQrCode'
,
options
.
query
.
qrCode
)
uni
.
setStorageSync
(
'alipayQrCode'
,
options
.
query
.
qrCode
)
}
else
{
}
else
{
...
@@ -71,7 +72,7 @@
...
@@ -71,7 +72,7 @@
onHide
:
function
()
{
onHide
:
function
()
{
}
}
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
>
<
style
lang=
"scss"
>
...
...
pages/login/login.vue
View file @
5c5c61ca
...
@@ -40,9 +40,11 @@ export default {
...
@@ -40,9 +40,11 @@ export default {
let
data
=
{
let
data
=
{
code
:
res
.
code
,
code
:
res
.
code
,
source
,
//微信小程序3,支付宝小程序4
source
,
//微信小程序3,支付宝小程序4
companyId
:
uni
.
getStorageSync
(
'enterOptions'
).
query
.
companyId
||
''
,
appid
:
uni
.
getStorageSync
(
'appid'
)
||
''
appid
:
uni
.
getStorageSync
(
'appid'
)
||
''
}
}
if
(
uni
.
getStorageSync
(
'enterOptions'
).
query
){
data
.
companyId
=
uni
.
getStorageSync
(
'enterOptions'
).
query
.
companyId
||
''
}
_this
.
$request
(
'wechat/wx/getUserInfoByCode'
,
data
).
then
(
res
=>
{
_this
.
$request
(
'wechat/wx/getUserInfoByCode'
,
data
).
then
(
res
=>
{
if
(
res
.
code
==
'00'
)
{
if
(
res
.
code
==
'00'
)
{
let
openid
=
res
.
data
.
openid
let
openid
=
res
.
data
.
openid
...
...
pages/payment/orderPayment/orderPayment.vue
View file @
5c5c61ca
...
@@ -140,9 +140,11 @@ export default {
...
@@ -140,9 +140,11 @@ export default {
let
data
=
{
let
data
=
{
code
:
res
.
code
,
code
:
res
.
code
,
source
,
//微信小程序3,支付宝小程序4
source
,
//微信小程序3,支付宝小程序4
companyId
:
uni
.
getStorageSync
(
'enterOptions'
).
query
.
companyId
||
''
,
appid
:
uni
.
getStorageSync
(
'appid'
)
||
''
appid
:
uni
.
getStorageSync
(
'appid'
)
||
''
}
}
if
(
uni
.
getStorageSync
(
'enterOptions'
).
query
){
data
.
companyId
=
uni
.
getStorageSync
(
'enterOptions'
).
query
.
companyId
||
''
}
_this
.
$request
(
'wechat/wx/getUserInfoByCode'
,
data
)
_this
.
$request
(
'wechat/wx/getUserInfoByCode'
,
data
)
.
then
(
res
=>
{
.
then
(
res
=>
{
if
(
res
.
code
==
'00'
)
{
if
(
res
.
code
==
'00'
)
{
...
...
pages/payment/ourPayment/ourPayment.vue
View file @
5c5c61ca
...
@@ -83,67 +83,68 @@
...
@@ -83,67 +83,68 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
orderCoupon
from
"@/components/orderCoupon.vue"
import
orderCoupon
from
'@/components/orderCoupon.vue'
export
default
{
export
default
{
components
:{
components
:{
orderCoupon
orderCoupon
},
},
data
()
{
data
()
{
return
{
return
{
enterUrl
:
""
,
//进入页面路由
enterUrl
:
''
,
//进入页面路由
buyMoney
:
""
,
//输入金额
buyMoney
:
''
,
//输入金额
companyId
:
""
,
//公司Id
companyId
:
''
,
//公司Id
merchantId
:
""
,
//商户Id
merchantId
:
''
,
//商户Id
name
:
""
,
//商家名称
name
:
''
,
//商家名称
payType
:
""
,
//支付类型,微信小程序42,支付宝小程序33
payType
:
''
,
//支付类型,微信小程序42,支付宝小程序33
paySign
:
""
,
//签名
paySign
:
''
,
//签名
signType
:
""
,
//签名方式
signType
:
''
,
//签名方式
timeStamp
:
""
,
//时间戳
timeStamp
:
''
,
//时间戳
nonceStr
:
""
,
//随机字符串
nonceStr
:
''
,
//随机字符串
package
:
""
,
//订单详情扩展字符串
package
:
''
,
//订单详情扩展字符串
orderInfo
:
""
,
//支付宝订单号
orderInfo
:
''
,
//支付宝订单号
flag
:
""
,
//setTimeout函数
flag
:
''
,
//setTimeout函数
couponData
:
""
,
//所有劵数据
couponData
:
''
,
//所有劵数据
chooseCouponObj
:
""
,
//默认选中最优价格优惠券
chooseCouponObj
:
''
,
//默认选中最优价格优惠券
savedMoney
:
0
,
//优惠金额
savedMoney
:
0
,
//优惠金额
ableConpon
:
""
,
//没有可用优惠券时,达到一定条件可用,显示达到的条件
ableConpon
:
''
,
//没有可用优惠券时,达到一定条件可用,显示达到的条件
orderSource
:
8
,
//1公众号平台、2公众号组合页面1、3公众号组合页面2、4胖丁伙伴app、5第三方自助机、6第三方票房窗口、7平台快捷买单、8扫码支付
orderSource
:
8
,
//1公众号平台、2公众号组合页面1、3公众号组合页面2、4胖丁伙伴app、5第三方自助机、6第三方票房窗口、7平台快捷买单、8扫码支付
background
:
""
,
//普通按钮背景颜色
background
:
''
,
//普通按钮背景颜色
spaceBackground
:
""
,
//回格按钮背景颜色
spaceBackground
:
''
,
//回格按钮背景颜色
payBackground
:
"#1dce2e"
,
//支付背景颜色
payBackground
:
'#1dce2e'
,
//支付背景颜色
leftList
:[
//左侧按钮数据
leftList
:[
//左侧按钮数据
{
{
child
:[
child
:[
{
text
:
1
,
background
:
""
},
{
text
:
1
,
background
:
''
},
{
text
:
2
,
background
:
""
},
{
text
:
2
,
background
:
''
},
{
text
:
3
,
background
:
""
}
{
text
:
3
,
background
:
''
}
]
]
},
},
{
{
child
:[
child
:[
{
text
:
4
,
background
:
""
},
{
text
:
4
,
background
:
''
},
{
text
:
5
,
background
:
""
},
{
text
:
5
,
background
:
''
},
{
text
:
6
,
background
:
""
},
{
text
:
6
,
background
:
''
},
]
]
},
},
{
{
child
:[
child
:[
{
text
:
7
,
background
:
""
},
{
text
:
7
,
background
:
''
},
{
text
:
8
,
background
:
""
},
{
text
:
8
,
background
:
''
},
{
text
:
9
,
background
:
""
},
{
text
:
9
,
background
:
''
},
]
]
},
},
{
{
child
:[
child
:[
{
text
:
0
,
background
:
""
},
{
text
:
0
,
background
:
''
},
{
text
:
'.'
,
background
:
""
},
{
text
:
'.'
,
background
:
''
},
]
]
}
}
],
],
orderId
:
""
,
//订单Id
orderId
:
''
,
//订单Id
paydJumpUrl
:
""
,
//页面跳转路径
paydJumpUrl
:
''
,
//页面跳转路径
companyAttribute
:
""
,
//等于5时为出租车
companyAttribute
:
''
,
//等于5时为出租车
timer
:
null
,
//定时器
timer
:
null
,
//定时器
extendInfo
:
''
//额外信息
}
}
},
},
onLoad
(
option
)
{
onLoad
(
option
)
{
...
@@ -153,19 +154,21 @@
...
@@ -153,19 +154,21 @@
//#endif
//#endif
//#ifdef MP-ALIPAY
//#ifdef MP-ALIPAY
this
.
enterUrl
=
uni
.
getStorageSync
(
"alipayQrCode"
)
this
.
enterUrl
=
uni
.
getStorageSync
(
'alipayQrCode'
)
uni
.
removeStorageSync
(
'alipayQrCode'
)
//临时解决出租车扫码之后跳转到组合票时,参数会有问题,有时间再根本解决
uni
.
removeStorageSync
(
'alipayQrCode'
)
//临时解决出租车扫码之后跳转到组合票时,参数会有问题,有时间再根本解决
this
.
payType
=
33
this
.
payType
=
33
//#endif
//#endif
if
(
this
.
enterUrl
){
//扫普通二维码进入
if
(
this
.
enterUrl
){
//扫普通二维码进入
this
.
merchantId
=
this
.
getUrlKey
(
"merchantId"
)
this
.
merchantId
=
this
.
getUrlKey
(
'merchantId'
)
this
.
companyId
=
this
.
getUrlKey
(
"companyId"
)
this
.
companyId
=
this
.
getUrlKey
(
'companyId'
)
this
.
extendInfo
=
this
.
getUrlKey
(
'extendInfo'
)
}
else
{
//扫小程序二维码进入
}
else
{
//扫小程序二维码进入
this
.
merchantId
=
option
.
merchantId
this
.
merchantId
=
option
.
merchantId
this
.
companyId
=
option
.
companyId
this
.
companyId
=
option
.
companyId
this
.
extendInfo
=
option
.
extendInfo
}
}
if
(
uni
.
getStorageSync
(
"openid"
)){
if
(
uni
.
getStorageSync
(
'openid'
)){
this
.
openid
=
uni
.
getStorageSync
(
"openid"
)
this
.
openid
=
uni
.
getStorageSync
(
'openid'
)
this
.
getUserBrowse
()
this
.
getUserBrowse
()
if
(
this
.
merchantId
)
{
//大商家的有merchantId
if
(
this
.
merchantId
)
{
//大商家的有merchantId
this
.
init
()
this
.
init
()
...
@@ -189,13 +192,13 @@
...
@@ -189,13 +192,13 @@
getUserBrowse
(){
//---获取浏览记录
getUserBrowse
(){
//---获取浏览记录
let
queryUrl
=
this
.
$commonjs
.
getCurrentPageUrl
()
let
queryUrl
=
this
.
$commonjs
.
getCurrentPageUrl
()
let
data
=
{
let
data
=
{
openid
:
uni
.
getStorageSync
(
"openid"
)
,
//用户Id
openid
:
uni
.
getStorageSync
(
'openid'
)
,
//用户Id
userName
:
""
,
//用户昵称
userName
:
''
,
//用户昵称
pageType
:
4
,
//页面类型(0首页,1商户页,2产品页,3售票页,4付款页,5付款完成页,6行记页,7评论页,8咨询页,9劵中心页,11订单页,12订单详情页,13IC卡出行页,14电子门票页,15常用信息页,16其他页)
pageType
:
4
,
//页面类型(0首页,1商户页,2产品页,3售票页,4付款页,5付款完成页,6行记页,7评论页,8咨询页,9劵中心页,11订单页,12订单详情页,13IC卡出行页,14电子门票页,15常用信息页,16其他页)
queryUrl
,
//页面全地址
queryUrl
,
//页面全地址
merchantType
:
""
//商户类型1景区,2酒店,3餐饮,4特产
merchantType
:
''
//商户类型1景区,2酒店,3餐饮,4特产
}
}
this
.
$request
(
"wechatUser/wxUser/saveUserBrowse"
,
data
).
then
((
res
)
=>
{
this
.
$request
(
'wechatUser/wxUser/saveUserBrowse'
,
data
).
then
((
res
)
=>
{
})
})
},
},
...
@@ -208,18 +211,20 @@
...
@@ -208,18 +211,20 @@
provider
:
proRes
.
provider
[
0
],
provider
:
proRes
.
provider
[
0
],
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
res
.
code
){
if
(
res
.
code
){
let
source
=
""
let
source
=
''
if
(
proRes
.
provider
[
0
]
==
"weixin"
){
if
(
proRes
.
provider
[
0
]
==
'weixin'
){
source
=
3
source
=
3
}
else
if
(
proRes
.
provider
[
0
]
==
"alipay"
){
}
else
if
(
proRes
.
provider
[
0
]
==
'alipay'
){
source
=
4
source
=
4
}
}
let
data
=
{
let
data
=
{
code
:
res
.
code
,
code
:
res
.
code
,
source
,
//微信小程序3,支付宝小程序4
source
,
//微信小程序3,支付宝小程序4
companyId
:
uni
.
getStorageSync
(
'enterOptions'
).
query
.
companyId
||
''
,
appid
:
uni
.
getStorageSync
(
'appid'
)
||
''
appid
:
uni
.
getStorageSync
(
'appid'
)
||
''
}
}
if
(
uni
.
getStorageSync
(
'enterOptions'
).
query
){
data
.
companyId
=
uni
.
getStorageSync
(
'enterOptions'
).
query
.
companyId
||
''
}
_this
.
$request
(
'wechat/wx/getUserInfoByCode'
,
data
).
then
(
res
=>
{
_this
.
$request
(
'wechat/wx/getUserInfoByCode'
,
data
).
then
(
res
=>
{
if
(
res
.
code
==
'00'
){
if
(
res
.
code
==
'00'
){
_this
.
openid
=
res
.
data
.
openid
_this
.
openid
=
res
.
data
.
openid
...
@@ -232,27 +237,27 @@
...
@@ -232,27 +237,27 @@
}
}
_this
.
initCoupon
()
_this
.
initCoupon
()
//用于获取token等信息
//用于获取token等信息
let
userId
=
res
.
data
.
userId
||
""
let
userId
=
res
.
data
.
userId
||
''
let
openid
=
res
.
data
.
openid
||
""
let
openid
=
res
.
data
.
openid
||
''
let
datas
=
{
openid
,
source
,
userId
}
let
datas
=
{
openid
,
source
,
userId
}
_this
.
$request
(
"wechatUser/login/findWxUserAndLogin"
,
datas
).
then
((
res
)
=>
{
_this
.
$request
(
'wechatUser/login/findWxUserAndLogin'
,
datas
).
then
((
res
)
=>
{
if
(
res
.
code
==
"00"
){
if
(
res
.
code
==
'00'
){
let
token
=
res
.
data
.
token
||
""
let
token
=
res
.
data
.
token
||
''
uni
.
setStorageSync
(
'token'
,
token
)
uni
.
setStorageSync
(
'token'
,
token
)
let
createUserId
=
res
.
data
.
personId
||
""
let
createUserId
=
res
.
data
.
personId
||
''
uni
.
setStorageSync
(
'createUserId'
,
createUserId
)
uni
.
setStorageSync
(
'createUserId'
,
createUserId
)
let
userId
=
res
.
data
.
userId
||
""
let
userId
=
res
.
data
.
userId
||
''
uni
.
setStorageSync
(
'userId'
,
userId
)
uni
.
setStorageSync
(
'userId'
,
userId
)
}
else
{
}
else
{
uni
.
showToast
({
uni
.
showToast
({
title
:
res
.
message
,
title
:
res
.
message
,
icon
:
"none"
icon
:
'none'
})
})
}
}
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
uni
.
showToast
({
uni
.
showToast
({
title
:
"登录失败"
,
title
:
'登录失败'
,
icon
:
"none"
icon
:
'none'
})
})
_this
.
timer
=
setTimeout
(()
=>
{
_this
.
timer
=
setTimeout
(()
=>
{
_this
.
login
()
_this
.
login
()
...
@@ -261,13 +266,13 @@
...
@@ -261,13 +266,13 @@
}
else
{
}
else
{
uni
.
showToast
({
uni
.
showToast
({
title
:
res
.
message
,
title
:
res
.
message
,
icon
:
"none"
icon
:
'none'
})
})
}
}
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
uni
.
showToast
({
uni
.
showToast
({
title
:
"登录失败"
,
title
:
'登录失败'
,
icon
:
"none"
icon
:
'none'
})
})
_this
.
timer
=
setTimeout
(()
=>
{
_this
.
timer
=
setTimeout
(()
=>
{
_this
.
login
()
_this
.
login
()
...
@@ -280,13 +285,13 @@
...
@@ -280,13 +285,13 @@
})
})
},
},
getUrlKey
(
name
){
//---获取url
getUrlKey
(
name
){
//---获取url
return
(
new
RegExp
(
'[?|&]'
+
name
+
'='
+
'([^&;]+?)(&|#|;|$)'
).
exec
(
decodeURIComponent
(
this
.
enterUrl
))
||
[,
""
])[
1
].
replace
(
/
\+
/g
,
'%20'
)
||
""
;
return
(
new
RegExp
(
'[?|&]'
+
name
+
'='
+
'([^&;]+?)(&|#|;|$)'
).
exec
(
decodeURIComponent
(
this
.
enterUrl
))
||
[,
''
])[
1
].
replace
(
/
\+
/g
,
'%20'
)
||
''
},
},
clickNum
(
i
,
index
,
a
)
{
//---输入数字
clickNum
(
i
,
index
,
a
)
{
//---输入数字
this
.
buyMoney
+=
i
this
.
buyMoney
+=
i
this
.
leftList
[
index
].
child
[
a
].
background
=
"#dddddd"
this
.
leftList
[
index
].
child
[
a
].
background
=
'#dddddd'
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
leftList
[
index
].
child
[
a
].
background
=
""
this
.
leftList
[
index
].
child
[
a
].
background
=
''
},
200
)
},
200
)
clearTimeout
(
this
.
flag
)
clearTimeout
(
this
.
flag
)
this
.
flag
=
setTimeout
(()
=>
{
this
.
flag
=
setTimeout
(()
=>
{
...
@@ -295,9 +300,9 @@
...
@@ -295,9 +300,9 @@
},
},
clickEnter
(){
//---退格
clickEnter
(){
//---退格
this
.
buyMoney
=
this
.
buyMoney
.
substr
(
0
,
this
.
buyMoney
.
length
-
1
)
this
.
buyMoney
=
this
.
buyMoney
.
substr
(
0
,
this
.
buyMoney
.
length
-
1
)
this
.
spaceBackground
=
"#dddddd"
this
.
spaceBackground
=
'#dddddd'
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
spaceBackground
=
""
this
.
spaceBackground
=
''
},
200
)
},
200
)
clearTimeout
(
this
.
flag
)
clearTimeout
(
this
.
flag
)
this
.
flag
=
setTimeout
(()
=>
{
this
.
flag
=
setTimeout
(()
=>
{
...
@@ -309,7 +314,7 @@
...
@@ -309,7 +314,7 @@
this
.
chooseCouponObj
=
data
this
.
chooseCouponObj
=
data
this
.
savedMoney
=
this
.
chooseCouponObj
.
savedMoney
||
0
this
.
savedMoney
=
this
.
chooseCouponObj
.
savedMoney
||
0
}
else
{
}
else
{
this
.
chooseCouponObj
=
""
this
.
chooseCouponObj
=
''
this
.
savedMoney
=
0
this
.
savedMoney
=
0
}
}
...
@@ -319,18 +324,18 @@
...
@@ -319,18 +324,18 @@
},
},
init
()
{
//---初始化获取商家名称,大商家
init
()
{
//---初始化获取商家名称,大商家
let
data
=
{
let
data
=
{
"merchantId"
:
this
.
merchantId
,
'merchantId'
:
this
.
merchantId
,
"companyId"
:
this
.
companyId
,
'companyId'
:
this
.
companyId
,
}
}
uni
.
showLoading
({
title
:
'加载中'
,
mask
:
true
})
uni
.
showLoading
({
title
:
'加载中'
,
mask
:
true
})
this
.
$request
(
"scenic/order/findCodePayInfo"
,
data
).
then
((
res
)
=>
{
this
.
$request
(
'scenic/order/findCodePayInfo'
,
data
).
then
((
res
)
=>
{
uni
.
hideLoading
()
uni
.
hideLoading
()
if
(
res
.
code
==
"00"
)
{
if
(
res
.
code
==
'00'
)
{
this
.
name
=
res
.
data
.
name
this
.
name
=
res
.
data
.
name
}
else
{
}
else
{
uni
.
showToast
({
uni
.
showToast
({
title
:
res
.
message
,
title
:
res
.
message
,
icon
:
"none"
icon
:
'none'
})
})
}
}
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
...
@@ -339,12 +344,12 @@
...
@@ -339,12 +344,12 @@
},
},
initTwo
()
{
//---初始化获取商家名称,没有merchantId的小商家
initTwo
()
{
//---初始化获取商家名称,没有merchantId的小商家
let
data
=
{
let
data
=
{
"id"
:
this
.
companyId
,
'id'
:
this
.
companyId
,
}
}
uni
.
showLoading
({
title
:
'加载中'
,
mask
:
true
})
uni
.
showLoading
({
title
:
'加载中'
,
mask
:
true
})
this
.
$request
(
"user/company/detail"
,
data
).
then
((
res
)
=>
{
this
.
$request
(
'user/company/detail'
,
data
).
then
((
res
)
=>
{
uni
.
hideLoading
()
uni
.
hideLoading
()
if
(
res
.
code
==
"00"
){
if
(
res
.
code
==
'00'
){
this
.
companyAttribute
=
res
.
data
.
companyVo
.
companyAttribute
this
.
companyAttribute
=
res
.
data
.
companyVo
.
companyAttribute
this
.
paydJumpUrl
=
res
.
data
.
paydJumpUrl
this
.
paydJumpUrl
=
res
.
data
.
paydJumpUrl
if
(
this
.
companyAttribute
==
5
){
//出租车显示联系人姓名,其他显示公司名称
if
(
this
.
companyAttribute
==
5
){
//出租车显示联系人姓名,其他显示公司名称
...
@@ -355,7 +360,7 @@
...
@@ -355,7 +360,7 @@
}
else
{
}
else
{
uni
.
showToast
({
uni
.
showToast
({
title
:
res
.
message
,
title
:
res
.
message
,
icon
:
"none"
icon
:
'none'
})
})
}
}
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
...
@@ -364,8 +369,8 @@
...
@@ -364,8 +369,8 @@
},
},
initCoupon
()
{
//---加载优惠券
initCoupon
()
{
//---加载优惠券
let
savedMoneyList
=
[]
let
savedMoneyList
=
[]
this
.
chooseCouponObj
=
""
this
.
chooseCouponObj
=
''
this
.
ableConpon
=
""
this
.
ableConpon
=
''
let
data
=
{
let
data
=
{
money
:
parseFloat
(
this
.
buyMoney
)
||
0
,
//订单总价,不算券,和现金红包
money
:
parseFloat
(
this
.
buyMoney
)
||
0
,
//订单总价,不算券,和现金红包
merchantId
:
this
.
merchantId
,
//商户Id
merchantId
:
this
.
merchantId
,
//商户Id
...
@@ -373,8 +378,8 @@
...
@@ -373,8 +378,8 @@
orderSource
:
this
.
orderSource
,
//订单来源 8扫码支付
orderSource
:
this
.
orderSource
,
//订单来源 8扫码支付
openid
:
this
.
openid
openid
:
this
.
openid
}
}
this
.
$request
(
"wechatUser/myPage/usableCouponList"
,
data
).
then
((
res
)
=>
{
this
.
$request
(
'wechatUser/myPage/usableCouponList'
,
data
).
then
((
res
)
=>
{
if
(
res
.
code
==
"00"
)
{
if
(
res
.
code
==
'00'
)
{
this
.
couponData
=
res
.
data
this
.
couponData
=
res
.
data
let
masterSlaveCouponList
=
res
.
data
.
masterSlaveCouponList
let
masterSlaveCouponList
=
res
.
data
.
masterSlaveCouponList
if
(
masterSlaveCouponList
&&
masterSlaveCouponList
.
length
>
0
)
{
if
(
masterSlaveCouponList
&&
masterSlaveCouponList
.
length
>
0
)
{
...
@@ -414,8 +419,8 @@
...
@@ -414,8 +419,8 @@
clickPay
(){
//---点击立即支付,获取支付需要的参数
clickPay
(){
//---点击立即支付,获取支付需要的参数
if
(
!
parseFloat
(
this
.
buyMoney
))
{
if
(
!
parseFloat
(
this
.
buyMoney
))
{
uni
.
showToast
({
uni
.
showToast
({
title
:
"请输入正确金额"
,
title
:
'请输入正确金额'
,
icon
:
"none"
icon
:
'none'
})
})
return
return
}
}
...
@@ -453,19 +458,20 @@
...
@@ -453,19 +458,20 @@
payType
:
this
.
payType
,
//支付类型,
payType
:
this
.
payType
,
//支付类型,
orderSource
:
this
.
orderSource
,
//订单来源 8扫码支付
orderSource
:
this
.
orderSource
,
//订单来源 8扫码支付
couponList
,
//券列表
couponList
,
//券列表
extendInfo
:
this
.
extendInfo
,
//额外信息
}
}
this
.
payBackground
=
"#cccccc"
this
.
payBackground
=
'#cccccc'
//重新加载优惠券
//重新加载优惠券
this
.
initCoupon
()
this
.
initCoupon
()
this
.
$request
(
"orderc/order/codePay"
,
data
).
then
((
res
)
=>
{
this
.
$request
(
'orderc/order/codePay'
,
data
).
then
((
res
)
=>
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
payBackground
=
"#1dce2e"
this
.
payBackground
=
'#1dce2e'
},
1000
)
},
1000
)
if
(
res
.
code
==
"00"
)
{
if
(
res
.
code
==
'00'
)
{
if
(
res
.
data
.
errorMessage
)
{
if
(
res
.
data
.
errorMessage
)
{
uni
.
showToast
({
uni
.
showToast
({
title
:
res
.
data
.
errorMessage
,
title
:
res
.
data
.
errorMessage
,
icon
:
"none"
icon
:
'none'
})
})
return
return
}
}
...
@@ -477,16 +483,16 @@
...
@@ -477,16 +483,16 @@
this
.
nonceStr
=
res
.
data
.
noncestr
this
.
nonceStr
=
res
.
data
.
noncestr
this
.
package
=
res
.
data
.
package
this
.
package
=
res
.
data
.
package
//支付宝入参
//支付宝入参
this
.
orderInfo
=
res
.
data
.
payInfo
||
""
this
.
orderInfo
=
res
.
data
.
payInfo
||
''
this
.
goPay
()
this
.
goPay
()
}
else
{
}
else
{
uni
.
showToast
({
uni
.
showToast
({
title
:
res
.
message
,
title
:
res
.
message
,
icon
:
"none"
icon
:
'none'
})
})
}
}
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
this
.
payBackground
=
"#1dce2e"
this
.
payBackground
=
'#1dce2e'
})
})
},
},
goPay
(){
//---去支付
goPay
(){
//---去支付
...
@@ -506,14 +512,14 @@
...
@@ -506,14 +512,14 @@
})
})
}
else
{
}
else
{
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
"/pages/payment/paySuccess/paySuccess?orderId="
+
_this
.
orderId
url
:
'/pages/payment/paySuccess/paySuccess?orderId='
+
_this
.
orderId
})
})
}
}
},
},
fail
:
function
(
err
)
{
fail
:
function
(
err
)
{
uni
.
showToast
({
uni
.
showToast
({
title
:
err
.
errMsg
,
title
:
err
.
errMsg
,
icon
:
"none"
icon
:
'none'
})
})
}
}
})
})
...
@@ -530,14 +536,14 @@
...
@@ -530,14 +536,14 @@
})
})
}
else
{
}
else
{
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
"/pages/payment/paySuccess/paySuccess?orderId="
+
_this
.
orderId
url
:
'/pages/payment/paySuccess/paySuccess?orderId='
+
_this
.
orderId
})
})
}
}
},
},
fail
:
function
(
err
)
{
fail
:
function
(
err
)
{
uni
.
showToast
({
uni
.
showToast
({
title
:
err
.
errMsg
,
title
:
err
.
errMsg
,
icon
:
"none"
icon
:
'none'
})
})
}
}
})
})
...
@@ -546,33 +552,33 @@
...
@@ -546,33 +552,33 @@
},
},
watch
:
{
watch
:
{
buyMoney
(
val
,
oldVal
)
{
buyMoney
(
val
,
oldVal
)
{
if
(
val
==
"."
&&
oldVal
==
""
)
{
//首位数是小数点自动加上0
if
(
val
==
'.'
&&
oldVal
==
''
)
{
//首位数是小数点自动加上0
this
.
buyMoney
=
0
+
"."
this
.
buyMoney
=
0
+
'.'
}
}
if
(
val
==
"0"
&&
oldVal
==
""
)
{
//首位数是0自动加上小数点
if
(
val
==
'0'
&&
oldVal
==
''
)
{
//首位数是0自动加上小数点
this
.
buyMoney
=
0
+
"."
this
.
buyMoney
=
0
+
'.'
}
}
if
(
val
.
length
==
2
)
{
//防止回退之后出现01,02等状况
if
(
val
.
length
==
2
)
{
//防止回退之后出现01,02等状况
if
(
val
.
substr
(
0
,
1
)
==
0
&&
val
.
substr
(
1
,
2
)
!=
"."
)
{
if
(
val
.
substr
(
0
,
1
)
==
0
&&
val
.
substr
(
1
,
2
)
!=
'.'
)
{
this
.
buyMoney
=
val
.
substr
(
1
,
2
)
this
.
buyMoney
=
val
.
substr
(
1
,
2
)
}
}
}
}
if
(
isNaN
(
val
)
&&
val
!=
"."
)
{
//出现非数字,输入无效
if
(
isNaN
(
val
)
&&
val
!=
'.'
)
{
//出现非数字,输入无效
this
.
buyMoney
=
oldVal
this
.
buyMoney
=
oldVal
}
}
var
x
=
String
(
this
.
buyMoney
).
indexOf
(
'.'
)
+
1
;
//小数点的位置
var
x
=
String
(
this
.
buyMoney
).
indexOf
(
'.'
)
+
1
//小数点的位置
var
y
=
String
(
this
.
buyMoney
).
length
-
x
;
//小数的位数
var
y
=
String
(
this
.
buyMoney
).
length
-
x
//小数的位数
if
(
y
>
2
&&
x
>
0
)
{
if
(
y
>
2
&&
x
>
0
)
{
this
.
buyMoney
=
oldVal
this
.
buyMoney
=
oldVal
}
}
if
(
parseFloat
(
this
.
buyMoney
))
{
if
(
parseFloat
(
this
.
buyMoney
))
{
this
.
payBackground
=
"#1dce2e"
this
.
payBackground
=
'#1dce2e'
}
else
{
}
else
{
this
.
payBackground
=
"#cccccc"
this
.
payBackground
=
'#cccccc'
}
}
}
}
}
}
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
>
<
style
lang=
"scss"
>
...
...
pages/payment/paySuccess/paySuccess.vue
View file @
5c5c61ca
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
}
}
this
.
ticketStatus
()
this
.
ticketStatus
()
intFun
()
intFun
()
},
12
00
)
},
20
00
)
}
}
intFun
()
intFun
()
},
},
...
...
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