shawenguan 1 vuosi sitten
vanhempi
commit
b5c09493d7
1 muutettua tiedostoa jossa 9 lisäystä ja 6 poistoa
  1. 9 6
      Scripts/wubian/wubianOthersCollectList.js

+ 9 - 6
Scripts/wubian/wubianOthersCollectList.js

@@ -181,7 +181,7 @@ async function tryCheckCollectList() {
         let buyArtList = retDetail.data || [];
         for (let j = 0; j < buyArtList.length; j++) {
             let artInfo = buyArtList[j];
-            buyText += `   ${artInfo.artName} 均价:¥${artInfo.unitPrice} 数量:${artInfo.num}\n`;
+            buyText += `   ${artInfo.artName.padEnd(10)} 均价:¥${artInfo.unitPrice.toFixed(2).padStart(6)} 数量:${artInfo.num.toString().padStart(4)}\n`;
         }
     } else {
         buyText += `${retDetail?.msg || '查询失败'}`;
@@ -208,9 +208,11 @@ function doCheckShowCollectText(collectDict) {
                 originNum++;
             }
         }
-        text += `${sortId}、${artInfo.title}\n总数量:${goodsNum} 原有数量:${originNum} 买入数量:${buyInNum}`;
+        text += `${sortId.toString().padStart(2)}、${artInfo.title}\n`;
+        text += `    总数量:${goodsNum.toString().padStart(4)}  原有数量:${originNum.toString().padStart(4)}  买入数量:${buyInNum.toString().padStart(4)}`;
         if (buyInNum > 0) {
-            text += ` 均价:¥${buyTotalCost / buyInNum}`;
+            const averagePrice = (buyTotalCost / buyInNum).toFixed(2);
+            text += `  均价:¥${averagePrice.toString().padStart(7)}`;
         }
         text += `\n\n`;
         sortId++;
@@ -219,6 +221,7 @@ function doCheckShowCollectText(collectDict) {
     magicJS.notification.appendNotifyInfo(text);
 }
 
+
 async function queryAllOtherUserViewGoodsList(hashId, type = 1) {
     let page = 1;
     let retList = [];
@@ -240,10 +243,10 @@ async function queryAllOtherUserViewGoodsList(hashId, type = 1) {
 
 /**
  * 查询其他用户产品拥有的情况
- * @param {*} hashId 
+ * @param {*} hashId
  * @param {*} type 1=藏品 2=盲盒 3=道具 4=已发布 5=已售出
- * @param {*} page 
- * @returns 
+ * @param {*} page
+ * @returns
  */
 async function queryOtherUserViewGoodsList(hashId, type = 1, page = 1) {
     const url = `https://api.wubian.pro/vmf/app/user/otherUserViewGoodsList`;