From 1dc54cf10aff5911425274e77aa5152afa165924 Mon Sep 17 00:00:00 2001 From: wisz2021 Date: Mon, 31 May 2021 09:56:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E5=AE=88=E6=8A=A4=E6=98=9F?= =?UTF-8?q?=E6=8A=BD=E5=A5=96=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jd_xtg.js | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/jd_xtg.js b/jd_xtg.js index c54dc5a4..03f2c8d1 100644 --- a/jd_xtg.js +++ b/jd_xtg.js @@ -1,6 +1,6 @@ /* 家电星推官脚本 -Last Modified time: 2021-05-27 18:15:04 +Last Modified time: 2021-05-31 9:15:04 家电星推官活动地址:https://3.cn/-1eD1VOa?_ts=1622072397979&utm_source=iosapp&utm_medium=appshare&utm_campaign=t_335139774&utm_term=CopyURL&ad_od=share&gx=RnFtxGZZPTONndRP--twDLBLeC4DoX3_2wf2 活动时间:2021年5月27日 00:00:00-2021年6月18日 23:59:59 京豆先到先得!!!!!!!!!!! @@ -108,6 +108,7 @@ const JD_API_HOST = "https://guardianstarjd.m.jd.com/star"; $.j = index; $.times = 0; await JD_XTG(true); + await indexInfo();//抽奖 } await showMsg(); } @@ -390,6 +391,58 @@ function doSupport(shareId) { }); }); } +function indexInfo() { + return new Promise(async (resolve) => { + const options = taskPostUrl('index/indexInfo', 'indexInfo', `starId=${$.activeId}&type=null`); + $.post(options, async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`); + console.log(`${$.name} API请求失败,请检查网路重试`); + } else { + data = JSON.parse(data); + if (data && data.code === 200) { + $.starPrizeVoList = (data.data.starPrizeVoList || []).filter(vo => vo.status === 0 && data.data.myTotalStar >= vo['starGradeNum']); + for (let item of $.starPrizeVoList) { + await lottery(item['id']); + // await $.wait(500); + } + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} +function lottery(id) { + return new Promise(async (resolve) => { + const options = taskPostUrl('task/lottery', 'lottery', `starId=${$.activeId}&id=${id}`); + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`); + console.log(`${$.name} API请求失败,请检查网路重试`); + } else { + data = JSON.parse(data); + if (data && data.code === 200) { + if (data.data && data.data.status === 1) { + console.log(`京东账号${$.index} ${$.nickName || $.UserName}恭喜中奖\n【${$.activeId}】星推官抽奖详情${JSON.stringify(data)}\n`); + } else { + console.log(`【${$.activeId}】星推官抽奖:未中奖\n`) + } + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} function TotalBean() { return new Promise(async (resolve) => { const options = {