chore: 优化系统功能与界面体验
- 升级系统版本至1.0.100 - 新增订单详情页物流、资质等信息展示 - 优化师傅报价页收益计算与显示 - 新增企业资质管理模块 - 优化后台标签页管理与交互 - 修复标签解析与地址脱敏问题 - 优化预约时段选择逻辑 - 调整服务类型配置界面布局
这个提交包含在:
@@ -836,6 +836,8 @@ class Home extends Base
|
||||
|
||||
// 支持多商品组合与增项计算(一口价模式下强制从 fa_service 与 fa_service_spec 读取真实价格,严禁采信前端传入 base_price)
|
||||
$base = 0;
|
||||
$goodsAmount = 0.0;
|
||||
$addonAmount = 0.0;
|
||||
$pricedLines = [];
|
||||
$dictionary = null;
|
||||
if (!empty($goodsList) && is_array($goodsList)) {
|
||||
@@ -869,7 +871,13 @@ class Home extends Base
|
||||
$dictionary = $dictionary ?? ProductPricing::dictionary();
|
||||
$line = self::configuredLine($dbSvc, $config, $dictionary, $g, $isFixedLike);
|
||||
$pricedLines[$index] = $line;
|
||||
$base += $line['total_cents'] / 100;
|
||||
$lineTotal = $line['total_cents'] / 100;
|
||||
$itemNum = max(1, (int)($g['num'] ?? $g['goods_num'] ?? 1));
|
||||
$lineGoods = $isFixedLike ? round(((float)($line['base_price'] ?? 0)) * $itemNum, 2) : 0.0;
|
||||
$lineAddon = $isFixedLike ? max(0.0, round($lineTotal - $lineGoods, 2)) : 0.0;
|
||||
$goodsAmount += $lineGoods;
|
||||
$addonAmount += $lineAddon;
|
||||
$base += $lineTotal;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -973,7 +981,9 @@ class Home extends Base
|
||||
}
|
||||
|
||||
$itemNum = isset($g['num']) ? max(1, (int)$g['num']) : (isset($g['goods_num']) ? max(1, (int)$g['goods_num']) : 1);
|
||||
$base += round($itemPrice * $itemNum, 2);
|
||||
$lineGoods = round($itemPrice * $itemNum, 2);
|
||||
$goodsAmount += $lineGoods;
|
||||
$base += $lineGoods;
|
||||
$curAddonsList = !empty($g['extras']) && is_array($g['extras'])
|
||||
? $g['extras']
|
||||
: (!empty($g['addons']) && is_array($g['addons']) ? $g['addons'] : []);
|
||||
@@ -993,13 +1003,18 @@ class Home extends Base
|
||||
} elseif (!$isFixedLike && isset($ex['price'])) {
|
||||
$exPrice = max(0, (float)$ex['price']);
|
||||
}
|
||||
$base += round($exPrice * $exNum, 2);
|
||||
$lineAddon = round($exPrice * $exNum, 2);
|
||||
$addonAmount += $lineAddon;
|
||||
$base += $lineAddon;
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif ($service && ($config = ProductPricing::read($service))) {
|
||||
$pricedLines[0] = self::configuredLine($service, $config, ProductPricing::dictionary(), $params, $isFixedLike);
|
||||
$base = $pricedLines[0]['total_cents'] / 100;
|
||||
$itemNum = max(1, (int)($params['goods_num'] ?? 1));
|
||||
$goodsAmount = $isFixedLike ? round(((float)($pricedLines[0]['base_price'] ?? 0)) * $itemNum, 2) : 0.0;
|
||||
$addonAmount = $isFixedLike ? max(0.0, round($base - $goodsAmount, 2)) : 0.0;
|
||||
} elseif ($service) {
|
||||
if ($isFixedLike && $service['price_type'] === 'quote') {
|
||||
throw new \InvalidArgumentException('该服务项目不支持一口价模式,请切换为师傅报价或自主定价');
|
||||
@@ -1055,7 +1070,8 @@ class Home extends Base
|
||||
throw new \InvalidArgumentException('该服务项目暂未配置有效一口价,请切换为师傅报价或自主定价');
|
||||
}
|
||||
$goodsNum = isset($params['goods_num']) ? max(1, (int)$params['goods_num']) : 1;
|
||||
$base = round($unitPrice * $goodsNum, 2);
|
||||
$goodsAmount = round($unitPrice * $goodsNum, 2);
|
||||
$base = $goodsAmount;
|
||||
|
||||
$singleAddons = !empty($params['extras']) && is_array($params['extras'])
|
||||
? $params['extras']
|
||||
@@ -1094,7 +1110,9 @@ class Home extends Base
|
||||
} elseif (!$isFixedLike && isset($ex['price'])) {
|
||||
$exPrice = max(0, (float)$ex['price']);
|
||||
}
|
||||
$base += round($exPrice * $exNum, 2);
|
||||
$lineAddon = round($exPrice * $exNum, 2);
|
||||
$addonAmount += $lineAddon;
|
||||
$base += $lineAddon;
|
||||
}
|
||||
}
|
||||
} elseif ($isFixedLike && (!empty($params['is_custom']) || $isStrict || (isset($params['base_price']) && (float)$params['base_price'] > 0))) {
|
||||
@@ -1107,9 +1125,13 @@ class Home extends Base
|
||||
if ($type === 'custom') {
|
||||
// 用户自主定价:出价即订单总价,已包含楼层费/加急费,师傅按此价接单
|
||||
$base = max(0, round((float)$userPrice, 2));
|
||||
$goodsAmount = $base;
|
||||
$addonAmount = 0.0;
|
||||
$total = $base;
|
||||
} elseif ($type === 'quote') {
|
||||
// 师傅报价模式:金额由师傅后续竞价给出,下单时总价与应付为 0
|
||||
$goodsAmount = 0.0;
|
||||
$addonAmount = 0.0;
|
||||
$total = 0;
|
||||
$floorAmount = 0;
|
||||
$urgentAmount = 0;
|
||||
@@ -1148,6 +1170,8 @@ class Home extends Base
|
||||
'lines' => $pricedLines,
|
||||
'price_type' => $type,
|
||||
'user_price' => $type === 'custom' ? round($base, 2) : 0,
|
||||
'goods_amount' => $type === 'quote' ? 0 : round($goodsAmount, 2),
|
||||
'addon_amount' => $type === 'quote' ? 0 : round($addonAmount, 2),
|
||||
'base_amount' => $type === 'quote' ? 0 : round($base, 2),
|
||||
'floor_amount' => round($floorAmount, 2),
|
||||
'urgent_amount' => round($urgentAmount, 2),
|
||||
|
||||
在新工单中引用
屏蔽一个用户