feat(config): add finance rules, activity rules, and real expert application flow
这个提交包含在:
@@ -763,3 +763,16 @@ export async function getSafetyPlaces() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交大神实名资质入驻认证申请
|
||||
*/
|
||||
export async function applyExpertCert(data) {
|
||||
try {
|
||||
const res = await http.post('/companions/apply', data);
|
||||
return res;
|
||||
} catch (err) {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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 () => {
|
||||
|
||||
@@ -206,6 +206,74 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 大神实名认证与资质入驻申请弹窗 (任务四:真实资料与后台审核) -->
|
||||
<view class="profile-edit-modal-mask" v-if="showExpertCertModal" @click="showExpertCertModal = false">
|
||||
<view class="profile-edit-modal expert-cert-modal" @click.stop>
|
||||
<view class="modal-header">
|
||||
<text class="modal-title">陪伴师 / 大神入驻实名申请</text>
|
||||
<view class="btn-close btn-active" @click="showExpertCertModal = false">
|
||||
<image class="close-svg" :src="ICONS.close" mode="aspectFit" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="modal-body">
|
||||
<view class="cert-alert">
|
||||
<text class="cert-alert-text">提交真实有效资料,平台将在 24 小时内由运营团队人工核验后开通接单工作台。</text>
|
||||
</view>
|
||||
|
||||
<view class="edit-field">
|
||||
<text class="field-label">真实姓名</text>
|
||||
<input class="field-input" v-model="expertCertForm.realName" placeholder="如:张三 (须与身份证一致)" placeholder-class="field-placeholder" />
|
||||
</view>
|
||||
|
||||
<view class="edit-field">
|
||||
<text class="field-label">身份证号码</text>
|
||||
<input class="field-input" v-model="expertCertForm.idCard" maxlength="18" placeholder="18位二代身份证号" placeholder-class="field-placeholder" />
|
||||
</view>
|
||||
|
||||
<view class="edit-field">
|
||||
<text class="field-label">主营陪伴品类</text>
|
||||
<view class="track-chips">
|
||||
<view
|
||||
v-for="trk in ['同城陪吃', 'KTV陪唱', '同城陪喝', '线上电竞', '同城桌游']"
|
||||
:key="trk"
|
||||
class="track-chip btn-active"
|
||||
:class="{ active: expertCertForm.track === trk }"
|
||||
@click="expertCertForm.track = trk"
|
||||
>
|
||||
{{ trk }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="edit-field">
|
||||
<text class="field-label">期望服务单价 (元/小时,平台限价: ¥{{ expertPriceMin }} - ¥{{ expertPriceMax }})</text>
|
||||
<input class="field-input price-num-input" type="number" v-model="expertCertForm.hourlyRate" :placeholder="`推荐单价 ¥${expertDefaultRate}`" placeholder-class="field-placeholder" />
|
||||
</view>
|
||||
|
||||
<view class="edit-field" v-if="expertCandidateTags.length > 0">
|
||||
<text class="field-label">技能专长标签 (最多选6项)</text>
|
||||
<view class="tags-chips">
|
||||
<view
|
||||
v-for="tg in expertCandidateTags"
|
||||
:key="tg"
|
||||
class="tag-pill btn-active"
|
||||
:class="{ active: expertCertForm.tags.includes(tg) }"
|
||||
@click="toggleCertTag(tg)"
|
||||
>
|
||||
{{ tg }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="modal-footer">
|
||||
<button class="btn-modal btn-cancel btn-active" @click="showExpertCertModal = false">取消</button>
|
||||
<button class="btn-modal btn-save btn-active" @click="submitExpertCertForm">提交审核</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部自定义导航栏 (动态自适应发单人4项 / 接单人3项) -->
|
||||
<custom-tab-bar current="user" />
|
||||
|
||||
@@ -546,13 +614,22 @@ const handleRecharge = async () => {
|
||||
|
||||
const handleWithdraw = () => {
|
||||
const comm = Number(user.value.commission || 0);
|
||||
const finRules = platformConfigs.value.finance_rules || {};
|
||||
const minWithdraw = Number(finRules.minWithdrawAmount) || 50;
|
||||
const withdrawDesc = finRules.withdrawDesc || '提现将自动发起微信企业付款打款到微信零钱。';
|
||||
|
||||
if (comm <= 0) {
|
||||
uni.showToast({ title: '暂无可用提现佣金', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
if (comm < minWithdraw) {
|
||||
uni.showToast({ title: `提现金额须满 ¥${minWithdraw} 元起提`, icon: 'none' });
|
||||
return;
|
||||
}
|
||||
|
||||
uni.showModal({
|
||||
title: '佣金提现申请',
|
||||
content: `当前可提现佣金为 ¥${user.value.commission},提现将自动发起微信企业付款打款到微信零钱。`,
|
||||
content: `当前可提现佣金为 ¥${user.value.commission} (最低满¥${minWithdraw}起提)。\n${withdrawDesc}`,
|
||||
confirmText: '确认提现',
|
||||
confirmColor: '#10B981',
|
||||
success: async (res) => {
|
||||
@@ -579,14 +656,99 @@ const handleWithdraw = () => {
|
||||
};
|
||||
|
||||
const showInvitePoster = () => {
|
||||
const finRules = platformConfigs.value.finance_rules || {};
|
||||
const firstRate = finRules.firstReferralPercent != null ? finRules.firstReferralPercent : 5.0;
|
||||
const secondRate = finRules.secondReferralPercent != null ? finRules.secondReferralPercent : 2.0;
|
||||
const totalRate = (Number(firstRate) + Number(secondRate)).toFixed(1);
|
||||
|
||||
uni.showModal({
|
||||
title: '二级分销推广',
|
||||
content: `您的专属邀请码为:PW${user.value.id}\n已成功邀请 ${user.value.invitedCount} 位好友!\n好友下单您将实时享受最高 15% 自动分润提成。`,
|
||||
content: `您的专属邀请码为:PW${user.value.id}\n已成功邀请 ${user.value.invitedCount} 位好友!\n好友下单享受直推 ${firstRate}% + 间推 ${secondRate}%,全网自动分润最高达 ${totalRate}%!`,
|
||||
showCancel: false,
|
||||
confirmText: '保存太阳码'
|
||||
confirmText: '保存推广码'
|
||||
});
|
||||
};
|
||||
|
||||
const showExpertCertModal = ref(false);
|
||||
const expertCertForm = ref({
|
||||
realName: '',
|
||||
idCard: '',
|
||||
track: '同城陪吃',
|
||||
hourlyRate: 88,
|
||||
tags: []
|
||||
});
|
||||
|
||||
const expertPriceMin = computed(() => {
|
||||
return platformConfigs.value.expert_rules?.minHourlyRate || 30;
|
||||
});
|
||||
const expertPriceMax = computed(() => {
|
||||
return platformConfigs.value.expert_rules?.maxHourlyRate || 500;
|
||||
});
|
||||
const expertDefaultRate = computed(() => {
|
||||
return platformConfigs.value.expert_rules?.defaultHourlyRate || 88;
|
||||
});
|
||||
const expertCandidateTags = computed(() => {
|
||||
return platformConfigs.value.expert_rules?.candidateTags || [
|
||||
'国服王者', '声优达人', '幽默风趣', '随叫随到', '暖心倾听',
|
||||
'百星野王', '金牌探店', '量贩麦霸', '微醺搭子'
|
||||
];
|
||||
});
|
||||
|
||||
const toggleCertTag = (tag) => {
|
||||
const idx = expertCertForm.value.tags.indexOf(tag);
|
||||
if (idx > -1) {
|
||||
expertCertForm.value.tags.splice(idx, 1);
|
||||
} else {
|
||||
if (expertCertForm.value.tags.length >= 6) {
|
||||
uni.showToast({ title: '最多选择6个技能标签', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
expertCertForm.value.tags.push(tag);
|
||||
}
|
||||
};
|
||||
|
||||
const submitExpertCertForm = async () => {
|
||||
if (!expertCertForm.value.realName || !expertCertForm.value.realName.trim()) {
|
||||
uni.showToast({ title: '请输入真实姓名', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
if (!expertCertForm.value.idCard || expertCertForm.value.idCard.length < 15) {
|
||||
uni.showToast({ title: '请输入有效身份证号', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
|
||||
const rate = Number(expertCertForm.value.hourlyRate) || expertDefaultRate.value;
|
||||
if (rate < expertPriceMin.value || rate > expertPriceMax.value) {
|
||||
uni.showToast({ title: `单价需在 ¥${expertPriceMin.value} - ¥${expertPriceMax.value} 之间`, icon: 'none' });
|
||||
return;
|
||||
}
|
||||
|
||||
uni.showLoading({ title: '正在提交认证...' });
|
||||
try {
|
||||
await applyExpertCert({
|
||||
userId: user.value.id || 1001,
|
||||
name: expertCertForm.value.realName.trim(),
|
||||
idCard: expertCertForm.value.idCard.trim(),
|
||||
track: expertCertForm.value.track,
|
||||
hourlyRate: rate,
|
||||
tags: expertCertForm.value.tags,
|
||||
avatar: user.value.avatar,
|
||||
gender: user.value.gender === 'male' ? '男' : '女'
|
||||
});
|
||||
setExpertCertStatus(CERT_STATUS.PENDING);
|
||||
showExpertCertModal.value = false;
|
||||
uni.hideLoading();
|
||||
uni.showModal({
|
||||
title: '申请已提交',
|
||||
content: '您的入驻申请已成功提交至平台审核中心,运营团队核准后即可自动开通接单工作台。',
|
||||
showCancel: false,
|
||||
confirmText: '我知道了'
|
||||
});
|
||||
} catch (e) {
|
||||
uni.hideLoading();
|
||||
uni.showToast({ title: e.message || '提交申请失败', icon: 'none' });
|
||||
}
|
||||
};
|
||||
|
||||
const applyExpert = () => {
|
||||
const certStatus = getExpertCertStatus();
|
||||
@@ -606,26 +768,15 @@ const applyExpert = () => {
|
||||
});
|
||||
return;
|
||||
}
|
||||
uni.showModal({
|
||||
title: '申请成为陪玩大神',
|
||||
content: '需开通实名认证以承接线上游戏与同城生活陪伴订单。是否确认提交当前用户实名认证?',
|
||||
confirmText: '提交入驻',
|
||||
cancelText: '取消',
|
||||
confirmColor: '#10B981',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
setExpertCertStatus(CERT_STATUS.APPROVED);
|
||||
uni.showToast({
|
||||
title: '实名认证已通过!接单权限已开通',
|
||||
icon: 'success',
|
||||
duration: 1500
|
||||
});
|
||||
uni.navigateTo({
|
||||
url: '/pages/expert/workspace'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
expertCertForm.value = {
|
||||
realName: '',
|
||||
idCard: '',
|
||||
track: '同城陪吃',
|
||||
hourlyRate: expertDefaultRate.value,
|
||||
tags: []
|
||||
};
|
||||
showExpertCertModal.value = true;
|
||||
};
|
||||
|
||||
const contactService = () => {
|
||||
@@ -1475,6 +1626,73 @@ const navTo = (url) => {
|
||||
}
|
||||
}
|
||||
|
||||
.expert-cert-modal {
|
||||
max-height: 85vh;
|
||||
overflow-y: auto;
|
||||
|
||||
.cert-alert {
|
||||
background: rgba(99, 102, 241, 0.08);
|
||||
border: 1px solid rgba(99, 102, 241, 0.2);
|
||||
border-radius: 12rpx;
|
||||
padding: 16rpx 20rpx;
|
||||
margin-bottom: 24rpx;
|
||||
|
||||
.cert-alert-text {
|
||||
font-size: 24rpx;
|
||||
color: #6366F1;
|
||||
line-height: 1.5;
|
||||
}
|
||||
}
|
||||
|
||||
.track-chips, .tags-chips {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 14rpx;
|
||||
margin-top: 10rpx;
|
||||
|
||||
.track-chip, .tag-pill {
|
||||
font-size: 24rpx;
|
||||
padding: 12rpx 24rpx;
|
||||
border-radius: 30rpx;
|
||||
background: var(--bg-card, #1E293B);
|
||||
color: #94A3B8;
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&.active {
|
||||
background: #6366F1;
|
||||
color: #FFFFFF;
|
||||
border-color: #6366F1;
|
||||
box-shadow: 0 4rpx 12rpx rgba(99, 102, 241, 0.35);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.theme-warm .expert-cert-modal {
|
||||
.cert-alert {
|
||||
background: #FFF7ED;
|
||||
border-color: #FDBA74;
|
||||
|
||||
.cert-alert-text {
|
||||
color: #EA580C;
|
||||
}
|
||||
}
|
||||
|
||||
.track-chips .track-chip, .tags-chips .tag-pill {
|
||||
background: #FDFBF7;
|
||||
color: #78716C;
|
||||
border-color: #E7E2D8;
|
||||
|
||||
&.active {
|
||||
background: linear-gradient(135deg, #EA580C, #F97316);
|
||||
color: #FFFFFF;
|
||||
border-color: #EA580C;
|
||||
box-shadow: 0 4rpx 14rpx rgba(234, 88, 12, 0.35);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes glowSpin {
|
||||
0% { transform: rotate(0deg); }
|
||||
100% { transform: rotate(360deg); }
|
||||
|
||||
在新工单中引用
屏蔽一个用户