diff --git a/jd_bookshop.js b/jd_bookshop.js index fcf82081..a209fef7 100644 --- a/jd_bookshop.js +++ b/jd_bookshop.js @@ -25,6 +25,9 @@ const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; //IOS等用户直接用NobyDa的jd cookie let cookiesArr = [], cookie = '', message; const ACT_ID = 'dz2010100034444201', shareUuid = '28a699ac78d74aa3b31f7103597f8927' +let ADD_CART = false +ADD_CART = $.isNode() ? (process.env.PURCHASE_SHOPS ? process.env.PURCHASE_SHOPS : ADD_CART) : ($.getdata("ADD_CART") ? $.getdata("ADD_CART") : ADD_CART); +// 加入购物车开关,与东东小窝共享 let inviteCodes = [ '28a699ac78d74aa3b31f7103597f8927@2f14ee9c92954cf79829320dd482bf49@fdf827db272543d88dbb51a505c2e869@ce2536153a8742fb9e8754a9a7d361da@38ba4e7ba8074b78851e928af2b4f6b2', @@ -75,6 +78,7 @@ if ($.isNode()) { } await shareCodesFormat() await jdBeauty() + return } } })() @@ -98,6 +102,7 @@ async function jdBeauty() { await doHelpList() await getAllBook() await getMyBook() + await chargeGold() await getActContent(true) if ($.gold > 800) { console.log(`金币大于800,去抽奖`) @@ -107,8 +112,7 @@ async function jdBeauty() { $.gold -= 800 } } - if($.userInfo.storeGold) await chargeGold() - await helpFriends() + //await helpFriends() await showMsg(); } @@ -300,7 +304,7 @@ function getActContent(info = false, shareUuid = '') { if (!info) { const tasks = data.data.settingVo for (let task of tasks) { - if (['关注店铺', '加购商品'].includes(task.title)) { + if (['关注店铺'].includes(task.title)) { if (task.okNum < task.dayMaxNum) { console.log(`去做${task.title}任务`) await doTask(task.settings[0].type, task.settings[0].value) @@ -323,6 +327,11 @@ function getActContent(info = false, shareUuid = '') { await $.wait(500) } } + } else if (ADD_CART && ['加购商品'].includes(task.title)) { + if (task.okNum < task.dayMaxNum) { + console.log(`去做${task.title}任务`) + await doTask(task.settings[0].type, task.settings[0].value) + } } } }