1
This commit is contained in:
+9
-12
@@ -1063,8 +1063,7 @@
|
||||
return Boolean(
|
||||
!purchased &&
|
||||
!isArticlePrePurchased(item) &&
|
||||
(isArticlePrePurchase(item) ||
|
||||
(!getArticleId(item) && isPendingPublishArticle(item))),
|
||||
!getArticleId(item),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1880,13 +1879,15 @@
|
||||
}
|
||||
|
||||
// Buy dialog
|
||||
function requirePurchaseAuth() {
|
||||
if (ApiClient.getToken()) return true;
|
||||
CommonUtil.requireAuth(function () {});
|
||||
return false;
|
||||
}
|
||||
|
||||
function openPrePurchaseDialog(index) {
|
||||
const item = currentArticleList[index] || {};
|
||||
if (!ApiClient.getToken()) {
|
||||
layui.layer.msg("请先登录");
|
||||
window.location.href = "login.html";
|
||||
return;
|
||||
}
|
||||
if (!requirePurchaseAuth()) return;
|
||||
currentPurchaseMode = "prepurchase";
|
||||
currentArticleId = "";
|
||||
currentPrePurchaseItem = item;
|
||||
@@ -1903,11 +1904,7 @@
|
||||
}
|
||||
|
||||
function openBuyDialog(articleId) {
|
||||
if (!ApiClient.getToken()) {
|
||||
layui.layer.msg("请先登录");
|
||||
window.location.href = "login.html";
|
||||
return;
|
||||
}
|
||||
if (!requirePurchaseAuth()) return;
|
||||
currentPurchaseMode = "purchase";
|
||||
currentPrePurchaseItem = null;
|
||||
currentArticleId = articleId;
|
||||
|
||||
+2
-1
@@ -653,7 +653,8 @@
|
||||
'" target="_blank"><img src="' +
|
||||
escapeHtml(article.accountAvatar || article.expertAvatar) +
|
||||
'" alt="" class="article-item__icon" />' +
|
||||
(authorName ? '<span class="article-item__author">' + escapeHtml(authorName) + "</span>" : "") +
|
||||
(authorName ? '<span class="article-item__author">' +
|
||||
escapeHtml(authorName) + "</span>" : "") +
|
||||
'<span class="article-item__title">' +
|
||||
escapeHtml(article.title || "文章标题") +
|
||||
"</span>" +
|
||||
|
||||
Reference in New Issue
Block a user