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
9466a266
authored
May 14, 2020
by
赵艳波
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
tj
parent
a6257bbe
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
133 deletions
src/assets/js/JsBridge.js
src/main.js
src/views/Bill/index.vue
src/assets/js/JsBridge.js
deleted
100644 → 0
View file @
a6257bbe
// function initJsBridge(readyCallback) {
// var u = navigator.userAgent;
// var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
// var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
// // console.log('initJsBridge');
// // 注册jsbridge
// function connectWebViewJavascriptBridge(callback) {
// // console.log('connectWebViewJavascriptBridge');
// if (isAndroid) {
// if (window.WebViewJavascriptBridge) {
// callback(WebViewJavascriptBridge)
// } else {
// document.addEventListener(
// 'WebViewJavascriptBridgeReady'
// , function () {
// callback(WebViewJavascriptBridge)
// },
// false
// );
// }
// return;
// }
// if (isiOS) {
// if (window.WebViewJavascriptBridge) {
// return callback(WebViewJavascriptBridge);
// }
// if (window.WVJBCallbacks) {
// return window.WVJBCallbacks.push(callback);
// }
// window.WVJBCallbacks = [callback];
// var WVJBIframe = document.createElement('iframe');
// WVJBIframe.style.display = 'none';
// WVJBIframe.src = 'https://__bridge_loaded__';
// document.documentElement.appendChild(WVJBIframe);
// setTimeout(function () {
// document.documentElement.removeChild(WVJBIframe)
// }, 0)
// }
// }
// // 调用注册方法 原生调用JS
// connectWebViewJavascriptBridge(function (bridge) {
// if (isAndroid) {
// bridge.init('getbarheight', function (data, responseCallback) {
// responseCallback('received from native data:', data);
// });
// }
// readyCallback();
// });
// }
// export default initJsBridge;
\ No newline at end of file
src/main.js
View file @
9466a266
...
...
@@ -49,54 +49,6 @@ Vue.prototype.setPageNavState = function () {
bridge
.
setBarColor
({
"barColor"
:
"#0978e7"
});
// try {
// initJsBridge((params) => {
// window.WebViewJavascriptBridge.callHandler(
// "setPageNavState",
// {
// isShowClose: params.isShowClose ? params.isShowClose : false,
// isShowBack: params.isShowBack ? params.isShowBack : false,
// isCloseLeft: params.isCloseLeft ? params.isCloseLeft : false,
// isShowTitle: params.isShowTitle ? params.isShowTitle : false,
// isShowNav: params.isShowNav ? params.isShowNav : false,
// isCloseWebView: params.isCloseWebView ? params.isCloseWebView : false
// },
// function (response) {
// console.log("setPageNavState来自 ios/android的回传数据: ", response);
// }
// );
// window.WebViewJavascriptBridge.callHandler(
// "getBarHeight",
// null,
// function (response) {
// console.log(
// "main getBarHeight来自 ios/android的回传数据: ",
// response
// );
// if (response) {
// response = JSON.parse(response);
// const barHeight = response.statusBarHeight;
// localStorage.setItem("barHeight", barHeight);
// console.log('main barHeight=', barHeight);
// }
// }
// );
// window.WebViewJavascriptBridge.callHandler(
// "setBarColor",
// { "barColor": params.headerColor ? params.headerColor : "#0978e7" },
// function (response) {
// console.log("main setBarColor的回传数据:", response);
// }
// );
// });
// } catch (err) {
// console.log("main setPageNavState is error,err=", err);
// }
};
Vue
.
prototype
.
$bridge
=
bridge
;
...
...
src/views/Bill/index.vue
View file @
9466a266
...
...
@@ -234,7 +234,7 @@ export default {
"loadPayUrl"
]),
toPay
()
{
this
.
setPageNavState
({
this
.
$bridge
.
setPageNavState
({
headerColor
:
"#fff"
,
isShowClose
:
true
,
isShowBack
:
true
,
...
...
@@ -255,7 +255,7 @@ export default {
const
fee
=
this
.
data
.
waitPay
;
let
payUrl
=
`
${
this
.
payUrl
}
&accountType=1&periodId=
${
this
.
currentPerId
}
&payMethod=
${
payMethod
}
&payType=
${
payType
}
&fee=
${
fee
}
&selected=0&failUrl=
${
failUrl
}
&successUrl=
${
successUrl
}
`
;
//
window.location.href = payUrl;
window
.
location
.
href
=
payUrl
;
},
toPage
(
flag
)
{
switch
(
flag
)
{
...
...
@@ -469,17 +469,6 @@ export default {
},
closeWebView
()
{
this
.
$bridge
.
closeWebView
();
// try {
// window.WebViewJavascriptBridge.callHandler(
// "closeWebView",
// null,
// function(response) {
// console.log("closeWebView 来自 ios/android的回传数据:", response);
// }
// );
// } catch (err) {
// console.log("closeWebView is error");
// }
},
setPageNavStateShow
()
{
this
.
$bridge
...
...
@@ -492,20 +481,6 @@ export default {
isCloseWebView
:
true
})
.
then
(
res
=>
{});
// window.WebViewJavascriptBridge.callHandler(
// "setPageNavState",
// {
// isShowClose: true,
// isShowBack: true,
// isCloseLeft: true,
// isShowTitle: true,
// isShowNav: true,
// isCloseWebView: true
// },
// function(response) {
// console.log("setPageNavState来自 ios/android的回传数据: ", response);
// }
// );
},
navLeftArrowClick
()
{
this
.
closeWebView
();
...
...
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