233 lines
10 KiB
PHP
Executable File
233 lines
10 KiB
PHP
Executable File
<?php
|
|
/* Smarty version 5.3.1, created on 2025-02-02 13:50:44
|
|
from 'file:user/order/create.tpl' */
|
|
|
|
/* @var \Smarty\Template $_smarty_tpl */
|
|
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
|
'version' => '5.3.1',
|
|
'unifunc' => 'content_679f07b44f2da5_55184184',
|
|
'has_nocache_code' => false,
|
|
'file_dependency' =>
|
|
array (
|
|
'7f044f72a47502eab810ff749ee60b0a2d6ab7c6' =>
|
|
array (
|
|
0 => 'user/order/create.tpl',
|
|
1 => 1712762115,
|
|
2 => 'file',
|
|
),
|
|
),
|
|
'includes' =>
|
|
array (
|
|
'file:user/header.tpl' => 1,
|
|
'file:user/footer.tpl' => 1,
|
|
),
|
|
))) {
|
|
function content_679f07b44f2da5_55184184 (\Smarty\Template $_smarty_tpl) {
|
|
$_smarty_current_dir = '/www/wwwroot/fuuu.cloud/resources/views/tabler/user/order';
|
|
$_smarty_tpl->renderSubTemplate('file:user/header.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir);
|
|
?>
|
|
|
|
<?php echo '<script'; ?>
|
|
src="//<?php echo $_smarty_tpl->getValue('config')['jsdelivr_url'];?>
|
|
/npm/jquery/dist/jquery.min.js"><?php echo '</script'; ?>
|
|
>
|
|
|
|
<div class="page-wrapper">
|
|
<div class="container-xl">
|
|
<div class="page-header d-print-none text-white">
|
|
<div class="row align-items-center">
|
|
<div class="col">
|
|
<h2 class="page-title">
|
|
<span class="home-title">创建订单</span>
|
|
</h2>
|
|
<div class="page-pretitle my-3">
|
|
<span class="home-subtitle">创建商品订单</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="page-body">
|
|
<div class="container-xl">
|
|
<div class="row row-cards">
|
|
<div class="col-sm-12 col-md-6 col-lg-9">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h3 class="card-title">订单内容</h3>
|
|
</div>
|
|
<div class="card-body">
|
|
<table class="table table-transparent table-responsive">
|
|
<tr hidden>
|
|
<td>商品ID</td>
|
|
<td id="product-id" class="text-end"><?php echo $_smarty_tpl->getValue('product')->id;?>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>商品名称</td>
|
|
<td class="text-end"><?php echo $_smarty_tpl->getValue('product')->name;?>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>商品类型</td>
|
|
<td class="text-end"><?php echo $_smarty_tpl->getValue('product')->type_text;?>
|
|
</td>
|
|
</tr>
|
|
<?php if ($_smarty_tpl->getValue('product')->type === 'tabp' || $_smarty_tpl->getValue('product')->type === 'time') {?>
|
|
<tr>
|
|
<td>商品时长</td>
|
|
<td class="text-end"><?php echo $_smarty_tpl->getValue('product')->content->time;?>
|
|
天</td>
|
|
</tr>
|
|
<tr>
|
|
<td>等级时长</td>
|
|
<td class="text-end"><?php echo $_smarty_tpl->getValue('product')->content->class_time;?>
|
|
天</td>
|
|
</tr>
|
|
<tr>
|
|
<td>等级</td>
|
|
<td class="text-end">Lv. <?php echo $_smarty_tpl->getValue('product')->content->class;?>
|
|
</td>
|
|
</tr>
|
|
<?php }?>
|
|
<?php if ($_smarty_tpl->getValue('product')->type === 'tabp' || $_smarty_tpl->getValue('product')->type === 'bandwidth') {?>
|
|
<tr>
|
|
<td>可用流量</td>
|
|
<td class="text-end"><?php echo $_smarty_tpl->getValue('product')->content->bandwidth;?>
|
|
GB</td>
|
|
</tr>
|
|
<?php }?>
|
|
<?php if ($_smarty_tpl->getValue('product')->type === 'tabp' || $_smarty_tpl->getValue('product')->type === 'time') {?>
|
|
<tr>
|
|
<td>速率限制</td>
|
|
<?php if ($_smarty_tpl->getValue('product')->content->speed_limit === '0') {?>
|
|
<td class="text-end">不限制</td>
|
|
<?php } else { ?>
|
|
<td class="text-end"><?php echo $_smarty_tpl->getValue('product')->content->speed_limit;?>
|
|
Mbps</td>
|
|
<?php }?>
|
|
</tr>
|
|
<tr>
|
|
<td>同时连接 IP 限制</td>
|
|
<?php if ($_smarty_tpl->getValue('product')->content->ip_limit === '0') {?>
|
|
<td class="text-end">不限制</td>
|
|
<?php } else { ?>
|
|
<td class="text-end"><?php echo $_smarty_tpl->getValue('product')->content->ip_limit;?>
|
|
</td>
|
|
<?php }?>
|
|
</tr>
|
|
<?php }?>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-12 col-md-6 col-lg-3">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h3 class="card-title">价格明细(元)</h3>
|
|
</div>
|
|
<div class="card-body">
|
|
<table class="table table-transparent table-responsive">
|
|
<tr>
|
|
<td>商品价格</td>
|
|
<td class="text-end"><?php echo $_smarty_tpl->getValue('product')->price;?>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>优惠码</td>
|
|
<td class="text-end" id="coupon-code"></td>
|
|
</tr>
|
|
<tr>
|
|
<td>优惠金额</td>
|
|
<td class="text-end" id="product-buy-discount"></td>
|
|
</tr>
|
|
<tr>
|
|
<td>实际支付</td>
|
|
<td class="text-end" id="product-buy-total"><?php echo $_smarty_tpl->getValue('product')->price;?>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="card my-3">
|
|
<div class="card-header">
|
|
<h3 class="card-title">优惠码</h3>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="mb-3">
|
|
<div class="input-group mb-2">
|
|
<input id="coupon" type="text" class="form-control"
|
|
placeholder="填写优惠码,没有请留空">
|
|
<button id="verify-coupon" class="btn" type="button">应用</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="card my-3">
|
|
<div class="card-body">
|
|
<button id="create-order" href=""
|
|
class="btn btn-primary w-100 my-3">创建订单
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<?php echo '<script'; ?>
|
|
>
|
|
$("#verify-coupon").click(function () {
|
|
$.ajax({
|
|
url: '/user/coupon',
|
|
type: 'POST',
|
|
dataType: "json",
|
|
data: {
|
|
coupon: $('#coupon').val(),
|
|
product_id: <?php echo $_smarty_tpl->getValue('product')->id;?>
|
|
,
|
|
},
|
|
success: function (data) {
|
|
if (data.ret === 1) {
|
|
$('#coupon-code').text($('#coupon').val());
|
|
$('#product-buy-discount').text(data.discount);
|
|
$('#product-buy-total').text(data.buy_price);
|
|
} else {
|
|
$('#fail-message').text(data.msg);
|
|
$('#fail-dialog').modal('show');
|
|
}
|
|
}
|
|
})
|
|
});
|
|
|
|
$("#create-order").click(function () {
|
|
$.ajax({
|
|
url: '/user/order/create',
|
|
type: 'POST',
|
|
dataType: "json",
|
|
data: {
|
|
coupon: $('#coupon').val(),
|
|
product_id: <?php echo $_smarty_tpl->getValue('product')->id;?>
|
|
,
|
|
},
|
|
success: function (data) {
|
|
if (data.ret === 1) {
|
|
$('#success-message').text(data.msg);
|
|
$('#success-dialog').modal('show');
|
|
setTimeout(function () {
|
|
$(location).attr('href', '/user/invoice/' + data.invoice_id + '/view');
|
|
}, <?php echo $_smarty_tpl->getValue('config')['jump_delay'];?>
|
|
);
|
|
} else {
|
|
$('#fail-message').text(data.msg);
|
|
$('#fail-dialog').modal('show');
|
|
}
|
|
}
|
|
})
|
|
});
|
|
<?php echo '</script'; ?>
|
|
>
|
|
|
|
<?php $_smarty_tpl->renderSubTemplate('file:user/footer.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir);
|
|
}
|
|
}
|