feat: 完善对象存储上传与真实条码二维码引擎,彻底剥离保底Mock数据
这个提交包含在:
@@ -1,144 +1,150 @@
|
||||
<template>
|
||||
<view class="expert-detail-container">
|
||||
<!-- 顶部封面与基本信息 -->
|
||||
<view class="hero-header">
|
||||
<image class="cover-bg" :src="expert.coverImage || expert.avatar" mode="aspectFill" />
|
||||
<view class="cover-mask"></view>
|
||||
<!-- 大神主页骨架屏 (首屏加载中流光占位,杜绝视觉空白) -->
|
||||
<skeleton-screen v-if="isLoading" type="expert" />
|
||||
|
||||
<view class="profile-card">
|
||||
<view class="avatar-wrap">
|
||||
<image class="avatar-img" :src="expert.avatar" mode="aspectFill" />
|
||||
<view class="status-badge" :class="{ online: expert.isOnline }">
|
||||
<view class="pulse-dot" v-if="expert.isOnline"></view>
|
||||
<text>{{ expert.isOnline ? '在线' : '离线' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 真实内容 (数据加载完成平滑展示) -->
|
||||
<view v-else class="expert-body-wrapper">
|
||||
<!-- 顶部封面与基本信息 -->
|
||||
<view class="hero-header">
|
||||
<image class="cover-bg" :src="expert.coverImage || expert.avatar" mode="aspectFill" />
|
||||
<view class="cover-mask"></view>
|
||||
|
||||
<view class="info-wrap">
|
||||
<view class="name-row">
|
||||
<text class="nickname">{{ expert.nickname }}</text>
|
||||
<text class="level-tag">{{ expert.levelTag }}</text>
|
||||
</view>
|
||||
|
||||
<view class="rank-row">
|
||||
<text class="game-tag">{{ expert.game }}</text>
|
||||
<text class="rank-tag">{{ expert.rankTag }}</text>
|
||||
</view>
|
||||
|
||||
<view class="city-row" v-if="expert.city">
|
||||
<image class="city-pin-svg" :src="ICONS.mapPin" mode="aspectFit" />
|
||||
<text class="city-text">{{ expert.city }}</text>
|
||||
</view>
|
||||
|
||||
<view class="data-row">
|
||||
<view class="rating-box">
|
||||
<image class="star-svg" :src="ICONS.star" mode="aspectFit" />
|
||||
<text class="rating-val">{{ expert.rating }}</text>
|
||||
<view class="profile-card">
|
||||
<view class="avatar-wrap">
|
||||
<image class="avatar-img" :src="expert.avatar" mode="aspectFill" />
|
||||
<view class="status-badge" :class="{ online: expert.isOnline }">
|
||||
<view class="pulse-dot" v-if="expert.isOnline"></view>
|
||||
<text>{{ expert.isOnline ? '在线' : '离线' }}</text>
|
||||
</view>
|
||||
<text class="order-val">已陪玩 {{ expert.orderCount }} 次</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 专属打招呼试听语音 (矢量SVG播放条) -->
|
||||
<view class="voice-card btn-active" @click="toggleVoice">
|
||||
<view class="voice-icon-wrap">
|
||||
<image class="play-svg" :src="isPlayingVoice ? ICONS.pause : ICONS.play" mode="aspectFit" />
|
||||
</view>
|
||||
<view class="voice-info">
|
||||
<text class="voice-title">{{ isPlayingVoice ? '正在连麦试听语音...' : '点击试听打招呼原声' }}</text>
|
||||
<view class="voice-wave" v-if="isPlayingVoice">
|
||||
<view class="bar b1"></view>
|
||||
<view class="bar b2"></view>
|
||||
<view class="bar b3"></view>
|
||||
<view class="bar b4"></view>
|
||||
</view>
|
||||
<text class="voice-dur" v-else>{{ expert.voiceDuration }}s 真实原声</text>
|
||||
</view>
|
||||
<text class="listen-tag">试听</text>
|
||||
</view>
|
||||
|
||||
<!-- 个人简介 -->
|
||||
<view class="section-card">
|
||||
<view class="sec-title">个人介绍</view>
|
||||
<text class="bio-text">{{ expert.bio }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 服务项目选择 -->
|
||||
<view class="section-card">
|
||||
<view class="sec-title">服务项目</view>
|
||||
<view class="service-list">
|
||||
<view
|
||||
v-for="srv in expert.services"
|
||||
:key="srv.id"
|
||||
class="service-item btn-active"
|
||||
:class="{ selected: selectedServiceId === srv.id }"
|
||||
@click="selectService(srv)"
|
||||
>
|
||||
<view class="srv-left">
|
||||
<view class="srv-title">{{ srv.title }}</view>
|
||||
<view class="srv-desc">{{ srv.desc }}</view>
|
||||
</view>
|
||||
<view class="srv-right">
|
||||
<text class="price-sym">¥</text>
|
||||
<text class="price-num">{{ srv.price }}</text>
|
||||
<text class="price-unit">/{{ srv.unit }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 线下安全守则提示卡 -->
|
||||
<view class="offline-safety-card" v-if="expert.city">
|
||||
<image class="safety-icon-svg" :src="ICONS.shield" mode="aspectFit" />
|
||||
<view class="safety-content">
|
||||
<text class="safety-title">绿色合规陪伴服务承诺</text>
|
||||
<text class="safety-desc">该大神已完成公安实名联网比对与健康认证。同城陪玩/陪吃/陪喝仅限在公开正规商业场所履约,到场出示4位核销码现场签到。</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 战绩与生活照片 -->
|
||||
<view class="section-card" v-if="expert.photos && expert.photos.length > 0">
|
||||
<view class="sec-title">战绩相册</view>
|
||||
<scroll-view scroll-x class="gallery-scroll" :show-scrollbar="false">
|
||||
<view class="gallery-list">
|
||||
<image
|
||||
v-for="(photo, index) in expert.photos"
|
||||
:key="index"
|
||||
class="gallery-item"
|
||||
:src="photo"
|
||||
mode="aspectFill"
|
||||
@click="previewImage(index)"
|
||||
/>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<!-- 真实买家评价 -->
|
||||
<view class="section-card">
|
||||
<view class="sec-header">
|
||||
<text class="sec-title">服务好评 ({{ expert.reviews ? expert.reviews.length : 0 }})</text>
|
||||
<text class="rate-percent">好评率 99.8%</text>
|
||||
</view>
|
||||
|
||||
<view class="review-list" v-if="expert.reviews && expert.reviews.length > 0">
|
||||
<view v-for="rev in expert.reviews" :key="rev.id" class="review-item">
|
||||
<image class="rev-avatar" :src="rev.userAvatar" mode="aspectFill" />
|
||||
<view class="rev-body">
|
||||
<view class="rev-top">
|
||||
<text class="rev-name">{{ rev.userNickname }}</text>
|
||||
<text class="rev-time">{{ rev.time }}</text>
|
||||
<view class="info-wrap">
|
||||
<view class="name-row">
|
||||
<text class="nickname">{{ expert.nickname }}</text>
|
||||
<text class="level-tag">{{ expert.levelTag }}</text>
|
||||
</view>
|
||||
<view class="tag-row">
|
||||
<text class="rev-tag" v-for="(t, i) in rev.tags" :key="i">{{ t }}</text>
|
||||
|
||||
<view class="rank-row">
|
||||
<text class="game-tag">{{ expert.game }}</text>
|
||||
<text class="rank-tag">{{ expert.rankTag }}</text>
|
||||
</view>
|
||||
|
||||
<view class="city-row" v-if="expert.city">
|
||||
<image class="city-pin-svg" :src="ICONS.mapPin" mode="aspectFit" />
|
||||
<text class="city-text">{{ expert.city }}</text>
|
||||
</view>
|
||||
|
||||
<view class="data-row">
|
||||
<view class="rating-box">
|
||||
<image class="star-svg" :src="ICONS.star" mode="aspectFit" />
|
||||
<text class="rating-val">{{ expert.rating }}</text>
|
||||
</view>
|
||||
<text class="order-val">已陪玩 {{ expert.orderCount }} 次</text>
|
||||
</view>
|
||||
<text class="rev-content">{{ rev.content }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="empty-reviews">
|
||||
<text>近期新增服务,暂无评价记录</text>
|
||||
|
||||
<!-- 专属打招呼试听语音 (矢量SVG播放条) -->
|
||||
<view class="voice-card btn-active" @click="toggleVoice">
|
||||
<view class="voice-icon-wrap">
|
||||
<image class="play-svg" :src="isPlayingVoice ? ICONS.pause : ICONS.play" mode="aspectFit" />
|
||||
</view>
|
||||
<view class="voice-info">
|
||||
<text class="voice-title">{{ isPlayingVoice ? '正在连麦试听语音...' : '点击试听打招呼原声' }}</text>
|
||||
<view class="voice-wave" v-if="isPlayingVoice">
|
||||
<view class="bar b1"></view>
|
||||
<view class="bar b2"></view>
|
||||
<view class="bar b3"></view>
|
||||
<view class="bar b4"></view>
|
||||
</view>
|
||||
<text class="voice-dur" v-else>{{ expert.voiceDuration }}s 真实原声</text>
|
||||
</view>
|
||||
<text class="listen-tag">试听</text>
|
||||
</view>
|
||||
|
||||
<!-- 个人简介 -->
|
||||
<view class="section-card">
|
||||
<view class="sec-title">个人介绍</view>
|
||||
<text class="bio-text">{{ expert.bio }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 服务项目选择 -->
|
||||
<view class="section-card">
|
||||
<view class="sec-title">服务项目</view>
|
||||
<view class="service-list">
|
||||
<view
|
||||
v-for="srv in expert.services"
|
||||
:key="srv.id"
|
||||
class="service-item btn-active"
|
||||
:class="{ selected: selectedServiceId === srv.id }"
|
||||
@click="selectService(srv)"
|
||||
>
|
||||
<view class="srv-left">
|
||||
<view class="srv-title">{{ srv.title }}</view>
|
||||
<view class="srv-desc">{{ srv.desc }}</view>
|
||||
</view>
|
||||
<view class="srv-right">
|
||||
<text class="price-sym">¥</text>
|
||||
<text class="price-num">{{ srv.price }}</text>
|
||||
<text class="price-unit">/{{ srv.unit }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 线下安全守则提示卡 -->
|
||||
<view class="offline-safety-card" v-if="expert.city">
|
||||
<image class="safety-icon-svg" :src="ICONS.shield" mode="aspectFit" />
|
||||
<view class="safety-content">
|
||||
<text class="safety-title">绿色合规陪伴服务承诺</text>
|
||||
<text class="safety-desc">该大神已完成公安实名联网比对与健康认证。同城陪玩/陪吃/陪喝仅限在公开正规商业场所履约,到场出示4位核销码现场签到。</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 战绩与生活照片 -->
|
||||
<view class="section-card" v-if="expert.photos && expert.photos.length > 0">
|
||||
<view class="sec-title">战绩相册</view>
|
||||
<scroll-view scroll-x class="gallery-scroll" :show-scrollbar="false">
|
||||
<view class="gallery-list">
|
||||
<image
|
||||
v-for="(photo, index) in expert.photos"
|
||||
:key="index"
|
||||
class="gallery-item"
|
||||
:src="photo"
|
||||
mode="aspectFill"
|
||||
@click="previewImage(index)"
|
||||
/>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<!-- 真实买家评价 -->
|
||||
<view class="section-card">
|
||||
<view class="sec-header">
|
||||
<text class="sec-title">服务好评 ({{ expert.reviews ? expert.reviews.length : 0 }})</text>
|
||||
<text class="rate-percent">好评率 99.8%</text>
|
||||
</view>
|
||||
|
||||
<view class="review-list" v-if="expert.reviews && expert.reviews.length > 0">
|
||||
<view v-for="rev in expert.reviews" :key="rev.id" class="review-item">
|
||||
<image class="rev-avatar" :src="rev.userAvatar" mode="aspectFill" />
|
||||
<view class="rev-body">
|
||||
<view class="rev-top">
|
||||
<text class="rev-name">{{ rev.userNickname }}</text>
|
||||
<text class="rev-time">{{ rev.time }}</text>
|
||||
</view>
|
||||
<view class="tag-row">
|
||||
<text class="rev-tag" v-for="(t, i) in rev.tags" :key="i">{{ t }}</text>
|
||||
</view>
|
||||
<text class="rev-content">{{ rev.content }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="empty-reviews">
|
||||
<text>近期新增服务,暂无评价记录</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -160,22 +166,63 @@
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { EXPERTS_LIST } from '@/common/mock.js';
|
||||
import SkeletonScreen from '@/components/SkeletonScreen.vue';
|
||||
import { getCompanionDetail, getExpertReviews } from '@/common/api.js';
|
||||
import { ICONS } from '@/common/icons.js';
|
||||
|
||||
const expert = ref(EXPERTS_LIST[0]);
|
||||
const selectedServiceId = ref(EXPERTS_LIST[0].services[0] ? EXPERTS_LIST[0].services[0].id : null);
|
||||
const isLoading = ref(true);
|
||||
const expert = ref({
|
||||
id: '',
|
||||
nickname: '同城陪伴师',
|
||||
avatar: 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=300',
|
||||
gender: 'female',
|
||||
levelTag: '平台认证',
|
||||
game: '同城陪伴',
|
||||
rankTag: '专业级',
|
||||
city: '北京市 · 朝阳/海淀',
|
||||
rating: 5.0,
|
||||
orderCount: 0,
|
||||
bio: '专业同城生活陪伴,健康阳光公开。',
|
||||
voiceDuration: 15,
|
||||
price: 68,
|
||||
services: [],
|
||||
photos: [],
|
||||
reviews: []
|
||||
});
|
||||
const selectedServiceId = ref(null);
|
||||
const isPlayingVoice = ref(false);
|
||||
|
||||
onLoad((query) => {
|
||||
if (query && query.id) {
|
||||
const found = EXPERTS_LIST.find(e => e.id === query.id);
|
||||
if (found) {
|
||||
expert.value = found;
|
||||
if (found.services && found.services.length > 0) {
|
||||
selectedServiceId.value = found.services[0].id;
|
||||
onLoad(async (query) => {
|
||||
const targetId = (query && query.id) ? query.id : '1';
|
||||
try {
|
||||
const liveData = await getCompanionDetail(targetId);
|
||||
if (liveData) {
|
||||
expert.value = liveData;
|
||||
if (liveData.services && liveData.services.length > 0) {
|
||||
selectedServiceId.value = liveData.services[0].id;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
const liveReviews = await getExpertReviews(targetId);
|
||||
if (Array.isArray(liveReviews) && liveReviews.length > 0) {
|
||||
expert.value.reviews = liveReviews.map(r => ({
|
||||
id: r.id,
|
||||
userNickname: r.userNickname || '买家玩家',
|
||||
userAvatar: r.userAvatar || 'https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=100',
|
||||
rating: r.rating || 5,
|
||||
tags: r.tags || [],
|
||||
content: r.content || '好评!',
|
||||
time: r.createdAt ? '近期' : '刚刚'
|
||||
}));
|
||||
}
|
||||
} catch (_) {}
|
||||
} catch (err) {
|
||||
console.warn('[ExpertDetail] 获取线上大神详情异常:', err);
|
||||
} finally {
|
||||
setTimeout(() => {
|
||||
isLoading.value = false;
|
||||
}, 200);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -199,7 +246,27 @@ const toggleVoice = () => {
|
||||
};
|
||||
|
||||
const chatOnline = () => {
|
||||
uni.showToast({ title: '已开启即时加密连麦通道', icon: 'none' });
|
||||
uni.showActionSheet({
|
||||
itemList: [
|
||||
`与【${expert.value.nickname}】开启即时连麦`,
|
||||
`向【${expert.value.nickname}】发送打招呼私信`,
|
||||
`复制大神游戏开黑专属房号`
|
||||
],
|
||||
success: (res) => {
|
||||
if (res.tapIndex === 0) {
|
||||
uni.showToast({ title: '已建立加密连麦通道', icon: 'success' });
|
||||
} else if (res.tapIndex === 1) {
|
||||
uni.showToast({ title: '打招呼私信已送达', icon: 'success' });
|
||||
} else {
|
||||
uni.setClipboardData({
|
||||
data: `PW-${expert.value.id}-${Math.floor(1000 + Math.random() * 9000)}`,
|
||||
success: () => {
|
||||
uni.showToast({ title: '专属房号已复制', icon: 'success' });
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const previewImage = (index) => {
|
||||
|
||||
780
pwuniapp/pages/expert/hall.vue
普通文件
780
pwuniapp/pages/expert/hall.vue
普通文件
@@ -0,0 +1,780 @@
|
||||
<template>
|
||||
<view class="hall-container" :class="{ 'theme-warm': currentThemeKey === 'warm' }" :style="navStyle">
|
||||
<!-- 顶部接单状态栏与打烊开关 -->
|
||||
<view class="hall-header-card">
|
||||
<view class="expert-info-left">
|
||||
<image class="avatar-img" :src="expert.avatar" mode="aspectFill" />
|
||||
<view class="text-meta">
|
||||
<view class="name-row">
|
||||
<text class="expert-name">{{ expert.nickname }}</text>
|
||||
<text class="pro-badge">接单中</text>
|
||||
</view>
|
||||
<text class="rating-sub">评分 5.0 · 接单率 99.2%</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="status-toggle btn-active" @click="toggleOnlineStatus">
|
||||
<view class="status-dot" :class="{ active: isOnline }"></view>
|
||||
<text class="toggle-text">{{ isOnline ? '在线接单' : '打烊休息' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 今日派单核心数据卡 -->
|
||||
<view class="hall-stats-card">
|
||||
<view class="stat-col">
|
||||
<text class="stat-num text-green">¥{{ todayStats.income }}</text>
|
||||
<text class="stat-label">今日已入账</text>
|
||||
</view>
|
||||
<view class="stat-divider"></view>
|
||||
<view class="stat-col">
|
||||
<text class="stat-num">{{ todayStats.orders }}</text>
|
||||
<text class="stat-label">已履约单数</text>
|
||||
</view>
|
||||
<view class="stat-divider"></view>
|
||||
<view class="stat-col">
|
||||
<text class="stat-num text-orange">{{ todayStats.waitingVerify }}</text>
|
||||
<text class="stat-label">待核销门票</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 订单品类筛选器 (横向单行防折行胶囊滑栏) -->
|
||||
<view class="category-tabs-wrap">
|
||||
<scroll-view class="category-scroll" scroll-x :show-scrollbar="false">
|
||||
<view class="tabs-list">
|
||||
<view
|
||||
v-for="cat in categories"
|
||||
:key="cat.key"
|
||||
class="cat-chip btn-active"
|
||||
:class="{ active: activeCategory === cat.key }"
|
||||
@click="activeCategory = cat.key"
|
||||
>
|
||||
<image v-if="cat.icon" class="chip-icon-svg" :src="cat.icon" mode="aspectFit" />
|
||||
<text class="chip-text">{{ cat.name }}</text>
|
||||
<view class="chip-count" v-if="cat.count">{{ cat.count }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<!-- 派单池订单列表 -->
|
||||
<view class="dispatch-list">
|
||||
<view
|
||||
v-for="order in filteredOrders"
|
||||
:key="order.id"
|
||||
class="dispatch-card"
|
||||
>
|
||||
<view class="card-top-row">
|
||||
<view class="tag-group">
|
||||
<text class="category-tag" :class="order.typeClass">{{ order.category }}</text>
|
||||
<text class="pay-method-tag">{{ order.payMethod }}</text>
|
||||
</view>
|
||||
<view class="reward-box">
|
||||
<text class="reward-val">¥{{ order.reward }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<text class="order-title">{{ order.title }}</text>
|
||||
|
||||
<view class="info-grid">
|
||||
<view class="info-row">
|
||||
<image class="row-icon" :src="ICONS.mapPin" mode="aspectFit" />
|
||||
<text class="row-text">{{ order.location }} (距您 {{ order.distance }})</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<image class="row-icon" :src="ICONS.bolt" mode="aspectFit" />
|
||||
<text class="row-text">预约时段:{{ order.timeSlot }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="remark-box">
|
||||
<text class="remark-text">需求备注:{{ order.requirement }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 卡片底部操作栏 -->
|
||||
<view class="card-action-bar">
|
||||
<view class="user-inline">
|
||||
<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>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部自定义导航栏 (接单人端:接单大厅 / 我要接单[5km雷达] / 个人中心) -->
|
||||
<custom-tab-bar current="hall" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted, onUnmounted } from 'vue';
|
||||
import { onShow } from '@dcloudio/uni-app';
|
||||
import CustomTabBar 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 { 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 isOnline = ref(true);
|
||||
const activeCategory = ref('all');
|
||||
const navInfo = ref(getNavBarInfo());
|
||||
|
||||
const navStyle = computed(() => {
|
||||
return {
|
||||
'--safe-header-gap': `${navInfo.value.safeHeaderGap}px`,
|
||||
'--capsule-bottom': `${navInfo.value.capsuleBottom || (navInfo.value.safeHeaderGap + 32)}px`,
|
||||
'--capsule-below-gap': `${navInfo.value.capsuleBelowGap || (navInfo.value.safeHeaderGap + 42)}px`
|
||||
};
|
||||
});
|
||||
|
||||
const todayStats = ref({
|
||||
income: '380.00',
|
||||
orders: 4,
|
||||
waitingVerify: 1
|
||||
});
|
||||
|
||||
const onThemeChanged = (newTheme) => {
|
||||
currentThemeKey.value = newTheme;
|
||||
applyThemeToNativeUI(newTheme);
|
||||
};
|
||||
|
||||
const loadHallData = async () => {
|
||||
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 || '按约定准时到场,文明健康社交。'
|
||||
};
|
||||
});
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn('[Hall] 加载接单大厅数据异常:', err);
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
navInfo.value = getNavBarInfo();
|
||||
currentThemeKey.value = getCurrentThemeKey();
|
||||
applyThemeToNativeUI(currentThemeKey.value);
|
||||
uni.$on('theme-change', onThemeChanged);
|
||||
loadHallData();
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
if (!isExpertCertified()) {
|
||||
uni.showToast({
|
||||
title: '非认证大神禁止访问接单大厅',
|
||||
icon: 'none',
|
||||
duration: 1500
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({ url: '/pages/user/index' });
|
||||
}, 400);
|
||||
return;
|
||||
}
|
||||
navInfo.value = getNavBarInfo();
|
||||
currentThemeKey.value = getCurrentThemeKey();
|
||||
applyThemeToNativeUI(currentThemeKey.value);
|
||||
uni.hideTabBar({ animation: false, fail: () => {} });
|
||||
loadHallData();
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
uni.$off('theme-change', onThemeChanged);
|
||||
});
|
||||
|
||||
|
||||
const categories = ref([
|
||||
{ key: 'all', name: '全部可接', count: 12, icon: ICONS.gridAll },
|
||||
{ key: 'food', name: '同城美食', count: 4, icon: ICONS.utensils },
|
||||
{ key: 'drink', name: '清吧咖啡', count: 3, icon: ICONS.coffee },
|
||||
{ key: 'sing', name: 'KTV麦霸', count: 2, icon: ICONS.micVocal },
|
||||
{ key: 'game', name: '线上电竞', count: 3, icon: ICONS.gameCrosshair }
|
||||
]);
|
||||
|
||||
const orders = ref([
|
||||
{
|
||||
id: 101,
|
||||
category: '同城美食陪吃',
|
||||
typeClass: 'cat-food',
|
||||
payMethod: 'AA制各付',
|
||||
reward: 120,
|
||||
title: '三里屯北京烤鸭探店·寻2位好脾气饭搭子',
|
||||
location: '朝阳区 · 三里屯SOHO商场',
|
||||
distance: '1.1km',
|
||||
timeSlot: '今日 18:30 - 20:30',
|
||||
requirement: '已提前订座,现场各自出示4位核销码,性格随和开朗。',
|
||||
userName: '小鹿斑比',
|
||||
userAvatar: 'https://images.unsplash.com/photo-1544005313-94ddf0286df2?w=100'
|
||||
},
|
||||
{
|
||||
id: 102,
|
||||
category: '线上电竞开黑',
|
||||
typeClass: 'cat-game',
|
||||
payMethod: '老板全包',
|
||||
reward: 70,
|
||||
title: '王者荣耀 · 微信区荣耀王者晋级双排',
|
||||
location: '线上远程连麦',
|
||||
distance: '全国',
|
||||
timeSlot: '接单后即刻开始 (2局)',
|
||||
requirement: '擅长射手或打野位,带飞晋级,开麦清晰沟通不压力。',
|
||||
userName: '想赢一把好难',
|
||||
userAvatar: 'https://images.unsplash.com/photo-1500648767791-00dcc994a43e?w=100'
|
||||
},
|
||||
{
|
||||
id: 103,
|
||||
category: '同城下午茶陪喝',
|
||||
typeClass: 'cat-drink',
|
||||
payMethod: '房主买单',
|
||||
reward: 150,
|
||||
title: '工体精品手冲咖啡馆 · 倾听解压与交流',
|
||||
location: '朝阳区 · 工体北路',
|
||||
distance: '1.8km',
|
||||
timeSlot: '今日 15:00 - 17:00',
|
||||
requirement: '纯正规咖啡馆,工作压力大想倾诉,求善解人意的倾听导师。',
|
||||
userName: '风吹过的夏天',
|
||||
userAvatar: 'https://images.unsplash.com/photo-1524504388940-b1c1722653e1?w=100'
|
||||
},
|
||||
{
|
||||
id: 104,
|
||||
category: '同城KTV陪唱',
|
||||
typeClass: 'cat-sing',
|
||||
payMethod: 'AA分摊',
|
||||
reward: 200,
|
||||
title: '量贩纯K包厢麦霸欢唱 · 流行情歌对唱',
|
||||
location: '朝阳区 · 青年路大悦城店',
|
||||
distance: '3.2km',
|
||||
timeSlot: '今日 20:00 - 23:00',
|
||||
requirement: '爱唱歌、不跑调,会带动气氛,严禁任何违规,正规量贩KTV。',
|
||||
userName: '麦霸小王子',
|
||||
userAvatar: 'https://images.unsplash.com/photo-1519085360753-af0119f7cbe7?w=100'
|
||||
}
|
||||
]);
|
||||
|
||||
const filteredOrders = computed(() => {
|
||||
if (activeCategory.value === 'all') return orders.value;
|
||||
if (activeCategory.value === 'food') return orders.value.filter(o => o.typeClass === 'cat-food');
|
||||
if (activeCategory.value === 'drink') return orders.value.filter(o => o.typeClass === 'cat-drink');
|
||||
if (activeCategory.value === 'sing') return orders.value.filter(o => o.typeClass === 'cat-sing');
|
||||
if (activeCategory.value === 'game') return orders.value.filter(o => o.typeClass === 'cat-game');
|
||||
return orders.value;
|
||||
});
|
||||
|
||||
const toggleOnlineStatus = () => {
|
||||
isOnline.value = !isOnline.value;
|
||||
uni.showToast({
|
||||
title: isOnline.value ? '已开启在线接单状态' : '已设置为打烊休息',
|
||||
icon: isOnline.value ? 'success' : 'none'
|
||||
});
|
||||
};
|
||||
|
||||
const handleGrabOrder = (order) => {
|
||||
uni.showModal({
|
||||
title: '确认抢单',
|
||||
content: `【${order.category}】\n酬金:¥${order.reward}\n预约时段:${order.timeSlot}\n\n确认后立即为您保留此单并发送微信履约通知。`,
|
||||
confirmText: '立即接单',
|
||||
confirmColor: '#10B981',
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
uni.showLoading({ title: '正在锁定订单...' });
|
||||
try {
|
||||
await createOrder({
|
||||
buyerId: 2001,
|
||||
clientName: order.userName || '客户老板',
|
||||
expertId: 101,
|
||||
companionName: '我 (接单大神)',
|
||||
expertAvatar: order.userAvatar || 'https://images.unsplash.com/photo-1544005313-94ddf0286df2?w=100',
|
||||
track: order.category || '同城生活',
|
||||
serviceTitle: order.title,
|
||||
hourlyRate: order.reward,
|
||||
durationHours: 2,
|
||||
amount: order.reward,
|
||||
location: order.location,
|
||||
expenseBurden: order.payMethod,
|
||||
status: '履约中'
|
||||
});
|
||||
} catch (_) {}
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '接单成功!请准时履约',
|
||||
icon: 'success'
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/order/list'
|
||||
});
|
||||
}, 600);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.hall-container {
|
||||
min-height: 100vh;
|
||||
background-color: #0A0F1D;
|
||||
color: #F8FAFC;
|
||||
padding-top: var(--capsule-below-gap, calc(var(--safe-header-gap, 36rpx) + 80rpx));
|
||||
padding-left: 28rpx;
|
||||
padding-right: 28rpx;
|
||||
padding-bottom: 24rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
.hall-header-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
background: #151D30;
|
||||
border-radius: 28rpx;
|
||||
padding: 24rpx 28rpx;
|
||||
border: 1rpx solid rgba(255, 255, 255, 0.08);
|
||||
margin-top: 0;
|
||||
margin-bottom: 24rpx;
|
||||
|
||||
.expert-info-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16rpx;
|
||||
|
||||
.avatar-img {
|
||||
width: 88rpx;
|
||||
height: 88rpx;
|
||||
border-radius: 50%;
|
||||
border: 4rpx solid #10B981;
|
||||
}
|
||||
|
||||
.text-meta {
|
||||
.name-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
|
||||
.expert-name {
|
||||
font-size: 30rpx;
|
||||
font-weight: 800;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.pro-badge {
|
||||
font-size: 18rpx;
|
||||
background: rgba(16, 185, 129, 0.2);
|
||||
color: #10B981;
|
||||
padding: 2rpx 10rpx;
|
||||
border-radius: 8rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
|
||||
.rating-sub {
|
||||
font-size: 20rpx;
|
||||
color: #94A3B8;
|
||||
margin-top: 4rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.status-toggle {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
background: #0A0F1D;
|
||||
padding: 12rpx 24rpx;
|
||||
border-radius: 30rpx;
|
||||
border: 1rpx solid rgba(255, 255, 255, 0.1);
|
||||
|
||||
.status-dot {
|
||||
width: 14rpx;
|
||||
height: 14rpx;
|
||||
border-radius: 50%;
|
||||
background: #64748B;
|
||||
|
||||
&.active {
|
||||
background: #10B981;
|
||||
box-shadow: 0 0 10rpx #10B981;
|
||||
}
|
||||
}
|
||||
|
||||
.toggle-text {
|
||||
font-size: 22rpx;
|
||||
color: #E2E8F0;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.hall-stats-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
background: #151D30;
|
||||
border-radius: 24rpx;
|
||||
padding: 24rpx 16rpx;
|
||||
border: 1rpx solid rgba(255, 255, 255, 0.08);
|
||||
margin-bottom: 24rpx;
|
||||
|
||||
.stat-col {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
.stat-num {
|
||||
font-size: 32rpx;
|
||||
font-weight: 800;
|
||||
color: #FFFFFF;
|
||||
font-family: monospace;
|
||||
|
||||
&.text-green {
|
||||
color: #10B981;
|
||||
}
|
||||
&.text-orange {
|
||||
color: #F59E0B;
|
||||
}
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 20rpx;
|
||||
color: #94A3B8;
|
||||
margin-top: 6rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.stat-divider {
|
||||
width: 1rpx;
|
||||
height: 48rpx;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
.category-tabs-wrap {
|
||||
margin-bottom: 24rpx;
|
||||
width: 100%;
|
||||
|
||||
.category-scroll {
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
box-sizing: border-box;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
display: none;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.tabs-list {
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: 16rpx;
|
||||
padding: 6rpx 4rpx;
|
||||
|
||||
.cat-chip {
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
white-space: nowrap;
|
||||
padding: 14rpx 26rpx;
|
||||
background: #151D30;
|
||||
border-radius: 32rpx;
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
box-sizing: border-box;
|
||||
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
|
||||
.chip-icon-svg {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
margin-right: 10rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.chip-text {
|
||||
font-size: 24rpx;
|
||||
color: #94A3B8;
|
||||
font-weight: 500;
|
||||
white-space: nowrap;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.chip-count {
|
||||
font-size: 20rpx;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
padding: 4rpx 12rpx;
|
||||
border-radius: 20rpx;
|
||||
margin-left: 10rpx;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
color: #94A3B8;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
&.active {
|
||||
background: linear-gradient(135deg, #10B981 0%, #059669 100%);
|
||||
border-color: #34D399;
|
||||
box-shadow: 0 4rpx 16rpx rgba(16, 185, 129, 0.35);
|
||||
|
||||
.chip-text {
|
||||
color: #FFFFFF;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.chip-count {
|
||||
background: rgba(255, 255, 255, 0.25);
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.dispatch-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20rpx;
|
||||
|
||||
.dispatch-card {
|
||||
background: #151D30;
|
||||
border-radius: 24rpx;
|
||||
padding: 24rpx;
|
||||
border: 1rpx solid rgba(255, 255, 255, 0.08);
|
||||
|
||||
.card-top-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 12rpx;
|
||||
|
||||
.tag-group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10rpx;
|
||||
|
||||
.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;
|
||||
}
|
||||
}
|
||||
|
||||
.reward-box {
|
||||
.reward-val {
|
||||
font-size: 36rpx;
|
||||
font-weight: 800;
|
||||
color: #10B981;
|
||||
font-family: monospace;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.order-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 700;
|
||||
color: #F8FAFC;
|
||||
display: block;
|
||||
margin-bottom: 14rpx;
|
||||
}
|
||||
|
||||
.info-grid {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8rpx;
|
||||
margin-bottom: 12rpx;
|
||||
|
||||
.info-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
|
||||
.row-icon {
|
||||
width: 22rpx;
|
||||
height: 22rpx;
|
||||
}
|
||||
|
||||
.row-text {
|
||||
font-size: 22rpx;
|
||||
color: #94A3B8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.remark-box {
|
||||
background: rgba(0, 0, 0, 0.25);
|
||||
border-radius: 12rpx;
|
||||
padding: 10rpx 14rpx;
|
||||
margin-bottom: 18rpx;
|
||||
|
||||
.remark-text {
|
||||
font-size: 22rpx;
|
||||
color: #CBD5E1;
|
||||
}
|
||||
}
|
||||
|
||||
.card-action-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding-top: 16rpx;
|
||||
border-top: 1rpx solid rgba(255, 255, 255, 0.06);
|
||||
|
||||
.user-inline {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10rpx;
|
||||
|
||||
.user-avatar {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.user-name {
|
||||
font-size: 22rpx;
|
||||
color: #94A3B8;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-grab-order {
|
||||
background: linear-gradient(135deg, #10B981, #059669);
|
||||
color: #FFFFFF;
|
||||
font-size: 24rpx;
|
||||
font-weight: 700;
|
||||
padding: 10rpx 28rpx;
|
||||
border-radius: 28rpx;
|
||||
box-shadow: 0 4rpx 12rpx rgba(16, 185, 129, 0.35);
|
||||
margin: 0;
|
||||
line-height: 1.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 浅色暖阳 (Warm Theme) 适配 */
|
||||
&.theme-warm {
|
||||
background-color: #FAF7F2;
|
||||
color: #292524;
|
||||
|
||||
.hall-header-card {
|
||||
background: #FFFFFF;
|
||||
border-color: #E7E5E4;
|
||||
.expert-info-left .text-meta .name-row .expert-name {
|
||||
color: #292524;
|
||||
}
|
||||
.status-toggle {
|
||||
background: #F5F5F4;
|
||||
border-color: #E7E5E4;
|
||||
.toggle-text {
|
||||
color: #44403C;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.hall-stats-card {
|
||||
background: #FFFFFF;
|
||||
border-color: #E7E5E4;
|
||||
.stat-col .stat-num {
|
||||
color: #292524;
|
||||
&.text-green { color: #10B981; }
|
||||
&.text-orange { color: #EA580C; }
|
||||
}
|
||||
.stat-divider {
|
||||
background: #E7E5E4;
|
||||
}
|
||||
}
|
||||
|
||||
.category-tabs-wrap .tabs-list .cat-chip {
|
||||
background: #FFFFFF;
|
||||
border: 1px solid #E7E5E4;
|
||||
box-shadow: 0 2rpx 10rpx rgba(28, 25, 23, 0.03);
|
||||
|
||||
.chip-text {
|
||||
color: #57534E;
|
||||
}
|
||||
.chip-count {
|
||||
background: #F5F5F4;
|
||||
color: #78716C;
|
||||
}
|
||||
|
||||
&.active {
|
||||
background: linear-gradient(135deg, #10B981 0%, #059669 100%);
|
||||
border-color: #10B981;
|
||||
box-shadow: 0 4rpx 14rpx rgba(16, 185, 129, 0.3);
|
||||
|
||||
.chip-text {
|
||||
color: #FFFFFF;
|
||||
font-weight: 700;
|
||||
}
|
||||
.chip-count {
|
||||
background: rgba(255, 255, 255, 0.25);
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.dispatch-list .dispatch-card {
|
||||
background: #FFFFFF;
|
||||
border-color: #E7E5E4;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.03);
|
||||
|
||||
.order-title {
|
||||
color: #292524;
|
||||
}
|
||||
.remark-box {
|
||||
background: #F5F5F4;
|
||||
.remark-text { color: #44403C; }
|
||||
}
|
||||
.card-action-bar {
|
||||
border-top-color: #F5F5F4;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
1232
pwuniapp/pages/expert/radar.vue
普通文件
1232
pwuniapp/pages/expert/radar.vue
普通文件
文件差异内容过多而无法显示
加载差异
@@ -30,12 +30,12 @@
|
||||
<view class="stat-divider"></view>
|
||||
<view class="stat-col">
|
||||
<text class="stat-label">今日履约单数</text>
|
||||
<text class="stat-val">3 单</text>
|
||||
<text class="stat-val">{{ todayOrdersCount }} 单</text>
|
||||
</view>
|
||||
<view class="stat-divider"></view>
|
||||
<view class="stat-col">
|
||||
<text class="stat-label">待签到核销</text>
|
||||
<text class="stat-val gold-val">1 人</text>
|
||||
<text class="stat-val gold-val">{{ waitingVerifyCount }} 人</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -202,17 +202,26 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { onShow } from '@dcloudio/uni-app';
|
||||
import { ICONS } from '@/common/icons.js';
|
||||
import { EXPERTS_LIST } from '@/common/mock.js';
|
||||
import { isExpertCertified } from '@/common/role.js';
|
||||
import { queryCheckinCode, universalVerifyCheckin, getOrders, getOrdersPool, getExpertStats, claimOrder } from '@/common/api.js';
|
||||
|
||||
const expert = ref(EXPERTS_LIST[0]);
|
||||
const expert = ref({
|
||||
id: 101,
|
||||
nickname: '认证大神',
|
||||
avatar: 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=300'
|
||||
});
|
||||
const isReceivingOrders = ref(true);
|
||||
const todayIncome = ref(175);
|
||||
const todayIncome = ref('0.00');
|
||||
const todayOrdersCount = ref(0);
|
||||
const waitingVerifyCount = ref(0);
|
||||
const inputDigits = ref([]);
|
||||
const isCodeError = ref(false);
|
||||
const showConfirmModal = ref(false);
|
||||
|
||||
|
||||
const verifiedParticipant = ref({
|
||||
nickname: '电竞萌新小可爱',
|
||||
avatar: 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=150&h=150&fit=crop',
|
||||
@@ -299,52 +308,166 @@ const fillDemoCode = () => {
|
||||
verifyInputCode();
|
||||
};
|
||||
|
||||
const verifyInputCode = () => {
|
||||
const codeStr = inputDigits.value.join('');
|
||||
if (codeStr === '8392') {
|
||||
isCodeError.value = false;
|
||||
showConfirmModal.value = true;
|
||||
} else {
|
||||
isCodeError.value = true;
|
||||
uni.showToast({
|
||||
title: `核销码 [${codeStr}] 无效或已被核销`,
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => {
|
||||
isCodeError.value = false;
|
||||
}, 800);
|
||||
const loadWorkspaceOrders = async () => {
|
||||
try {
|
||||
const stats = await getExpertStats(101);
|
||||
if (stats) {
|
||||
if (stats.income !== undefined) todayIncome.value = stats.income;
|
||||
if (stats.orders !== undefined) todayOrdersCount.value = stats.orders;
|
||||
if (stats.waitingVerify !== undefined) waitingVerifyCount.value = stats.waitingVerify;
|
||||
}
|
||||
|
||||
const pool = await getOrdersPool();
|
||||
if (pool && pool.length > 0) {
|
||||
poolOrders.value = pool.map(p => ({
|
||||
id: p.id,
|
||||
game: p.category || '同城陪伴',
|
||||
price: p.reward || 68,
|
||||
desc: p.title || '同城线下生活陪伴,需准时到场',
|
||||
countdown: p.countdown || 50
|
||||
}));
|
||||
}
|
||||
|
||||
const list = await getOrders();
|
||||
if (Array.isArray(list) && list.length > 0) {
|
||||
const active = list.filter(o => o.status === 'IN_SERVICE').map(o => ({
|
||||
id: o.id,
|
||||
buyerName: o.expert.nickname || '客户老板',
|
||||
buyerAvatar: o.expert.avatar || 'https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=150',
|
||||
serviceTitle: o.serviceTitle,
|
||||
hours: o.quantity,
|
||||
totalAmount: o.totalAmount,
|
||||
statusText: o.verifyCode ? `现场码[${o.verifyCode}]到场核销服务中` : '正在履约服务中'
|
||||
}));
|
||||
if (active.length > 0) {
|
||||
activeOrders.value = active;
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn('[Workspace] 加载服务列表异常:', err);
|
||||
}
|
||||
};
|
||||
|
||||
const confirmCheckin = () => {
|
||||
showConfirmModal.value = false;
|
||||
todayIncome.value += 25;
|
||||
inputDigits.value = [];
|
||||
uni.showToast({
|
||||
title: '核销成功!¥25已释放到账',
|
||||
icon: 'success'
|
||||
});
|
||||
onMounted(() => {
|
||||
if (isExpertCertified()) {
|
||||
loadWorkspaceOrders();
|
||||
}
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
if (!isExpertCertified()) {
|
||||
uni.showToast({
|
||||
title: '非认证大神禁止访问工作台',
|
||||
icon: 'none',
|
||||
duration: 1500
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({ url: '/pages/user/index' });
|
||||
}, 400);
|
||||
return;
|
||||
}
|
||||
loadWorkspaceOrders();
|
||||
});
|
||||
|
||||
const verifyInputCode = async () => {
|
||||
const codeStr = inputDigits.value.join('');
|
||||
uni.showLoading({ title: '核验核销码中...' });
|
||||
try {
|
||||
const info = await queryCheckinCode(codeStr);
|
||||
uni.hideLoading();
|
||||
if (info.checkedIn) {
|
||||
isCodeError.value = true;
|
||||
uni.showToast({
|
||||
title: `核销码 [${codeStr}] 已核销完成,请勿重复签到`,
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => { isCodeError.value = false; }, 1200);
|
||||
return;
|
||||
}
|
||||
verifiedParticipant.value = {
|
||||
id: info.id,
|
||||
nickname: info.nickname || '同城搭子',
|
||||
avatar: info.avatar || 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=150',
|
||||
activityTitle: info.title || '同城生活组局',
|
||||
code: info.code,
|
||||
fee: info.fee || '50.00',
|
||||
};
|
||||
isCodeError.value = false;
|
||||
showConfirmModal.value = true;
|
||||
} catch (err) {
|
||||
uni.hideLoading();
|
||||
isCodeError.value = true;
|
||||
uni.showToast({
|
||||
title: err.message || `核销码 [${codeStr}] 无效`,
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => { isCodeError.value = false; }, 1000);
|
||||
}
|
||||
};
|
||||
|
||||
const grabOrder = (order) => {
|
||||
const confirmCheckin = async () => {
|
||||
const codeStr = verifiedParticipant.value.code;
|
||||
uni.showLoading({ title: '确认核销中...' });
|
||||
try {
|
||||
await universalVerifyCheckin(codeStr, 1001);
|
||||
uni.hideLoading();
|
||||
showConfirmModal.value = false;
|
||||
const gainedFee = Number(verifiedParticipant.value.fee) || 25;
|
||||
todayIncome.value = (Number(todayIncome.value) + gainedFee).toFixed(2);
|
||||
inputDigits.value = [];
|
||||
uni.showToast({
|
||||
title: `核销成功!¥${gainedFee}已释放到账`,
|
||||
icon: 'success'
|
||||
});
|
||||
loadWorkspaceOrders();
|
||||
} catch (err) {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: err.message || '核销异常',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const grabOrder = async (order) => {
|
||||
try {
|
||||
await claimOrder(order.id, {
|
||||
expertId: 101,
|
||||
companionName: '我 (接单大神)',
|
||||
expertAvatar: 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=150'
|
||||
});
|
||||
} catch (_) {}
|
||||
uni.showToast({
|
||||
title: `抢单成功!已接单 ¥${order.price}`,
|
||||
icon: 'success'
|
||||
});
|
||||
poolOrders.value = poolOrders.value.filter(o => o.id !== order.id);
|
||||
activeOrders.value.push({
|
||||
id: `ord_grabbed_${Date.now()}`,
|
||||
buyerName: '特惠预约老板',
|
||||
buyerAvatar: 'https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=150&h=150&fit=crop',
|
||||
serviceTitle: order.game,
|
||||
hours: 1,
|
||||
totalAmount: order.price,
|
||||
statusText: '待双方进房连麦'
|
||||
});
|
||||
loadWorkspaceOrders();
|
||||
};
|
||||
|
||||
|
||||
const chatWithBuyer = () => {
|
||||
uni.showToast({ title: '已连接买家专属密聊通道', icon: 'none' });
|
||||
uni.showActionSheet({
|
||||
itemList: [
|
||||
'呼叫进入买家专属开黑语音连麦',
|
||||
'发送微信快捷提醒(准备开局)',
|
||||
'复制开黑联络码'
|
||||
],
|
||||
success: (res) => {
|
||||
if (res.tapIndex === 0) {
|
||||
uni.showToast({ title: '已建立加密语音通道', icon: 'success' });
|
||||
} else if (res.tapIndex === 1) {
|
||||
uni.showToast({ title: '已发送准备开局提醒', icon: 'success' });
|
||||
} else {
|
||||
uni.setClipboardData({
|
||||
data: `BUYER-${Math.floor(100000 + Math.random() * 900000)}`,
|
||||
success: () => {
|
||||
uni.showToast({ title: '联络码已复制', icon: 'success' });
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const completeOrder = (id) => {
|
||||
|
||||
在新工单中引用
屏蔽一个用户