From 65696dff7c556a4de29c5569a2023cfde7be84f7 Mon Sep 17 00:00:00 2001 From: zpc Date: Tue, 2 Dec 2025 14:05:38 +0800 Subject: [PATCH] 312 --- common/env.js | 8 ++--- pages/appointment/appointment-page.vue | 46 +++++++++++++++++++++----- 2 files changed, 42 insertions(+), 12 deletions(-) diff --git a/common/env.js b/common/env.js index 357a4ca..2f79dc6 100644 --- a/common/env.js +++ b/common/env.js @@ -6,11 +6,11 @@ // 开发环境配置 const development = { // API基础URL - baseUrl: 'https://sqqp.zpc-xy.com', + // baseUrl: 'https://sqqp.zpc-xy.com', // baseUrl: 'http://1.15.21.245:2401', - host: ['https://sqqp.zpc-xy.com'], - // baseUrl: 'http://192.168.1.21:2016', - // host: ['http://192.168.1.21:2016'], + // host: ['https://sqqp.zpc-xy.com'], + baseUrl: 'http://192.168.1.21:2016', + host: ['http://192.168.1.21:2016'], imageUrl: 'https://guyu-1308826010.cos.ap-shanghai.myqcloud.com', }; diff --git a/pages/appointment/appointment-page.vue b/pages/appointment/appointment-page.vue index 2f73956..d26957b 100644 --- a/pages/appointment/appointment-page.vue +++ b/pages/appointment/appointment-page.vue @@ -96,9 +96,15 @@ - - - + + + + + + + + + 鸽子费(保证金),参与人需缴纳鸽子费。若有参与者在预约后没有赴约,其鸽子费由在场的所有人平分。组局成功或失败后鸽子费将全额返还。 @@ -396,9 +402,21 @@ const depositOptions = ref([ { value: 0, text: '0元' }, { value: 5, text: '5元' }, { value: 10, text: '10元' }, + { value: -1, text: '自定义' }, ]) const currentValue = ref(0) +const customDeposit = ref('') + +const onCustomDepositInput = (val) => { + // 仅保留数字与小数点,但需求是整数金额,按只允许数字处理 + let v = String(val).replace(/[^0-9]/g, '') + if (v === '') v = '0' + let n = Number(v) + if (n > 50) n = 50 + if (n < 0) n = 0 + customDeposit.value = String(n) +} const increment = () => { if (currentValue.value < 5) { @@ -522,7 +540,7 @@ const submitReservation = async () => { } - try { + try { var messageId = await getSubscribeMessage(reservationInfo.value.deposit_fee); console.log("messageId", messageId); var subscribeMessage = await requestSubscribeMessage(messageId); @@ -533,11 +551,23 @@ const submitReservation = async () => { title: '提交中...' }) - // 准备提交数据 - const submitData = { + // 处理自定义鸽子费 + let finalDeposit = reservationInfo.value.deposit_fee + if (finalDeposit === -1) { + const n = Number(customDeposit.value || 0) + if (isNaN(n) || n < 0 || n > 50) { + uni.showToast({ title: '自定义金额需在0-50之间', icon: 'none' }) + return + } + finalDeposit = n + } + + // 准备提交数据 + const submitData = { ...reservationInfo.value, // 确保信誉限制同步 - credit_limit: currentValue.value, + credit_limit: currentValue.value, + deposit_fee: finalDeposit, important_data: {} } @@ -561,7 +591,7 @@ const submitReservation = async () => { } var resPay = null; - if (submitData.deposit_fee > 0) { + if (submitData.deposit_fee > 0) { resPay = await usePay(submitData.deposit_fee); if (resPay == null) { uni.showToast({