hookehuyr

feat: 在预约API中添加source_type参数以区分H5来源

在addReserveAPI函数中新增source_type参数,允许区分来自H5和小程序的预约请求。在submit.vue的提交逻辑中,为H5页面调用时显式传递source_type: 'H5'参数,确保后端能正确识别预约来源。
1 /* 1 /*
2 * @Date: 2023-08-24 09:42:27 2 * @Date: 2023-08-24 09:42:27
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-01-29 17:26:42 4 + * @LastEditTime: 2026-02-13 11:34:50
5 * @FilePath: /xysBooking/src/api/index.js 5 * @FilePath: /xysBooking/src/api/index.js
6 * @Description: 文件描述 6 * @Description: 文件描述
7 */ 7 */
...@@ -73,6 +73,7 @@ export const delPersonAPI = (params) => fn(fetch.post(Api.DEL_PERSON, params)); ...@@ -73,6 +73,7 @@ export const delPersonAPI = (params) => fn(fetch.post(Api.DEL_PERSON, params));
73 * @param {String} begin_time 73 * @param {String} begin_time
74 * @param {String} end_time 74 * @param {String} end_time
75 * @param {String} person_id_list 75 * @param {String} person_id_list
76 + * @param {String} source_type 来源类型。H5=来自H5的预约, MINI_PROGRAM=来自小程序的预约。默认为 MINI_PROGRAM
76 * @returns {String} bill_id 预约单id 77 * @returns {String} bill_id 预约单id
77 */ 78 */
78 export const addReserveAPI = (params) => fn(fetch.post(Api.ADD_RESERVE, params)); 79 export const addReserveAPI = (params) => fn(fetch.post(Api.ADD_RESERVE, params));
......
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: 2026-01-22 12:18:08 4 + * @LastEditTime: 2026-02-13 11:35:10
5 - * @FilePath: /git/xysBooking/src/views/submit.vue 5 + * @FilePath: /xysBooking/src/views/submit.vue
6 * @Description: 预约人员信息 6 * @Description: 预约人员信息
7 --> 7 -->
8 <template> 8 <template>
...@@ -153,7 +153,7 @@ const submitBtn = async () => { ...@@ -153,7 +153,7 @@ const submitBtn = async () => {
153 showToast('请先添加参观者') 153 showToast('请先添加参观者')
154 } else { 154 } else {
155 // TAG: 提交订单跳转到支付页面 155 // TAG: 提交订单跳转到支付页面
156 - 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 }); 156 + 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, source_type: 'H5' });
157 if (code) { 157 if (code) {
158 const pay_id = data?.pay_id 158 const pay_id = data?.pay_id
159 const need_pay = data?.need_pay 159 const need_pay = data?.need_pay
......