feat: 新增发票抬头、晒单、钱包日志等模型及后台管理功能

- 新增 invoice_title、showcase、wallet_log 模型及对应语言包
- 新增后台控制器、视图及搜索字段配置
- 修复服务类目删除保护逻辑
- 优化后台登录页面文案及样式
- 新增前端角色切换逻辑及页面拦截
- 新增 SVG 图标及样式变量
- 修复接口权限及下拉框默认值问题
这个提交包含在:
2026-11-11 17:02:35 +08:00
父节点 5908cf6b16
当前提交 fafddceaf2
共有 332 个文件被更改,包括 33892 次插入 和 8835 次删除

查看文件

@@ -3,8 +3,15 @@
<!-- 1. 顶部统一固定吸顶导航栏(与其他页面 100% 统一,固定在手机顶部不随滚动划出) -->
<YjyfNavBar theme="orange" title="抢单大厅" :fixed="true" :placeholder="true" />
<YjyfRefreshScroll
class="hall-scroll"
theme="orange"
:nav-offset="stickyTop"
:refresh-task="load"
@scrolltolower="loadMore"
>
<!-- 师傅状态与听单控制台(与顶部导航栏共享连续渐变零断层接壤) -->
<view class="hall-hero" :style="{ marginTop: (-stickyTop) + 'px', paddingTop: stickyTop + 'px' }">
<view class="hall-hero" :style="{ backgroundPosition: '0 -' + stickyTop + 'px' }">
<view class="hall-header-body">
<view class="header-main">
<view class="h-user">
@@ -32,13 +39,15 @@
<view class="hq-item clickable-hover" @tap="goSkills">
<image class="hq-ico" src="/static/icons/master/hall-skill-setting.svg" mode="aspectFit" />
<text class="hq-txt">接单技能:已认证 {{ skillsCount }} 项</text>
<text class="hq-link">设置 ›</text>
<text class="hq-link">设置</text>
<image class="hq-arrow" src="/static/icons/arrow-right-white.svg" mode="aspectFit" />
</view>
<view class="hq-divider"></view>
<view class="hq-item clickable-hover" @tap="goMyOrders">
<text class="hq-txt">待处理工单:</text>
<text class="hq-num">{{ info.todo_count || 0 }}</text>
<text class="hq-link">去履约 ›</text>
<text class="hq-link">去履约</text>
<image class="hq-arrow" src="/static/icons/arrow-right-white.svg" mode="aspectFit" />
</view>
</view>
</view>
@@ -55,7 +64,7 @@
</view>
<!-- 3. 吸顶双层筛选与排序导航栏 -->
<view class="filter-sticky" :style="{ top: stickyTop + 'px' }">
<view class="filter-sticky">
<view class="type-tabs">
<view
v-for="t in typeTabs"
@@ -121,8 +130,8 @@
<view class="hd-right">
<template v-if="o.price_type === 'quote'">
<text class="quote-slogan">报价快,中选高</text>
<text class="quote-label">师傅竞价</text>
<text class="quote-slogan">开放竞价</text>
<text class="quote-label">师傅报价</text>
</template>
<template v-else>
<text class="price-mode-tag" :class="o.price_type">{{ o.price_type === 'custom' ? '用户定价' : '一口价' }}</text>
@@ -207,6 +216,9 @@
</view>
</view>
</view>
<view class="list-foot-tip">
<text class="foot-tip-txt">{{ loadingMore ? '正在加载更多工单...' : (hasMore ? '上滑加载更多工单' : '已展示全部待接工单') }}</text>
</view>
</view>
<!-- 6. 友好空状态 -->
@@ -219,6 +231,7 @@
<view class="skill-cta clickable-hover" @tap="goSkills">扩展接单技能</view>
</view>
</view>
</YjyfRefreshScroll>
<!-- 7. 抢单防误点二次确认弹窗 -->
<view class="confirm-mask" v-if="selectedOrder" @tap="selectedOrder = null">
@@ -249,6 +262,7 @@
import { isLogin, toLogin } from '@/utils/request.js';
import { getNavBarMetrics } from '@/utils/system.js';
import YjyfNavBar from '@/components/YjyfNavBar.vue';
import YjyfRefreshScroll from '@/components/YjyfRefreshScroll.vue';
const stickyTop = ref(getNavBarMetrics().totalNavHeight);
@@ -257,6 +271,10 @@
const skillsCount = ref(0);
const counts = ref({ all: 0, fixed: 0, quote: 0, custom: 0 });
const loading = ref(false);
const loadingMore = ref(false);
const page = ref(1);
const hasMore = ref(false);
const coords = ref({ lat: '', lng: '' });
const type = ref('all');
const sort = ref('new');
const selectedOrder = ref(null);
@@ -282,7 +300,8 @@
return list.value.slice(0, 6).map((o) => {
const region = o.district || o.city || '同城';
const priceDesc = o.price_type === 'quote' ? '开放竞价中' : `工费 ¥${o.pay_amount}`;
return `${region}业主发布【${o.service_name}】工单,${priceDesc},距离 ${o.distance_text || '附近'}`;
const distPart = o.distance_text ? `,距离 ${o.distance_text}` : '';
return `${region}业主发布【${o.service_name}】工单,${priceDesc}${distPart}`;
});
});
@@ -341,30 +360,51 @@
selectedOrder.value = null;
uni.showToast({ title: '抢单成功!', icon: 'success' });
setTimeout(() => {
grabbing.value = false;
uni.navigateTo({
url: `/pages/master/success?order_id=${o.id}&mobile=${res.user_mobile || ''}`
});
}, 450);
} catch (e) {
uni.showToast({ title: e.msg || '手慢了,该订单已被接走', icon: 'none' });
} finally {
grabbing.value = false;
uni.showToast({ title: e.msg || '手慢了,该订单已被接走', icon: 'none' });
}
}
function tryUpdateLocation() {
try {
uni.getLocation({
type: 'gcj02',
success: (pos) => {
if (pos && pos.latitude && pos.longitude) {
coords.value = { lat: pos.latitude, lng: pos.longitude };
}
},
fail: () => {}
});
} catch (e) {}
}
async function load() {
if (!isLogin()) {
toLogin();
return;
}
loading.value = true;
page.value = 1;
try {
const params = { page: 1, limit: 20, type: type.value, sort: sort.value };
if (coords.value.lat && coords.value.lng) {
params.lat = coords.value.lat;
params.lng = coords.value.lng;
}
const [hallRes, meRes] = await Promise.all([
api.masterHall({ limit: 20, type: type.value, sort: sort.value }),
api.masterHall(params),
api.masterInfo()
]);
if (hallRes) {
list.value = hallRes.list || [];
hasMore.value = !!hallRes.has_more;
if (hallRes.counts) {
counts.value = hallRes.counts;
}
@@ -379,18 +419,48 @@
}
}
async function loadMore() {
if (loading.value || loadingMore.value || !hasMore.value) return;
loadingMore.value = true;
const nextPage = page.value + 1;
try {
const params = { page: nextPage, limit: 20, type: type.value, sort: sort.value };
if (coords.value.lat && coords.value.lng) {
params.lat = coords.value.lat;
params.lng = coords.value.lng;
}
const hallRes = await api.masterHall(params);
if (hallRes) {
const rows = hallRes.list || [];
list.value = list.value.concat(rows);
page.value = nextPage;
hasMore.value = !!hallRes.has_more;
}
} catch (e) {
} finally {
loadingMore.value = false;
}
}
const togglingWork = ref(false);
async function toggleWork() {
if (!info.value) return;
if (!info.value || togglingWork.value) return;
togglingWork.value = true;
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) {}
} catch (e) {
} finally {
togglingWork.value = false;
}
}
onMounted(() => {
stickyTop.value = getNavBarMetrics().totalNavHeight;
tryUpdateLocation();
load();
});
@@ -401,11 +471,20 @@
<style scoped>
.hall-view {
min-height: 100vh;
height: calc(100vh - 104rpx - constant(safe-area-inset-bottom));
height: calc(100vh - 104rpx - env(safe-area-inset-bottom));
display: flex;
flex-direction: column;
overflow: hidden;
width: 100%;
box-sizing: border-box;
background: #F5F6F8;
padding-bottom: 32rpx;
}
.hall-scroll {
flex: 1;
height: 0;
width: 100%;
}
/* 1. 顶部沉浸式师傅状态区(标准 135deg 橙色渐变,与 TopBar 共享连续渐变起点) */
@@ -563,6 +642,12 @@
white-space: nowrap;
line-height: 1;
}
.hq-arrow {
width: 20rpx;
height: 20rpx;
margin-left: 4rpx;
flex-shrink: 0;
}
.hq-divider {
width: 1rpx;
height: 28rpx;
@@ -769,7 +854,15 @@
/* 5. 抢单卡片列表 */
.list {
padding: 20rpx 24rpx;
padding: 20rpx 24rpx 32rpx;
}
.list-foot-tip {
padding: 12rpx 0 24rpx;
text-align: center;
}
.foot-tip-txt {
font-size: 22rpx;
color: #AAAAAA;
}
.order-card {
background: #FFFFFF;