Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
xysBooking
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2024-01-29 13:48:13 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b8551ad860b6b907934ee62f9a1223b3497ec883
b8551ad8
1 parent
836b309d
fix 回调页面调整
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
11 deletions
src/views/callback.vue
src/views/callback.vue
View file @
b8551ad
<!--
* @Date: 2024-01-26 10:24:45
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-01-2
6 17:21:40
* @LastEditTime: 2024-01-2
9 13:44:24
* @FilePath: /xysBooking/src/views/callback.vue
* @Description: 反馈页面
-->
...
...
@@ -21,6 +21,9 @@
<div class="visit-time">参访时间:<span>{{ billInfo?.datetime }}</span></div>
<div class="payment-amount">支付金额:<span>¥ {{ billInfo?.total_amt }}</span></div>
</div>
<div style="border-bottom: 1px dashed #A67939; padding: 0.5rem; display: flex; justify-content: center;">
<van-button color="#A67939" size="small" @click="returnMerchant()">返回商户</van-button>
</div>
<!-- <div class="appointment-notice">
<p style="margin-bottom: 0.25rem;"><van-icon name="info-o" /> 温馨提示</p>
<p style="font-size: 0.85rem;">1. 一人一码,或拿身份证,扫码或识别身份证成功后进入</p>
...
...
@@ -58,19 +61,48 @@ const PAY_STATUS = {
}
const pay_status = ref('1');
onMounted(async () => {
// 获取订单ID
const { code, data } = await icbcOrderQryAPI({ out_trade_no: $route.query.out_trade_no });
if (code) {
pay_status.value = data.pay_status;
//获取url中返回参数
function getQueryString(name) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
if (pair[0] == name) {
return pair[1];
}
}
return null;
}
const out_trade_no = getQueryString('out_trade_no');
const callback = async () => {
// 获取订单详情
const { code:code_pay, data:data_pay } = await onAuthBillInfoAPI({ pay_id: data.pay_id
});
const { code:code_pay, data:data_pay } = await onAuthBillInfoAPI({ pay_id: out_trade_no
});
if (code_pay) {
//
data_pay.datetime = data_pay && formatDatetime(data_pay);
billInfo.value = data_pay;
var mchData = { action: 'onIframeReady', displayStyle: 'SHOW_CUSTOM_PAGE', height: 404 };
let postData = JSON.stringify(mchData);
top.postMessage(postData, '*');
}
}
const returnMerchant = () => {
var mchData = {
action: 'jumpOut',
jumpOutUrl: window.location.origin + window.location.pathname //跳转的页面
}
console.log('调用成功',mchData);
var postData = JSON.stringify(mchData)
top.postMessage(postData, "*")
}
callback();
onMounted(async () => {
})
</script>
...
...
@@ -82,10 +114,10 @@ onMounted(async () => {
display: flex;
align-items: center;
justify-content: center;
height:
35
vh;
height:
20
vh;
flex-direction: column;
img {
width:
5
0vw;
width:
3
0vw;
}
.text {
color: #A67939;
...
...
@@ -94,9 +126,9 @@ onMounted(async () => {
}
}
.appointment-information {
padding: 2rem 1rem;
border-bottom: 1px dashed #A67939;
padding: 1rem;
line-height: 2;
padding-bottom: 0;
.number-of-visitors {
span {
color: #A67939;
...
...
Please
register
or
login
to post a comment