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

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

查看文件

@@ -1,6 +1,5 @@
<template>
<view class="message-view">
<!-- 统一顶部橙色导航栏 -->
<YjyfNavBar theme="orange" title="消息中心" />
<view class="head">
@@ -10,17 +9,45 @@
<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>
<YjyfRefreshScroll
class="msg-scroll"
theme="light"
:refresh-task="load"
>
<view class="list">
<view class="msg clickable-hover" :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>
<view class="go-row" v-if="m.order_id">
<text class="go">查看工单详情</text>
<image class="go-arrow" src="/static/icons/arrow-right.svg" mode="aspectFit" />
</view>
</view>
<view class="empty-box" v-if="!loading && !list.length">
<image class="empty-img" src="/static/icons/empty-message.svg" mode="aspectFit" />
<text class="empty-txt">暂无消息通知</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>
</YjyfRefreshScroll>
<!-- 系统通知详情抽屉 -->
<view class="detail-mask" v-if="activeMsg" @tap="activeMsg = null">
<view class="detail-sheet" @tap.stop>
<view class="ds-head">
<text class="ds-title">{{ activeMsg.title }}</text>
<view class="ds-close clickable-hover" @tap="activeMsg = null">
<image class="ds-close-ico" src="/static/icons/close.svg" mode="aspectFit" />
</view>
</view>
<text class="ds-time">{{ activeMsg.time_text }}</text>
<text class="ds-content">{{ activeMsg.content }}</text>
<view class="ds-btn clickable-hover" @tap="activeMsg = null">我知道了</view>
</view>
</view>
</view>
</template>
@@ -30,16 +57,18 @@
import api from '@/utils/api.js';
import { isLogin, toLogin } from '@/utils/request.js';
import YjyfNavBar from '@/components/YjyfNavBar.vue';
import YjyfRefreshScroll from '@/components/YjyfRefreshScroll.vue';
const emit = defineEmits(['switch-tab']);
const list = ref([]);
const loading = ref(false);
const category = ref('all');
const activeMsg = ref(null);
const cats = [
{ key: 'all', name: '全部' },
{ key: 'order', name: '订单' },
{ key: 'order', name: '工单' },
{ key: 'system', name: '系统' },
{ key: 'remind', name: '提醒' }
];
@@ -48,7 +77,7 @@
if (!isLogin()) { toLogin(); return; }
loading.value = true;
try {
const res = await api.messageList({ category: category.value, limit: 30 });
const res = await api.messageList({ type: 'master', category: category.value, limit: 30 });
list.value = res.list || [];
} catch (e) {
} finally {
@@ -61,24 +90,39 @@
load();
}
const readingAll = ref(false);
async function open(m) {
if (!m.is_read) {
if (!m.is_read && !m._reading) {
m._reading = true;
try {
await api.messageRead({ id: m.id });
await api.messageRead({ id: m.id, type: 'master' });
m.is_read = 1;
} catch (e) {}
uni.$emit('yjyf:unreadChanged');
} catch (e) {
} finally {
m._reading = false;
}
}
if (m.order_id) {
emit('switch-tab', 1);
uni.navigateTo({ url: `/pages/master/detail?id=${m.order_id}` });
} else {
activeMsg.value = m;
}
}
async function readAll() {
if (readingAll.value) return;
readingAll.value = true;
try {
const res = await api.messageReadAll({});
uni.showToast({ title: '已全部标记已读(' + res.count + ' 条)', icon: 'none' });
load();
} catch (e) {}
const res = await api.messageReadAll({ type: 'master' });
uni.showToast({ title: '已全部标记已读(' + (res.count || 0) + ' 条)', icon: 'none' });
uni.$emit('yjyf:unreadChanged');
await load();
} catch (e) {
} finally {
readingAll.value = false;
}
}
onMounted(() => {
@@ -90,22 +134,118 @@
});
</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; }
<style lang="scss" scoped>
.message-view {
height: calc(100vh - 112rpx - constant(safe-area-inset-bottom));
height: calc(100vh - 112rpx - env(safe-area-inset-bottom));
display: flex;
flex-direction: column;
overflow: hidden;
background: $yjyf-bg-page;
}
.head {
flex-shrink: 0;
position: relative;
z-index: 2;
display: flex;
align-items: center;
background: $yjyf-bg-card;
padding: 20rpx $yjyf-space-md;
border-bottom: 1rpx solid $yjyf-border-color;
}
.msg-scroll { flex: 1; height: 0; width: 100%; }
.cats { flex: 1; display: flex; gap: 14rpx; }
.cat {
padding: 0 24rpx;
height: 56rpx;
line-height: 56rpx;
border-radius: $yjyf-radius-pill;
background: $yjyf-bg-page;
font-size: $yjyf-font-sub;
color: $yjyf-text-regular;
}
.cat.on {
background: $yjyf-primary-bg;
color: $yjyf-primary;
font-weight: 600;
}
.read-all { font-size: $yjyf-font-sub; color: $yjyf-primary; font-weight: 500; }
.list { padding: $yjyf-space-md; }
.msg {
background: $yjyf-bg-card;
border-radius: $yjyf-radius-md;
padding: $yjyf-space-md;
margin-bottom: 20rpx;
box-shadow: $yjyf-shadow-card;
}
.msg.unread { border-left: 6rpx solid $yjyf-primary; }
.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); }
.dot { width: 14rpx; height: 14rpx; border-radius: 50%; background: $yjyf-primary; margin-right: 12rpx; flex-shrink: 0; }
.title { flex: 1; min-width: 0; font-size: $yjyf-font-body; font-weight: 700; color: $yjyf-text-main; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.time { flex-shrink: 0; margin-left: 12rpx; font-size: $yjyf-font-micro; color: $yjyf-text-muted; }
.content {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
margin-top: 12rpx;
font-size: $yjyf-font-sub;
color: $yjyf-text-regular;
line-height: 1.5;
}
.go-row {
margin-top: 16rpx;
padding-top: 14rpx;
border-top: 1rpx solid $yjyf-border-color;
display: flex;
align-items: center;
justify-content: space-between;
}
.go { font-size: $yjyf-font-sub; color: $yjyf-primary; font-weight: 500; }
.go-arrow { width: 26rpx; height: 26rpx; opacity: 0.6; }
.empty-box {
padding: 140rpx 0;
display: flex;
flex-direction: column;
align-items: center;
}
.empty-img { width: 160rpx; height: 160rpx; margin-bottom: 20rpx; }
.empty-txt { font-size: $yjyf-font-sub; color: $yjyf-text-secondary; }
.detail-mask {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.55);
z-index: 1000;
display: flex;
flex-direction: column;
justify-content: flex-end;
}
.detail-sheet {
background: $yjyf-bg-card;
border-radius: $yjyf-radius-lg $yjyf-radius-lg 0 0;
padding: 36rpx $yjyf-space-lg calc(36rpx + env(safe-area-inset-bottom));
}
.ds-head { display: flex; align-items: center; justify-content: space-between; gap: 16rpx; }
.ds-title { flex: 1; font-size: $yjyf-font-title; font-weight: 700; color: $yjyf-text-main; }
.ds-close { width: 56rpx; height: 56rpx; display: flex; align-items: center; justify-content: flex-end; }
.ds-close-ico { width: 32rpx; height: 32rpx; opacity: 0.65; }
.ds-time { display: block; margin-top: 10rpx; font-size: $yjyf-font-micro; color: $yjyf-text-muted; }
.ds-content { display: block; margin: 28rpx 0 40rpx; font-size: $yjyf-font-body; color: $yjyf-text-regular; line-height: 1.65; white-space: pre-wrap; }
.ds-btn {
height: 88rpx;
border-radius: $yjyf-radius-pill;
background: $yjyf-gradient-primary;
color: #FFFFFF;
font-size: $yjyf-font-body;
font-weight: 600;
display: flex;
align-items: center;
justify-content: center;
}
.clickable-hover:active { opacity: 0.85; }
</style>