feat(config): add finance rules, activity rules, and real expert application flow

这个提交包含在:
xcbyy
2026-10-10 14:06:29 +08:00
父节点 d7f5c31762
当前提交 872af22c20
共有 8 个文件被更改,包括 649 次插入 和 33 次删除

查看文件

@@ -80,12 +80,12 @@
<view class="stepper-row">
<view class="stepper-info">
<text class="row-label">招募席位 (人)</text>
<text class="sub-label">包含房主在内的组局总人数</text>
<text class="sub-label">包含房主在内的组局总人数 ({{ minParticipants }}-{{ maxParticipants }}人)</text>
</view>
<view class="stepper-box">
<button class="step-btn btn-active" :disabled="form.maxParticipants <= 2" @click="changeParticipants(-1)">-</button>
<button class="step-btn btn-active" :disabled="form.maxParticipants <= minParticipants" @click="changeParticipants(-1)">-</button>
<text class="step-val">{{ form.maxParticipants }} 人</text>
<button class="step-btn btn-active" :disabled="form.maxParticipants >= 10" @click="changeParticipants(1)">+</button>
<button class="step-btn btn-active" :disabled="form.maxParticipants >= maxParticipants" @click="changeParticipants(1)">+</button>
</view>
</view>
@@ -138,7 +138,7 @@
<text class="preset-label">快捷赏金:</text>
<view class="preset-chips">
<view
v-for="amt in [200, 300, 500, 800, 1000]"
v-for="amt in presetPerPersonFees"
:key="amt"
class="preset-chip btn-active"
:class="{ selected: Number(form.perPersonFee) === amt }"
@@ -165,7 +165,7 @@
<text class="preset-label">快捷预算:</text>
<view class="preset-chips">
<view
v-for="amt in [500, 1000, 2000, 3000, 5000]"
v-for="amt in presetTotalFees"
:key="amt"
class="preset-chip btn-active"
:class="{ selected: Number(form.totalFee) === amt }"
@@ -349,11 +349,17 @@ const recommendPublicZones = ref([
'北京市海淀区五道口购物中心 (高校商圈)'
]);
const minParticipants = ref(2);
const maxParticipants = ref(10);
const presetPerPersonFees = ref([200, 300, 500, 800, 1000]);
const presetTotalFees = ref([500, 1000, 2000, 3000, 5000]);
const loadLivePlaces = async () => {
try {
const [placesList, catList] = await Promise.allSettled([
const [placesList, catList, configsRes] = await Promise.allSettled([
getSafetyPlaces(),
getNavCategories()
getNavCategories(),
getPlatformConfigs()
]);
if (placesList.status === 'fulfilled' && Array.isArray(placesList.value) && placesList.value.length > 0) {
@@ -368,6 +374,21 @@ const loadLivePlaces = async () => {
.map((c) => c.name);
if (activeCats.length > 0) {
games.value = activeCats;
if (!games.value.includes(form.value.game)) {
form.value.game = games.value[0];
}
}
}
if (configsRes.status === 'fulfilled' && configsRes.value?.activity_rules) {
const actRules = configsRes.value.activity_rules;
if (actRules.minParticipants) minParticipants.value = Number(actRules.minParticipants);
if (actRules.maxParticipants) maxParticipants.value = Number(actRules.maxParticipants);
if (Array.isArray(actRules.presetPerPersonFees) && actRules.presetPerPersonFees.length > 0) {
presetPerPersonFees.value = actRules.presetPerPersonFees;
}
if (Array.isArray(actRules.presetTotalFees) && actRules.presetTotalFees.length > 0) {
presetTotalFees.value = actRules.presetTotalFees;
}
}
} catch (e) {
@@ -386,7 +407,10 @@ const applyRecommendZone = (zone) => {
};
const changeParticipants = (delta) => {
form.value.maxParticipants = Math.max(2, Math.min(10, form.value.maxParticipants + delta));
form.value.maxParticipants = Math.max(
minParticipants.value,
Math.min(maxParticipants.value, form.value.maxParticipants + delta)
);
};
const handleSubmit = async () => {