修复东东小窝因装饰领京豆功能下线导致脚本出错

This commit is contained in:
lxk0301
2021-01-04 12:22:11 +08:00
parent f3b3f3c5de
commit 27b5aa96c0
3 changed files with 23 additions and 21 deletions

View File

@@ -120,6 +120,6 @@ cron "10-20/5 12 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd
# 金融打卡领年终奖 # 金融打卡领年终奖
# cron "10 6 1-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js, tag=金融打卡领年终奖 # cron "10 6 1-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js, tag=金融打卡领年终奖
# 健康抽奖机 # 健康抽奖机
cron "10 0 1-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_health.js,tag=健康抽奖机 cron "10 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_health.js,tag=健康抽奖机
# 疯狂的joy日常任务 # 疯狂的joy日常任务
cron "30 8 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_crazy_joy.js,tag=疯狂的joy日常任务 cron "30 8 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_crazy_joy.js,tag=疯狂的joy日常任务

View File

@@ -5,7 +5,7 @@
##############短期活动############## ##############短期活动##############
# 健康抽奖机(2020.12.31活动过期) # 健康抽奖机(2020.12.31活动过期)
10 0 1-31 12 * node /scripts/jd_health.js >> /scripts/logs/jd_health.log 2>&1 10 0 * * * node /scripts/jd_health.js >> /scripts/logs/jd_health.log 2>&1
##############长期活动############## ##############长期活动##############
# 签到 # 签到
0 0,18 * * * cd /scripts && node jd_bean_sign.js >> /scripts/logs/jd_bean_sign.log 2>&1 0 0,18 * * * cd /scripts && node jd_bean_sign.js >> /scripts/logs/jd_bean_sign.log 2>&1

View File

@@ -2,7 +2,7 @@
* @Author: lxk0301 https://github.com/lxk0301 * @Author: lxk0301 https://github.com/lxk0301
* @Date: 2020-11-12 11:42:12 * @Date: 2020-11-12 11:42:12
* @Last Modified by: lxk0301 * @Last Modified by: lxk0301
* @Last Modified time: 2020-12-23 14:27:20 * @Last Modified time: 2021-1-4 14:27:20
*/ */
/* /*
东东小窝 https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_small_home.js 东东小窝 https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_small_home.js
@@ -274,25 +274,27 @@ function queryFurnituresCenterList() {
if (safeGet(data)) { if (safeGet(data)) {
data = JSON.parse(data); data = JSON.parse(data);
if (data.head.code === 200) { if (data.head.code === 200) {
let { buy, list } = data.body; if (data.body) {
$.canBuyList = []; let { buy, list } = data.body;
list.map((item, index) => { $.canBuyList = [];
if (buy.some((buyItem) => buyItem === item.id)) return list.map((item, index) => {
$.canBuyList.push(item); if (buy.some((buyItem) => buyItem === item.id)) return
}) $.canBuyList.push(item);
$.canBuyList.sort(sortByjdBeanNum); })
if ($.canBuyList[0].needWoB <= $.woB) { $.canBuyList.sort(sortByjdBeanNum);
await furnituresCenterPurchase($.canBuyList[0].id, $.canBuyList[0].jdBeanNum); if ($.canBuyList[0].needWoB <= $.woB) {
} else { await furnituresCenterPurchase($.canBuyList[0].id, $.canBuyList[0].jdBeanNum);
console.log(`\n兑换${$.canBuyList[0].jdBeanNum}京豆失败:当前wo币${$.woB}不够兑换所需的${$.canBuyList[0].needWoB}WO币`) } else {
message += `【装饰领京豆】兑换${$.canBuyList[0].jdBeanNum}京豆失败,原因:WO币不够\n`; console.log(`\n兑换${$.canBuyList[0].jdBeanNum}京豆失败:当前wo币${$.woB}不够兑换所需的${$.canBuyList[0].needWoB}WO币`)
message += `【装饰领京豆】兑换${$.canBuyList[0].jdBeanNum}京豆失败,原因:WO币不够\n`;
}
// for (let canBuyItem of $.canBuyList) {
// if (canBuyItem.needWoB <= $.woB) {
// await furnituresCenterPurchase(canBuyItem.id, canBuyItem.jdBeanNum);
// break
// }
// }
} }
// for (let canBuyItem of $.canBuyList) {
// if (canBuyItem.needWoB <= $.woB) {
// await furnituresCenterPurchase(canBuyItem.id, canBuyItem.jdBeanNum);
// break
// }
// }
} }
} }
} }