chore: 移除废弃的增项服务模块并升级服务架构
- 删除 Addon 相关控制器、模型、语言包和视图文件 - 新增服务类型支持一口价属性配置 - 新增系统监控、用户资料、订单评价等后端管理页面 - 新增数据库表结构及索引优化脚本 - 更新应用版本号至 1.0.44 - 更新小程序应用标识 - 完善 .gitignore 配置
这个提交包含在:
@@ -224,13 +224,18 @@
|
||||
const goods = currentGoods.value;
|
||||
if (!goods) return;
|
||||
const gBase = Number(goods.base_price) || 0;
|
||||
const sBase = Number(spec.base_price) || gBase;
|
||||
const ratio = gBase > 0 && sBase > 0 ? sBase / gBase : 1;
|
||||
const scaledTypes = (goods.service_types || []).map(st => ({
|
||||
...st,
|
||||
price: st.price > 0 ? Math.round(Number(st.price) * ratio) : 0
|
||||
}));
|
||||
const defType = scaledTypes.find(st => st.is_default) || scaledTypes[0] || { code: 'install', name: '安装' };
|
||||
const hasCustomSpecPrice = Number(spec.base_price) > 0;
|
||||
const sBase = hasCustomSpecPrice ? Number(spec.base_price) : gBase;
|
||||
const rawTypes = goods.service_types || [];
|
||||
const hasExplicitDefault = rawTypes.some(x => Number(x.is_default) === 1);
|
||||
const resolvedTypes = rawTypes.map((st, idx) => {
|
||||
const isDef = Number(st.is_default) === 1 || (!hasExplicitDefault && idx === 0);
|
||||
return {
|
||||
...st,
|
||||
price: (isDef && hasCustomSpecPrice) ? sBase : (Number(st.price) || 0)
|
||||
};
|
||||
});
|
||||
const defType = resolvedTypes.find(st => Number(st.is_default) === 1) || resolvedTypes[0] || { code: 'install', name: '安装', price: sBase };
|
||||
emit('select', {
|
||||
service_id: goods.id,
|
||||
item_name: goods.name,
|
||||
@@ -239,10 +244,10 @@
|
||||
cat_id: goods.cat_id || props.catId,
|
||||
cat_name: props.catName || '',
|
||||
unit: goods.unit || '件',
|
||||
base_price: sBase,
|
||||
base_price: Number(defType.price) || sBase,
|
||||
price_type: goods.price_type || 'fixed',
|
||||
description: spec.description || goods.description || '',
|
||||
service_types: scaledTypes,
|
||||
service_types: resolvedTypes,
|
||||
addons: goods.addons || [],
|
||||
default_service_type: defType.code,
|
||||
default_service_name: defType.name
|
||||
|
||||
在新工单中引用
屏蔽一个用户