进行了一些优化
This commit is contained in:
@@ -252,10 +252,6 @@
|
||||
}
|
||||
|
||||
// ===== 成功渲染 =====
|
||||
function metaChip(icon, label) {
|
||||
return '<span class="aksrt-dl-modal__chip"><i class="fa fas ' + icon + '" aria-hidden="true"></i>' + escapeHtml(label) + '</span>';
|
||||
}
|
||||
|
||||
function renderSuccess(payload, returnFocusEl) {
|
||||
payload = payload || {};
|
||||
const code = String(payload.extract_code || '').trim();
|
||||
@@ -266,6 +262,8 @@
|
||||
? Math.max(1, Math.round(payload.expires_in / 60))
|
||||
: 10;
|
||||
|
||||
const hintMsg = '点击下方按钮开始下载,链接 ' + expiresIn + ' 分钟内有效。';
|
||||
|
||||
let body = '';
|
||||
if (code !== '') {
|
||||
body +=
|
||||
@@ -275,11 +273,12 @@
|
||||
' <code class="aksrt-dl-modal__code">' + safeCode + '</code>' +
|
||||
' <button type="button" class="aksrt-dl-modal__copy" data-copy="' + safeCodeAttr + '"><span class="aksrt-dl-modal__copy-text">复制</span></button>' +
|
||||
' </div>' +
|
||||
'</div>';
|
||||
'</div>' +
|
||||
'<p class="aksrt-dl-modal__msg">' + escapeHtml(hintMsg) + '</p>';
|
||||
} else if (has) {
|
||||
body += '<p class="aksrt-dl-modal__alert aksrt-dl-modal__alert--warn">下载源标记了提取码,但接口未返回具体内容,请检查资源下载源的 extract_code 字段。</p>';
|
||||
} else {
|
||||
body += '<p class="aksrt-dl-modal__msg">点击下方按钮开始下载,文件请及时保存到本地。</p>';
|
||||
body += '<p class="aksrt-dl-modal__msg">' + escapeHtml(hintMsg) + '</p>';
|
||||
}
|
||||
|
||||
const chips = [];
|
||||
@@ -287,11 +286,9 @@
|
||||
if (sourceLabel !== '') {
|
||||
chips.push('<span class="aksrt-dl-modal__chip"><i class="fa fas fa-box" aria-hidden="true"></i>' + escapeHtml(sourceLabel) + '</span>');
|
||||
}
|
||||
chips.push(metaChip('fa-clock', '链接 ' + expiresIn + ' 分钟内有效'));
|
||||
if (typeof payload.balance === 'number') {
|
||||
chips.push(metaChip('fa-coins', '积分余额 ' + payload.balance));
|
||||
if (chips.length) {
|
||||
body += '<div class="aksrt-dl-modal__meta">' + chips.join('') + '</div>';
|
||||
}
|
||||
body += '<div class="aksrt-dl-modal__meta">' + chips.join('') + '</div>';
|
||||
|
||||
open(
|
||||
dlView('success', {
|
||||
|
||||
Reference in New Issue
Block a user