shawenguan před 1 rokem
rodič
revize
0292a7c141

+ 43 - 1
Scripts/wubian/wubianOthersCollectList.js

@@ -175,6 +175,18 @@ async function tryCheckCollectList() {
     }
     magicJS.notification.appendNotifyInfo(text);
     doCheckShowCollectText(collectDict);
+
+    let retDetail = await getUserArtScoreInfo(othersHashId);
+    if (retDetail && retDetail.code == 200) {
+        let buyText = `当天购买的情况如下:` + '\n';
+        let buyArtList = retDetail.data || [];
+        for (let j = 0; j < buyArtList.length; j++) {
+            let artInfo = buyArtList[j];
+            buyText += `   ${artInfo.artName} 均价:¥${artInfo.unitPrice} 数量:${artInfo.num}\n`;
+        }
+        magicJS.notification.appendNotifyInfo(buyText);
+    }
+
 }
 
 function doCheckShowCollectText(collectDict) {
@@ -186,15 +198,21 @@ function doCheckShowCollectText(collectDict) {
         let goodsNum = goodsList.length;
         let originNum = 0;
         let buyInNum = 0;
+        let buyTotalCost = 0;
         for (let i = 0; i < goodsNum; i++) {
             const goodsInfo = goodsList[i];
             if (goodsInfo.price > 0) {
                 buyInNum++;
+                buyTotalCost += goodsInfo.price;
             } else {
                 originNum++;
             }
         }
-        text += `${sortId}、${artInfo.title}\n总数量:${goodsNum} 原有数量:${originNum} 买入数量:${buyInNum}\n\n`;
+        text += `${sortId}、${artInfo.title}\n总数量:${goodsNum} 原有数量:${originNum} 买入数量:${buyInNum}`;
+        if (buyInNum > 0) {
+            text += ` 均价:¥${buyTotalCost / buyInNum}`;
+        }
+        ext += `\n\n`;
         sortId++;
     }
     text += `\n`;
@@ -253,6 +271,30 @@ async function queryOtherUserViewGoodsList(hashId, type = 1, page = 1) {
     });
     return result;
 }
+async function getUserArtScoreInfo(userId) {
+    const url = `https://api.wubian.pro/vmf/app/index/getUserArtScoreInfo`;
+    const reqData = {
+        userId: userId
+    };
+    let options = {
+        url: url,
+        headers: gCommonHeaders,
+        body: JSON.stringify(reqData),
+    };
+    let result = await magicJS.http.post(options).then(response => {
+        try {
+            let rspData = response.body;
+            // magicJS.logger.info(`rspData=${JSON.stringify(rspData)}`);
+            return rspData;
+        } catch (e) {
+            magicJS.logger.error(e);
+        }
+    }).catch(err => {
+        const msg = `请求用户买入详情异常\n${JSON.stringify(err)}`;
+        magicJS.logger.error(msg);
+    });
+    return result;
+}
 
 Main().catch((e) => magicJS.logger.log(`-\n ${e}`)).finally(() => magicJS.done());
 

+ 9 - 4
Scripts/wubian/wubianScoreRank.js

@@ -112,10 +112,15 @@ async function tryCheckScoreRank() {
     for (let i = 0; i < rankList.length; i++) {
         const rankInfo = rankList[i];
         const hashId = rankInfo.hashId;
-        allUserCache[hashId] = {
-            nickName: rankInfo.nickName,
-            hashId: rankInfo.hashId,
-        };
+        if (!allUserCache[hashId]) {
+            allUserCache[hashId] = {
+                nickName: rankInfo.nickName,
+                hashId: rankInfo.hashId,
+            };
+        } else {
+            allUserCache[hashId].nickName = rankInfo.nickName;
+            allUserCache[hashId].hashId = rankInfo.hashId;
+        }
         if (rankInfo.isHide == 1) {
             // 不允许查看买入情况,跳过
             continue;