feat: 重构后台服务字典与商品独立定价体系及前后端交互优化

这个提交包含在:
2026-11-10 11:01:05 +08:00
父节点 3ebd795cbb
当前提交 e2b0044b64
共有 66 个文件被更改,包括 6628 次插入 和 2137 次删除

查看文件

@@ -1,7 +1,7 @@
<template>
<view class="drawer-mask" v-if="visible" @tap="close">
<view class="drawer-sheet" @tap.stop>
<!-- 标题栏(对标 frame_005:左标题 + 右侧叉 + 底部分割线) -->
<!-- 标题栏(1:1 复刻视频 00:06 & 00:17:左标题 + 右侧叉 + 底部分割线) -->
<view class="drawer-head">
<text class="dh-title">增项服务</text>
<view class="dh-close clickable-hover" @tap="close">
@@ -9,12 +9,17 @@
</view>
</view>
<!-- 增项列表(1:1 复刻 frame_005:左侧工序名+浅灰单价小签,右侧方形步进器) -->
<!-- 增项列表(1:1 复刻视频 00:06 报价模式无价格标签 / 00:17 一口价模式显示 50元/份) -->
<scroll-view class="drawer-body" scroll-y="true">
<view class="addon-row" v-for="(item, idx) in localList" :key="item.key || idx">
<view class="ac-left">
<view
class="addon-row"
:class="{ active: (item.num || 0) > 0 }"
v-for="(item, idx) in localList"
:key="item.key || idx"
>
<view class="ac-left clickable-hover" @tap="toggleQuickSelect(idx)">
<text class="ac-name">{{ item.name }}</text>
<view class="ac-price-tag" v-if="Number(item.price) > 0">
<view class="ac-price-tag" v-if="showPrice && Number(item.price) > 0">
<text class="apt-txt">{{ item.price }}元/{{ item.unit || '份' }}</text>
</view>
</view>
@@ -51,7 +56,8 @@
const props = defineProps({
visible: { type: Boolean, default: false },
list: { type: Array, default: () => [] }
list: { type: Array, default: () => [] },
showPrice: { type: Boolean, default: true }
});
const emit = defineEmits(['update:visible', 'confirm']);
@@ -71,6 +77,22 @@
target.num = next;
}
function toggleQuickSelect(idx) {
const target = localList.value[idx];
if (!target) return;
target.num = (target.num || 0) > 0 ? 0 : 1;
}
function showHelpTip() {
uni.showModal({
title: '增项服务说明',
content: '增项服务列表会根据您所选的具体商品自动匹配对应的拆旧、打孔、加固、配件等附加项目。点击项目名称可快速选中1份,也可通过右侧加减号调整数量。',
showCancel: false,
confirmText: '我知道了',
confirmColor: '#F0710D'
});
}
function close() {
emit('update:visible', false);
}
@@ -122,12 +144,31 @@
border-bottom: 1rpx solid #F0F0F2;
}
.dh-left {
display: flex;
align-items: center;
gap: 12rpx;
}
.dh-title {
font-size: 32rpx;
font-weight: 500;
color: #1F1F1F;
}
.dh-help {
width: 44rpx;
height: 44rpx;
display: flex;
align-items: center;
justify-content: center;
}
.dh-help-img {
width: 34rpx;
height: 34rpx;
}
.dh-close {
width: 56rpx;
height: 56rpx;
@@ -154,9 +195,16 @@
align-items: center;
justify-content: space-between;
padding: 22rpx 0;
border-bottom: 1rpx solid #F7F7F9;
}
.addon-row:last-child {
border-bottom: none;
}
.ac-left {
flex: 1;
padding-right: 20rpx;
display: flex;
flex-direction: column;
align-items: flex-start;
@@ -167,6 +215,11 @@
font-size: 30rpx;
font-weight: 500;
color: #1F1F1F;
transition: color 0.15s;
}
.addon-row.active .ac-name {
color: #F0710D;
}
.ac-price-tag {
@@ -176,6 +229,11 @@
display: inline-flex;
align-items: center;
justify-content: center;
transition: all 0.15s;
}
.addon-row.active .ac-price-tag {
background: #FFF7F0;
}
.apt-txt {
@@ -184,6 +242,10 @@
line-height: 1;
}
.addon-row.active .apt-txt {
color: #F0710D;
}
.ac-stepper {
display: flex;
align-items: center;
@@ -191,6 +253,11 @@
border-radius: 4rpx;
background: #FFFFFF;
overflow: hidden;
transition: border-color 0.15s;
}
.addon-row.active .ac-stepper {
border-color: #F0710D;
}
.step-btn {