后台界面:签到页面 sign.html 更新;version 提升至 2.11.10

This commit is contained in:
2026-10-19 03:22:08 +08:00
parent 822e1bcc03
commit 2babb26fca
2 changed files with 23 additions and 12 deletions
@@ -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 @@
'<div class="layui-form-item">' +
'<label class="layui-form-label">奖励类型</label>' +
'<div class="layui-input-block">' +
'<select id="giftType"><option value="1">金币</option><option value="2">钻石</option><option value="3">道具</option></select>' +
'<select id="giftType" lay-filter="giftType"><option value="1">金币</option><option value="2">钻石</option><option value="3">道具</option></select>' +
'</div>' +
'</div>' +
'<div class="layui-form-item gift-prop-type-item">' +
'<label class="layui-form-label">道具类型</label>' +
'<div class="layui-input-block">' +
'<select id="giftPropType"><option value="">请选择道具类型</option></select>' +
'<select id="giftPropType" lay-filter="giftPropType"><option value="">请选择道具类型</option></select>' +
'</div>' +
'</div>' +
'<div class="layui-form-item gift-prop-item">' +
@@ -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 ? '保存成功' : '保存失败')) } }) }
+1 -1
View File
@@ -20,7 +20,7 @@
<script>
layui.config({
base: './dist/' //指定 layuiAdmin 项目路径
, version: '2.11.9'
, version: '2.11.10'
}).use('index', function () {
var layer = layui.layer, admin = layui.admin;