更新商品表单管理

This commit is contained in:
邹景立 2022-05-15 13:45:29 +08:00
parent 74502b2cd5
commit cfd759816e
7 changed files with 65 additions and 54 deletions

View File

@ -24,7 +24,7 @@ class Upgrade extends Controller
public function index()
{
$this->title = '用户等级管理';
BaseUserUpgrade::mQuery()->order('number asc')->layTable();
BaseUserUpgrade::mQuery()->layTable();
}
/**

View File

@ -162,25 +162,27 @@
</label>
</fieldset>
<div class="hr-line-dashed"></div>
{if isset($vo.id)}<input name='id' type='hidden' value='{$vo.id}'>{/if}
{if isset($vo.number)}<input name='old_number' type='hidden' value='{$vo.number}'>{/if}
<div class="layui-form-item text-center">
<button class="layui-btn" type='submit'>保存数据</button>
<button class="layui-btn layui-btn-danger" data-close data-confirm="确定要取消编辑吗?" type='button'>取消编辑</button>
</div>
</div>
<script>
$(function () {
var $elem = $('[data-level-zero]');
layui.form.on('select(number)', apply);
apply({value: parseInt("{$vo.number|default='0'}")});
<div class="hr-line-dashed"></div>
{if isset($vo.id)}<input name='id' type='hidden' value='{$vo.id}'>{/if}
{if isset($vo.number)}<input name='old_number' type='hidden' value='{$vo.number}'>{/if}
<div class="layui-form-item text-center">
<button class="layui-btn" type='submit'>保存数据</button>
<button class="layui-btn layui-btn-danger" data-close data-confirm="确定要取消编辑吗?" type='button'>取消编辑</button>
</div>
function apply(data) {
data.value > 0 ? $elem.addClass('layui-hide') : $elem.removeClass('layui-hide');
}
});
</script>
</form>
<script>
$(function () {
var $elem = $('[data-level-zero]');
layui.form.on('select(number)', apply);
apply({value: parseInt("{$vo.number|default=0}")});
function apply(data) {
data.value > 0 ? $elem.addClass('layui-hide') : $elem.removeClass('layui-hide');
}
});
</script>

View File

@ -22,12 +22,10 @@
// 初始化表格组件
$('#UpgradeTable').layTable({
even: true, height: 'full',
sort: {field: 'number', type: 'asc'},
cols: [[
{
field: 'number', title: '等级名称', align: 'left', minWidth: 140, templet: function (d) {
return laytpl('<div>[ <b class="color-blue">VIP{{d.number}}</b> ] {{d.name}}</div>').render(d);
}
},
{field: 'number', title: '序号', align: "center", width: 120, sort: true},
{field: 'name', title: '等级名称', align: 'center', minWidth: 120},
{
field: 'upgrade_team', title: '团队计数', align: 'center', width: 80, templet: function (d) {
if (!d.upgrade_team || d.upgrade_team < 1) return '-';

View File

@ -3,17 +3,38 @@
{block name="content"}
{include file='shop/goods/formstyle'}
<form action="{:sysuri()}" method="post" data-auto="true" class="layui-form layui-card" id="GoodsForm">
<div class="layui-card-body padding-40 padding-bottom-20">
<div class="layui-card-body">
<!--{notempty name='marks'}-->
<div class="layui-form-item relative block">
<span class="help-label label-required-prev"><b>商品标签</b>Mark Name</span>
<div class="layui-form-item label-required-prev">
<span class="help-label"><b>商品标签</b>Mark Name</span>
<div class="layui-textarea help-checks">
{foreach $marks as $mark}{if isset($vo.marks) && is_array($vo.marks) && in_array($mark, $vo.marks)}
<input checked name="marks[]" title="{$mark}" type="checkbox" value="{$mark}">
{else}
<input name="marks[]" title="{$mark}" type="checkbox" value="{$mark}">
{/if}{/foreach}
{foreach $marks as $mark}
<label class="think-checkbox">
{if isset($vo.marks) && is_array($vo.marks) && in_array($mark, $vo.marks)}
<input name="marks[]" type="checkbox" value="{$mark}" lay-ignore checked> {$mark}
{else}
<input name="marks[]" type="checkbox" value="{$mark}" lay-ignore> {$mark}
{/if}
</label>
{/foreach}
</div>
</div>
<!--{/notempty}-->
<!--{notempty name='payments'}-->
<div class="layui-form-item label-required-prev">
<span class="help-label"><b>支付方式</b>Goods Payment</span>
<div class="layui-textarea help-checks">
{foreach $payments as $payment}
<label class="think-checkbox">
{if isset($vo.payment) && is_array($vo.payment) && in_array($payment.code, $vo.payment)}
<input name="payment[]" type="checkbox" value="{$payment.code}" lay-ignore checked> {$payment.name}
{else}
<input name="payment[]" type="checkbox" value="{$payment.code}" lay-ignore> {$payment.name}
{/if}
</label>
{/foreach}
</div>
</div>
<!--{/notempty}-->
@ -31,28 +52,15 @@
</label>
<!--{/notempty}-->
<!--{notempty name='payments'}-->
<div class="layui-form-item relative block">
<span class="help-label label-required-prev"><b>支付方式</b>Goods Payment</span>
<div class="layui-textarea help-checks">
{foreach $payments as $payment}{if isset($vo.payment) && is_array($vo.payment) && in_array($payment.code, $vo.payment)}
<input checked name="payment[]" title="{$payment.name}" type="checkbox" value="{$payment.code}">
{else}
<input name="payment[]" title="{$payment.name}" type="checkbox" value="{$payment.code}">
{/if}{/foreach}
</div>
</div>
<!--{/notempty}-->
<label class="layui-form-item block relative">
<span class="help-label"><b>商品名称</b>Goods Name</span>
<input class="layui-input" name="name" placeholder="请输入商品名称" required value="{$vo.name|default=''}">
</label>
<!--{notempty name='trucks'}-->
<label class="layui-form-item block relative">
<span class="help-label label-required-prev"><b>邮费模板</b>Truck Template</span>
<select class="layui-select" lay-search name="truck_code">
<label class="layui-form-item block relative label-required-prev">
<span class="help-label"><b>邮费模板</b>Truck Template</span>
<select class="layui-select" name="truck_code" lay-search>
<option value="">--- ---</option>
{foreach $trucks as $truck}{if isset($vo.truck_code) and $vo.truck_code eq $truck.code}
<option selected value="{$truck.code}">{$truck.code} - {$truck.name|default=''}</option>
@ -63,8 +71,8 @@
</label>
<!--{/notempty}-->
<div class="layui-form-item">
<span class="help-label label-required-prev"><b>商品封面及轮播图片</b>Cover and Carousel Pictures</span>
<div class="layui-form-item label-required-prev">
<span class="help-label"><b>商品封面及轮播图片</b>Cover and Carousel Pictures</span>
<table class="layui-table">
<thead>
<tr>
@ -80,7 +88,6 @@
</td>
<td class="text-left padding-0">
<div class="help-images">
<input name="slider" type="hidden" value="{$vo.slider|default=''}">
<script>$('[name="slider"]').uploadMultipleImage();</script>
</div>
@ -91,7 +98,7 @@
</div>
<div class="goods-item-box">
<div class="layui-clear">
<div class="flex flex-wrap">
<fieldset>
<legend><span class="layui-badge think-bg-violet">商品返利配置</span></legend>
<div>

View File

@ -27,6 +27,10 @@ fieldset {
font-size: 12px;
letter-spacing: 1px;
}
.layui-form-item {
margin-bottom: 10px;
}
}
.layui-tab,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long