312
This commit is contained in:
parent
566df7f3b9
commit
65696dff7c
|
|
@ -6,11 +6,11 @@
|
||||||
// 开发环境配置
|
// 开发环境配置
|
||||||
const development = {
|
const development = {
|
||||||
// API基础URL
|
// API基础URL
|
||||||
baseUrl: 'https://sqqp.zpc-xy.com',
|
// baseUrl: 'https://sqqp.zpc-xy.com',
|
||||||
// baseUrl: 'http://1.15.21.245:2401',
|
// baseUrl: 'http://1.15.21.245:2401',
|
||||||
host: ['https://sqqp.zpc-xy.com'],
|
// host: ['https://sqqp.zpc-xy.com'],
|
||||||
// baseUrl: 'http://192.168.1.21:2016',
|
baseUrl: 'http://192.168.1.21:2016',
|
||||||
// host: ['http://192.168.1.21:2016'],
|
host: ['http://192.168.1.21:2016'],
|
||||||
imageUrl: 'https://guyu-1308826010.cos.ap-shanghai.myqcloud.com',
|
imageUrl: 'https://guyu-1308826010.cos.ap-shanghai.myqcloud.com',
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -96,9 +96,15 @@
|
||||||
|
|
||||||
<card-container marginTop="30rpx">
|
<card-container marginTop="30rpx">
|
||||||
|
|
||||||
<label-slect-field label="鸽子费">
|
<label-slect-field label="鸽子费">
|
||||||
<com-appointment-radio-select :options="depositOptions" v-model="reservationInfo.deposit_fee" />
|
<com-appointment-radio-select :options="depositOptions" v-model="reservationInfo.deposit_fee" />
|
||||||
</label-slect-field>
|
</label-slect-field>
|
||||||
|
<view v-if="reservationInfo.deposit_fee === -1" :style="{ height: lineHeight }"></view>
|
||||||
|
<label-slect-field v-if="reservationInfo.deposit_fee === -1" label="金额">
|
||||||
|
<view class="input-wrapper">
|
||||||
|
<up-input type="number" placeholder="请输入0-50" v-model="customDeposit" @input="onCustomDepositInput"></up-input>
|
||||||
|
</view>
|
||||||
|
</label-slect-field>
|
||||||
<view :style="{ height: lineHeight }"></view>
|
<view :style="{ height: lineHeight }"></view>
|
||||||
<text class="note-text">鸽子费(保证金),参与人需缴纳鸽子费。若有参与者在预约后没有赴约,其鸽子费由在场的所有人平分。组局成功或失败后鸽子费将全额返还。</text>
|
<text class="note-text">鸽子费(保证金),参与人需缴纳鸽子费。若有参与者在预约后没有赴约,其鸽子费由在场的所有人平分。组局成功或失败后鸽子费将全额返还。</text>
|
||||||
</card-container>
|
</card-container>
|
||||||
|
|
@ -396,9 +402,21 @@ const depositOptions = ref([
|
||||||
{ value: 0, text: '0元' },
|
{ value: 0, text: '0元' },
|
||||||
{ value: 5, text: '5元' },
|
{ value: 5, text: '5元' },
|
||||||
{ value: 10, text: '10元' },
|
{ value: 10, text: '10元' },
|
||||||
|
{ value: -1, text: '自定义' },
|
||||||
])
|
])
|
||||||
|
|
||||||
const currentValue = ref(0)
|
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 = () => {
|
const increment = () => {
|
||||||
if (currentValue.value < 5) {
|
if (currentValue.value < 5) {
|
||||||
|
|
@ -522,7 +540,7 @@ const submitReservation = async () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var messageId = await getSubscribeMessage(reservationInfo.value.deposit_fee);
|
var messageId = await getSubscribeMessage(reservationInfo.value.deposit_fee);
|
||||||
console.log("messageId", messageId);
|
console.log("messageId", messageId);
|
||||||
var subscribeMessage = await requestSubscribeMessage(messageId);
|
var subscribeMessage = await requestSubscribeMessage(messageId);
|
||||||
|
|
@ -533,11 +551,23 @@ const submitReservation = async () => {
|
||||||
title: '提交中...'
|
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,
|
...reservationInfo.value,
|
||||||
// 确保信誉限制同步
|
// 确保信誉限制同步
|
||||||
credit_limit: currentValue.value,
|
credit_limit: currentValue.value,
|
||||||
|
deposit_fee: finalDeposit,
|
||||||
important_data: {}
|
important_data: {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -561,7 +591,7 @@ const submitReservation = async () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
var resPay = null;
|
var resPay = null;
|
||||||
if (submitData.deposit_fee > 0) {
|
if (submitData.deposit_fee > 0) {
|
||||||
resPay = await usePay(submitData.deposit_fee);
|
resPay = await usePay(submitData.deposit_fee);
|
||||||
if (resPay == null) {
|
if (resPay == null) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user