Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-h5-ailipay
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 88069fb3
authored
Aug 28, 2025
by
前端
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'SAAS+V4.55.1' into 'master'
上线合并 See merge request
!10
2 parents
f3197b66
306a023d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
31 deletions
src/views/alipay/index.vue
src/views/alipay/index.vue
View file @
88069fb
...
@@ -95,6 +95,7 @@ export default {
...
@@ -95,6 +95,7 @@ export default {
merchantName
:
''
,
merchantName
:
''
,
shopMerchantId
:
''
,
shopMerchantId
:
''
,
shopMerchantName
:
''
,
shopMerchantName
:
''
,
pay
:
''
,
payMoney
:
''
,
// 支付金额
payMoney
:
''
,
// 支付金额
unPayMoneyList
:
[
'0'
,
'0.'
,
'0.0'
,
'0.00'
],
unPayMoneyList
:
[
'0'
,
'0.'
,
'0.0'
,
'0.00'
],
canPay
:
false
,
canPay
:
false
,
...
@@ -118,7 +119,8 @@ export default {
...
@@ -118,7 +119,8 @@ export default {
userCollaborationName
:
''
,
userCollaborationName
:
''
,
userCollaborationCheck
:
false
,
userCollaborationCheck
:
false
,
isYqType
:
true
,
isYqType
:
true
,
merchantDisabled
:
false
merchantDisabled
:
false
,
appId
:
''
}
}
},
},
mounted
()
{
mounted
()
{
...
@@ -126,25 +128,32 @@ export default {
...
@@ -126,25 +128,32 @@ export default {
console
.
log
(
baseConfig
)
console
.
log
(
baseConfig
)
const
{
appId
}
=
baseConfig
const
{
appId
}
=
baseConfig
// console.log(appId)
// console.log(appId)
const
{
merchantName
,
merchantId
,
shopMerchantId
,
shopMerchantName
}
=
this
.
getHrefParams
()
const
{
merchantName
,
merchantId
,
shopMerchantId
,
shopMerchantName
,
M
,
MN
,
SM
,
SMN
,
P
}
=
this
.
getHrefParams
()
this
.
paymentChannelId
=
P
this
.
appId
=
baseConfig
.
appidMap
[
this
.
paymentChannelId
]
||
appId
console
.
log
(
baseConfig
.
appidMap
[
this
.
paymentChannelId
],
this
.
appId
)
// 区分是流量方还是导流方
// 区分是流量方还是导流方
// this.getMiniAppConfig()
// this.getMiniAppConfig()
this
.
setMerchantDisabled
(
merchantId
||
shopMerchantId
)
this
.
setMerchantDisabled
(
merchantId
||
shopMerchantId
)
if
(
merchantId
)
{
if
(
merchantId
||
M
)
{
this
.
merchantId
=
merchantId
this
.
merchantId
=
merchantId
||
M
this
.
merchantName
=
merchantName
this
.
merchantName
=
merchantName
||
MN
}
else
{
}
else
{
this
.
shopMerchantId
=
shopMerchantId
this
.
shopMerchantId
=
shopMerchantId
||
SM
this
.
shopMerchantName
=
shopMerchantName
this
.
shopMerchantName
=
shopMerchantName
||
SMN
this
.
isYqType
=
false
this
.
isYqType
=
false
}
}
console
.
log
(
appId
,
'appId'
)
//
console.log(appId, 'appId')
// console.log('ap.getAuthCode', ap.getAuthCode)
// console.log('ap.getAuthCode', ap.getAuthCode)
// ap.alert(appId)
// ap.alert(appId)
console
.
log
(
ap
,
'ap'
)
console
.
log
(
ap
.
getAuthCode
,
'ap.getAuthCode'
)
console
.
log
(
this
.
appId
,
'this.appId'
)
try
{
// 请求用户授权
// 请求用户授权
ap
.
getAuthCode
({
ap
.
getAuthCode
({
appId
,
appId
:
this
.
appId
,
scopes
:
[
'auth_base'
]
// 主动授权:auth_user,静默授权:auth_base。或者其它scope
scopes
:
[
'auth_base'
]
// 主动授权:auth_user,静默授权:auth_base。或者其它scope
},
function
(
res
)
{
},
function
(
res
)
{
// ap.alert(JSON.stringify(res))
// ap.alert(JSON.stringify(res))
...
@@ -155,6 +164,10 @@ export default {
...
@@ -155,6 +164,10 @@ export default {
console
.
log
(
'res.fail'
,
res
)
console
.
log
(
'res.fail'
,
res
)
// res.authCode && that.getOpenId(res.authCode)
// res.authCode && that.getOpenId(res.authCode)
})
})
}
catch
(
error
)
{
console
.
log
(
error
,
'error'
)
}
// this.getOpenId('ab3aa51e466140b5b96475706653UX72')
// this.getOpenId('ab3aa51e466140b5b96475706653UX72')
...
@@ -192,10 +205,10 @@ export default {
...
@@ -192,10 +205,10 @@ export default {
this
.
userCollaborationCheck
=
!
this
.
userCollaborationCheck
this
.
userCollaborationCheck
=
!
this
.
userCollaborationCheck
},
},
getOpenId
(
code
)
{
getOpenId
(
code
)
{
console
.
log
(
'getOpenId'
,
code
)
console
.
log
(
'getOpenId'
,
code
,
this
.
appId
)
console
.
log
(
alipayOauthToken
)
console
.
log
(
alipayOauthToken
)
// !code&&console.log('alipayOauthToken')
// !code&&console.log('alipayOauthToken')
code
&&
alipayOauthToken
({
code
}).
then
((
result
)
=>
{
code
&&
alipayOauthToken
({
code
,
appId
:
this
.
appId
}).
then
((
result
)
=>
{
// alert('alipayOauthToken', JSON.stringify(result))
// alert('alipayOauthToken', JSON.stringify(result))
console
.
log
(
'alipayOauthToken'
,
result
)
console
.
log
(
'alipayOauthToken'
,
result
)
const
{
userId
}
=
result
const
{
userId
}
=
result
...
@@ -282,11 +295,12 @@ export default {
...
@@ -282,11 +295,12 @@ export default {
// merchantId,
// merchantId,
// openId,
// openId,
isMinipg
:
1
,
isMinipg
:
1
,
appid
:
baseConfig
.
appId
,
appid
:
this
.
appId
,
subOpenid
:
userId
,
subOpenid
:
userId
,
oprBy
:
userId
,
oprBy
:
userId
,
receivedMoney
:
payMoney
*
100
,
receivedMoney
:
payMoney
*
100
,
payType
:
4
payType
:
4
,
paymentChannelId
:
this
.
paymentChannelId
,
}
}
if
(
this
.
isYqType
)
{
if
(
this
.
isYqType
)
{
params
.
merchantId
=
this
.
merchantId
params
.
merchantId
=
this
.
merchantId
...
@@ -299,8 +313,9 @@ export default {
...
@@ -299,8 +313,9 @@ export default {
duration
:
0
duration
:
0
})
})
createWxPayH5
(
params
).
then
((
result
)
=>
{
createWxPayH5
(
params
).
then
((
result
)
=>
{
const
{
tradeNO
}
=
JSON
.
parse
(
result
.
jsapiPayInfo
)
// tradeNO 银盛 chnlPayInfo 通联
this
.
tradeNO
=
tradeNO
const
{
tradeNO
,
chnlPayInfo
}
=
JSON
.
parse
(
result
.
jsapiPayInfo
)
this
.
tradeNO
=
tradeNO
||
chnlPayInfo
console
.
log
(
'tradeNO'
,
tradeNO
)
console
.
log
(
'tradeNO'
,
tradeNO
)
this
.
tradeNO
&&
this
.
aliPayment
()
this
.
tradeNO
&&
this
.
aliPayment
()
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
...
@@ -308,27 +323,12 @@ export default {
...
@@ -308,27 +323,12 @@ export default {
}).
finally
(()
=>
{
}).
finally
(()
=>
{
this
.
$toast
.
clear
()
this
.
$toast
.
clear
()
})
})
// createWxPayH5(params).then((result) => {
// console.log(result, 'result')
// const { code, data, message } = result
// if (code == 0) {
// const { tradeNO } = JSON.parse(result.jsapiPayInfo)
// this.tradeNO = tradeNO
// console.log('tradeNO', tradeNO)
// this.tradeNO && this.aliPayment()
// } else {
// this.$toast.fail(message || '支付失败')
// }
// }).catch((err) => {
// console.log(err)
// }).finally(() => {
// this.$toast.clear()
// })
},
},
aliPayment
()
{
aliPayment
()
{
const
that
=
this
const
that
=
this
// 调用支付宝api唤起支付功能
// 调用支付宝api唤起支付功能
console
.
log
(
'this.tradeNO'
,
this
.
tradeNO
)
console
.
log
(
'this.tradeNO'
,
this
.
tradeNO
)
// this.tradeNO = '2025073122001417721400156209'
const
{
tradeNO
}
=
this
const
{
tradeNO
}
=
this
AlipayJSBridge
.
call
(
AlipayJSBridge
.
call
(
'tradePay'
,
'tradePay'
,
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment