| | |
| | | width: 100%; |
| | | height: 100%; |
| | | background-color: rgba(0,0,0,0.5); |
| | | display: flex; |
| | | display: none; |
| | | justify-content: center; |
| | | align-items: center; |
| | | z-index: 9999; |
| | |
| | | border-radius: 5px; |
| | | box-shadow: 0px 0px 20px rgba(0,0,0,0.3); |
| | | text-align: center; |
| | | } |
| | | |
| | | button:hover { |
| | | background-color: #0069d9; |
| | | } |
| | | </style> |
| | | </head> |
| | |
| | | <div class="popup-content"> |
| | | <h2 style="font-size: 28px;margin-bottom: 10px;">许可证即将过期</h2> |
| | | <div id="popup-text" style="font-size: 28px;color: red"></div> |
| | | <p style="font-size: 26px;margin-bottom: 20px;margin-top: 20px;color: blue">请联系立库公司商务续约!!!</p> |
| | | <button style="background-color: #007bff;color: #fff;border: none;padding: 10px 20px;border-radius: 5px;cursor: pointer;font-size: 16px;" onclick="hidePopup()">关闭</button> |
| | | </div> |
| | | </div> |
| | |
| | | var popupText = document.getElementById('popup-text'); |
| | | // 假设后台返回的字符串为 responseString |
| | | if (res!=""){ |
| | | var responseString = "许可证即将过期,剩余有效期:"+res+"天!"; |
| | | // 获取当前日期 |
| | | const currentDate = new Date(); |
| | | // 创建新日期对象并添加天数 |
| | | const newDate = new Date(); |
| | | newDate.setDate(currentDate.getDate() + res + 1); |
| | | // 将字符串设置为弹窗内容的文本 |
| | | popupText.textContent = responseString; |
| | | //关闭设备 |
| | | // document.getElementById('popup').style.display = 'none'; |
| | | popupText.textContent = "许可证将于" + new Intl.DateTimeFormat('zh-CN').format(newDate) + "过期,剩余有效期:" + res + "天!"; |
| | | }else { |
| | | document.getElementById('popup').style.display = 'none'; |
| | | } |
| | |
| | | success: function (res) { |
| | | if (res.code == 200) { |
| | | let days = res.data |
| | | if (days <= 30) { |
| | | if (days <= 15) { |
| | | showPopup(res.data) |
| | | } else { |
| | | showPopup(""); |