1. 账号体系与数据库解耦: - 师傅表 fa_master 解除对 fa_user.id 的外键依赖,升级为独立认证账号主表; - 新增师傅端独立支撑表:fa_master_security、fa_master_token、fa_master_wechat、fa_master_agreement_read; - 新增工单超时未接单自动关闭与原路退款配置(order_unaccepted_close_days)。 2. 服务端(Server): - 新增师傅端独立 API 控制器与认证库(MasterAuth, MasterBase, MasterMessage, MasterSecurity, MasterToken); - WxLogin 支持双小程序端(user/master)独立换取 session_key、openid 与 access_token; - 新增控制台调度命令 php think order:autoclose,支持订单超时自动关闭与售后退款闭环; - 修复 PHP 8.5 兼容性问题(Request.php 的 (bool) 强制转换); - 系统业务配置全面收敛至数据库 fa_config 及 site.php。 3. 小程序端: - yjyf-app(用户端):彻底剥离师傅端路由、组件及静态资源,增加隐私授权弹窗与评价模块; - yjyf-master-app(师傅端):全新独立微信小程序工程(wx140d90ceda786107),实现工作台、接单大厅、资质认证、工单协同与钱包提现完整闭环。
116 行
3.3 KiB
Vue
116 行
3.3 KiB
Vue
<template>
|
||
<view class="master-container-page">
|
||
<!-- 1. 抢单大厅 (Tab 0) -->
|
||
<view class="tab-pane" v-if="visitedTabs[0]" v-show="activeTab === 0">
|
||
<MasterHallView ref="hallRef" @switch-tab="onTabChange" />
|
||
</view>
|
||
|
||
<!-- 2. 我的工单 (Tab 1) -->
|
||
<view class="tab-pane" v-if="visitedTabs[1]" v-show="activeTab === 1">
|
||
<MasterOrdersView ref="ordersRef" :in-container="true" @switch-tab="onTabChange" />
|
||
</view>
|
||
|
||
<!-- 3. 消息 (Tab 2) -->
|
||
<view class="tab-pane" v-if="visitedTabs[2]" v-show="activeTab === 2">
|
||
<MasterMessageView ref="messageRef" @switch-tab="onTabChange" />
|
||
</view>
|
||
|
||
<!-- 4. 工作台 (Tab 3) -->
|
||
<view class="tab-pane" v-if="visitedTabs[3]" v-show="activeTab === 3">
|
||
<MasterWorkbenchView ref="workbenchRef" :in-container="true" @switch-tab="onTabChange" />
|
||
</view>
|
||
|
||
<!-- 全局统一师傅端底部导航(单母页组件化调度,0ms 极速秒切不闪烁) -->
|
||
<YjyfMasterTabBar :current="activeTab" :standalone="false" @change="onTabChange" />
|
||
<YjyfPrivacyPopup />
|
||
</view>
|
||
</template>
|
||
|
||
<script setup>
|
||
import { ref, reactive } from 'vue';
|
||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||
import MasterHallView from '@/components/master/MasterHallView.vue';
|
||
import MasterOrdersView from '@/components/master/MasterOrdersView.vue';
|
||
import MasterMessageView from '@/components/master/MasterMessageView.vue';
|
||
import MasterWorkbenchView from '@/components/master/MasterWorkbenchView.vue';
|
||
import YjyfMasterTabBar from '@/components/YjyfMasterTabBar.vue';
|
||
import YjyfPrivacyPopup from '@/components/YjyfPrivacyPopup.vue';
|
||
import { useShare } from '@/utils/share.js';
|
||
|
||
const activeTab = ref(0);
|
||
const visitedTabs = reactive({ 0: true, 1: false, 2: false, 3: false });
|
||
let initialShown = false;
|
||
|
||
const hallRef = ref(null);
|
||
const ordersRef = ref(null);
|
||
const messageRef = ref(null);
|
||
const workbenchRef = ref(null);
|
||
|
||
useShare(() => ({
|
||
title: '优匠优服 · 师傅接单大厅,海量同城好单实时派发',
|
||
path: '/pages/master/hall',
|
||
query: ''
|
||
}));
|
||
|
||
function refreshCurrentTab() {
|
||
if (activeTab.value === 0 && hallRef.value?.load) {
|
||
hallRef.value.load();
|
||
} else if (activeTab.value === 1 && ordersRef.value?.load) {
|
||
ordersRef.value.load();
|
||
} else if (activeTab.value === 2 && messageRef.value?.load) {
|
||
messageRef.value.load();
|
||
} else if (activeTab.value === 3 && workbenchRef.value?.load) {
|
||
workbenchRef.value.load();
|
||
}
|
||
}
|
||
|
||
function onTabChange(index) {
|
||
const targetIndex = Number(index);
|
||
if (isNaN(targetIndex) || targetIndex < 0 || targetIndex > 3) return;
|
||
if (activeTab.value === targetIndex) return;
|
||
const firstVisit = !visitedTabs[targetIndex];
|
||
visitedTabs[targetIndex] = true;
|
||
activeTab.value = targetIndex;
|
||
if (!firstVisit) {
|
||
setTimeout(() => {
|
||
refreshCurrentTab();
|
||
}, 0);
|
||
}
|
||
}
|
||
|
||
onLoad((query) => {
|
||
if (query && query.tab !== undefined) {
|
||
const t = parseInt(query.tab);
|
||
if (!isNaN(t) && t >= 0 && t <= 3) {
|
||
if (t !== 0) {
|
||
visitedTabs[0] = false;
|
||
}
|
||
visitedTabs[t] = true;
|
||
activeTab.value = t;
|
||
}
|
||
}
|
||
});
|
||
|
||
onShow(() => {
|
||
if (!initialShown) {
|
||
initialShown = true;
|
||
return;
|
||
}
|
||
refreshCurrentTab();
|
||
uni.$emit('yjyf:refreshUnread');
|
||
});
|
||
</script>
|
||
|
||
<style scoped>
|
||
.master-container-page {
|
||
height: 100vh;
|
||
overflow: hidden;
|
||
background: #F5F6F8;
|
||
}
|
||
|
||
.tab-pane {
|
||
width: 100%;
|
||
height: 100%;
|
||
}
|
||
</style>
|