hookehuyr

fix 二维码功能优化

<!--
* @Date: 2024-01-16 10:06:47
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-01-25 16:10:17
* @LastEditTime: 2024-01-25 16:26:37
* @FilePath: /xysBooking/src/components/qrCode.vue
* @Description: 预约码卡组件
-->
......@@ -190,9 +190,13 @@ onMounted(async () => {
//
item.datetime = `${str.split(' ')[0]} ${str.split(' ')[1]}-${str.split(' ')[3]}`
});
const { code: status_code, data: status_data } = await qrcodeStatusAPI({ qr_code: data[select_index.value]?.qr_code });
if (status_code) {
useStatus.value = status_data.status;
// 剔除qr_code为空的二维码
userList.value = data.filter(item => item.qr_code !== '');
}
}
} else {
const { code, data } = await billPersonAPI({ pay_id });
if (code) {
......@@ -200,10 +204,14 @@ onMounted(async () => {
// 生成二维码地址
item.qr_code_url = 'http://oa.onwall.cn/admin?m=srv&a=get_qrcode&key=' + item.qr_code;
});
const { code: status_code, data: status_data } = await qrcodeStatusAPI({ qr_code: data[select_index.value]?.qr_code });
if (status_code) {
useStatus.value = status_data.status;
// 剔除qr_code为空的二维码
userList.value = data.filter(item => item.qr_code !== '');
}
}
}
});
// 定义轮询函数
......
<!--
* @Date: 2024-01-15 16:25:51
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-01-24 17:28:25
* @LastEditTime: 2024-01-25 16:19:42
* @FilePath: /xysBooking/src/views/submit.vue
* @Description: 预约人员信息
-->
......@@ -23,7 +23,7 @@
<div>
<p style="color: #A67939;">{{ item.name }}</p>
<p>证件号:{{ formatId(item.id_number) }}</p>
<p v-if="item.is_reserve === '1'" style="color: #9C9A9A; font-size: 0.8rem;">*已预约过{{ date }}参观,请不要重复预约</p>
<p v-if="item.is_reserve === RESERVE_STATUS.ENABLE" style="color: #9C9A9A; font-size: 0.8rem;">*已预约过{{ date }}参观,请不要重复预约</p>
</div>
</div>
</div>
......@@ -33,7 +33,7 @@
</div>
<div style="height: 5rem;"></div>
<div class="submit-wrapper">
<div style="display: flex; justify-content: space-between;">
<div class="control-wrapper">
<div class="left">
<div style="margin-left: 1rem; display: flex;align-items: center;">
订单金额&nbsp;&nbsp;<div style="color: #FF1919;display: inline-block;">¥<div style="font-size: 1.5rem;display: inline-block;">&nbsp;{{ total }}</div></div>
......@@ -88,9 +88,13 @@ const formatId = (id) => {
return replaceMiddleCharacters(id);
};
const RESERVE_STATUS = {
ENABLE: '1'
}
const checked_visitors = ref([]);
const addVisitor = (item) => {
if (item.is_reserve === '1') { // 今天已经预约
if (item.is_reserve === RESERVE_STATUS.ENABLE) { // 今天已经预约
showToast('已预约过参观,请不要重复预约')
return;
}
......@@ -125,15 +129,6 @@ const submitBtn = async () => {
if (code) {
const pay_url = `/srv/?f=reserve&a=icbc_pay&pay_id=${data.pay_id}`;
location.href = pay_url; // 跳转支付页面
// const { code: prepare_code, data: prepare_data } = await payPrepareAPI({ pay_id: data.pay_id });
// if (prepare_code) {
// const { code: callback_code, data: callback_data } = await payCallbackAPI({ pay_id: prepare_data.pay_id, pay_status: 1 });
// if (callback_code) {
// // TODO:看需求,把跳转页换成等待页面
// go('/success', { pay_id: prepare_data.pay_id });
// // go('/waiting', { pay_id: prepare_data.pay_id });
// }
// }
}
}
}
......@@ -202,6 +197,10 @@ onMounted(async () => {
// padding: 1rem;
justify-content: space-between;
flex-direction: column;
.control-wrapper {
display: flex;
justify-content: space-between;
}
.left {
display: flex;
justify-content: center;
......