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

400 行
16 KiB
HTML

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

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

<style>
.srv-pricing-modal { padding: 6px 12px; color: #1e293b; }
/* 商品信息横幅 */
.srv-hero-banner {
background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
border: 1px solid #bfdbfe;
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 #93c5fd;
background: #fff;
}
.srv-hero-title { font-size: 16px; font-weight: 700; color: #1e3a8a; display: flex; align-items: center; gap: 8px; }
.srv-hero-cat {
font-size: 11.5px;
padding: 2px 8px;
border-radius: 12px;
background: #2563eb;
color: #fff;
font-weight: 600;
}
.srv-hero-sub { font-size: 12px; color: #1d4ed8; margin-top: 3px; }
.srv-hero-badges { display: flex; gap: 10px; }
.srv-hero-stat {
background: rgba(255, 255, 255, 0.9);
border: 1px solid #bfdbfe;
border-radius: 8px;
padding: 6px 14px;
text-align: center;
}
.srv-hero-stat .s-num { font-size: 16px; font-weight: 800; color: #2563eb; line-height: 1.1; }
.srv-hero-stat .s-lbl { font-size: 11px; color: #1e40af; 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: #2563eb; }
.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-blue input:checked + .slider { background-color: #2563eb; }
.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-default-label {
display: inline-flex;
align-items: center;
gap: 4px;
font-size: 12px;
color: #475569;
cursor: pointer;
margin: 0;
padding: 3px 8px;
border-radius: 6px;
border: 1px solid transparent;
transition: all 0.15s;
}
.srv-default-label.is-def-active {
background: #dbeafe;
color: #1d4ed8;
border-color: #93c5fd;
font-weight: 600;
}
/* 规格表格输入框微光高亮 */
.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-main {
background-color: #eff6ff !important;
border-color: #3b82f6 !important;
color: #1d4ed8 !important;
font-weight: 700 !important;
box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2);
}
.srv-matrix-input-box.is-active-main .input-prefix { color: #2563eb !important; }
</style>
<?php
$savedMainMap = [];
foreach ($serviceTypes as $st) {
if (isset($st['code'])) {
$savedMainMap[$st['code']] = $st;
}
}
// 整理主服务字典工项(已开启在先)
$mainPool = [];
$disabledMainPool = [];
foreach ($typesPool as $tp) {
$c = $tp['code'];
$isOn = !empty($savedMainMap) ? isset($savedMainMap[$c]) : ($tp['can_be_main'] == 1 && in_array($c, ['install','repair','remove']));
if ($isOn) {
$mainPool[] = $tp;
} else {
$disabledMainPool[] = $tp;
}
}
$finalMainPool = array_merge($mainPool, $disabledMainPool);
?>
<form id="pricing-main-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-main-cnt">{:count($savedMainMap)}</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-wrench"></i> 【父级商品】主服务工项与基准价格
</div>
<span class="srv-section-sub">用户单独选此工项时的全局基准价;下级细分规格未单独设价时将默认采用此基准价</span>
</div>
<table class="srv-table" id="table-parent-main">
<thead>
<tr>
<th style="width: 200px;">主服务工项</th>
<th style="width: 100px; text-align: center;">启用状态</th>
<th style="width: 260px;">父级基准单价(一口价)</th>
<th style="width: 140px; text-align: center;">默认首选</th>
<th>计价规则说明</th>
</tr>
</thead>
<tbody>
{foreach name="finalMainPool" item="tp"}
<?php
$code = $tp['code'];
$name = $tp['name'];
$unit = $tp['unit'] ?: ($row['unit'] ?: '台');
$isMainChecked = !empty($savedMainMap) ? isset($savedMainMap[$code]) : ($tp['can_be_main'] == 1 && in_array($code, ['install','repair','remove']));
$mainSupportFixed = (int)$tp['support_fixed'];
$mainPrice = isset($savedMainMap[$code]['price']) && (float)$savedMainMap[$code]['price'] > 0 ? (float)$savedMainMap[$code]['price'] : (float)$tp['default_price'];
$isMainDefault = ($mainSupportFixed === 1 && isset($savedMainMap[$code]['is_default'])) ? (int)$savedMainMap[$code]['is_default'] : ($mainSupportFixed === 1 ? (int)$tp['is_default'] : 0);
?>
<tr class="main-pool-row {if !$isMainChecked}is-row-disabled{/if}" data-code="{$code}" data-name="{$name}" data-support-fixed="{$mainSupportFixed}">
<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-blue" title="开启/关闭主服务工项">
<input type="checkbox" class="st-enable" data-code="{$code}" {if $isMainChecked}checked{/if}>
<span class="slider"></span>
</label>
</td>
<td>
<div class="st-active-panel" style="display:{if $isMainChecked}inline-flex{else/}none{/if};align-items:center;gap:6px;">
{if $mainSupportFixed == 1}
<div class="input-group input-group-sm" style="width:170px;">
<span class="input-group-addon" style="background:#eff6ff;color:#1d4ed8;font-weight:700;">¥</span>
<input type="number" step="0.01" class="form-control st-price" data-code="{$code}" value="{$mainPrice}" style="font-weight:700;color:#0f172a;">
<span class="input-group-addon">/{$unit}</span>
</div>
{else/}
<span class="label" style="background:#f1f5f9;color:#475569;border:1px dashed #cbd5e1;padding:4px 8px;font-size:11.5px;">不支持一口价(现场师傅报价)</span>
{/if}
</div>
<span class="st-off-hint" style="display:{if $isMainChecked}none{else/}inline{/if};color:#94a3b8;font-size:12px;">未启用</span>
</td>
<td style="text-align: center;">
{if $mainSupportFixed == 1}
<label class="srv-default-label {if $isMainDefault==1}is-def-active{/if}" style="display:{if $isMainChecked}inline-flex{else/}none{/if};">
<input type="radio" name="st_default_radio" class="st-default" data-code="{$code}" {if $isMainDefault==1}checked{/if}> 默认首选
</label>
{else/}
<span class="text-muted" style="font-size:11px;">-</span>
{/if}
</td>
<td>
<span class="text-muted" style="font-size:12px;">{if $mainSupportFixed == 1}支持在线统一定价,下单按此一口价结算{else/}现场勘验施工难度,由师傅上门后在线报价{/if}</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:#eff6ff;border:1px solid #bfdbfe;border-radius:8px;padding:8px 12px;font-size:12px;color:#1e40af;margin-bottom:12px;">
<i class="fa fa-info-circle" style="color:#2563eb;"></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-main-table" style="border:none;">
<thead id="specs-main-thead">
<!-- JS 动态渲染表头 -->
</thead>
<tbody id="specs-main-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="service_types_raw" id="service_types_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-primary btn-embossed" id="btn-save-main-pricing"><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.92, 1280);
var th = Math.min(ph * 0.90, 850);
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>