Commit 8c75276c by 展昭

update

parent 8d9016b1
...@@ -13,4 +13,8 @@ export default { ...@@ -13,4 +13,8 @@ export default {
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);
}
}; };
...@@ -4,6 +4,7 @@ function initJsBridge(readyCallback) { ...@@ -4,6 +4,7 @@ function initJsBridge(readyCallback) {
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) {
if (isAndroid) { if (isAndroid) {
...@@ -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();
......
...@@ -32,9 +32,6 @@ FastClick.prototype.focus = function (targetElement) { ...@@ -32,9 +32,6 @@ FastClick.prototype.focus = function (targetElement) {
Vue.prototype.setPageNavState = function () { Vue.prototype.setPageNavState = function () {
try { try {
initJsBridge(() => { initJsBridge(() => {
window.WebViewJavascriptBridge.callHandler("ready", null, function (
response
) {
window.WebViewJavascriptBridge.callHandler( window.WebViewJavascriptBridge.callHandler(
"setPageNavState", "setPageNavState",
{ {
...@@ -50,7 +47,6 @@ Vue.prototype.setPageNavState = function () { ...@@ -50,7 +47,6 @@ Vue.prototype.setPageNavState = function () {
} }
); );
}); });
});
} catch (err) { } catch (err) {
console.log("setPageNavState is error"); console.log("setPageNavState is error");
} }
......
...@@ -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)
}
})
});
} }
} }
......
...@@ -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>
......
...@@ -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,7 +71,12 @@ export default { ...@@ -70,7 +71,12 @@ 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",
...@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment