feat(closed-loop): complete end-to-end closed loops across miniapp, backend, and admin
这个提交包含在:
@@ -73,6 +73,15 @@
|
||||
|
||||
<!-- 3. 状态三:未认证 / 重新申请 (NOT_APPLIED / REJECTED) -->
|
||||
<view class="form-container" v-else>
|
||||
<!-- 审核驳回反馈横幅 (当后台驳回时展示具体原因并引导修改重提) -->
|
||||
<view class="notice-banner reject-banner" v-if="certStatus === CERT_STATUS.REJECTED">
|
||||
<image class="banner-icon-svg" :src="ICONS.alert" mode="aspectFit" />
|
||||
<view class="banner-content">
|
||||
<text class="banner-title">上次入驻审核未通过,请修改后重新提交</text>
|
||||
<text class="banner-desc">驳回原因:{{ rejectReason || '提交的资质或语音未通过人工核验,请核对后重新提交' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 平台合规与安全保障提示横幅 -->
|
||||
<view class="notice-banner">
|
||||
<image class="banner-icon-svg" :src="ICONS.shield" mode="aspectFit" />
|
||||
@@ -410,17 +419,41 @@ const contactService = () => {
|
||||
});
|
||||
};
|
||||
|
||||
const rejectReason = ref('');
|
||||
|
||||
const syncRemoteCertStatus = async () => {
|
||||
try {
|
||||
const cachedUser = uni.getStorageSync('PW_USER_INFO') || {};
|
||||
const uid = Number(cachedUser.id) || 1001;
|
||||
const profile = await getUserProfile(uid);
|
||||
if (profile && profile.certStatus !== undefined) {
|
||||
const remoteCert = Number(profile.certStatus);
|
||||
setExpertCertStatus(remoteCert);
|
||||
certStatus.value = remoteCert;
|
||||
rejectReason.value = profile.rejectReason || '';
|
||||
uni.setStorageSync('PW_USER_INFO', {
|
||||
...cachedUser,
|
||||
...profile
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
// 保持本地缓存兜底
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
currentThemeKey.value = getCurrentThemeKey();
|
||||
applyThemeToNativeUI(currentThemeKey.value);
|
||||
certStatus.value = getExpertCertStatus();
|
||||
loadInitialConfigs();
|
||||
syncRemoteCertStatus();
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
currentThemeKey.value = getCurrentThemeKey();
|
||||
applyThemeToNativeUI(currentThemeKey.value);
|
||||
certStatus.value = getExpertCertStatus();
|
||||
syncRemoteCertStatus();
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -443,6 +476,19 @@ onShow(() => {
|
||||
padding: 24rpx;
|
||||
margin-bottom: 28rpx;
|
||||
|
||||
&.reject-banner {
|
||||
background: rgba(244, 63, 94, 0.12);
|
||||
border-color: rgba(244, 63, 94, 0.35);
|
||||
|
||||
.banner-title {
|
||||
color: #FDA4AF;
|
||||
}
|
||||
|
||||
.banner-desc {
|
||||
color: #FECDD3;
|
||||
}
|
||||
}
|
||||
|
||||
.banner-icon-svg {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
|
||||
@@ -115,7 +115,7 @@ import AppTabBar from '@/components/CustomTabBar.vue';
|
||||
import { ICONS } from '@/common/icons.js';
|
||||
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
|
||||
import { isExpertCertified } from '@/common/role.js';
|
||||
import { createOrder, getOrdersPool, getExpertStats, claimOrder } from '@/common/api.js';
|
||||
import { createOrder, getOrdersPool, getExpertStats, claimOrder, updateCompanionProfile } from '@/common/api.js';
|
||||
import { getNavBarInfo } from '@/common/nav.js';
|
||||
|
||||
const currentThemeKey = ref(getCurrentThemeKey());
|
||||
@@ -124,7 +124,7 @@ const expert = ref({
|
||||
nickname: '接单大神',
|
||||
avatar: 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=300'
|
||||
});
|
||||
const isOnline = ref(true);
|
||||
const isOnline = ref(uni.getStorageSync('EXPERT_RECEIVING_STATUS') !== '0');
|
||||
const activeCategory = ref('all');
|
||||
const navInfo = ref(getNavBarInfo());
|
||||
|
||||
@@ -282,8 +282,14 @@ const filteredOrders = computed(() => {
|
||||
return orders.value;
|
||||
});
|
||||
|
||||
const toggleOnlineStatus = () => {
|
||||
const toggleOnlineStatus = async () => {
|
||||
isOnline.value = !isOnline.value;
|
||||
uni.setStorageSync('EXPERT_RECEIVING_STATUS', isOnline.value ? '1' : '0');
|
||||
try {
|
||||
await updateCompanionProfile(expert.value.id || 101, {
|
||||
status: isOnline.value ? '接单中' : '休息中'
|
||||
});
|
||||
} catch (_) {}
|
||||
uni.showToast({
|
||||
title: isOnline.value ? '已开启在线接单状态' : '已设置为打烊休息',
|
||||
icon: isOnline.value ? 'success' : 'none'
|
||||
|
||||
@@ -404,6 +404,8 @@ import {
|
||||
getOrdersPool,
|
||||
getExpertStats,
|
||||
claimOrder,
|
||||
completeOrder as completeOrderApi,
|
||||
updateCompanionProfile,
|
||||
getExpertRevenueTrends,
|
||||
getExpertServices,
|
||||
updateExpertServiceStatus,
|
||||
@@ -583,9 +585,13 @@ const activeOrders = ref([
|
||||
}
|
||||
]);
|
||||
|
||||
const toggleReceivingStatus = () => {
|
||||
const toggleReceivingStatus = async () => {
|
||||
isReceivingOrders.value = !isReceivingOrders.value;
|
||||
const newStatusStr = isReceivingOrders.value ? '接单中' : '休息中';
|
||||
uni.setStorageSync('EXPERT_RECEIVING_STATUS', isReceivingOrders.value ? '1' : '0');
|
||||
try {
|
||||
await updateCompanionProfile(expert.value.id || 101, { status: newStatusStr });
|
||||
} catch (_) {}
|
||||
uni.showToast({
|
||||
title: isReceivingOrders.value ? '已开启在线接单通道!' : '已打烊停止接单',
|
||||
icon: 'none'
|
||||
@@ -792,12 +798,16 @@ const chatWithBuyer = () => {
|
||||
const completeOrder = (id) => {
|
||||
uni.showModal({
|
||||
title: '确认提交服务验收',
|
||||
content: '服务已完成?提交后买家确认无误或 24 小时内未异议将自动解冻订单资金打入钱包。',
|
||||
content: '服务已完成?提交后将完成服务结算并自动解冻订单资金打入您的佣金钱包。',
|
||||
confirmColor: '#10B981',
|
||||
success: (res) => {
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
try {
|
||||
await completeOrderApi(id);
|
||||
} catch (_) {}
|
||||
activeOrders.value = activeOrders.value.filter(o => o.id !== id);
|
||||
uni.showToast({ title: '已申请验收结算!', icon: 'success' });
|
||||
uni.showToast({ title: '已验收结算并入账!', icon: 'success' });
|
||||
loadWorkspaceOrders();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
在新工单中引用
屏蔽一个用户