Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
hrs_app_h5
/
bill
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2df3e8e1
authored
Jul 13, 2020
by
cocomilk2012
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修改支付链接为调用原生方法getActionUrl
parent
acbbe089
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
37 deletions
src/assets/js/bridge/birdge.js
src/views/Bill/index.vue
src/assets/js/bridge/birdge.js
View file @
2df3e8e1
...
...
@@ -80,6 +80,23 @@ class Bridge {
}
})
}
/**
* 使APP调用URL
*
* @param {Object=} args 请求对象
*/
getActionUrl
(
args
=
{})
{
return
new
Promise
((
resolve
,
reject
)
=>
{
try
{
jsBridge
.
callHandler
(
"getActionUrl"
,
args
,
function
(
response
)
{
resolve
(
response
);
});
}
catch
(
err
)
{
reject
(
err
);
}
})
}
}
export
default
new
Bridge
();
...
...
src/views/Bill/index.vue
View file @
2df3e8e1
...
...
@@ -45,11 +45,9 @@
</div>
</div>
<div
class=
"header_info"
>
<div
class=
"left"
>
<a
:href=
"nativePayUrl"
>
<div
class=
"left"
@
click=
"toPay()"
>
<img
src=
"../../assets/images/icon01.png"
alt
/>
<span>
充值
</span>
</a>
</div>
<div
class=
"right"
@
click=
"toPage(2)"
>
...
...
@@ -250,42 +248,60 @@ export default {
"loadPayUrl"
]),
toPay
()
{
// this.$bridge
// .setPageNavState({
// headerColor: "#fff",
// isShowClose: true,
// isShowBack: true,
// isCloseLeft: true,
// isShowTitle: true,
// isShowNav: true,
// isCloseWebView: false
// })
// .then(res => {
// console.log("setPageNavState in bill index");
// });
//TODO:根据UA判断:如果App版本
<
2.1
.
9
就走原来的充值逻辑;如果
App
版本
>=
2.1
.
9
就走新的充值逻辑;
const
userAgent
=
navigator
.
userAgent
.
toLowerCase
();
if
(
userAgent
.
indexOf
(
"qqxbua"
)
!=
-
1
)
{
// this.$bridge
// .setBarColor({
// barColor: "#ffffff"
// })
// .then(res => {});
}
const
version
=
"2.1.9"
;
if
(
version
<
"2.1.9"
)
{
this
.
toPay_old
();
}
else
{
this
.
toPay_new
();
}
},
toPay_new
()
{
//TODO:先弹出一个遮罩层,点击任意按钮刷新页面
this
.
$bridge
.
getActionUrl
(
nativePayUrl
).
then
(
res
=>
{
console
.
log
(
"getActionUrl in bill index"
);
});
},
toPay_old
()
{
this
.
$bridge
.
setPageNavState
({
headerColor
:
"#fff"
,
isShowClose
:
true
,
isShowBack
:
true
,
isCloseLeft
:
true
,
isShowTitle
:
true
,
isShowNav
:
true
,
isCloseWebView
:
false
})
.
then
(
res
=>
{
console
.
log
(
"setPageNavState in bill index"
);
});
this
.
$bridge
.
setBarColor
({
barColor
:
"#ffffff"
})
.
then
(
res
=>
{});
// const failUrl = encodeURIComponent(
// "https://pay.qinqinxiaobao.com/callback/fail"
// );
// const successUrl = encodeURIComponent(
// "https://pay.qinqinxiaobao.com/callback/success"
// );
// const payMethod = 0;
// const payType = 4;
// const selected = 0;
// const fee = this.data.waitPay;
// let payUrl = `${this.payUrl}&accountId=${this.currentPerId}&payMethod=${payMethod}&payType=${payType}&fee=${fee}&selected=0&failUrl=${failUrl}&successUrl=${successUrl}`;
// window.onpageshow=null;
// window.onpageshow=function(event){
// location.reload();
// }
let
payUrl
=
`hrs100://native/SelectRechargeMode?periodId=
${
this
.
currentPerId
}
&fee=
${
this
.
data
.
waitPay
}
`
;
const
failUrl
=
encodeURIComponent
(
"https://pay.qinqinxiaobao.com/callback/fail"
);
const
successUrl
=
encodeURIComponent
(
"https://pay.qinqinxiaobao.com/callback/success"
);
const
payMethod
=
0
;
const
payType
=
4
;
const
selected
=
0
;
const
fee
=
this
.
data
.
waitPay
;
let
payUrl
=
`
${
this
.
payUrl
}
&accountId=
${
this
.
currentPerId
}
&payMethod=
${
payMethod
}
&payType=
${
payType
}
&fee=
${
fee
}
&selected=0&failUrl=
${
failUrl
}
&successUrl=
${
successUrl
}
`
;
window
.
onpageshow
=
null
;
window
.
onpageshow
=
function
(
event
)
{
location
.
reload
();
};
window
.
location
.
href
=
payUrl
;
},
toPage
(
flag
)
{
...
...
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