feat: 新增用户和师傅消息中心及订单页重构

- 新增用户消息中心组件 UserMessageView
- 新增师傅消息中心组件 MasterMessageView
- 新增用户订单列表组件 UserOrdersView
- 重构订单列表页,复用独立组件
- 新增系统工具 getWindowInfoSafe 兼容多端系统信息获取
- 重构 TabBar 组件,支持单母页模式和事件回调
- 优化消息跳转逻辑,支持角色自适应 Tab 切换
这个提交包含在:
YuanWen
2026-11-05 16:52:12 +08:00
父节点 f60b2df7b3
当前提交 cd0da0324b
共有 23 个文件被更改,包括 4088 次插入 和 3538 次删除

查看文件

@@ -0,0 +1,720 @@
<template>
<view class="hall-view">
<!-- 顶部一体化沉浸式头部(单一连续背景渐变,彻底消除分层割裂) -->
<view class="hall-hero">
<YjyfNavBar theme="transparent" title="接单大厅" :fixed="false" />
<view class="hall-header-body">
<view class="header-main">
<view class="h-user">
<view class="name-line">
<text class="h-name">{{ info ? info.realname : '优匠师傅' }}</text>
<view class="level-badge" v-if="info">
<text class="level-txt">Lv{{ info.level }}</text>
</view>
</view>
<text class="h-stats">{{ info ? ('综合评分 ' + info.score + ' · 累计完成 ' + info.order_count + ' 单') : '优匠优服师傅工作端' }}</text>
</view>
<view class="work-toggle clickable-hover" :class="{ paused: info && info.work_status === 'off' }" @tap="toggleWork">
<view class="dot"></view>
<text class="toggle-txt">{{ info && info.work_status === 'off' ? '已暂停' : '听单中' }}</text>
</view>
</view>
</view>
</view>
<!-- 跑马灯动态通知广播(对标工奇兵广播条) -->
<view class="broadcast-bar" v-if="list.length">
<image class="broadcast-ico" src="/static/icons/nav-bell.svg" mode="aspectFit" />
<swiper class="broadcast-swiper" :vertical="true" :autoplay="true" :interval="3500" :circular="true">
<swiper-item class="swiper-item" v-for="(item, idx) in broadcastList" :key="idx">
<text class="broadcast-txt">{{ item }}</text>
</swiper-item>
</swiper>
</view>
<!-- 工奇兵风格筛选导航栏:全部 / 一口价 / 师傅竞价 / 用户定价 -->
<view class="filter-sticky">
<view class="type-tabs">
<view v-for="t in typeTabs" :key="t.key" class="t-tab clickable-hover" :class="{ on: type === t.key }" @tap="type = t.key">
<text class="t-txt">{{ t.name }}</text>
<view class="t-dot" v-if="t.badge && list.length"></view>
</view>
</view>
<view class="sort-tabs">
<view v-for="s in sortTabs" :key="s.key" class="s-tab clickable-hover" :class="{ on: sort === s.key }" @tap="sort = s.key">
{{ s.name }}
</view>
</view>
</view>
<!-- 订单列表(工奇兵高密度信息流卡片,点击卡片进详情) -->
<view class="list">
<view class="item clickable-hover" v-for="o in list" :key="o.id" @tap="goDetail(o)">
<view class="hd">
<view class="hd-left">
<text class="tag-urgent" v-if="Number(o.urgent)">急单</text>
<text class="tag-mode quote" v-if="o.price_type === 'quote'">师傅竞价</text>
<text class="tag-mode custom" v-if="o.price_type === 'custom'">用户定价</text>
<text class="tag-mode fixed" v-if="o.price_type === 'fixed'">一口价</text>
<text class="svc">{{ o.service_name }}</text>
</view>
<view class="amt-box">
<text class="amt-symbol" v-if="o.price_type !== 'quote'">¥</text>
<text class="amt">{{ o.price_type === 'quote' ? '竞价中' : o.pay_amount }}</text>
</view>
</view>
<view class="bd">
<!-- 地址与距离 -->
<view class="info-row">
<image class="row-icon" src="/static/icons/master/order-loc.svg" mode="aspectFit" />
<text class="row-txt addr-txt">{{ o.address }}</text>
<text class="distance-txt" v-if="o.distance_text">{{ o.distance_text }}</text>
</view>
<!-- 预约上门时间 -->
<view class="info-row">
<image class="row-icon" src="/static/icons/master/order-time.svg" mode="aspectFit" />
<text class="row-txt">期望上门:{{ o.appoint_text }}</text>
</view>
<!-- 服务规格与条件微徽标 -->
<view class="badge-row">
<text class="badge">楼层 {{ o.floor }} 层</text>
<text class="badge">{{ Number(o.has_elevator) ? '有电梯' : '步梯无电梯' }}</text>
<text class="badge" v-if="o.goods_model">型号:{{ o.goods_model }}</text>
</view>
<!-- 客户工单要求备注 -->
<view class="remark-row" v-if="o.remark">
<text class="remark-tag">工单要求</text>
<text class="remark-txt">{{ o.remark }}</text>
</view>
</view>
<view class="ft" @tap.stop>
<view class="time-left">
<text class="left-label">有效倒计时:</text>
<text class="left-val" :class="{ urgent: o.left_seconds <= 1800 }">
{{ o.left_seconds > 0 ? countdown(o.left_seconds) : '即将超时' }}
</text>
</view>
<view class="ft-btns">
<view class="quote-btn clickable-hover" v-if="o.price_type === 'quote'" @tap="goDetail(o)">
立即报价({{ o.quote_count }})
</view>
<view class="grab-btn clickable-hover" v-else @tap="openGrabConfirm(o)">
{{ o.price_type === 'custom' ? '按此价接单' : '立即抢单' }}
</view>
</view>
</view>
</view>
</view>
<!-- 空状态 -->
<view class="empty-state" v-if="!loading && !list.length">
<image class="empty-img" src="/static/icons/master/empty-orders.svg" mode="aspectFit" />
<text class="empty-title">当前大厅暂无待接工单</text>
<text class="empty-sub">保持听单中状态,有新订单将第一时间呈现</text>
<view class="refresh-cta clickable-hover" @tap="load">立即刷新大厅</view>
</view>
<!-- 抢单防误点二次确认弹窗(100% 对标工奇兵实机图3) -->
<view class="confirm-mask" v-if="selectedOrder" @tap="selectedOrder = null">
<view class="confirm-dialog" @tap.stop>
<text class="cd-title">提示</text>
<text class="cd-content">请确定已经了解清楚订单服务要求、商品数量、服务地址等信息。您确定可以承揽,并能完成工作,如随意抢单,将影响您的订单推送优先级。</text>
<view class="cd-actions">
<view class="cd-btn cancel clickable-hover" @tap="selectedOrder = null">
<text class="cd-btn-txt cancel">再看看</text>
</view>
<view class="cd-btn ok clickable-hover" :class="{ disabled: grabbing }" @tap="confirmGrab">
<text class="cd-btn-txt ok">{{ grabbing ? '抢单中...' : '确定' }}</text>
</view>
</view>
</view>
</view>
</view>
</template>
<script setup>
import { ref, computed, watch, onMounted } from 'vue';
import api from '@/utils/api.js';
import { isLogin, toLogin } from '@/utils/request.js';
import YjyfNavBar from '@/components/YjyfNavBar.vue';
const list = ref([]);
const info = ref(null);
const loading = ref(false);
const type = ref('all');
const sort = ref('new');
const selectedOrder = ref(null);
const grabbing = ref(false);
const typeTabs = [
{ key: 'all', name: '全部订单', badge: true },
{ key: 'fixed', name: '一口价' },
{ key: 'quote', name: '师傅竞价' },
{ key: 'custom', name: '用户定价' }
];
const sortTabs = [
{ key: 'new', name: '最新发布' },
{ key: 'amount', name: '报酬最高' },
{ key: 'urgent', name: '急单优先' },
{ key: 'time', name: '时效最近' }
];
// 根据真实订单列表动态生成走马灯播报(拒绝假数据)
const broadcastList = computed(() => {
if (!list.value.length) return [];
return list.value.slice(0, 5).map((o) => {
const addrPart = (o.address || '本地').slice(0, 6);
const priceDesc = o.price_type === 'quote' ? '需师傅竞价' : `报酬 ¥${o.pay_amount}`;
return `${addrPart}发布【${o.service_name}】工单,${priceDesc} · 开放接单`;
});
});
watch([type, sort], () => load());
function countdown(sec) {
const s = Number(sec) || 0;
if (s <= 0) return '已结束';
const h = Math.floor(s / 3600);
const m = Math.floor((s % 3600) / 60);
if (h > 0) {
return `${h}小时${m}分`;
}
return `${m}分钟`;
}
function goDetail(o) {
uni.navigateTo({ url: '/pages/master/detail?id=' + o.id });
}
function openGrabConfirm(o) {
selectedOrder.value = o;
}
async function confirmGrab() {
if (grabbing.value || !selectedOrder.value) return;
grabbing.value = true;
const o = selectedOrder.value;
try {
const res = await api.masterGrab({ order_id: o.id });
selectedOrder.value = null;
uni.showToast({ title: '抢单成功!', icon: 'success' });
setTimeout(() => {
uni.navigateTo({
url: `/pages/master/success?order_id=${o.id}&mobile=${res.user_mobile || ''}`
});
}, 500);
} catch (e) {
uni.showToast({ title: e.msg || '手慢了,该订单已被抢', icon: 'none' });
} finally {
grabbing.value = false;
}
}
async function load() {
if (!isLogin()) { toLogin(); return; }
loading.value = true;
try {
const res = await api.masterHall({ limit: 20, type: type.value, sort: sort.value });
list.value = res.list || [];
} catch (e) {
}
try {
const me = await api.masterInfo();
info.value = me.applied ? me.master : null;
} catch (e) {}
loading.value = false;
}
async function toggleWork() {
if (!info.value) return;
const next = info.value.work_status === 'off' ? 'on' : 'off';
try {
await api.masterToggle({ work_status: next });
info.value.work_status = next;
uni.showToast({ title: next === 'on' ? '已开启接单听单' : '已暂停接单', icon: 'none' });
} catch (e) {}
}
onMounted(() => {
load();
});
defineExpose({
load
});
</script>
<style scoped>
.hall-view {
min-height: 100vh;
background: #F5F6F8;
padding-bottom: 20rpx;
}
/* 顶部一体化沉浸师傅状态区(单一连续渐变) */
.hall-hero {
background: linear-gradient(135deg, #FFA93F 0%, #F0710D 100%);
position: relative;
overflow: hidden;
}
.hall-header-body {
padding: 6rpx 28rpx 24rpx;
}
.header-main {
display: flex;
align-items: center;
justify-content: space-between;
}
.h-user {
flex: 1;
min-width: 0;
}
.name-line {
display: flex;
align-items: center;
}
.h-name {
font-size: 34rpx;
font-weight: 700;
color: #FFFFFF;
}
.level-badge {
margin-left: 12rpx;
padding: 2rpx 12rpx;
background: rgba(255, 255, 255, 0.25);
border-radius: 8rpx;
}
.level-txt {
font-size: 20rpx;
color: #FFFFFF;
font-weight: 600;
}
.h-stats {
display: block;
margin-top: 6rpx;
font-size: 22rpx;
color: rgba(255, 255, 255, 0.9);
}
.work-toggle {
display: flex;
align-items: center;
background: #FFFFFF;
padding: 0 20rpx;
height: 52rpx;
border-radius: 26rpx;
box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, 0.08);
}
.work-toggle.paused {
background: rgba(255, 255, 255, 0.35);
}
.dot {
width: 12rpx;
height: 12rpx;
border-radius: 50%;
background: #2FA84F;
margin-right: 8rpx;
}
.work-toggle.paused .dot {
background: #E8331B;
}
.toggle-txt {
font-size: 24rpx;
font-weight: 600;
color: #E36B0C;
}
.work-toggle.paused .toggle-txt {
color: #FFFFFF;
}
/* 跑马灯通知栏 */
.broadcast-bar {
display: flex;
align-items: center;
background: #FFF7F0;
height: 64rpx;
padding: 0 24rpx;
border-bottom: 1rpx solid #FEE5D2;
}
.broadcast-ico {
width: 28rpx;
height: 28rpx;
margin-right: 12rpx;
flex-shrink: 0;
}
.broadcast-swiper {
flex: 1;
height: 64rpx;
}
.swiper-item {
display: flex;
align-items: center;
}
.broadcast-txt {
font-size: 22rpx;
color: #E36B0C;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
/* 筛选切换栏 */
.filter-sticky {
background: #FFFFFF;
position: sticky;
top: 0;
z-index: 10;
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.04);
}
.type-tabs {
display: flex;
border-bottom: 1rpx solid #F0F0F2;
}
.t-tab {
flex: 1;
height: 80rpx;
display: flex;
align-items: center;
justify-content: center;
position: relative;
}
.t-txt {
font-size: 28rpx;
color: #444444;
font-weight: 500;
transition: all 0.2s ease;
}
.t-tab.on .t-txt {
color: #F0710D;
font-weight: 700;
font-size: 30rpx;
}
.t-tab.on::after {
content: '';
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 48rpx;
height: 4rpx;
background: #F0710D;
border-radius: 2rpx;
}
.t-dot {
width: 10rpx;
height: 10rpx;
border-radius: 50%;
background: #E8331B;
margin-left: 6rpx;
margin-top: -12rpx;
}
.sort-tabs {
display: flex;
padding: 16rpx 24rpx;
gap: 16rpx;
}
.s-tab {
padding: 8rpx 20rpx;
background: #F5F6F8;
border-radius: 20rpx;
font-size: 22rpx;
color: #888888;
}
.s-tab.on {
background: #FFF7F0;
color: #F0710D;
font-weight: 600;
}
/* 订单列表卡片 */
.list {
padding: 16rpx 24rpx;
}
.item {
background: #FFFFFF;
border-radius: 16rpx;
padding: 24rpx;
margin-bottom: 18rpx;
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.04);
}
.hd {
display: flex;
align-items: center;
justify-content: space-between;
padding-bottom: 18rpx;
border-bottom: 1rpx solid #F0F0F2;
}
.hd-left {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 10rpx;
flex: 1;
}
.tag-urgent {
font-size: 20rpx;
background: #FFE8E5;
color: #E8331B;
padding: 2rpx 10rpx;
border-radius: 6rpx;
font-weight: 600;
}
.tag-mode {
font-size: 20rpx;
padding: 2rpx 10rpx;
border-radius: 6rpx;
font-weight: 600;
}
.tag-mode.fixed {
background: #E6F4EA;
color: #2FA84F;
}
.tag-mode.quote {
background: #EBF1FF;
color: #4A7CFF;
}
.tag-mode.custom {
background: #FFF3E6;
color: #F0710D;
}
.svc {
font-size: 30rpx;
font-weight: 700;
color: #1F1F1F;
}
.amt-box {
display: flex;
align-items: baseline;
}
.amt-symbol {
font-size: 24rpx;
font-weight: 700;
color: #E8331B;
}
.amt {
font-size: 36rpx;
font-weight: 700;
color: #E8331B;
}
.bd {
padding: 18rpx 0;
}
.info-row {
display: flex;
align-items: center;
margin-bottom: 12rpx;
}
.row-icon {
width: 26rpx;
height: 26rpx;
margin-right: 12rpx;
flex-shrink: 0;
}
.row-txt {
font-size: 24rpx;
color: #444444;
}
.addr-txt {
flex: 1;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.distance-txt {
font-size: 22rpx;
color: #F0710D;
background: #FFF7F0;
padding: 2rpx 8rpx;
border-radius: 6rpx;
margin-left: 10rpx;
}
.badge-row {
display: flex;
flex-wrap: wrap;
gap: 10rpx;
margin-top: 14rpx;
}
.badge {
font-size: 20rpx;
color: #888888;
background: #F5F6F8;
padding: 4rpx 12rpx;
border-radius: 6rpx;
}
.remark-row {
margin-top: 14rpx;
background: #F9F9FA;
padding: 10rpx 14rpx;
border-radius: 8rpx;
display: flex;
align-items: flex-start;
}
.remark-tag {
font-size: 20rpx;
color: #FFA93F;
font-weight: 600;
margin-right: 10rpx;
flex-shrink: 0;
}
.remark-txt {
font-size: 22rpx;
color: #666666;
line-height: 1.4;
}
.ft {
display: flex;
align-items: center;
justify-content: space-between;
padding-top: 16rpx;
border-top: 1rpx solid #F0F0F2;
}
.time-left {
display: flex;
align-items: center;
}
.left-label {
font-size: 22rpx;
color: #AAAAAA;
}
.left-val {
font-size: 22rpx;
color: #F0710D;
font-weight: 600;
}
.left-val.urgent {
color: #E8331B;
}
.ft-btns {
display: flex;
gap: 14rpx;
}
.grab-btn {
background: linear-gradient(135deg, #FFA93F 0%, #F0710D 100%);
color: #FFFFFF;
font-size: 24rpx;
font-weight: 600;
padding: 12rpx 32rpx;
border-radius: 28rpx;
box-shadow: 0 4rpx 12rpx rgba(240, 113, 13, 0.3);
}
.quote-btn {
background: #EBF1FF;
color: #4A7CFF;
font-size: 24rpx;
font-weight: 600;
padding: 12rpx 28rpx;
border-radius: 28rpx;
}
/* 空状态 */
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
padding: 80rpx 40rpx;
}
.empty-img {
width: 200rpx;
height: 200rpx;
margin-bottom: 24rpx;
}
.empty-title {
font-size: 28rpx;
font-weight: 600;
color: #1F1F1F;
margin-bottom: 10rpx;
}
.empty-sub {
font-size: 22rpx;
color: #888888;
margin-bottom: 30rpx;
}
.refresh-cta {
background: #FFF7F0;
color: #F0710D;
font-size: 24rpx;
font-weight: 600;
padding: 14rpx 36rpx;
border-radius: 28rpx;
border: 1rpx solid #FEE5D2;
}
/* 抢单二次确认弹窗 */
.confirm-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.6);
z-index: 999;
display: flex;
align-items: center;
justify-content: center;
padding: 40rpx;
}
.confirm-dialog {
background: #FFFFFF;
border-radius: 24rpx;
padding: 36rpx;
width: 100%;
max-width: 600rpx;
}
.cd-title {
font-size: 32rpx;
font-weight: 700;
color: #1F1F1F;
display: block;
text-align: center;
margin-bottom: 20rpx;
}
.cd-content {
font-size: 26rpx;
color: #444444;
line-height: 1.6;
display: block;
margin-bottom: 36rpx;
}
.cd-actions {
display: flex;
gap: 20rpx;
}
.cd-btn {
flex: 1;
height: 72rpx;
border-radius: 36rpx;
display: flex;
align-items: center;
justify-content: center;
}
.cd-btn.cancel {
background: #F5F6F8;
}
.cd-btn.ok {
background: linear-gradient(135deg, #FFA93F 0%, #F0710D 100%);
}
.cd-btn.ok.disabled {
opacity: 0.6;
}
.cd-btn-txt.cancel {
color: #888888;
font-size: 26rpx;
}
.cd-btn-txt.ok {
color: #FFFFFF;
font-size: 26rpx;
font-weight: 600;
}
.clickable-hover:active {
opacity: 0.85;
transform: scale(0.98);
}
</style>

查看文件

@@ -0,0 +1,111 @@
<template>
<view class="message-view">
<!-- 统一顶部橙色导航栏 -->
<YjyfNavBar theme="orange" title="消息中心" />
<view class="head">
<view class="cats">
<view v-for="c in cats" :key="c.key" class="cat clickable-hover" :class="{ on: category === c.key }" @tap="switchCat(c.key)">{{ c.name }}</view>
</view>
<text class="read-all clickable-hover" @tap="readAll">全部已读</text>
</view>
<view class="list">
<view class="msg" :class="{ unread: !m.is_read }" v-for="m in list" :key="m.id" @tap="open(m)">
<view class="msg-top">
<view class="dot" v-if="!m.is_read"></view>
<text class="title">{{ m.title }}</text>
<text class="time">{{ m.time_text }}</text>
</view>
<text class="content">{{ m.content }}</text>
<text class="go" v-if="m.order_id">查看订单 ›</text>
</view>
<view class="empty" v-if="!loading && !list.length">暂无消息</view>
</view>
</view>
</template>
<script setup>
import { ref, onMounted } from 'vue';
import api from '@/utils/api.js';
import { isLogin, toLogin } from '@/utils/request.js';
import YjyfNavBar from '@/components/YjyfNavBar.vue';
const emit = defineEmits(['switch-tab']);
const list = ref([]);
const loading = ref(false);
const category = ref('all');
const cats = [
{ key: 'all', name: '全部' },
{ key: 'order', name: '订单' },
{ key: 'system', name: '系统' },
{ key: 'remind', name: '提醒' }
];
async function load() {
if (!isLogin()) { toLogin(); return; }
loading.value = true;
try {
const res = await api.messageList({ category: category.value, limit: 30 });
list.value = res.list || [];
} catch (e) {
} finally {
loading.value = false;
}
}
function switchCat(k) {
category.value = k;
load();
}
async function open(m) {
if (!m.is_read) {
try {
await api.messageRead({ id: m.id });
m.is_read = 1;
} catch (e) {}
}
if (m.order_id) {
emit('switch-tab', 1);
}
}
async function readAll() {
try {
const res = await api.messageReadAll({});
uni.showToast({ title: '已全部标记已读(' + res.count + ' 条)', icon: 'none' });
load();
} catch (e) {}
}
onMounted(() => {
load();
});
defineExpose({
load
});
</script>
<style scoped>
.message-view { min-height: 100vh; background: #F5F6F8; padding-bottom: 40rpx; }
.head { display: flex; align-items: center; background: #fff; padding: 20rpx 24rpx; box-shadow: 0 4rpx 12rpx rgba(0,0,0,.03); }
.cats { flex: 1; display: flex; }
.cat { margin-right: 14rpx; padding: 0 22rpx; line-height: 54rpx; border-radius: 27rpx; background: #F5F5F5; font-size: 24rpx; color: #666; }
.cat.on { background: #FFF3E6; color: #E36B0C; font-weight: 600; }
.read-all { font-size: 24rpx; color: #F0710D; }
.list { padding: 22rpx 28rpx; }
.msg { background: #fff; border-radius: 20rpx; padding: 22rpx 24rpx; margin-bottom: 18rpx; box-shadow: 0 6rpx 20rpx rgba(240,129,31,.06); }
.msg.unread { border-left: 6rpx solid #F0710D; }
.msg-top { display: flex; align-items: center; }
.dot { width: 12rpx; height: 12rpx; border-radius: 50%; background: #F0710D; margin-right: 10rpx; }
.title { flex: 1; min-width: 0; font-size: 28rpx; font-weight: 600; color: #1F1F1F; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.time { flex-shrink: 0; margin-left: 12rpx; font-size: 22rpx; color: #AAAAAA; }
.content { display: block; margin-top: 10rpx; font-size: 24rpx; color: #666; line-height: 34rpx; }
.go { display: block; margin-top: 10rpx; font-size: 22rpx; color: #4A7CFF; }
.empty { padding: 110rpx 0; text-align: center; font-size: 24rpx; color: #9A9A9A; }
.clickable-hover:active { opacity: 0.85; transform: scale(0.98); }
</style>

查看文件

@@ -0,0 +1,469 @@
<template>
<view class="orders-view">
<!-- 统一规范顶部橙色导航栏 -->
<YjyfNavBar theme="orange" title="接单管理" />
<!-- 顶部状态漏斗看板(对标工奇兵 4 态流转漏斗) -->
<view class="funnel-card">
<view class="funnel-row">
<view class="f-item clickable-hover" :class="{ on: cur === 'active' }" @tap="switchTab('active')">
<text class="f-num">{{ activeCount }}</text>
<text class="f-lab">待处理</text>
<view class="f-line" v-if="cur === 'active'"></view>
</view>
<view class="f-divider"></view>
<view class="f-item clickable-hover" :class="{ on: cur === 'verify' }" @tap="switchTab('verify')">
<text class="f-num">{{ verifyCount }}</text>
<text class="f-lab">待验收</text>
<view class="f-line" v-if="cur === 'verify'"></view>
</view>
<view class="f-divider"></view>
<view class="f-item clickable-hover" :class="{ on: cur === 'completed' }" @tap="switchTab('completed')">
<text class="f-num">{{ completedCount }}</text>
<text class="f-lab">已完成</text>
<view class="f-line" v-if="cur === 'completed'"></view>
</view>
<view class="f-divider"></view>
<view class="f-item clickable-hover" @tap="goQuotes">
<text class="f-num f-quote">{{ quoteCount }}</text>
<text class="f-lab">我的报价</text>
</view>
</view>
</view>
<!-- 订单列表 -->
<view class="list" v-if="list.length">
<view class="item" v-for="o in list" :key="o.id">
<view class="hd">
<view class="svc-box">
<text class="svc">{{ o.service_name }}</text>
<view class="time-urgent-pill" v-if="Number(o.status) === 3 && !o.contact_time">
<image class="time-urgent-ico" src="/static/icons/master/order-time.svg" mode="aspectFit" />
<text class="time-urgent-txt">2小时首联中</text>
</view>
</view>
<view class="status-badge" :class="'st-' + o.status">
<text class="status-txt">{{ o.status_text }}</text>
</view>
</view>
<view class="bd">
<view class="info-line">
<image class="info-ico" src="/static/icons/master/order-loc.svg" mode="aspectFit" />
<text class="addr-txt">{{ o.address }}</text>
</view>
<view class="info-line">
<image class="info-ico" src="/static/icons/master/order-time.svg" mode="aspectFit" />
<text class="meta-txt">预约时间:{{ o.appoint_text }}</text>
</view>
<view class="meta-tags">
<text class="tag">楼层 {{ o.floor }} 层</text>
<text class="tag">{{ Number(o.has_elevator) ? '有电梯' : '步梯无电梯' }}</text>
<text class="tag" v-if="o.goods_model">型号:{{ o.goods_model }}</text>
</view>
<view class="customer-row">
<view class="cust-mobile" @tap="call(o)">
<image class="phone-ico" src="/static/icons/phone.svg" mode="aspectFit" />
<text class="phone-num">客户:{{ o.mobile }}</text>
</view>
<view class="amt-box">
<text class="amt-symbol">¥</text>
<text class="amt-val">{{ o.pay_amount }}</text>
</view>
</view>
</view>
<!-- 操作动作条 -->
<view class="ops">
<view class="op clickable-hover" v-if="Number(o.status) === 3 && !o.contact_time" @tap="act('contact', o)">标记已联系</view>
<view class="op clickable-hover" v-if="Number(o.status) === 3" @tap="act('schedule', o)">约定上门</view>
<view class="op clickable-hover" v-if="Number(o.status) === 4" @tap="act('arrive', o)">到达打卡</view>
<view class="op clickable-hover" v-if="Number(o.status) === 5" @tap="act('start', o)">开始服务</view>
<view class="op clickable-hover" v-if="Number(o.status) === 5 || Number(o.status) === 6" @tap="act('requestDiff', o)">增项补差</view>
<view class="op primary clickable-hover" v-if="Number(o.status) === 6" @tap="act('finish', o)">现场水印拍照完工</view>
<view class="op primary clickable-hover" v-if="Number(o.status) === 7" @tap="act('verifyCode', o)">输入验证码核销</view>
<view class="op clickable-hover" v-if="Number(o.status) === 7" @tap="call(o)">联系客户催码</view>
<view class="op clickable-hover" v-if="Number(o.status) === 3 || Number(o.status) === 4" @tap="call(o)">联系客户</view>
</view>
</view>
</view>
<!-- 空状态引导 -->
<view class="empty-state" v-if="!loading && !list.length">
<image class="empty-img" src="/static/icons/master/empty-orders.svg" mode="aspectFit" />
<text class="empty-title">当前无{{ curTabText }}工单</text>
<text class="empty-sub">前往订单大厅,海量订单实时抢</text>
<view class="empty-cta clickable-hover" @tap="goHall">前往大厅抢单</view>
</view>
<!-- 水印合成离屏 Canvas -->
<canvas canvas-id="watermarkCanvas" :style="{ width: canvasW + 'px', height: canvasH + 'px', position: 'fixed', left: '-9999px', top: '-9999px' }"></canvas>
</view>
</template>
<script setup>
import { ref, computed, onMounted } from 'vue';
import api from '@/utils/api.js';
import { isLogin, toLogin } from '@/utils/request.js';
import YjyfNavBar from '@/components/YjyfNavBar.vue';
const emit = defineEmits(['switch-tab']);
const cur = ref('active');
const list = ref([]);
const loading = ref(false);
const activeCount = ref(0);
const verifyCount = ref(0);
const completedCount = ref(0);
const quoteCount = ref(0);
const canvasW = ref(750);
const canvasH = ref(1000);
function getNowTimeStr() {
const d = new Date();
const pad = (n) => String(n).padStart(2, '0');
return `${d.getFullYear()}-${pad(d.getMonth()+1)}-${pad(d.getDate())} ${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`;
}
function createWatermarkPhoto(tempPath, o) {
return new Promise((resolve) => {
uni.getImageInfo({
src: tempPath,
success: (info) => {
let w = info.width;
let h = info.height;
const maxEdge = 1200;
if (w > maxEdge || h > maxEdge) {
if (w > h) {
h = Math.round((h * maxEdge) / w);
w = maxEdge;
} else {
w = Math.round((w * maxEdge) / h);
h = maxEdge;
}
}
canvasW.value = w;
canvasH.value = h;
setTimeout(() => {
const ctx = uni.createCanvasContext('watermarkCanvas');
ctx.drawImage(info.path, 0, 0, w, h);
const barHeight = Math.max(90, Math.round(h * 0.16));
ctx.setFillStyle('rgba(0, 0, 0, 0.65)');
ctx.fillRect(0, h - barHeight, w, barHeight);
const fontSize = Math.max(14, Math.round(w * 0.028));
ctx.setFillStyle('#FFFFFF');
ctx.setFontSize(fontSize);
const timeStr = getNowTimeStr();
const line1 = `【优匠优服·现场施工取证】 时间: ${timeStr}`;
const line2 = `施工地点: ${o.address || '客户服务现场'}`;
const line3 = `工单流水: ${o.order_no || o.id}`;
const paddingX = Math.round(w * 0.04);
const lineSpacing = Math.round(barHeight / 3.4);
const startY = h - barHeight + lineSpacing - 4;
ctx.fillText(line1, paddingX, startY);
ctx.fillText(line2, paddingX, startY + lineSpacing);
ctx.fillText(line3, paddingX, startY + lineSpacing * 2);
ctx.draw(false, () => {
uni.canvasToTempFilePath({
canvasId: 'watermarkCanvas',
fileType: 'jpg',
quality: 0.85,
success: (res) => resolve(res.tempFilePath),
fail: () => resolve(tempPath)
});
});
}, 150);
},
fail: () => resolve(tempPath)
});
});
}
const curTabText = computed(() => {
const m = { active: '待处理', verify: '待验收', completed: '已完成' };
return m[cur.value] || '';
});
async function loadCounts() {
try {
const infoRes = await api.masterInfo();
if (infoRes && infoRes.master) {
activeCount.value = infoRes.master.todo_count || 0;
verifyCount.value = infoRes.master.verify_count || 0;
}
const qRes = await api.masterQuotes();
quoteCount.value = (qRes.list || []).length;
} catch (e) {}
}
async function load() {
if (!isLogin()) { toLogin(); return; }
loading.value = true;
try {
const res = await api.masterOrders({ status: cur.value, limit: 20 });
list.value = res.list || [];
if (cur.value === 'completed') {
completedCount.value = (res.list || []).length;
}
} catch (e) {
} finally {
loading.value = false;
}
}
function switchTab(k) {
cur.value = k;
load();
}
function goQuotes() {
uni.navigateTo({ url: '/pages/master/quote' });
}
function call(o) {
if (!o.mobile) return;
uni.makePhoneCall({ phoneNumber: String(o.mobile) });
}
function goHall() {
emit('switch-tab', 0);
}
function act(type, o) {
const id = o.id;
if (type === 'contact') {
api.masterContact({ order_id: id }).then(() => {
uni.showToast({ title: '已记录已联系' });
load();
loadCounts();
}).catch(() => {});
return;
}
if (type === 'arrive') {
api.masterArrive({ order_id: id }).then(() => {
uni.showToast({ title: '已到达打卡' });
load();
}).catch(() => {});
return;
}
if (type === 'start') {
api.masterStart({ order_id: id }).then(() => {
uni.showToast({ title: '已开始服务' });
load();
}).catch(() => {});
return;
}
if (type === 'finish') {
uni.chooseImage({
count: 1,
sourceType: ['camera'],
success: async (chooseRes) => {
const rawFile = chooseRes.tempFilePaths[0];
uni.showLoading({ title: '压印防伪水印中...' });
try {
const watermarkedFile = await createWatermarkPhoto(rawFile, o);
uni.showLoading({ title: '上传完工照片...' });
const uploadData = await api.upload(watermarkedFile, 'order');
const remoteImg = uploadData.fullurl || uploadData.url;
await api.masterFinish({
order_id: id,
'images[0]': remoteImg
});
uni.hideLoading();
uni.showModal({
title: '完工提交成功',
content: '系统已向客户手机发送 6 位验收码,请向客户索取核销码后点击【输入验证码核销】完成工费结算!',
showCancel: false
});
load();
loadCounts();
} catch (err) {
uni.hideLoading();
uni.showToast({ title: '上传失败,请重试', icon: 'none' });
}
},
fail: () => {}
});
return;
}
if (type === 'verifyCode') {
uni.showModal({
title: '客户验收码核销',
editable: true,
placeholderText: '请输入客户手机收到的 6 位核销码',
confirmText: '核销结算',
confirmColor: '#F0710D',
success: async (r) => {
if (!r.confirm) return;
const code = (r.content || '').trim();
if (!code) {
uni.showToast({ title: '核销码不能为空', icon: 'none' });
return;
}
uni.showLoading({ title: '核销验证中...' });
try {
const res = await api.masterVerifyCode({ order_id: id, verify_code: code });
uni.hideLoading();
uni.showModal({
title: '核销成功!',
content: `订单已正式完工!本次工费 ¥${res.settle_amount} 已划入您的钱包余额`,
showCancel: false
});
load();
loadCounts();
} catch (e) {
uni.hideLoading();
}
}
});
return;
}
if (type === 'requestDiff') {
uni.showModal({
title: '申请施工增项补差价',
editable: true,
placeholderText: '请输入增项金额(元),如: 50',
confirmText: '发起补差',
confirmColor: '#F0710D',
success: async (r) => {
if (!r.confirm) return;
const amt = parseFloat((r.content || '').trim());
if (!amt || amt <= 0) {
uni.showToast({ title: '请输入有效金额', icon: 'none' });
return;
}
uni.showLoading({ title: '提交申请中...' });
try {
await api.masterRequestDiff({ order_id: id, amount: amt, remark: '施工现场打孔/拆旧等增项补差' });
uni.hideLoading();
uni.showModal({
title: '补差申请已发起',
content: `已成功发起增项补差价 ¥${amt},请提醒客户在订单详情中点击【去支付补差】完成在线支付!`,
showCancel: false
});
load();
} catch (e) {
uni.hideLoading();
}
}
});
return;
}
if (type === 'schedule') {
const ts = Math.floor(Date.now() / 1000) + 7200;
api.masterSchedule({ order_id: id, appoint_time: ts }).then(() => {
uni.showToast({ title: '已约定 2 小时后上门' });
load();
}).catch(() => {});
}
}
onMounted(() => {
load();
loadCounts();
});
defineExpose({
load: () => Promise.all([load(), loadCounts()]),
loadCounts
});
</script>
<style scoped>
.orders-view { min-height: 100vh; background: #F5F6F8; padding-bottom: 30rpx; }
/* 顶部工奇兵风格数据漏斗看板 */
.funnel-card {
background: #ffffff;
padding: 24rpx 20rpx 16rpx;
box-shadow: 0 4rpx 14rpx rgba(0,0,0,0.03);
position: sticky; top: 0; z-index: 10;
}
.funnel-row { display: flex; align-items: center; justify-content: space-around; }
.f-item {
flex: 1; display: flex; flex-direction: column; align-items: center;
position: relative; padding-bottom: 12rpx;
}
.f-num { font-size: 38rpx; font-weight: 700; color: #666; line-height: 1.1; }
.f-quote { color: #7A5AF8; }
.f-item.on .f-num { color: #F0710D; }
.f-lab { margin-top: 8rpx; font-size: 22rpx; color: #8E8E93; }
.f-item.on .f-lab { color: #F0710D; font-weight: 600; }
.f-line {
position: absolute; bottom: 0; width: 44rpx; height: 6rpx;
border-radius: 3rpx; background: #F0710D;
}
.f-divider { width: 1rpx; height: 38rpx; background: #EEEEEE; }
/* 列表卡片 */
.list { padding: 20rpx 24rpx; }
.item {
background: #fff; border-radius: 20rpx; margin-bottom: 20rpx; padding: 24rpx;
box-shadow: 0 6rpx 20rpx rgba(240,129,31,0.06);
}
.hd { display: flex; align-items: center; justify-content: space-between; padding-bottom: 16rpx; border-bottom: 1rpx solid #F4F4F4; }
.svc-box { display: flex; align-items: center; }
.svc { font-size: 30rpx; font-weight: 700; color: #1F1F1F; }
.time-urgent-pill {
display: inline-flex; align-items: center;
margin-left: 14rpx; padding: 2rpx 12rpx; border-radius: 16rpx;
background: #FFF1F0; border: 1rpx solid #FFA39E;
}
.time-urgent-ico { width: 22rpx; height: 22rpx; margin-right: 6rpx; }
.time-urgent-txt { font-size: 20rpx; color: #CF1322; font-weight: 600; }
.status-badge { padding: 4rpx 16rpx; border-radius: 20rpx; background: #FFF3E6; }
.status-txt { font-size: 22rpx; font-weight: 600; color: #E36B0C; }
.status-badge.st-7 { background: #FDEEEB; }
.status-badge.st-7 .status-txt { color: #E8331B; }
.status-badge.st-8 { background: #E9F7EE; }
.status-badge.st-8 .status-txt { color: #2FA84F; }
.bd { padding: 18rpx 0; display: flex; flex-direction: column; }
.info-line { display: flex; align-items: flex-start; margin-bottom: 10rpx; }
.info-ico { width: 28rpx; height: 28rpx; margin-right: 10rpx; margin-top: 4rpx; flex-shrink: 0; }
.addr-txt { font-size: 26rpx; color: #222; font-weight: 500; line-height: 36rpx; }
.meta-txt { font-size: 24rpx; color: #666; line-height: 36rpx; }
.meta-tags { display: flex; flex-wrap: wrap; margin-top: 6rpx; }
.tag { padding: 4rpx 14rpx; background: #F5F6F8; color: #777; font-size: 20rpx; border-radius: 8rpx; margin-right: 10rpx; margin-bottom: 6rpx; }
.customer-row {
display: flex; align-items: center; justify-content: space-between;
margin-top: 14rpx; padding-top: 14rpx; border-top: 1rpx dashed #EEEEEE;
}
.cust-mobile { display: flex; align-items: center; }
.phone-ico { width: 28rpx; height: 28rpx; margin-right: 8rpx; }
.phone-num { font-size: 24rpx; color: #4A7CFF; font-weight: 500; }
.amt-box { display: flex; align-items: baseline; }
.amt-symbol { font-size: 24rpx; font-weight: 700; color: #F0710D; }
.amt-val { font-size: 34rpx; font-weight: 700; color: #F0710D; line-height: 1; }
.ops { display: flex; flex-wrap: wrap; justify-content: flex-end; padding-top: 16rpx; border-top: 1rpx solid #F4F4F4; }
.op {
margin: 8rpx 0 0 14rpx; padding: 0 26rpx; height: 60rpx; line-height: 58rpx;
border-radius: 30rpx; border: 1.5rpx solid #DDD; font-size: 24rpx; color: #555;
}
.op.primary {
border-color: #F0710D; color: #fff;
background: linear-gradient(135deg,#FFA93F 0%,#F0710D 100%);
box-shadow: 0 4rpx 14rpx rgba(240,113,13,0.25);
}
/* 空状态 */
.empty-state { display: flex; flex-direction: column; align-items: center; padding: 120rpx 40rpx 40rpx; }
.empty-img { width: 180rpx; height: 180rpx; margin-bottom: 24rpx; }
.empty-title { font-size: 28rpx; font-weight: 600; color: #333; margin-bottom: 8rpx; }
.empty-sub { font-size: 22rpx; color: #9A9A9A; text-align: center; margin-bottom: 32rpx; }
.empty-cta {
padding: 0 48rpx; height: 74rpx; line-height: 74rpx; border-radius: 37rpx;
background: linear-gradient(135deg,#FFA93F 0%,#F0710D 100%);
color: #fff; font-size: 26rpx; font-weight: 600;
box-shadow: 0 6rpx 16rpx rgba(240,113,13,0.25);
}
</style>

查看文件

@@ -0,0 +1,332 @@
<template>
<view class="workbench-view">
<!-- 1. 师傅顶部一体化沉浸名片区(单一大背景贯穿,彻底消除分层断层) -->
<view class="profile-hero">
<view class="hero-deco d1"></view>
<view class="hero-deco d2"></view>
<!-- 沉浸式透明导航栏 -->
<YjyfNavBar theme="transparent" title="师傅工作台" :fixed="false" />
<view class="hero-body">
<view class="user-block">
<view class="avatar-wrap">
<image class="avatar-img" src="/static/icons/user-avatar.svg" mode="aspectFit" />
</view>
<view class="user-meta">
<view class="name-row">
<text class="user-name">{{ info ? info.realname : '师傅' }}</text>
<view class="auth-tag">
<image class="auth-ico" src="/static/icons/shield.svg" mode="aspectFit" />
<text class="auth-txt">实名认证师傅</text>
</view>
</view>
<text class="user-level" v-if="info">
等级 Lv{{ info.level }} · 综合评分 {{ info.score }} 分 · 履约 {{ info.order_count }} 单
</text>
</view>
<view class="status-pill clickable-hover" :class="{ off: info && info.work_status === 'off' }" @tap="toggleWork">
<view class="status-dot"></view>
<text class="status-txt">{{ info && info.work_status === 'off' ? '暂停接单' : '听单中' }}</text>
</view>
</view>
<!-- 2. 资产工钱大卡(对标工奇兵待结算工钱) -->
<view class="assets-box">
<view class="asset-top">
<text class="asset-title">可提现工钱(元)</text>
<view class="bill-link clickable-hover" @tap="go('/pages/master/wallet')">
<text class="bill-txt">账单明细</text>
<image class="arrow-ico" src="/static/icons/arrow-right.svg" mode="aspectFit" />
</view>
</view>
<view class="asset-main">
<text class="asset-val">{{ info ? Number(info.money).toFixed(2) : '0.00' }}</text>
<view class="withdraw-btn clickable-hover" @tap="go('/pages/master/wallet')">
申请提现
</view>
</view>
<view class="asset-sub">
<text class="sub-item">今日收入 ¥{{ todayIncome }}</text>
<text class="sub-divider">|</text>
<text class="sub-item">累计收入 ¥{{ totalIncome }}</text>
</view>
</view>
</view>
</view>
<!-- 3. 核心功能菜单组(对标工奇兵功能列表) -->
<view class="menu-card">
<view class="menu-item clickable-hover" @tap="goOrdersTab">
<view class="mi-left">
<image class="mi-ico" src="/static/icons/master/menu-orders.svg" mode="aspectFit" />
<text class="mi-title">我的接单管理</text>
</view>
<view class="mi-right">
<text class="mi-badge" v-if="info && info.todo_count > 0">{{ info.todo_count }} 待办</text>
<image class="mi-arrow" src="/static/icons/arrow-right.svg" mode="aspectFit" />
</view>
</view>
<view class="menu-item clickable-hover" @tap="go('/pages/master/quote')">
<view class="mi-left">
<image class="mi-ico" src="/static/icons/master/menu-quote.svg" mode="aspectFit" />
<text class="mi-title">报价记录与管理</text>
</view>
<view class="mi-right">
<text class="mi-tip">查看出价状态</text>
<image class="mi-arrow" src="/static/icons/arrow-right.svg" mode="aspectFit" />
</view>
</view>
<view class="menu-item clickable-hover" @tap="go('/pages/master/credit')">
<view class="mi-left">
<image class="mi-ico" src="/static/icons/master/menu-credit.svg" mode="aspectFit" />
<text class="mi-title">服务信用与申诉</text>
</view>
<view class="mi-right">
<text class="mi-tip" v-if="credit">好评率 {{ credit.good_rate }}%</text>
<image class="mi-arrow" src="/static/icons/arrow-right.svg" mode="aspectFit" />
</view>
</view>
<view class="menu-item clickable-hover" @tap="callService">
<view class="mi-left">
<image class="mi-ico" src="/static/icons/master/menu-service.svg" mode="aspectFit" />
<text class="mi-title">联系平台客服</text>
</view>
<view class="mi-right">
<text class="mi-tip">4000000000</text>
<image class="mi-arrow" src="/static/icons/arrow-right.svg" mode="aspectFit" />
</view>
</view>
</view>
<!-- 4. 服务技能与品类 -->
<view class="card">
<view class="card-head clickable-hover" @tap="goSkills">
<text class="card-title">已认证服务技能</text>
<view style="display: flex; align-items: center; gap: 8rpx;">
<text class="card-tip">{{ skills.length }} 项技能</text>
<text style="font-size: 24rpx; color: #EA580C; font-weight: 600;">修改 ›</text>
</view>
</view>
<view class="skills-box" @tap="goSkills">
<text class="skill-tag" v-for="s in skills" :key="s.name">{{ s.name }}</text>
<text class="skill-tag empty" v-if="!skills.length">暂无已认证技能,点击去选择</text>
</view>
</view>
<!-- 5. 身份切换通道(对标工奇兵我要下单找师傅) -->
<view class="switch-role-card clickable-hover" @tap="backToUser">
<view class="src-left">
<image class="src-ico" src="/static/icons/role-switch.svg" mode="aspectFit" />
<view class="src-text">
<text class="src-title">我要下单找师傅</text>
<text class="src-desc">切换至业主身份发布安装维修需求</text>
</view>
</view>
<image class="src-arrow" src="/static/icons/arrow-right-orange.svg" mode="aspectFit" />
</view>
</view>
</template>
<script setup>
import { ref, onMounted } from 'vue';
import api from '@/utils/api.js';
import { isLogin, toLogin } from '@/utils/request.js';
import { setRole } from '@/utils/role.js';
import YjyfNavBar from '@/components/YjyfNavBar.vue';
const emit = defineEmits(['switch-tab']);
const info = ref(null);
const credit = ref(null);
const skills = ref([]);
const todayIncome = ref('0.00');
const totalIncome = ref('0.00');
function go(url) {
uni.navigateTo({ url });
}
function goOrdersTab() {
emit('switch-tab', 1);
}
function goSkills() {
uni.navigateTo({ url: '/pages/master/skills' });
}
function callService() {
uni.makePhoneCall({ phoneNumber: '4000000000' });
}
async function load() {
if (!isLogin()) { toLogin(); return; }
try {
const res = await api.masterInfo();
if (!res.applied || res.master.verify_status !== 'pass') {
uni.redirectTo({ url: '/pages/master/apply' });
return;
}
info.value = res.master;
skills.value = res.skills || [];
} catch (e) {}
try {
const inc = await api.masterIncome();
if (inc) {
todayIncome.value = Number(inc.today_income || 0).toFixed(2);
totalIncome.value = Number(inc.total_income || 0).toFixed(2);
}
} catch (e) {}
try {
credit.value = await api.masterCredit();
} catch (e) {}
}
async function toggleWork() {
if (!info.value) return;
const next = info.value.work_status === 'off' ? 'on' : 'off';
try {
await api.masterToggle({ work_status: next });
info.value.work_status = next;
uni.showToast({ title: next === 'on' ? '已开启接单听单' : '已暂停接单', icon: 'none' });
} catch (e) {}
}
function backToUser() {
api.switchRole({ role: 'user' }).then((res) => {
setRole('user');
uni.reLaunch({ url: res.redirect || '/pages/index/index' });
}).catch(() => {});
}
onMounted(() => {
load();
});
defineExpose({
load
});
</script>
<style scoped>
.workbench-view { min-height: 100vh; background: #F5F6F8; padding-bottom: 40rpx; }
/* 顶部名片(单一连续大渐变) */
.profile-hero {
position: relative; overflow: hidden; padding-bottom: 30rpx;
background: linear-gradient(135deg, #FFA93F 0%, #F0710D 100%);
}
.hero-body {
position: relative; z-index: 2; padding: 10rpx 28rpx 0;
}
.hero-deco { position: absolute; border-radius: 50%; background: rgba(255,255,255,0.13); }
.d1 { width: 320rpx; height: 320rpx; right: -120rpx; top: -130rpx; }
.d2 { width: 180rpx; height: 180rpx; left: -80rpx; bottom: -60rpx; }
.user-block { position: relative; display: flex; align-items: center; justify-content: space-between; }
.avatar-wrap {
width: 104rpx; height: 104rpx; border-radius: 52rpx; background: #fff;
display: flex; align-items: center; justify-content: center; flex-shrink: 0;
box-shadow: 0 4rpx 14rpx rgba(0,0,0,0.1);
}
.avatar-img { width: 72rpx; height: 72rpx; }
.user-meta { flex: 1; min-width: 0; margin-left: 20rpx; }
.name-row { display: flex; align-items: center; }
.user-name { font-size: 36rpx; font-weight: 700; color: #fff; }
.auth-tag {
margin-left: 12rpx; display: flex; align-items: center; padding: 2rpx 12rpx;
border-radius: 8rpx; background: rgba(255,255,255,0.22);
}
.auth-ico { width: 20rpx; height: 20rpx; margin-right: 6rpx; }
.auth-txt { font-size: 18rpx; color: #fff; font-weight: 600; }
.user-level { margin-top: 8rpx; font-size: 22rpx; color: rgba(255,255,255,0.92); }
.status-pill {
display: flex; align-items: center; padding: 0 22rpx; height: 54rpx;
border-radius: 27rpx; background: #fff; box-shadow: 0 4rpx 12rpx rgba(0,0,0,0.08);
}
.status-pill.off { background: rgba(255,255,255,0.35); }
.status-dot { width: 12rpx; height: 12rpx; border-radius: 50%; background: #2FA84F; margin-right: 8rpx; }
.status-pill.off .status-dot { background: #E8331B; }
.status-txt { font-size: 22rpx; font-weight: 600; color: #E36B0C; }
.status-pill.off .status-txt { color: #fff; }
/* 资产大卡 */
.assets-box {
position: relative; margin-top: 30rpx; padding: 24rpx 24rpx 20rpx;
border-radius: 20rpx; background: rgba(255,255,255,0.18);
backdrop-filter: blur(10px);
}
.asset-top { display: flex; align-items: center; justify-content: space-between; }
.asset-title { font-size: 24rpx; color: rgba(255,255,255,0.9); }
.bill-link { display: flex; align-items: center; }
.bill-txt { font-size: 22rpx; color: #fff; font-weight: 500; }
.arrow-ico { width: 22rpx; height: 22rpx; margin-left: 4rpx; }
.asset-main { display: flex; align-items: baseline; justify-content: space-between; margin-top: 10rpx; }
.asset-val { font-size: 56rpx; font-weight: 700; color: #fff; line-height: 1.1; }
.withdraw-btn {
padding: 0 32rpx; height: 56rpx; line-height: 56rpx; border-radius: 28rpx;
background: #fff; color: #E36B0C; font-size: 24rpx; font-weight: 700;
box-shadow: 0 4rpx 12rpx rgba(0,0,0,0.08);
}
.asset-sub { display: flex; align-items: center; margin-top: 14rpx; padding-top: 14rpx; border-top: 1rpx solid rgba(255,255,255,0.22); }
.sub-item { font-size: 22rpx; color: rgba(255,255,255,0.9); }
.sub-divider { margin: 0 16rpx; font-size: 18rpx; color: rgba(255,255,255,0.5); }
/* 菜单组 */
.menu-card {
margin: 20rpx 24rpx 0; background: #fff; border-radius: 20rpx;
box-shadow: 0 6rpx 20rpx rgba(240,129,31,.06); overflow: hidden;
}
.menu-item {
display: flex; align-items: center; justify-content: space-between;
padding: 28rpx 24rpx; border-bottom: 1rpx solid #F5F5F5;
}
.menu-item:last-child { border-bottom: none; }
.mi-left { display: flex; align-items: center; }
.mi-ico { width: 40rpx; height: 40rpx; margin-right: 18rpx; flex-shrink: 0; }
.mi-title { font-size: 28rpx; font-weight: 600; color: #2C2C2E; }
.mi-right { display: flex; align-items: center; }
.mi-badge {
padding: 2rpx 14rpx; border-radius: 14rpx; background: #FDEEEB;
color: #E8331B; font-size: 20rpx; font-weight: 600; margin-right: 8rpx;
}
.mi-tip { font-size: 24rpx; color: #9A9A9A; margin-right: 8rpx; }
.mi-arrow { width: 24rpx; height: 24rpx; }
/* 类目卡片 */
.card {
margin: 20rpx 24rpx 0; padding: 24rpx; background: #fff; border-radius: 20rpx;
box-shadow: 0 6rpx 20rpx rgba(240,129,31,.06);
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14rpx; }
.card-title { font-size: 28rpx; font-weight: 700; color: #1F1F1F; }
.card-tip { font-size: 22rpx; color: #9A9A9A; }
.skills-box { display: flex; flex-wrap: wrap; }
.skill-tag {
padding: 0 22rpx; line-height: 52rpx; margin: 0 12rpx 12rpx 0;
border-radius: 26rpx; background: #FFF3E6; color: #C4580A; font-size: 22rpx; font-weight: 500;
}
.skill-tag.empty { background: #F5F5F5; color: #9A9A9A; }
/* 切换业主角色卡片 */
.switch-role-card {
margin: 24rpx 24rpx 0; padding: 24rpx; background: #fff; border-radius: 20rpx;
display: flex; align-items: center; justify-content: space-between;
box-shadow: 0 6rpx 20rpx rgba(240,129,31,.06);
}
.src-left { display: flex; align-items: center; }
.src-ico { width: 44rpx; height: 44rpx; margin-right: 18rpx; flex-shrink: 0; }
.src-text { display: flex; flex-direction: column; }
.src-title { font-size: 28rpx; font-weight: 700; color: #1F1F1F; }
.src-desc { margin-top: 4rpx; font-size: 22rpx; color: #8E8E93; }
.src-arrow { width: 28rpx; height: 28rpx; }
.clickable-hover:active { opacity: 0.85; transform: scale(0.98); }
</style>