diff --git a/app/src/config/bazaar.ts b/app/src/config/bazaar.ts index 7485d02f8..5030a48de 100644 --- a/app/src/config/bazaar.ts +++ b/app/src/config/bazaar.ts @@ -50,20 +50,20 @@ export const bazaar = {
-
-
+
+
-
- @@ -76,13 +76,13 @@ export const bazaar = {
-
+
- @@ -94,13 +94,13 @@ export const bazaar = {
-
+
- @@ -112,13 +112,13 @@ export const bazaar = {
-
+
- @@ -130,13 +130,13 @@ export const bazaar = {
-
+
- @@ -173,6 +173,7 @@ export const bazaar = { name: item.name, repoURL: item.repoURL, repoHash: item.repoHash, + downloads: item.downloads, downloaded: false, }; return `
@@ -183,7 +184,7 @@ export const bazaar = {
${item.preferredName} ${item.name}
-
+
${item.preferredDesc || ""}
@@ -254,7 +255,7 @@ export const bazaar = {
${item.preferredName} ${item.name}
-
${item.preferredDesc || ""}
+
${item.preferredDesc || ""}
${item.preferredFunding ? `` : ""} @@ -725,13 +726,13 @@ export const bazaar = { }); } else if (selectElement.value === "2") { // 下载次数降序 Array.from(panelElement.querySelectorAll(".b3-card")).sort((a, b) => { - return parseInt(b.querySelector(".b3-card__info").lastElementChild.textContent) < parseInt(a.querySelector(".b3-card__info").lastElementChild.textContent) ? -1 : 1; + return JSON.parse(b.getAttribute("data-obj")).downloads < JSON.parse(a.getAttribute("data-obj")).downloads ? -1 : 1; }).forEach((item) => { html += item.outerHTML; }); } else if (selectElement.value === "3") { // 下载次数升序 Array.from(panelElement.querySelectorAll(".b3-card")).sort((a, b) => { - return parseInt(b.querySelector(".b3-card__info").lastElementChild.textContent) < parseInt(a.querySelector(".b3-card__info").lastElementChild.textContent) ? 1 : -1; + return JSON.parse(b.getAttribute("data-obj")).downloads < JSON.parse(a.getAttribute("data-obj")).downloads ? 1 : -1; }).forEach((item) => { html += item.outerHTML; });