fix(miniapp): 清理剩余身份兜底并修正待接单状态/客服入口
- 修复 user/index 使用 normalizeUserId 未导入(分享按钮会报错) - 待接单独立为 PENDING_ACCEPT:新增待接单 tab/状态色/取消订单与联系客服操作,不再显示为进行中 - 移除 hall/bill-records/reports/settings/favorites/order-create/activity-create/activity-detail/apply 的 1001/2006 身份兜底 - 线下订单(含指定大神)必须填写碰面地点;再次预约不再兜底到 101 号大神;评价不预选标签 - 接单大厅去掉「已实名认证/信誉积分100」等伪造信任文案;客服按钮统一为「联系客服」 - 114 套件/745 用例全绿
这个提交包含在:
@@ -454,7 +454,7 @@ const submitApply = async () => {
|
||||
uni.showLoading({ title: '正在提交入驻材料...' });
|
||||
// 身份与登录态保持一致:有 token 时由服务端按 token 识别(缺失 userId 传 0)
|
||||
const uid = normalizeUserId();
|
||||
const profileUid = uid || 1001;
|
||||
const profileUid = uid;
|
||||
|
||||
try {
|
||||
let avatarUrl = '';
|
||||
@@ -555,7 +555,8 @@ const rejectReason = ref('');
|
||||
const syncRemoteCertStatus = async () => {
|
||||
try {
|
||||
const cachedUser = uni.getStorageSync('PW_USER_INFO') || {};
|
||||
const uid = Number(cachedUser.id) || 1001;
|
||||
const uid = normalizeUserId();
|
||||
if (!uid) return;
|
||||
const profile = await getUserProfile(uid);
|
||||
if (profile && profile.certStatus !== undefined) {
|
||||
const remoteCert = Number(profile.certStatus);
|
||||
|
||||
@@ -218,9 +218,9 @@
|
||||
<view class="client-info">
|
||||
<view class="client-name-row">
|
||||
<text class="client-name">{{ selectedOrder.userName }}</text>
|
||||
<text class="client-verified-tag">已实名认证买家</text>
|
||||
<text class="client-verified-tag">平台注册买家</text>
|
||||
</view>
|
||||
<text class="client-trust-sub">信誉积分 100 · 资金全额托管</text>
|
||||
<text class="client-trust-sub">资金由平台担保托管</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -251,7 +251,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 { claimOrder, getOrdersPool, getExpertStats, updateCompanionProfile, getUserProfile, getActivities } from '@/common/api.js';
|
||||
import { claimOrder, getOrdersPool, getExpertStats, updateCompanionProfile, getUserProfile, getActivities, normalizeUserId } from '@/common/api.js';
|
||||
import { getUserLocation } from '@/common/location.js';
|
||||
import { getNavBarInfo } from '@/common/nav.js';
|
||||
|
||||
@@ -316,8 +316,11 @@ let isHallLoading = false;
|
||||
const loadHallData = async () => {
|
||||
if (isHallLoading) return;
|
||||
isHallLoading = true;
|
||||
let uid = uni.getStorageSync('userId') || expert.value.id || 2006;
|
||||
if (uid == 101) uid = 2006;
|
||||
let uid = normalizeUserId();
|
||||
if (!uid) {
|
||||
isHallLoading = false;
|
||||
return;
|
||||
}
|
||||
expert.value.id = uid;
|
||||
|
||||
// 1. 同步最新在线接单状态
|
||||
@@ -469,8 +472,13 @@ const filteredOrders = computed(() => {
|
||||
const toggleOnlineStatus = async () => {
|
||||
isOnline.value = !isOnline.value;
|
||||
uni.setStorageSync('EXPERT_RECEIVING_STATUS', isOnline.value ? '1' : '0');
|
||||
const eid = Number(expert.value.id) || normalizeUserId();
|
||||
if (!eid) {
|
||||
uni.showToast({ title: '请先登录后再操作', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await updateCompanionProfile(expert.value.id || 2006, {
|
||||
await updateCompanionProfile(eid, {
|
||||
status: isOnline.value ? '接单中' : '休息中'
|
||||
});
|
||||
} catch (_) {}
|
||||
@@ -493,7 +501,7 @@ const handleGrabOrder = (order) => {
|
||||
uni.showLoading({ title: '正在锁定订单...' });
|
||||
try {
|
||||
await claimOrder(order.id, {
|
||||
expertId: expert.value.id || 2006,
|
||||
expertId: expert.value.id || 0,
|
||||
companionName: expert.value.nickname || '接单大神',
|
||||
expertAvatar: expert.value.avatar || DEFAULT_EXPERT_AVATAR
|
||||
});
|
||||
|
||||
@@ -360,7 +360,7 @@
|
||||
<view class="order-progress-row">
|
||||
<text class="prog-text">状态:{{ order.statusText }}</text>
|
||||
<view class="order-btns">
|
||||
<button class="btn-chat btn-active" @click="chatWithBuyer(order)">联系老板</button>
|
||||
<button class="btn-chat btn-active" @click="chatWithBuyer(order)">联系客服</button>
|
||||
<button class="btn-complete btn-active" @click="completeOrder(order.id)">
|
||||
申请验收结算
|
||||
</button>
|
||||
|
||||
在新工单中引用
屏蔽一个用户