From 2babb26fca7198292cf266df0f8ee58422e329a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A3=AE2003?= <2384017988@qq.com> Date: Mon, 19 Oct 2026 03:22:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E7=95=8C=E9=9D=A2=EF=BC=9A?= =?UTF-8?q?=E7=AD=BE=E5=88=B0=E9=A1=B5=E9=9D=A2=20sign.html=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=EF=BC=9Bversion=20=E6=8F=90=E5=8D=87=E8=87=B3=202.11.?= =?UTF-8?q?10?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/dist/views/gameconfig/sign.html | 33 ++++++++++++------- AdminSrc/AdminHost/wwwroot/admin/index.html | 2 +- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/AdminSrc/AdminHost/wwwroot/admin/dist/views/gameconfig/sign.html b/AdminSrc/AdminHost/wwwroot/admin/dist/views/gameconfig/sign.html index c47c132..e184543 100644 --- a/AdminSrc/AdminHost/wwwroot/admin/dist/views/gameconfig/sign.html +++ b/AdminSrc/AdminHost/wwwroot/admin/dist/views/gameconfig/sign.html @@ -91,6 +91,7 @@ var activityConfig = null; var propList = []; + var giftLayer = null; var typeMap = { 1: '金币', 2: '钻石', 3: '道具' }; var propTypeNames = { 1: '炮台', 2: '翅膀', 3: '炮塔碎片', 4: '翅膀碎片', 5: '战神', 6: '战神碎片', 7: '刮刮卡', 8: '改名卡', 9: '大喇叭', 10: '技能', 11: '召唤卡', 12: 'VipExp', 13: '鱼雷' }; @@ -197,6 +198,17 @@ form.on('submit(save-base)', function () { save('保存成功'); return false; }); + // 奖励编辑弹窗:layui select 用 form.on 事件联动(原生 change 不触发) + form.on('select(giftType)', function (data) { + if (!giftLayer) return; + toggleGiftProp(giftLayer, data.value); + }); + form.on('select(giftPropType)', function (data) { + if (!giftLayer) return; + populateProps(giftLayer, parseInt(data.value) || 0, ''); + form.render('select'); + }); + $(document).on('click', '[lay-filter="reload-sign"]', function () { loadConfig(); layer.msg('刷新成功'); @@ -432,13 +444,13 @@ '
' + '' + '
' + - '' + + '' + '
' + '
' + '
' + '' + '
' + - '' + + '' + '
' + '
' + '
' + @@ -464,6 +476,7 @@ btn: ['确定', '取消'], shadeClose: true, success: function (l) { + giftLayer = l; l.find('#giftType').val(g.type || 1); // 编辑已有道具奖励时,定位其所属道具类型 @@ -476,13 +489,9 @@ populateProps(l, initPropType, g.otherId || ''); form.render('select'); - toggleGiftProp(l); - l.find('#giftType').on('change', function () { toggleGiftProp(l); }); - l.find('#giftPropType').on('change', function () { - populateProps(l, parseInt($(this).val()) || 0, ''); - form.render('select'); - }); + toggleGiftProp(l, g.type || 1); }, + end: function () { giftLayer = null; }, yes: function (idx, l) { var t = parseInt(l.find('#giftType').val()) || 1; var c = parseInt(l.find('#giftCount').val()) || 0; @@ -526,9 +535,11 @@ if (selectedNumber) l.find('#giftProp').val(selectedNumber); } - function toggleGiftProp(l) { - var isProp = (parseInt(l.find('#giftType').val()) || 1) === 3; - l.find('.gift-prop-item, .gift-prop-type-item').toggle(isProp); + function toggleGiftProp(l, typeValue) { + var t = (typeValue !== undefined && typeValue !== null) + ? parseInt(typeValue) + : (parseInt(l.find('#giftType').val()) || 1); + l.find('.gift-prop-item, .gift-prop-type-item').toggle(t === 3); } window.saveAct = function (n) { layui.admin.req({ method: 'get', url: (layui.setter.baseurl || '/') + 'adminapi/ActivityConfig/SaveSection/' + n, done: function (r) { layui.layer.msg(r.info || (r.code === 0 ? '保存成功' : '保存失败')) } }) } diff --git a/AdminSrc/AdminHost/wwwroot/admin/index.html b/AdminSrc/AdminHost/wwwroot/admin/index.html index 48b9e4d..8b99594 100644 --- a/AdminSrc/AdminHost/wwwroot/admin/index.html +++ b/AdminSrc/AdminHost/wwwroot/admin/index.html @@ -20,7 +20,7 @@