Commit 8c75276c by 展昭

update

parent 8d9016b1
...@@ -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);
}
}; };
...@@ -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();
......
...@@ -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");
......
...@@ -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,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>
......
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