|
@@ -175,6 +175,18 @@ async function tryCheckCollectList() {
|
|
|
}
|
|
}
|
|
|
magicJS.notification.appendNotifyInfo(text);
|
|
magicJS.notification.appendNotifyInfo(text);
|
|
|
doCheckShowCollectText(collectDict);
|
|
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) {
|
|
function doCheckShowCollectText(collectDict) {
|
|
@@ -186,15 +198,21 @@ function doCheckShowCollectText(collectDict) {
|
|
|
let goodsNum = goodsList.length;
|
|
let goodsNum = goodsList.length;
|
|
|
let originNum = 0;
|
|
let originNum = 0;
|
|
|
let buyInNum = 0;
|
|
let buyInNum = 0;
|
|
|
|
|
+ let buyTotalCost = 0;
|
|
|
for (let i = 0; i < goodsNum; i++) {
|
|
for (let i = 0; i < goodsNum; i++) {
|
|
|
const goodsInfo = goodsList[i];
|
|
const goodsInfo = goodsList[i];
|
|
|
if (goodsInfo.price > 0) {
|
|
if (goodsInfo.price > 0) {
|
|
|
buyInNum++;
|
|
buyInNum++;
|
|
|
|
|
+ buyTotalCost += goodsInfo.price;
|
|
|
} else {
|
|
} else {
|
|
|
originNum++;
|
|
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++;
|
|
sortId++;
|
|
|
}
|
|
}
|
|
|
text += `\n`;
|
|
text += `\n`;
|
|
@@ -253,6 +271,30 @@ async function queryOtherUserViewGoodsList(hashId, type = 1, page = 1) {
|
|
|
});
|
|
});
|
|
|
return result;
|
|
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());
|
|
Main().catch((e) => magicJS.logger.log(`-\n ${e}`)).finally(() => magicJS.done());
|
|
|
|
|
|