From a8eb927541d9428c0e0635aff03bcf322778d436 Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Mon, 4 Jan 2021 12:22:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=9C=E4=B8=9C=E5=B0=8F?= =?UTF-8?q?=E7=AA=9D=E5=9B=A0=E8=A3=85=E9=A5=B0=E9=A2=86=E4=BA=AC=E8=B1=86?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=B8=8B=E7=BA=BF=E5=AF=BC=E8=87=B4=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E5=87=BA=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Loon/lxk0301_LoonTask.conf | 2 +- docker/crontab_list.sh | 2 +- jd_small_home.js | 40 ++++++++++++++++++++------------------ 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/Loon/lxk0301_LoonTask.conf b/Loon/lxk0301_LoonTask.conf index 63977d1f..13ff0c41 100644 --- a/Loon/lxk0301_LoonTask.conf +++ b/Loon/lxk0301_LoonTask.conf @@ -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 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日常任务 cron "30 8 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_crazy_joy.js,tag=疯狂的joy日常任务 diff --git a/docker/crontab_list.sh b/docker/crontab_list.sh index 29945110..4dbf59b8 100644 --- a/docker/crontab_list.sh +++ b/docker/crontab_list.sh @@ -5,7 +5,7 @@ ##############短期活动############## # 健康抽奖机(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 diff --git a/jd_small_home.js b/jd_small_home.js index 096519e6..46a21a0b 100644 --- a/jd_small_home.js +++ b/jd_small_home.js @@ -2,7 +2,7 @@ * @Author: lxk0301 https://github.com/lxk0301 * @Date: 2020-11-12 11:42:12 * @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 @@ -274,25 +274,27 @@ function queryFurnituresCenterList() { if (safeGet(data)) { data = JSON.parse(data); if (data.head.code === 200) { - let { buy, list } = data.body; - $.canBuyList = []; - list.map((item, index) => { - if (buy.some((buyItem) => buyItem === item.id)) return - $.canBuyList.push(item); - }) - $.canBuyList.sort(sortByjdBeanNum); - if ($.canBuyList[0].needWoB <= $.woB) { - await furnituresCenterPurchase($.canBuyList[0].id, $.canBuyList[0].jdBeanNum); - } else { - console.log(`\n兑换${$.canBuyList[0].jdBeanNum}京豆失败:当前wo币${$.woB}不够兑换所需的${$.canBuyList[0].needWoB}WO币`) - message += `【装饰领京豆】兑换${$.canBuyList[0].jdBeanNum}京豆失败,原因:WO币不够\n`; + if (data.body) { + let { buy, list } = data.body; + $.canBuyList = []; + list.map((item, index) => { + if (buy.some((buyItem) => buyItem === item.id)) return + $.canBuyList.push(item); + }) + $.canBuyList.sort(sortByjdBeanNum); + if ($.canBuyList[0].needWoB <= $.woB) { + await furnituresCenterPurchase($.canBuyList[0].id, $.canBuyList[0].jdBeanNum); + } else { + 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 - // } - // } } } }