后台界面:签到页面 sign.html 更新;version 提升至 2.11.10
This commit is contained in:
@@ -91,6 +91,7 @@
|
|||||||
|
|
||||||
var activityConfig = null;
|
var activityConfig = null;
|
||||||
var propList = [];
|
var propList = [];
|
||||||
|
var giftLayer = null;
|
||||||
var typeMap = { 1: '金币', 2: '钻石', 3: '道具' };
|
var typeMap = { 1: '金币', 2: '钻石', 3: '道具' };
|
||||||
var propTypeNames = { 1: '炮台', 2: '翅膀', 3: '炮塔碎片', 4: '翅膀碎片', 5: '战神', 6: '战神碎片', 7: '刮刮卡', 8: '改名卡', 9: '大喇叭', 10: '技能', 11: '召唤卡', 12: 'VipExp', 13: '鱼雷' };
|
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; });
|
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 () {
|
$(document).on('click', '[lay-filter="reload-sign"]', function () {
|
||||||
loadConfig();
|
loadConfig();
|
||||||
layer.msg('刷新成功');
|
layer.msg('刷新成功');
|
||||||
@@ -432,13 +444,13 @@
|
|||||||
'<div class="layui-form-item">' +
|
'<div class="layui-form-item">' +
|
||||||
'<label class="layui-form-label">奖励类型</label>' +
|
'<label class="layui-form-label">奖励类型</label>' +
|
||||||
'<div class="layui-input-block">' +
|
'<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>' +
|
'</div>' +
|
||||||
'<div class="layui-form-item gift-prop-type-item">' +
|
'<div class="layui-form-item gift-prop-type-item">' +
|
||||||
'<label class="layui-form-label">道具类型</label>' +
|
'<label class="layui-form-label">道具类型</label>' +
|
||||||
'<div class="layui-input-block">' +
|
'<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>' +
|
'</div>' +
|
||||||
'<div class="layui-form-item gift-prop-item">' +
|
'<div class="layui-form-item gift-prop-item">' +
|
||||||
@@ -464,6 +476,7 @@
|
|||||||
btn: ['确定', '取消'],
|
btn: ['确定', '取消'],
|
||||||
shadeClose: true,
|
shadeClose: true,
|
||||||
success: function (l) {
|
success: function (l) {
|
||||||
|
giftLayer = l;
|
||||||
l.find('#giftType').val(g.type || 1);
|
l.find('#giftType').val(g.type || 1);
|
||||||
|
|
||||||
// 编辑已有道具奖励时,定位其所属道具类型
|
// 编辑已有道具奖励时,定位其所属道具类型
|
||||||
@@ -476,13 +489,9 @@
|
|||||||
populateProps(l, initPropType, g.otherId || '');
|
populateProps(l, initPropType, g.otherId || '');
|
||||||
|
|
||||||
form.render('select');
|
form.render('select');
|
||||||
toggleGiftProp(l);
|
toggleGiftProp(l, g.type || 1);
|
||||||
l.find('#giftType').on('change', function () { toggleGiftProp(l); });
|
|
||||||
l.find('#giftPropType').on('change', function () {
|
|
||||||
populateProps(l, parseInt($(this).val()) || 0, '');
|
|
||||||
form.render('select');
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
end: function () { giftLayer = null; },
|
||||||
yes: function (idx, l) {
|
yes: function (idx, l) {
|
||||||
var t = parseInt(l.find('#giftType').val()) || 1;
|
var t = parseInt(l.find('#giftType').val()) || 1;
|
||||||
var c = parseInt(l.find('#giftCount').val()) || 0;
|
var c = parseInt(l.find('#giftCount').val()) || 0;
|
||||||
@@ -526,9 +535,11 @@
|
|||||||
if (selectedNumber) l.find('#giftProp').val(selectedNumber);
|
if (selectedNumber) l.find('#giftProp').val(selectedNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleGiftProp(l) {
|
function toggleGiftProp(l, typeValue) {
|
||||||
var isProp = (parseInt(l.find('#giftType').val()) || 1) === 3;
|
var t = (typeValue !== undefined && typeValue !== null)
|
||||||
l.find('.gift-prop-item, .gift-prop-type-item').toggle(isProp);
|
? 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 ? '保存成功' : '保存失败')) } }) }
|
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 ? '保存成功' : '保存失败')) } }) }
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
<script>
|
<script>
|
||||||
layui.config({
|
layui.config({
|
||||||
base: './dist/' //指定 layuiAdmin 项目路径
|
base: './dist/' //指定 layuiAdmin 项目路径
|
||||||
, version: '2.11.9'
|
, version: '2.11.10'
|
||||||
}).use('index', function () {
|
}).use('index', function () {
|
||||||
var layer = layui.layer, admin = layui.admin;
|
var layer = layui.layer, admin = layui.admin;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user