更新商品表单管理

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() public function index()
{ {
$this->title = '用户等级管理'; $this->title = '用户等级管理';
BaseUserUpgrade::mQuery()->order('number asc')->layTable(); BaseUserUpgrade::mQuery()->layTable();
} }
/** /**

View File

@ -162,25 +162,27 @@
</label> </label>
</fieldset> </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> </div>
<script> <div class="hr-line-dashed"></div>
$(function () { {if isset($vo.id)}<input name='id' type='hidden' value='{$vo.id}'>{/if}
var $elem = $('[data-level-zero]'); {if isset($vo.number)}<input name='old_number' type='hidden' value='{$vo.number}'>{/if}
layui.form.on('select(number)', apply);
apply({value: parseInt("{$vo.number|default='0'}")}); <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> </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({ $('#UpgradeTable').layTable({
even: true, height: 'full', even: true, height: 'full',
sort: {field: 'number', type: 'asc'},
cols: [[ cols: [[
{ {field: 'number', title: '序号', align: "center", width: 120, sort: true},
field: 'number', title: '等级名称', align: 'left', minWidth: 140, templet: function (d) { {field: 'name', title: '等级名称', align: 'center', minWidth: 120},
return laytpl('<div>[ <b class="color-blue">VIP{{d.number}}</b> ] {{d.name}}</div>').render(d);
}
},
{ {
field: 'upgrade_team', title: '团队计数', align: 'center', width: 80, templet: function (d) { field: 'upgrade_team', title: '团队计数', align: 'center', width: 80, templet: function (d) {
if (!d.upgrade_team || d.upgrade_team < 1) return '-'; if (!d.upgrade_team || d.upgrade_team < 1) return '-';

View File

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

View File

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long