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
8c75276c
authored
May 07, 2020
by
展昭
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
update
parent
8d9016b1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
55 additions
and
36 deletions
src/api/More/index.js
src/assets/js/JsBridge.js
src/main.js
src/store/modules/more.js
src/views/Bill/index.vue
src/views/More/index.vue
src/api/More/index.js
View file @
8c75276c
...
@@ -10,7 +10,11 @@ export default {
...
@@ -10,7 +10,11 @@ export default {
return
AjaxRequest
.
get
(
url
);
return
AjaxRequest
.
get
(
url
);
},
},
async
getMoreSummary
()
{
async
getMoreSummary
()
{
const
url
=
urls
.
getMoreSummary
();
const
url
=
urls
.
getMoreSummary
();
return
AjaxRequest
.
get
(
url
);
return
AjaxRequest
.
get
(
url
);
},
},
async
getPayUrl
()
{
const
url
=
'http://organization.test.hrs100.cn:18080/api/common/pay/getPaymentUrl'
return
AjaxRequest
.
get
(
url
);
}
};
};
src/assets/js/JsBridge.js
View file @
8c75276c
...
@@ -2,7 +2,8 @@ function initJsBridge(readyCallback) {
...
@@ -2,7 +2,8 @@ function initJsBridge(readyCallback) {
var
u
=
navigator
.
userAgent
;
var
u
=
navigator
.
userAgent
;
var
isAndroid
=
u
.
indexOf
(
'Android'
)
>
-
1
||
u
.
indexOf
(
'Adr'
)
>
-
1
;
//android终端
var
isAndroid
=
u
.
indexOf
(
'Android'
)
>
-
1
||
u
.
indexOf
(
'Adr'
)
>
-
1
;
//android终端
var
isiOS
=
!!
u
.
match
(
/
\(
i
[^
;
]
+;
(
U;
)?
CPU.+Mac OS X/
);
//ios终端
var
isiOS
=
!!
u
.
match
(
/
\(
i
[^
;
]
+;
(
U;
)?
CPU.+Mac OS X/
);
//ios终端
// 注册jsbridge
// 注册jsbridge
function
connectWebViewJavascriptBridge
(
callback
)
{
function
connectWebViewJavascriptBridge
(
callback
)
{
...
@@ -39,23 +40,15 @@ function initJsBridge(readyCallback) {
...
@@ -39,23 +40,15 @@ function initJsBridge(readyCallback) {
}
}
}
}
// // 调用注册方法
// // 调用注册方法
原生调用JS
// connectWebViewJavascriptBridge(function (bridge) {
// connectWebViewJavascriptBridge(function (bridge) {
// if (isAndroid) {
// if (isAndroid) {
// bridge.init('reloadTXLContact', function (data, responseCallback) {
// bridge.init('reloadTXLContact', function (data, responseCallback) {
// //store.dispatch('changeTxlMember', data);
// // data=JSON.parse(data);
// // const date=Date.now();
// // router.replace({ name: "addmembermanual", query: { name: data.name, linkway: data.linkway,date } });
// responseCallback('received from native data:', data);
// responseCallback('received from native data:', data);
// });
// });
// }
// }
// bridge.registerHandler('reloadTXLContact', function (data, responseCallback) {
// bridge.registerHandler('reloadTXLContact', function (data, responseCallback) {
// //store.dispatch('changeTxlMember', data);
// // data=JSON.parse(data);
// // const date=Date.now();
// // router.replace({ name: "addmembermanual", query: { name: data.name, linkway: data.linkway,date } });
// responseCallback('received from native data:' + data);
// responseCallback('received from native data:' + data);
// });
// });
// readyCallback();
// readyCallback();
...
...
src/main.js
View file @
8c75276c
...
@@ -32,24 +32,20 @@ FastClick.prototype.focus = function (targetElement) {
...
@@ -32,24 +32,20 @@ FastClick.prototype.focus = function (targetElement) {
Vue
.
prototype
.
setPageNavState
=
function
()
{
Vue
.
prototype
.
setPageNavState
=
function
()
{
try
{
try
{
initJsBridge
(()
=>
{
initJsBridge
(()
=>
{
window
.
WebViewJavascriptBridge
.
callHandler
(
"ready"
,
null
,
function
(
window
.
WebViewJavascriptBridge
.
callHandler
(
response
"setPageNavState"
,
)
{
{
window
.
WebViewJavascriptBridge
.
callHandler
(
isShowClose
:
false
,
"setPageNavState"
,
isShowBack
:
false
,
{
isCloseLeft
:
false
,
isShowClose
:
false
,
isShowTitle
:
false
,
isShowBack
:
false
,
isShowNav
:
false
,
isCloseLeft
:
false
,
isCloseWebView
:
false
isShowTitle
:
false
,
},
isShowNav
:
false
,
function
(
response
)
{
isCloseWebView
:
false
console
.
log
(
"来自 ios/android的回传数据: "
,
response
);
},
}
function
(
response
)
{
);
console
.
log
(
"来自 ios/android的回传数据: "
,
response
);
}
);
});
});
});
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
log
(
"setPageNavState is error"
);
console
.
log
(
"setPageNavState is error"
);
...
...
src/store/modules/more.js
View file @
8c75276c
...
@@ -60,6 +60,17 @@ const actions = {
...
@@ -60,6 +60,17 @@ const actions = {
}
}
})
})
});
});
},
loadPayUrl
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
api
.
getPayUrl
().
then
(
res
=>
{
if
(
res
&&
res
.
status
)
{
resolve
(
res
.
data
.
paymentUrl
);
}
else
{
reject
(
res
.
message
)
}
})
});
}
}
}
}
...
...
src/views/Bill/index.vue
View file @
8c75276c
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
</div>
</div>
</div>
</div>
<div
class=
"header_info"
>
<div
class=
"header_info"
>
<div
class=
"left"
>
<div
class=
"left"
@
click=
"toPay()"
>
<img
src=
"../../assets/images/icon01.png"
alt
/>
<img
src=
"../../assets/images/icon01.png"
alt
/>
<span>
充值
</span>
<span>
充值
</span>
</div>
</div>
...
@@ -173,6 +173,7 @@ export default {
...
@@ -173,6 +173,7 @@ export default {
currentPerId
:
0
,
currentPerId
:
0
,
currentPerName
:
""
,
currentPerName
:
""
,
period
:
[{
name
:
""
}],
period
:
[{
name
:
""
}],
payUrl
:
''
,
data
:
{
data
:
{
balance
:
0
,
balance
:
0
,
waitPay
:
0
,
waitPay
:
0
,
...
@@ -228,8 +229,14 @@ export default {
...
@@ -228,8 +229,14 @@ export default {
"loadBillHosting"
,
"loadBillHosting"
,
"loadReceiptList"
,
"loadReceiptList"
,
"savePeriodIndex"
,
"savePeriodIndex"
,
"savePerBeginDate"
"savePerBeginDate"
,
"loadPayUrl"
]),
]),
toPay
(){
let
payUrl
=
this
.
payUrl
+
"&accountType=1&payType=3&selected=1&failUrl="
+
encodeURIComponent
(
'https://pay.qinqinxiaobao.com/callback/fail'
)
+
"&successUrl="
+
encodeURIComponent
(
'https://pay.qinqinxiaobao.com/callback/success'
)
+
""
+
"&periodId="
+
this
.
currentPerId
;
window
.
open
(
payUrl
);
},
toPage
(
flag
)
{
toPage
(
flag
)
{
switch
(
flag
)
{
switch
(
flag
)
{
case
1
:
// 充值
case
1
:
// 充值
...
@@ -423,6 +430,7 @@ export default {
...
@@ -423,6 +430,7 @@ export default {
this
.
setPageNavState
();
this
.
setPageNavState
();
this
.
globalNavLeftArrowClick
(
this
.
navLeftArrowClick
);
this
.
globalNavLeftArrowClick
(
this
.
navLeftArrowClick
);
await
this
.
loadPeriodData
();
await
this
.
loadPeriodData
();
this
.
payUrl
=
await
this
.
loadPayUrl
();
}
}
};
};
</
script
>
</
script
>
...
...
src/views/More/index.vue
View file @
8c75276c
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
</div>
</div>
</div>
</div>
<div
class=
"header_info"
>
<div
class=
"header_info"
>
<div
class=
"left"
>
<div
class=
"left"
@
click=
"toPay()"
>
<img
src
alt
/>
<img
src
alt
/>
<span>
充值
</span>
<span>
充值
</span>
</div>
</div>
...
@@ -62,6 +62,7 @@ export default {
...
@@ -62,6 +62,7 @@ export default {
return
{
return
{
title
:
""
,
title
:
""
,
list
:
[],
list
:
[],
payUrl
:
""
,
summary
:
{
summary
:
{
accountId
:
0
,
accountId
:
0
,
balance
:
0
,
balance
:
0
,
...
@@ -70,12 +71,17 @@ export default {
...
@@ -70,12 +71,17 @@ export default {
};
};
},
},
methods
:
{
methods
:
{
...
mapActions
([
"loadMoreList"
,
"loadMoreSummary"
]),
...
mapActions
([
"loadMoreList"
,
"loadMoreSummary"
,
"loadPayUrl"
]),
toPay
()
{
let
payUrl
=
this
.
payUrl
+
"&accountType=1&payType=3&selected=1&failUrl="
+
encodeURIComponent
(
'https://pay.qinqinxiaobao.com/callback/fail'
)
+
"&successUrl="
+
encodeURIComponent
(
'https://pay.qinqinxiaobao.com/callback/success'
)
+
""
+
"&periodId="
+
this
.
currentPerId
;
window
.
open
(
payUrl
);
},
toPage
()
{
toPage
()
{
this
.
$router
.
push
({
this
.
$router
.
push
({
name
:
"billrecord"
,
name
:
"billrecord"
,
query
:
{
accountId
:
this
.
summary
.
accountId
}
query
:
{
accountId
:
this
.
summary
.
accountId
}
});
});
},
},
toNextPage
(
index
,
name
)
{
toNextPage
(
index
,
name
)
{
this
.
$router
.
push
({
name
:
"moredetail"
,
query
:
{
index
,
name
}
});
this
.
$router
.
push
({
name
:
"moredetail"
,
query
:
{
index
,
name
}
});
...
@@ -106,6 +112,7 @@ export default {
...
@@ -106,6 +112,7 @@ export default {
this
.
setPageNavState
();
this
.
setPageNavState
();
this
.
globalNavLeftArrowClick
(
this
.
navLeftArrowClick
);
this
.
globalNavLeftArrowClick
(
this
.
navLeftArrowClick
);
await
this
.
getData
();
await
this
.
getData
();
this
.
payUrl
=
await
this
.
loadPayUrl
();
}
}
};
};
</
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