feat(closed-loop): complete end-to-end closed loops across miniapp, backend, and admin
这个提交包含在:
@@ -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'
|
||||
|
||||
在新工单中引用
屏蔽一个用户