shawenguan 1 سال پیش
والد
کامیت
f199401443
1فایلهای تغییر یافته به همراه36 افزوده شده و 5 حذف شده
  1. 36 5
      Scripts/wubian/wubianHelper.js

+ 36 - 5
Scripts/wubian/wubianHelper.js

@@ -421,13 +421,14 @@ function handleNoticeInfo() {
         let marketGroupLstDict = magicJS.data.read(WuBianConstKey.AllMarketGroupListData, {});
         let baseLstDict = [];
         let relationLstDict = [];
-        let sortId = 1;
+        let tempId = 1;
         for (let artId in marketGroupLstDict) {
             const artInfo = marketGroupLstDict[artId];
             const groupName = artInfo.groupName;
             const artInfoA = {
+                sortId: arguments.sortId,
                 hash_id: artInfo.artId,
-                id: sortId,
+                id: tempId,
                 image: artInfo.image,
                 title: artInfo.title,
                 event: "art",
@@ -437,8 +438,9 @@ function handleNoticeInfo() {
                 baseLstDict[groupName] = [];
             }
             baseLstDict[groupName].push(artInfoA);
-            sortId += 1;
+            tempId += 1;
             const artInfoB = {
+                sortId: arguments.sortId,
                 jumpType: "",
                 url: "",
                 timeList: [],
@@ -468,6 +470,8 @@ function handleNoticeInfo() {
             let artLstSubText = ``;
             let baseList = baseLstDict[albumName] || [];
             let relationList = relationLstDict[albumName] || [];
+            baseList.sort((a, b) => a.sortId - b.sortId);
+            relationList.sort((a, b) => a.sortId - b.sortId);
             relationAllList = relationAllList.concat(relationList);
             for (let i = 0; i < baseList.length; ++i) {
                 let element = baseList[i];
@@ -486,7 +490,8 @@ function handleNoticeInfo() {
             };
             artLstText += `<p><strong><span style="color:#E53333;">${artLstSubText}<br /></span></strong></p>`;
         }
-        magicJS.logger.info(artLstText);
+        // magicJS.logger.info(artLstText);
+        let dateStr = magicJS.formatDate(new Date(), 'yyyy年M月-d日');
         let content = `
             <p><br /></p>
             <p style="white-space:normal;"><strong>以下过往开放过的藏品:</strong></p>
@@ -497,9 +502,11 @@ function handleNoticeInfo() {
             <p><strong><span style="color:#E53333;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span></strong></p>
             <p style="white-space:normal;text-align:right;"><strong><b>无边星链运营团队</b></strong></p>
             <p style="white-space:normal;text-align:right;"><strong><b><br /></b></strong></p>
-            <p style="white-space:normal;text-align:right;"><strong><b>2024年9月10日</b></strong></p>
+            <p style="white-space:normal;text-align:right;"><strong><b>${dateStr}</b></strong></p>
             <p><br /></p>
         `;
+        dateStr = magicJS.formatDate(new Date(), 'yyyy-MM-dd HH:mm:ss');
+        rspData.data.createdTime = dateStr;
         rspData.data.content = content;
         rspData.data.relationList = relationAllList;
         rspData.data.title = '欢迎来到神秘空间';
@@ -528,11 +535,35 @@ function hadnleMarketGroupList() {
     if (rspData.code != 200) {
         return;
     }
+    let reqData = getRequestPlainData();
     let dataDict = magicJS.data.read(WuBianConstKey.AllMarketGroupListData, {});
+    let sortId = (reqData.page - 1) * 20 + 1;
     let list = rspData.data?.list || [];
+    let groupName = '';
+    let nowTime = Date.now();
     for (let i = 0; i < list.length; ++i) {
         let item = list[i];
         dataDict[item.artId] = item;
+        item.sortId = sortId;
+        item.onSale = 1;
+        item.updateTime = nowTime;
+        sortId += 1;
+        groupName = item.groupName;
+    }
+    for (let artId in dataDict) {
+        let item = dataDict[artId];
+        if (item.updateTime == void 0) {
+            item.updateTime = 0;
+        }
+        if (item.sortId == void 0) {
+            item.sortId = 9999;
+        }
+        if (item.updateTime < nowTime - 2 * 24 * 3600 * 1000) {
+            item.onSale = 0;
+            item.sortId = 9999;
+        } else {
+            item.onSale = 1;
+        }
     }
     magicJS.data.write(WuBianConstKey.AllMarketGroupListData, dataDict);
 }