修改
This commit is contained in:
parent
2761218f2a
commit
c56dc553b1
|
|
@ -112,25 +112,7 @@
|
|||
<td>{$vo.id}</td>
|
||||
<td>{$vo.title}</td>
|
||||
<td>
|
||||
{if condition="$vo.type eq 1"}
|
||||
<button class="layui-btn layui-btn-normal layui-btn-radius layui-btn-xs">一番赏</button>
|
||||
{elseif condition="$vo.type eq 2"}
|
||||
<button class="layui-btn layui-btn-normal layui-btn-radius layui-btn-xs">无限赏</button>
|
||||
{elseif condition="$vo.type eq 3"}
|
||||
<button class="layui-btn layui-btn-normal layui-btn-radius layui-btn-xs">擂台赏</button>
|
||||
{elseif condition="$vo.type eq 5"}
|
||||
<button class="layui-btn layui-btn-normal layui-btn-radius layui-btn-xs">积分赏</button>
|
||||
{elseif condition="$vo.type eq 6"}
|
||||
<button class="layui-btn layui-btn-normal layui-btn-radius layui-btn-xs">全局赏</button>
|
||||
{elseif condition="$vo.type eq 8"}
|
||||
<button class="layui-btn layui-btn-normal layui-btn-radius layui-btn-xs">领主赏</button>
|
||||
{elseif condition="$vo.type eq 9"}
|
||||
<button class="layui-btn layui-btn-normal layui-btn-radius layui-btn-xs">连击赏</button>
|
||||
{elseif condition="$vo.type eq 10"}
|
||||
<button class="layui-btn layui-btn-normal layui-btn-radius layui-btn-xs">商城赏</button>
|
||||
{elseif condition="$vo.type eq 11"}
|
||||
<button class="layui-btn layui-btn-normal layui-btn-radius layui-btn-xs">自制赏</button>
|
||||
{/if}
|
||||
<button class="layui-btn layui-btn-normal layui-btn-radius layui-btn-xs" data-type="{$vo.type}">加载中...</button>
|
||||
/
|
||||
{if condition="$vo.status eq 1"}
|
||||
<span class="layui-badge layui-bg-green">上架</span>
|
||||
|
|
@ -198,24 +180,45 @@
|
|||
});
|
||||
|
||||
// 加载盒子类型数据
|
||||
$.ajax({
|
||||
url: '{:url("/admin/api/goods/types")}',
|
||||
type: 'GET',
|
||||
success: function (res) {
|
||||
if (res.code === 0) {
|
||||
var html = '<option value="">--盒子类型--</option>';
|
||||
|
||||
$.each(res.data, function (index, item) {
|
||||
if(item.value == '{$Request.get.type}'){
|
||||
html += '<option value="' + item.value + '" title="' + item.remark + '" selected>' + item.fl_name + '</option>';
|
||||
} else {
|
||||
html += '<option value="' + item.value + '" title="' + item.remark + '">' + item.fl_name + '</option>';
|
||||
}
|
||||
});
|
||||
$('#goodsType').html(html);
|
||||
form.render('select');
|
||||
function loadGoodsTypes() {
|
||||
$.ajax({
|
||||
url: '{:url("/admin/api/goods/types")}',
|
||||
type: 'GET',
|
||||
success: function (res) {
|
||||
if (res.code === 0) {
|
||||
// 更新下拉框
|
||||
var html = '<option value="">--盒子类型--</option>';
|
||||
|
||||
$.each(res.data, function (index, item) {
|
||||
if(item.value == '{$Request.get.type}'){
|
||||
html += '<option value="' + item.value + '" title="' + item.remark + '" selected>' + item.fl_name + '</option>';
|
||||
} else {
|
||||
html += '<option value="' + item.value + '" title="' + item.remark + '">' + item.fl_name + '</option>';
|
||||
}
|
||||
});
|
||||
$('#goodsType').html(html);
|
||||
form.render('select');
|
||||
|
||||
// 更新表格中的类型显示
|
||||
$('button[data-type]').each(function() {
|
||||
var type = $(this).data('type');
|
||||
var typeInfo = res.data.find(function(item) {
|
||||
return item.value == type;
|
||||
});
|
||||
if (typeInfo) {
|
||||
$(this).text(typeInfo.fl_name);
|
||||
} else {
|
||||
$(this).text('未知类型');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 页面加载完成后执行
|
||||
$(function() {
|
||||
loadGoodsTypes();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user