feat: security hardening, wechat pay v3 platform cert integration, companion certification revocation, and audit closed-loop
这个提交包含在:
@@ -246,6 +246,7 @@ import SkeletonScreen from '@/components/SkeletonScreen.vue';
|
||||
import { getCompanionDetail, getExpertReviews, replyOrderReview, submitReport as submitReportApi, checkFavorite, addFavorite as addFavApi, removeFavorite as removeFavApi } from '@/common/api.js';
|
||||
import { ICONS } from '@/common/icons.js';
|
||||
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
|
||||
import { ensureLoginOrRedirect } from '@/common/role.js';
|
||||
|
||||
const currentThemeKey = ref(getCurrentThemeKey());
|
||||
|
||||
@@ -272,8 +273,27 @@ const stopPropagation = (e) => {
|
||||
|
||||
const isLoading = ref(true);
|
||||
const isFav = ref(false);
|
||||
const buildDefaultServices = (gameTitle = '同城陪伴', basePrice = 68) => [
|
||||
{
|
||||
id: 'srv_1',
|
||||
name: `${gameTitle} · 基础陪伴 (2小时)`,
|
||||
title: `${gameTitle} · 基础陪伴 (2小时)`,
|
||||
price: basePrice,
|
||||
unit: '小时',
|
||||
desc: '正规公开商圈同城陪伴,AA制或协商消费'
|
||||
},
|
||||
{
|
||||
id: 'srv_2',
|
||||
name: `${gameTitle} · 半日畅享 (3小时)`,
|
||||
title: `${gameTitle} · 半日畅享 (3小时)`,
|
||||
price: Math.round(basePrice * 2.8),
|
||||
unit: '次',
|
||||
desc: '深度互动与陪伴交流,赠送专属点歌或语音祝福'
|
||||
}
|
||||
];
|
||||
|
||||
const expert = ref({
|
||||
id: '',
|
||||
id: '101',
|
||||
nickname: '同城陪伴师',
|
||||
avatar: 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=300',
|
||||
gender: 'female',
|
||||
@@ -282,15 +302,19 @@ const expert = ref({
|
||||
rankTag: '专业级',
|
||||
city: '北京市 · 朝阳/海淀',
|
||||
rating: 5.0,
|
||||
orderCount: 0,
|
||||
orderCount: 86,
|
||||
isOnline: true,
|
||||
bio: '专业同城生活陪伴,健康阳光公开。',
|
||||
voiceDuration: 15,
|
||||
price: 68,
|
||||
services: [],
|
||||
photos: [],
|
||||
services: buildDefaultServices('同城陪伴', 68),
|
||||
photos: [
|
||||
'https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=400',
|
||||
'https://images.unsplash.com/photo-1517841905240-472988babdf9?w=400'
|
||||
],
|
||||
reviews: []
|
||||
});
|
||||
const selectedServiceId = ref(null);
|
||||
const selectedServiceId = ref('srv_1');
|
||||
const isPlayingVoice = ref(false);
|
||||
let currentExpertTargetId = null;
|
||||
|
||||
@@ -309,8 +333,11 @@ onShow(() => {
|
||||
});
|
||||
|
||||
const toggleFavorite = async () => {
|
||||
const targetId = Number(expert.value.id || currentExpertTargetId || 101);
|
||||
if (!ensureLoginOrRedirect(`/pages/expert/detail?id=${targetId}`)) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const targetId = Number(expert.value.id || currentExpertTargetId || 101);
|
||||
if (isFav.value) {
|
||||
await removeFavApi(targetId);
|
||||
isFav.value = false;
|
||||
@@ -326,6 +353,10 @@ const toggleFavorite = async () => {
|
||||
};
|
||||
|
||||
const handleReplyReview = (rev) => {
|
||||
const targetId = Number(expert.value.id || currentExpertTargetId || 101);
|
||||
if (!ensureLoginOrRedirect(`/pages/expert/detail?id=${targetId}`)) {
|
||||
return;
|
||||
}
|
||||
const defaultReplies = [
|
||||
'感谢老板的支持与五星好评!开黑配合非常默契,期待下次一起上大分!',
|
||||
'谢谢老板认可!非常准时礼貌的高素质玩家老板,下次继续开黑走起~',
|
||||
@@ -352,15 +383,86 @@ const handleReplyReview = (rev) => {
|
||||
});
|
||||
};
|
||||
|
||||
const safeDecode = (val) => {
|
||||
if (!val) return '';
|
||||
try {
|
||||
return decodeURIComponent(val);
|
||||
} catch (_) {
|
||||
return val;
|
||||
}
|
||||
};
|
||||
|
||||
onLoad(async (query) => {
|
||||
const targetId = (query && query.id) ? query.id : '1';
|
||||
const targetId = (query && query.id) ? safeDecode(query.id) : '1';
|
||||
const queryName = query && query.name ? safeDecode(query.name) : '';
|
||||
const queryAvatar = query && query.avatar ? safeDecode(query.avatar) : '';
|
||||
const queryTag = query && query.tag ? safeDecode(query.tag) : '';
|
||||
const queryCity = query && query.city ? safeDecode(query.city) : '';
|
||||
currentExpertTargetId = targetId;
|
||||
|
||||
const cachedAuthor = uni.getStorageSync('ACTIVE_AUTHOR_PROFILE');
|
||||
const matchedSnapshot = (cachedAuthor && (String(cachedAuthor.id) === String(targetId) || String(cachedAuthor.userId) === String(targetId) || (queryName && cachedAuthor.nickname === queryName)))
|
||||
? cachedAuthor
|
||||
: null;
|
||||
|
||||
if (matchedSnapshot || queryName) {
|
||||
const snapName = queryName || (matchedSnapshot && matchedSnapshot.nickname) || expert.value.nickname;
|
||||
const snapAvatar = queryAvatar || (matchedSnapshot && matchedSnapshot.avatar) || expert.value.avatar;
|
||||
const snapTag = queryTag || (matchedSnapshot && matchedSnapshot.rankTag) || expert.value.rankTag;
|
||||
const snapCity = queryCity || (matchedSnapshot && matchedSnapshot.city) || expert.value.city;
|
||||
const snapGame = (matchedSnapshot && matchedSnapshot.game) || '同城搭子';
|
||||
const snapBio = (matchedSnapshot && matchedSnapshot.bio) || expert.value.bio;
|
||||
const snapPhotos = (matchedSnapshot && Array.isArray(matchedSnapshot.photos) && matchedSnapshot.photos.length > 0)
|
||||
? matchedSnapshot.photos
|
||||
: [snapAvatar];
|
||||
const snapPrice = snapGame === '车队开黑' ? 88 : 128;
|
||||
|
||||
expert.value = {
|
||||
...expert.value,
|
||||
id: String(targetId),
|
||||
nickname: snapName,
|
||||
avatar: snapAvatar,
|
||||
coverImage: snapPhotos[0] || snapAvatar,
|
||||
rankTag: snapTag,
|
||||
levelTag: '实名认证',
|
||||
game: snapGame,
|
||||
city: snapCity,
|
||||
bio: snapBio,
|
||||
price: snapPrice,
|
||||
photos: snapPhotos,
|
||||
services: buildDefaultServices(snapGame, snapPrice)
|
||||
};
|
||||
selectedServiceId.value = expert.value.services[0].id;
|
||||
}
|
||||
|
||||
try {
|
||||
const liveData = await getCompanionDetail(targetId);
|
||||
if (liveData) {
|
||||
expert.value = liveData;
|
||||
if (liveData.services && liveData.services.length > 0) {
|
||||
selectedServiceId.value = liveData.services[0].id;
|
||||
if (queryName || matchedSnapshot) {
|
||||
const finalName = queryName || (matchedSnapshot && matchedSnapshot.nickname) || liveData.nickname;
|
||||
const finalAvatar = queryAvatar || (matchedSnapshot && matchedSnapshot.avatar) || liveData.avatar;
|
||||
const finalTag = queryTag || (matchedSnapshot && matchedSnapshot.rankTag) || liveData.rankTag;
|
||||
const finalCity = queryCity || (matchedSnapshot && matchedSnapshot.city) || liveData.city;
|
||||
const finalBio = (matchedSnapshot && matchedSnapshot.bio) || liveData.bio;
|
||||
const finalPhotos = (matchedSnapshot && Array.isArray(matchedSnapshot.photos) && matchedSnapshot.photos.length > 0)
|
||||
? matchedSnapshot.photos
|
||||
: (liveData.photos || [finalAvatar]);
|
||||
|
||||
expert.value = {
|
||||
...liveData,
|
||||
nickname: finalName,
|
||||
avatar: finalAvatar,
|
||||
coverImage: finalPhotos[0] || finalAvatar,
|
||||
rankTag: finalTag,
|
||||
city: finalCity,
|
||||
bio: finalBio,
|
||||
photos: finalPhotos
|
||||
};
|
||||
} else {
|
||||
expert.value = liveData;
|
||||
}
|
||||
if (expert.value.services && expert.value.services.length > 0) {
|
||||
selectedServiceId.value = expert.value.services[0].id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -444,9 +546,14 @@ const previewImage = (index) => {
|
||||
};
|
||||
|
||||
const goToOrder = () => {
|
||||
const srv = currentSelectedService.value || expert.value.services[0];
|
||||
const srv = currentSelectedService.value || (expert.value.services && expert.value.services[0]);
|
||||
const srvId = srv ? srv.id : 'srv_1';
|
||||
const targetUrl = `/pages/order/create?expertId=${expert.value.id || currentExpertTargetId || 101}&serviceId=${srvId}`;
|
||||
if (!ensureLoginOrRedirect(targetUrl)) {
|
||||
return;
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: `/pages/order/create?expertId=${expert.value.id}&serviceId=${srv.id}`
|
||||
url: targetUrl
|
||||
});
|
||||
};
|
||||
|
||||
@@ -467,6 +574,10 @@ const reportForm = ref({
|
||||
});
|
||||
|
||||
const openReportModal = () => {
|
||||
const targetId = Number(expert.value.id || currentExpertTargetId || 101);
|
||||
if (!ensureLoginOrRedirect(`/pages/expert/detail?id=${targetId}`)) {
|
||||
return;
|
||||
}
|
||||
reportForm.value = {
|
||||
reason: '涉黄低俗言论',
|
||||
description: ''
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
<!-- 顶部接单状态栏与打烊开关 -->
|
||||
<view class="hall-header-card">
|
||||
<view class="expert-info-left">
|
||||
<image class="avatar-img" :src="expert.avatar" mode="aspectFill" />
|
||||
<image class="avatar-img" :src="expert.avatar" mode="aspectFill" @error="onAvatarError" />
|
||||
<view class="text-meta">
|
||||
<view class="name-row">
|
||||
<text class="expert-name">{{ expert.nickname }}</text>
|
||||
<text class="pro-badge">接单中</text>
|
||||
<text class="pro-badge" :class="{ offline: !isOnline }">{{ isOnline ? '接单中' : '已打烊' }}</text>
|
||||
</view>
|
||||
<text class="rating-sub">评分 5.0 · 接单率 99.2%</text>
|
||||
<text class="rating-sub">评分 {{ expert.rating || '5.0' }} · 接单率 {{ expert.orderRate || '99.2%' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -61,7 +61,8 @@
|
||||
<view
|
||||
v-for="order in filteredOrders"
|
||||
:key="order.id"
|
||||
class="dispatch-card"
|
||||
class="dispatch-card card-active"
|
||||
@click="openOrderDetailModal(order)"
|
||||
>
|
||||
<view class="card-top-row">
|
||||
<view class="tag-group">
|
||||
@@ -96,13 +97,124 @@
|
||||
<image class="user-avatar" :src="order.userAvatar" mode="aspectFill" />
|
||||
<text class="user-name">{{ order.userName }}</text>
|
||||
</view>
|
||||
<button class="btn-grab-order btn-active" @click="handleGrabOrder(order)">
|
||||
<button class="btn-grab-order btn-active" @click.stop="handleGrabOrder(order)">
|
||||
立即接单
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 派单需求全貌看板弹窗 (方案1) -->
|
||||
<view class="dispatch-detail-mask" v-if="showDetailModal" @click="closeOrderDetailModal">
|
||||
<view class="dispatch-detail-modal" @click.stop="stopPropagation">
|
||||
<!-- 弹窗顶栏 -->
|
||||
<view class="modal-header">
|
||||
<view class="header-title-box">
|
||||
<text class="modal-title">派单需求详情</text>
|
||||
<text class="order-no-sub" v-if="selectedOrder" @click.stop="copyOrderNo">NO.{{ formatShortOrderNo(selectedOrder.id) }}</text>
|
||||
</view>
|
||||
<view class="btn-close-modal btn-active" @click="closeOrderDetailModal">
|
||||
<image class="close-icon-svg" :src="ICONS.close" mode="aspectFit" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 弹窗滚动主体 -->
|
||||
<scroll-view scroll-y class="modal-body-scroll" v-if="selectedOrder">
|
||||
<!-- 核心酬金与品类看板 -->
|
||||
<view class="detail-reward-card">
|
||||
<view class="reward-left">
|
||||
<view class="detail-tag-row">
|
||||
<text class="category-tag" :class="selectedOrder.typeClass">{{ selectedOrder.category }}</text>
|
||||
<text class="pay-method-tag">{{ selectedOrder.payMethod }}</text>
|
||||
</view>
|
||||
<text class="detail-title">{{ selectedOrder.title }}</text>
|
||||
</view>
|
||||
|
||||
<view class="reward-badge-card">
|
||||
<text class="badge-label">预计到账</text>
|
||||
<view class="amount-row">
|
||||
<text class="curr-mark">¥</text>
|
||||
<text class="reward-num">{{ selectedOrder.reward }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 需求与时段核心参数表 -->
|
||||
<view class="detail-params-card">
|
||||
<view class="param-row">
|
||||
<view class="param-lbl">
|
||||
<image class="param-icon" :src="ICONS.bolt" mode="aspectFit" />
|
||||
<text class="lbl-txt">预约时段</text>
|
||||
</view>
|
||||
<text class="param-val highlight">{{ selectedOrder.timeSlot }}</text>
|
||||
</view>
|
||||
|
||||
<view class="param-row">
|
||||
<view class="param-lbl">
|
||||
<image class="param-icon" :src="ICONS.mapPin" mode="aspectFit" />
|
||||
<text class="lbl-txt">服务地点</text>
|
||||
</view>
|
||||
<view class="param-val-col">
|
||||
<text class="param-val">{{ selectedOrder.location }}</text>
|
||||
<text class="distance-sub">距离您当前约 {{ selectedOrder.distance }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="param-row">
|
||||
<view class="param-lbl">
|
||||
<image class="param-icon" :src="ICONS.clock" mode="aspectFit" />
|
||||
<text class="lbl-txt">服务时长</text>
|
||||
</view>
|
||||
<text class="param-val">{{ selectedOrder.durationHours || 2 }} 小时</text>
|
||||
</view>
|
||||
|
||||
<view class="param-row">
|
||||
<view class="param-lbl">
|
||||
<image class="param-icon" :src="ICONS.wallet" mode="aspectFit" />
|
||||
<text class="lbl-txt">结算方式</text>
|
||||
</view>
|
||||
<text class="param-val">{{ selectedOrder.payMethod }} · 平台资金托管</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 客户详细需求备注 -->
|
||||
<view class="detail-remark-card">
|
||||
<view class="remark-head">
|
||||
<image class="remark-icon" :src="ICONS.messageSquare" mode="aspectFit" />
|
||||
<text class="remark-title">客户需求备注说明</text>
|
||||
</view>
|
||||
<view class="remark-content">
|
||||
<text class="remark-text">{{ selectedOrder.requirement || '按约定准时到场,文明健康社交。' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 发单客户老板信息 -->
|
||||
<view class="detail-client-card">
|
||||
<image class="client-avatar" :src="selectedOrder.userAvatar" mode="aspectFill" />
|
||||
<view class="client-info">
|
||||
<view class="client-name-row">
|
||||
<text class="client-name">{{ selectedOrder.userName }}</text>
|
||||
<text class="client-verified-tag">已实名认证买家</text>
|
||||
</view>
|
||||
<text class="client-trust-sub">信誉积分 100 · 资金全额托管</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 履约保障指引 -->
|
||||
<view class="detail-safe-notice">
|
||||
<image class="safe-icon" :src="ICONS.shield" mode="aspectFit" />
|
||||
<text class="safe-desc">现场碰面后请出示或核验双方 4 位数字核销码进行准时签到。服务全程遵循平台文明社交规范,如遇纠纷平台提供 7x24 小时资金托管与仲裁保障。</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 弹窗底部操作条 -->
|
||||
<view class="modal-footer">
|
||||
<button class="btn-modal-cancel btn-active" @click="closeOrderDetailModal">稍后考虑</button>
|
||||
<button class="btn-modal-grab btn-active" @click="handleGrabOrderFromModal">立即接此单</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部自定义导航栏 (接单人端:接单大厅 / 我要接单[5km雷达] / 个人中心) -->
|
||||
<AppTabBar current="hall" />
|
||||
</view>
|
||||
@@ -115,19 +227,37 @@ 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, updateCompanionProfile } from '@/common/api.js';
|
||||
import { createOrder, getOrdersPool, getExpertStats, claimOrder, updateCompanionProfile, getUserProfile } from '@/common/api.js';
|
||||
import { getNavBarInfo } from '@/common/nav.js';
|
||||
|
||||
const currentThemeKey = ref(getCurrentThemeKey());
|
||||
const expert = ref({
|
||||
id: 101,
|
||||
nickname: '接单大神',
|
||||
avatar: 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=300'
|
||||
});
|
||||
const DEFAULT_EXPERT_AVATAR = 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=300';
|
||||
|
||||
const getInitialExpert = () => {
|
||||
let cached = null;
|
||||
try {
|
||||
cached = uni.getStorageSync('PW_USER_INFO') || uni.getStorageSync('userInfo');
|
||||
} catch (_) {}
|
||||
let uid = (cached && cached.id) || uni.getStorageSync('userId') || 2006;
|
||||
if (uid == 101) uid = 2006;
|
||||
return {
|
||||
id: uid,
|
||||
nickname: (cached && cached.nickname) || '接单大神',
|
||||
avatar: (cached && cached.avatar) || DEFAULT_EXPERT_AVATAR,
|
||||
rating: (cached && cached.rating) || '5.0',
|
||||
orderRate: (cached && cached.orderRate) || '99.2%'
|
||||
};
|
||||
};
|
||||
|
||||
const expert = ref(getInitialExpert());
|
||||
const isOnline = ref(uni.getStorageSync('EXPERT_RECEIVING_STATUS') !== '0');
|
||||
const activeCategory = ref('all');
|
||||
const navInfo = ref(getNavBarInfo());
|
||||
|
||||
const onAvatarError = () => {
|
||||
expert.value.avatar = DEFAULT_EXPERT_AVATAR;
|
||||
};
|
||||
|
||||
const navStyle = computed(() => {
|
||||
return {
|
||||
'--safe-header-gap': `${navInfo.value.safeHeaderGap}px`,
|
||||
@@ -147,30 +277,68 @@ const onThemeChanged = (newTheme) => {
|
||||
applyThemeToNativeUI(newTheme);
|
||||
};
|
||||
|
||||
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;
|
||||
expert.value.id = uid;
|
||||
|
||||
// 1. 同步最新在线接单状态
|
||||
isOnline.value = uni.getStorageSync('EXPERT_RECEIVING_STATUS') !== '0';
|
||||
|
||||
// 2. 并行动态读取最新资料、经营数据与派单池
|
||||
try {
|
||||
const stats = await getExpertStats(101);
|
||||
if (stats) {
|
||||
todayStats.value = stats;
|
||||
}
|
||||
const pool = await getOrdersPool();
|
||||
if (pool && pool.length > 0) {
|
||||
orders.value = pool.map(p => {
|
||||
let typeClass = 'cat-food';
|
||||
if (p.category.includes('喝') || p.category.includes('咖啡')) typeClass = 'cat-drink';
|
||||
if (p.category.includes('唱') || p.category.includes('KTV')) typeClass = 'cat-sing';
|
||||
if (p.category.includes('游戏') || p.category.includes('电竞') || p.category.includes('开黑')) typeClass = 'cat-game';
|
||||
return {
|
||||
...p,
|
||||
typeClass,
|
||||
timeSlot: p.timeSlot || '今日内随时可约',
|
||||
distance: '1.2km内',
|
||||
requirement: p.requirement || '按约定准时到场,文明健康社交。'
|
||||
};
|
||||
});
|
||||
}
|
||||
await Promise.allSettled([
|
||||
getUserProfile(uid).then((profile) => {
|
||||
if (profile) {
|
||||
let safeAvatar = profile.avatar;
|
||||
if (!safeAvatar || safeAvatar.startsWith('http://tmp') || safeAvatar.includes('__tmp__')) {
|
||||
safeAvatar = DEFAULT_EXPERT_AVATAR;
|
||||
}
|
||||
expert.value = {
|
||||
...expert.value,
|
||||
...profile,
|
||||
id: uid,
|
||||
nickname: profile.nickname || expert.value.nickname,
|
||||
avatar: safeAvatar
|
||||
};
|
||||
}
|
||||
}).catch(() => {}),
|
||||
|
||||
getExpertStats(uid).then((stats) => {
|
||||
if (stats) {
|
||||
todayStats.value = {
|
||||
income: stats.income !== undefined ? stats.income : '0.00',
|
||||
orders: stats.orders !== undefined ? stats.orders : 0,
|
||||
waitingVerify: stats.waitingVerify !== undefined ? stats.waitingVerify : 0
|
||||
};
|
||||
}
|
||||
}).catch(() => {}),
|
||||
|
||||
getOrdersPool().then((pool) => {
|
||||
if (pool && pool.length > 0) {
|
||||
orders.value = pool.map(p => {
|
||||
let typeClass = 'cat-food';
|
||||
if (p.category.includes('喝') || p.category.includes('咖啡')) typeClass = 'cat-drink';
|
||||
if (p.category.includes('唱') || p.category.includes('KTV')) typeClass = 'cat-sing';
|
||||
if (p.category.includes('游戏') || p.category.includes('电竞') || p.category.includes('开黑')) typeClass = 'cat-game';
|
||||
return {
|
||||
...p,
|
||||
typeClass,
|
||||
timeSlot: p.timeSlot || '今日内随时可约',
|
||||
distance: '1.2km内',
|
||||
requirement: p.requirement || '按约定准时到场,文明健康社交。'
|
||||
};
|
||||
});
|
||||
}
|
||||
}).catch(() => {})
|
||||
]);
|
||||
} catch (err) {
|
||||
console.warn('[Hall] 加载接单大厅数据异常:', err);
|
||||
} finally {
|
||||
isHallLoading = false;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -286,13 +454,14 @@ const toggleOnlineStatus = async () => {
|
||||
isOnline.value = !isOnline.value;
|
||||
uni.setStorageSync('EXPERT_RECEIVING_STATUS', isOnline.value ? '1' : '0');
|
||||
try {
|
||||
await updateCompanionProfile(expert.value.id || 101, {
|
||||
await updateCompanionProfile(expert.value.id || 2006, {
|
||||
status: isOnline.value ? '接单中' : '休息中'
|
||||
});
|
||||
} catch (_) {}
|
||||
uni.showToast({
|
||||
title: isOnline.value ? '已开启在线接单状态' : '已设置为打烊休息',
|
||||
icon: isOnline.value ? 'success' : 'none'
|
||||
title: isOnline.value ? '已开启在线接单' : '已设置为打烊休息',
|
||||
icon: isOnline.value ? 'success' : 'none',
|
||||
duration: 1500
|
||||
});
|
||||
};
|
||||
|
||||
@@ -302,6 +471,7 @@ const handleGrabOrder = (order) => {
|
||||
content: `【${order.category}】\n酬金:¥${order.reward}\n预约时段:${order.timeSlot}\n\n确认后立即为您保留此单并发送微信履约通知。`,
|
||||
confirmText: '立即接单',
|
||||
confirmColor: '#10B981',
|
||||
cancelText: '取消',
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
uni.showLoading({ title: '正在锁定订单...' });
|
||||
@@ -309,9 +479,9 @@ const handleGrabOrder = (order) => {
|
||||
await createOrder({
|
||||
buyerId: 2001,
|
||||
clientName: order.userName || '客户老板',
|
||||
expertId: 101,
|
||||
companionName: '我 (接单大神)',
|
||||
expertAvatar: order.userAvatar || 'https://images.unsplash.com/photo-1544005313-94ddf0286df2?w=100',
|
||||
expertId: expert.value.id || 2006,
|
||||
companionName: expert.value.nickname || '接单大神',
|
||||
expertAvatar: expert.value.avatar || DEFAULT_EXPERT_AVATAR,
|
||||
track: order.category || '同城生活',
|
||||
serviceTitle: order.title,
|
||||
hourlyRate: order.reward,
|
||||
@@ -336,6 +506,65 @@ const handleGrabOrder = (order) => {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const showDetailModal = ref(false);
|
||||
const selectedOrder = ref(null);
|
||||
|
||||
const stopPropagation = (e) => {
|
||||
if (e && typeof e.stopPropagation === 'function') {
|
||||
e.stopPropagation();
|
||||
}
|
||||
};
|
||||
|
||||
const openOrderDetailModal = (order) => {
|
||||
selectedOrder.value = order;
|
||||
showDetailModal.value = true;
|
||||
};
|
||||
|
||||
const closeOrderDetailModal = () => {
|
||||
showDetailModal.value = false;
|
||||
selectedOrder.value = null;
|
||||
};
|
||||
|
||||
const handleGrabOrderFromModal = () => {
|
||||
if (!selectedOrder.value) return;
|
||||
const orderToGrab = selectedOrder.value;
|
||||
closeOrderDetailModal();
|
||||
handleGrabOrder(orderToGrab);
|
||||
};
|
||||
|
||||
const formatShortOrderNo = (id) => {
|
||||
if (!id && id !== 0) return '';
|
||||
const str = String(id).trim();
|
||||
if (str.includes('_')) {
|
||||
const parts = str.split('_');
|
||||
const mainPart = parts[1] || parts[0];
|
||||
const digits = mainPart.replace(/\D/g, '');
|
||||
if (digits.length >= 6) {
|
||||
return digits.slice(-6);
|
||||
}
|
||||
}
|
||||
const digits = str.replace(/\D/g, '');
|
||||
if (digits.length >= 6) {
|
||||
return digits.slice(-6);
|
||||
}
|
||||
return str;
|
||||
};
|
||||
|
||||
const copyOrderNo = () => {
|
||||
if (!selectedOrder.value || !selectedOrder.value.id) return;
|
||||
uni.setClipboardData({
|
||||
data: String(selectedOrder.value.id),
|
||||
showToast: false,
|
||||
success: () => {
|
||||
uni.showToast({
|
||||
title: '已复制完整单号',
|
||||
icon: 'none',
|
||||
duration: 1500
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@@ -391,6 +620,11 @@ const handleGrabOrder = (order) => {
|
||||
padding: 2rpx 10rpx;
|
||||
border-radius: 8rpx;
|
||||
font-weight: 700;
|
||||
|
||||
&.offline {
|
||||
background: rgba(148, 163, 184, 0.2);
|
||||
color: #94A3B8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -703,6 +937,394 @@ const handleGrabOrder = (order) => {
|
||||
}
|
||||
}
|
||||
|
||||
// 派单需求全貌看板浮层弹窗
|
||||
.dispatch-detail-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 1000;
|
||||
background: rgba(0, 0, 0, 0.72);
|
||||
backdrop-filter: blur(16px);
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: center;
|
||||
|
||||
.dispatch-detail-modal {
|
||||
width: 100%;
|
||||
max-width: 500px;
|
||||
max-height: 85vh;
|
||||
background: #111827;
|
||||
border-top-left-radius: 36rpx;
|
||||
border-top-right-radius: 36rpx;
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
border-bottom: none;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
box-shadow: 0 -16rpx 48rpx rgba(0, 0, 0, 0.5);
|
||||
animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
|
||||
|
||||
.modal-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx 32rpx 20rpx;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
|
||||
|
||||
.header-title-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 14rpx;
|
||||
|
||||
.modal-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 800;
|
||||
color: #F8FAFC;
|
||||
}
|
||||
|
||||
.order-no-sub {
|
||||
font-size: 20rpx;
|
||||
color: #94A3B8;
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
padding: 2rpx 12rpx;
|
||||
border-radius: 8rpx;
|
||||
font-family: -apple-system, BlinkMacSystemFont, monospace;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.5rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-close-modal {
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
border-radius: 50%;
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.close-icon-svg {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.modal-body-scroll {
|
||||
flex: 1;
|
||||
max-height: calc(85vh - 240rpx);
|
||||
padding: 24rpx 32rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
.detail-reward-card {
|
||||
background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
|
||||
border: 1px solid rgba(16, 185, 129, 0.25);
|
||||
border-radius: 20rpx;
|
||||
padding: 24rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.reward-left {
|
||||
flex: 1;
|
||||
margin-right: 20rpx;
|
||||
|
||||
.detail-tag-row {
|
||||
display: flex;
|
||||
gap: 10rpx;
|
||||
margin-bottom: 8rpx;
|
||||
|
||||
.category-tag {
|
||||
font-size: 20rpx;
|
||||
padding: 4rpx 14rpx;
|
||||
border-radius: 8rpx;
|
||||
font-weight: 700;
|
||||
|
||||
&.cat-food { background: rgba(245, 158, 11, 0.15); color: #F59E0B; }
|
||||
&.cat-game { background: rgba(99, 102, 241, 0.15); color: #818CF8; }
|
||||
&.cat-drink { background: rgba(16, 185, 129, 0.15); color: #10B981; }
|
||||
&.cat-sing { background: rgba(236, 72, 153, 0.15); color: #EC4899; }
|
||||
}
|
||||
|
||||
.pay-method-tag {
|
||||
font-size: 20rpx;
|
||||
color: #94A3B8;
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
padding: 4rpx 12rpx;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.detail-title {
|
||||
font-size: 30rpx;
|
||||
font-weight: 700;
|
||||
color: #F8FAFC;
|
||||
line-height: 1.4;
|
||||
}
|
||||
}
|
||||
|
||||
.reward-badge-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-end;
|
||||
justify-content: center;
|
||||
padding: 12rpx 20rpx;
|
||||
background: rgba(16, 185, 129, 0.08);
|
||||
border: 1px solid rgba(16, 185, 129, 0.25);
|
||||
border-radius: 16rpx;
|
||||
flex-shrink: 0;
|
||||
|
||||
.badge-label {
|
||||
font-size: 20rpx;
|
||||
color: #10B981;
|
||||
font-weight: 600;
|
||||
margin-bottom: 6rpx;
|
||||
letter-spacing: 0.5rpx;
|
||||
}
|
||||
|
||||
.amount-row {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 4rpx;
|
||||
|
||||
.curr-mark {
|
||||
font-size: 28rpx;
|
||||
font-weight: 800;
|
||||
color: #10B981;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.reward-num {
|
||||
font-size: 50rpx;
|
||||
font-weight: 900;
|
||||
color: #10B981;
|
||||
line-height: 1;
|
||||
font-family: -apple-system, BlinkMacSystemFont, monospace;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.detail-params-card {
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
border: 1px solid rgba(255, 255, 255, 0.06);
|
||||
border-radius: 20rpx;
|
||||
padding: 16rpx 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.param-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 14rpx 0;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.04);
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.param-lbl {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
|
||||
.param-icon {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
}
|
||||
|
||||
.lbl-txt {
|
||||
font-size: 24rpx;
|
||||
color: #94A3B8;
|
||||
}
|
||||
}
|
||||
|
||||
.param-val {
|
||||
font-size: 24rpx;
|
||||
color: #F8FAFC;
|
||||
font-weight: 600;
|
||||
|
||||
&.highlight {
|
||||
color: #818CF8;
|
||||
}
|
||||
}
|
||||
|
||||
.param-val-col {
|
||||
text-align: right;
|
||||
|
||||
.param-val {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.distance-sub {
|
||||
font-size: 20rpx;
|
||||
color: #64748B;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.detail-remark-card {
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
border: 1px solid rgba(255, 255, 255, 0.06);
|
||||
border-radius: 20rpx;
|
||||
padding: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.remark-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10rpx;
|
||||
margin-bottom: 12rpx;
|
||||
|
||||
.remark-icon {
|
||||
width: 26rpx;
|
||||
height: 26rpx;
|
||||
}
|
||||
|
||||
.remark-title {
|
||||
font-size: 24rpx;
|
||||
font-weight: 700;
|
||||
color: #94A3B8;
|
||||
}
|
||||
}
|
||||
|
||||
.remark-content {
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
padding: 14rpx 16rpx;
|
||||
border-radius: 12rpx;
|
||||
|
||||
.remark-text {
|
||||
font-size: 24rpx;
|
||||
color: #CBD5E1;
|
||||
line-height: 1.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.detail-client-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
border: 1px solid rgba(255, 255, 255, 0.06);
|
||||
border-radius: 20rpx;
|
||||
padding: 18rpx 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.client-avatar {
|
||||
width: 76rpx;
|
||||
height: 76rpx;
|
||||
border-radius: 50%;
|
||||
margin-right: 16rpx;
|
||||
border: 2rpx solid rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.client-info {
|
||||
flex: 1;
|
||||
|
||||
.client-name-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
margin-bottom: 4rpx;
|
||||
|
||||
.client-name {
|
||||
font-size: 26rpx;
|
||||
font-weight: 700;
|
||||
color: #F8FAFC;
|
||||
}
|
||||
|
||||
.client-verified-tag {
|
||||
font-size: 18rpx;
|
||||
color: #10B981;
|
||||
background: rgba(16, 185, 129, 0.12);
|
||||
padding: 2rpx 8rpx;
|
||||
border-radius: 6rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
.client-trust-sub {
|
||||
font-size: 20rpx;
|
||||
color: #64748B;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.detail-safe-notice {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 10rpx;
|
||||
background: rgba(16, 185, 129, 0.06);
|
||||
border: 1px solid rgba(16, 185, 129, 0.15);
|
||||
border-radius: 16rpx;
|
||||
padding: 16rpx 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.safe-icon {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
margin-top: 2rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.safe-desc {
|
||||
font-size: 20rpx;
|
||||
color: #94A3B8;
|
||||
line-height: 1.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.modal-footer {
|
||||
padding: 20rpx 32rpx;
|
||||
padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.08);
|
||||
display: flex;
|
||||
gap: 20rpx;
|
||||
|
||||
.btn-modal-cancel {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: 600;
|
||||
color: #94A3B8;
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
border-radius: 40rpx;
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.btn-modal-grab {
|
||||
flex: 2;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 700;
|
||||
color: #FFFFFF;
|
||||
background: linear-gradient(135deg, #10B981 0%, #059669 100%);
|
||||
border-radius: 40rpx;
|
||||
border: none;
|
||||
box-shadow: 0 8rpx 24rpx rgba(16, 185, 129, 0.35);
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes modalSlideUp {
|
||||
from {
|
||||
transform: translateY(100%);
|
||||
}
|
||||
to {
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
/* 浅色暖阳 (Warm Theme) 适配 */
|
||||
&.theme-warm {
|
||||
background-color: #FAF7F2;
|
||||
@@ -781,6 +1403,99 @@ const handleGrabOrder = (order) => {
|
||||
border-top-color: #F5F5F4;
|
||||
}
|
||||
}
|
||||
|
||||
.dispatch-detail-mask {
|
||||
background: rgba(0, 0, 0, 0.45);
|
||||
|
||||
.dispatch-detail-modal {
|
||||
background: #FFFFFF;
|
||||
border-color: #E7E5E4;
|
||||
box-shadow: 0 -16rpx 48rpx rgba(28, 25, 23, 0.12);
|
||||
|
||||
.modal-header {
|
||||
border-bottom-color: #F5F5F4;
|
||||
.header-title-box .modal-title { color: #1C1917; }
|
||||
.header-title-box .order-no-sub {
|
||||
color: #78716C;
|
||||
background: #F5F5F4;
|
||||
border-color: #E7E5E4;
|
||||
}
|
||||
.btn-close-modal { background: #F5F5F4; }
|
||||
}
|
||||
|
||||
.modal-body-scroll {
|
||||
.detail-reward-card {
|
||||
background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 100%);
|
||||
border-color: #FED7AA;
|
||||
.reward-left .detail-title { color: #1C1917; }
|
||||
.reward-left .detail-tag-row .pay-method-tag { background: #FFFFFF; color: #78716C; }
|
||||
.reward-badge-card {
|
||||
background: #FFFFFF;
|
||||
border-color: rgba(234, 88, 12, 0.25);
|
||||
box-shadow: 0 4rpx 14rpx rgba(234, 88, 12, 0.1);
|
||||
|
||||
.badge-label {
|
||||
color: #EA580C;
|
||||
}
|
||||
|
||||
.amount-row {
|
||||
.curr-mark,
|
||||
.reward-num {
|
||||
color: #EA580C;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.detail-params-card {
|
||||
background: #FAFAF9;
|
||||
border-color: #E7E5E4;
|
||||
.param-row {
|
||||
border-bottom-color: #F5F5F4;
|
||||
.param-lbl .lbl-txt { color: #78716C; }
|
||||
.param-val { color: #1C1917; }
|
||||
.param-val.highlight { color: #EA580C; }
|
||||
}
|
||||
}
|
||||
|
||||
.detail-remark-card {
|
||||
background: #FAFAF9;
|
||||
border-color: #E7E5E4;
|
||||
.remark-head .remark-title { color: #78716C; }
|
||||
.remark-content {
|
||||
background: #F5F5F4;
|
||||
.remark-text { color: #44403C; }
|
||||
}
|
||||
}
|
||||
|
||||
.detail-client-card {
|
||||
background: #FAFAF9;
|
||||
border-color: #E7E5E4;
|
||||
.client-info .client-name-row .client-name { color: #1C1917; }
|
||||
.client-info .client-trust-sub { color: #78716C; }
|
||||
}
|
||||
|
||||
.detail-safe-notice {
|
||||
background: #FFF7ED;
|
||||
border-color: #FED7AA;
|
||||
.safe-desc { color: #78716C; }
|
||||
}
|
||||
}
|
||||
|
||||
.modal-footer {
|
||||
border-top-color: #E7E5E4;
|
||||
.btn-modal-cancel {
|
||||
background: #F5F5F4;
|
||||
border-color: #E7E5E4;
|
||||
color: #78716C;
|
||||
}
|
||||
.btn-modal-grab {
|
||||
background: linear-gradient(135deg, #EA580C 0%, #C2410C 100%);
|
||||
box-shadow: 0 8rpx 24rpx rgba(234, 88, 12, 0.3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
在新工单中引用
屏蔽一个用户