diff --git a/app/admin/view/Statistics/profit.html b/app/admin/view/Statistics/profit.html
index 5883bb4..0776f77 100755
--- a/app/admin/view/Statistics/profit.html
+++ b/app/admin/view/Statistics/profit.html
@@ -112,25 +112,7 @@
{$vo.id} |
{$vo.title} |
- {if condition="$vo.type eq 1"}
-
- {elseif condition="$vo.type eq 2"}
-
- {elseif condition="$vo.type eq 3"}
-
- {elseif condition="$vo.type eq 5"}
-
- {elseif condition="$vo.type eq 6"}
-
- {elseif condition="$vo.type eq 8"}
-
- {elseif condition="$vo.type eq 9"}
-
- {elseif condition="$vo.type eq 10"}
-
- {elseif condition="$vo.type eq 11"}
-
- {/if}
+
/
{if condition="$vo.status eq 1"}
上架
@@ -198,24 +180,45 @@
});
// 加载盒子类型数据
- $.ajax({
- url: '{:url("/admin/api/goods/types")}',
- type: 'GET',
- success: function (res) {
- if (res.code === 0) {
- var html = '';
-
- $.each(res.data, function (index, item) {
- if(item.value == '{$Request.get.type}'){
- html += '';
- } else {
- html += '';
- }
- });
- $('#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 = '';
+
+ $.each(res.data, function (index, item) {
+ if(item.value == '{$Request.get.type}'){
+ html += '';
+ } else {
+ html += '';
+ }
+ });
+ $('#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();
});
});
|