文件
yjyf/server/application/admin/view/service/pricing_addon.html
MiAn 0370cb9bd6 feat: 新增师傅入驻审核与接单状态联动功能
- 新增师傅资质审核模块及权限
- 未审核通过的师傅默认禁用接单状态
- 新增售后退款申诉功能与相关界面
- 新增用户钱包管理及充值功能
- 更新服务定价矩阵相关数据库结构
- 修复微信支付证书验证问题
2026-11-17 10:28:01 +08:00

369 行
15 KiB
HTML

此文件含有模棱两可的 Unicode 字符

此文件含有可能会与其他字符混淆的 Unicode 字符。 如果您是想特意这样的,可以安全地忽略该警告。 使用 Escape 按钮显示他们。

<style>
.srv-pricing-modal { padding: 6px 12px; color: #1e293b; }
/* 商品信息横幅 */
.srv-hero-banner {
background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
border: 1px solid #fed7aa;
border-radius: 10px;
padding: 12px 18px;
margin-bottom: 14px;
display: flex;
align-items: center;
justify-content: space-between;
}
.srv-hero-left { display: flex; align-items: center; gap: 12px; }
.srv-hero-thumb {
width: 48px;
height: 48px;
border-radius: 8px;
object-fit: cover;
border: 1px solid #fdba74;
background: #fff;
}
.srv-hero-title { font-size: 16px; font-weight: 700; color: #9a3412; display: flex; align-items: center; gap: 8px; }
.srv-hero-cat {
font-size: 11.5px;
padding: 2px 8px;
border-radius: 12px;
background: #ea580c;
color: #fff;
font-weight: 600;
}
.srv-hero-sub { font-size: 12px; color: #c2410c; margin-top: 3px; }
.srv-hero-badges { display: flex; gap: 10px; }
.srv-hero-stat {
background: rgba(255, 255, 255, 0.9);
border: 1px solid #fed7aa;
border-radius: 8px;
padding: 6px 14px;
text-align: center;
}
.srv-hero-stat .s-num { font-size: 16px; font-weight: 800; color: #ea580c; line-height: 1.1; }
.srv-hero-stat .s-lbl { font-size: 11px; color: #78350f; margin-top: 2px; }
/* 分区卡片 */
.srv-section-card {
background: #ffffff;
border: 1px solid #e2e8f0;
border-radius: 10px;
padding: 14px 16px;
margin-bottom: 14px;
box-shadow: 0 1px 3px rgba(15, 23, 42, 0.02);
}
.srv-section-header {
display: flex;
align-items: center;
justify-content: space-between;
padding-bottom: 10px;
margin-bottom: 12px;
border-bottom: 1px solid #f1f5f9;
}
.srv-section-title {
font-size: 13.5px;
font-weight: 700;
color: #0f172a;
display: flex;
align-items: center;
gap: 8px;
}
.srv-section-title i { color: #ea580c; }
.srv-section-sub { font-size: 12px; color: #64748b; font-weight: normal; }
/* Switch 开关 */
.srv-switch {
position: relative;
display: inline-flex;
align-items: center;
cursor: pointer;
margin: 0;
user-select: none;
}
.srv-switch input { display: none; }
.srv-switch .slider {
width: 38px;
height: 20px;
background-color: #cbd5e1;
border-radius: 20px;
position: relative;
transition: 0.2s;
}
.srv-switch .slider::before {
content: "";
position: absolute;
width: 16px;
height: 16px;
left: 2px;
bottom: 2px;
background-color: white;
border-radius: 50%;
transition: 0.2s;
box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.srv-switch.switch-orange input:checked + .slider { background-color: #ea580c; }
.srv-switch input:checked + .slider::before { transform: translateX(18px); }
/* 表格 */
.srv-table {
width: 100%;
border-collapse: separate;
border-spacing: 0;
border: 1px solid #e2e8f0;
border-radius: 8px;
overflow: hidden;
margin-bottom: 0;
}
.srv-table thead th {
padding: 9px 12px;
font-size: 12.5px;
font-weight: 700;
color: #334155;
border-bottom: 1px solid #e2e8f0;
background: #f8fafc;
vertical-align: middle;
}
.srv-table tbody td {
padding: 9px 12px;
vertical-align: middle;
border-bottom: 1px solid #f1f5f9;
}
.srv-table tbody tr:last-child td { border-bottom: none; }
.srv-table tbody tr.is-row-disabled { background: #fafafa; opacity: 0.65; }
.srv-table tbody tr.is-row-disabled:hover { opacity: 0.9; }
/* 增值服务专属加价输入高亮 */
.srv-matrix-input-box {
position: relative;
display: flex;
align-items: center;
width: 100%;
min-width: 95px;
max-width: 120px;
margin: 0 auto;
}
.srv-matrix-input-box .input-prefix {
position: absolute;
left: 8px;
font-size: 11px;
font-weight: 600;
color: #94a3b8;
pointer-events: none;
z-index: 2;
}
.srv-matrix-input-box input.form-control {
height: 30px;
padding: 2px 8px 2px 22px;
font-size: 12px;
font-weight: 500;
text-align: left;
border-radius: 4px;
border: 1px solid #cbd5e1;
background-color: #f8fafc;
color: #334155;
transition: all 0.15s;
width: 100%;
}
.srv-matrix-input-box input.form-control::placeholder {
color: #94a3b8;
font-weight: 400;
font-size: 11px;
}
.srv-matrix-input-box input.form-control.is-custom-addon {
background-color: #fff7ed !important;
border-color: #f97316 !important;
color: #c2410c !important;
font-weight: 700 !important;
box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.2);
}
.srv-matrix-input-box.is-active-addon .input-prefix { color: #ea580c !important; }
</style>
<?php
$savedAddonMap = [];
foreach ($assignedAddons as $ad) {
if (isset($ad['code']) && $ad['code'] !== '') {
$savedAddonMap[$ad['code']] = $ad;
} elseif (isset($ad['name'])) {
$savedAddonMap[$ad['name']] = $ad;
}
}
// 整理增值服务字典工项(已开启在先)
$addonPool = [];
$disabledAddonPool = [];
foreach ($typesPool as $tp) {
$c = $tp['code'];
$n = $tp['name'];
$isOn = !empty($savedAddonMap) ? (isset($savedAddonMap[$c]) || isset($savedAddonMap[$n])) : ($c === 'remove');
if ($isOn) {
$addonPool[] = $tp;
} else {
$disabledAddonPool[] = $tp;
}
}
$finalAddonPool = array_merge($addonPool, $disabledAddonPool);
?>
<form id="pricing-addon-form" class="form-horizontal srv-pricing-modal" role="form" data-toggle="validator" method="POST" action="">
<!-- 顶部标的物信息横幅 -->
<?php $srvThumbUrl = empty($row['image']) ? '/assets/img/qrcode.png' : (strpos($row['image'], '/assets/') === 0 || strpos($row['image'], '/icon/') === 0 ? $row['image'] : cdnurl($row['image'], true)); ?>
<div class="srv-hero-banner">
<div class="srv-hero-left">
<img class="srv-hero-thumb" src="{$srvThumbUrl|htmlentities}" onerror="this.src='/assets/img/qrcode.png'">
<div>
<div class="srv-hero-title">
{$row.name|htmlentities}
<span class="srv-hero-cat">{$catName|htmlentities}</span>
</div>
<div class="srv-hero-sub">计价单位:{$row.unit|htmlentities} · 配置小程序下单可加购的顺带增项与加价,规格未单独设加价自动沿用父级</div>
</div>
</div>
<div class="srv-hero-badges">
<div class="srv-hero-stat">
<div class="s-num" id="stat-addon-cnt">{:count($savedAddonMap)}</div>
<div class="s-lbl">已启用增项</div>
</div>
<div class="srv-hero-stat">
<div class="s-num">{:count($specs)}</div>
<div class="s-lbl">细分型号规格</div>
</div>
</div>
</div>
<!-- 卡片 1:【父级商品】增值服务工项与基准加价 -->
<div class="srv-section-card">
<div class="srv-section-header">
<div class="srv-section-title">
<i class="fa fa-plus-circle"></i> 【父级商品】增值服务工项与基准加价
</div>
<span class="srv-section-sub">小程序下单时可勾选的顺带增项;下级细分规格未单独设置加价时将默认采用此基准加价</span>
</div>
<table class="srv-table" id="table-parent-addon">
<thead>
<tr>
<th style="width: 220px;">增值服务工项</th>
<th style="width: 100px; text-align: center;">启用状态</th>
<th style="width: 260px;">父级基准加价(顺带增项)</th>
<th>增项说明</th>
</tr>
</thead>
<tbody>
{foreach name="finalAddonPool" item="tp"}
<?php
$code = $tp['code'];
$name = $tp['name'];
$unit = $tp['unit'] ?: ($row['unit'] ?: '台');
$matchedAddon = isset($savedAddonMap[$code]) ? $savedAddonMap[$code] : (isset($savedAddonMap[$name]) ? $savedAddonMap[$name] : null);
$isAddonChecked = !empty($savedAddonMap) ? ($matchedAddon !== null) : ($code === 'remove');
$addonPrice = $matchedAddon !== null && isset($matchedAddon['price']) ? (float)$matchedAddon['price'] : ((float)$tp['default_addon_price'] > 0 ? (float)$tp['default_addon_price'] : 30.00);
$addonUnit = $matchedAddon !== null && !empty($matchedAddon['unit']) ? $matchedAddon['unit'] : $unit;
?>
<tr class="addon-pool-row {if !$isAddonChecked}is-row-disabled{/if}" data-code="{$code}" data-name="{$name}" data-unit="{$addonUnit}">
<td>
<strong style="font-size:13px;color:#0f172a;">{$name}</strong>
<span style="font-size:11px;color:#64748b;margin-left:4px;font-family:Consolas,monospace;">{$code}</span>
</td>
<td style="text-align: center;">
<label class="srv-switch switch-orange" title="开启/关闭增值服务">
<input type="checkbox" class="ad-bind" data-code="{$code}" {if $isAddonChecked}checked{/if}>
<span class="slider"></span>
</label>
</td>
<td>
<div class="ad-active-panel" style="display:{if $isAddonChecked}inline-flex{else/}none{/if};align-items:center;gap:6px;">
<div class="input-group input-group-sm" style="width:170px;">
<span class="input-group-addon" style="background:#fff7ed;color:#ea580c;font-weight:700;">+¥</span>
<input type="number" step="0.01" class="form-control ad-price" data-code="{$code}" value="{$addonPrice}" style="font-weight:700;color:#ea580c;">
<span class="input-group-addon">/{$addonUnit}</span>
</div>
</div>
<span class="ad-off-hint" style="display:{if $isAddonChecked}none{else/}inline{/if};color:#94a3b8;font-size:12px;">未作为增值服务开启</span>
</td>
<td>
<span class="text-muted" style="font-size:12px;">用户在主服务基础上下单时,可选择顺带加购此项(如安装时顺带拆旧 +¥50)</span>
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
<!-- 卡片 2:【下级细分规格】增值服务专属加价(若商品有规格) -->
<div class="srv-section-card" style="padding:0;overflow:hidden;">
<div style="padding:12px 16px 0 16px;">
<div style="background:#fff7ed;border:1px solid #fed7aa;border-radius:8px;padding:8px 12px;font-size:12px;color:#9a3412;margin-bottom:12px;">
<i class="fa fa-tags" style="color:#ea580c;"></i>
<strong>细分规格增值服务专属加价:</strong>
每个细分规格可单独设置专属加价。<strong>留空则自动继承上方父级基准加价</strong>;若特殊规格(如特殊材质/大型号)拆装加价更高,在下方输入专属加价进行覆盖。
</div>
</div>
{if count($specs) > 0}
<div style="overflow-x:auto;-webkit-overflow-scrolling:touch;">
<table class="table table-bordered table-hover srv-table" id="specs-addon-table" style="border:none;">
<thead id="specs-addon-thead">
<!-- JS 动态渲染表头 -->
</thead>
<tbody id="specs-addon-tbody">
<!-- JS 动态渲染各规格加价数据行 -->
</tbody>
</table>
</div>
{else/}
<div style="text-align:center;padding:24px 0;color:#94a3b8;font-size:12.5px;">
<i class="fa fa-info-circle"></i> 当前商品为标准单品(未配置细分型号规格),全局统一执行上方配置的父级增值服务基准加价。
</div>
{/if}
</div>
<input type="hidden" name="addons_raw" id="addons_raw" value="">
<!-- 原始规格数据载入供 JS 引擎全量渲染 -->
<script id="specs-data-source" type="application/json">
{:json_encode($specs, JSON_UNESCAPED_UNICODE)}
</script>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-warning btn-embossed" id="btn-save-addon-pricing" style="background:#ea580c;border-color:#ea580c;"><i class="fa fa-check"></i> 保存增值服务加价配置</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>
<script>
(function () {
function autoExpandModal() {
try {
if (window.parent && window.parent.Layer) {
var frameIdx = window.parent.Layer.getFrameIndex(window.name);
if (frameIdx) {
var pWin = window.parent.$(window.parent);
var pw = pWin.width();
var ph = pWin.height();
if (pw > 992) {
var tw = Math.min(pw * 0.90, 1200);
var th = Math.min(ph * 0.88, 800);
window.parent.Layer.style(frameIdx, {
width: tw + 'px',
height: th + 'px',
left: Math.max(0, (pw - tw) / 2) + 'px',
top: Math.max(0, (ph - th) / 2) + 'px'
});
}
}
}
} catch (e) {}
}
if (document.readyState === 'complete') {
autoExpandModal();
} else {
window.addEventListener('load', autoExpandModal);
}
setTimeout(autoExpandModal, 150);
})();
</script>