fix: 账号页闪烁/浏览类型/截图复制/时区统一
This commit is contained in:
@@ -842,7 +842,6 @@
|
||||
<select id="scheduleBrowseType" style="max-width: 200px; padding: 10px; border: 1px solid #ddd; border-radius: 5px; font-size: 14px;">
|
||||
<option value="注册前未读">注册前未读</option>
|
||||
<option value="应读" selected>应读</option>
|
||||
<option value="未读">未读</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -1731,10 +1730,23 @@
|
||||
}
|
||||
|
||||
// VIP functions
|
||||
function parseBeijingDateTime(value) {
|
||||
if (!value) return null;
|
||||
const str = String(value).trim();
|
||||
if (!str) return null;
|
||||
let iso = str.includes('T') ? str : str.replace(' ', 'T');
|
||||
// 统一按北京时间解析(除非字符串本身已带时区)
|
||||
const hasTimezone = /([zZ]|[+-]\d{2}:\d{2})$/.test(iso);
|
||||
if (!hasTimezone) iso = iso + '+08:00';
|
||||
const dt = new Date(iso);
|
||||
if (Number.isNaN(dt.getTime())) return null;
|
||||
return dt;
|
||||
}
|
||||
|
||||
function isVip(user) {
|
||||
if (!user.vip_expire_time) return false;
|
||||
const expireTime = new Date(user.vip_expire_time);
|
||||
return expireTime > new Date();
|
||||
const expireTime = parseBeijingDateTime(user.vip_expire_time);
|
||||
return expireTime ? expireTime > new Date() : false;
|
||||
}
|
||||
|
||||
function getVipBadge(user) {
|
||||
@@ -1746,8 +1758,8 @@
|
||||
|
||||
function getVipExpire(user) {
|
||||
if (!isVip(user)) return '';
|
||||
const expireTime = new Date(user.vip_expire_time);
|
||||
const daysLeft = Math.ceil((expireTime - new Date()) / (1000*60*60*24));
|
||||
const expireTime = parseBeijingDateTime(user.vip_expire_time);
|
||||
const daysLeft = expireTime ? Math.ceil((expireTime - new Date()) / (1000*60*60*24)) : 0;
|
||||
if (user.vip_expire_time === '2099-12-31 23:59:59') {
|
||||
return '<div class="user-info" style="color:#667eea;">永久VIP</div>';
|
||||
}
|
||||
|
||||
@@ -556,7 +556,6 @@
|
||||
<div class="toolbar-group">
|
||||
<select class="select-inline" id="batchBrowseType">
|
||||
<option value="应读">应读</option>
|
||||
<option value="未读">未读</option>
|
||||
<option value="注册前未读">注册前未读</option>
|
||||
</select>
|
||||
<label class="switch">
|
||||
@@ -718,7 +717,6 @@
|
||||
<label class="form-label">浏览类型</label>
|
||||
<select class="form-select" id="scheduleBrowseType">
|
||||
<option value="应读">应读</option>
|
||||
<option value="未读">未读</option>
|
||||
<option value="注册前未读">注册前未读</option>
|
||||
</select>
|
||||
</div>
|
||||
@@ -1313,7 +1311,7 @@
|
||||
'</div>' + progressHtml +
|
||||
'<div class="account-card-actions">' +
|
||||
'<select class="select-inline browse-type" data-id="' + acc.id + '">' +
|
||||
'<option value="应读">应读</option><option value="未读">未读</option><option value="注册前未读">注册前未读</option>' +
|
||||
'<option value="应读">应读</option><option value="注册前未读">注册前未读</option>' +
|
||||
'</select>' +
|
||||
'<button class="btn btn-primary btn-small" onclick="startAccount(\'' + acc.id + '\')" ' + (isRunning ? 'disabled' : '') + '>启动</button>' +
|
||||
'<button class="btn btn-outlined btn-small" onclick="stopAccount(\'' + acc.id + '\')" ' + (!isRunning ? 'disabled' : '') + '>停止</button>' +
|
||||
@@ -1868,7 +1866,6 @@
|
||||
|
||||
function copyScreenshotImage(imgSrc) {
|
||||
const img = new Image();
|
||||
img.crossOrigin = 'anonymous';
|
||||
img.onload = function() {
|
||||
const canvas = document.createElement('canvas');
|
||||
canvas.width = img.naturalWidth;
|
||||
|
||||
Reference in New Issue
Block a user