539 lines
22 KiB
JavaScript
539 lines
22 KiB
JavaScript
/*
|
|
幸运抽奖beta v2.0.6
|
|
|
|
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
|
|
https://lzkj-isv.isvjcloud.com/prod/cc/interaction/v2/30003/1001/?shopId=819551&activityId=1783351662425452546
|
|
|
|
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="100" # 前N没有次数跳出 默认值100
|
|
|
|
cron: 7 7 7 7 7 *
|
|
const $ = new Env("幸运抽奖beta");
|
|
*/
|
|
|
|
let mode = __dirname.includes('bear');
|
|
|
|
let activityUrl = decodeURIComponent(process.argv.splice(2)?.[0] || process.env.M_WX_LUCK_DRAW_URL);
|
|
|
|
if (mode) {
|
|
}
|
|
const {
|
|
RunMode: _0x14c5ce,
|
|
UserMode: _0x2785a5,
|
|
baseCommonEnv: _0x34c2bd,
|
|
baseCommonEnvKey: _0x42af3f
|
|
} = require("./bear");
|
|
let _0x32ba81 = ["10020", "10021", "10026", "10031", "10041", "10042", "10046", "10062", "10063", "10073", "10080"];
|
|
process.env.B_WX_LUCK_ACTIVITY_TYPES ? process.env.B_WX_LUCK_ACTIVITY_TYPES.split(/[@,&|]/).forEach(_0x3b0926 => _0x32ba81.push(_0x3b0926)) : "";
|
|
_0x34c2bd.notLuckDrawList = process.env.B_WX_NOT_LUCK_DRAW_LIST ? process.env.B_WX_NOT_LUCK_DRAW_LIST.split(/[@,&|]/) : "a2海外@马可波罗@合田家@风向标@罗技二手外设".split("@");
|
|
_0x34c2bd.blackLuckDrawRule = process.env.B_WX_BLACK_LUCK_DRAW_RULE || "FITURE|FITURE";
|
|
_0x34c2bd.openCardMode = parseInt(process.env.B_WX_LUCK_OPEN_MODE || 0);
|
|
_0x34c2bd.notLuckLimit = parseInt(process.env.B_WX_NOT_LUCK_LIMIT || 100);
|
|
_0x34c2bd.activityTypes = _0x32ba81;
|
|
_0x42af3f.B_WX_NOT_LUCK_DRAW_LIST = "__notLuckDrawList__";
|
|
_0x42af3f.B_WX_BLACK_LUCK_DRAW_RULE = "blackLuckDrawRule";
|
|
_0x42af3f.B_WX_LUCK_OPEN_MODE = "openCardMode";
|
|
_0x42af3f.B_WX_LUCK_ACTIVITY_TYPES = "__activityTypes__";
|
|
_0x42af3f.B_WX_NOT_LUCK_LIMIT = "notLuckLimit";
|
|
_0x14c5ce.envInfo = {
|
|
"name": "B幸运抽奖",
|
|
"runName": "b_jd_wx_luckDraw",
|
|
"env": "B_WX_LUCK_DRAW_URL",
|
|
"version": "2.0.6"
|
|
};
|
|
let _0x5002ff = 0;
|
|
class _0x2f7451 extends _0x2785a5 {
|
|
constructor(_0x2a4581, _0x463154) {
|
|
super(_0x2a4581, _0x463154);
|
|
this.lzkjOpenCard = true;
|
|
_0x34c2bd.openCardMode === 1 && (this.openCardTypes = [...this.openCardTypes, ..._0x32ba81]);
|
|
}
|
|
async ["followShop"](_0x3dd62e) {
|
|
let _0x9882db = await this.wxApi(this.type + "/follow", {
|
|
"pin": this.secretPin,
|
|
"skuId": _0x3dd62e
|
|
});
|
|
if (_0x9882db && _0x9882db.result) {
|
|
return _0x9882db.data;
|
|
}
|
|
return false;
|
|
}
|
|
["exitShop"]() {
|
|
if (this.shopName?.["match"](_0x34c2bd.blackLuckDrawRule) || _0x34c2bd.notLuckDrawList.some(_0x13379e => this.shopName?.["includes"](_0x13379e))) {
|
|
return this.putMsg("已屏蔽"), this.stop();
|
|
}
|
|
}
|
|
async ["userTask"]() {
|
|
await this.isvObfuscator();
|
|
if (this.mode === "v2") {
|
|
await this.login();
|
|
if (this.index == 0) {
|
|
await this.v2getPrizes();
|
|
}
|
|
this.exitShop();
|
|
if (_0x34c2bd.openCardMode === 1 && !this.openCard) {
|
|
await this.bindWithVender();
|
|
}
|
|
let _0x20f2a7;
|
|
if (!["30003"].includes(this.activityType)) {
|
|
await this.v2Task();
|
|
let _0x4eef74 = await this.v2Api("api/" + this.activityType + "/chanceNum");
|
|
_0x20f2a7 = _0x4eef74?.["data"] ?? 5;
|
|
} else _0x20f2a7 = 3;
|
|
if (_0x20f2a7 === 0) return _0x5002ff++, _0x5002ff >= _0x34c2bd.notLuckLimit && _0x34c2bd.notLuckLimit === this.index + 1 && (this.putMsg("达到无抽奖次数上限"), this.stop()), this.putMsg("无抽奖次数");
|
|
while (_0x20f2a7-- > 0) {
|
|
let _0x59e27e = await this.v2Api("api/" + this.activityType + "/lotteryDraw");
|
|
this.log(_0x59e27e);
|
|
if (_0x59e27e && _0x59e27e.code === 200) {
|
|
this.putMsg(_0x59e27e?.["data"]?.["prizeName"] || "空气");
|
|
_0x59e27e?.["data"]?.["result"]?.["result"] !== "true" && _0x59e27e?.["data"]?.["result"]?.["result"] !== true && _0x59e27e?.["data"]?.["activityPrizeId"] && (this.addressId = _0x59e27e?.["data"]?.["result"]?.["result"], this.prizeName = _0x59e27e?.["data"]?.["prizeName"], this.activityPrizeId = _0x59e27e?.["data"]?.["activityPrizeId"], await this.saveAddress());
|
|
continue;
|
|
}
|
|
let _0x3e41dc = _0x59e27e?.["message"] || "抽奖失败";
|
|
this.putMsg(_0x3e41dc);
|
|
await this.wxStopSync(_0x3e41dc);
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
if (this.mode === "hzbz") {
|
|
let _0x5d029d = await this.taskGet(this.activityUrl);
|
|
if (!_0x5d029d) return;
|
|
if (_0x5d029d.includes("活动已结束")) {
|
|
this.putMsg("活动已经结束,手动确认");
|
|
await this.writeLongCacheByStop();
|
|
this.stop();
|
|
return;
|
|
}
|
|
let _0x115d53 = this.textToHtml(_0x5d029d),
|
|
_0x3e36cb = _0x115d53("#draw_info").text();
|
|
_0x3e36cb = this.parseJSON(_0x3e36cb);
|
|
let _0x48fcd2 = _0x3e36cb?.["condtions"] || [],
|
|
_0x562996 = _0x3e36cb?.["stime"] || 0,
|
|
_0x204f49 = _0x3e36cb?.["etime"] || 0;
|
|
this.shopName = _0x3e36cb?.["shopName"];
|
|
this.shopId = _0x3e36cb?.["shopId"];
|
|
this.rule = _0x3e36cb?.["drawRule"];
|
|
_0x2785a5.activity.shopId = this.shopId;
|
|
_0x2785a5.activity.venderId = this.shopId;
|
|
_0x2785a5.activity.shopName = this.shopName;
|
|
_0x2785a5.activity.startTime = _0x562996;
|
|
_0x2785a5.activity.endTime = _0x204f49;
|
|
if (_0x562996 && _0x562996 > this.timestamp()) {
|
|
this.putMsg("活动未开始");
|
|
this.stop();
|
|
return;
|
|
}
|
|
if (_0x204f49 && _0x204f49 < this.timestamp()) {
|
|
this.putMsg("活动已结束");
|
|
await this.writeLongCacheByStop();
|
|
this.stop();
|
|
return;
|
|
}
|
|
this.exitShop();
|
|
let _0x7a15b7 = await this.hzbzApi("LoadUserData.json", {
|
|
"id": this.activityId,
|
|
"token": this.isvToken,
|
|
"buyerFrom": "01"
|
|
});
|
|
this.debug(_0x7a15b7);
|
|
if (_0x7a15b7 && _0x7a15b7.code !== 0 && _0x7a15b7.code !== 1) {
|
|
this.putMsg(_0x7a15b7?.["txt"]);
|
|
}
|
|
this.wxStop(_0x7a15b7?.["txt"]);
|
|
for (let _0x2dca05 of _0x48fcd2) {
|
|
this.debug(_0x2dca05?.["type"]);
|
|
_0x2dca05?.["type"] === "sc_shop" && (await this.hzbzApi("CollectShopToDraw.json", {
|
|
"conditionid": _0x2dca05?.["id"]
|
|
}));
|
|
_0x2dca05?.["type"] === "sign_draw" && (await this.hzbzApi("SingedInfo.json", {
|
|
"conditionid": _0x2dca05?.["id"]
|
|
}));
|
|
if (_0x2dca05?.["type"] === "ll_goods") {
|
|
let _0x3cd470 = JSON.parse(_0x2dca05.condition),
|
|
_0x5eb9e9 = _0x3cd470?.["allMax"] ?? 0,
|
|
_0x11b89b = _0x3cd470?.["dayMax"] ?? 0,
|
|
_0x410394 = _0x3cd470?.["viewCount"] ?? 0;
|
|
this.debug(_0x5eb9e9, _0x11b89b, _0x410394);
|
|
this.debug(_0x11b89b ?? _0x410394);
|
|
await this.hzbzApi("ViewGoodsToDraw.json", {
|
|
"conditionid": _0x2dca05?.["id"],
|
|
"count": _0x11b89b ?? _0x410394
|
|
});
|
|
}
|
|
if (_0x2dca05?.["type"] === "sc_goods") {
|
|
let _0x4adff0 = JSON.parse(_0x2dca05.condition),
|
|
_0x1b871f = _0x4adff0?.["viewCount"] ?? 0,
|
|
_0xcfc62 = _0x4adff0?.["dayMax"] ?? 0;
|
|
await this.hzbzApi("CollectGoodsToDraw.json", {
|
|
"conditionid": _0x2dca05?.["id"],
|
|
"count": _0xcfc62 ?? _0x1b871f
|
|
});
|
|
}
|
|
}
|
|
_0x7a15b7 = await this.hzbzApi("LoadUserData.json", {
|
|
"id": this.activityId,
|
|
"token": this.isvToken,
|
|
"buyerFrom": "01"
|
|
});
|
|
this.debug(_0x7a15b7);
|
|
if (_0x7a15b7?.["code"] !== 0) {
|
|
this.putMsg(_0x7a15b7?.["txt"]);
|
|
return;
|
|
}
|
|
let _0x5a6e98 = _0x7a15b7?.["drawChances"] ?? 0;
|
|
_0x5a6e98 = Math.min(_0x5a6e98, 3);
|
|
while (_0x5a6e98-- > 0) {
|
|
await this.sleep(1000);
|
|
let _0x9c8b99 = await this.hzbzApi("DoDraw.json", {
|
|
"needCollectShop": _0x7a15b7.needCollectShop ?? false
|
|
});
|
|
this.debug(_0x9c8b99);
|
|
if (_0x9c8b99?.["prizeName"]) {
|
|
this.putMsg(_0x9c8b99?.["prizeName"]);
|
|
_0x9c8b99?.["needInputInfo"] && (this.addressId = _0x9c8b99?.["prizeId"], this.prizeName = _0x9c8b99?.["prizeName"], await this.saveAddress());
|
|
continue;
|
|
}
|
|
let _0x15fd7c = _0x9c8b99?.["txt"];
|
|
this.putMsg(_0x15fd7c);
|
|
this.wxStop(_0x15fd7c);
|
|
}
|
|
return;
|
|
}
|
|
if (this.mode === "gzsl") {
|
|
let _0x1da79b = await this.gzslApi("getLottery");
|
|
this.debug(_0x1da79b);
|
|
if (_0x1da79b && _0x1da79b.status === "1") {
|
|
let _0x3ee58d = _0x1da79b?.["activity"] || {};
|
|
this.shopId = _0x3ee58d.shopId;
|
|
this.venderId = _0x3ee58d.customerId ?? this.shopId;
|
|
this.rule = _0x3ee58d.rule;
|
|
this.shopName = _0x3ee58d.shopName;
|
|
let {
|
|
startTime: _0x2cc036,
|
|
endTime: _0x173ea5
|
|
} = _0x3ee58d;
|
|
_0x2785a5.activity.shopId = this.shopId;
|
|
_0x2785a5.activity.venderId = this.venderId;
|
|
_0x2785a5.activity.shopName = this.shopName;
|
|
_0x2785a5.activity.startTime = _0x2cc036;
|
|
_0x2785a5.activity.endTime = _0x173ea5;
|
|
_0x2785a5.activity.actType = 'gzsl'
|
|
_0x2785a5.activity.prizeList = _0x1da79b.prizeList
|
|
if (_0x2cc036 && _0x2cc036 > this.timestamp()) {
|
|
this.putMsg("活动未开始");
|
|
this.stop();
|
|
return;
|
|
}
|
|
if (_0x173ea5 && _0x173ea5 < this.timestamp()) {
|
|
this.putMsg("活动已结束");
|
|
await this.writeLongCacheByStop();
|
|
this.stop();
|
|
return;
|
|
}
|
|
this.exitShop();
|
|
let _0x3d7147 = Math.max(0, _0x1da79b?.["leftTime"] ?? 0);
|
|
if (_0x3d7147 === 0) {
|
|
_0x5002ff++;
|
|
_0x5002ff >= _0x34c2bd.notLuckLimit && _0x34c2bd.notLuckLimit === this.index + 1 && (this.putMsg("达到无抽奖次数上限"), this.stop());
|
|
this.putMsg("无抽奖次数");
|
|
return;
|
|
}
|
|
_0x3d7147 = Math.min(_0x3d7147, 3);
|
|
this.debug(_0x3d7147);
|
|
while (_0x3d7147-- > 0) {
|
|
await this.sleep(2000, 3000);
|
|
let _0x1a513e = await this.gzslApi("draw");
|
|
this.log(_0x1a513e);
|
|
if (_0x1a513e && _0x1a513e.status === "1") this.putMsg(_0x1a513e?.["data"]?.["name"] + _0x1a513e?.["data"]?.["detail"] || "空气"); else {
|
|
if (_0x1a513e && _0x1a513e.status === "-14") {
|
|
this.putMsg("非会员");
|
|
return;
|
|
} else {
|
|
if (_0x1a513e && _0x1a513e.status === "-3") {
|
|
this.log("关注");
|
|
let _0x2e44a0 = await this.taskPostByJson("wuxian/user/flowShop/" + this.shopId + "/" + this.venderId, {
|
|
"shopId": this.shopId,
|
|
"venderId": this.venderId,
|
|
"token": this.isvToken,
|
|
"source": "01"
|
|
});
|
|
if (_0x2e44a0 && _0x2e44a0.status !== "1") return this.putMsg(_0x1a513e?.["msg"]);
|
|
_0x3d7147++;
|
|
continue;
|
|
} else {
|
|
let _0x3ef19c = _0x1a513e?.["msg"];
|
|
this.putMsg(_0x3ef19c);
|
|
await this.wxStopSync(_0x3ef19c);
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
let _0x3bd477 = _0x1da79b?.["msg"];
|
|
this.putMsg(_0x3bd477);
|
|
await this.wxStopSync(_0x3bd477);
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
if (this.mode === "jinggeng") {
|
|
await this.setMixNick();
|
|
await this.jinggengShopInfo();
|
|
this.exitShop();
|
|
let _0x37c70a = {
|
|
"user_id": this.userId,
|
|
"act_id": this.activityId
|
|
},
|
|
_0x5afddd = "";
|
|
if (this.activityUrl.includes("showDrawOne")) _0x5afddd = "postFrontCheckDrawOne"; else {
|
|
if (this.activityUrl.includes("showTaskDraw")) {
|
|
_0x5afddd = "postFrontTaskDraw";
|
|
_0x37c70a.drawCountNumFlag = true;
|
|
} else {
|
|
if (this.activityUrl.includes("loadBlindBox")) _0x5afddd = "postBlindBox"; else {
|
|
this.putMsg("未知活动类型");
|
|
this.stop();
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
let _0x5953ac = 1;
|
|
while (_0x5953ac-- > 0) {
|
|
await this.sleep(1000, 2000);
|
|
let _0x4a715c = await this.jinggengApi(_0x5afddd, _0x37c70a);
|
|
this.debug(_0x4a715c);
|
|
if (_0x4a715c && _0x4a715c.succ) {
|
|
this.log(_0x4a715c);
|
|
let _0x41ffd2 = _0x4a715c.msg ?? "{}",
|
|
_0x4e7ab2 = JSON.parse(_0x41ffd2);
|
|
if (_0x4e7ab2?.["isSendSucc"]) {
|
|
let _0x5b0978 = _0x4e7ab2?.["drawAwardDto"]?.["awardName"];
|
|
this.putMsg("" + _0x4e7ab2?.["drawAwardDto"]?.["awardDenomination"] + _0x5b0978);
|
|
if (_0x4e7ab2?.["drawAwardDto"]?.["awardType"] === "JD_GOODS") {
|
|
this.addressId = _0x4e7ab2?.["drawAwardDto"]?.["actLogId"];
|
|
this.prizeName = _0x5b0978;
|
|
await this.saveAddress();
|
|
}
|
|
}
|
|
} else {
|
|
let _0x15ba92 = _0x4a715c?.["msg"] || "抽奖失败";
|
|
if (_0x15ba92?.["includes"]("部分会员") && _0x34c2bd.openCardMode === 1) {
|
|
this.debug("尝试开卡", this.venderId, this.shopId);
|
|
await this.bindWithVender();
|
|
if (this.canNotOpenCard) return;
|
|
_0x5953ac++;
|
|
continue;
|
|
}
|
|
if (_0x15ba92?.["includes"]("关注店铺")) {
|
|
await this.taskPost("front/followShop", {
|
|
"userId": this.userId
|
|
});
|
|
_0x5953ac++;
|
|
continue;
|
|
}
|
|
_0x5953ac = _0x4a715c?.["drawNum"] ?? _0x5953ac;
|
|
this.putMsg(_0x15ba92);
|
|
this.wxStop();
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
if (this.mode === "hdb") {
|
|
await this.login();
|
|
await this.reportPVUV();
|
|
await this.loadFrontAct();
|
|
await this.loadFrontAward();
|
|
this.exitShop();
|
|
_0x34c2bd.openCardMode === 1 && this.openCard === 0 && (this.debug("尝试开卡", this.venderId, this.shopId), await this.bindWithVender());
|
|
let _0x50018a = 1;
|
|
if (this.actType === "pointDraw") { } else {
|
|
let _0x5d1189 = await this.hdbApi("showTaskList", {}, true);
|
|
if (_0x5d1189 && _0x5d1189.succ) {
|
|
let _0x2e2805 = _0x5d1189?.["result"]?.["taskList"] ?? [];
|
|
if (_0x2e2805.some(_0x5c72e1 => _0x5c72e1.conditionType === "favouriteShop" && _0x5c72e1.isFinish === 0)) {
|
|
let _0x241748 = await this.hdbApi("completeActivityTask", {
|
|
"conditionType": "favouriteShop"
|
|
}, true);
|
|
this.debug(_0x241748);
|
|
}
|
|
}
|
|
let _0x31118e = await this.hdbApi("getDrawTimes");
|
|
this.debug(_0x31118e);
|
|
if (_0x31118e && _0x31118e.succ) {
|
|
_0x50018a = _0x31118e?.["result"]?.["giveTimes"] ?? 1;
|
|
}
|
|
}
|
|
if (_0x50018a === 0) {
|
|
_0x5002ff++;
|
|
_0x5002ff >= _0x34c2bd.notLuckLimit && _0x34c2bd.notLuckLimit === this.index + 1 && (this.putMsg("达到无抽奖次数上限"), this.stop());
|
|
this.putMsg("无抽奖次数");
|
|
return;
|
|
}
|
|
_0x50018a = Math.min(_0x50018a, 3);
|
|
while (_0x50018a-- > 0) {
|
|
await this.sleep(1500);
|
|
let _0x196699 = await this.hdbApi(this.actType === "pointDraw" ? "postPointDraw" : "postDraw", {
|
|
"drawTimes": 1
|
|
});
|
|
this.log(_0x196699);
|
|
if (_0x196699 && _0x196699.succ) {
|
|
if (_0x196699.result.succ) {
|
|
this.putMsg(_0x196699.result?.["dmActivityLog"]?.["awardName"] || "空气");
|
|
_0x196699.result?.["msg"]?.["includes"]("填写信息") && (this.addressId = _0x196699.result?.["dmActivityLog"]?.["id"], this.prizeName = _0x196699.result?.["dmActivityLog"]?.["awardName"], await this.saveAddress());
|
|
return;
|
|
} else this.putMsg(_0x196699.result?.["errorMsg"] || _0x196699.result?.["message"]);
|
|
}
|
|
let _0x4e39b5 = _0x196699?.["message"];
|
|
if (_0x4e39b5?.["includes"]("您未中奖")) {
|
|
this.putMsg("空气");
|
|
continue;
|
|
}
|
|
if (_0x4e39b5?.["includes"]("关注店铺") && (await this.follow())) {
|
|
_0x50018a++;
|
|
continue;
|
|
}
|
|
this.putMsg(_0x4e39b5);
|
|
await this.wxStopSync(_0x4e39b5);
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
await this.getDefenseUrls();
|
|
if (_0x32ba81.includes(this.activityType)) {
|
|
await this.login();
|
|
this.exitShop();
|
|
if (![10026, 10080].includes(this.actType)) {
|
|
let _0x29cd8a = await this.lzkjApi("api/task/" + this.type + "/activity");
|
|
if (_0x29cd8a && _0x29cd8a.resp_code === 0) {
|
|
let _0x431f59 = _0x29cd8a.data?.["taskList"] || [];
|
|
await this.lzkjTask(_0x431f59);
|
|
}
|
|
}
|
|
let _0x7b628d = await this.lzkjApi("api/prize/drawPrize");
|
|
this.drawNumber = 5;
|
|
_0x7b628d && _0x7b628d.resp_code === 0 && (this.drawNumber = _0x7b628d.data?.["drawNumber"]);
|
|
[10026, 10080].includes(this.actType) && (this.drawNumber = 3);
|
|
if (this.drawNumber <= 0) {
|
|
_0x5002ff++;
|
|
_0x5002ff >= _0x34c2bd.notLuckLimit && _0x34c2bd.notLuckLimit === this.index + 1 && (this.putMsg("达到无抽奖次数上限"), this.stop());
|
|
this.putMsg("无抽奖次数");
|
|
return;
|
|
}
|
|
this.drawNumber = Math.min(this.drawNumber, 7);
|
|
while (this.drawNumber-- > 0) {
|
|
let _0x5aceaa = await this.lzkjApi("api/prize/draw", {
|
|
"consumePoints": 0,
|
|
"actId": this.activityId
|
|
});
|
|
this.debug(_0x5aceaa);
|
|
if (_0x5aceaa && _0x5aceaa.resp_code === 0) {
|
|
if (_0x5aceaa.data === "1") {
|
|
this.putMsg("积分不足");
|
|
return;
|
|
}
|
|
this.putMsg(_0x5aceaa.data?.["prizeName"] || "空气");
|
|
_0x5aceaa.data && _0x5aceaa.data?.["prizeName"] && _0x5aceaa.data?.["prizeType"] === 3 && _0x5aceaa.data?.["addressId"] && _0x5aceaa.data?.["dayTime"] === this.formatDate(Date.now(), "yyyy-MM-dd") && (this.addressId = _0x5aceaa.data.addressId, this.prizeName = _0x5aceaa.data?.["prizeName"], await this.saveAddress());
|
|
await this.sleep(200);
|
|
} else {
|
|
let _0x524f34 = _0x5aceaa?.["resp_msg"];
|
|
this.putMsg(_0x524f34);
|
|
await this.wxStopSync(_0x524f34);
|
|
return;
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
await this.wxCommonInfo();
|
|
await this.getSimpleActInfoVo();
|
|
if (this.index === 0) {
|
|
await this.getShopInfo();
|
|
if (this.shopName && ([26, 128, 129].includes(this.activityType) && _0x34c2bd.notLuckDrawList.some(_0x3d777b => this.shopName.includes(_0x3d777b)) || this.shopName.match(_0x34c2bd.blackLuckDrawRule))) {
|
|
this.putMsg("已屏蔽");
|
|
this.stop();
|
|
return;
|
|
}
|
|
}
|
|
this.defenseUrls.length === 0 ? await this.getMyPing() : await this.initPinToken();
|
|
await this.accessLog();
|
|
let _0x7b6d73 = await this.activityContent();
|
|
if (!_0x7b6d73?.["result"] || !_0x7b6d73?.["data"]) {
|
|
this.putMsg(_0x7b6d73?.["errorMessage"]);
|
|
return;
|
|
}
|
|
let _0x16966d = _0x7b6d73.data?.["canDrawTimes"] ?? 5,
|
|
_0xd7f791 = _0x7b6d73.data?.["dayMaxDraw"] || 5,
|
|
_0x7dead6 = _0x7b6d73.data?.["hasFollow"] || false,
|
|
_0x1eb877 = _0x7b6d73.data?.["needFollow"] || false,
|
|
_0x17c7b8 = _0x7b6d73.data?.["content"]["filter"](_0x2a8f53 => [6, 7, 13, 14, 15, 16].includes(_0x2a8f53.type));
|
|
if (_0x17c7b8.length === 0) {
|
|
this.putMsg("垃圾或领完");
|
|
this.stop();
|
|
return;
|
|
}
|
|
let _0x55f613 = await this.getGiveContent();
|
|
if (_0x55f613 && _0x55f613.data) {
|
|
let _0x2085f4 = _0x55f613.data;
|
|
if (_0x2085f4?.["follow"] && _0x2085f4.follow.hasGetGiveTimes < _0x2085f4.follow.maxGiveTimes) {
|
|
this.log("做关注任务");
|
|
let _0x2e965c = _0x55f613.data.follow.skuIdsList;
|
|
const _0x5d0d21 = _0x2085f4?.["followRecordVO"]?.["hasFollowSkuIdsList"];
|
|
_0x2e965c = _0x5d0d21 ? this.different(_0x2e965c, _0x5d0d21) : _0x2e965c;
|
|
for (let _0x5b0c3f = 0; _0x5b0c3f < _0x2085f4.follow.followTimes - _0x2085f4.follow.hasFollowTimes; _0x5b0c3f++) {
|
|
await this.followShop(_0x2e965c[_0x5b0c3f]);
|
|
await this.sleep(100);
|
|
}
|
|
_0x16966d++;
|
|
}
|
|
}
|
|
_0x16966d = Math.min(_0x16966d, _0xd7f791, 7);
|
|
if (_0x16966d <= 0) return _0x5002ff++, _0x5002ff >= _0x34c2bd.notLuckLimit && _0x34c2bd.notLuckLimit === this.index + 1 && (this.putMsg("达到无抽奖次数上限"), this.stop()), this.putMsg("无抽奖次数");
|
|
_0x1eb877 && !_0x7dead6 && (this.log("关注店铺"), await this.wxApi("wxActionCommon/newFollowShop", {
|
|
"buyerPin": this.secretPin,
|
|
"venderId": this.venderId,
|
|
"activityType": this.activityType
|
|
}));
|
|
_0x16966d = Math.min(_0x16966d, 7);
|
|
while (_0x16966d-- > 0) {
|
|
let _0x53578c = await this.wxApi(this.type + "/start", {
|
|
"pin": this.secretPin
|
|
});
|
|
this.debug(_0x53578c);
|
|
if (_0x53578c && _0x53578c.result) this.putMsg("" + (_0x53578c.data?.["name"] || "空气")), _0x53578c.data?.["drawInfoType"] === 7 && _0x53578c.data?.["needWriteAddress"] === "y" && _0x53578c.data?.["addressId"] && (this.addressId = _0x53578c.data.addressId, this.prizeName = _0x53578c.data.name, await this.saveAddress()), await this.sleep(500); else {
|
|
let _0x2db8bd = _0x53578c?.["errorMessage"];
|
|
if (_0x2db8bd?.["includes"]("未关注") && (await this.follow())) {
|
|
_0x16966d++;
|
|
continue;
|
|
}
|
|
if (_0x34c2bd.openCardMode === 1 && ["不是会员", "店铺会员"].some(_0x336e5a => _0x2db8bd?.["includes"](_0x336e5a))) {
|
|
await this.bindWithVender();
|
|
if (this.canNotOpenCard) return this.reseCookieStatus();
|
|
_0x16966d++;
|
|
continue;
|
|
}
|
|
this.putMsg(_0x2db8bd);
|
|
await this.wxStopSync(_0x2db8bd);
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
_0x14c5ce.activity = {
|
|
"activityUrl": activityUrl
|
|
};
|
|
_0x14c5ce.TaskClass = _0x2f7451;
|
|
_0x14c5ce.run({
|
|
"whitelist": ["1-20000"],
|
|
"main_thread": 3
|
|
}); |