feat: 新增发票抬头、晒单、钱包日志等模型及后台管理功能
- 新增 invoice_title、showcase、wallet_log 模型及对应语言包 - 新增后台控制器、视图及搜索字段配置 - 修复服务类目删除保护逻辑 - 优化后台登录页面文案及样式 - 新增前端角色切换逻辑及页面拦截 - 新增 SVG 图标及样式变量 - 修复接口权限及下拉框默认值问题
这个提交包含在:
@@ -3,12 +3,18 @@
|
||||
<!-- 1. 顶部统一固定吸顶导航栏(与其他页面 100% 统一,固定在手机顶部不随滚动划出) -->
|
||||
<YjyfNavBar theme="orange" title="师傅工作台" :fixed="true" :placeholder="true" />
|
||||
|
||||
<YjyfRefreshScroll
|
||||
class="workbench-scroll"
|
||||
theme="orange"
|
||||
:nav-offset="navHeight"
|
||||
:refresh-task="load"
|
||||
>
|
||||
<!-- 师傅顶部名片区(与顶部导航栏共享连续渐变零断层接壤) -->
|
||||
<view class="profile-hero" :style="{ marginTop: (-navHeight) + 'px', paddingTop: navHeight + 'px' }">
|
||||
<view class="profile-hero" :style="{ backgroundPosition: '0 -' + navHeight + 'px' }">
|
||||
<view class="hero-body">
|
||||
<view class="user-block">
|
||||
<view class="avatar-wrap">
|
||||
<image class="avatar-img" src="/static/icons/user-avatar.svg" mode="aspectFit" />
|
||||
<image class="avatar-img" src="/static/icons/avatar-master.svg" mode="aspectFit" />
|
||||
</view>
|
||||
<view class="user-meta">
|
||||
<view class="name-row">
|
||||
@@ -74,6 +80,17 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="menu-item clickable-hover" @tap="go('/pages/master/reviews')">
|
||||
<view class="mi-left">
|
||||
<image class="mi-ico" src="/static/icons/master/menu-review.svg" mode="aspectFit" />
|
||||
<text class="mi-title">客户评价管理</text>
|
||||
</view>
|
||||
<view class="mi-right">
|
||||
<text class="mi-tip" v-if="credit">{{ credit.review_total || 0 }} 条评价</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" />
|
||||
@@ -91,7 +108,7 @@
|
||||
<text class="mi-title">联系平台客服</text>
|
||||
</view>
|
||||
<view class="mi-right">
|
||||
<text class="mi-tip">4000000000</text>
|
||||
<text class="mi-tip">{{ servicePhone || '在线咨询' }}</text>
|
||||
<image class="mi-arrow" src="/static/icons/arrow-right.svg" mode="aspectFit" />
|
||||
</view>
|
||||
</view>
|
||||
@@ -101,9 +118,10 @@
|
||||
<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;">
|
||||
<view class="card-edit-action">
|
||||
<text class="card-tip">{{ skills.length }} 项技能</text>
|
||||
<text style="font-size: 24rpx; color: #EA580C; font-weight: 600;">修改 ›</text>
|
||||
<text class="card-edit-txt">修改</text>
|
||||
<image class="card-edit-arrow" src="/static/icons/arrow-right-orange.svg" mode="aspectFit" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="skills-box" @tap="goSkills">
|
||||
@@ -123,6 +141,7 @@
|
||||
</view>
|
||||
<image class="src-arrow" src="/static/icons/arrow-right-orange.svg" mode="aspectFit" />
|
||||
</view>
|
||||
</YjyfRefreshScroll>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -133,6 +152,7 @@
|
||||
import { setRole } from '@/utils/role.js';
|
||||
import { getNavBarMetrics } from '@/utils/system.js';
|
||||
import YjyfNavBar from '@/components/YjyfNavBar.vue';
|
||||
import YjyfRefreshScroll from '@/components/YjyfRefreshScroll.vue';
|
||||
|
||||
const emit = defineEmits(['switch-tab']);
|
||||
const navHeight = ref(getNavBarMetrics().totalNavHeight);
|
||||
@@ -142,6 +162,7 @@
|
||||
const skills = ref([]);
|
||||
const todayIncome = ref('0.00');
|
||||
const totalIncome = ref('0.00');
|
||||
const servicePhone = ref(uni.getStorageSync('yjyf_service_phone') || '');
|
||||
|
||||
function go(url) {
|
||||
uni.navigateTo({ url });
|
||||
@@ -159,7 +180,7 @@
|
||||
}
|
||||
|
||||
function callService() {
|
||||
uni.makePhoneCall({ phoneNumber: '4000000000' });
|
||||
api.contactService();
|
||||
}
|
||||
|
||||
async function load() {
|
||||
@@ -185,23 +206,45 @@
|
||||
try {
|
||||
credit.value = await api.masterCredit();
|
||||
} catch (e) {}
|
||||
|
||||
if (!servicePhone.value) {
|
||||
try {
|
||||
const h = await api.home();
|
||||
if (h && h.service_phone) {
|
||||
servicePhone.value = String(h.service_phone).trim();
|
||||
uni.setStorageSync('yjyf_service_phone', servicePhone.value);
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
}
|
||||
|
||||
const togglingWork = ref(false);
|
||||
const switchingRole = 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;
|
||||
}
|
||||
}
|
||||
|
||||
function backToUser() {
|
||||
if (switchingRole.value) return;
|
||||
switchingRole.value = true;
|
||||
api.switchRole({ role: 'user' }).then((res) => {
|
||||
setRole('user');
|
||||
uni.reLaunch({ url: res.redirect || '/pages/index/index' });
|
||||
}).catch(() => {});
|
||||
setTimeout(() => { switchingRole.value = false; }, 500);
|
||||
}).catch(() => {
|
||||
switchingRole.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
@@ -216,12 +259,20 @@
|
||||
|
||||
<style scoped>
|
||||
.workbench-view {
|
||||
min-height: calc(100vh - 104rpx - env(safe-area-inset-bottom));
|
||||
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%;
|
||||
overflow-x: hidden;
|
||||
box-sizing: border-box;
|
||||
background: #F5F6F8;
|
||||
padding-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.workbench-scroll {
|
||||
flex: 1;
|
||||
height: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* 顶部名片(单一连续大渐变,与 TopBar 共享连续渐变起点) */
|
||||
@@ -317,19 +368,22 @@
|
||||
}
|
||||
.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; }
|
||||
.card-edit-action { display: flex; align-items: center; gap: 8rpx; }
|
||||
.card-tip { font-size: 22rpx; color: #888888; }
|
||||
.card-edit-txt { font-size: 24rpx; color: #F0710D; font-weight: 600; }
|
||||
.card-edit-arrow { width: 22rpx; height: 22rpx; }
|
||||
.skills-box { display: flex; flex-wrap: wrap; }
|
||||
.skill-tag {
|
||||
padding: 0 22rpx; height: 52rpx; line-height: 52rpx; text-align: center; display: inline-flex; align-items: center; justify-content: center; margin: 0 12rpx 12rpx 0;
|
||||
border-radius: 26rpx; background: #FFF3E6; color: #C4580A; font-size: 22rpx; font-weight: 500;
|
||||
border-radius: 26rpx; background: #FFF7F0; color: #F0710D; font-size: 24rpx; font-weight: 500;
|
||||
}
|
||||
.skill-tag.empty { background: #F5F5F5; color: #9A9A9A; }
|
||||
.skill-tag.empty { background: #F5F6F8; color: #888888; }
|
||||
|
||||
/* 切换业主角色卡片 */
|
||||
.switch-role-card {
|
||||
margin: 24rpx 24rpx 0; padding: 24rpx; background: #fff; border-radius: 20rpx;
|
||||
margin: 24rpx 24rpx 56rpx; padding: 24rpx; background: #FFFFFF; border-radius: 20rpx;
|
||||
display: flex; align-items: center; justify-content: space-between;
|
||||
box-shadow: 0 6rpx 20rpx rgba(240,129,31,.06);
|
||||
box-shadow: 0 6rpx 20rpx rgba(240, 113, 13, 0.06);
|
||||
}
|
||||
.src-left { display: flex; align-items: center; }
|
||||
.src-ico { width: 44rpx; height: 44rpx; margin-right: 18rpx; flex-shrink: 0; }
|
||||
|
||||
在新工单中引用
屏蔽一个用户