仰望星辰工作室

better-staridc-MNBT

Z zfhsh first commit 2 个月前
1<?php
2if (!defined('IN_CRONLITE')) { exit; }
3$page_title = $page_title ?? '主机套餐';
4$plans = $plans ?? [];
5ob_start();
6?>
7<div class="hs-section">
8 <h1>主机套餐</h1>
9 <p>选择合适的套餐购买,支付完成后自动开通主机</p>
10</div>
11
12<?php if (empty($plans)): ?>
13 <div class="layui-card"><div class="layui-card-body" style="text-align:center;padding:40px;color:#999;">暂无可购买的套餐,请稍后再来。</div></div>
14<?php else: ?>
15 <div class="hs-plan-grid">
16 <?php foreach ($plans as $plan): ?>
17 <div class="hs-plan-card">
18 <div class="hs-plan-head">
19 <h2><?= htmlspecialchars($plan['name']) ?></h2>
20 <?php if (!empty($plan['category'])): ?><span class="hs-plan-tag"><?= htmlspecialchars($plan['category']) ?></span><?php endif; ?>
21 </div>
22 <div class="hs-plan-desc"><?= nl2br(htmlspecialchars($plan['description'])) ?></div>
23 <ul class="hs-plan-spec">
24 <li><span>网页空间</span><b><?= (int)$plan['spec_web'] ?> MB</b></li>
25 <li><span>数据库</span><b><?= (int)$plan['spec_sql'] ?> MB</b></li>
26 <li><span>流量</span><b><?= (int)$plan['spec_flow'] > 0 ? ((int)$plan['spec_flow'].' GB') : '不限' ?></b></li>
27 <li><span>域名绑定</span><b><?= (int)$plan['spec_domain'] ?> 个</b></li>
28 </ul>
29 <div class="hs-plan-price">
30 <?php
31 $enabled = hosting_plan_enabled_periods($plan);
32 foreach ($enabled as $p):
33 $cfg = hosting_periods()[$p];
34 $field = hosting_period_price_field($p);
35 $price = (int)($plan[$field] ?? 0);
36 ?>
37 <div class="hs-price-item"><span class="hs-price-label"><?= htmlspecialchars($cfg['label']) ?></span><span class="hs-price-value">¥<?= hosting_format_cents($price) ?></span></div>
38 <?php endforeach; ?>
39 <?php if ($enabled === []): ?>
40 <span style="color:#999;font-size:12px;">暂无可购买周期</span>
41 <?php endif; ?>
42 </div>
43 <div class="hs-plan-buy"><a class="layui-btn" href="<?= hosting_url('shop/order/'.(int)$plan['id']) ?>">立即购买</a></div>
44 </div>
45 <?php endforeach; ?>
46 </div>
47<?php endif; ?>
48
49
50<?php
51$content = ob_get_clean();
52include __DIR__ . '/layout.php';