feat(预约): 添加period_type参数到预约和提交流程
在预约和提交页面中添加period_type参数,确保时间段类型信息能正确传递到后端API
Showing
2 changed files
with
8 additions
and
7 deletions
| ... | @@ -308,7 +308,7 @@ const nextBtn = () => { | ... | @@ -308,7 +308,7 @@ const nextBtn = () => { |
| 308 | show_error.value = true; | 308 | show_error.value = true; |
| 309 | error_message.value = '请选择日期和时间段'; | 309 | error_message.value = '请选择日期和时间段'; |
| 310 | } else { | 310 | } else { |
| 311 | - 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 }); | 311 | + 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, period_type: timePeriod.value[checked_time.value].period_type }); |
| 312 | } | 312 | } |
| 313 | } | 313 | } |
| 314 | </script> | 314 | </script> | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2024-01-15 16:25:51 | 2 | * @Date: 2024-01-15 16:25:51 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2024-01-30 15:18:58 | 4 | + * @LastEditTime: 2026-01-22 11:21:08 |
| 5 | - * @FilePath: /xysBooking/src/views/submit.vue | 5 | + * @FilePath: /git/xysBooking/src/views/submit.vue |
| 6 | * @Description: 预约人员信息 | 6 | * @Description: 预约人员信息 |
| 7 | --> | 7 | --> |
| 8 | <template> | 8 | <template> |
| ... | @@ -17,8 +17,8 @@ | ... | @@ -17,8 +17,8 @@ |
| 17 | <div v-if="visitorList.length" class="visitors-list"> | 17 | <div v-if="visitorList.length" class="visitors-list"> |
| 18 | <div v-for="(item, index) in visitorList" :key="index" @click="addVisitor(item)" class="visitor-item"> | 18 | <div v-for="(item, index) in visitorList" :key="index" @click="addVisitor(item)" class="visitor-item"> |
| 19 | <div style="margin-right: 1rem;"> | 19 | <div style="margin-right: 1rem;"> |
| 20 | - <van-icon v-if="!checked_visitors.includes(item.id)" :name="icon_check1" /> | 20 | + <van-icon v-if="!checked_visitors.includes(item.id)" :name="icon_check1" style="margin-right: 0.25rem;" /> |
| 21 | - <van-icon v-else :name="icon_check2" /> | 21 | + <van-icon v-else :name="icon_check2" style="margin-right: 0.25rem;" /> |
| 22 | </div> | 22 | </div> |
| 23 | <div> | 23 | <div> |
| 24 | <p style="color: #A67939;">{{ item.name }}</p> | 24 | <p style="color: #A67939;">{{ item.name }}</p> |
| ... | @@ -108,6 +108,7 @@ const addVisitor = (item) => { | ... | @@ -108,6 +108,7 @@ const addVisitor = (item) => { |
| 108 | const date = $route.query.date; | 108 | const date = $route.query.date; |
| 109 | const time = $route.query.time; | 109 | const time = $route.query.time; |
| 110 | const price = $route.query.price; | 110 | const price = $route.query.price; |
| 111 | +const period_type = $route.query.period_type; | ||
| 111 | 112 | ||
| 112 | const total = computed(() => { | 113 | const total = computed(() => { |
| 113 | return price * checked_visitors.value.length; | 114 | return price * checked_visitors.value.length; |
| ... | @@ -125,7 +126,7 @@ const submitBtn = async () => { | ... | @@ -125,7 +126,7 @@ const submitBtn = async () => { |
| 125 | showToast('请先添加参观者') | 126 | showToast('请先添加参观者') |
| 126 | } else { | 127 | } else { |
| 127 | // TAG: 提交订单跳转到支付页面 | 128 | // TAG: 提交订单跳转到支付页面 |
| 128 | - const { code, data } = await addReserveAPI({ reserve_date: date, begin_time: time.split('-')[0], end_time: time.split('-')[1], person_id_list: JSON.stringify(checked_visitors.value) }); | 129 | + const { code, data } = await addReserveAPI({ reserve_date: date, begin_time: time.split('-')[0], end_time: time.split('-')[1], person_id_list: JSON.stringify(checked_visitors.value), period_type }); |
| 129 | if (code) { | 130 | if (code) { |
| 130 | const pay_url = `/srv/?f=reserve&a=icbc_pay&pay_id=${data.pay_id}`; | 131 | const pay_url = `/srv/?f=reserve&a=icbc_pay&pay_id=${data.pay_id}`; |
| 131 | location.href = pay_url; // 跳转支付页面 | 132 | location.href = pay_url; // 跳转支付页面 |
| ... | @@ -134,7 +135,7 @@ const submitBtn = async () => { | ... | @@ -134,7 +135,7 @@ const submitBtn = async () => { |
| 134 | } | 135 | } |
| 135 | 136 | ||
| 136 | onMounted(async () => { | 137 | onMounted(async () => { |
| 137 | - const { code, data } = await personListAPI({ reserve_date: date, begin_time: time.split('-')[0], end_time: time.split('-')[1] }); | 138 | + const { code, data } = await personListAPI({ reserve_date: date, begin_time: time.split('-')[0], end_time: time.split('-')[1], period_type }); |
| 138 | if (code) { | 139 | if (code) { |
| 139 | visitorList.value = data; | 140 | visitorList.value = data; |
| 140 | } | 141 | } | ... | ... |
-
Please register or login to post a comment