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 @@