/** 跳转的代码 **/ let jumpOldContent = $("#head").attr("content"); const jumpContent = "width=device-width, initial-scale=1,maximum-scale=1,minimum-scale=1"; const jumpPageCount = parseInt($(".get_page_count").html()); let jumpPage = parseInt($(".get_page").html()); const jumpError = ['已经是第一页了', '已经是最后一页了', '跳转页数超出的范围', '已经在当前页了无需跳转']; const setJumpPage= function(){ const report_info = $(".report_info").html(); const PageInfo = $(".get_page_info").html(); let url = ""; if (report_info !== null && report_info !== undefined && report_info !== '') { var report_info_obj = eval("(" + report_info + ")"); if (report_info_obj.url !== undefined && report_info_obj.url !== null && report_info_obj.url !== '') { url = report_info_obj.url; } } let jumpScale=getScale(); let jumpTransform = 0.84; let jumpBottom = 20; if (jumpScale !== 1) { jumpTransform = 0.84 / jumpScale; jumpBottom = 1 / jumpScale * 20 + (1 / jumpScale - 1) * 36 / 2; } const pageDiv = '
\n' + ' \n' + '
'; $(".condition-box").append(pageDiv); const jump_interface_page = '
\n' + '
' + ' ' + '
' + '
'; const jump_interface_error = '
' + '
' + ' ' + '
' + '
'; $("body").append(jump_interface_page); $("body").append(jump_interface_error); } setJumpPage() //上一页 document.getElementById("prev_btn").onclick = function () { jumpSkip(0); }; //下一页 document.getElementById("next_btn").onclick = function () { jumpSkip(1); }; //跳转功能代码 function jumpSkip(type) { var jumpNumber = jumpPage; var errorBool = false; if (type == 0) { jumpPage = jumpPage - 1; if (jumpPage < 1) { errorBool = true; } } else if (type == 1) { jumpPage = jumpPage + 1; if (jumpPage > jumpPageCount) { errorBool = true; } } else { var PageValue = document.getElementById("jumpNumber").value; if (typeof PageValue == "undefined" || PageValue == null || PageValue == "") { errorBool = true; } else { jumpPage = parseInt(PageValue); if (jumpPage == null || jumpPage < 1 || jumpPage > jumpPageCount) { errorBool = true; } if (jumpNumber == jumpPage) { type = 3; errorBool = true; } } } if (errorBool) { jumpPage = jumpNumber; document.getElementById("tip-content-div").innerHTML = jumpError[type]; $(".condition-box").addClass("none"); $("#head").attr("content", content); $(".jump-interface-error").removeClass("none"); } else { alert("JumpPage@" + jumpPage); } } //自定义键盘 const coolInput = new CoolInput({slt: '#jumpNumber'}); //跳转界面 document.getElementById("jump-phone-img").onclick = function () { jumpOldContent = $("#head").attr("content"); $(".condition-box").addClass("none"); $("#head").attr("content", jumpContent); $(".jump-interface-page").removeClass("none"); coolInput.cursorT = $("#jumpNumber").offset().top; }; //跳转 document.getElementById("jump").onclick = function () { $(".jump-interface-page").addClass("none"); $("#head").attr("content", jumpOldContent); $(".condition-box").removeClass("none"); jumpSkip(2); }; document.getElementById("cancel").onclick = function () { $(".jump-interface-page").addClass("none"); $("#head").attr("content", jumpOldContent); $(".condition-box").removeClass("none"); }; document.getElementById("esure").onclick = function () { $(".jump-interface-error").addClass("none"); $("#head").attr("content", jumpOldContent); $(".condition-box").removeClass("none"); }; document.getElementById("esure-cancel").onclick = function () { $(".jump-interface-error").addClass("none"); $("#head").attr("content", jumpOldContent); $(".condition-box").removeClass("none"); };