| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- <!-- 探险管理模块 -->
- <div class="layui-card">
- <div class="layui-card-header">探险管理</div>
- <div class="layui-card-body">
- <form class="layui-form" id="chapterForm">
- <div class="layui-form-item">
- <label class="layui-form-label">关卡ID:</label>
- <div class="layui-input-inline">
- <input type="number" id="chapterLevelID" placeholder="关卡ID, 空或0所有关卡" class="layui-input">
- </div>
- <div class="layui-input-inline">
- <input type="number" id="chapterLevelCount" placeholder="当前挑战次数" min="0" value="0"
- class="layui-input">
- </div>
- <div class="layui-input-inline double-button">
- <button id="setChapterBtn" class="layui-btn layui-btn-normal" type="button"
- onclick="submitChapterForm()">设置次数</button>
- <button id="resetAllBtn" class="layui-btn layui-btn-danger" type="button"
- onclick="resetAllChapters()">重置所有关卡次数</button>
- <button id="fastLevelBtn" class="layui-btn layui-btn-normal" type="button"
- onclick="fastLevel()">快速通关</button>
- </div>
- </div>
- <div class="layui-form-item">
- <!-- 新增红色备注 -->
- <div style="color: red; margin-left:50px; margin-top: 5px; font-size: 18px;">
- *【关卡ID】请参考配置表中【T-探险-关卡.xlsx】表中的关卡ID
- </div>
- </div>
- </form>
- </div>
- </div>
- <script>
- // 探险管理模块的提交逻辑
- function submitChapterForm() {
- chapterLevelID = $("#chapterLevelID").val();
- if (!chapterLevelID) {
- chapterLevelID = 0
- }
- if (chapterLevelID < 0) {
- layer.msg("关卡ID错误", { icon: 3 });
- return
- }
- chapterLevelCount = $("#chapterLevelCount").val();
- var params = [
- "set",
- chapterLevelID,
- chapterLevelCount
- ]
- toChapterSubmitForm(params); // 调用统一的 submitForm 方法
- }
- // 重置所有关卡次数
- function resetAllChapters() {
- var params = [
- "set",
- "0",
- "0"
- ]
- toChapterSubmitForm(params);
- }
- // 快速通关
- function fastLevel() {
- chapterLevelID = $("#chapterLevelID").val();
- if (!chapterLevelID) {
- chapterLevelID = 0
- }
- if (chapterLevelID < 0) {
- layer.msg("关卡ID错误", { icon: 3 });
- return
- }
- var params = [
- "level",
- chapterLevelID
- ]
- toChapterSubmitForm(params);
- }
- // 提交表单
- function toChapterSubmitForm(params) {
- var command = "/gm chapter " + params.join(" ")
- // 提交表单
- submitForm(command); // 调用统一的 submitForm 方法
- }
- </script>
|