661 lines
27 KiB
JavaScript
661 lines
27 KiB
JavaScript
/*
|
|
幸运抽奖beta v2.0.1
|
|
|
|
https://cjhy-isv.isvjcloud.com/wxDrawActivity/activity?activityId=56f3d081b3394dd0bf78c3b2ad8ada99
|
|
https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10046&templateId=20210714190900lhj011&activityId=1706582977057599489&nodeId=101001&prd=cjwx
|
|
https://jinggeng-isv.isvjcloud.com/ql/front/loadBlindBox?id=9e8080f28b7c3eeb018b7f17e0e01f0a&user_id=1000003788
|
|
https://hdb-isv.isvjcloud.com/h5/pages/pointDraw/pointDraw?id=aa5737bac99a9b9f5a4defad272ba8df&userId=131385
|
|
https://jingyun-rc.isvjcloud.com/h5/pages/turntable/turntable11?id=715459808c66e8fe5cac9bad3e1aab46&userId=11744671
|
|
https://gzsl-isv.isvjcloud.com/wuxian/mobileForApp/dist/views/pages/gameDZPWw_1.html?activityId=bdcbe31ba346449a93e95d749a1c493b
|
|
https://hzbz-isv.isvjcloud.com/bigdraw/draw.h4?id=d571bc02uzix
|
|
https://hdds-isv.isvjcloud.com/bigdraw/draw.h4?id=f0c6c831megx
|
|
|
|
export M_WX_LUCK_DRAW_URL=""
|
|
export M_WX_NOT_LUCK_DRAW_LIST="" # 积分不跑 @分割 例子: a2海外@马可波罗@合田家@风向标@罗技二手外设
|
|
export M_WX_BLACK_LUCK_DRAW_RULE="" # 拉黑的店铺 例子: FITURE|FITURE
|
|
export M_WX_LUCK_OPEN_MODE="0" # 强制开卡 0:不开卡 1:开卡 默认值0
|
|
export M_WX_NOT_LUCK_LIMIT="200" # 前N没有次数跳出 默认值100
|
|
|
|
cron: 1 1 1 1 *
|
|
const $ = new Env("M幸运抽奖");
|
|
*/
|
|
|
|
let mode = __dirname.includes('bear');
|
|
|
|
let activityUrl = decodeURIComponent(process.argv.splice(2)?.[0] || process.env.M_WX_LUCK_DRAW_URL);
|
|
|
|
if (mode) {
|
|
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10046&templateId=20210714190900lhj011&activityId=1706582977057599489&nodeId=101001&prd=cjwx";
|
|
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10080&templateId=20210714190901ggl011&activityId=1707242183950278658";
|
|
activityUrl = "https://lorealjdcampaign-rc.isvjcloud.com/interact/index?activityType=10021&activityId=1706684390047875073&templateId=20210527190900dazhuanpan01&nodeId=101001&prd=crm";
|
|
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10021&activityId=1714950726797340674&templateId=33ed5a4c-5aae-4b99-8b92-85c1c2e5a784&nodeId=101001&prd=cjwx";
|
|
activityUrl = "https://cjhy-isv.isvjcloud.com/wxDrawActivity/activity?activityId=56f3d081b3394dd0bf78c3b2ad8ada99";
|
|
activityUrl = "https://cjhy-isv.isvjcloud.com/wxDrawActivity/activity?activityId=8f740c7af17747c79d364434aa47c363";
|
|
activityUrl = "https://jinggeng-isv.isvjcloud.com/ql/front/loadBlindBox?id=9e8080f28b7c3eeb018b7f17e0e01f0a&user_id=1000003788";
|
|
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10062&templateId=20210824190900zjd011&activityId=1724100184810049538&prd=cjwx";
|
|
activityUrl = "https://gzsl-isv.isvjcloud.com/wuxian/mobileForApp/dist2/views/pages/gameDZP_57.html?activityId=e836f4faad8d4c99a25ab888288ebae8";
|
|
activityUrl = "https://hdb-isv.isvjcloud.com/h5/pages/turntable/turntable?id=3ebc29c4a08bf9192d0effd569a491af&userId=12303514";
|
|
activityUrl = "https://hdb-isv.isvjcloud.com/h5/pages/pointDraw/pointDraw?id=aa5737bac99a9b9f5a4defad272ba8df&userId=131385";
|
|
activityUrl = "https://hdb-isv.isvjcloud.com/h5/pages/luckyGrid/luckyGrid1?id=87cf65dd463e47e89807d763c43a3f5d&userId=10016542";
|
|
activityUrl = "https://jingyun-rc.isvjcloud.com/h5/pages/turntable/turntable11?id=6750963b19ec9483a51ae7ca400eb490&userId=688781";
|
|
activityUrl = "https://jingyun-rc.isvjcloud.com/h5/pages/turntable/turntable11?id=715459808c66e8fe5cac9bad3e1aab46&userId=11744671";
|
|
activityUrl = "https://gzsl-isv.isvjcloud.com/wuxian/mobileForApp/dist/views/pages/gameDZP_17.html?activityId=089149abd5454a58a924be1e774b9bd3";
|
|
activityUrl = "https://hzbz-isv.isvjcloud.com/bigdraw/draw.h4?id=d571bc02uzix";
|
|
activityUrl = "https://hdds-isv.isvjcloud.com/bigdraw/draw.h4?id=f0c6c831megx";
|
|
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10026&activityId=1729748317390970881&templateId=20210518190900jfcj011&nodeId=101001&prd=cjwx&adsource=tg_storePage";
|
|
activityUrl = "https://jinggeng-isv.isvjcloud.com/ql/front/showDrawOne?id=9e8080c08c1efd3e018c1f9780f5248b&user_id=1000117302";
|
|
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10026&activityId=1722146358967668737&templateId=20210518190900jfcj011&nodeId=101001&prd=cjwx";
|
|
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/?activityType=10021&activityId=1730049752963821570&templateId=2adaadf0-d16c-4533-b8b4-f32608f4db4c&nodeId=101001&prd=cjwx";
|
|
activityUrl = "https://cjhy-isv.isvjcloud.com/wxDrawActivity/activity?activityId=5aaf763d9a0e4e70a3bddc60d1d14e5d";
|
|
activityUrl = "https://hdb-isv.isvjcloud.com/h5/pages/pointDraw/pointDraw?id=c1d6a646cab33cd6f8786b7f627e30d2&userId=131385";
|
|
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10026&activityId=1729088940946305026&templateId=20210518190900jfcj011&nodeId=101001&prd=cjwx";
|
|
activityUrl = "https://hdds-isv.isvjcloud.com/bigdraw/draw.h4?id=a0ea1ac582gx";
|
|
activityUrl = "https://jinggeng-rc.isvjcloud.com/ql/front/showDrawOne?id=9e8080708c9a6bf2018ca1395354375a&user_id=64340";
|
|
activityUrl = "https://hzbz-isv.isvjcloud.com/bigdraw/draw.h4?id=1bd11547y87x";
|
|
activityUrl = "https://gzsl-isv.isvjcloud.com/wuxian/mobileForApp/dist/views/pages/gameDZPWw_1.html?activityId=bdcbe31ba346449a93e95d749a1c493b";
|
|
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10021&activityId=1753002607839600642&templateId=20210527190900dazhuanpan011&nodeId=101001&prd=cjwx";
|
|
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interaction/v2/30003/1003/?shopId=819551&activityId=1750765103755206657";
|
|
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interaction/v2/30003/1003/?activityId=1751949454304165889&shopId=1000015026";
|
|
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interaction/v2/10020/1001/?activityId=1752247172913238018&shopId=1000004064";
|
|
activityUrl = "https://jingyun-rc.isvjcloud.com/h5/pages/turntable/turntable?id=cdbe2aaf3b36048dba88c3c40ffaf59f&userId=1000311299";
|
|
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10021&activityId=1763155905388326913&templateId=2023120510021dzpcj02&nodeId=101001&prd=cjwx&adsource=tg_storePage";
|
|
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10042&activityId=1763084851989499905&templateId=20210714190900ggl011&nodeId=101001&prd=cjwx";
|
|
activityUrl = "https://jingyun-rc.isvjcloud.com/h5/pages/bestTicket/default?id=24cd1c31ced80756f0bf04e09ec098d2&userId=1000007503";
|
|
activityUrl = "https://jingyun-rc.isvjcloud.com/h5/pages/gashapon/gashapon?id=9e015d859e3506791672d63bfa21a069&userId=1000015664&actForm=single";
|
|
activityUrl = "https://lzkj-isv.isvjd.com/wxDrawActivity/activity/activity?activityId=4e314d7ccf594e129f04735705b1bdfc";
|
|
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interaction/v2/30003/1001/?shopId=819551&activityId=1783351662425452546";
|
|
}
|
|
|
|
const {
|
|
RunMode: ilIIi,
|
|
UserMode: IilllIlI,
|
|
baseCommonEnv: i1iiI1i,
|
|
baseCommonEnvKey: iIlI1IlI
|
|
} = require("./bear");
|
|
|
|
let lii1l11l = ["10020", "10021", "10026", "10031", "10041", "10042", "10046", "10062", "10063", "10073", "10080"];
|
|
process.env.M_WX_LUCK_ACTIVITY_TYPES ? process.env.M_WX_LUCK_ACTIVITY_TYPES.split(/[@,&|]/).forEach(lliii1I => lii1l11l.push(lliii1I)) : "";
|
|
i1iiI1i.notLuckDrawList = process.env.M_WX_NOT_LUCK_DRAW_LIST ? process.env.M_WX_NOT_LUCK_DRAW_LIST.split(/[@,&|]/) : "a2海外@马可波罗@合田家@风向标@罗技二手外设@小米建极".split("@");
|
|
i1iiI1i.blackLuckDrawRule = process.env.M_WX_BLACK_LUCK_DRAW_RULE || "FITURE|FITURE";
|
|
i1iiI1i.openCardMode = parseInt(process.env.M_WX_LUCK_OPEN_MODE || 0);
|
|
i1iiI1i.notLuckLimit = parseInt(process.env.M_WX_NOT_LUCK_LIMIT || 100);
|
|
i1iiI1i.activityTypes = lii1l11l;
|
|
iIlI1IlI.M_WX_NOT_LUCK_DRAW_LIST = "__notLuckDrawList__";
|
|
iIlI1IlI.M_WX_BLACK_LUCK_DRAW_RULE = "blackLuckDrawRule";
|
|
iIlI1IlI.M_WX_LUCK_OPEN_MODE = "openCardMode";
|
|
iIlI1IlI.M_WX_LUCK_ACTIVITY_TYPES = "__activityTypes__";
|
|
iIlI1IlI.M_WX_NOT_LUCK_LIMIT = "notLuckLimit";
|
|
ilIIi.envInfo = {
|
|
"name": "M幸运抽奖",
|
|
"runName": "m_jd_wx_luckDraw",
|
|
"version": "2.0.1"
|
|
};
|
|
let li1l111l = 0;
|
|
|
|
class ll1i1IiI extends IilllIlI {
|
|
constructor(Ililiil, iII1ll1) {
|
|
super(Ililiil, iII1ll1);
|
|
this.lzkjOpenCard = true;
|
|
i1iiI1i.openCardMode === 1 && (this.openCardTypes = [...this.openCardTypes, ...lii1l11l]);
|
|
}
|
|
|
|
async ["followShop"](l1l1iIlI) {
|
|
let IilI11I = await this.wxApi(this.type + "/follow", {
|
|
"pin": this.secretPin,
|
|
"skuId": l1l1iIlI
|
|
});
|
|
|
|
if (IilI11I && IilI11I.result) {
|
|
return IilI11I.data;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
["exitShop"]() {
|
|
if (this.shopName?.["match"](i1iiI1i.blackLuckDrawRule) || i1iiI1i.notLuckDrawList.some(_0x13379e => this.shopName?.["includes"](_0x13379e))) {
|
|
return this.putMsg("已屏蔽"), this.stop();
|
|
}
|
|
}
|
|
|
|
async ["userTask"]() {
|
|
await this.isvObfuscator();
|
|
|
|
if (this.mode === "v2") {
|
|
await this.login();
|
|
let iiiiii = await this.taskPostByJson("api/" + this.activityType + "/getPrizes");
|
|
IilllIlI.activity.prizeList = iiiiii.data;
|
|
|
|
this.exitShop();
|
|
if (i1iiI1i.openCardMode === 1 && !this.openCard) {
|
|
await this.bindWithVender();
|
|
}
|
|
let i11l11ii;
|
|
if (!["30003"].includes(this.activityType)) {
|
|
let lIlil = await this.taskPostByJson("api/" + this.activityType + "/chanceNum");
|
|
i11l11ii = lIlil?.["data"] ?? 5;
|
|
} else i11l11ii = 3;
|
|
|
|
if (i11l11ii === 0) {
|
|
return li1l111l++, li1l111l >= i1iiI1i.notLuckLimit && i1iiI1i.notLuckLimit === this.index + 1 && (this.putMsg("达到无抽奖次数上限"), this.stop()), this.putMsg("无抽奖次数");
|
|
}
|
|
|
|
while (i11l11ii-- > 0) {
|
|
let IiIIiII = await this.taskPostByJson("api/" + this.activityType + "/lotteryDraw");
|
|
this.log(IiIIiII);
|
|
|
|
if (IiIIiII && IiIIiII.code === 200) {
|
|
this.putMsg(IiIIiII?.["data"]?.["prizeName"] || "空气");
|
|
IiIIiII?.["data"]?.["result"]?.["result"] !== "true" && IiIIiII?.["data"]?.["result"]?.["result"] !== true && IiIIiII?.["data"]?.["activityPrizeId"] && (this.addressId = IiIIiII?.["data"]?.["result"]?.["result"], this.prizeName = IiIIiII?.["data"]?.["prizeName"], this.activityPrizeId = IiIIiII?.["data"]?.["activityPrizeId"], await this.saveAddress());
|
|
continue;
|
|
}
|
|
|
|
let l11iIli = IiIIiII?.["message"] || "抽奖失败";
|
|
this.putMsg(l11iIli);
|
|
this.wxStop(l11iIli);
|
|
return;
|
|
}
|
|
|
|
return;
|
|
}
|
|
|
|
if (this.mode === "hzbz") {
|
|
let lIl11iI = await this.taskGet(this.activityUrl);
|
|
if (!lIl11iI) return;
|
|
|
|
if (lIl11iI.includes("活动已结束")) {
|
|
this.putMsg("活动已经结束,手动确认");
|
|
this.stop();
|
|
return;
|
|
}
|
|
|
|
let II1Iill1 = this.textToHtml(lIl11iI),
|
|
iI1i11I1 = II1Iill1("#draw_info").text();
|
|
iI1i11I1 = this.parseJSON(iI1i11I1);
|
|
let i1Ii1lll = iI1i11I1?.["condtions"] || [],
|
|
iIl1111I = iI1i11I1?.["stime"] || 0,
|
|
I1lI1l1i = iI1i11I1?.["etime"] || 0;
|
|
this.shopName = iI1i11I1?.["shopName"];
|
|
this.shopId = iI1i11I1?.["shopId"];
|
|
this.rule = iI1i11I1?.["drawRule"];
|
|
IilllIlI.activity.shopId = this.shopId;
|
|
IilllIlI.activity.venderId = this.shopId;
|
|
IilllIlI.activity.shopName = this.shopName;
|
|
IilllIlI.activity.startTime = iIl1111I;
|
|
IilllIlI.activity.endTime = I1lI1l1i;
|
|
|
|
if (iIl1111I && iIl1111I > this.timestamp()) {
|
|
this.putMsg("活动未开始");
|
|
this.stop();
|
|
return;
|
|
}
|
|
|
|
if (I1lI1l1i && I1lI1l1i < this.timestamp()) {
|
|
this.putMsg("活动已结束");
|
|
this.stop();
|
|
return;
|
|
}
|
|
this.exitShop();
|
|
|
|
let l1I1I1iI = await this.hzbzApi("LoadUserData.json", {
|
|
"id": this.activityId,
|
|
"token": this.isvToken,
|
|
"buyerFrom": "01"
|
|
});
|
|
this.debug(l1I1I1iI);
|
|
l1I1I1iI && l1I1I1iI.code !== 0 && l1I1I1iI.code !== 1 && this.putMsg(l1I1I1iI?.["txt"]);
|
|
this.wxStop(l1I1I1iI?.["txt"]);
|
|
|
|
for (let IIilI11I of i1Ii1lll) {
|
|
this.debug(IIilI11I?.["type"]);
|
|
|
|
if (IIilI11I?.["type"] === "sc_shop") {
|
|
await this.hzbzApi("CollectShopToDraw.json", {
|
|
"conditionid": IIilI11I?.["id"]
|
|
});
|
|
}
|
|
|
|
IIilI11I?.["type"] === "sign_draw" && (await this.hzbzApi("SingedInfo.json", {
|
|
"conditionid": IIilI11I?.["id"]
|
|
}));
|
|
|
|
if (IIilI11I?.["type"] === "ll_goods") {
|
|
let li1l1l1 = JSON.parse(IIilI11I.condition),
|
|
i1iIlllI = li1l1l1?.["allMax"] ?? 0,
|
|
ll1iIi1l = li1l1l1?.["dayMax"] ?? 0,
|
|
iI11iIl1 = li1l1l1?.["viewCount"] ?? 0;
|
|
this.debug(i1iIlllI, ll1iIi1l, iI11iIl1);
|
|
this.debug(ll1iIi1l ?? iI11iIl1);
|
|
await this.hzbzApi("ViewGoodsToDraw.json", {
|
|
"conditionid": IIilI11I?.["id"],
|
|
"count": ll1iIi1l ?? iI11iIl1
|
|
});
|
|
}
|
|
|
|
if (IIilI11I?.["type"] === "sc_goods") {
|
|
let iIil1i = JSON.parse(IIilI11I.condition),
|
|
IiliiIlI = iIil1i?.["viewCount"] ?? 0,
|
|
II1liiI1 = iIil1i?.["dayMax"] ?? 0;
|
|
await this.hzbzApi("CollectGoodsToDraw.json", {
|
|
"conditionid": IIilI11I?.["id"],
|
|
"count": II1liiI1 ?? IiliiIlI
|
|
});
|
|
}
|
|
}
|
|
|
|
l1I1I1iI = await this.hzbzApi("LoadUserData.json", {
|
|
"id": this.activityId,
|
|
"token": this.isvToken,
|
|
"buyerFrom": "01"
|
|
});
|
|
this.debug(l1I1I1iI);
|
|
|
|
if (l1I1I1iI?.["code"] !== 0) {
|
|
this.putMsg(l1I1I1iI?.["txt"]);
|
|
return;
|
|
}
|
|
|
|
let iIiiiiII = l1I1I1iI?.["drawChances"] ?? 0;
|
|
iIiiiiII = Math.min(iIiiiiII, 3);
|
|
|
|
while (iIiiiiII-- > 0) {
|
|
await this.sleep(1000);
|
|
let i1Iill1l = await this.hzbzApi("DoDraw.json", {
|
|
"needCollectShop": l1I1I1iI.needCollectShop ?? false
|
|
});
|
|
this.debug(i1Iill1l);
|
|
|
|
if (i1Iill1l?.["prizeName"]) {
|
|
this.putMsg(i1Iill1l?.["prizeName"]);
|
|
i1Iill1l?.["needInputInfo"] && (this.addressId = i1Iill1l?.["prizeId"], this.prizeName = i1Iill1l?.["prizeName"], await this.saveAddress());
|
|
continue;
|
|
}
|
|
|
|
let i1IlIli = i1Iill1l?.["txt"];
|
|
this.putMsg(i1IlIli);
|
|
this.wxStop(i1IlIli);
|
|
}
|
|
|
|
return;
|
|
}
|
|
|
|
if (this.mode === "gzsl") {
|
|
let I1I1Illi = await this.gzslApi("getLottery");
|
|
this.debug(I1I1Illi);
|
|
|
|
if (I1I1Illi && I1I1Illi.status === "1") {
|
|
let ill1Iili = I1I1Illi?.["activity"] || {},
|
|
iiilll = I1I1Illi?.["prizeList"] || [],
|
|
llliii = ill1Iili?.["activityType"] || "";
|
|
this.shopId = ill1Iili.shopId;
|
|
this.venderId = ill1Iili.customerId ?? this.shopId;
|
|
this.rule = ill1Iili.rule;
|
|
this.shopName = ill1Iili.shopName;
|
|
let {
|
|
startTime: illIilI,
|
|
endTime: iIIllili
|
|
} = ill1Iili;
|
|
IilllIlI.activity.shopId = this.shopId;
|
|
IilllIlI.activity.venderId = this.venderId;
|
|
IilllIlI.activity.shopName = this.shopName;
|
|
IilllIlI.activity.startTime = illIilI;
|
|
IilllIlI.activity.endTime = iIIllili;
|
|
IilllIlI.activity.activityType = llliii;
|
|
IilllIlI.activity.prizeList = iiilll;
|
|
|
|
if (illIilI && illIilI > this.timestamp()) {
|
|
this.putMsg("活动未开始");
|
|
this.stop();
|
|
return;
|
|
}
|
|
|
|
if (iIIllili && iIIllili < this.timestamp()) {
|
|
this.putMsg("活动已结束");
|
|
this.stop();
|
|
return;
|
|
}
|
|
this.exitShop();
|
|
|
|
let l11llI1 = Math.max(0, I1I1Illi?.["leftTime"] ?? 0);
|
|
|
|
if (l11llI1 === 0) {
|
|
li1l111l++;
|
|
|
|
if (li1l111l >= i1iiI1i.notLuckLimit && i1iiI1i.notLuckLimit === this.index + 1) {
|
|
this.putMsg("达到无抽奖次数上限");
|
|
this.stop();
|
|
}
|
|
|
|
this.putMsg("无抽奖次数");
|
|
return;
|
|
}
|
|
|
|
l11llI1 = Math.min(l11llI1, 3);
|
|
|
|
while (l11llI1-- > 0) {
|
|
await this.sleep(2000, 3000);
|
|
let il1li1Il = await this.gzslApi("draw");
|
|
this.log(il1li1Il);
|
|
if (il1li1Il && il1li1Il.status === "1") this.putMsg(il1li1Il?.["data"]?.["name"] || "空气");else {
|
|
if (il1li1Il && il1li1Il.status === "-14") {
|
|
this.putMsg("非会员");
|
|
return;
|
|
} else {
|
|
if (il1li1Il && il1li1Il.status === "-3") {
|
|
this.log("关注");
|
|
let i1iilII1 = await this.taskPostByJson("wuxian/user/flowShop/" + this.shopId + "/" + this.venderId, {
|
|
"shopId": this.shopId,
|
|
"venderId": this.venderId,
|
|
"token": this.isvToken,
|
|
"source": "01"
|
|
});
|
|
if (i1iilII1 && i1iilII1.status !== "1") return this.putMsg(il1li1Il?.["msg"]);
|
|
l11llI1++;
|
|
continue;
|
|
} else {
|
|
let lIlIlliI = il1li1Il?.["msg"];
|
|
this.putMsg(lIlIlliI);
|
|
this.wxStop(lIlIlliI);
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
let IliI1l11 = I1I1Illi?.["msg"];
|
|
this.putMsg(IliI1l11);
|
|
this.wxStop(IliI1l11);
|
|
return;
|
|
}
|
|
|
|
return;
|
|
}
|
|
|
|
if (this.mode === "jinggeng") {
|
|
await this.setMixNick();
|
|
await this.jinggengShopInfo();
|
|
this.exitShop();
|
|
let llIIliIi = {
|
|
"user_id": this.userId,
|
|
"act_id": this.activityId
|
|
},
|
|
l1i1I1li = "";
|
|
|
|
if (this.activityUrl.includes("showDrawOne")) {
|
|
l1i1I1li = "postFrontCheckDrawOne";
|
|
} else {
|
|
if (this.activityUrl.includes("showTaskDraw")) {
|
|
l1i1I1li = "postFrontTaskDraw";
|
|
llIIliIi.drawCountNumFlag = true;
|
|
} else {
|
|
if (this.activityUrl.includes("loadBlindBox")) l1i1I1li = "postBlindBox";else {
|
|
this.putMsg("未知活动类型");
|
|
this.stop();
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
let liIlliIl = await this.jinggengApi(l1i1I1li, llIIliIi);
|
|
this.debug(liIlliIl);
|
|
|
|
if (liIlliIl && liIlliIl.succ) {
|
|
// this.log(liIlliIl);
|
|
let ii1iii11 = liIlliIl.msg ?? "{}",
|
|
iiIIIIii = JSON.parse(ii1iii11);
|
|
|
|
if (iiIIIIii?.["isSendSucc"]) {
|
|
let iIIiii1i = iiIIIIii?.["drawAwardDto"]?.["awardName"];
|
|
this.putMsg(iIIiii1i || iiIIIIii?.["drawAwardDto"]?.["awardDenomination"]);
|
|
|
|
if (iiIIIIii?.["drawAwardDto"]?.["awardType"] === "JD_GOODS") {
|
|
this.addressId = iiIIIIii?.["drawAwardDto"]?.["actLogId"];
|
|
this.prizeName = iIIiii1i;
|
|
await this.saveAddress();
|
|
}
|
|
|
|
return;
|
|
}
|
|
} else {
|
|
let IiIiiII = liIlliIl?.["msg"] || "抽奖失败";
|
|
this.putMsg(IiIiiII);
|
|
this.wxStop();
|
|
return;
|
|
}
|
|
|
|
return;
|
|
}
|
|
|
|
if (this.mode === "hdb") {
|
|
await this.login();
|
|
await this.reportPVUV();
|
|
await this.loadFrontAct();
|
|
await this.loadFrontAward();
|
|
this.exitShop();
|
|
i1iiI1i.openCardMode === 1 && this.openCard === 0 && (this.debug("尝试开卡", this.venderId, this.shopId), await this.bindWithVender());
|
|
|
|
let IIl1IiI1 = 1;
|
|
if (this.actType === "pointDraw") {} else {
|
|
let iIiliii1 = await this.hdbApi("showTaskList", {}, true);
|
|
|
|
if (iIiliii1 && iIiliii1.succ) {
|
|
let il11iii = iIiliii1?.["result"]?.["taskList"] ?? [];
|
|
|
|
if (il11iii.some(liI11ii1 => liI11ii1.conditionType === "favouriteShop" && liI11ii1.isFinish === 0)) {
|
|
let iIIlIi1i = await this.hdbApi("completeActivityTask", {
|
|
"conditionType": "favouriteShop"
|
|
}, true);
|
|
this.debug(iIIlIi1i);
|
|
}
|
|
}
|
|
|
|
let IllIiII = await this.hdbApi("getDrawTimes");
|
|
this.debug(IllIiII);
|
|
IllIiII && IllIiII.succ && (IIl1IiI1 = IllIiII?.["result"]?.["giveTimes"] ?? 1);
|
|
}
|
|
|
|
if (IIl1IiI1 === 0) {
|
|
li1l111l++;
|
|
li1l111l >= i1iiI1i.notLuckLimit && i1iiI1i.notLuckLimit === this.index + 1 && (this.putMsg("达到无抽奖次数上限"), this.stop());
|
|
this.putMsg("无抽奖次数");
|
|
return;
|
|
}
|
|
|
|
IIl1IiI1 = Math.min(IIl1IiI1, 3);
|
|
|
|
while (IIl1IiI1-- > 0) {
|
|
await this.sleep(1500);
|
|
let iIi11l1I = await this.hdbApi(this.actType === "pointDraw" ? "postPointDraw" : "postDraw", {
|
|
"drawTimes": 1
|
|
});
|
|
// this.log(iIi11l1I);
|
|
|
|
if (iIi11l1I && iIi11l1I.succ) {
|
|
if (iIi11l1I.result.succ) {
|
|
this.putMsg(iIi11l1I.result?.["dmActivityLog"]?.["awardName"] || "空气");
|
|
iIi11l1I.result?.["msg"]?.["includes"]("填写信息") && (this.addressId = iIi11l1I.result?.["dmActivityLog"]?.["id"], this.prizeName = iIi11l1I.result?.["dmActivityLog"]?.["awardName"], await this.saveAddress());
|
|
return;
|
|
} else this.putMsg(iIi11l1I.result?.["errorMsg"] || iIi11l1I.result?.["message"]);
|
|
}
|
|
|
|
let iilIii1l = iIi11l1I?.["message"];
|
|
|
|
if (iilIii1l?.["includes"]("您未中奖")) {
|
|
this.putMsg("空气");
|
|
continue;
|
|
}
|
|
|
|
if (iilIii1l?.["includes"]("关注店铺") && (await this.follow())) {
|
|
IIl1IiI1++;
|
|
continue;
|
|
}
|
|
|
|
this.putMsg(iilIii1l);
|
|
this.wxStop(iilIii1l);
|
|
return;
|
|
}
|
|
|
|
return;
|
|
}
|
|
|
|
await this.getDefenseUrls();
|
|
|
|
if (lii1l11l.includes(this.activityType)) {
|
|
await this.login();
|
|
this.exitShop();
|
|
if (![10026, 10080].includes(this.actType)) {
|
|
let Iil1lilI = await this.lzkjApi("api/task/" + this.type + "/activity");
|
|
|
|
if (Iil1lilI && Iil1lilI.resp_code === 0) {
|
|
let IIlll1l1 = Iil1lilI.data?.["taskList"] || [];
|
|
await this.lzkjTask(IIlll1l1);
|
|
}
|
|
}
|
|
|
|
let i1IiI1Il = await this.lzkjApi("api/prize/drawPrize");
|
|
this.drawNumber = 5;
|
|
i1IiI1Il && i1IiI1Il.resp_code === 0 && (this.drawNumber = i1IiI1Il.data?.["drawNumber"]);
|
|
|
|
if ([10026, 10080].includes(this.actType)) {
|
|
this.drawNumber = 3;
|
|
}
|
|
|
|
if (this.drawNumber <= 0) {
|
|
li1l111l++;
|
|
li1l111l >= i1iiI1i.notLuckLimit && i1iiI1i.notLuckLimit === this.index + 1 && (this.putMsg("达到无抽奖次数上限"), this.stop());
|
|
this.putMsg("无抽奖次数");
|
|
return;
|
|
}
|
|
|
|
this.drawNumber = Math.min(this.drawNumber, 7);
|
|
|
|
while (this.drawNumber-- > 0) {
|
|
let IlllIl1I = await this.lzkjApi("api/prize/draw", {
|
|
"consumePoints": 0,
|
|
"actId": this.activityId
|
|
});
|
|
this.debug(IlllIl1I);
|
|
|
|
if (IlllIl1I && IlllIl1I.resp_code === 0) {
|
|
if (IlllIl1I.data === "1") {
|
|
this.putMsg("积分不足");
|
|
return;
|
|
}
|
|
|
|
this.putMsg(IlllIl1I.data?.["prizeName"] || "空气");
|
|
IlllIl1I.data && IlllIl1I.data?.["prizeName"] && IlllIl1I.data?.["prizeType"] === 3 && IlllIl1I.data?.["addressId"] && IlllIl1I.data?.["dayTime"] === this.formatDate(Date.now(), "yyyy-MM-dd") && (this.addressId = IlllIl1I.data.addressId, this.prizeName = IlllIl1I.data?.["prizeName"], await this.saveAddress());
|
|
await this.sleep(200);
|
|
} else {
|
|
let Il1IilI1 = IlllIl1I?.["resp_msg"];
|
|
this.putMsg(Il1IilI1);
|
|
this.wxStop(Il1IilI1);
|
|
return;
|
|
}
|
|
}
|
|
|
|
return;
|
|
}
|
|
|
|
await this.wxCommonInfo();
|
|
await this.getSimpleActInfoVo();
|
|
|
|
if (this.index === 0) {
|
|
await this.getShopInfo();
|
|
|
|
if (this.shopName && ([26, 128, 129].includes(this.activityType) && i1iiI1i.notLuckDrawList.some(Ii11li11 => this.shopName.includes(Ii11li11)) || this.shopName.match(i1iiI1i.blackLuckDrawRule))) {
|
|
this.putMsg("已屏蔽");
|
|
this.stop();
|
|
return;
|
|
}
|
|
}
|
|
|
|
this.defenseUrls.length === 0 ? await this.getMyPing() : await this.initPinToken();
|
|
await this.accessLog();
|
|
let ii1liI1 = await this.activityContent();
|
|
|
|
if (!ii1liI1?.["result"] || !ii1liI1?.["data"]) {
|
|
this.putMsg(ii1liI1?.["errorMessage"]);
|
|
return;
|
|
}
|
|
|
|
let i11i1li1 = ii1liI1.data?.["canDrawTimes"] ?? 5,
|
|
i1iIil1i = ii1liI1.data?.["dayMaxDraw"] ?? 5,
|
|
IIiii1li = ii1liI1.data?.["hasFollow"] || false,
|
|
liiIl1I = ii1liI1.data?.["needFollow"] || false,
|
|
ilIlIIII = ii1liI1.data?.["content"]["filter"](lIl11llI => [6, 7, 13, 14, 15, 16].includes(lIl11llI.type));
|
|
|
|
if (ilIlIIII.length === 0) {
|
|
this.putMsg("垃圾或领完");
|
|
this.stop();
|
|
return;
|
|
}
|
|
|
|
let IIliillI = await this.getGiveContent();
|
|
|
|
if (IIliillI && IIliillI.data) {
|
|
let I11lIiI = IIliillI.data;
|
|
if (I11lIiI?.["follow"] && I11lIiI.follow.hasGetGiveTimes < I11lIiI.follow.maxGiveTimes) {
|
|
this.log("做关注任务");
|
|
let i1il11lI = IIliillI.data.follow.skuIdsList;
|
|
const lIliliII = I11lIiI?.["followRecordVO"]?.["hasFollowSkuIdsList"];
|
|
i1il11lI = lIliliII ? this.different(i1il11lI, lIliliII) : i1il11lI;
|
|
|
|
for (let i1IIllI = 0; i1IIllI < I11lIiI.follow.followTimes - I11lIiI.follow.hasFollowTimes; i1IIllI++) {
|
|
await this.followShop(i1il11lI[i1IIllI]);
|
|
await this.sleep(100);
|
|
}
|
|
|
|
i11i1li1++;
|
|
}
|
|
}
|
|
|
|
i11i1li1 = Math.min(i11i1li1, i1iIil1i, 7);
|
|
if (i11i1li1 <= 0) return li1l111l++, li1l111l >= i1iiI1i.notLuckLimit && i1iiI1i.notLuckLimit === this.index + 1 && (this.putMsg("达到无抽奖次数上限"), this.stop()), this.putMsg("无抽奖次数");
|
|
liiIl1I && !IIiii1li && (this.log("关注店铺"), await this.wxApi("wxActionCommon/newFollowShop", {
|
|
"buyerPin": this.secretPin,
|
|
"venderId": this.venderId,
|
|
"activityType": this.activityType
|
|
}));
|
|
|
|
i11i1li1 = Math.min(i11i1li1, 7);
|
|
while (i11i1li1-- > 0) {
|
|
let i1l1iIl = await this.wxApi(this.type + "/start", {
|
|
"pin": this.secretPin
|
|
});
|
|
this.debug(i1l1iIl);
|
|
if (i1l1iIl && i1l1iIl.result) this.putMsg("" + (i1l1iIl.data?.["name"] || "空气")), i1l1iIl.data?.["drawInfoType"] === 7 && i1l1iIl.data?.["needWriteAddress"] === "y" && i1l1iIl.data?.["addressId"] && (this.addressId = i1l1iIl.data.addressId, this.prizeName = i1l1iIl.data.name, await this.saveAddress()), await this.sleep(500);else {
|
|
let Il1llI1 = i1l1iIl?.["errorMessage"];
|
|
|
|
if (Il1llI1?.["includes"]("未关注") && (await this.follow())) {
|
|
i11i1li1++;
|
|
continue;
|
|
}
|
|
|
|
if (i1iiI1i.openCardMode === 1 && ["不是会员", "店铺会员", "未开卡"].some(_0x336e5a => Il1llI1?.["includes"](_0x336e5a))) {
|
|
await this.bindWithVender();
|
|
if (this.canNotOpenCard) return this.reseCookieStatus();
|
|
i11i1li1++;
|
|
continue;
|
|
}
|
|
|
|
this.putMsg(Il1llI1);
|
|
this.wxStop(Il1llI1);
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
ilIIi.activity = {
|
|
"activityUrl": activityUrl
|
|
};
|
|
|
|
ilIIi.TaskClass = ll1i1IiI;
|
|
|
|
ilIIi.run({
|
|
"whitelist": ["1-20000"],
|
|
"main_thread": 3,
|
|
"wxProxySmart": 2
|
|
});
|