promptAndAlert.js 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. function prompts(text2,input,fun1,fun2) {
  2. $("body").prepend('<div id="alertDiv" style="z-index:100;font-size:20px;width: 100%;height: 100%;position :absolute ;background: rgba(0,0,0,0.5);display: none;"> ' +
  3. ' <div style="border-radius:25px;width: 300px;height: 220px; top: 0; left: 0; right: 0; bottom: 0; margin:200px auto 0 auto ;' +
  4. 'background: white;text-align: center;padding: 20px;"> <label style="font-size:25px;">系统提示</label> ' +
  5. ' <div style="margin-top:10px;"> <label id="syyText2">是否提供手机号</label><br></div> <input id="syyInput" placeholder="请输入手机号" maxlength="11" style="font-size:20px;border: 1px solid #ccc;width: 100%;height:15%;margin-top: 5%;"><br><br> ' +
  6. ' <table width="100%" style="height:60px;border-top: 1px solid #a0f7dd;"> ' +
  7. ' <tr><td style="border-right: 1px solid #a0f7dd;"><b style="color: blue" id="syyCommit">提交</b></td> ' +
  8. ' <td><b style="color: blue" id="colsefunid">关闭</b></td> </tr> </table> </div> </div>');
  9. document.getElementById("alertDiv").style.display = "";
  10. // document.getElementById("syyText1").innerHTML=text1
  11. document.getElementById("syyText2").innerHTML=text2
  12. document.getElementById("syyInput").value=input;
  13. document.getElementById("syyCommit").onclick=fun1
  14. document.getElementById("colsefunid").onclick=fun2
  15. }
  16. function sprompt(text2,input,fun1,fun2,fun3) {
  17. $("body").prepend('<div id="alertDiv" style="z-index:100;font-size:20px;width: 100%;height: 100%;position :absolute ;background: rgba(0,0,0,0.5);display: none;"> ' +
  18. ' <div style="border-radius:25px;width: 300px;height: 190px; top: 0; left: 0; right: 0; bottom: 0; margin:200px auto 0 auto ;' +
  19. 'background: white;text-align: center;padding: 20px;"> <label style="font-size:25px;">系统提示</label> ' +
  20. ' <div style="margin-top:30px;"> <label id="syyText2">是否提供手机号</label><br></div> <input id="syyInput" placeholder="请输入手机号" maxlength="11" style="font-size:20px;border: 1px solid #ccc;width: 100%;height:15%;margin-top: 5%;"><br> ' +
  21. ' <table width="100%" style="height:60px;border-top: 1px solid #a0f7dd;margin-top: 15px;"> ' +
  22. ' <tr><td style="border-right: 1px solid #a0f7dd;"><b style="color: blue" id="syyCommit">提交</b></td> ' +
  23. ' <td><b style="color: blue" id="colsefunid">关闭</b></td> </tr> </table> </div> </div>');
  24. document.getElementById("alertDiv").style.display = "";
  25. if(fun3=="alert"){
  26. document.getElementById("syyInput").style.display = "none";
  27. }else{
  28. document.getElementById("syyInput").style.display = "";
  29. }
  30. // document.getElementById("syyText1").innerHTML=text1
  31. document.getElementById("syyText2").innerHTML=text2
  32. document.getElementById("syyInput").value=input;
  33. document.getElementById("syyCommit").onclick=fun1
  34. document.getElementById("colsefunid").onclick=fun2
  35. }
  36. function alerts(text2,fun1){
  37. $("body").prepend('<div id="syyalertDiv" style="z-index:200;font-size:20px;width: 100%;height: 100%;position :absolute ;background: rgba(0,0,0,0.5);display: none;"> ' +
  38. ' <div style="border-radius:25px;width: 300px;height: 180px; top: 0; left: 0; right: 0; bottom: 0; margin:200px auto 0 auto ;' +
  39. 'background: white;text-align: center;padding: 20px;"> <label style="font-size:25px;">系统提示</label> ' +
  40. ' <div style="margin-top:30px;"> <label id="Text2syy">是否提供手机号</label><br></div> ' +
  41. ' <table width="100%" style="margin-top: 20px;height:60px;border-top: 1px solid #a0f7dd;"> ' +
  42. ' <tr><td ><b style="color: blue" id="Commitsyy">确定</b></td> ' +
  43. ' </tr> </table> </div> </div>');
  44. document.getElementById("syyalertDiv").style.display = "";
  45. // debugger
  46. try{
  47. document.getElementById("alertDiv").style.display = "none";
  48. }catch{}
  49. // document.getElementById("syyText1").innerHTML=text1
  50. document.getElementById("Text2syy").innerHTML=text2
  51. document.getElementById("Commitsyy").onclick=fun1
  52. }