hookehuyr

日期显示隐藏秒数,首页入口显示样式调整

<!--
* @Date: 2024-01-16 10:06:47
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-01-30 10:50:03
* @LastEditTime: 2024-01-30 15:43:22
* @FilePath: /xysBooking/src/components/qrCode.vue
* @Description: 预约码卡组件
-->
......@@ -61,7 +61,7 @@ import { Cookies, axios, storeToRefs, mainStore, Toast, useTitle } from '@/utils
//import { } from '@/utils/generateModules.js'
//import { } from '@/utils/generateIcons.js'
//import { } from '@/composables'
import { formatDatetime } from '@/utils/tools';
import { qrcodeListAPI, qrcodeStatusAPI, billPersonAPI } from '@/api/index'
import { useGo } from '@/hooks/useGo'
const go = useGo();
......@@ -205,11 +205,11 @@ onMounted(async () => {
// 生成二维码地址
item.qr_code_url = 'http://oa.onwall.cn/admin?m=srv&a=get_qrcode&key=' + item.qr_code;
// 二维码使用时间
let begin_time = item.begin_time.slice(0, -3);
let end_time = item.end_time.slice(0, -3);
let begin_time = item.begin_time.slice(0, -6);
let end_time = item.end_time.slice(0, -6);
let str = begin_time + ' ' + end_time;
//
item.datetime = `${str.split(' ')[0]} ${str.split(' ')[1]}-${str.split(' ')[3]}`;
item.datetime = formatDatetime({ begin_time: item.begin_time, end_time: item.end_time })
item.sort = 0;
});
const { code: status_code, data: status_data } = await qrcodeStatusAPI({ qr_code: data[select_index.value]?.qr_code });
......
/*
* @Date: 2022-04-18 15:59:42
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-01-30 14:00:25
* @LastEditTime: 2024-01-30 15:43:33
* @FilePath: /xysBooking/src/utils/tools.js
* @Description: 文件描述
*/
......@@ -72,8 +72,8 @@ const strExist = (array, str) => {
}
const formatDatetime = (data) => { // 格式化日期
let begin_time = data?.begin_time.slice(0, -3);
let end_time = data?.end_time.slice(0, -3);
let begin_time = data?.begin_time.slice(0, -6);
let end_time = data?.end_time.slice(0, -6);
let str = begin_time + ' ' + end_time;
return `${str.split(' ')[0]} ${str.split(' ')[1]}-${str.split(' ')[3]}`;
}
......
<!--
* @Date: 2024-01-15 13:35:51
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-01-30 15:21:55
* @LastEditTime: 2024-01-30 15:37:28
* @FilePath: /xysBooking/src/views/booking.vue
* @Description: 预约页面
-->
......@@ -51,7 +51,7 @@
<div class="left">
<van-icon v-if="checked_time !== index" :name="icon_select1" />&nbsp;
<van-icon v-else :name="icon_select2" />&nbsp;
{{ item.begin_time }}-{{ item.end_time }}
{{ item.begin_time.slice(0, -3) }}-{{ item.end_time.slice(0, -3) }}
&nbsp;&nbsp;<span class="price">¥&nbsp;{{ item.price }}</span>
</div>
<div class="right">
......@@ -289,7 +289,7 @@ const nextBtn = () => {
show_error.value = true;
error_message.value = '请选择日期和时间段';
} else {
go('/submit', { date: checked_day.value, time: `${timePeriod.value[checked_time.value]['begin_time']}-${timePeriod.value[checked_time.value]['end_time']}`, price: checked_day_price.value });
go('/submit', { date: checked_day.value, time: `${timePeriod.value[checked_time.value]['begin_time'].slice(0, -3)}-${timePeriod.value[checked_time.value]['end_time'].slice(0, -3)}`, price: checked_day_price.value });
}
}
</script>
......
<!--
* @Date: 2023-06-21 10:23:09
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-01-30 15:20:20
* @LastEditTime: 2024-01-30 15:35:17
* @FilePath: /xysBooking/src/views/index.vue
* @Description: 预约页首页
-->
......@@ -33,7 +33,7 @@
<div class="booking-wrapper">
<div class="booking" @click="toBooking">
<div><van-icon size="3rem" color="#FFFFFF" :name="icon_1" /></div>
<div style="color: #FFF;">马上预约</div>
<div style="color: #FFF;">开始预约</div>
</div>
</div>
</div>
......@@ -171,16 +171,16 @@ useClickAway(root, () => {
font-size: 1.1rem;
.booking-wrapper {
height: 25vh;
width: 25vh;
height: 19vh;
width: 19vh;
border-radius: 50%;
background-color: rgba(166, 121, 57, 0.26);
display: flex;
align-items: center;
justify-content: center;
.booking {
height: 21.5vh;
width: 21.5vh;
height: 17vh;
width: 17vh;
border-radius: 50%;
background-color: #A67939;
display: flex;
......