From 822e1bcc039ad7a65b53974fca77d44f5d7a25eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A3=AE2003?= <2384017988@qq.com> Date: Mon, 19 Oct 2026 02:43:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E7=95=8C=E9=9D=A2=EF=BC=9A?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=AD=BE=E5=88=B0=E9=A1=B5=E9=9D=A2=20sign.h?= =?UTF-8?q?tml=EF=BC=9Bversion=20=E6=8F=90=E5=8D=87=E8=87=B3=202.11.9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/dist/views/gameconfig/sign.html | 72 +++++++++++++++---- AdminSrc/AdminHost/wwwroot/admin/index.html | 2 +- 2 files changed, 60 insertions(+), 14 deletions(-) diff --git a/AdminSrc/AdminHost/wwwroot/admin/dist/views/gameconfig/sign.html b/AdminSrc/AdminHost/wwwroot/admin/dist/views/gameconfig/sign.html index 8dc215f..c47c132 100644 --- a/AdminSrc/AdminHost/wwwroot/admin/dist/views/gameconfig/sign.html +++ b/AdminSrc/AdminHost/wwwroot/admin/dist/views/gameconfig/sign.html @@ -92,6 +92,7 @@ var activityConfig = null; var propList = []; var typeMap = { 1: '金币', 2: '钻石', 3: '道具' }; + var propTypeNames = { 1: '炮台', 2: '翅膀', 3: '炮塔碎片', 4: '翅膀碎片', 5: '战神', 6: '战神碎片', 7: '刮刮卡', 8: '改名卡', 9: '大喇叭', 10: '技能', 11: '召唤卡', 12: 'VipExp', 13: '鱼雷' }; setTimeout(function() { if (window.parent && window.parent.$ && window.parent.layer) { @@ -425,23 +426,25 @@ function showGiftEdit(dayLayero, giftList, index, isAdd) { var g = isAdd ? { type: 1, count: 0, otherId: '' } : giftList[index]; - var propOpts = ''; - propList.forEach(function (p) { - propOpts += ''; - }); var html = '
' + '
' + '
' + - '' + + '' + '
' + '' + '
' + '
' + - '
' + - '' + + '
' + + '' + '
' + - '' + + '' + + '
' + + '
' + + '
' + + '' + + '
' + + '' + '
' + '
' + '
' + @@ -456,22 +459,38 @@ layer.open({ type: 1, title: isAdd ? '新增奖励' : '编辑奖励', - area: ['460px', '360px'], + area: ['480px', '420px'], content: html, btn: ['确定', '取消'], shadeClose: true, success: function (l) { l.find('#giftType').val(g.type || 1); - l.find('#giftProp').val(g.otherId || ''); + + // 编辑已有道具奖励时,定位其所属道具类型 + var initPropType = 0; + if ((g.type || 1) === 3 && g.otherId) { + var p = propList.find(function (x) { return String(x.number) === String(g.otherId); }); + if (p) initPropType = p.type; + } + populatePropTypes(l, initPropType); + 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'); + }); }, yes: function (idx, l) { var t = parseInt(l.find('#giftType').val()) || 1; var c = parseInt(l.find('#giftCount').val()) || 0; - var oid = t === 3 ? (l.find('#giftProp').val() || '') : ''; - if (t === 3 && !oid) { layer.msg('请选择道具'); return; } + var oid = ''; + if (t === 3) { + oid = l.find('#giftProp').val() || ''; + if (!oid) { layer.msg('请选择具体道具'); return; } + } var item = { type: t, count: c, otherId: oid }; if (isAdd) giftList.push(item); else giftList[index] = item; layer.close(idx); @@ -480,9 +499,36 @@ }); } + // 填充“道具类型”下拉(仅列出道具表中实际存在的类型) + function populatePropTypes(l, selectedType) { + var usedTypes = []; + propList.forEach(function (p) { + if (p.type && usedTypes.indexOf(p.type) < 0) usedTypes.push(p.type); + }); + usedTypes.sort(function (a, b) { return a - b; }); + var opts = ''; + usedTypes.forEach(function (t) { + opts += ''; + }); + l.find('#giftPropType').html(opts); + if (selectedType) l.find('#giftPropType').val(selectedType); + } + + // 按所选“道具类型”填充“具体道具”下拉 + function populateProps(l, propType, selectedNumber) { + var opts = ''; + if (propType) { + propList.filter(function (p) { return p.type === propType; }).forEach(function (p) { + opts += ''; + }); + } + l.find('#giftProp').html(opts); + if (selectedNumber) l.find('#giftProp').val(selectedNumber); + } + function toggleGiftProp(l) { var isProp = (parseInt(l.find('#giftType').val()) || 1) === 3; - l.find('.gift-prop-item').toggle(isProp); + l.find('.gift-prop-item, .gift-prop-type-item').toggle(isProp); } 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 3bc4c4e..48b9e4d 100644 --- a/AdminSrc/AdminHost/wwwroot/admin/index.html +++ b/AdminSrc/AdminHost/wwwroot/admin/index.html @@ -20,7 +20,7 @@