小熊脚本提交

This commit is contained in:
youfak 2024-12-14 11:22:32 +08:00
parent bf283be1d0
commit a3b5f25f12
29 changed files with 13118 additions and 0 deletions

539
b_jd_wx_luckDraw.js Normal file
View File

@ -0,0 +1,539 @@
/*
幸运抽奖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 B_WX_LUCK_DRAW_URL=""
export B_WX_NOT_LUCK_DRAW_LIST="" # 积分不跑 @分割 例子: a2海外@马可波罗@合田家@风向标@罗技二手外设
export B_WX_BLACK_LUCK_DRAW_RULE="" # 拉黑的店铺 例子: FITURE|FITURE
export B_WX_LUCK_OPEN_MODE="0" # 强制开卡 0:不开卡 1:开卡 默认值0
export B_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.B_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
});

264
b_jd_wx_shopSign.js Normal file
View File

@ -0,0 +1,264 @@
/*
签到有礼beta v2.0.0
https://cjhy-isv.isvjcloud.com/sign/signActivity?activityId=4879ca4f9b4d4e9580ac09eca30b44ac
https://lzkj-isv.isvjd.com/prod/cc/interaction/v2/10023/1001/?activityId=1752260456689242113&shopId=1000001706
https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10002&activityId=1764492473030377474&templateId=20201228083300lxqdsl011&nodeId=101001003&prd=cjwx
https://jinggeng-rc.isvjcloud.com/ql/front/showSign?id=9e80802c8dc9f04d018df48f286509c1&user_id=10028198
https://txzj-isv.isvjcloud.com/sign_in/home?a=UHpDWkVHNFhlTzhGZ2MrYUV3
export B_WX_SIGN_URL=""
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.B_WX_SHOP_SIGN_URL);
if (mode) {
activityUrl = "https://lzkj-isv.isvjd.com/prod/cc/interaction/v2/10023/1001/?activityId=1763116670225666049&shopId=10034889";
activityUrl = "https://cjhy-isv.isvjcloud.com/sign/signActivity?activityId=4879ca4f9b4d4e9580ac09eca30b44ac";
activityUrl = "https://jinggeng-rc.isvjcloud.com/ql/front/showSign?id=9e80802c8dc9f04d018df48f286509c1&user_id=10028198";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10002&activityId=1764492473030377474&templateId=20201228083300lxqdsl011&nodeId=101001003&prd=cjwx";
activityUrl = "https://cjhy-isv.isvjcloud.com/sign/signActivity?activityId=4879ca4f9b4d4e9580ac09eca30b44ac";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10023&activityId=1752867173633544194&templateId=2023110802rlqd&nodeId=101001&prd=cjwx";
activityUrl = "https://txzj-isv.isvjcloud.com/sign_in/home?a=UHpDWkVHNFhlTzhGZ2MrYUV3";
activityUrl = "https://lzkj-isv.isvjcloud.com/sign/signActivity2?activityId=f6bfaa803f59453b897876ccccd08cef&venderId=1000084244&adsource=tg_storePage";
activityUrl = "https://txzj-isv.isvjcloud.com/sign_in/home?a=TUdPWlJXOFFlK29GZ2MrZUV3";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10040&activityId=1772829299506323457&templateId=20210518190900qrqd011&nodeId=101001&prd=cjwx";
activityUrl = "https://jingyun-rc.isvjcloud.com/h5/pages/SignIn/SignIn?id=2085faf335324522080865dbc20ba790&userId=1000007503";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10023&templateId=20210518190900rlqd011&activityId=1791052003950125057";
activityUrl = "https://jingyun-rc.isvjcloud.com/sign_h5/pages/BudweiserSignIn/SignIn?id=0c9992da962de13b2f205b1000dac90d&userId=1000002552";
activityUrl = "https://cjhy-isv.isvjcloud.com/sign/signActivity?activityId=b3a4db52e1dc43598b71c946bdcae9bd";
}
const {
RunMode: I,
UserMode: J
} = require("./bear");
I.envInfo = {
"name": "B签到有礼",
"runName": "b_jd_wx_shopSign",
"env": "B_WX_SHOP_SIGN_URL",
"version": "2.0.0"
};
let K = process.env.B_WX_SHOP_SIGN_BEAN_GOODS ? process.env.B_WX_SHOP_SIGN_BEAN_GOODS : false,
M = ["10001", "10002", "10003", "10004", "10023", "10040"];
process.env.B_WX_SIGN_ACTIVITY_TYPES ? process.env.B_WX_SIGN_ACTIVITY_TYPES.split(/[@,&|]/).forEach(e => M.push(e)) : "";
class N extends J {
constructor(e, f) {
super(e, f);
}
async ["v2Sign"](e = true) {
let g = await this.v2Api("api/" + this.activityType + "/sign");
this.debug(g);
if (g && g.code === 200) this.putMsg(g.data?.["prizeName"] || "签到成功"); else {
if (g?.["message"]["includes"]("不是店铺会员") && e) {
await this.bindWithVender();
await this.sign(false);
}
}
}
async ["signPost"](e = true) {
let g = await this.hdbApi(this.hdbPrefix ? this.hdbPrefix + "front/cusActivity/cusSignPost" : "signPost");
if (g && g.succ) {
g?.["result"]?.["awardRes"]?.["needSend"] && this.putMsg(g.result?.["awardRes"]?.["dmActivityLog"]?.["awardName"] || "空气");
let j = g.result?.["signLog"]?.["continueCount"];
this.putMsg("已连续签到" + j + "天");
return;
}
let h = g?.["message"];
if (e && h?.["includes"]("关注店铺") && (await this.follow())) {
return await this.signPost(false);
}
this.putMsg(h);
this.wxStop(h);
return;
}
async ["userTask"]() {
await this.isvObfuscator();
if (this.mode === "txzj") {
if (!this.activityId) return this.putMsg("活动链接错误"), this.stop();
let h = await this.taskPost("front/jd_store_user_info", {
"token": this.isvToken
});
if (!h || h.code !== "success") {
let k = h.msg || "获取用户信息失败";
return this.putMsg(k), this.wxStop(k);
}
let i = await this.taskPost("sign_in/receive_prize", {
"pid": this.activityId
});
this.debug(i);
if (i && i.code === "success") {
this.putMsg("签到成功");
if (i?.["data"]?.["prize_title"]) switch (i?.["data"]?.["prize_title"]["type"]) {
case "coupon":
this.putMsg("优惠券");
break;
case "bean":
this.putMsg((i.data.prize_title?.["prize_title"] || i.data.prize_title?.["once_num"]) + "京豆");
break;
case "integral":
this.putMsg((i.data.prize_title?.["prize_title"] || i.data.prize_title?.["once_num"]) + "积分");
break;
case "goods":
this.putMsg("" + i.data.prize_title.prize_name);
break;
default:
this.putMsg(JSON.stringify(i?.["data"]?.["prize_title"]));
}
return;
}
let j = i?.["msg"] || "签到失败";
this.putMsg(j);
this.wxStop(j);
return;
}
if (this.mode === "v2") {
await this.login();
await this.v2Sign();
if (this.index == 0) {
await this.getShopInfo();
await this.v2getPrizeList();
await this.v2getRule();
}
let m = await this.v2Api("api/" + this.activityType + "/calendar");
this.debug(m);
if (m && m.code === 200) {
let n = m.data.continuousSignDays;
this.putMsg("已连续签到" + n + "天");
}
return;
}
if (this.mode === "jinggeng") {
this.userId = this.userId || this.getQueryString(this.activityUrl, "userId");
this.activityId = this.activityId || this.getQueryString(this.activityUrl, "actId");
await this.setMixNick();
await this.jinggengShopInfo();
await this.taskPost("front/followShop", {
"userId": this.userId
});
let p = await this.jinggengApi("saveSignIn");
this.debug(p);
if (p && p.succ) {
if (p?.["msg"]?.["includes"]("签到成功但不需要发奖")) this.putMsg("签到成功"); else {
let s = JSON.parse(p.msg);
s?.["isSendSucc"] ? this.putMsg(s?.["actLogDto"]?.["remark"]) : this.putMsg("空气");
}
return;
}
let q = p?.["msg"] || "签到失败";
this.putMsg(q);
this.wxStop(q);
return;
}
if (this.mode === "hdb") {
return this.hdbPrefix = "", this.activityUrl?.["includes"]("BudweiserSignIn") && (this.hdbEncript = true, this.hdbLoginPath = "sign_java/front/fans/login", this.hdbPrefix = "sign_java/"), await this.login(), await this.reportPVUV(this.hdbPrefix + "front/activity/reportPVUV"), await this.loadFrontAct(this.hdbPrefix + "front/activity/loadFrontAct"), await this.signPost();
}
await this.getDefenseUrls();
if (M.includes(this.activityType)) {
await this.login();
let v = ["10001", "10002", "10003", "10004"].includes(this.activityType) ? "api/task/sign/add" : "api/task/daySign/getSignClick",
w = await this.lzkjApi(v);
this.debug(w);
if (w && w.resp_code === 0) {
this.putMsg("签到成功");
let y = w?.["data"]?.["prizeName"];
this.putMsg(y);
w.data && w.data?.["prizeName"] && w.data?.["prizeType"] === 3 && w.data?.["addressId"] && w.data?.["dayTime"] === this.formatDate(Date.now(), "yyyy-MM-dd") && (this.addressId = w.data.addressId, this.prizeName = w.data?.["prizeName"], await this.saveAddress());
return;
}
let x = w?.["resp_msg"] || "签到失败";
this.putMsg(x);
this.wxStop(x);
return;
}
await this.wxCommonInfo();
await this.getSimpleActInfoVo();
if (this.index === 0) {
await this.getShopInfo();
}
this.defenseUrls.length === 0 ? await this.getMyPing() : await this.initPinToken();
await this.accessLog();
this.isSevenDay = this.activityUrl?.["includes"]("sevenDay");
this.isCj = this.activityUrl?.["includes"]("//cjhy");
this.signNew = this.activityUrl?.["includes"]("signNew");
if (this.index === 0) {
let z = await this.wxApi(this.isSevenDay ? "sign/sevenDay/wx/getActivity" : (this.signNew ? "signNew/wx/getActivity" : "sign/wx/getActivity"), {
"actId": this.activityId,
"venderId": this.venderId
});
this.debug(z);
if(z?.isOk) {
let jsondata = JSON.parse(z?.act?.giftJson);
J.activity.prizeList = jsondata.giftConditions;
}
if (!z || !z.isOk) {
let A = z?.["msg"] || "活动已结束";
this.putMsg(A);
this.wxStop(A);
} else {
let B = z?.["act"]?.["startTime"],
C = z?.["act"]?.["endTime"];
J.activity.startTime = B;
J.activity.endTime = C;
if (B && B > this.timestamp()) {
return this.putMsg("活动未开始"), this.stop();
}
if (C && C < this.timestamp()) return this.putMsg("活动已结束"), this.stop();
let D = [];
if (this.isSevenDay) {
for (let Q of z?.["act"]?.["giftBean"]?.["giftConditions"] || []) {
Q.gift && (Q.gift.dayNum = Q.dayNum, D.push(Q.gift));
}
} else {
z?.["act"]?.["wxSignActivityGiftBean"]?.["hasGiftEveryDay"] === "y" && D.push(z?.["act"]?.["wxSignActivityGiftBean"]?.["gift"]);
if (z?.["act"]?.["wxSignActivityGiftBean"]?.["giftConditions"]?.["length"] > 0) {
for (let R of z?.["act"]?.["wxSignActivityGiftBean"]?.["giftConditions"] || []) {
R.gift && (R.gift.dayNum = R.dayNum, D.push(R.gift));
}
}
}
D = D.filter(T => ["6", "7", "9", "13", "14", "15", "16"].includes(T.giftType) && !T.insufficient);
if (D.length === 0) return this.putMsg("垃圾或领完"), this.stop();
if (K && D.filter(T => ["6", "7", "13", "14", "15", "16"].includes(T.giftType)).length === 0) return this.putMsg("垃圾或领完"), this.stop();
}
}
this.debug(this.isSevenDay ? "sign/sevenDay/wx/signUp" : (this.signNew ? "signNew/wx/signUp" : "sign/wx/signUp"));
let f = await this.wxApi(this.isSevenDay ? "sign/sevenDay/wx/signUp" : (this.signNew ? "signNew/wx/signUp" : "sign/wx/signUp"), {
"actId": this.activityId,
"pin": this.secretPin
});
this.debug(f);
if (f && f.isOk) {
this.putMsg("签到成功");
let U = this.isSevenDay ? f.signResult?.["gift"] : f.gift,
V = "";
if (U) {
let W = this.isSevenDay ? f.signResult?.["gift"]?.["giftName"] : f?.["gift"]?.["giftName"],
X = this.isCj ? f?.["signResult"]?.["send"] ? "" : "(已发完)" : f?.["isSend"] ? "" : "(已发完)";
V = "" + W + X;
this.addressId = f?.["addressId"];
f?.["needWriteAddress"] === "y" && this.addressId && (this.prizeName = W, await this.saveAddress());
}
this.putMsg(V);
return;
}
let g = f?.["msg"] || f?.["errMsg"] || "签到失败";
this.putMsg(g);
this.wxStop(g);
}
}
I.activity = {
"activityUrl": activityUrl
};
I.TaskClass = N;
I.run({
"whitelist": ["1-100000"],
"main_thread": 5,
"wxProxyCheck": 2
});

4358
bear.js Normal file

File diff suppressed because it is too large Load Diff

143
jd_follow_shop.js Normal file
View File

@ -0,0 +1,143 @@
/*
关注有礼beta v1.0.0
https://shop.m.jd.com/?shopId=1000304221
650767_655224
https://shop.m.jd.com/?shopId=650767&venderId=650767
export B_FOLLOW_SHOP_ARGV=""
cron: 1 1 1 1 *
const $ = new Env("关注有礼beta");
*/
let l1IlIiIi = __dirname.includes("bear"),
ilIIlIl1 = decodeURIComponent(process.argv.splice(2)?.[0] || process.env.M_FOLLOW_SHOP_ARGV);
if (l1IlIiIi) {
ilIIlIl1 = "650767_655224";
ilIIlIl1 = "https://shop.m.jd.com/?shopId=650767";
ilIIlIl1 = "https://shop.m.jd.com/?venderId=650767";
ilIIlIl1 = "https://shop.m.jd.com/?shopId=650767&venderId=650767";
ilIIlIl1 = "1000083882_1000083882";
ilIIlIl1 = "https://shop.m.jd.com/shop/home?shopId=158274";
}
const {
RunMode: Ii1I1iil,
UserMode: lli1111I,
tools: tool
} = require("./bear");
const qs = require("qs");
Ii1I1iil.envInfo = {
"name": "M关注有礼",
"runName": "jd_follow_shop",
"version": "1.0.0"
};
class i11IiIIl extends lli1111I {
constructor(iiiIIliI, l1I1iI) {
super(iiiIIliI, l1I1iI);
}
["removeLastCharacterIfAmpersand"](Ii1iIlII) {
const l111i11l = Ii1iIlII.charAt(Ii1iIlII.length - 1);
if (l111i11l === "&") {
return Ii1iIlII.slice(0, -1);
} else return Ii1iIlII;
}
async ["drawShopGift"](IiiilI) {
let I1I11iii = {
"activityId": IiiilI
};
this.shopId && (I1I11iii.shopId = this.shopId);
this.venderId && (I1I11iii.venderId = this.venderId);
let l1iiii1i = await this.jd_api({
"url": "https://api.m.jd.com/client.action?functionId=whx_drawShopGift&appid=shop_m_jd_com&body=" + encodeURIComponent(JSON.stringify(I1I11iii)),
"headers": {
"Referer": "https://shop.m.jd.com/"
}
});
this.debug(l1iiii1i);
if (l1iiii1i && l1iiii1i.code === "0") {
let iliI1iII = l1iiii1i.result,
iiIl1II = iliI1iII?.["alreadyReceivedGifts"]?.["map"](I11IlII => "" + I11IlII?.["rearWord"] + I11IlII?.["redWord"])["join"](",");
this.putMsg(iiIl1II);
return;
}
this.putMsg(l1iiii1i ? JSON.stringify(l1iiii1i) : "领取失败");
}
async ["userTask"]() {
if (this.followShopArgv?.["startsWith"]("http")) {
this.shopId = this.getQueryString(this.followShopArgv, "shopId");
this.venderId = this.getQueryString(this.followShopArgv, "venderId");
} else {
if (this.followShopArgv.includes("_")) {
let I1i111il = this.followShopArgv.split("_");
this.shopId = I1i111il[0];
this.venderId = I1i111il[1];
} else {
if (/^\d+$/.test(this.followShopArgv)) this.venderId = this.followShopArgv;else {
this.putMsg("参数错误");
this.stop();
return;
}
}
}
!this.shopId && !this.venderId && (this.putMsg("参数错误"), this.stop());
let lIIl11Il = "https://shop.m.jd.com/?" + (this.shopId ? "shopId=" + this.shopId + "&" : "") + (this.venderId ? "venderId=" + this.venderId : "");
Ii1I1iil.activity.activityUrl = this.removeLastCharacterIfAmpersand(lIIl11Il);
let body = {
"shopId": this.shopId,
"source":"app-shop",
"sourceRpc": "shop_app_home_home",
"venderId": this.venderId
};
let sign = tool.getSignData("getShopHomeActivityInfo", body, this.phoneInfo);
let sifnStr = qs.stringify(sign);
let i11li1i = await this.jd_api({
"url": 'https://api.m.jd.com/client.action?functionId=getShopHomeActivityInfo&' + sifnStr,
"headers": this.headers
});
if (!i11li1i || i11li1i.code !== "0") {
this.putMsg(i11li1i ? JSON.stringify(i11li1i) : "获取活动信息失败");
return;
}
let iilliil1 = i11li1i.result;
if (iilliil1?.["followed"]) {
this.putMsg("已经关注过");
await this.unfollow();
}
if (iilliil1?.["shopGifts"]) {
let body = {
"shopId": this.shopId,
"source":"app-shop",
"sourceRpc": "shop_app_home_home",
"venderId": this.venderId,
"activityId": iilliil1?.["activityId"]
};
let sign = tool.getSignData("drawShopGift", body, this.phoneInfo);
let sifnStr = qs.stringify(sign);
let lIiillIl = await this.jd_api({
"url": "https://api.m.jd.com/client.action?functionId=drawShopGift&" + sifnStr,
"headers": this.headers
});
this.debug(lIiillIl);
if (lIiillIl && lIiillIl.code === "0") {
let I1lIl1Ii = lIiillIl.result,
llIlli1I = I1lIl1Ii?.["alreadyReceivedGifts"]?.["map"](liIili1i => "" + liIili1i?.["rearWord"] + liIili1i?.["redWord"])["join"](",");
this.putMsg(llIlli1I);
return;
}
this.putMsg(lIiillIl ? JSON.stringify(lIiillIl) : "领取失败");
} else {
this.putMsg("未发现关注有礼活动");
}
}
}
Ii1I1iil.activity = {
"followShopArgv": ilIIlIl1
};
Ii1I1iil.TaskClass = i11IiIIl;
Ii1I1iil.run({
"whitelist": ["1-2000"],
"main_thread": 3,
"wxProxySmart": 1
});

153
jd_live.js Normal file
View File

@ -0,0 +1,153 @@
/*
直播抽奖beta v1.0.6
https://h5.m.jd.com/dev/3pbY8ZuCx4ML99uttZKLHC2QcAMn/live.html?id=xxxxxx
xxxxxx
export B_LIVE_URL=""
cron: 7 7 7 7 7 *
const $ = new Env("直播抽奖beta");
*/
let mode = __dirname.includes('bear');
let liveArgv = decodeURIComponent(process.argv.splice(2)?.[0] || process.env.M_LIVE_URL);
if (mode) {
liveArgv = "https://h5.m.jd.com/dev/3pbY8ZuCx4ML99uttZKLHC2QcAMn/live.html?id=22832609";
liveArgv = "https://h5.m.jd.com/dev/3pbY8ZuCx4ML99uttZKLHC2QcAMn/live.html?id=22789891&sharer=%e8%93%9d%e8%89%b2%e9%9b%a8+R62663&user=tZLbIfinAeEQHKV7oZNnzHlo69Mkg6&cu=true&rid=12440&utm_source=kong&utm_medium=jingfen&utm_campaign=t_1002070633_1589_169_1&utm_term=3f58013f8d4a4055942f01ff46fd9f84";
liveArgv = "https://h5.m.jd.com/dev/3pbY8ZuCx4ML99uttZKLHC2QcAMn/live.html?id=22775299&sharer=%e8%93%9d%e8%89%b2%e9%9b%a8+R62663&user=tZLbIfinAeEQHKV7oZNnzHlo69Mkg6&cu=true&rid=12422&hideyl=1&utm_source=kong&utm_medium=jingfen&utm_campaign=t_1002070633_1589_169_1&utm_term=0785fb47bf6945baa958ba7e68e132e5";
liveArgv = "https://h5.m.jd.com/dev/3pbY8ZuCx4ML99uttZKLHC2QcAMn/live.html?id=22789891&sharer=%e8%93%9d%e8%89%b2%e9%9b%a8+R62663&user=tZLbIfinAeEQHKV7oZNnzHlo69Mkg6&cu=true&rid=12427&hideyl=1&utm_source=kong&utm_medium=jingfen&utm_campaign=t_1002070633_1589_169_1&utm_term=5834da7c5ddd4bd8965fa763833aaa01";
liveArgv = "https://h5.m.jd.com/dev/3pbY8ZuCx4ML99uttZKLHC2QcAMn/live.html?id=22670339&sharer=%e8%93%9d%e8%89%b2%e9%9b%a8+R62663&user=tZLbIfinAeEQHKV7oZNnzHlo69Mkg6&cu=true&rid=12439&hideyl=1&utm_source=kong&utm_medium=jingfen&utm_campaign=t_1002070633_1589_169_1&utm_term=0e716e561b334b1b9a75c87a5221be56";
liveArgv = "22670339";
liveArgv = "https://h5.m.jd.com/dev/3pbY8ZuCx4ML99uttZKLHC2QcAMn/live.html?id=22773294";
liveArgv = "https://h5.m.jd.com/dev/3pbY8ZuCx4ML99uttZKLHC2QcAMn/live.html?id=22747197";
}
const {
RunMode: liii1i,
UserMode: IlI1iiII
} = require("./bear");
liii1i.envInfo = {
"name": "直播抽奖beta",
"runName": "jd_live",
"version": "1.0.6"
};
class i11Iliii extends IlI1iiII {
constructor(i1III1i, IIlI1i) {
super(i1III1i, IIlI1i);
this.retryCount = 2;
this.proxyRetryCount = 2;
this.otherHeaders = {
"User-Agent": this.ua.jd4,
"jdgs": "-3107",
"x-referer-package": "com.360buy.jdmobile",
"x-rp-client": "ios_4.0.0"
};
}
["randomCookie"]() {
const Iiiii11 = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",
iili1II = Array.from({
"length": 12
}, () => Iiiii11.charAt(Math.floor(Math.random() * Iiiii11.length))).join(""),
illiiiI1 = Array.from({
"length": 9
}, () => Iiiii11.charAt(Math.floor(Math.random() * Iiiii11.length))).join("");
return "pt_key=AAJi3kgCADBAwCJiwFJpvIfk7J_U6J0FsSZDCnvCtbEhC" + iili1II + ";pt_pin=jd_" + illiiiI1 + ";";
}
async ["liveActivity"]() {
let iiIiIlIl = await this.jd_api({
"api": "client.action",
"method": "post",
"data": {},
"functionId": "liveActivityV946",
"body": {
"itemId": null,
"liveId": this.liveId,
"masterPin": null,
"pageId": "Live_Room",
"showCoupon": "0"
},
"sign": true,
"jdje": true,
"noReferer": true
});
this.debug(iiIiIlIl);
if (!iiIiIlIl || iiIiIlIl.code !== "0") return this.putMsg(iiIiIlIl ? JSON.stringify(iiIiIlIl) : "获取直播信息失败"), this.exit();
let IIIliI1i = iiIiIlIl.data?.["iconArea"]?.["filter"](iilIiii => iilIiii.type === "new_anchor_darw_lottery" && iilIiii.actionType === 3) ?? [];
if (IIIliI1i.length <= 0) return this.putMsg("未找到有效抽奖活动"), this.stop();
this.iconArea = IIIliI1i;
}
async ["liveLotteryPanel"]() {
let lIllII1 = await this.jd_api({
"api": "client.action",
"method": "post",
"data": {},
"functionId": "liveLotteryPanelV1012",
"body": {
"liveId": this.liveId.toString(),
"lotteryId": this.lotteryId.toString(),
"pageId": "Live_Room",
"shared": 1
},
"sign": true,
"jdje": true,
"noReferer": true
});
this.debug(lIllII1);
if (!lIllII1 || lIllII1.code !== "0") return this.putMsg("获取活动详情失败"), this.exit();
if (![3, 13].includes(lIllII1.data?.["lotteryRewardDetail"]?.["rewardType"])) {
return this.putMsg("垃圾活动"), this.stop();
}
this.rewardValue = lIllII1.data?.["lotteryRewardDetail"]?.["couponCondition"] || lIllII1.data?.["lotteryRewardDetail"]?.["rewardValue"] || 0;
this.debug(this.rewardValue);
}
async ["userTask"]() {
this.liveArgv?.["startsWith"]("http") ? this.liveId = this.getQueryString(this.liveArgv, "id") : this.liveId = this.liveArgv;
if (!this.liveId) return this.putMsg("参数错误"), this.stop();
liii1i.activity.activityUrl = "https://h5.m.jd.com/dev/3pbY8ZuCx4ML99uttZKLHC2QcAMn/live.html?id=" + this.liveId;
await this.liveActivity();
for (let il1IllI1 of this.iconArea) {
this.lotteryId = il1IllI1.data.lotteryId;
if (!this.lotteryId) {
continue;
}
await this.liveLotteryPanel();
let i1ii11Il = await this.jd_api({
"api": "client.action",
"data": {},
"method": "post",
"functionId": "liveDrawLotteryV1012",
"body": {
"fansLevel": 1,
"liveId": this.liveId.toString(),
"lotteryId": this.lotteryId.toString(),
"nickName": this.pin,
"pageId": "Live_Room",
"plus": 1,
"token": "",
"eid": ""
},
"sign": true,
"jdje": true,
"noReferer": true
});
this.debug(i1ii11Il);
if (!i1ii11Il || i1ii11Il.code !== "0") {
this.putMsg("抽奖失败");
continue;
}
if (i1ii11Il.data?.["rewardTitle"]?.["includes"]("中奖")) {
this.putMsg(this.rewardValue + "京豆");
} else i1ii11Il.data?.["rewardTitle"]?.["includes"]("擦肩") ? this.putMsg("空气") : this.putMsg(i1ii11Il.data?.["rewardTitle"]);
}
}
}
liii1i.activity = {
"liveArgv": liveArgv
};
liii1i.TaskClass = i11Iliii;
liii1i.run({
"whitelist": ["1-2000"],
"main_thread": 3
});

106
jd_open_card.js Normal file
View File

@ -0,0 +1,106 @@
/*
入会有礼beta v2.0.2
https://shopmember.m.jd.com/shopcard/?shopId=123
https://shopmember.m.jd.com/shopcard/?venderId=123
https://shopmember.m.jd.com/shopcard/?shopId=3779964&venderId=3779964
650767_655224
export B_OPEN_CARD_ARGV=""
export B_OPEN_CARD_MODE="0" # 开卡模式 0仅豆子 1积分和豆子
export B_OPEN_CARD_BEAN_NUM="10" # 超过这个数量才会开卡 默认值10 当B_OPEN_CARD_MODE为1时该配置无效
cron: 7 7 7 7 7 *
const $ = new Env("入会有礼beta");
*/
let mode = __dirname.includes('bear');
let openCardArgv = decodeURIComponent(process.argv.splice(2)?.[0] || process.env.M_OPEN_CARD_ARGV);
if (mode) {
openCardArgv = "650767_655224";
openCardArgv = "https://shopmember.m.jd.com/shopcard/?shopId=123";
openCardArgv = "https://shopmember.m.jd.com/shopcard/?venderId=123";
openCardArgv = "https://shopmember.m.jd.com/shopcard/?shopId=3779964&venderId=3779964";
openCardArgv = "1000008814";
openCardArgv = "https://shop.m.jd.com/shop/home?shopId=1000076283";
openCardArgv = "https://shopmember.m.jd.com/shopcard?shopId=1000098801&venderId=1000098801";
openCardArgv = "https://shopmember.m.jd.com/shopcard?shopId=1000077407&venderId=1000077407";
openCardArgv = "https://shopmember.m.jd.com/shopcard?shopId=1000072462&venderId=1000072462";
openCardArgv = "1000001195";
}
const {
RunMode: i11I1ili,
UserMode: ll1li1Ii,
baseCommonEnv: II1I1ill,
baseCommonEnvKey: IliIIil
} = require("./bear");
i11I1ili.envInfo = {
"name": "入会有礼beta",
"runName": "jd_open_card",
"version": "2.0.2"
};
II1I1ill.openCardBeanNum = parseInt(process.env.B_OPEN_CARD_BEAN_NUM || "10");
II1I1ill.openCardMode = parseInt(process.env.B_OPEN_CARD_MODE || "0");
IliIIil.B_OPEN_CARD_BEAN_NUM = "openCardBeanNum";
IliIIil.B_OPEN_CARD_MODE = "openCardMode";
class ll11IIll extends ll1li1Ii {
constructor(lilI1Il1, l1l11ii1) {
super(lilI1Il1, l1l11ii1);
}
async ["userTask"]() {
const llIiiIlI = /^(https?:\/\/)?([\da-zA-Z.-]+)\.([a-z.]{2,6})([/\w.-]*)*\/?(\?[\w&=.-]*)?$/;
if (llIiiIlI.test(this.openCardArgv)) {
this.shopId = this.getQueryString(this.openCardArgv, "shopId");
this.venderId = this.getQueryString(this.openCardArgv, "venderId");
this.debug(this.shopId);
this.debug(this.venderId);
} else {
if (this.openCardArgv.includes("_")) {
let IlliilI = this.openCardArgv.split("_");
this.shopId = IlliilI[0];
this.venderId = IlliilI[1];
} else {
if (/^\d+$/.test(this.openCardArgv)) this.venderId = this.openCardArgv;else {
this.putMsg("参数错误");
this.stop();
return;
}
}
}
i11I1ili.activity.activityUrl = "https://shopmember.m.jd.com/shopcard?" + (this.shopId ? "shopId=" + this.shopId + "&" : "") + "venderId=" + this.venderId;
let I1i11ilI = await this.getShopOpenCardInfo();
this.debug(I1i11ilI);
if (!I1i11ilI) {
return;
}
if (this.openCardStatus == 0) {
if (!this.giftActId) {
this.putMsg("无入会礼包");
this.stop();
return;
}
let iliiIlII = I1i11ilI?.["result"]?.[0]?.["interestsRuleList"] ?? [];
if (II1I1ill.openCardMode === 0 && !iliiIlII.some(i1i11ll1 => ["京豆"].includes(i1i11ll1.prizeName) && parseInt(i1i11ll1.discountString) >= II1I1ill.openCardBeanNum)) return this.putMsg("垃圾活动"); //this.stop();
if (II1I1ill.openCardMode === 1 && !iliiIlII.some(Iill1111 => /京豆|积分/.exec(Iill1111.prizeName))) return this.putMsg("垃圾活动"); //this.stop();
let ili1iIlI = await this.bindWithVender();
if (ili1iIlI && ili1iIlI.success) {
let i1iil111 = ili1iIlI?.["result"]?.["giftInfo"]?.["giftList"] ?? [];
for (let l111IIl1 of i1iil111) {
this.putMsg("" + l111IIl1?.["discount"] + l111IIl1?.["prizeTypeName"]);
}
}
return;
}
this.log("已开卡");
}
}
i11I1ili.activity = {
"openCardArgv": openCardArgv
};
i11I1ili.TaskClass = ll11IIll;
i11I1ili.run({
"whitelist": ["1-2000"],
"main_thread": 3
});

87
jd_shop_gyg.js Normal file
View File

@ -0,0 +1,87 @@
/*
店铺刮奖beta v1.0.0
https://shop.m.jd.com/?shopId=650767
650767_655224
export B_GYG_SHOP_ARGV=""
cron: 7 7 7 7 7 *
const $ = new Env("店铺刮奖beta");
*/
let mode = __dirname.includes('bear');
let gygShopArgv = decodeURIComponent(process.argv.splice(2)?.[0] || process.env.M_GYG_SHOP_ARGV);
mode && (gygShopArgv = "650767_655224", gygShopArgv = "https://shop.m.jd.com/?shopId=650767", gygShopArgv = "https://shop.m.jd.com/?shopId=1000457155");
const {
RunMode: iIlI1l1I,
UserMode: ilII1iiI
} = require("./bear");
iIlI1l1I.envInfo = {
"name": "店铺刮奖beta",
"runName": "jd_shop_gyg",
"version": "1.0.0"
};
class iIlIlIil extends ilII1iiI {
constructor(ll1iilIl, IIIlIiI) {
super(ll1iilIl, IIIlIiI);
}
["removeLastCharacterIfAmpersand"](I1ii1lil) {
const IiIlllii = I1ii1lil.charAt(I1ii1lil.length - 1);
if (IiIlllii === "&") return I1ii1lil.slice(0, -1);else {
return I1ii1lil;
}
}
async ["userTask"]() {
if (this.gygShopArgv?.["startsWith"]("http")) {
this.shopId = this.getQueryString(this.gygShopArgv, "shopId");
this.venderId = this.getQueryString(this.gygShopArgv, "venderId");
} else {
if (this.gygShopArgv.includes("_")) {
let lIilII1l = this.gygShopArgv.split("_");
this.shopId = lIilII1l[0];
this.venderId = lIilII1l[1];
} else {
if (/^\d+$/.test(this.gygShopArgv)) this.venderId = this.gygShopArgv;else {
this.putMsg("参数错误");
this.stop();
return;
}
}
}
!this.shopId && !this.venderId && (this.putMsg("参数错误"), this.stop());
let ilIlllil = "https://shop.m.jd.com/?" + (this.shopId ? "shopId=" + this.shopId + "&" : "") + (this.venderId ? "venderId=" + this.venderId : "");
iIlI1l1I.activity.activityUrl = this.removeLastCharacterIfAmpersand(ilIlllil);
let ilIiilll = await this.jd_api({
"url": "https://api.m.jd.com/client.action",
"method": "post",
"data": {},
"functionId": "sign",
"body": {
"vendorId": this.venderId || this.shopId,
"sourceRpc": "shop_app_sign_home"
},
"sign": true,
"headers": {
"Referer": "",
"User-Agent": this.ua.jd4
}
});
this.debug(ilIiilll);
if (!ilIiilll || ilIiilll.code !== "0") {
this.putMsg(ilIiilll ? JSON.stringify(ilIiilll) : "获取活动信息失败");
return;
}
if (ilIiilll?.["result"]?.["isSign"] === 3) return this.putMsg("已刮过奖");else ilIiilll?.["result"]?.["isSign"] === 1 ? ilIiilll.result?.["isWin"] ? this.putMsg(ilIiilll.result?.["signReward"]?.["name"]) : this.putMsg("未中奖") : this.log(ilIiilll);
}
}
iIlI1l1I.activity = {
"gygShopArgv": gygShopArgv
};
iIlI1l1I.TaskClass = iIlIlIil;
iIlI1l1I.run({
"whitelist": ["1-2000"],
"main_thread": 3
});

332
jd_wx_cartKoi.js Normal file
View File

@ -0,0 +1,332 @@
/*
购物车锦鲤beta v2.0.0
https://lzkj-isv.isvjd.com/wxCartKoi/cartkoi/activity/361487a1d9704d178f77ea631279550f?activityId=361487a1d9704d178f77ea631279550f
https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10036&templateId=2021070590900gwcjl081&activityId=1722164785163591681&nodeId=101001&prd=cjwx
export B_WX_CARTKOI_URL=""
export B_WX_CARTKOI_MODE="3" # 豆子 1 实物2 豆子或实物3 无视奖品4 默认值3
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_CARTKOI_URL);
if (mode) {
activityUrl = "https://lzkj-isv.isvjd.com/wxCartKoi/cartkoi/activity/361487a1d9704d178f77ea631279550f?activityId=361487a1d9704d178f77ea631279550f";
activityUrl = "https://lzkj-isv.isvjd.com/wxCartKoi/cartkoi/activity/10f3ef3be1414b36b9b566f7ce381372?activityId=10f3ef3be1414b36b9b566f7ce381372&adsource=tg_storePage";
activityUrl = "https://lzkj-isv.isvjcloud.com/wxCartKoi/cartkoi/activity/501953175faa4e09913847657eb81681?activityId=501953175faa4e09913847657eb81681";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10036&templateId=2021070590900gwcjl081&activityId=1722164785163591681&nodeId=101001&prd=cjwx";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10036&templateId=2021070590900gwcjl081&activityId=1724309552314191873&nodeId=101001&prd=cjwx";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10036&activityId=1723332057093693441&templateId=2021070590900gwcjl081&nodeId=101001&prd=cjwx";
activityUrl = "https://lzkjdz-isv.isvjd.com/wxCartKoi/cartkoi/activity/07841bc39b0a4226b26f9d03535e9ab1?activityId=07841bc39b0a4226b26f9d03535e9ab1";
activityUrl = "https://lzkj-isv.isvjd.com/wxCartKoi/cartkoi/activity?activityId=cc5ab0a00ccc48a288874549709db392";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10036&templateId=2021070590900gwcjl081&activityId=1715308876757774338&nodeId=101001&prd=cjwx";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10036&activityId=1727254167809003522&templateId=2021070590900gwcjl081&nodeId=101001&prd=cjwx";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10036&templateId=2021070590900gwcjl081&activityId=1727246016674234370&nodeId=101001&prd=cjwx";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interaction/v1/index?activityType=10036&templateId=2021070590900gwcjl08&activityId=1731494042823737346&nodeId=101001&prd=crm";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10036&templateId=2023121110036gwcjl01&activityId=1740321245336375298&nodeId=101001&prd=cjwx";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10036&templateId=20210518190900rlqd011&activityId=1744276235708506114&prd=cjwx";
}
const {
RunMode: lIi1I11,
UserMode: IIiIi1li,
baseCommonEnv: lI1i11I,
baseCommonEnvKey: i1Il1Iii
} = require("./bear");
lI1i11I.openCardBeanNum = parseInt(process.env.B_WX_CARTKOI_MODE || 3);
i1Il1Iii.B_WX_CARTKOI_MODE = "openCardBeanNum";
lIi1I11.envInfo = {
"name": "购物车锦鲤beta",
"runName": "jd_wx_cartKoi",
"version": "2.0.0"
};
class i11llii extends IIiIi1li {
constructor(IiI1iIil, llll1lII) {
super(IiI1iIil, llll1lII);
this.oneClickPurchase = 0;
}
async ["getDrawPrizeInfo"]() {
let I1i1lli1 = [];
if (lI1i11I.openCardBeanNum === 1) {
I1i1lli1.push(6);
} else {
if (lI1i11I.openCardBeanNum === 2) {
I1i1lli1.push(7);
} else lI1i11I.openCardBeanNum === 3 && I1i1lli1.push(6, 7);
}
if (I1i1lli1.length === 0) {
this.openCard = true;
return;
}
let lIIlI1iI = await this.wxApi("wxCartKoi/cartkoi/getDrawPrizeInfo", {
"activityId": this.activityId
});
if (lIIlI1iI && lIIlI1iI.data) {
let iII1Ii1 = lIIlI1iI.data ?? [];
if (iII1Ii1.some(iliIiI11 => I1i1lli1.includes(iliIiI11.type))) {
this.openCard = true;
}
}
}
async ["addCart"]() {
let liI1lliI = await this.wxApi("wxCartKoi/cartkoi/addCart", {
"activityId": this.activityId,
"pin": this.secretPin,
"productId": this.prodectVos[0].productId
});
this.debug(liI1lliI);
if (liI1lliI && liI1lliI.result) {
this.putMsg("加购完成");
return;
}
let iiI1iiIl = liI1lliI?.["errorMessage"] || "加购失败";
this.putMsg(iiI1iiIl);
this.wxStop(iiI1iiIl);
}
async ["quickAddCart"](llIIIiI = true) {
let ll1iilIl = await this.wxApi("wxCartKoi/cartkoi/quickAddCart", {
"activityId": this.activityId,
"pin": this.secretPin,
"productIds": JSON.stringify(this.prodectVos.map(Iiiil11l => Iiiil11l.productId))
});
this.debug(ll1iilIl);
if (ll1iilIl && ll1iilIl.result) {
if (this.timestamp() > IIiIi1li.activity.drawTime && this.timestamp() < IIiIi1li.activity.endTime) {
return await this.drawResult();
}
this.putMsg("已完成加购");
return;
}
let lIIl1IIl = ll1iilIl?.["errorMessage"] || "加购失败";
if (lIIl1IIl.includes("未关注") && llIIIiI && (await this.follow())) return await this.quickAddCart(false);
if (lIIl1IIl.includes("会员") && this.openCard && llIIIiI && (await this.bindWithVender()) && !this.canNotOpenCard) return await this.quickAddCart(false);
this.putMsg(lIIl1IIl);
this.wxStop(lIIl1IIl);
}
async ["drawResult"](lIi1liI1 = true) {
let iilIIiI = await this.wxApi("wxCartKoi/cartkoi/drawResult", {
"activityId": this.activityId,
"pin": this.secretPin,
"uuid": this.myUuid
});
this.debug(iilIIiI);
if (iilIIiI && iilIIiI.result) this.putMsg("" + (iilIIiI.data?.["name"] || iilIIiI.data?.["drawInfo"]?.["name"] || "空气")), iilIIiI.data?.["drawInfoType"] === 7 && iilIIiI.data?.["needWriteAddress"] === "y" && iilIIiI.data?.["addressId"] && (this.addressId = iilIIiI.data.addressId, this.prizeName = iilIIiI.data.name, await this.saveAddress());else {
let II1l1Iii = res?.["errorMessage"];
if (II1l1Iii?.["includes"]("未关注") && lIi1liI1 && (await this.follow())) {
return await this.drawResult(false);
}
if (II1l1Iii.includes("会员") && this.openCard && lIi1liI1 && (await this.bindWithVender()) && !this.canNotOpenCard) {
return await this.quickAddCart(false);
}
this.putMsg(II1l1Iii);
this.wxStop(II1l1Iii);
return;
}
}
async ["drawPrize"]() {
let IlIIIiII = await this.lzkjApi("api/prize/drawPrize");
this.drawNumber = 1;
if (IlIIIiII && IlIIIiII.resp_code === 0) {
this.drawNumber = IlIIIiII?.["data"]?.["drawNumber"] ?? 1;
let I1IiIiIl = [];
if (lI1i11I.openCardBeanNum === 1) {
I1IiIiIl.push(1);
} else {
if (lI1i11I.openCardBeanNum === 2) I1IiIiIl.push(3);else lI1i11I.openCardBeanNum === 3 && I1IiIiIl.push(1, 3);
}
if (I1IiIiIl.length === 0) {
this.openCard = true;
return;
}
let Il1II1li = IlIIIiII?.["data"]?.["prizeInfo"] ?? [];
if (Il1II1li.some(illi1iI1 => I1IiIiIl.includes(illi1iI1?.["prizeType"]))) {
this.openCard = true;
}
}
}
async ["addSku"](l1lllIli = "999") {
let ii1I11I = await this.lzkjApi("api/task/addSkuPrice/addSku", {
"skuId": l1lllIli
});
this.debug(ii1I11I);
if (typeof ii1I11I?.["data"] === "object" && Object.keys(ii1I11I.data).length === 0 && l1lllIli === "999") {
this.oneClickPurchase = 1;
return;
}
if (ii1I11I && ii1I11I.resp_code === 0) {
let il1lI111 = ii1I11I?.["data"] ?? {};
if (il1lI111.skuFlag) {
this.putMsg("加购完成");
return;
}
this.putMsg(il1lI111.messageFlag === 1 ? "未在加购时间内" : il1lI111.messageFlag === 2 ? "当前商品已加购" : il1lI111.messageFlag === 3 ? "当前商品已全部加购" : il1lI111.messageFlag === 4 && "没有加购资格");
return;
}
let illiIIII = ii1I11I?.["resp_msg"] || "加购失败";
this.putMsg(illiIIII);
this.wxStop(illiIIII);
}
async ["draw"]() {
let iill1I1l = await this.lzkjApi("api/task/addSkuPrice/draw");
this.debug(iill1I1l);
if (iill1I1l && iill1I1l.resp_code === 0) {
let IiiIi11I = iill1I1l?.["data"] ?? {};
if (IiiIi11I.skuFlag) {
this.putMsg("加购的商品数量不满足抽奖所需的数量");
return;
}
if (IiiIi11I.drawNull) {
this.putMsg(IiiIi11I?.["draw"]?.["prizeName"] || "空气");
IiiIi11I?.["draw"] && IiiIi11I?.["draw"]?.["prizeName"] && IiiIi11I?.["draw"]?.["prizeType"] === 3 && IiiIi11I?.["draw"]?.["addressId"] && IiiIi11I?.["draw"]?.["dayTime"] === this.formatDate(Date.now(), "yyyy-MM-dd") && (this.addressId = IiiIi11I.draw.addressId, this.prizeName = IiiIi11I.draw.prizeName, await this.saveAddress());
return;
} else {
this.putMsg("空气");
return;
}
}
let i1lIIIll = iill1I1l?.["resp_msg"];
this.putMsg(i1lIIIll);
this.wxStop(i1lIIIll);
}
async ["inviteActivity"]() {
let I1ilIi1I = IIiIi1li.activity.userList && IIiIi1li.activity.userList.length > 0 ? IIiIi1li.activity.userList[0] : null;
if (!I1ilIi1I) return;
let II1lllil = await this.lzkjApi("api/task/addSkuPrice/activity", {
"shareUserId": "1744750944717832194" || ""
});
if (II1lllil && II1lllil.resp_code === 0) {
let iiI1l11I = II1lllil?.["data"]?.["shareNum"] ?? 0,
l1I1IliI = II1lllil?.["data"]?.["shareFlag"] ?? 0;
this.debug(I1ilIi1I.pin, iiI1l11I, l1I1IliI);
if (l1I1IliI && iiI1l11I === 3) {
I1ilIi1I.helpedCount++;
I1ilIi1I.helpedCount >= I1ilIi1I.maxHelpCount && I1ilIi1I.needHelp && (I1ilIi1I.needHelp = false, IIiIi1li.activity.userList.shift(), await I1ilIi1I.addSku());
}
}
}
async ["userTask"]() {
await this.isvObfuscator();
await this.getDefenseUrls();
if (["10036"].includes(this.activityType)) {
await this.login();
await this.drawPrize();
let lIi11iI1 = await this.lzkjApi("api/task/addSkuPrice/activity1");
if (lIi11iI1 && lIi11iI1.resp_code === 0) {
let IiiI1iIi = lIi11iI1?.["data"]?.["skuInfoList"] ?? [],
llIliII = lIi11iI1?.["data"]?.["userAddSkuRecord"] ?? [],
iiil1Ill = lIi11iI1?.["data"]?.["addSkuNumber"] ?? 0,
I1lI11Il = lIi11iI1?.["data"]?.["addSkuStartTime"] ?? 0,
I1Ili1lI = lIi11iI1?.["data"]?.["addSkuEndTime"] ?? 0,
iIllIlll = lIi11iI1?.["data"]?.["priceTime"] ?? 0,
IlIiliiI = lIi11iI1?.["data"]?.["userSkuCount"] ?? 0,
IilIli1 = lIi11iI1?.["data"]?.["unlockSkuNumber"] ?? 0,
IiiIiilI = lIi11iI1?.["data"]?.["shareNum"] ?? 0,
iIili = lIi11iI1?.["data"]?.["shareFlag"] ?? 0,
Ii1ii1l1 = lIi11iI1?.["data"]?.["shareCount"] ?? 0;
this.debug(IiiIiilI, iIili);
IIiIi1li.activity.drawTimeStr = this.formatDate(iIllIlll, "yyyy-MM-dd HH:mm:ss");
IIiIi1li.activity.drawTime = iIllIlll;
this.timestamp() < iIllIlll && (IIiIi1li.activity.noDraw = true);
if (this.timestamp() < I1lI11Il) {
this.putMsg("未到加购时间");
this.stop();
return;
}
if (["1006", "1005", "1002"].includes(this.joinCode)) {
if (!this.openCard) return this.putMsg(this.joinDes);
await this.getShopOpenCardInfo();
await this.bindWithVender();
if (this.canNotOpenCard) return this.reseCookieStatus();
await this.login(false);
}
if (this.timestamp() > I1lI11Il && this.timestamp() < I1Ili1lI) {
if (IlIiliiI >= iiil1Ill && IlIiliiI >= IilIli1 + Ii1ii1l1) {
this.putMsg("已完成加购");
}
await this.inviteActivity();
if (IilIli1 < iiil1Ill && IlIiliiI < iiil1Ill) {
await this.getUserId();
this.helpedCount = Ii1ii1l1;
this.maxHelpCount = iiil1Ill - IilIli1;
!IIiIi1li.activity.userList && (IIiIi1li.activity.userList = []);
IIiIi1li.activity.userList.push(this);
}
this.debug(IilIli1 + Ii1ii1l1, IlIiliiI, iiil1Ill, IilIli1);
if (IilIli1 + Ii1ii1l1 > IlIiliiI && IilIli1 + Ii1ii1l1 >= iiil1Ill) {
await this.addSku();
if (this.oneClickPurchase === 1) {
IiiI1iIi = IiiI1iIi.filter(I1lliII => !llIliII.some(lli1I1lI => lli1I1lI.skuId === I1lliII.skuId));
if (IiiI1iIi.length === 0) {
this.putMsg("已完成加购");
return;
}
for (let lIlIliI of IiiI1iIi) {
await this.addSku(lIlIliI.skuId);
}
}
}
}
this.debug(this.timestamp(), iIllIlll, IlIiliiI, iiil1Ill, this.drawNumber);
this.timestamp() > iIllIlll && IlIiliiI >= iiil1Ill && (await this.draw());
}
return;
}
this.needHelp = false;
await this.wxCommonInfo();
await this.getSimpleActInfoVo();
this.index === 0 && (await this.getShopInfo());
this.defenseUrls.length === 0 ? await this.getMyPing() : await this.initPinToken();
await this.accessLog();
let ll1liIIl = await this.activityContent({
"status": 1
});
if (!ll1liIIl?.["result"] || !ll1liIIl?.["data"]) {
this.putMsg(ll1liIIl?.["errorMessage"]);
return;
}
this.prodectVos = ll1liIIl.data?.["prodectVos"] ?? [];
let Ii11I11I = ll1liIIl.data?.["addCarts"] ?? 1,
Illi1Iii = ll1liIIl.data?.["activityVo"] ?? {},
lIiilllI = this.dateStringToTimestamp(Illi1Iii?.["drawTime"]),
ill11I1I = this.dateStringToTimestamp(Illi1Iii?.["cartStartTime"]),
llIII1Il = this.dateStringToTimestamp(Illi1Iii?.["cartEndTime"]),
IIl11llI = this.dateStringToTimestamp(Illi1Iii?.["startTime"]),
li1Ii11l = this.dateStringToTimestamp(Illi1Iii?.["endTime"]),
Ili11l11 = Illi1Iii?.["drawCondition"] ?? 1;
this.myUuid = ll1liIIl.data?.["joinRecord"]?.["myUuid"] ?? "";
this.debug("startTime", "cartStartTime", ill11I1I, "cartEndTime", llIII1Il, IIl11llI, "drawTime", lIiilllI, "endTime", li1Ii11l);
this.rule = Illi1Iii?.["actRule"] ?? "";
IIiIi1li.activity.timeStr = this.formatDate(IIl11llI, "yyyy-MM-dd HH:mm:ss") + "至" + this.formatDate(li1Ii11l, "yyyy-MM-dd HH:mm:ss");
IIiIi1li.activity.startTime = IIl11llI;
IIiIi1li.activity.endTime = li1Ii11l;
IIiIi1li.activity.drawTimeStr = this.formatDate(lIiilllI, "yyyy-MM-dd HH:mm:ss");
IIiIi1li.activity.drawTime = lIiilllI;
this.timestamp() < lIiilllI && (IIiIi1li.activity.noDraw = true);
IIl11llI && IIl11llI > Date.now() && (this.putMsg("活动未开始"), IIiIi1li.activity.noStart = true, this.stop());
li1Ii11l && li1Ii11l < Date.now() && (this.putMsg("活动已结束"), this.stop());
let ll11iil1 = Illi1Iii?.["needFollow"] ?? false,
Il1ii1Il = ll1liIIl.data?.["hasFollow"] ?? false;
ll11iil1 && !Il1ii1Il && (await this.follow());
await this.getDrawPrizeInfo();
if (this.timestamp() > lIiilllI && this.timestamp() < li1Ii11l && Ii11I11I >= Ili11l11) {
return await this.drawResult();
}
if (this.timestamp() < llIII1Il) {
if (Ii11I11I >= Ili11l11) this.putMsg("已完成加购");else {
await this.quickAddCart();
}
}
}
}
lIi1I11.activity = {
"activityUrl": activityUrl
};
lIi1I11.TaskClass = i11llii;
lIi1I11.run({
"whitelist": ["1-2000"],
"main_thread": 3
});

130
jd_wx_centerDraw.js Normal file
View File

@ -0,0 +1,130 @@
/*
老虎机抽奖beta v1.0.0
https://lzkj-isv.isvjd.com/drawCenter/activity/71ca645008bd4d688984bc7e737e6ebe?activityId=71ca645008bd4d688984bc7e737e6ebe
https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10054&templateId=20210804190900ssq011&activityId=1722901315029733378&nodeId=101001054&prd=cjwx
export B_WX_CENTER_DRAW_URL=""
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_CENTER_DRAW_URL);
mode && (activityUrl = "https://lzkj-isv.isvjd.com/drawCenter/activity/ef729f6783cc405cbb9fa83e68ce9be3?activityId=ef729f6783cc405cbb9fa83e68ce9be3", activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10054&templateId=20210804190900ssq011&activityId=1722901315029733378&nodeId=101001054&prd=cjwx", activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10054&templateId=20210804190900ssq011&activityId=1722085969499193346&nodeId=101001054&prd=cjwx", activityUrl = "https://lzkj-isv.isvjd.com/drawCenter/activity/71ca645008bd4d688984bc7e737e6ebe?activityId=71ca645008bd4d688984bc7e737e6ebe");
const {
RunMode: IIlII1l1,
UserMode: lIilIIi1
} = require("./bear");
IIlII1l1.envInfo = {
"name": "老虎机抽奖beta",
"runName": "jd_wx_centerDraw",
"version": "1.0.0"
};
class lIll1ilI extends lIilIIi1 {
constructor(llII1iIl, ii1l11I1) {
super(llII1iIl, ii1l11I1);
this.lzkjOpenCard = true;
}
async ["userTask"]() {
await this.isvObfuscator();
await this.getDefenseUrls();
if (["10054"].includes(this.activityType)) {
await this.login();
let l1IIlII = await this.lzkjApi("api/task/" + this.type + "/getTask", {
"shareUserId": ""
});
this.debug(l1IIlII);
if (l1IIlII && l1IIlII.resp_code === 0) {
let I1IliIii = l1IIlII.data?.["taskList"] ?? [];
await this.lzkjTask(I1IliIii);
}
let IllIliii = await this.lzkjApi("api/prize/drawPrize");
this.drawNumber = 0;
if (IllIliii && IllIliii.resp_code === 0) {
this.drawNumber = IllIliii.data?.["drawNumber"];
}
if (this.drawNumber <= 0) {
this.putMsg("无抽奖次数");
return;
}
this.drawNumber = Math.min(this.drawNumber, 7);
while (this.drawNumber-- > 0) {
let iil1IIll = await this.lzkjApi("api/prize/draw", {
"consumePoints": 0,
"actId": this.activityId
});
this.debug(iil1IIll);
if (iil1IIll && iil1IIll.resp_code === 0) {
if (iil1IIll.data === "1") {
this.putMsg("积分不足");
return;
}
this.putMsg(iil1IIll.data?.["prizeName"] || "空气");
iil1IIll.data && iil1IIll.data?.["prizeName"] && iil1IIll.data?.["prizeType"] === 3 && iil1IIll.data?.["addressId"] && iil1IIll.data?.["dayTime"] === this.formatDate(Date.now(), "yyyy-MM-dd") && (this.addressId = iil1IIll.data.addressId, this.prizeName = iil1IIll.data?.["prizeName"], await this.saveAddress());
await this.sleep(200);
} else {
let i1i1liI = iil1IIll?.["resp_msg"];
this.putMsg(i1i1liI);
this.wxStop(i1i1liI);
return;
}
}
return;
}
await this.wxCommonInfo();
await this.getSimpleActInfoVo();
this.type = "drawCenter";
this.defenseUrls.length === 0 ? await this.getMyPing() : await this.initPinToken();
await this.accessLog();
let I1i1llll = await this.activityContent({
"shareUuid": "",
"nick": "",
"pinImg": ""
});
if (!I1i1llll?.["result"] || !I1i1llll?.["data"]) {
this.putMsg(I1i1llll?.["errorMessage"]);
return;
}
let Iii1iiI1 = I1i1llll?.["data"]?.["chance"] ?? 3,
l1l11l = I1i1llll?.["data"]?.["isGameEnd"] ?? false;
if (l1l11l) {
this.putMsg("活动已结束");
this.stop();
return;
}
if (Iii1iiI1 === 0) {
this.putMsg("抽奖机会不足");
return;
}
Iii1iiI1 = Math.min(Iii1iiI1, 7);
while (Iii1iiI1-- > 0) {
let llIill1i = await this.wxApi("drawCenter/draw/luckyDraw", {
"activityId": this.activityId,
"pin": this.secretPin
});
this.debug(llIill1i);
if (llIill1i && llIill1i.result) this.putMsg("" + (llIill1i.data?.["name"] || "空气")), llIill1i.data?.["drawInfoType"] === 7 && llIill1i.data?.["needWriteAddress"] === "y" && llIill1i.data?.["addressId"] && (this.addressId = llIill1i.data.addressId, this.prizeName = llIill1i.data.name, await this.saveAddress()), await this.sleep(500);else {
let i1li11i1 = llIill1i?.["errorMessage"];
if (i1li11i1?.["includes"]("未关注") && (await this.follow())) {
Iii1iiI1++;
continue;
}
this.putMsg(i1li11i1);
this.wxStop(i1li11i1);
return;
}
}
}
}
IIlII1l1.activity = {
"activityUrl": activityUrl
};
IIlII1l1.TaskClass = lIll1ilI;
IIlII1l1.run({
"whitelist": ["1-2000"],
"main_thread": 3
});

345
jd_wx_completeDraw.js Normal file
View File

@ -0,0 +1,345 @@
/*
完善有礼beta v2.1.0
https://cjhy-isv.isvjcloud.com/wx/completeInfoActivity/view/activity?activityId=c9a7f0ca315d44aabecf618d953cadfd&venderId=1000091815
https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10049&templateId=20210720190900wsxxyl011&activityId=1732713789232435201&nodeId=101001009&prd=cjwx
https://lzkj-isv.isvjcloud.com/prod/cc/interaction/v2/10049/1002/?activityId=1772602526133301250&shopId=1000399381
export B_WX_COMPLETE_DRAW_URL=""
export B_WX_COMPLETE_BEAN_NUM="2" # 超过这个数量才会开卡 默认值2
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_COMPLETE_DRAW_URL);
if (mode) {
activityUrl = "https://cjhy-isv.isvjcloud.com/wx/completeInfoActivity/view/activity?activityId=c9a7f0ca315d44aabecf618d953cadfd&venderId=1000091815";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10049&templateId=20210720190900wsxxyl011&activityId=1732713789232435201&nodeId=101001009&prd=cjwx";
activityUrl = "https://cjhy-isv.isvjcloud.com/wx/completeInfoActivity/view/activity?activityId=35bc437239234dd386cedae3751e9e53&venderId=102282&shareuserid4minipg=6%252BhitCZLEJf6Svvo%252BM5%252BfFhXBmEZA6lSVT%252B72G8p%252FfVoLg2u1PPhDKnKIGiyllSk&shopid=100391";
activityUrl = "https://cjhy-isv.isvjcloud.com/wx/completeInfoActivity/view/activity?activityId=0e39ac6147374ed68bd8112cf99788c0&venderId=1000385629";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interaction/v2/10049/1002/?activityId=1772602526133301250&shopId=1000399381";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10049&activityId=1774620564769026049&templateId=20210720190900wsxxyl011&nodeId=101001009&prd=cjwx";
activityUrl = "https://cjhy-isv.isvjcloud.com/wx/completeInfoActivity/view/activity?activityId=2075e6cf7a64475c888303b7d95c9bb1&venderId=16401149";
activityUrl = "https://cjhy-isv.isvjcloud.com/wx/completeInfoActivity/view/activity?activityId=688c76293a42466b973fd62112de8e3d&venderId=14923588";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10049&templateId=20210720190900wsxxyl011&activityId=1784873822283304962&nodeId=101001009&prd=cjwx";
activityUrl = "https://cjhy-isv.isvjcloud.com/wx/completeInfoActivity/view/activity?activityId=a2bd9a11d77f48b5b8965eb11e9cc34a&venderId=1000092950";
}
const {
RunMode: iI1II1i,
UserMode: lliii11,
baseCommonEnv: I1Ii1i,
baseCommonEnvKey: lI11ii1I
} = require("./bear");
I1Ii1i.openCardBeanNum = parseInt(process.env.B_WX_COMPLETE_BEAN_NUM || "2");
lI11ii1I.B_WX_COMPLETE_BEAN_NUM = "openCardBeanNum";
iI1II1i.envInfo = {
"name": "完善有礼beta",
"runName": "jd_wx_completeDraw",
"version": "2.1.0"
};
class l1il1l1i extends lliii11 {
constructor(li1l1Ii, I111iI1l) {
super(li1l1Ii, I111iI1l);
this.names = "赵钱孙李周吴郑王冯陈褚卫蒋沈韩杨朱秦尤许何吕施张孔曹严华金魏陶姜戚谢邹喻柏水窦章云苏潘葛奚范彭郎鲁韦昌马苗凤花方俞任袁柳酆鲍史唐费廉岑薛雷贺倪汤滕殷罗毕郝邬安常乐于时傅皮卞齐康".split("");
this.phones = this.generateRandomMobiles(10);
}
["generateRandomMobiles"](iiilIIli) {
const l1I1Illi = ["130", "131", "132", "133", "134", "135", "136", "137", "138", "139", "150", "151", "152", "153", "155", "156", "157", "158", "159", "180", "181", "182", "183", "184", "185", "186", "187", "188", "189"];
let ilIl1i1l = [];
for (let illI1i = 0; illI1i < iiilIIli; illI1i++) {
const IIil1 = l1I1Illi[Math.floor(Math.random() * l1I1Illi.length)];
let I1i11ill = IIil1;
for (let i1lIlIII = 0; i1lIlIII < 8; i1lIlIII++) {
I1i11ill += Math.floor(Math.random() * 10);
}
ilIl1i1l.push(I1i11ill);
}
return ilIl1i1l;
}
["firstCharToLowercase"](IiilIill) {
return IiilIill.charAt(0).toLowerCase() + IiilIill.slice(1);
}
async ["listDrawContent"]() {
lliii11.activity.listDrawContent && lliii11.activity?.["prizeList"] && (this.prizeList = lliii11.activity.prizeList);
let IIi11Ii1 = await this.wxApi("drawContent/listDrawContent", {
"activityId": this.activityId,
"type": this.activityType
});
this.debug(IIi11Ii1);
if (!IIi11Ii1 || !IIi11Ii1.result) {
if (IIi11Ii1.errorMessage === null && IIi11Ii1.data === "") return this.putMsg("垃圾或领完"), this.stop();
let I11Il11l = IIi11Ii1?.["errorMessage"] || "获取奖品失败";
this.putMsg(I11Il11l);
await this.wxStopSync(I11Il11l);
this.exit();
return;
}
this.prizeList = IIi11Ii1.data || [];
this.debug(this.prizeList);
this.prizeList = this.prizeList.filter(IiIlIili => [6, 7, 9, 13, 14, 15, 16].includes(IiIlIili.type) || IiIlIili.hasSendPrizeNum - IiIlIili.size > 0);
if (this.prizeList.length === 0) {
this.putMsg("垃圾或领完");
this.stop();
return;
}
lliii11.activity.prizeList = this.prizeList;
}
async ["userTask"]() {
await this.hitCache();
await this.isvObfuscator();
await this.getDefenseUrls();
if (this.mode === "v2") {
await this.login();
let lI1I1IlI = await this.v2Api("api/" + this.activityType + "/getPrize");
this.debug(lI1I1IlI);
if (!lI1I1IlI || lI1I1IlI.code !== 200) {
this.putMsg("获取活动信息失败");
return;
}
if (lI1I1IlI.data?.["filter"](iII11i1i => iII11i1i.status === 1)["length"] > 0) {
this.putMsg("已领取");
await this.writeLongCache();
return;
}
if (!this.openCard) {
if (lI1I1IlI.data?.["some"](illI1iiI => illI1iiI.prizeName.includes("京豆"))) await this.bindWithVender();else return this.putMsg("活动仅限店铺会员参与");
}
let I1iIIll1 = await this.v2Api("api/" + this.activityType + "/getItem");
this.debug(I1iIIll1);
if (!I1iIIll1 || I1iIIll1.code !== 200) {
this.putMsg(I1iIIll1?.["message"] || "获取奖品失败");
return;
}
let iIiIIi1i = I1iIIll1.data?.["allInfo"];
if (I1iIIll1.data?.["status"] === 0) {
for (let IilI1lII of iIiIIi1i) {
switch (IilI1lII.num) {
case "1":
IilI1lII.content = this.names[this.random(0, this.names.length - 1)];
break;
case "2":
IilI1lII.content = this.random(2000, 2022) + "/" + this.random(1, 12) + "/" + this.random(1, 27);
break;
case "3":
IilI1lII.content = this.phones[this.random(0, this.phones.length - 1)];
break;
case "4":
IilI1lII.content = this.randomArray(["男", "女"], 1)[0];
break;
case "5":
IilI1lII.content = this.random(1000000, 9999999) + "@qq.com";
break;
case "6":
IilI1lII.content = "北京市/北京市/东城区";
break;
default:
this.log("未知字段", IilI1lII.num, IilI1lII.title), IilI1lII.content = "1";
}
}
let I1i1iI1 = await this.v2Api("api/" + this.activityType + "/addInfo", {
"allInfo": iIiIIi1i
});
this.debug(I1i1iI1);
if (!I1i1iI1 || I1i1iI1.code !== 200) {
this.putMsg(I1i1iI1?.["message"] || "提交信息失败");
return;
}
}
let iiIII1li = await this.v2Api("api/" + this.activityType + "/receivePrize");
this.debug(iiIII1li);
if (!iiIII1li || iiIII1li.code !== 200) {
this.putMsg(iiIII1li?.["message"] || "领取奖品失败");
return;
}
this.putMsg(iiIII1li.data?.["prizeName"] || "领取成功");
await this.writeLongCache();
return;
}
if (this.mode === "jinggeng") {
await this.setMixNick();
await this.jinggengShopInfo();
let Iiil1ill = await this.jinggengApi("postAddMaterial", {
"detail": JSON.stringify({
"姓名": this.names[this.random(0, this.names.length - 1)],
"性别": this.randomArray(["男", "女"], 1)[0],
"生日": "19" + this.random(60, 99) + "-0" + this.random(1, 9) + "-0" + this.random(1, 9),
"手机号码": "" + this.phones[this.random(0, this.phones.length - 1)],
"地区(省市)": "北京市-北京市"
})
});
if (Iiil1ill && Iiil1ill.succ) {
let liilllil = JSON.parse(Iiil1ill.msg);
if (liilllil.isSendSucc && liilllil.drawAwardDto) {
let l1111iiI = liilllil?.["drawAwardDto"]?.["awardName"];
this.putMsg("" + liilllil?.["drawAwardDto"]?.["awardDenomination"] + l1111iiI);
await this.writeLongCache();
if (liilllil?.["drawAwardDto"]?.["awardType"] === "JD_GOODS") {
this.addressId = liilllil?.["drawAwardDto"]?.["actLogId"];
this.prizeName = l1111iiI;
await this.saveAddress();
}
}
return;
}
let IIlllI1i = Iiil1ill?.["msg"];
this.putMsg(IIlllI1i);
await this.wxStopSync(IIlllI1i);
return;
}
if (["10049"].includes(this.activityType)) {
await this.login();
let IiI1iil1 = await this.lzkjApi("api/task/perfectInfo/activity");
this.debug(IiI1iil1);
if (!IiI1iil1 || IiI1iil1.resp_code !== 0) {
this.putMsg(IiI1iil1?.["resp_msg"] || "获取奖品失败");
await this.wxStopSync(IiI1iil1?.["resp_msg"]);
return;
}
if (IiI1iil1.data?.["flag"] === "002") return this.putMsg("已领取"), await this.writeLongCache();
let l1l11iii = [IiI1iil1?.["data"]];
l1l11iii.some(I1l1i1lI => I1l1i1lI?.["prizeName"]?.["includes"]("京豆") && I1l1i1lI?.["beanNum"] >= I1Ii1i.openCardBeanNum) && (this.openCard = true);
await this.lzkjOpenCardTask();
l1l11iii = l1l11iii.filter(Ii1l1III => Ii1l1III?.["prizeName"]["includes"]("京豆") || Ii1l1III?.["prizeName"]["includes"]("积分"));
if (l1l11iii.length === 0) {
this.putMsg("垃圾或领完");
this.stop();
return;
}
let i1I1lliI = IiI1iil1.data.allInfo || [];
for (let i1Il1liI of i1I1lliI) {
switch (i1Il1liI.num) {
case "info01":
i1Il1liI.content = this.names[this.random(0, this.names.length - 1)];
break;
case "info02":
i1Il1liI.content = this.random(2000, 2022) + "年" + this.random(1, 12) + "月" + this.random(1, 27) + "日 ";
break;
case "info03":
i1Il1liI.content = this.phones[this.random(0, this.phones.length - 1)];
break;
case "info04":
i1Il1liI.content = this.randomArray(["男", "女"], 1)[0];
break;
default:
this.log("未知字段", i1Il1liI.num, i1Il1liI.title), i1Il1liI.content = "1";
}
}
let Ii1i1i1I = await this.lzkjApi("api/task/perfectInfo/addInfo", {
"perfectInfo": i1I1lliI
});
this.debug(Ii1i1i1I);
if (!Ii1i1i1I || Ii1i1i1I.resp_code !== 0) {
this.putMsg(Ii1i1i1I?.["resp_msg"]);
await this.wxStopSync(Ii1i1i1I?.["resp_msg"]);
return;
}
await this.lzkjApi("api/task/perfectInfo/activity");
await this.acquire(IiI1iil1.data.prizeId, true);
return;
}
await this.wxCommonInfo();
await this.getSimpleActInfoVo();
this.defenseUrls.length === 0 ? await this.getMyPing() : await this.initPinToken();
await this.accessLog();
await this.listDrawContent();
let lli11ii1 = await this.wxApi("completeInfoActivity/selectById", {
"activityId": this.activityId,
"pin": this.secretPin,
"venderId": this.venderId
});
this.debug(lli11ii1);
if (!lli11ii1 || !lli11ii1.result) {
let II1lli11 = lli11ii1?.["errorMessage"];
this.putMsg(II1lli11);
await this.wxStopSync(II1lli11);
return;
}
let i1llI11 = lli11ii1.data?.["startTime"] || 0,
iiI11II = lli11ii1.data?.["endTime"] || 0;
lliii11.activity.startTime = i1llI11;
lliii11.activity.endTime = iiI11II;
if (i1llI11 && i1llI11 > this.timestamp()) {
this.log("活动未开始");
this.stop();
return;
}
if (iiI11II && iiI11II < this.timestamp()) {
this.log("活动已结束");
await this.writeLongCacheByStop();
this.stop();
return;
}
let IIl1Ii = {};
for (let IilI111l in lli11ii1.data) {
if (IilI111l.startsWith("choose") && lli11ii1.data[IilI111l] === "y") {
let IIiiiil1 = this.firstCharToLowercase(IilI111l?.["replace"]("choose", ""));
switch (IIiiiil1) {
case "name":
IIl1Ii.name = this.names[this.random(0, this.names.length - 1)];
break;
case "phone":
IIl1Ii.phone = this.phones[this.random(0, this.phones.length - 1)];
break;
case "weixin":
IIl1Ii.weiXin = "wx_" + this.randomNum(10);
break;
case "qQ":
IIl1Ii.QQ = this.randomNum(10);
break;
case "birth":
IIl1Ii.birthDay = "19" + this.random(60, 99) + "-0" + this.random(1, 9) + "-0" + this.random(1, 9);
break;
case "professional":
IIl1Ii.professional = this.randomArray(["科学家", "工人", "农民", "白领", "司机"], 1)[0];
break;
case "address":
IIl1Ii.province = "上海市", IIl1Ii.city = "黄浦区", IIl1Ii.address = "未知";
break;
case "email":
IIl1Ii.email = random(1000000, 9999999) + "@qq.com";
break;
case "gender":
IIl1Ii.gender = this.randomArray(["男", "女"], 1)[0];
break;
default:
IIl1Ii[IIiiiil1] = "1";
}
}
}
if (lli11ii1.data?.["customJson"]) {
let lIiiI = [];
for (let li1I1II = 0; li1I1II < JSON.parse(lli11ii1.data.customJson).length; li1I1II++) {
lIiiI.push("1");
}
IIl1Ii.customContent = JSON.stringify(lIiiI);
}
IIl1Ii.drawInfoId = this.prizeList[0].drawInfoId;
IIl1Ii.activityId = this.activityId;
IIl1Ii.venderId = this.venderId;
IIl1Ii.pin = this.secretPin;
IIl1Ii.vcode = "";
IIl1Ii.token = this.isvToken;
IIl1Ii.fromType = "APP";
let IIIilil = await this.wxApi("wx/completeInfoActivity/save", IIl1Ii);
this.debug(IIIilil);
if (IIIilil && IIIilil.result) {
if (IIIilil.data?.["drawOk"]) this.putMsg("领取成功"), await this.writeLongCache();else IIIilil.data === "修改成功" ? (this.putMsg("已领过"), await this.writeLongCache()) : (this.putMsg(IIIilil.data?.["errorMessage"]), await this.wxStopSync(IIIilil.data?.["errorMessage"]));
return;
}
let llIiIili = IIIilil.errorMessage;
this.putMsg(llIiIili);
await this.wxStopSync(llIiIili);
}
}
iI1II1i.activity = {
"activityUrl": activityUrl
};
iI1II1i.TaskClass = l1il1l1i;
iI1II1i.run({
"whitelist": ["1-2000"],
"main_thread": 3
});

119
jd_wx_daily.js Normal file
View File

@ -0,0 +1,119 @@
/*
每日抢beta v2.0.2
https://cjhy-isv.isvjcloud.com/activity/daily/wx/indexPage?activityId=25c8fa02eab04f6fb6ffbca9eef11e19
https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10022&templateId=20210518190900mrqhl011&activityId=1764484786904494081&nodeId=101001&prd=cjwx
export B_WX_DAILY_URL=""
export B_WX_DAILY_OPEN_MODE="0" // 0: 关闭, 1: 开启
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_DAILY_GIFT_URL);
mode && (activityUrl = "https://cjhy-isv.isvjcloud.com/activity/daily/wx/indexPage?activityId=25c8fa02eab04f6fb6ffbca9eef11e19", activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10022&templateId=20210518190900mrqhl011&activityId=1764484786904494081&nodeId=101001&prd=cjwx", activityUrl = "https://cjhy-isv.isvjcloud.com/activity/daily/wx/indexPage1/236b89e3b3d24379a56e6cb07ee997fa?activityId=236b89e3b3d24379a56e6cb07ee997fa&venderId=33957");
const {
RunMode: I11ilI1i,
UserMode: l11ll1i,
baseCommonEnv: illill1i,
baseCommonEnvKey: iI1I1ili
} = require("./bear");
I11ilI1i.envInfo = {
"name": "每日抢beta",
"runName": "jd_wx_daily",
"version": "2.0.2"
};
illill1i.openCardMode = parseInt(process.env.B_WX_DAILY_OPEN_MODE || 0);
iI1I1ili.B_WX_DAILY_OPEN_MODE = "openCardMode";
class IiI1llII extends l11ll1i {
constructor(li1iI11, lll1IIII) {
super(li1iI11, lll1IIII);
this.lzkjOpenCard = true;
}
async ["userTask"]() {
await this.isvObfuscator();
await this.getDefenseUrls();
if (["10022"].includes(this.activityType)) {
await this.login();
if (illill1i.openCardMode && this.joinCode !== "1001") {
await this.bindWithVender();
if (this.canNotOpenCard) return this.putMsg(this.joinDes);
await this.login(false);
}
let l11Iiiii = await this.lzkjApi("api/task/dailyGrabs/activity");
this.debug(l11Iiiii);
(!l11Iiiii || l11Iiiii.resp_code !== 0) && (this.putMsg(l11Iiiii.resp_msg || "获取活动信息失败"), this.exit());
let li11I1i1 = l11Iiiii.data?.["activityEndTime"],
liilllll = l11Iiiii.data?.["activityStartTime"];
l11ll1i.activity.timeStr = this.formatDate(liilllll, "yyyy-MM-dd HH:mm:ss") + "至" + this.formatDate(li11I1i1, "yyyy-MM-dd HH:mm:ss") + "\n" + "每日开抢时间:" + l11Iiiii.data?.["hours"] + "点" + l11Iiiii.data?.["minutes"] + "分";
if (l11Iiiii.data?.["receiveStatus"] === 1) return this.putMsg("已领取");
let lIlI1l1 = await this.lzkjApi("api/task/dailyGrabs/dayReceive", {
"prizeInfoId": l11Iiiii.data?.["prizeInfoId"]
});
this.debug(lIlI1l1);
if (lIlI1l1 && lIlI1l1.resp_code === 0) {
this.putMsg(lIlI1l1.data?.["prizeName"] || "空气");
lIlI1l1.data?.["prizeType"] === 3 && (this.addressId = lIlI1l1.data?.["addressId"], this.prizeName = lIlI1l1.data?.["prizeName"], await this.saveAddress());
return;
}
let iillI1I = lIlI1l1?.["resp_msg"] || "抢礼物失败";
this.putMsg(iillI1I);
this.wxStop(iillI1I);
return;
}
await this.wxCommonInfo();
let iI11I1iI = await this.taskGet(this.activityUrl),
iiiillI = this.textToHtml(iI11I1iI),
lIl1lli1 = iiiillI("#actTimeStr", "body").attr("value"),
l11li11l = iiiillI("#giftJson", "body").attr("value");
l11li11l && (l11li11l = JSON.parse(l11li11l));
lIl1lli1 && (l11ll1i.activity.timeStr = lIl1lli1.replace(/\s*至\s*/, "至") + "\n" + "每日开抢时间:" + l11li11l?.["hours"] + "点" + l11li11l?.["minutes"] + "分");
await this.getSimpleActInfoVo();
this.defenseUrls.length === 0 ? await this.getMyPing() : await this.initPinToken();
await this.accessLog();
if (illill1i.openCardMode) {
let IIliiI1i = "",
IiIillII = {};
this.activityUrl.includes("//cjhy") ? (IIliiI1i = "mc/new/brandCard/common/shopAndBrand/getOpenCardInfo", IiIillII = {
"venderId": this.venderId,
"buyerPin": this.secretPin,
"activityType": this.activityType
}) : (IIliiI1i = "wxCommonInfo/getActMemberInfo", IiIillII = {
"activityId": this.activityId,
"venderId": this.venderId,
"pin": this.secretPin
});
let i1ii1lII = await this.wxApi(IIliiI1i, IiIillII);
this.debug(i1ii1lII);
if (i1ii1lII && i1ii1lII.result && !i1ii1lII.data?.["openedCard"]) {
await this.bindWithVender();
if (this.canNotOpenCard) return this.exit();
}
}
let lll11l = await this.wxApi("activity/daily/wx/grabGift", {
"actId": this.activityId,
"pin": this.secretPin
});
this.debug(lll11l);
if (lll11l && lll11l.isOk) {
this.putMsg(lll11l.gift?.["gift"]?.["giftName"] || "空气");
lll11l.gift?.["gift"]?.["giftType"] === 7 && (this.addressId = lll11l?.["addressId"], this.prizeName = lll11l.gift?.["gift"]?.["giftName"], await this.saveAddress());
return;
}
let iiiIill = lll11l?.["msg"] || "抢礼物失败";
this.putMsg(iiiIill);
this.wxStop(iiiIill);
}
}
I11ilI1i.activity = {
"activityUrl": activityUrl
};
I11ilI1i.TaskClass = IiI1llII;
I11ilI1i.run({
"whitelist": ["1-2000"],
"main_thread": 3
});

170
jd_wx_fansDraw.js Normal file
View File

@ -0,0 +1,170 @@
/*
粉丝互动beta v1.0.0
https://lzkj-isv.isvjcloud.com/wxFansInterActionActivity/activity/5876f114e9524b91ad00080850c49e30?activityId=5876f114e9524b91ad00080850c49e30
export B_WX_FANS_DRAW_URL=""
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_FANS_DRAW_URL);
mode && (activityUrl = "https://lzkj-isv.isvjcloud.com/wxFansInterActionActivity/activity/5876f114e9524b91ad00080850c49e30?activityId=5876f114e9524b91ad00080850c49e30");
const {
RunMode: iI11IIiI,
UserMode: il1lIl1i
} = require("./bear");
iI11IIiI.envInfo = {
"name": "粉丝互动beta",
"runName": "jd_wx_fansDraw",
"version": "1.0.0"
};
class iII1i1lI extends il1lIl1i {
constructor(lliliIlI, l1ll1l11) {
super(lliliIlI, l1ll1l11);
this.content = [];
}
async ["userTask"]() {
await this.isvObfuscator();
await this.getDefenseUrls();
await this.wxCommonInfo();
await this.getSimpleActInfoVo();
this.defenseUrls.length === 0 ? await this.getMyPing() : await this.initPinToken();
await this.accessLog();
let Ill1II11 = await this.wxApi("wxFansInterActionActivity/activityContent", {
"activityId": this.activityId,
"pin": this.secretPin
});
if (!Ill1II11 || !Ill1II11.result) {
let iiIIIIil = Ill1II11?.["msg"] || "获取活动信息失败";
this.putMsg(iiIIIIil);
this.wxStop(iiIIIIil);
return;
}
let lIIII1i = Ill1II11.data?.["actInfo"]?.["startTime"],
ii1i1lii = Ill1II11.data?.["actInfo"]?.["endTime"];
["giftLevelOne", "giftLevelTwo", "giftLevelThree"].forEach(I1IiIliI => JSON.parse(Ill1II11.data?.["actInfo"]?.[I1IiIliI] ?? "[]").forEach(iii1lIIl => this.content.push(iii1lIIl)));
this.shopName = Ill1II11.data?.["actInfo"]?.["shopName"];
let iliI1l11 = Ill1II11.data?.["actorInfo"];
il1lIl1i.activity.shopName = this.shopName;
il1lIl1i.activity.startTime = lIIII1i;
il1lIl1i.activity.endTime = ii1i1lii;
if (lIIII1i && this.timestamp() < lIIII1i) {
this.putMsg("活动未开始");
this.wxStop();
return;
}
if (ii1i1lii && this.timestamp() > ii1i1lii) {
this.putMsg("活动已结束");
this.wxStop();
return;
}
if (iliI1l11?.["prizeOneStatus"] && iliI1l11?.["prizeTwoStatus"] && iliI1l11?.["prizeThreeStatus"]) {
this.putMsg("已领取所有奖品");
return;
}
let lI1liliI = iliI1l11.uuid,
I11II1l1 = {
1: "task1Sign",
2: "task2BrowGoods",
3: "task3AddCart",
4: "task4Share",
5: "task5Remind",
6: "task6GetCoupon",
7: "task7MeetPlaceVo"
},
IIlIi1l1 = Ill1II11.data?.["actInfo"]?.["taskIds"];
for (let ill1IIIi of IIlIi1l1.split(",")) {
let lIill11 = Ill1II11.data?.[I11II1l1[ill1IIIi]] ?? {};
if (lIill11.finishedCount >= lIill11.upLimit) continue;
for (let i1ll1i1 = 0; i1ll1i1 < lIill11.upLimit - lIill11.finishedCount; i1ll1i1++) {
try {
if (["task1Sign", "task4Share", "task5Remind", "task7MeetPlaceVo"].includes(I11II1l1[ill1IIIi])) {
let iI11Il = I11II1l1[ill1IIIi] === "task1Sign" ? "doSign" : I11II1l1[ill1IIIi] === "task4Share" ? "doShareTask" : I11II1l1[ill1IIIi] === "task5Remind" ? "doRemindTask" : "doMeetingTask";
await this.wxApi("wxFansInterActionActivity/" + iI11Il, {
"activityId": this.activityId,
"uuid": lI1liliI
});
}
if (["task2BrowGoods", "task3AddCart"].includes(I11II1l1[ill1IIIi]) && lIill11.taskGoodList?.["length"] > 0) {
let iIil1IIl = lIill11.taskGoodList,
illlliI1 = iIil1IIl[i1ll1i1].skuId,
i1iIiI1I = I11II1l1[ill1IIIi] === "task2BrowGoods" ? "doBrowGoodsTask" : "doAddGoodsTask";
await this.wxApi("wxFansInterActionActivity/" + i1iIiI1I, {
"activityId": this.activityId,
"uuid": lI1liliI,
"skuId": illlliI1
});
}
if (I11II1l1[ill1IIIi] === "task6GetCoupon" && lIill11.taskCouponInfoList?.["length"] > 0) {
let lI1IIl11 = lIill11.taskCouponInfoList,
il11illl = lI1IIl11[0].couponId;
await this.wxApi("wxFansInterActionActivity/doGetCouponTask", {
"activityId": this.activityId,
"uuid": lI1liliI,
"couponId": il11illl
});
}
} catch (I1Ii1II) {
this.log(I1Ii1II);
} finally {
this.sleep(1500);
}
}
}
let iliIilIi = iliI1l11?.["follow"];
!iliIilIi && (await this.wxApi("wxFansInterActionActivity/followShop", {
"activityId": this.activityId,
"uuid": lI1liliI
}));
Ill1II11 = await this.wxApi("wxFansInterActionActivity/activityContent", {
"activityId": this.activityId,
"pin": this.secretPin
});
iliI1l11 = Ill1II11.data?.["actorInfo"] || iliI1l11;
let IiI1illi = iliI1l11?.["energyValue"] ?? 0;
IiI1illi += iliI1l11?.["fansLoveValue"] ?? 0;
let lIiiIi1l = iliI1l11?.["prizeOneStatus"] ?? false,
IIli11I1 = iliI1l11?.["prizeTwoStatus"] ?? false,
i11i1Ii = iliI1l11?.["prizeThreeStatus"] ?? false,
lIi1iiiI = Ill1II11.data?.["actConfig"],
Ii1IlIli = lIi1iiiI?.["prizeScoreOne"] ?? 0,
lil1IlII = lIi1iiiI?.["prizeScoreTwo"] ?? 0,
l1i1lI11 = lIi1iiiI?.["prizeScoreThree"] ?? 0,
iIl1Iii1 = "";
!lIiiIi1l && IiI1illi >= Ii1IlIli && (iIl1Iii1 = "01");
!IIli11I1 && IiI1illi >= lil1IlII && (iIl1Iii1 = "02");
!i11i1Ii && IiI1illi >= l1i1lI11 && (iIl1Iii1 = "03");
if (iIl1Iii1) {
let ili1Iil1 = await this.wxApi("wxFansInterActionActivity/startDraw", {
"activityId": this.activityId,
"uuid": lI1liliI,
"drawType": iIl1Iii1
});
this.log(ili1Iil1);
if (ili1Iil1 && ili1Iil1.result) {
let l1IIIilI = ili1Iil1.data.drawOk ? ili1Iil1.data?.["name"] : ili1Iil1.data?.["errorMessage"] || "空气";
this.putMsg(l1IIIilI);
ili1Iil1.data.needWriteAddress === "y" && ili1Iil1.data?.["drawInfoType"] === 7 && ili1Iil1.data?.["addressId"] && (this.addressId = ili1Iil1.data.addressId, this.prizeName = l1IIIilI, await this.saveAddress());
return;
}
let ilI111I = ili1Iil1?.["errorMessage"];
this.putMsg(ilI111I);
this.wxStop(ilI111I);
return;
}
this.putMsg("积分:" + IiI1illi + ",兑换1:" + lIiiIi1l + ",兑换2:" + IIli11I1 + "兑换3:" + i11i1Ii);
}
}
iI11IIiI.activity = {
"activityUrl": activityUrl
};
iI11IIiI.TaskClass = iII1i1lI;
iI11IIiI.run({
"whitelist": ["1-2000"],
"main_thread": 3
});

196
jd_wx_followDraw.js Normal file
View File

@ -0,0 +1,196 @@
/*
关注抽奖beta v1.0.1
https://cjhy-isv.isvjcloud.com/wxShopFollowActivity/activity?activityId=92406df13eae4203b77d7a567c398326
https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10069&templateId=ac8b6564-aa35-4ba5-aa62-55b0ce61b5d01&activityId=1719974616209104898&nodeId=101001&prd=cjwx
https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10053&templateId=20210804190900gzspyl011&activityId=1718891863502409730&nodeId=101001053&prd=cjwx
https://jinggeng-isv.isvjcloud.com/ql/front/showFavoriteShop?id=9e8080a784add0d20184c74e8f0659f5&user_id=11179724
export B_WX_FOLLOW_DRAW_URL=""
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_FOLLOW_DRAW_URL);
if (mode) {
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10069&templateId=ac8b6564-aa35-4ba5-aa62-55b0ce61b5d01&activityId=1719974616209104898&nodeId=101001&prd=cjwx";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10053&templateId=20210804190900gzspyl011&activityId=1718891863502409730&nodeId=101001053&prd=cjwx";
activityUrl = "https://cjhy-isv.isvjcloud.com/wxShopFollowActivity/activity?activityId=92406df13eae4203b77d7a567c398326";
activityUrl = "https://jinggeng-isv.isvjcloud.com/ql/front/showFavoriteShop?id=9e8080a78b83db8f018b854284f27565&user_id=10028198";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10069&activityId=1723989742404182018&templateId=ac8b6564-aa35-4ba5-aa62-55b0ce61b5d01&nodeId=101001&prd=cjwx";
activityUrl = "https://jinggeng-isv.isvjcloud.com/ql/front/showFavoriteShop?id=9e8080a784add0d20184c74e8f0659f5&user_id=11179724";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10053&templateId=20210804190900gzspyl011&activityId=1717457082637680641&nodeId=101001053&prd=cjwx";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interaction/v1/index?activityType=10069&templateId=b60a7f97-84ed-445b-a2e2-9709da4a4d34&activityId=1775495796115959810&nodeId=101001&prd=crm";
}
const {
RunMode: lI11Il1,
UserMode: i1Ii1i1i
} = require("./bear");
lI11Il1.envInfo = {
"name": "关注抽奖beta",
"runName": "jd_wx_followDraw",
"version": "1.0.1"
};
class iII11II extends i1Ii1i1i {
constructor(il1l1iii, IilIllIl) {
super(il1l1iii, IilIllIl);
}
async ["getActivityContentOnly"]() {}
async ["userTask"]() {
await this.isvObfuscator();
if (this.mode === "jinggeng") {
await this.setMixNick();
await this.jinggengShopInfo();
let I1ll11li = await this.jinggengApi("postFavoriteShop");
this.debug(I1ll11li);
if (I1ll11li && I1ll11li.succ) {
let il1lli1I = I1ll11li.msg ?? "{}",
lIlI11i = JSON.parse(il1lli1I);
if (lIlI11i?.["actLogDto"]?.["remark"]) {
this.putMsg(lIlI11i?.["actLogDto"]?.["remark"]);
return;
}
} else {
let iIlIIl = I1ll11li?.["msg"] || "抽奖失败";
this.putMsg(iIlIIl);
this.wxStop();
}
return;
}
await this.getDefenseUrls();
if (["10053", "10069"].includes(this.activityType)) {
await this.login();
if (this.type === "lkFollowShop") {
await this.unfollow();
let iIiil111 = await this.taskGet("api/task/" + this.type + "/getUserFollowInfo");
this.debug(iIiil111);
if (iIiil111 && iIiil111.resp_code === 0) {
if (iIiil111.data.followShop) {
let IIllili1 = await this.taskGet("api/task/" + this.type + "/saveFollowInfo?actType=" + this.activityType);
this.debug(IIllili1);
if (IIllili1 && IIllili1.resp_code === 0) {
this.putMsg(IIllili1.data?.["prizeName"] || "空气");
return;
}
let il11l1I1 = IIllili1?.["resp_msg"] || "关注店铺失败";
this.putMsg(il11l1I1);
return;
} else this.putMsg("此活动只针对新关注店铺用户~");
} else {
let lIII1lli = iIiil111?.["resp_msg"] || "获取关注信息失败";
this.putMsg(lIII1lli);
}
return;
}
if (this.type === "followGoods") {
let Ill11lIl = await this.lzkjApi("api/task/" + this.type + "/getFollowGoods");
if (Ill11lIl && Ill11lIl.resp_code === 0) {
this.taskId = Ill11lIl.data?.[0]?.["taskId"];
let iil1IiIl = Ill11lIl.data?.[0]?.["completeCount"] || 0,
IlIilllI = Ill11lIl.data?.[0]?.["finishNum"] || 0,
i1II1il = Ill11lIl.data?.[0]?.["oneClickFollowPurchase"] || 1,
l1ll1iii = Ill11lIl.data?.[0]?.["status"] || 0,
il111Ii = Ill11lIl.data?.[0]?.["skuInfoVO"] || [];
il111Ii = il111Ii.filter(Ilii11li => Ilii11li.status === 0);
if (iil1IiIl >= IlIilllI || l1ll1iii === 1) {
this.putMsg("已领取");
return;
}
if (i1II1il === 0) {
let i1llIlll = await this.lzkjApi("api/task/" + this.type + "/followGoods", {
"taskId": this.taskId,
"skuId": ""
});
this.debug(i1llIlll);
if (i1llIlll && i1llIlll.resp_code === 0) {
this.putMsg(i1llIlll.data?.["prizeName"] || "空气");
return;
}
let Ii1ilil = i1llIlll?.["resp_msg"] || "关注商品失败";
this.log(Ii1ilil);
} else for (let lIIi11ll of il111Ii) {
let i1ilIil = await this.lzkjApi("api/task/" + this.type + "/followGoods", {
"skuId": lIIi11ll.skuId
});
this.debug(i1ilIil);
if (i1ilIil && i1ilIil.resp_code === 0) {
if (i1ilIil.data) {
this.putMsg(i1ilIil.data?.["prizeName"] || "空气");
return;
}
}
let iI1ii111 = i1ilIil?.["resp_msg"] || "关注商品失败";
this.log(iI1ii111);
if (iI1ii111.includes("会员等级")) {
return;
}
}
} else {
let i1lll1II = Ill11lIl?.["resp_msg"] || "获取关注商品信息失败";
this.log(i1lll1II);
}
}
return;
}
await this.wxCommonInfo();
await this.getSimpleActInfoVo();
this.index === 0 && (await this.getShopInfo());
this.defenseUrls.length === 0 ? await this.getMyPing() : await this.initPinToken();
await this.accessLog();
let lIiIil1i = await this.wxApi("wxShopFollowActivity/activityContentOnly", {
"activityId": this.activityId,
"pin": this.secretPin
});
this.debug(lIiIil1i);
if (lIiIil1i && lIiIil1i.result) {
let Iliilii = lIiIil1i.data.hasFollow ?? false,
II1iiI1 = lIiIil1i.data.canDrawTimes ?? 1,
IIIII = lIiIil1i.data.startTime ?? 0,
I111I1i = lIiIil1i.data.endTime ?? 0;
i1Ii1i1i.activity.startTime = IIIII;
i1Ii1i1i.activity.endTime = I111I1i;
const II11IiI1 = this.formatDate(IIIII, "yyyy-MM-dd HH:mm:ss") + "至" + this.formatDate(I111I1i, "yyyy-MM-dd HH:mm:ss");
i1Ii1i1i.activity.timeStr = II11IiI1;
if (IIIII && IIIII > Date.now()) {
this.putMsg("活动未开始");
this.stop();
return;
}
if (I111I1i && I111I1i < Date.now()) {
this.putMsg("活动已结束");
this.stop();
return;
}
if (II1iiI1 === 0) {
this.putMsg("无抽奖次数");
return;
}
Iliilii && (await this.unfollow());
if (this.domain.includes("cjhy")) await this.follow();else {
let Ii1ii111 = await this.wxApi("wxShopFollowActivity/follow", {
"activityId": this.activityId,
"pin": this.secretPin
});
this.debug(Ii1ii111);
if (!(Ii1ii111 && Ii1ii111.result)) {
let l11iilI = Ii1ii111?.["errorMessage"] || "关注店铺失败";
this.putMsg(l11iilI);
return;
}
}
await this.getPrize();
}
}
}
lI11Il1.activity = {
"activityUrl": activityUrl
};
lI11Il1.TaskClass = iII11II;
lI11Il1.run({
"whitelist": ["1-2000"],
"main_thread": 3
});

384
jd_wx_game.js Normal file
View File

@ -0,0 +1,384 @@
/*
无线游戏beta v2.0.1
https://cjhy-isv.isvjcloud.com/wxGameActivity/activity?activityId=2e8c28b441b34d03ab4579b1dd78fda3
https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10092&templateId=831049299456454111&activityId=1730467509346807809&nodeId=101001&prd=cjwx
https://lzkj-isv.isvjd.com/wxgame/activity/de387009255e49d68a1a1ebc9973dc2a?activityId=de387009255e49d68a1a1ebc9973dc2a
https://lzkj-isv.isvjcloud.com/prod/cc/interaction/v2/10086/1001/?activityId=1809050581606518785&shopId=1000004065
export B_WX_GAME_URL=""
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_GAME_URL);
if (mode) {
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10092&templateId=831049299456454111&activityId=1730467509346807809&nodeId=101001&prd=cjwx";
activityUrl = "https://cjhy-isv.isvjcloud.com/wxGameActivity/activity?activityId=2e8c28b441b34d03ab4579b1dd78fda3";
activityUrl = "https://lzkj-isv.isvjd.com/wxgame/activity/de387009255e49d68a1a1ebc9973dc2a?activityId=de387009255e49d68a1a1ebc9973dc2a";
activityUrl = "https://lzkj-isv.isvjd.com/wxgame/activity/7d77dd9caf16432cac8894e644bf146f?activityId=7d77dd9caf16432cac8894e644bf146f";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interaction/v2/10086/1001/?activityId=1809050581606518785&shopId=1000004065";
}
const {
RunMode: _0xfcbdcc,
UserMode: _0xd05e66
} = require("./bear");
_0xfcbdcc.envInfo = {
"name": "无线游戏beta",
"runName": "jd_wx_game",
"version": "2.0.1"
};
let _0x120d7f = ["10082", "10084", "10086", "10089", "10091", "10092", "10093", "10094", "10095"];
class _0xbfd39f extends _0xd05e66 {
constructor(_0x287e53, _0x5cfa76) {
super(_0x287e53, _0x5cfa76);
}
async ["v2ToDoTask"](_0x5d8961, _0x512db6 = "") {
let _0x5219b9 = {
2: "浏览店铺",
7: "加购商品",
8: "购买商品",
9: "分享商品",
12: "分享活动"
},
_0x373350 = {
2: "browseShop/shareShop",
7: "addSku/excute",
9: "shareSku",
12: "shareActivity"
},
_0x1ed663 = await this.v2Api("api/" + this.activityType + "/" + _0x373350[_0x5d8961], {
"skuId": _0x512db6
});
this.debug(_0x1ed663, _0x5d8961);
if (_0x1ed663 && _0x1ed663.code === 200) {
return this.log("任务[" + (_0x5219b9[_0x5d8961] || _0x512db6 || _0x5d8961) + "]完成"), _0x1ed663.data;
}
}
async ["userTask"]() {
await this.isvObfuscator();
if (this.mode === "v2") {
await this.login();
let _0x2abea7 = await this.v2Api("api/" + this.activityType + "/getTask");
this.debug(_0x2abea7);
if (_0x2abea7 && _0x2abea7.code === 200) {
let _0x1c9170 = _0x2abea7?.["data"] || [];
for (let _0x30e3dc of _0x1c9170) {
if (_0x30e3dc.taskFinishGiveAllLotteryCount >= _0x30e3dc.totalLimit) continue;
switch (_0x30e3dc.taskType) {
case 2:
case 12:
await this.v2ToDoTask(_0x30e3dc.taskType);
break;
case 9:
let _0x3102e1 = await this.v2Api("api/" + this.activityType + "/getShareSkuTaskSkuList"),
_0x1bfbb9 = _0x3102e1?.["data"]?.["filter"](_0x4eddc9 => !_0x4eddc9.isOperated) || [];
for (let _0x5c2024 = _0x30e3dc.taskFinishGiveAllLotteryCount || 0; _0x5c2024 < Math.min(_0x30e3dc.totalLimit, _0x1bfbb9.length); _0x5c2024++) {
await this.v2ToDoTask(9, _0x1bfbb9.shift().skuId);
}
break;
case 7:
let _0xadb004 = await this.v2Api("api/" + this.activityType + "/addSku/getSkuList"),
_0x3a6de8 = _0xadb004?.["data"]?.["filter"](_0x93d1c3 => !_0x93d1c3.isOperated) || [];
for (let _0xdcff7e = _0x30e3dc.taskFinishGiveAllLotteryCount || 0; _0xdcff7e < Math.min(_0x30e3dc.totalLimit, _0x3a6de8.length); _0xdcff7e++) {
await this.v2ToDoTask(7, _0x3a6de8.shift().skuId);
}
break;
}
}
}
let _0x4f0f26 = await this.v2Api("api/" + this.activityType + "/gameChanceNum");
this.debug(_0x4f0f26);
let _0x4e0068 = _0x4f0f26?.["data"] ?? 0;
while (_0x4e0068-- > 0) {
await this.sleep(2000, 3000);
let _0x3ec701 = await this.v2Api("api/" + this.activityType + "/gameStart");
this.debug(_0x3ec701);
let _0x2a3a0d = _0x3ec701.data.uuid;
await this.sleep(3000, 5000);
let _0x23d215 = await this.v2Api("api/" + this.activityType + "/gameEnd", {
"uuid": _0x2a3a0d
});
this.debug(_0x23d215);
}
let _0x2aee39 = await this.v2Api("api/" + this.activityType + "/chanceNum");
this.debug(_0x2aee39);
let _0x3e5c0e = _0x2aee39?.["data"] ?? 5;
this.debug(_0x3e5c0e);
while (_0x3e5c0e-- > 0) {
let _0x487bb1 = await this.v2Api("api/" + this.activityType + "/lotteryDraw");
this.log(_0x487bb1);
if (_0x487bb1 && _0x487bb1.code === 200) {
this.putMsg(_0x487bb1?.["data"]?.["prizeName"] || "空气");
_0x487bb1?.["data"]?.["result"]?.["result"] !== "true" && _0x487bb1?.["data"]?.["result"]?.["result"] !== true && _0x487bb1?.["data"]?.["activityPrizeId"] && (this.addressId = _0x487bb1?.["data"]?.["result"]?.["result"], this.prizeName = _0x487bb1?.["data"]?.["prizeName"], this.activityPrizeId = _0x487bb1?.["data"]?.["activityPrizeId"], await this.saveAddress());
continue;
}
let _0x4d95a7 = _0x487bb1?.["message"] || "抽奖失败";
this.putMsg(_0x4d95a7);
await this.wxStopSync(_0x4d95a7);
return;
}
return;
}
await this.getDefenseUrls();
if (_0x120d7f.includes(this.activityType)) {
await this.login();
let _0x34712c = this.getQueryString(this.activityUrl, "templateId"),
_0x180126 = await this.lzkjApi("api/game/getGameInfo", {
"gameUrl": "https://lzkj-yc.isvjd.com/index.html?templateId=" + _0x34712c + "&token=" + this.token,
"shareUserId": ""
});
this.debug(_0x180126);
if (_0x180126 && _0x180126.resp_code === 0) {
await this.lzkjTask(_0x180126.data?.["taskList"]);
}
_0x180126 = await this.lzkjApi("api/game/getGameInfo", {
"gameUrl": "https://lzkj-yc.isvjd.com/index.html?templateId=" + _0x34712c + "&token=" + this.token,
"shareUserId": ""
});
this.debug(_0x180126);
if (!(_0x180126 && _0x180126.resp_code === 0)) {
let _0x1ec695 = _0x180126?.["resp_msg"] || "获取任务失败";
this.putMsg(_0x1ec695);
await this.wxStopSync(_0x1ec695);
return;
}
let _0x2f3f42 = _0x180126.data?.["gameChance"] ?? 4,
_0x442194 = _0x180126.data?.["canDrawTimes"] ?? 0,
_0x4b9d30 = await this.lzkjApi("api/game/init", {
"templateId": _0x34712c
});
if (_0x4b9d30 && _0x4b9d30.resp_code === 0) {
let _0x49bff6 = _0x4b9d30.data?.["publicKey"],
_0x3d8d2e = _0x4b9d30.data?.["ruleScore"];
this.debug(_0x49bff6, _0x3d8d2e);
for (let _0x5a6488 = 0; _0x5a6488 < _0x2f3f42; _0x5a6488++) {
let _0x5bbcce = await this.lzkjApi("api/game/start");
this.debug(_0x5bbcce);
if (!(_0x5bbcce && _0x5bbcce.resp_code === 0)) {
this.log("开启游戏失败");
continue;
}
let _0xb7b9d3 = _0x5bbcce.data?.["id"],
_0x59c786 = this.rsaEncrypt(_0x49bff6, {
"encryptionScheme": "pkcs1"
}, JSON.stringify({
"score": _0x3d8d2e + "",
"id": _0xb7b9d3
}));
this.debug(_0x59c786);
let _0x36d08d = await this.lzkjApi("api/game/end", {
"result": _0x59c786,
"activityId": this.activityId
});
this.debug(_0x36d08d);
if (_0x36d08d && _0x36d08d.resp_code === 0) {
_0x36d08d.data === 1 && _0x442194++;
}
}
} else {
let _0x57b2a1 = _0x4b9d30?.["resp_msg"] || "初始化游戏失败";
this.putMsg(_0x57b2a1);
await this.wxStopSync(_0x57b2a1);
}
while (_0x442194-- > 0) {
let _0x1c7c7d = await this.lzkjApi("api/prize/draw", {
"consumePoints": 0
});
this.debug(_0x1c7c7d);
if (_0x1c7c7d && _0x1c7c7d.resp_code === 0) {
this.putMsg(_0x1c7c7d.data?.["prizeName"] || "空气");
if (_0x1c7c7d.data.prizeType == 3) {
this.addressId = _0x1c7c7d.data.addressId;
this.prizeName = _0x1c7c7d.data.prizeName;
await this.saveAddress();
}
} else {
let _0x214e28 = _0x1c7c7d?.["resp_msg"] || "抽奖失败";
this.putMsg(_0x214e28);
await this.wxStopSync(_0x214e28);
}
await this.sleep(200);
}
return;
}
await this.wxCommonInfo();
await this.getSimpleActInfoVo();
this.index === 0 && (await this.getShopInfo());
this.defenseUrls.length === 0 ? await this.getMyPing() : await this.initPinToken();
await this.accessLog();
let _0x32c3bc = "",
_0x1e68bc = "",
_0x185ec2 = this.activityType == 7 ? {} : {
"pinImg": _0x32c3bc,
"nick": _0x1e68bc,
"shareUuid": _0xd05e66.activity.shareUuid || "",
"cjyxPin": "",
"cjhyPin": ""
};
this.debug(_0x185ec2, this.type);
let _0x34eb84 = await this.activityContent(_0x185ec2);
if (!_0x34eb84?.["result"] || !_0x34eb84?.["data"]) {
this.putMsg(_0x34eb84?.["errorMessage"]);
return;
}
if (this.activityType == 7) {
let _0x3a461e = _0x34eb84?.["data"]?.["todayCanDrawOk"] || 1,
_0x56c403 = _0x34eb84?.["data"]?.["drawContentVOs"] ?? [];
_0x56c403 = _0x56c403.filter(_0x258f0d => [6, 7, 9, 13, 14, 15, 16].includes(_0x258f0d.type) && _0x258f0d.prizeNum > _0x258f0d.hasSendPrizeNum);
if (_0x56c403.length === 0) {
this.putMsg("垃圾或领完");
this.stop();
return;
}
await this.wxApi("wxGameActivity/follow", {
"activityId": this.activityId,
"pin": this.secretPin
});
if (_0x3a461e === 0) {
this.putMsg("无次数");
return;
}
_0x3a461e = Math.min(_0x3a461e, 20);
_0x56c403 = _0x56c403.sort((_0x40d810, _0x3c4545) => _0x3c4545.startScore - _0x40d810.startScore);
while (_0x3a461e-- > 0) {
let _0x11379c = this.random(_0x56c403[0].startScore, _0x56c403[0].endScore) + "";
_0x11379c = (_0x11379c.substring(0, _0x11379c.length - 1) + 0) * 1;
this.domain.includes("cjhy") && (_0x11379c = this.encryptCrypto("AES", "ECB", "Pkcs7", "00000000", JSON.stringify(_0x11379c), this.activityId));
let _0x275fb3 = await this.wxApi("wxGameActivity/gameStartDeposit", {
"activityId": this.activityId,
"pin": this.secretPin
});
this.debug(_0x275fb3);
if (!(_0x275fb3 && _0x275fb3.result)) {
this.log("开启游戏失败");
continue;
}
let _0xfdf5ce = {
"activityId": this.activityId,
"pin": this.secretPin,
"score": encodeURIComponent(_0x11379c)
};
this.debug(_0xfdf5ce);
let _0x27eecd = await this.wxApi("wxGameActivity/gameOverRecord", _0xfdf5ce);
this.debug(_0x27eecd);
if (_0x27eecd && _0x27eecd.result) this.putMsg(_0x27eecd.data?.["name"] || "空气"), _0x27eecd.data?.["needWriteAddress"] === "y" && (this.addressId = _0x27eecd.data.addressId, this.prizeName = _0x27eecd.data.name, await this.saveAddress());else {
let _0x5bcfbd = _0x27eecd?.["errorMessage"] || "游戏失败";
this.putMsg(_0x5bcfbd);
await this.wxStopSync(_0x5bcfbd);
}
}
} else {
let _0x32418f = _0x34eb84?.["data"]?.["drawMiniScore"] ?? 1000;
if (_0x34eb84?.["data"]?.["isGameEnd"]) {
this.putMsg("活动已结束");
await this.writeLongCache();
this.stop();
return;
}
let _0x6dbfd3 = _0x34eb84?.["data"]?.["uid"];
this.index === 0 && _0x6dbfd3 && (_0xd05e66.activity.shareUuid = _0x6dbfd3);
let _0xfe0f4a = await this.wxApi("wxgame/myInfo", {
"activityId": this.activityId,
"pin": this.secretPin
});
if (_0xfe0f4a && _0xfe0f4a.result) {
let _0x17d9fe = _0xfe0f4a.data?.["taskList"] ?? [];
_0x17d9fe = _0x17d9fe.filter(_0x166acf => _0x166acf.taskId !== "share2help" && _0x166acf.curNum < _0x166acf.maxNeed);
for (let _0x5cdc86 of _0x17d9fe) {
let _0x44f128 = _0x5cdc86.taskId === "followsku" ? "3" : _0x5cdc86.taskId === "add2cart" ? "1" : "";
if (_0x44f128 === "") continue;
let _0x5602a7 = await this.wxApi("wxgame/getProduct", {
"activityId": this.activityId,
"pin": this.secretPin,
"type": _0x44f128
});
if (_0x5602a7 && _0x5602a7.result) for (let _0x422e36 = 0; _0x422e36 < _0x5602a7.data.length && _0x422e36 < _0x5cdc86.maxNeed; _0x422e36++) {
let _0x5b29c1 = await this.wxApi("wxgame/doTask", {
"activityId": this.activityId,
"pin": this.secretPin,
"taskId": _0x5cdc86.taskId,
"param": _0x5602a7.data[_0x422e36].skuId
});
this.debug(_0x5b29c1);
}
}
}
_0xfe0f4a = await this.wxApi("wxgame/myInfo", {
"activityId": this.activityId,
"pin": this.secretPin
});
if (_0xfe0f4a && _0xfe0f4a.result) {
let _0x1f3998 = Math.min(_0xfe0f4a.data?.["chance"] ?? 0, 7);
if (_0x1f3998 === 0) {
this.putMsg("无次数");
return;
}
while (_0x1f3998-- > 0) {
let _0x5dad61 = await this.wxApi("wxgame/game/start", {
"activityId": this.activityId,
"pin": this.secretPin
});
this.debug(_0x5dad61);
if (_0x5dad61 && _0x5dad61.result) {
let _0x492de3 = _0x5dad61.data;
this.debug("gameId:", _0x492de3);
let _0x4126ee = _0x32418f + this.random(100, 200);
await this.sleep(1000);
let _0x367930 = this.timestamp(),
_0x3a9bec = this.md5(_0x492de3 + "," + _0x367930 + "," + _0x4126ee + ",0eed6538f6e84b754ad2ab95b45c54f8"),
_0x589956 = await this.wxApi("wxgame/game/end", {
"activityId": this.activityId,
"pin": this.secretPin,
"gameId": _0x492de3,
"score": _0x4126ee,
"sign": _0x3a9bec,
"reqtime": _0x367930,
"getRank": true,
"getScoreRank": true,
"getPlayerNum": true
});
this.debug(_0x589956);
if (_0x589956 && _0x589956.result) {
_0x367930 = this.timestamp() + "";
let _0x420872 = await this.wxApi("wxgame/game/luckyDraw", {
"activityId": this.activityId,
"pin": this.secretPin,
"gameId": _0x492de3,
"score": _0x4126ee,
"reqtime": _0x367930,
"sign": this.md5(_0x492de3 + "," + _0x367930 + ",0eed6538f6e84b754ad2ab95b45c54f8")
});
this.debug(_0x420872);
if (_0x420872 && _0x420872.result) this.putMsg(_0x420872.data.name || "空气"), _0x420872.data.needWriteAddress === "y" && (this.addressId = _0x420872.data.addressId, this.prizeName = _0x420872.data.name, await this.saveAddress());else {
let _0x3639e4 = _0x420872?.["errorMessage"] || "抽奖失败";
this.putMsg(_0x3639e4);
await this.wxStopSync(_0x3639e4);
}
} else {
let _0x5d28c7 = _0x589956?.["errorMessage"] || "游戏失败";
this.putMsg(_0x5d28c7);
await this.wxStopSync(_0x5d28c7);
}
}
}
} else {
let _0x1fd8bf = _0xfe0f4a?.["errorMessage"] || "获取用户信息失败";
this.putMsg(_0x1fd8bf);
await this.wxStopSync(_0x1fd8bf);
}
}
}
}
_0xfcbdcc.activity = {
"activityUrl": activityUrl
};
_0xfcbdcc.TaskClass = _0xbfd39f;
_0xfcbdcc.run({
"whitelist": ["1-2000"],
"main_thread": 3
});

117
jd_wx_knowledge.js Normal file
View File

@ -0,0 +1,117 @@
/*
知识超人beta v2.0.0
https://cjhy-isv.isvjcloud.com/wxKnowledgeActivity/activity?activityId=ffa61daaa499402da5fdc1bf4a779cfe
export B_WX_KNOWLEDGE_URL=""
export B_WX_KNOWLEDGE_BEAN_NUM="1" # 豆子超过多少才开卡 默认值1
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_KNOWLEDGE_URL);
mode && (activityUrl = "https://cjhy-isv.isvjcloud.com/wxKnowledgeActivity/activity?activityId=ffa61daaa499402da5fdc1bf4a779cfe");
const {
RunMode: lII1il1l,
UserMode: llIlilIl,
baseCommonEnv: Iil1i1II,
baseCommonEnvKey: il1i11i
} = require("./bear");
Iil1i1II.openCardBeanNum = parseInt(process.env.B_WX_KNOWLEDGE_BEAN_NUM || 1);
il1i11i.B_WX_KNOWLEDGE_BEAN_NUM = "openCardBeanNum";
lII1il1l.envInfo = {
"name": "知识超人beta",
"runName": "jd_wx_knowledge",
"version": "2.0.0"
};
class IillI1ll extends llIlilIl {
constructor(II11lIli, liiiiI1I) {
super(II11lIli, liiiiI1I);
}
async ["userTask"]() {
if (this.activityType === "10039") return;
await this.isvObfuscator();
await this.getDefenseUrls();
await this.wxCommonInfo();
await this.getSimpleActInfoVo();
this.type = "wxKnowledgeActivity";
this.index === 0 && (await this.getShopInfo());
this.defenseUrls.length === 0 ? await this.getMyPing() : await this.initPinToken();
await this.accessLog();
let IIl1lII1 = await this.activityContent();
if (!IIl1lII1 || !IIl1lII1.result) {
this.putMsg(IIl1lII1?.["errorMessage"]);
this.wxStop(IIl1lII1?.["errorMessage"]);
return;
}
let IIii1iI = IIl1lII1.data.questions ?? [],
i1lIllil = IIl1lII1.data.drawContentVOs ?? [];
i1lIllil = i1lIllil.filter(iiII1iI => [6, 7, 9, 13, 14, 15, 16].includes(iiII1iI.type));
if (i1lIllil.length === 0) {
this.putMsg("垃圾或领完");
this.stop();
return;
}
let iiiilil1 = i1lIllil[0].type === 6 && i1lIllil[0].beanNum >= Iil1i1II.openCardBeanNum || i1lIllil[0].type === 7 || false,
IliIlil = 10,
I11II = null;
while (IliIlil-- > 0) {
I11II = await this.wxApi("wxKnowledgeActivity/startAnswer", {
"activityId": this.activityId,
"pin": this.secretPin
});
this.debug(I11II);
if (I11II && I11II.result) break;
let i1lllllI = I11II?.["errorMessage"];
if (i1lllllI.includes("会员") && iiiilil1) {
await this.bindWithVender();
if (this.canNotOpenCard) return this.reseCookieStatus();
continue;
}
this.putMsg(i1lllllI);
this.wxStop(i1lllllI);
return;
}
for (let ll11liII of IIii1iI) {
let IIIliIll = await this.wxApi("wxKnowledgeActivity/answer", {
"questionId": ll11liII.id,
"answer": ll11liII.realAnswer,
"detailId": I11II.data.id
});
this.debug(IIIliIll);
let lIliII1l = IIIliIll?.["errorMessage"];
this.wxStop(lIliII1l);
if (lIliII1l.includes("答题已通关")) break;
}
let I1iIII = await this.wxApi("wxKnowledgeActivity/getPrize", {
"detailId": I11II.data.id
});
this.debug(I1iIII);
if (I1iIII && I1iIII.result) {
if (I1iIII.data.drawOk) {
this.putMsg(I1iIII.data.name || "空气");
if (I1iIII.data?.["drawInfoType"] === 7 && I1iIII.data?.["needWriteAddress"] === "y" && I1iIII.data?.["addressId"]) {
this.addressId = I1iIII.data.addressId;
this.prizeName = I1iIII.data.name;
await this.saveAddress();
}
}
return;
}
let Il1lli1 = I1iIII?.["errorMessage"];
this.putMsg(Il1lli1);
this.wxStop(Il1lli1);
}
}
lII1il1l.activity = {
"activityUrl": activityUrl
};
lII1il1l.TaskClass = IillI1ll;
lII1il1l.run({
"whitelist": ["1-2000"],
"main_thread": 3
});

193
jd_wx_levelBirth.js Normal file
View File

@ -0,0 +1,193 @@
/*
等级/生日礼包beta v2.0.0
https://cjhy-isv.isvjcloud.com/mc/wxMcLevelAndBirthGifts/activity?activityId=d651133fe1e74bb3823dc745d571a185
export B_WX_LEVEL_BIRTH_URL=""
export B_WX_LEVEL_BIRTH_BEAN_NUM="10" # 豆子超过多少才开卡 默认值10
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_LEVEL_BIRTH_URL);
if (mode) {
activityUrl = "https://cjhy-isv.isvjcloud.com/mc/wxMcLevelAndBirthGifts/activity?activityId=d651133fe1e74bb3823dc745d571a185";
activityUrl = "https://cjhy-isv.isvjcloud.com/mc/wxMcLevelAndBirthGifts/activity?activityId=25386dcd16b34b14ba50b5c6c5c5b0f4";
activityUrl = "https://cjhy-isv.isvjcloud.com/mc/wxMcLevelAndBirthGifts/activity?activityId=ee8648bca1ae492cacc43dcf8ae294d7";
activityUrl = "https://cjhy-isv.isvjcloud.com/mc/wxMcLevelAndBirthGifts/activity?activityId=b741377f23a048a08b64999b08cbd7aa";
activityUrl = "https://cjhy-isv.isvjcloud.com/mc/wxMcLevelAndBirthGifts/activity?activityId=b1cd3698edad47698573bad5742356f6";
activityUrl = "https://lzkj-isv.isvjd.com/prod/cc/interaction/v2/20002/1001/?shopId=1000309923&activityId=1762435679669395458";
}
const {
RunMode: i1i1lIlI,
UserMode: ilII11I,
baseCommonEnv: I1i1liil,
baseCommonEnvKey: I11i1iIl
} = require("./bear");
I1i1liil.beanNum = parseInt(process.env?.["B_WX_LEVEL_BIRTH_BEAN_NUM"] || 10);
I11i1iIl.B_WX_LEVEL_BIRTH_BEAN_NUM = "beanNum";
i1i1lIlI.envInfo = {
"name": "等级/生日礼包beta",
"runName": "jd_wx_levelBirth",
"version": "2.0.0"
};
class l1liIIil extends ilII11I {
constructor(liiIi1l, IIlI11Il) {
super(liiIi1l, IIlI11Il);
this.level = 0;
this.openedCard = false;
}
async ["saveBirthDay"]() {
let i11IiI1I = this.formatDate(Date.now(), "yyyy-MM-dd"),
ill11Ii = await this.wxApi("mc/wxMcLevelAndBirthGifts/saveBirthDay", {
"venderId": this.venderId,
"pin": this.secretPin,
"birthDay": i11IiI1I
});
if (ill11Ii && ill11Ii.result) {
this.log("设置生日" + i11IiI1I + "成功");
return;
}
let lIi11Il = ill11Ii?.["errorMessage"] || "设置生日失败";
this.log(lIi11Il);
}
async ["sendBirthGifts"]() {
let lIIIll1 = await this.wxApi("mc/wxMcLevelAndBirthGifts/sendBirthGifts", {
"activityId": this.activityId,
"venderId": this.venderId,
"pin": this.secretPin,
"level": this.level
});
this.debug(lIIIll1);
if (lIIIll1 && lIIIll1.result) {
let IiiiiiI = [];
if (lIIIll1.data?.["birthdayData"]) {
for (let lliIiii of lIIIll1.data.birthdayData) {
if (lliIiii.name) {
IiiiiiI.push(lliIiii.beanNum + "个" + lliIiii.name);
}
}
}
IiiiiiI.length > 0 ? this.putMsg(IiiiiiI.join(",")) : this.putMsg("没有获得奖品");
return;
}
let Iiil1lli = lIIIll1?.["errorMessage"] || lIIIll1?.["data"]?.["birthdayError"] || "领取生日礼包失败";
this.putMsg(Iiil1lli);
this.wxStop(Iiil1lli);
}
async ["sendLevelGifts"]() {
let ill1iIiI = await this.wxApi("mc/wxMcLevelAndBirthGifts/sendLevelGifts", {
"activityId": this.activityId,
"venderId": this.venderId,
"pin": this.secretPin,
"level": this.level
});
this.debug(ill1iIiI);
if (ill1iIiI && ill1iIiI.result) {
let i11iilI1 = [];
if (ill1iIiI.data?.["birthdayData"]) for (let lllIi1I1 of ill1iIiI.data.birthdayData) {
lllIi1I1.name && i11iilI1.push(lllIi1I1.beanNum + "个" + lllIi1I1.name);
}
i11iilI1.length > 0 ? this.putMsg(i11iilI1.join(",")) : this.putMsg("没有获得奖品");
return;
}
let Il1lllii = ill1iIiI?.["errorMessage"] || ill1iIiI?.["data"]?.["levelError"] || "领取等级礼包失败";
this.putMsg(Il1lllii);
this.wxStop(Il1lllii);
}
async ["userTask"]() {
await this.isvObfuscator();
if (this.mode === "v2") {
await this.login();
let lI1Iili1 = await this.v2Api("api/" + this.activityType + "/getActivityInfo");
this.debug(lI1Iili1);
if (!lI1Iili1 && !lI1Iili1.code === 200) {
this.putMsg("获取活动信息失败");
return;
}
if (lI1Iili1?.["data"]?.["remark"]?.["includes"]("已经领取") || lI1Iili1?.["data"]?.["status"] === 4) {
this.putMsg("已领取");
return;
}
let IIiI1liI = await this.v2Api("api/" + this.activityType + "/birthday", {
"birthday": this.formatDate(Date.now(), "yyyy/MM/dd")
});
this.debug(IIiI1liI);
let IIl1111I = await this.v2Api("api/" + this.activityType + "/receivePrize");
this.debug(IIl1111I);
let iIiI1i1I = await this.v2Api("api/" + this.activityType + "/myPrizes");
this.debug(iIiI1i1I);
if (iIiI1i1I && iIiI1i1I.code === 200) {
this.putMsg(iIiI1i1I.data.map(liilllii => "" + liilllii.prizeName).join(",") || "空气");
return;
}
this.putMsg("领取失败");
return;
}
await this.getDefenseUrls();
await this.wxCommonInfo();
await this.getSimpleActInfoVo();
this.defenseUrls.length === 0 ? await this.getMyPing() : await this.initPinToken();
await this.accessLog();
let iI1lii1i = await this.wxApi("mc/new/brandCard/common/shopAndBrand/getOpenCardInfo", {
"venderId": this.venderId,
"buyerPin": this.secretPin,
"activityType": 103
});
this.debug(iI1lii1i);
if (iI1lii1i && iI1lii1i.result) this.openedCard = iI1lii1i.data.openedCard;else {
let iIli1il = iI1lii1i?.["errorMessage"] || "获取开卡信息失败";
this.log(iIli1il);
}
let llIliII1 = await this.wxApi("mc/wxMcLevelAndBirthGifts/getMemberLevel", {
"venderId": this.venderId,
"pin": this.secretPin
});
this.debug(llIliII1);
if (llIliII1 && llIliII1.result) {
this.level = llIliII1.data.level;
} else {
let ilIl1lI = llIliII1?.["errorMessage"] || "获取会员等级失败";
this.log(ilIl1lI);
}
let ll11liIl = await this.activityContent({
"level": 1
});
if (ll11liIl && ll11liIl.result) {
let iIi1i111 = JSON.parse(ll11liIl.data?.["content"]).filter(i1111II => [4, 6, 7, 9, 13, 14, 15, 16].includes(i1111II.type));
if (iIi1i111.length === 0) {
this.putMsg("垃圾或领完");
this.stop();
return;
}
iIi1i111 = iIi1i111.sort((iiI1Ii1, l1iIiii1) => iiI1Ii1.drawLevel - l1iIiii1.drawLevel);
if (ll11liIl.data.isReceived === 0) {
let iiI11Iii = !this.openedCard && iIi1i111.filter(l1iIIil => l1iIIil.beanNum >= I1i1liil.beanNum && l1iIIil.name == "京豆" && l1iIIil.drawLevel == 1).length > 0;
if (iiI11Iii) {
await this.getShopOpenCardInfo();
await this.bindWithVender();
if (this.canNotOpenCard) return;
this.level = 1;
}
this.debug(this.activityType);
if (this.activityType === 103) await this.saveBirthDay(), await this.sendBirthGifts();else [104, 119].includes(this.activityType) && (await this.sendLevelGifts());
} else this.putMsg("已领取");
return;
}
let IiII1iii = ll11liIl?.["errorMessage"] || "获取活动信息失败";
this.putMsg(IiII1iii);
this.wxStop(IiII1iii);
}
}
i1i1lIlI.activity = {
"activityUrl": activityUrl
};
i1i1lIlI.TaskClass = l1liIIil;
i1i1lIlI.run({
"whitelist": ["1-2000"],
"main_thread": 3
});

587
jd_wx_luckDraw.js Normal file
View File

@ -0,0 +1,587 @@
/*
幸运抽奖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 B_WX_LUCK_DRAW_URL=""
export B_WX_NOT_LUCK_DRAW_LIST="" # 积分不跑 @分割 例子: a2海外@马可波罗@合田家@风向标@罗技二手外设
export B_WX_BLACK_LUCK_DRAW_RULE="" # 拉黑的店铺 例子: FITURE|FITURE
export B_WX_LUCK_OPEN_MODE="0" # 强制开卡 0:不开卡 1:开卡 默认值0
export B_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.B_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/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://lzkj-isv.isvjd.com/prod/cc/interaction/v2/10023/1001/?shopId=1000003015&activityId=1774717615353618434&shareId=1775154418404347905&nick=醉清风十4506164";
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";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10021&templateId=20210527190900dazhuanpan011&activityId=1785218258431082497&prd=cjwx";
activityUrl = "https://lzkj-isv.isvjd.com/prod/cc/interaction/v2/10021/1006/?shopId=1000002984&activityId=1784546748423274498&shareId=1787350615634395137";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10021&templateId=20210527190900dazhuanpan011&activityId=1784159118973149185&nodeId=101001&prd=cjwx";
activityUrl = "https://jingyun-rc.isvjcloud.com/h5/pages/turntable/turntable3?id=35bfa9eceee09eccb92b5c5cfa08b83d&userId=139755&actForm=single";
activityUrl = "https://jinggeng-rc.isvjcloud.com/ql/front/showDrawOne?id=9e8080a48f2dbdeb018f2e46fae077d1&user_id=722518";
activityUrl = "https://gzsl-isv.isvjcloud.com/wuxian/mobileForApp/dist2/views/pages/gameDZP_34.html?activityId=f42d4b371284463eaae514fc0d4b6bef";
activityUrl = "https://cjhy-isv.isvjcloud.com/wxDrawActivity/activity?activityId=b62b337bfc984c40b2c30ece36214dce";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10021&activityId=1775405379973079042&templateId=10021240320dzpcj01&nodeId=101001&prd=cjwx";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interaction/v1/index?activityType=10046&templateId=20210714190900lhj01&activityId=1800790172506263554&nodeId=101001&prd=crm";
activityUrl = "https://cjhy-isv.isvjcloud.com/wxDrawActivity/activity?activityId=aa8ce8604a064d35a02098444c98f248";
activityUrl = "https://cjhy-isv.isvjcloud.com/wxDrawActivity/activity?activityId=71660c5f93094903827bbf91f7cdb21c";
activityUrl = "https://jingyun-rc.isvjcloud.com/h5/pages/turntable/turntable4?id=5096a3806604378765d8863acb6c921f&userId=65679";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interaction/v2/10021/1006/?activityId=1806579415919820801&shopId=1000386186";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interaction/v2/10020/1002/?activityId=1810484831281164289&shopId=1000376431";
activityUrl = "https://lzkj-isv.isvjcloud.com/wxDrawActivity/activity/8906c94a5be64525b9b454fabc0a1b4e?activityId=8906c94a5be64525b9b454fabc0a1b4e";
}
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": "幸运抽奖beta",
"runName": "jd_wx_luckDraw",
"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();
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;
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"] || "空气");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
});

776
jd_wx_opencard.js Normal file
View File

@ -0,0 +1,776 @@
/*
通用开卡beta v2.0.2
https://lzdz1-isv.isvjcloud.com/m/1000282702/dze70dc1d244b18a194dfc8857shop
https://jinggengjcq-isv.isvjcloud.com/jdbeverage/pages/oC20240401cot/oC20240401cot?actId=8b0ef0c607f34f2ab2a7a5_240401
https://lzdz1-isv.isvjd.com/m/unite/dzlh0001/?activityId=d5412c11d735467abbfba3b3f4b319d7&venderId=1000001933&adSource=TBGFQJD
https://lzdz1-isv.isvjd.com/m/1000001683/dzb08098af8dca4bb28fce9c88b6e4/?adsource=0005
https://lzdz1-isv.isvjd.com/dingzhi/joinCommon/activity/activity?activityId=d5412c11d735467abbfba3b3f4b319d7
https://szxyun-rc.isvjcloud.com/pagec/unionOpenSHR240422/index.html
export B_WX_OPENCARD_URL=""
export B_WX_OPENCARD_INVITE_NUM=100 邀请人数
export B_WX_OPENCARD_LEADER_NUM=1 车头数量 默认值1
export B_WX_OPENCARD_VIEW_SHOP=0 0邀请 1浏览 2邀请+浏览 默认值0
export B_WX_OPENCARD_ADD_SKU=0 0不加购 1加购 默认值0
ps: 当关注和加购为1时则不会邀请 建议分身设置单独跑浏览或加购
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_OPENCARD_M_URL);
if (mode) {
activityUrl = "https://lzdz1-isv.isvjcloud.com/m/1000282702/dze70dc1d244b18a194dfc8857shop/";
activityUrl = "https://jinggengjcq-isv.isvjcloud.com/jdbeverage/pages/oC20240401cot/oC20240401cot?actId=8b0ef0c607f34f2ab2a7a5_240401";
activityUrl = "https://jinggengjcq-isv.isvjcloud.com/jdbeverage/pages/oC20240401cot/oC20240401cot?actId=c903126b617b4d8e943c82baa_240403";
activityUrl = "https://jinggengjcq-isv.isvjcloud.com/jdbeverage/pages/oC20240401cot/oC20240401cot?actId=0f03b6459c2c4333a1081be5acca7_240410";
activityUrl = "https://lzdz1-isv.isvjd.com/m/unite/dzlh0001/?activityId=d5412c11d735467abbfba3b3f4b319d7&venderId=1000001933&adSource=TBGFQJD";
activityUrl = "https://lzdz1-isv.isvjd.com/m/1000001683/dzb08098af8dca4bb28fce9c88b6e4/?adsource=0005";
activityUrl = "https://lzdz1-isv.isvjd.com/dingzhi/joinCommon/activity/activity?activityId=d5412c11d735467abbfba3b3f4b319d7";
activityUrl = "https://szxyun-rc.isvjcloud.com/pagec/unionOpenSHR240422/index.html";
activityUrl = "https://lzdz1-isv.isvjcloud.com/m/unite/dzlh0001?activityId=7940395b691b4611a4eadb59c3c8a4f6&venderId=1000003443&adSource=MJLJDZYGFQJD";
activityUrl = "https://jinggengjcq-isv.isvjcloud.com/jdbeverage/pages/oC20240410aslw/oC20240410aslw?actId=5f4d63b233744b1_240515";
activityUrl = "https://jinggengjcq-isv.isvjcloud.com/jdbeverage/pages/oC20240410aslw/oC20240410aslw?actId=42af5f29743f45e_240517";
activityUrl = "https://jinggengjcq-isv.isvjcloud.com/jdbeverage/pages/oC20240520def/oC20240520def?actId=df5b2fe59b9b453_240520";
activityUrl = "https://jinggengjcq-isv.isvjcloud.com/jdbeverage/pages/oC2024052402cxc/oC2024052402cxc?actId=0421ccc68d7c41bb_24052402";
}
const {
RunMode: l1IilII,
UserMode: il11iiIl,
baseCommonEnv: l1l11I1l,
baseCommonEnvKey: iIIiIil
} = require("./bear");
l1l11I1l.inviteNum = parseInt(process.env.B_WX_OPENCARD_INVITE_NUM || 100);
l1l11I1l.leaderNum = parseInt(process.env.B_WX_OPENCARD_LEADER_NUM || 1);
l1l11I1l.viewShop = parseInt(process.env.B_WX_OPENCARD_VIEW_SHOP || 0);
l1l11I1l.addSku = parseInt(process.env.B_WX_OPENCARD_ADD_SKU || 0);
iIIiIil.B_WX_OPENCARD_INVITE_NUM = "inviteNum";
iIIiIil.B_WX_OPENCARD_LEADER_NUM = "leaderNum";
iIIiIil.B_WX_OPENCARD_VIEW_SHOP = "viewShop";
iIIiIil.B_WX_OPENCARD_ADD_SKU = "addSku";
l1IilII.envInfo = {
"name": "通用开卡beta",
"runName": "jd_wx_opencard",
"version": "2.0.2"
};
class I1IiiIil extends il11iiIl {
constructor(ilIIiil1, liIIIiil) {
super(ilIIiil1, liIIIiil);
this.pinImg = "https://img10.360buyimg.com/imgzone/jfs/t1/21383/2/6633/3879/5c5138d8E0967ccf2/91da57c5e2166005.jpg";
this.viewShop = true;
}
async ["writeLongCache"]() {
this.writeFileSyncByLock("cache", this.activityId, this.pin);
}
async ["checkOpenCard"](ii1II1II = false) {
this.debug({
"activityId": this.activityId,
"pin": this.secretPin,
"actorUuid": this.shareUuid,
"shareUuid": this.toHelpUser?.["shareUuid"] || ""
});
let i1iI1lI = await this.wxApi("dingzhi/shop/league/checkOpenCard", {
"activityId": this.activityId,
"pin": this.secretPin,
"actorUuid": this.shareUuid,
"shareUuid": this.toHelpUser?.["shareUuid"] || ""
});
this.debug(i1iI1lI);
if (!i1iI1lI || !i1iI1lI.result) {
this.putMsg(i1iI1lI?.["errorMessage"]);
this.wxStop(i1iI1lI?.["errorMessage"]);
return;
}
let iIilili = i1iI1lI.data.allOpenCard,
IIll1iil = i1iI1lI.data.assistStatus,
II1lIlIi = i1iI1lI.data.sendBeanNum;
this.debug("----", II1lIlIi);
if (iIilili) {
this.log("已完成全部开卡");
}
if (this.toHelpUser?.["shareUuid"] && ii1II1II) switch (IIll1iil) {
case 0:
break;
case 1:
this.toHelpUser.helpedCount++, this.toHelpUser.helpedCount >= il11iiIl.activity.maxHelpCount && (this.toHelpUser.needHelp = false), this.log("助力成功,已邀请" + this.toHelpUser.helpedCount + "人");
break;
case 2:
this.log("您已经为该好友助力过了!");
break;
case 3:
this.log("您已经为其他好友助力过了!");
break;
case 11:
this.log("今日助力次数已达上限,无法继续为他助力!");
break;
case 12:
this.log("您活动期间助力次数已达上限,无法继续助力!");
break;
case 21:
this.log("您还不是会员,无法为好友助力!");
break;
case 22:
this.log("需要关注店铺及成为全部品牌会员并且有新会员,才能助力成功哦~");
break;
case 88:
this.log("需要关注店铺及成为全部品牌会员并且有新会员,才能助力成功哦~");
break;
case 66:
break;
case 99:
switch (i1iI1lI.shareType) {
case 2:
this.log("您需要完成全部开卡才能为好友助力");
break;
case 5:
this.log("您需要完成任意一组开卡,并关注店铺才能为好友助力");
break;
case 6:
this.log("您的好友邀请您为TA助力您关注店铺和品牌全部开卡后即为好友助力成功");
break;
default:
break;
}
break;
}
return i1iI1lI.data.cardList.filter(l1lIIilI => !l1lIIilI.status);
}
async ["assist"](lI11iIii = false) {
let Ii1Ilil1 = await this.wxApi("dingzhi/joinCommon/assist", {
"activityId": this.activityId,
"pin": this.secretPin,
"uuid": this.shareUuid,
"shareUuid": this.toHelpUser?.["shareUuid"] || ""
});
this.debug(Ii1Ilil1);
let iiiil1I1 = Ii1Ilil1?.["data"]?.["assistState"],
lI1I1lI = Ii1Ilil1?.["data"]?.["openCardInfo"]?.["openAll"];
lI1I1lI && this.log("已完成全部开卡");
if (this.toHelpUser?.["shareUuid"]) switch (iiiil1I1) {
case 0:
this.log("无法助力自己");
break;
case 1:
this.toHelpUser.helpedCount++, this.toHelpUser.helpedCount >= il11iiIl.activity.maxHelpCount && (this.toHelpUser.needHelp = false), this.log("助力成功,已邀请" + this.toHelpUser.helpedCount + "人");
break;
case 2:
this.log("已经助力过了");
break;
case 3:
this.log("没有助力次数了");
break;
case 10:
this.log("您已为好友助力过了哦");
break;
case 11:
this.log("您已成功为好友助力了,不能再为其他好友助力了");
break;
case 20:
this.log("您需注册会员,才能为好友助力!");
break;
case 21:
this.log("您需注册会员并关注店铺,才能为好友助力!");
break;
case 22:
this.log("您需注关注店铺,才能为好友助力!");
break;
case 77:
this.log("未全部开卡和关注,不能助力");
break;
case 78:
this.log("已经是老会员,不能助力");
break;
default:
this.log("未知状态");
break;
}
return Ii1Ilil1.data?.["openCardInfo"]["openVenderId"] || [];
}
async ["getActivityContent"]() {
let ll1iIi1I = "";
if (this.domain.includes("lzdz-isv")) {
let iliIIIil = await this.wxApi("dingzhi/taskact/common/init", {
"activityId": this.activityId,
"dzActivityType": 0,
"pin": "",
"adSource": ""
});
if (!iliIIIil || !iliIIIil.result) {
this.putMsg(iliIIIil?.["errorMessage"]);
this.wxStop(iliIIIil?.["errorMessage"]);
return;
}
let l1ll1iIl = iliIIIil?.["data"]?.["startTime"],
IlIIIIl1 = iliIIIil?.["data"]?.["endTime"];
if (l1ll1iIl && this.timestamp() < l1ll1iIl) {
this.putMsg("活动未开始");
this.stop();
return;
}
if (IlIIIIl1 && this.timestamp() > IlIIIIl1) {
this.putMsg("活动已结束");
this.stop();
return;
}
ll1iIi1I = await this.wxApi("dingzhi/uinion/plus2505/activityContent", {
"activityId": this.activityId,
"nick": this.nickname,
"pinImg": this.pinImg,
"pin": this.secretPin,
"shareUuid": this.toHelpUser?.["shareUuid"] || ""
});
let IIlI1lIi = ll1iIi1I?.["data"]?.["vipPrize"] ?? [];
if (IIlI1lIi.length > 0) {
let l1liil11 = [];
for (let Ill11lii of IIlI1lIi) {
let {
bean = 0,
score = 0
} = Ill11lii;
if (bean) l1liil11.push(bean + "京豆");
if (score) l1liil11.push(score + "金币");
}
this.log("获得入会奖励:" + l1liil11.join(","));
}
} else {
if (this.activityUrl.includes("/m/unite/") || this.activityUrl.includes("joinCommon")) {
let ilIIliII = await this.wxApi("dingzhi/taskact/common/init", {
"activityId": this.activityId,
"dzActivityType": 1,
"pin": ""
});
this.debug(ilIIliII);
if (!ilIIliII || !ilIIliII.result) {
this.putMsg(ilIIliII?.["errorMessage"]);
this.wxStop(ilIIliII?.["errorMessage"]);
return;
}
let Ilililil = ilIIliII?.["data"]?.["startTime"],
illIIii1 = ilIIliII?.["data"]?.["endTime"];
if (Ilililil && this.timestamp() < Ilililil) {
this.putMsg("活动未开始");
this.stop();
return;
}
if (illIIii1 && this.timestamp() > illIIii1) {
this.putMsg("活动已结束");
this.stop();
return;
}
ll1iIi1I = await this.wxApi("dingzhi/joinCommon/activityContent", {
"activityId": this.activityId,
"nick": this.nickname,
"pinImg": this.pinImg,
"pin": this.secretPin,
"shareUuid": this.toHelpUser?.["shareUuid"] || ""
});
this.debug(ll1iIi1I);
} else this.activityUrl.includes("shop") ? (ll1iIi1I = await this.wxApi("dingzhi/shop/league/activityContent", {
"activityId": this.activityId,
"nick": this.nickname,
"pinImg": this.pinImg,
"pin": this.secretPin,
"shareUuid": this.toHelpUser?.["shareUuid"] || ""
}), this.debug(ll1iIi1I)) : (await this.getOpenCardPath(), this.debug("dingzhi/" + this.pathType + "/union/activityContent"), ll1iIi1I = await this.wxApi("dingzhi/" + this.pathType + "/union/activityContent", {
"activityId": this.activityId,
"nick": this.nickname,
"pinImg": this.pinImg,
"pin": this.secretPin,
"shareUuid": this.toHelpUser?.["shareUuid"] || ""
}));
}
return ll1iIi1I;
}
async ["getOpenCardPath"]() {
if (il11iiIl.activity.pathType) return this.pathType = il11iiIl.activity.pathType;
let iiIii1Il = await this.taskGet(this.activityUrl);
const liIIillI = this.textToHtml(iiIii1Il);
let iilill1i = "";
liIIillI("script[src]").each((i1Iii1I1, i1I1lli1) => {
const iiIl1Ii = liIIillI(i1I1lli1).attr("src");
let i1i1II1l = iiIl1Ii.match(/\/\/.*\/js\/index\.\w+\.js/);
i1i1II1l && i1i1II1l.length > 0 && (iilill1i = i1i1II1l[0]);
});
let ll1IllII = await this.request({
"url": "https:" + iilill1i
}),
Iiiiili1 = ll1IllII?.["data"]?.["match"](/dingzhi\/([a-zA-Z]+)\/union\/saveTask/);
if (Iiiiili1 && Iiiiili1.length > 1) {
il11iiIl.activity.pathType = Iiiiili1[1];
this.pathType = Iiiiili1[1];
return;
}
return this.log("未匹配到路径"), this.stop();
}
async ["initOpenCard"](l1iilIi1 = false) {
let lliI11II = await this.wxApi("dingzhi/" + this.pathType + "/union/initOpenCard", {
"activityId": this.activityId,
"pin": this.secretPin,
"actorUuid": this.shareUuid,
"shareUuid": this.toHelpUser?.["shareUuid"] || ""
});
this.debug(lliI11II);
let Il11lill = lliI11II?.["data"]?.["allOpenCard"],
lliiII1i = lliI11II?.["data"]?.["assistStatus"],
Illl1liI = lliI11II?.["data"]?.["openCardBeans"];
Illl1liI > 0 && this.log("开卡获得京豆: " + Illl1liI);
Il11lill && this.log("已完成全部开卡");
if (this.toHelpUser?.["shareUuid"]) {
switch (lliiII1i) {
case 0:
this.log("无法助力自己");
break;
case 1:
this.toHelpUser.helpedCount++, this.toHelpUser.helpedCount >= il11iiIl.activity.maxHelpCount && (this.toHelpUser.needHelp = false), this.log("助力成功,已邀请" + this.toHelpUser.helpedCount + "人");
break;
case 2:
this.log("已经助力过了");
break;
case 3:
this.log("没有助力次数了");
break;
case 10:
this.log("您已为好友助力过了哦");
break;
case 11:
this.log("您已成功为好友助力了,不能再为其他好友助力了");
break;
case 20:
this.log("您需注册会员,才能为好友助力!");
break;
case 21:
this.log("您需注册会员并关注店铺,才能为好友助力!");
break;
case 22:
this.log("您需注关注店铺,才能为好友助力!");
break;
case 77:
this.log("未全部开卡和关注,不能助力");
break;
case 78:
this.log("已经是老会员,不能助力");
break;
default:
this.log("未知状态");
break;
}
}
return lliI11II?.["data"]?.["openInfo"] || [];
}
async ["task"]() {
if (this.domain.includes("lzdz-isv")) {
let ll11i1lI = this.activityContent.data.vipList ?? [],
lIIil1ii = this.activityContent.data.venderList?.["filter"](IilliiI1 => !ll11i1lI.includes(IilliiI1.venderId));
if (lIIil1ii.length === 0) return this.log("已全部开卡");
for (let IIiilII1 of lIIil1ii) {
await this.bindWithVender(IIiilII1.venderId || IIiilII1.shopId);
await this.sleep(500, 1000);
}
await this.getActivityContent();
return;
}
if (this.activityUrl.includes("shop")) {
for (let i1ll1li1 in this.activityContent.data) {
if (this.activityContent.data[i1ll1li1]?.["allStatus"]) continue;
switch (i1ll1li1) {
case "followShop":
await this.wxApi("dingzhi/shop/league/saveTask", {
"activityId": this.activityId,
"pin": this.secretPin,
"actorUuid": this.shareUuid,
"taskType": 1,
"taskValue": 1,
"shareUuid": this.toHelpUser?.["shareUuid"] || ""
});
break;
case "addSku":
await this.wxApi("dingzhi/shop/league/saveTask", {
"activityId": this.activityId,
"pin": this.secretPin,
"actorUuid": this.shareUuid,
"taskType": 2,
"taskValue": 2,
"shareUuid": this.toHelpUser?.["shareUuid"] || ""
});
break;
case "mainActive":
break;
}
}
let iliIlll = await this.checkOpenCard();
for (let lIlIll1l of iliIlll) {
await this.bindWithVender(lIlIll1l.value || lIlIll1l.value2);
await this.sleep(500, 1000);
}
iliIlll?.["length"] > 0 && (await this.checkOpenCard(true));
} else {
if (this.activityUrl.includes("/m/unite/") || this.activityUrl.includes("joinCommon")) {
let ii11l1ii = await this.wxApi("dingzhi/joinCommon/taskInfo", {
"activityId": this.activityId,
"pin": this.secretPin,
"uuid": this.shareUuid,
"shareUuid": this.toHelpUser?.["shareUuid"] || ""
}),
lIIi11II = await this.wxApi("dingzhi/joinCommon/taskRecord", {
"activityId": this.activityId,
"pin": this.secretPin,
"uuid": this.shareUuid,
"shareUuid": this.toHelpUser?.["shareUuid"] || "",
"taskType": ""
});
this.debug(lIIi11II);
for (let liiliilI in lIIi11II?.["data"] || {}) {
if (liiliilI === "1") continue;
if (lIIi11II.data[liiliilI]?.["recordCount"] > 0) continue;
if (["20", "23", "24"].includes(liiliilI)) {
let iii1ll11 = await this.wxApi("dingzhi/joinCommon/doTask", {
"activityId": this.activityId,
"pin": this.secretPin,
"uuid": this.shareUuid,
"shareUuid": this.toHelpUser?.["shareUuid"] || "",
"taskType": liiliilI,
"taskValue": ""
});
this.debug(iii1ll11);
}
}
let IlIIIlIl = ii11l1ii?.["data"]?.[1]?.["settingInfo"]["map"](liiIliI => parseInt(liiIliI.value)) || [],
l1lllilI = (await this.assist()).map(lii1ilii => parseInt(lii1ilii));
IlIIIlIl = this.different(IlIIIlIl, l1lllilI);
for (let iiil1111 of IlIIIlIl) {
await this.bindWithVender(iiil1111);
await this.sleep(50, 500);
}
IlIIIlIl?.["length"] > 0 && (await this.assist(true));
} else {
let I1I1iliI = await this.initOpenCard();
for (let I1IlIi of I1I1iliI) {
!I1IlIi?.["followShopStatus"] && (await this.wxApi("dingzhi/" + this.pathType + "/union/saveTask", {
"activityId": this.activityId,
"pin": this.secretPin,
"actorUuid": this.shareUuid,
"taskType": 1,
"taskValue": I1IlIi.venderId,
"shareUuid": this.toHelpUser?.["shareUuid"] || ""
}));
!I1IlIi?.["openStatus"] && (await this.bindWithVender(I1IlIi.venderId));
}
I1I1iliI?.["length"] > 0 && (await this.initOpenCard(true));
}
}
}
["mpdzSign"](i11l1lii) {
let lI111i1l = "6cc5dbd8900e434b94c4bdb0c16348ed",
I11iIIII = "c1614da9ac68",
l1lIiIii = this.timestamp(),
l11Ii1iI = "f" + I11iIIII + "D" + JSON.stringify(i11l1lii) + "c" + l1lIiIii + lI111i1l,
lli1II = this.md5(l11Ii1iI.toLowerCase());
return {
"sign": lli1II,
"timeStamp": l1lIiIii
};
}
["jgcqdm"](I1lIIIi, Il1lIill) {
let I11ili11 = {
"actId": this.activityId,
...Il1lIill,
"method": I1lIIIi.replace("dm/front", ""),
"userId": this.userId,
"buyerNick": this.buyerNick || ""
},
IlII1Ill = this.mpdzSign(I11ili11);
return {
"jsonRpc": "2.0",
"params": {
"commonParameter": {
"m": "POST",
"oba": IlII1Ill.sign,
"timestamp": IlII1Ill.timeStamp,
"userId": this.userId
},
"admJson": I11ili11
}
};
}
async ["mpdzTask"](I1IIIlIl, Iliii11I = {}) {
let lIllIil = I1IIIlIl.replace("dm/front", "").replace("//", "/");
return await this.taskPostByJson(I1IIIlIl + "?open_id=&mix_nick=" + (this.buyerNick ?? "") + "&user_id=10299171", this.jgcqdm(lIllIil, Iliii11I));
}
async ["load"]() {
let IIll1Ill = await this.mpdzTask("dm/front/jdJoinCardtf/activity/load", {
"jdToken": this.isvToken,
"source": "01",
"inviteNick": this.toHelpUser?.["buyerNick"] || ""
});
this.debug(IIll1Ill);
if (!IIll1Ill || !IIll1Ill.success || IIll1Ill.data.status !== 200) return this.putMsg(IIll1Ill?.["errorMessage"]), this.wxStop(IIll1Ill?.["errorMessage"]), this.index === 0 && this.stop(), this.exit();
this.buyerNick = IIll1Ill.data.data.missionCustomer.buyerNick;
if (!this.buyerNick) {
return this.index === 0 && (this.putMsg("无法获取到buyerNick"), this.stop()), this.log("黑号,跳过"), this.exit();
}
let lIliiiil = IIll1Ill.data.data.cusActivity.startTime,
lli11lI1 = IIll1Ill.data.data.cusActivity.endTime;
if (lIliiiil && this.timestamp() < lIliiiil) {
this.putMsg("活动未开始");
this.stop();
return;
}
if (lli11lI1 && this.timestamp() > lli11lI1) {
this.putMsg("活动已结束");
this.stop();
return;
}
!this.isInviter && l1l11I1l.viewShop !== 1 && l1l11I1l.addSku !== 1 && (await this.inviteRelation());
if (IIll1Ill.data.data?.["missionCustomer"]?.["hasAddCart"] === 0 && l1l11I1l.viewShop !== 1 && l1l11I1l.addSku === 1) {
let l1Illlii = await this.mpdzTask("dm/front/jdJoinCardtf/mission/completeMission", {
"missionType": "uniteAddCart"
});
this.log(l1Illlii?.["data"]?.["data"]?.["remark"] || l1Illlii.errorMessage || "已完成加购任务");
}
if (IIll1Ill.data?.["data"]?.["missionCustomer"]?.["hasCollectShop"] === 0 && l1l11I1l.viewShop !== 1) {
let li1Iili1 = await this.mpdzTask("dm/front/jdJoinCardtf/mission/completeMission", {
"missionType": "uniteCollectShop"
});
this.log(li1Iili1?.["data"]?.["data"]?.["remark"] || li1Iili1.errorMessage || "已完成关注店铺任务");
}
let lil1llIi = await this.mpdzTask("dm/front/jdJoinCardtf/shop/shopList");
this.debug(lil1llIi);
let i111iII = lil1llIi?.["data"]?.["data"] || [];
if (l1l11I1l.viewShop === 1 || l1l11I1l.viewShop === 2) {
for (let iill1II of i111iII) {
let lIlll1il = await this.mpdzTask("dm/front/jdJoinCardtf/mission/completeMission", {
"missionType": "viewShop",
"goodsNumId": iill1II.userId
});
this.log(lIlll1il?.["data"]?.["data"]?.["remark"] || lIlll1il.errorMessage);
await this.sleep(800, 1200);
}
}
if (l1l11I1l.viewShop === 1 || l1l11I1l.addSku === 1) return;
i111iII = lil1llIi?.["data"]?.["data"]?.["filter"](IlIl1I1l => !IlIl1I1l.open) || [];
for (let l1Iii1il of i111iII) {
let iiii1Iil = await this.mpdzTask("dm/front/jdJoinCardtf/mission/completeMission", {
"missionType": "openCard",
"shopId": l1Iii1il.userId
});
this.log(iiii1Iil?.["data"]?.["data"]?.["remark"] || iiii1Iil.errorMessage);
let iIi1iil1 = this.getQueryString(l1Iii1il?.["openCardUrl"] || "", "venderId") || l1Iii1il.userId || l1Iii1il.shopId;
await this.bindWithVender(iIi1iil1);
if (this.canNotOpenCard) this.log("不能开卡", iIi1iil1), this.exit();
await this.sleep(500, 1000);
await await this.mpdzTask("dm/front/jdJoinCardtf/activity/load", {
"jdToken": this.isvToken,
"source": "01",
"inviteNick": this.toHelpUser?.["buyerNick"] || "",
"shopId": l1Iii1il.userId
});
}
}
async ["inviteRelation"]() {
let I1iiIII = {
"inviterNick": this.toHelpUser?.["buyerNick"] || ""
},
liiiIlI1 = this.jgcqdm("/jdJoinCardtf/customer/inviteRelation", I1iiIII),
liiilIII = await this.taskPostByJson("dm/front/jdJoinCardtf/customer/inviteRelation?open_id=&mix_nick=" + (this.buyerNick ?? "") + "&user_id=10299171", liiiIlI1);
this.debug(liiilIII);
if (!liiilIII || !liiilIII.success || liiilIII.data.status !== 200) return this.putMsg(liiilIII?.["errorMessage"]), this.wxStop(liiilIII?.["errorMessage"]), this.exit();
this.log(liiilIII.data.msg || "绑定邀请成功");
this.toHelpUser.helpedCount++;
this.toHelpUser.helpedCount >= il11iiIl.activity.maxHelpCount && (this.toHelpUser.needHelp = false);
}
async ["getszxyunActid"]() {
if (il11iiIl.activity.activityId) return this.activityId = il11iiIl.activity.activityId;
let Iililiii = await this.taskGet(this.activityUrl);
const l1illiI1 = this.textToHtml(Iililiii);
let ll1llIi = "";
l1illiI1("script[src]").each((lli1l1lI, illlllI) => {
const iIII1II = l1illiI1(illlllI).attr("src");
let iIlIllll = iIII1II.match(/\/\/.*\/js\/app\.\w+\.js/);
iIlIllll && iIlIllll.length > 0 && (ll1llIi = iIlIllll[0]);
});
let lIllI1 = await this.request({
"url": "https:" + ll1llIi
}),
ilIll1iI = lIllI1?.["data"]?.["match"](/unionOpen\w*\"/g);
if (ilIll1iI && ilIll1iI.length > 0) {
let ilillIl1 = ilIll1iI[0].replace("\"", "");
il11iiIl.activity.activityId = ilillIl1;
this.activityId = ilillIl1;
return;
}
return this.putMsg("未匹配到活动id"), this.stop();
}
async ["szxyunLogin"]() {
let i1IiI1Il = await this.taskPostByJson("webc/login/userLogin", {
"shopId": "1000100710",
"token": this.isvToken,
"source": "01"
});
if (!i1IiI1Il || i1IiI1Il.code !== "200") {
return this.putMsg(i1IiI1Il.message || "登录失败"), this.wxStop(i1IiI1Il.message || "登录失败"), this.exit();
}
this.otherHeaders = {
"jd-fast-token": i1IiI1Il.data
};
}
async ["active"](ill1liiI = false) {
let iiili11i = await this.taskPostByJson("webc/unionOpen/active", {
"activeId": this.activityId,
"shareId": null
});
this.debug(iiili11i);
if (!iiili11i || iiili11i.code !== "200") {
return this.putMsg(iiili11i.message || "获取活动详情失败"), this.wxStop(iiili11i.message || "获取活动详情失败"), this.exit();
}
if (ill1liiI) {
iiili11i.data?.["showBeanList"] && iiili11i.data?.["showBeanList"]["length"] > 0 && this.log("获得:", iiili11i.data?.["showBeanList"][0]?.["sendNum"] + "京豆");
return;
}
this.shareUuid = iiili11i.data?.["userVO"]?.["joinId"];
this.helpedCount = iiili11i.data?.["userVO"]?.["points"];
this.log("助力码: " + this.shareUuid);
this.log("已邀请: " + this.helpedCount);
if (this.isInviter) il11iiIl.activity.maxHelpCount = l1l11I1l.inviteNum;
let l1iIiI1i = iiili11i.data?.["bindCardInfo"] ?? [];
l1iIiI1i = l1iIiI1i.filter(I1lI1i11 => !I1lI1i11.isBindCard);
for (let iIili11i of l1iIiI1i) {
let liIlilI1 = this.getQueryString(iIili11i?.["openUrl"] || "", "venderId") ?? iIili11i?.["shopId"];
await this.bindWithVender(liIlilI1);
await this.sleep(50, 500);
}
l1iIiI1i?.["length"] > 0 && (await this.active(true));
}
async ["szyunShare"]() {
let ili1i = await this.taskPostByJson("webc/unionOpen/share", {
"activeId": this.activityId,
"joinId": this.shareUuid || "",
"shareId": this.toHelpUser?.["shareUuid"] || ""
});
this.debug(ili1i);
if (!ili1i || ili1i.code !== "200") return this.putMsg(ili1i.message || "助力失败"), this.wxStop(ili1i.message || "助力失败"), this.exit();
let li1lIIiI = ili1i.data?.["helpStatus"];
switch (li1lIIiI) {
case 1:
this.toHelpUser.helpedCount++, this.toHelpUser.helpedCount >= il11iiIl.activity.maxHelpCount && (this.toHelpUser.needHelp = false), this.log("助力成功,已邀请" + this.toHelpUser.helpedCount + "人");
break;
case 2:
this.log("已经助力过了");
break;
case 3:
this.log("已为他人助力");
break;
case 4:
this.log("发起人助力到达限制");
break;
case 5:
this.log("发起人助力数达到上限");
break;
default:
this.log("未知状态", li1lIIiI);
break;
}
}
async ["inviteTask"](l11llII1) {
this.toHelpUser = l11llII1;
if (!this.toHelpUser.needHelp) {
return;
}
await this.isvObfuscator();
if (this.activityUrl.includes("szxyun")) {
await this.getszxyunActid();
await this.szxyunLogin();
this.debug(this.otherHeaders);
await this.active();
await this.szyunShare();
return;
}
if (this.activityUrl.includes("jinggengjcq")) {
this.activityId = this.getQueryString(this.activityUrl, "actId");
this.userId = "10299171";
await this.load();
return;
}
if (this.domain.includes("lzdz-isv")) await this.taskGet("/wxCommonInfo/token"), this.venderId = this.activityUrl.match(/\/m\/(\d+)/)[1], this.activityId = this.activityUrl.match(/\/(\d+)$/)[1];else {
await this.wxCommonInfo();
await this.getSimpleActInfoVo("dz/common/getSimpleActInfoVo");
}
if (this.activityUrl.includes("joinCommon")) {
await this.getMyPing();
} else {
await this.getMyPing("customer/getMyCidPing");
}
await this.accessLog();
let Iilili1i = await this.getActivityContent();
if (!Iilili1i || !Iilili1i.result) {
return this.putMsg(Iilili1i?.["errorMessage"]), this.wxStop(Iilili1i?.["errorMessage"]), this.exit();
}
this.activityContent = Iilili1i;
let iiIiilii = Iilili1i?.["data"]?.["actorUuid"] || Iilili1i?.["data"]?.["actorInfo"]?.["uuid"];
this.shareUuid = iiIiilii;
await this.task();
}
async ["userTask"]() {
if (this.index >= l1l11I1l.leaderNum && l1l11I1l.viewShop !== 1) return this.stop();
await this.isvObfuscator();
if (this.activityUrl.includes("szxyun")) {
await this.getszxyunActid();
this.debug("activityId:", this.activityId);
await this.szxyunLogin();
this.debug(this.otherHeaders);
await this.active();
return;
}
if (this.activityUrl.includes("jinggengjcq")) {
this.activityId = this.getQueryString(this.activityUrl, "actId");
this.userId = "10299171";
await this.load();
if (l1l11I1l.viewShop === 1) this.needHelp = false;
il11iiIl.activity.maxHelpCount = l1l11I1l.inviteNum;
this.helpedCount = 0;
return;
}
if (this.domain.includes("lzdz-isv")) await this.taskGet("/wxCommonInfo/token"), this.venderId = this.activityUrl.match(/\/m\/(\d+)/)[1], this.activityId = this.activityUrl.match(/\/(\d+)$/)[1];else {
await this.wxCommonInfo();
await this.getSimpleActInfoVo("dz/common/getSimpleActInfoVo");
}
this.activityUrl.includes("joinCommon") ? await this.getMyPing() : await this.getMyPing("customer/getMyCidPing");
await this.accessLog();
let iill1I1i = await this.getActivityContent();
if (!iill1I1i || !iill1I1i.result) return this.putMsg(iill1I1i?.["errorMessage"]), this.wxStop(iill1I1i?.["errorMessage"]), this.exit();
let iI1Ili1 = iill1I1i?.["data"]?.["startTime"],
IiIl111 = iill1I1i?.["data"]?.["endTime"];
if (iI1Ili1 && this.timestamp() < iI1Ili1) {
this.putMsg("活动未开始");
this.stop();
return;
}
if (IiIl111 && this.timestamp() > IiIl111) {
this.putMsg("活动已结束");
this.stop();
return;
}
let l1iilIlI = iill1I1i?.["data"]?.["actorUuid"] || iill1I1i?.["data"]?.["actorInfo"]?.["uuid"] || iill1I1i?.["data"]?.["userInfo"]?.["uid"];
this.shareUuid = l1iilIlI;
this.helpedCount = 0;
il11iiIl.activity.maxHelpCount = l1l11I1l.inviteNum;
this.log("助力码: " + l1iilIlI);
this.activityContent = iill1I1i;
await this.task();
}
}
l1IilII.activity = {
"activityUrl": activityUrl
};
l1IilII.TaskClass = I1IiiIil;
l1IilII.run({
"whitelist": ["1-2000"],
"main_thread": 50,
"thread": 10,
"inviteTask": true,
"noPush": true
});

776
jd_wx_opencardll.js Normal file
View File

@ -0,0 +1,776 @@
/*
通用开卡beta v2.0.2
https://lzdz1-isv.isvjcloud.com/m/1000282702/dze70dc1d244b18a194dfc8857shop
https://jinggengjcq-isv.isvjcloud.com/jdbeverage/pages/oC20240401cot/oC20240401cot?actId=8b0ef0c607f34f2ab2a7a5_240401
https://lzdz1-isv.isvjd.com/m/unite/dzlh0001/?activityId=d5412c11d735467abbfba3b3f4b319d7&venderId=1000001933&adSource=TBGFQJD
https://lzdz1-isv.isvjd.com/m/1000001683/dzb08098af8dca4bb28fce9c88b6e4/?adsource=0005
https://lzdz1-isv.isvjd.com/dingzhi/joinCommon/activity/activity?activityId=d5412c11d735467abbfba3b3f4b319d7
https://szxyun-rc.isvjcloud.com/pagec/unionOpenSHR240422/index.html
export B_WX_OPENCARD_URL=""
export B_WX_OPENCARD_INVITE_NUM=100 邀请人数
export B_WX_OPENCARD_LEADER_NUM=1 车头数量 默认值1
export B_WX_OPENCARD_VIEW_SHOP=0 0邀请 1浏览 2邀请+浏览 默认值0
export B_WX_OPENCARD_ADD_SKU=0 0不加购 1加购 默认值0
ps: 当关注和加购为1时则不会邀请 建议分身设置单独跑浏览或加购
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_OPENCARD_M_URL);
if (mode) {
activityUrl = "https://lzdz1-isv.isvjcloud.com/m/1000282702/dze70dc1d244b18a194dfc8857shop/";
activityUrl = "https://jinggengjcq-isv.isvjcloud.com/jdbeverage/pages/oC20240401cot/oC20240401cot?actId=8b0ef0c607f34f2ab2a7a5_240401";
activityUrl = "https://jinggengjcq-isv.isvjcloud.com/jdbeverage/pages/oC20240401cot/oC20240401cot?actId=c903126b617b4d8e943c82baa_240403";
activityUrl = "https://jinggengjcq-isv.isvjcloud.com/jdbeverage/pages/oC20240401cot/oC20240401cot?actId=0f03b6459c2c4333a1081be5acca7_240410";
activityUrl = "https://lzdz1-isv.isvjd.com/m/unite/dzlh0001/?activityId=d5412c11d735467abbfba3b3f4b319d7&venderId=1000001933&adSource=TBGFQJD";
activityUrl = "https://lzdz1-isv.isvjd.com/m/1000001683/dzb08098af8dca4bb28fce9c88b6e4/?adsource=0005";
activityUrl = "https://lzdz1-isv.isvjd.com/dingzhi/joinCommon/activity/activity?activityId=d5412c11d735467abbfba3b3f4b319d7";
activityUrl = "https://szxyun-rc.isvjcloud.com/pagec/unionOpenSHR240422/index.html";
activityUrl = "https://lzdz1-isv.isvjcloud.com/m/unite/dzlh0001?activityId=7940395b691b4611a4eadb59c3c8a4f6&venderId=1000003443&adSource=MJLJDZYGFQJD";
activityUrl = "https://jinggengjcq-isv.isvjcloud.com/jdbeverage/pages/oC20240410aslw/oC20240410aslw?actId=5f4d63b233744b1_240515";
activityUrl = "https://jinggengjcq-isv.isvjcloud.com/jdbeverage/pages/oC20240410aslw/oC20240410aslw?actId=42af5f29743f45e_240517";
activityUrl = "https://jinggengjcq-isv.isvjcloud.com/jdbeverage/pages/oC20240520def/oC20240520def?actId=df5b2fe59b9b453_240520";
activityUrl = "https://jinggengjcq-isv.isvjcloud.com/jdbeverage/pages/oC2024052402cxc/oC2024052402cxc?actId=0421ccc68d7c41bb_24052402";
}
const {
RunMode: l1IilII,
UserMode: il11iiIl,
baseCommonEnv: l1l11I1l,
baseCommonEnvKey: iIIiIil
} = require("./bear");
l1l11I1l.inviteNum = parseInt(process.env.B_WX_OPENCARD_INVITE_NUM || 100);
l1l11I1l.leaderNum = parseInt(process.env.B_WX_OPENCARD_LEADER_NUM || 1);
l1l11I1l.viewShop = parseInt(process.env.B_WX_OPENCARD_VIEW_SHOP || 0);
l1l11I1l.addSku = parseInt(process.env.B_WX_OPENCARD_ADD_SKU || 0);
iIIiIil.B_WX_OPENCARD_INVITE_NUM = "inviteNum";
iIIiIil.B_WX_OPENCARD_LEADER_NUM = "leaderNum";
iIIiIil.B_WX_OPENCARD_VIEW_SHOP = "viewShop";
iIIiIil.B_WX_OPENCARD_ADD_SKU = "addSku";
l1IilII.envInfo = {
"name": "通用开卡beta",
"runName": "jd_wx_opencard",
"version": "2.0.2"
};
class I1IiiIil extends il11iiIl {
constructor(ilIIiil1, liIIIiil) {
super(ilIIiil1, liIIIiil);
this.pinImg = "https://img10.360buyimg.com/imgzone/jfs/t1/21383/2/6633/3879/5c5138d8E0967ccf2/91da57c5e2166005.jpg";
this.viewShop = true;
}
async ["writeLongCache"]() {
this.writeFileSyncByLock("cache", this.activityId, this.pin);
}
async ["checkOpenCard"](ii1II1II = false) {
this.debug({
"activityId": this.activityId,
"pin": this.secretPin,
"actorUuid": this.shareUuid,
"shareUuid": this.toHelpUser?.["shareUuid"] || ""
});
let i1iI1lI = await this.wxApi("dingzhi/shop/league/checkOpenCard", {
"activityId": this.activityId,
"pin": this.secretPin,
"actorUuid": this.shareUuid,
"shareUuid": this.toHelpUser?.["shareUuid"] || ""
});
this.debug(i1iI1lI);
if (!i1iI1lI || !i1iI1lI.result) {
this.putMsg(i1iI1lI?.["errorMessage"]);
this.wxStop(i1iI1lI?.["errorMessage"]);
return;
}
let iIilili = i1iI1lI.data.allOpenCard,
IIll1iil = i1iI1lI.data.assistStatus,
II1lIlIi = i1iI1lI.data.sendBeanNum;
this.debug("----", II1lIlIi);
if (iIilili) {
this.log("已完成全部开卡");
}
if (this.toHelpUser?.["shareUuid"] && ii1II1II) switch (IIll1iil) {
case 0:
break;
case 1:
this.toHelpUser.helpedCount++, this.toHelpUser.helpedCount >= il11iiIl.activity.maxHelpCount && (this.toHelpUser.needHelp = false), this.log("助力成功,已邀请" + this.toHelpUser.helpedCount + "人");
break;
case 2:
this.log("您已经为该好友助力过了!");
break;
case 3:
this.log("您已经为其他好友助力过了!");
break;
case 11:
this.log("今日助力次数已达上限,无法继续为他助力!");
break;
case 12:
this.log("您活动期间助力次数已达上限,无法继续助力!");
break;
case 21:
this.log("您还不是会员,无法为好友助力!");
break;
case 22:
this.log("需要关注店铺及成为全部品牌会员并且有新会员,才能助力成功哦~");
break;
case 88:
this.log("需要关注店铺及成为全部品牌会员并且有新会员,才能助力成功哦~");
break;
case 66:
break;
case 99:
switch (i1iI1lI.shareType) {
case 2:
this.log("您需要完成全部开卡才能为好友助力");
break;
case 5:
this.log("您需要完成任意一组开卡,并关注店铺才能为好友助力");
break;
case 6:
this.log("您的好友邀请您为TA助力您关注店铺和品牌全部开卡后即为好友助力成功");
break;
default:
break;
}
break;
}
return i1iI1lI.data.cardList.filter(l1lIIilI => !l1lIIilI.status);
}
async ["assist"](lI11iIii = false) {
let Ii1Ilil1 = await this.wxApi("dingzhi/joinCommon/assist", {
"activityId": this.activityId,
"pin": this.secretPin,
"uuid": this.shareUuid,
"shareUuid": this.toHelpUser?.["shareUuid"] || ""
});
this.debug(Ii1Ilil1);
let iiiil1I1 = Ii1Ilil1?.["data"]?.["assistState"],
lI1I1lI = Ii1Ilil1?.["data"]?.["openCardInfo"]?.["openAll"];
lI1I1lI && this.log("已完成全部开卡");
if (this.toHelpUser?.["shareUuid"]) switch (iiiil1I1) {
case 0:
this.log("无法助力自己");
break;
case 1:
this.toHelpUser.helpedCount++, this.toHelpUser.helpedCount >= il11iiIl.activity.maxHelpCount && (this.toHelpUser.needHelp = false), this.log("助力成功,已邀请" + this.toHelpUser.helpedCount + "人");
break;
case 2:
this.log("已经助力过了");
break;
case 3:
this.log("没有助力次数了");
break;
case 10:
this.log("您已为好友助力过了哦");
break;
case 11:
this.log("您已成功为好友助力了,不能再为其他好友助力了");
break;
case 20:
this.log("您需注册会员,才能为好友助力!");
break;
case 21:
this.log("您需注册会员并关注店铺,才能为好友助力!");
break;
case 22:
this.log("您需注关注店铺,才能为好友助力!");
break;
case 77:
this.log("未全部开卡和关注,不能助力");
break;
case 78:
this.log("已经是老会员,不能助力");
break;
default:
this.log("未知状态");
break;
}
return Ii1Ilil1.data?.["openCardInfo"]["openVenderId"] || [];
}
async ["getActivityContent"]() {
let ll1iIi1I = "";
if (this.domain.includes("lzdz-isv")) {
let iliIIIil = await this.wxApi("dingzhi/taskact/common/init", {
"activityId": this.activityId,
"dzActivityType": 0,
"pin": "",
"adSource": ""
});
if (!iliIIIil || !iliIIIil.result) {
this.putMsg(iliIIIil?.["errorMessage"]);
this.wxStop(iliIIIil?.["errorMessage"]);
return;
}
let l1ll1iIl = iliIIIil?.["data"]?.["startTime"],
IlIIIIl1 = iliIIIil?.["data"]?.["endTime"];
if (l1ll1iIl && this.timestamp() < l1ll1iIl) {
this.putMsg("活动未开始");
this.stop();
return;
}
if (IlIIIIl1 && this.timestamp() > IlIIIIl1) {
this.putMsg("活动已结束");
this.stop();
return;
}
ll1iIi1I = await this.wxApi("dingzhi/uinion/plus2505/activityContent", {
"activityId": this.activityId,
"nick": this.nickname,
"pinImg": this.pinImg,
"pin": this.secretPin,
"shareUuid": this.toHelpUser?.["shareUuid"] || ""
});
let IIlI1lIi = ll1iIi1I?.["data"]?.["vipPrize"] ?? [];
if (IIlI1lIi.length > 0) {
let l1liil11 = [];
for (let Ill11lii of IIlI1lIi) {
let {
bean = 0,
score = 0
} = Ill11lii;
if (bean) l1liil11.push(bean + "京豆");
if (score) l1liil11.push(score + "金币");
}
this.log("获得入会奖励:" + l1liil11.join(","));
}
} else {
if (this.activityUrl.includes("/m/unite/") || this.activityUrl.includes("joinCommon")) {
let ilIIliII = await this.wxApi("dingzhi/taskact/common/init", {
"activityId": this.activityId,
"dzActivityType": 1,
"pin": ""
});
this.debug(ilIIliII);
if (!ilIIliII || !ilIIliII.result) {
this.putMsg(ilIIliII?.["errorMessage"]);
this.wxStop(ilIIliII?.["errorMessage"]);
return;
}
let Ilililil = ilIIliII?.["data"]?.["startTime"],
illIIii1 = ilIIliII?.["data"]?.["endTime"];
if (Ilililil && this.timestamp() < Ilililil) {
this.putMsg("活动未开始");
this.stop();
return;
}
if (illIIii1 && this.timestamp() > illIIii1) {
this.putMsg("活动已结束");
this.stop();
return;
}
ll1iIi1I = await this.wxApi("dingzhi/joinCommon/activityContent", {
"activityId": this.activityId,
"nick": this.nickname,
"pinImg": this.pinImg,
"pin": this.secretPin,
"shareUuid": this.toHelpUser?.["shareUuid"] || ""
});
this.debug(ll1iIi1I);
} else this.activityUrl.includes("shop") ? (ll1iIi1I = await this.wxApi("dingzhi/shop/league/activityContent", {
"activityId": this.activityId,
"nick": this.nickname,
"pinImg": this.pinImg,
"pin": this.secretPin,
"shareUuid": this.toHelpUser?.["shareUuid"] || ""
}), this.debug(ll1iIi1I)) : (await this.getOpenCardPath(), this.debug("dingzhi/" + this.pathType + "/union/activityContent"), ll1iIi1I = await this.wxApi("dingzhi/" + this.pathType + "/union/activityContent", {
"activityId": this.activityId,
"nick": this.nickname,
"pinImg": this.pinImg,
"pin": this.secretPin,
"shareUuid": this.toHelpUser?.["shareUuid"] || ""
}));
}
return ll1iIi1I;
}
async ["getOpenCardPath"]() {
if (il11iiIl.activity.pathType) return this.pathType = il11iiIl.activity.pathType;
let iiIii1Il = await this.taskGet(this.activityUrl);
const liIIillI = this.textToHtml(iiIii1Il);
let iilill1i = "";
liIIillI("script[src]").each((i1Iii1I1, i1I1lli1) => {
const iiIl1Ii = liIIillI(i1I1lli1).attr("src");
let i1i1II1l = iiIl1Ii.match(/\/\/.*\/js\/index\.\w+\.js/);
i1i1II1l && i1i1II1l.length > 0 && (iilill1i = i1i1II1l[0]);
});
let ll1IllII = await this.request({
"url": "https:" + iilill1i
}),
Iiiiili1 = ll1IllII?.["data"]?.["match"](/dingzhi\/([a-zA-Z]+)\/union\/saveTask/);
if (Iiiiili1 && Iiiiili1.length > 1) {
il11iiIl.activity.pathType = Iiiiili1[1];
this.pathType = Iiiiili1[1];
return;
}
return this.log("未匹配到路径"), this.stop();
}
async ["initOpenCard"](l1iilIi1 = false) {
let lliI11II = await this.wxApi("dingzhi/" + this.pathType + "/union/initOpenCard", {
"activityId": this.activityId,
"pin": this.secretPin,
"actorUuid": this.shareUuid,
"shareUuid": this.toHelpUser?.["shareUuid"] || ""
});
this.debug(lliI11II);
let Il11lill = lliI11II?.["data"]?.["allOpenCard"],
lliiII1i = lliI11II?.["data"]?.["assistStatus"],
Illl1liI = lliI11II?.["data"]?.["openCardBeans"];
Illl1liI > 0 && this.log("开卡获得京豆: " + Illl1liI);
Il11lill && this.log("已完成全部开卡");
if (this.toHelpUser?.["shareUuid"]) {
switch (lliiII1i) {
case 0:
this.log("无法助力自己");
break;
case 1:
this.toHelpUser.helpedCount++, this.toHelpUser.helpedCount >= il11iiIl.activity.maxHelpCount && (this.toHelpUser.needHelp = false), this.log("助力成功,已邀请" + this.toHelpUser.helpedCount + "人");
break;
case 2:
this.log("已经助力过了");
break;
case 3:
this.log("没有助力次数了");
break;
case 10:
this.log("您已为好友助力过了哦");
break;
case 11:
this.log("您已成功为好友助力了,不能再为其他好友助力了");
break;
case 20:
this.log("您需注册会员,才能为好友助力!");
break;
case 21:
this.log("您需注册会员并关注店铺,才能为好友助力!");
break;
case 22:
this.log("您需注关注店铺,才能为好友助力!");
break;
case 77:
this.log("未全部开卡和关注,不能助力");
break;
case 78:
this.log("已经是老会员,不能助力");
break;
default:
this.log("未知状态");
break;
}
}
return lliI11II?.["data"]?.["openInfo"] || [];
}
async ["task"]() {
if (this.domain.includes("lzdz-isv")) {
let ll11i1lI = this.activityContent.data.vipList ?? [],
lIIil1ii = this.activityContent.data.venderList?.["filter"](IilliiI1 => !ll11i1lI.includes(IilliiI1.venderId));
if (lIIil1ii.length === 0) return this.log("已全部开卡");
for (let IIiilII1 of lIIil1ii) {
await this.bindWithVender(IIiilII1.venderId || IIiilII1.shopId);
await this.sleep(500, 1000);
}
await this.getActivityContent();
return;
}
if (this.activityUrl.includes("shop")) {
for (let i1ll1li1 in this.activityContent.data) {
if (this.activityContent.data[i1ll1li1]?.["allStatus"]) continue;
switch (i1ll1li1) {
case "followShop":
await this.wxApi("dingzhi/shop/league/saveTask", {
"activityId": this.activityId,
"pin": this.secretPin,
"actorUuid": this.shareUuid,
"taskType": 1,
"taskValue": 1,
"shareUuid": this.toHelpUser?.["shareUuid"] || ""
});
break;
case "addSku":
await this.wxApi("dingzhi/shop/league/saveTask", {
"activityId": this.activityId,
"pin": this.secretPin,
"actorUuid": this.shareUuid,
"taskType": 2,
"taskValue": 2,
"shareUuid": this.toHelpUser?.["shareUuid"] || ""
});
break;
case "mainActive":
break;
}
}
let iliIlll = await this.checkOpenCard();
for (let lIlIll1l of iliIlll) {
await this.bindWithVender(lIlIll1l.value || lIlIll1l.value2);
await this.sleep(500, 1000);
}
iliIlll?.["length"] > 0 && (await this.checkOpenCard(true));
} else {
if (this.activityUrl.includes("/m/unite/") || this.activityUrl.includes("joinCommon")) {
let ii11l1ii = await this.wxApi("dingzhi/joinCommon/taskInfo", {
"activityId": this.activityId,
"pin": this.secretPin,
"uuid": this.shareUuid,
"shareUuid": this.toHelpUser?.["shareUuid"] || ""
}),
lIIi11II = await this.wxApi("dingzhi/joinCommon/taskRecord", {
"activityId": this.activityId,
"pin": this.secretPin,
"uuid": this.shareUuid,
"shareUuid": this.toHelpUser?.["shareUuid"] || "",
"taskType": ""
});
this.debug(lIIi11II);
for (let liiliilI in lIIi11II?.["data"] || {}) {
if (liiliilI === "1") continue;
if (lIIi11II.data[liiliilI]?.["recordCount"] > 0) continue;
if (["20", "23", "24"].includes(liiliilI)) {
let iii1ll11 = await this.wxApi("dingzhi/joinCommon/doTask", {
"activityId": this.activityId,
"pin": this.secretPin,
"uuid": this.shareUuid,
"shareUuid": this.toHelpUser?.["shareUuid"] || "",
"taskType": liiliilI,
"taskValue": ""
});
this.debug(iii1ll11);
}
}
let IlIIIlIl = ii11l1ii?.["data"]?.[1]?.["settingInfo"]["map"](liiIliI => parseInt(liiIliI.value)) || [],
l1lllilI = (await this.assist()).map(lii1ilii => parseInt(lii1ilii));
IlIIIlIl = this.different(IlIIIlIl, l1lllilI);
for (let iiil1111 of IlIIIlIl) {
await this.bindWithVender(iiil1111);
await this.sleep(50, 500);
}
IlIIIlIl?.["length"] > 0 && (await this.assist(true));
} else {
let I1I1iliI = await this.initOpenCard();
for (let I1IlIi of I1I1iliI) {
!I1IlIi?.["followShopStatus"] && (await this.wxApi("dingzhi/" + this.pathType + "/union/saveTask", {
"activityId": this.activityId,
"pin": this.secretPin,
"actorUuid": this.shareUuid,
"taskType": 1,
"taskValue": I1IlIi.venderId,
"shareUuid": this.toHelpUser?.["shareUuid"] || ""
}));
!I1IlIi?.["openStatus"] && (await this.bindWithVender(I1IlIi.venderId));
}
I1I1iliI?.["length"] > 0 && (await this.initOpenCard(true));
}
}
}
["mpdzSign"](i11l1lii) {
let lI111i1l = "6cc5dbd8900e434b94c4bdb0c16348ed",
I11iIIII = "c1614da9ac68",
l1lIiIii = this.timestamp(),
l11Ii1iI = "f" + I11iIIII + "D" + JSON.stringify(i11l1lii) + "c" + l1lIiIii + lI111i1l,
lli1II = this.md5(l11Ii1iI.toLowerCase());
return {
"sign": lli1II,
"timeStamp": l1lIiIii
};
}
["jgcqdm"](I1lIIIi, Il1lIill) {
let I11ili11 = {
"actId": this.activityId,
...Il1lIill,
"method": I1lIIIi.replace("dm/front", ""),
"userId": this.userId,
"buyerNick": this.buyerNick || ""
},
IlII1Ill = this.mpdzSign(I11ili11);
return {
"jsonRpc": "2.0",
"params": {
"commonParameter": {
"m": "POST",
"oba": IlII1Ill.sign,
"timestamp": IlII1Ill.timeStamp,
"userId": this.userId
},
"admJson": I11ili11
}
};
}
async ["mpdzTask"](I1IIIlIl, Iliii11I = {}) {
let lIllIil = I1IIIlIl.replace("dm/front", "").replace("//", "/");
return await this.taskPostByJson(I1IIIlIl + "?open_id=&mix_nick=" + (this.buyerNick ?? "") + "&user_id=10299171", this.jgcqdm(lIllIil, Iliii11I));
}
async ["load"]() {
let IIll1Ill = await this.mpdzTask("dm/front/jdJoinCardtf/activity/load", {
"jdToken": this.isvToken,
"source": "01",
"inviteNick": this.toHelpUser?.["buyerNick"] || ""
});
this.debug(IIll1Ill);
if (!IIll1Ill || !IIll1Ill.success || IIll1Ill.data.status !== 200) return this.putMsg(IIll1Ill?.["errorMessage"]), this.wxStop(IIll1Ill?.["errorMessage"]), this.index === 0 && this.stop(), this.exit();
this.buyerNick = IIll1Ill.data.data.missionCustomer.buyerNick;
if (!this.buyerNick) {
return this.index === 0 && (this.putMsg("无法获取到buyerNick"), this.stop()), this.log("黑号,跳过"), this.exit();
}
let lIliiiil = IIll1Ill.data.data.cusActivity.startTime,
lli11lI1 = IIll1Ill.data.data.cusActivity.endTime;
if (lIliiiil && this.timestamp() < lIliiiil) {
this.putMsg("活动未开始");
this.stop();
return;
}
if (lli11lI1 && this.timestamp() > lli11lI1) {
this.putMsg("活动已结束");
this.stop();
return;
}
!this.isInviter && l1l11I1l.viewShop !== 1 && l1l11I1l.addSku !== 1 && (await this.inviteRelation());
if (IIll1Ill.data.data?.["missionCustomer"]?.["hasAddCart"] === 0 && l1l11I1l.viewShop !== 1 && l1l11I1l.addSku === 1) {
let l1Illlii = await this.mpdzTask("dm/front/jdJoinCardtf/mission/completeMission", {
"missionType": "uniteAddCart"
});
this.log(l1Illlii?.["data"]?.["data"]?.["remark"] || l1Illlii.errorMessage || "已完成加购任务");
}
if (IIll1Ill.data?.["data"]?.["missionCustomer"]?.["hasCollectShop"] === 0 && l1l11I1l.viewShop !== 1) {
let li1Iili1 = await this.mpdzTask("dm/front/jdJoinCardtf/mission/completeMission", {
"missionType": "uniteCollectShop"
});
this.log(li1Iili1?.["data"]?.["data"]?.["remark"] || li1Iili1.errorMessage || "已完成关注店铺任务");
}
let lil1llIi = await this.mpdzTask("dm/front/jdJoinCardtf/shop/shopList");
this.debug(lil1llIi);
let i111iII = lil1llIi?.["data"]?.["data"] || [];
if (l1l11I1l.viewShop === 1 || l1l11I1l.viewShop === 2) {
for (let iill1II of i111iII) {
let lIlll1il = await this.mpdzTask("dm/front/jdJoinCardtf/mission/completeMission", {
"missionType": "viewShop",
"goodsNumId": iill1II.userId
});
this.log(lIlll1il?.["data"]?.["data"]?.["remark"] || lIlll1il.errorMessage);
await this.sleep(800, 1200);
}
}
if (l1l11I1l.viewShop === 1 || l1l11I1l.addSku === 1) return;
i111iII = lil1llIi?.["data"]?.["data"]?.["filter"](IlIl1I1l => !IlIl1I1l.open) || [];
for (let l1Iii1il of i111iII) {
let iiii1Iil = await this.mpdzTask("dm/front/jdJoinCardtf/mission/completeMission", {
"missionType": "openCard",
"shopId": l1Iii1il.userId
});
this.log(iiii1Iil?.["data"]?.["data"]?.["remark"] || iiii1Iil.errorMessage);
let iIi1iil1 = this.getQueryString(l1Iii1il?.["openCardUrl"] || "", "venderId") || l1Iii1il.userId || l1Iii1il.shopId;
await this.bindWithVender(iIi1iil1);
if (this.canNotOpenCard) this.log("不能开卡", iIi1iil1), this.exit();
await this.sleep(500, 1000);
await await this.mpdzTask("dm/front/jdJoinCardtf/activity/load", {
"jdToken": this.isvToken,
"source": "01",
"inviteNick": this.toHelpUser?.["buyerNick"] || "",
"shopId": l1Iii1il.userId
});
}
}
async ["inviteRelation"]() {
let I1iiIII = {
"inviterNick": this.toHelpUser?.["buyerNick"] || ""
},
liiiIlI1 = this.jgcqdm("/jdJoinCardtf/customer/inviteRelation", I1iiIII),
liiilIII = await this.taskPostByJson("dm/front/jdJoinCardtf/customer/inviteRelation?open_id=&mix_nick=" + (this.buyerNick ?? "") + "&user_id=10299171", liiiIlI1);
this.debug(liiilIII);
if (!liiilIII || !liiilIII.success || liiilIII.data.status !== 200) return this.putMsg(liiilIII?.["errorMessage"]), this.wxStop(liiilIII?.["errorMessage"]), this.exit();
this.log(liiilIII.data.msg || "绑定邀请成功");
this.toHelpUser.helpedCount++;
this.toHelpUser.helpedCount >= il11iiIl.activity.maxHelpCount && (this.toHelpUser.needHelp = false);
}
async ["getszxyunActid"]() {
if (il11iiIl.activity.activityId) return this.activityId = il11iiIl.activity.activityId;
let Iililiii = await this.taskGet(this.activityUrl);
const l1illiI1 = this.textToHtml(Iililiii);
let ll1llIi = "";
l1illiI1("script[src]").each((lli1l1lI, illlllI) => {
const iIII1II = l1illiI1(illlllI).attr("src");
let iIlIllll = iIII1II.match(/\/\/.*\/js\/app\.\w+\.js/);
iIlIllll && iIlIllll.length > 0 && (ll1llIi = iIlIllll[0]);
});
let lIllI1 = await this.request({
"url": "https:" + ll1llIi
}),
ilIll1iI = lIllI1?.["data"]?.["match"](/unionOpen\w*\"/g);
if (ilIll1iI && ilIll1iI.length > 0) {
let ilillIl1 = ilIll1iI[0].replace("\"", "");
il11iiIl.activity.activityId = ilillIl1;
this.activityId = ilillIl1;
return;
}
return this.putMsg("未匹配到活动id"), this.stop();
}
async ["szxyunLogin"]() {
let i1IiI1Il = await this.taskPostByJson("webc/login/userLogin", {
"shopId": "1000100710",
"token": this.isvToken,
"source": "01"
});
if (!i1IiI1Il || i1IiI1Il.code !== "200") {
return this.putMsg(i1IiI1Il.message || "登录失败"), this.wxStop(i1IiI1Il.message || "登录失败"), this.exit();
}
this.otherHeaders = {
"jd-fast-token": i1IiI1Il.data
};
}
async ["active"](ill1liiI = false) {
let iiili11i = await this.taskPostByJson("webc/unionOpen/active", {
"activeId": this.activityId,
"shareId": null
});
this.debug(iiili11i);
if (!iiili11i || iiili11i.code !== "200") {
return this.putMsg(iiili11i.message || "获取活动详情失败"), this.wxStop(iiili11i.message || "获取活动详情失败"), this.exit();
}
if (ill1liiI) {
iiili11i.data?.["showBeanList"] && iiili11i.data?.["showBeanList"]["length"] > 0 && this.log("获得:", iiili11i.data?.["showBeanList"][0]?.["sendNum"] + "京豆");
return;
}
this.shareUuid = iiili11i.data?.["userVO"]?.["joinId"];
this.helpedCount = iiili11i.data?.["userVO"]?.["points"];
this.log("助力码: " + this.shareUuid);
this.log("已邀请: " + this.helpedCount);
if (this.isInviter) il11iiIl.activity.maxHelpCount = l1l11I1l.inviteNum;
let l1iIiI1i = iiili11i.data?.["bindCardInfo"] ?? [];
l1iIiI1i = l1iIiI1i.filter(I1lI1i11 => !I1lI1i11.isBindCard);
for (let iIili11i of l1iIiI1i) {
let liIlilI1 = this.getQueryString(iIili11i?.["openUrl"] || "", "venderId") ?? iIili11i?.["shopId"];
await this.bindWithVender(liIlilI1);
await this.sleep(50, 500);
}
l1iIiI1i?.["length"] > 0 && (await this.active(true));
}
async ["szyunShare"]() {
let ili1i = await this.taskPostByJson("webc/unionOpen/share", {
"activeId": this.activityId,
"joinId": this.shareUuid || "",
"shareId": this.toHelpUser?.["shareUuid"] || ""
});
this.debug(ili1i);
if (!ili1i || ili1i.code !== "200") return this.putMsg(ili1i.message || "助力失败"), this.wxStop(ili1i.message || "助力失败"), this.exit();
let li1lIIiI = ili1i.data?.["helpStatus"];
switch (li1lIIiI) {
case 1:
this.toHelpUser.helpedCount++, this.toHelpUser.helpedCount >= il11iiIl.activity.maxHelpCount && (this.toHelpUser.needHelp = false), this.log("助力成功,已邀请" + this.toHelpUser.helpedCount + "人");
break;
case 2:
this.log("已经助力过了");
break;
case 3:
this.log("已为他人助力");
break;
case 4:
this.log("发起人助力到达限制");
break;
case 5:
this.log("发起人助力数达到上限");
break;
default:
this.log("未知状态", li1lIIiI);
break;
}
}
async ["inviteTask"](l11llII1) {
this.toHelpUser = l11llII1;
if (!this.toHelpUser.needHelp) {
return;
}
await this.isvObfuscator();
if (this.activityUrl.includes("szxyun")) {
await this.getszxyunActid();
await this.szxyunLogin();
this.debug(this.otherHeaders);
await this.active();
await this.szyunShare();
return;
}
if (this.activityUrl.includes("jinggengjcq")) {
this.activityId = this.getQueryString(this.activityUrl, "actId");
this.userId = "10299171";
await this.load();
return;
}
if (this.domain.includes("lzdz-isv")) await this.taskGet("/wxCommonInfo/token"), this.venderId = this.activityUrl.match(/\/m\/(\d+)/)[1], this.activityId = this.activityUrl.match(/\/(\d+)$/)[1];else {
await this.wxCommonInfo();
await this.getSimpleActInfoVo("dz/common/getSimpleActInfoVo");
}
if (this.activityUrl.includes("joinCommon")) {
await this.getMyPing();
} else {
await this.getMyPing("customer/getMyCidPing");
}
await this.accessLog();
let Iilili1i = await this.getActivityContent();
if (!Iilili1i || !Iilili1i.result) {
return this.putMsg(Iilili1i?.["errorMessage"]), this.wxStop(Iilili1i?.["errorMessage"]), this.exit();
}
this.activityContent = Iilili1i;
let iiIiilii = Iilili1i?.["data"]?.["actorUuid"] || Iilili1i?.["data"]?.["actorInfo"]?.["uuid"];
this.shareUuid = iiIiilii;
await this.task();
}
async ["userTask"]() {
if (this.index >= l1l11I1l.leaderNum && l1l11I1l.viewShop !== 1) return this.stop();
await this.isvObfuscator();
if (this.activityUrl.includes("szxyun")) {
await this.getszxyunActid();
this.debug("activityId:", this.activityId);
await this.szxyunLogin();
this.debug(this.otherHeaders);
await this.active();
return;
}
if (this.activityUrl.includes("jinggengjcq")) {
this.activityId = this.getQueryString(this.activityUrl, "actId");
this.userId = "10299171";
await this.load();
if (l1l11I1l.viewShop === 1) this.needHelp = false;
il11iiIl.activity.maxHelpCount = l1l11I1l.inviteNum;
this.helpedCount = 0;
return;
}
if (this.domain.includes("lzdz-isv")) await this.taskGet("/wxCommonInfo/token"), this.venderId = this.activityUrl.match(/\/m\/(\d+)/)[1], this.activityId = this.activityUrl.match(/\/(\d+)$/)[1];else {
await this.wxCommonInfo();
await this.getSimpleActInfoVo("dz/common/getSimpleActInfoVo");
}
this.activityUrl.includes("joinCommon") ? await this.getMyPing() : await this.getMyPing("customer/getMyCidPing");
await this.accessLog();
let iill1I1i = await this.getActivityContent();
if (!iill1I1i || !iill1I1i.result) return this.putMsg(iill1I1i?.["errorMessage"]), this.wxStop(iill1I1i?.["errorMessage"]), this.exit();
let iI1Ili1 = iill1I1i?.["data"]?.["startTime"],
IiIl111 = iill1I1i?.["data"]?.["endTime"];
if (iI1Ili1 && this.timestamp() < iI1Ili1) {
this.putMsg("活动未开始");
this.stop();
return;
}
if (IiIl111 && this.timestamp() > IiIl111) {
this.putMsg("活动已结束");
this.stop();
return;
}
let l1iilIlI = iill1I1i?.["data"]?.["actorUuid"] || iill1I1i?.["data"]?.["actorInfo"]?.["uuid"] || iill1I1i?.["data"]?.["userInfo"]?.["uid"];
this.shareUuid = l1iilIlI;
this.helpedCount = 0;
il11iiIl.activity.maxHelpCount = l1l11I1l.inviteNum;
this.log("助力码: " + l1iilIlI);
this.activityContent = iill1I1i;
await this.task();
}
}
l1IilII.activity = {
"activityUrl": activityUrl
};
l1IilII.TaskClass = I1IiiIil;
l1IilII.run({
"whitelist": ["1-2000"],
"main_thread": 50,
"thread": 10,
"inviteTask": true,
"noPush": true
});

450
jd_wx_pointDraw.js Normal file
View File

@ -0,0 +1,450 @@
/*
积分兑换beta v2.0.3
https://cjhy-isv.isvjcloud.com/mc/wxPointShopView/pointExgBeans?venderId=1000015445&giftId=c8e4b16f96014fb3a53aa182627402c3&giftType=4&beansLevel=1
https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10079&templateId=202209051007jfdh&activityId=1768977757201473538&nodeId=101001&prd=cjwx
https://jinggeng-rc.isvjcloud.com/ql/front/exchangeActDetail?actId=9e8080268dca1acb018df35a01c36241&userId=1000377707
https://jingyun-rc.isvjcloud.com/h5/pages/exchangePoint/exchangePoint?id=2ee25610cda5d58daff79c7a98178904&userId=1000007503&actForm=single
https://lzkj-isv.isvjcloud.com/prod/cc/interaction/v2/30002/1001/?activityId=1806167396485083137&shopId=1000002836
export B_WX_POINT_DRAW_URL=""
export B_WX_NOT_POINT_DRAW_LIST="" # 拉黑的店铺 例子: xxxxx@xxxxxxxx
export B_WX_NOT_POINT_DRAW_GIFT_NAMES="" # 拉黑的奖品 例子: 雨x伞@雨x伞@雨x伞
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_POINT_DRAW_URL);
if (mode) {
activityUrl = "https://cjhy-isv.isvjcloud.com/mc/wxPointShopView/pointExgBeans?venderId=1000092950&giftId=83c141f7589348ada97081d92f79f511&giftType=4&beansLevel=";
activityUrl = "https://cjhy-isv.isvjcloud.com/mc/wxPointShopView/pointExgBeans?venderId=1000015445&giftId=c8e4b16f96014fb3a53aa182627402c3&giftType=4&beansLevel=1";
activityUrl = "https://cjhy-isv.isvjcloud.com/mc/wxPointShopView/pointExgShiWu?venderId=779565&giftId=a0ebbb463bf04473ae1da3ac017653be&giftType=3";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10079&templateId=202209051007jfdh&activityId=1768977757201473538&nodeId=101001&prd=cjwx";
activityUrl = "https://jinggeng-rc.isvjcloud.com/ql/front/exchangeActDetail?actId=9e8080c68e328c5e018e3668d9f42709&userId=10726683";
activityUrl = "https://jinggeng-rc.isvjcloud.com/ql/front/exchangeActDetail?actId=9e8080268dca1acb018df35a01c36241&userId=1000377707";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10079&templateId=202209051007jfdh&activityId=1770345652211335170&nodeId=101001&prd=cjwx";
activityUrl = "https://cjhy-isv.isvjcloud.com/mc/wxPointShopView/pointExgZheKou?venderId=13355577&giftId=fe450dd0d7a74d24919549b43472824d&giftType=5";
activityUrl = "https://cjhy-isv.isvjcloud.com/mc/wxPointShopView/pointExgShiWu?venderId=1000075343&giftId=48d9a075943c412390977c2e61d4f155&giftType=3";
activityUrl = "https://jingyun-rc.isvjcloud.com/h5/pages/exchangePoint/exchangePoint?id=7b7db11b08b21348e9aeb2d4cc31ae7a&userId=1000080364&actForm=single";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10079&templateId=202209051007jfdh618&activityId=1785215208127311873&nodeId=101001&prd=cjwx";
activityUrl = "https://cjhy-isv.isvjcloud.com/mc/wxPointShopView/pointExgBeans?venderId=1000302822&giftId=7a3c49af66ff42bf8e2eb2c0c7b95cec&giftType=4";
activityUrl = "https://cjhy-isv.isvjcloud.com/mc/wxPointShopView/pointExgBeans?venderId=1000302822&giftId=a573617872f541f9ac18436208e776c2&giftType=4";
activityUrl = "https://jingyun-rc.isvjcloud.com/h5/pages/exchangeJDmarket/exchangeJDmarket?id=f0ec65ba8db5a7a913dddc892f9d5b9e&userId=1000307221&actForm=single";
activityUrl = "https://jingyun-rc.isvjcloud.com/h5/pages/exchangePoint/exchangePoint?id=2ee25610cda5d58daff79c7a98178904&userId=1000007503&actForm=single";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interaction/v2/30002/1001/?activityId=1806167396485083137&shopId=1000002836";
}
const {
RunMode: _0x517e36,
UserMode: _0x56fba7,
baseCommonEnv: _0x1c00c6,
baseCommonEnvKey: _0x10f3de
} = require("./bear");
_0x1c00c6.notPointDrawList = process.env?.["B_WX_NOT_POINT_DRAW_LIST"]?.["split"](/[@,&|]/) || [];
_0x1c00c6.notPointDrawGiftNameList = process.env?.["B_WX_NOT_POINT_DRAW_GIFT_NAMES"]?.["split"](/[@,&|]/) || ["雨x伞", "加赠特权"];
_0x10f3de.B_WX_NOT_POINT_DRAW_LIST = "__notPointDrawList__";
_0x10f3de.B_WX_NOT_POINT_DRAW_GIFT_NAMES = "__notPointDrawGiftNameList__";
_0x517e36.envInfo = {
"name": "积分兑换beta",
"runName": "jd_wx_pointDraw",
"version": "2.0.3"
};
class _0x20828e extends _0x56fba7 {
constructor(_0xd1cd72, _0xc1c9da) {
super(_0xd1cd72, _0xc1c9da);
this.needPoint = null;
}
async ["receivePrize"](_0x29fd5c = {}) {
let _0x58fde4 = await this.v2Api("api/" + this.activityType + "/receivePrize", {
"prizeNum": 1,
"mobile": "",
..._0x29fd5c
});
if (_0x58fde4 && _0x58fde4.code === 200) {
this.putMsg(_0x58fde4.data?.["msg"] || _0x58fde4.data);
if (_0x58fde4.data?.["successNum"] > 0) {
let _0x332387 = this.formatDate(Date.now(), "yyyy-MM-dd HH:mm:ss") + "," + this.rightsName + "," + this.pin + "," + this.address?.["phone"] + "," + this.address?.["address"] + "," + _0x517e36.envInfo.name + "," + (this.shopId ?? this.venderId) + "," + this.activityUrl + "\n";
this.appendFileSync("", "gifts.csv", _0x332387);
}
return;
}
let _0x48ad7f = _0x58fde4.data?.["msg"] || _0x58fde4.data;
this.putMsg(_0x48ad7f);
await this.wxStopSync(_0x48ad7f);
this.exit();
}
async ["hdbExchange"](_0x5aacc8, _0x45bf9 = true) {
let _0x20a668 = await this.hdbApi("post" + this.activityType + "FrontAct", {
"awardId": _0x5aacc8
});
if (_0x20a668 && _0x20a668.succ) {
if (_0x20a668.result.succ) {
this.putMsg(_0x20a668.result?.["dmActivityLog"]?.["awardName"] || "空气");
_0x20a668.result?.["msg"]?.["includes"]("填写信息") && (this.addressId = _0x20a668.result?.["dmActivityLog"]?.["id"], this.prizeName = _0x20a668.result?.["dmActivityLog"]?.["awardName"], await this.saveAddress());
return;
} else this.putMsg(_0x20a668.result?.["errorMsg"] || _0x20a668.result?.["message"]), this.exit();
}
let _0x1e6397 = _0x20a668?.["message"];
if (_0x1e6397?.["includes"]("关注店铺") && _0x45bf9 && (await this.follow())) return await this.hdbExchange(_0x5aacc8, false);
return this.putMsg(_0x1e6397), await this.wxStopSync(_0x1e6397), this.exit();
}
async ["userTask"]() {
await this.isvObfuscator();
await this.getDefenseUrls();
if (this.mode === "v2") {
await this.login();
let _0x573518 = await this.v2Api("api/" + this.activityType + "/getActivityInfo"),
{
detail: _0x1f07a0,
rightsName: _0x2fd93a,
rightsType: _0x3e43f3
} = _0x573518?.["data"];
this.rightsName = _0x2fd93a;
if (/(券|权益已兑完)/.test(_0x2fd93a)) return this.putMsg("垃圾活动"), this.stop();
if (_0x1f07a0) return this.putMsg(_0x1f07a0);
if (_0x3e43f3 === 3) {
this.getAddress();
if (!this.address) {
this.putMsg("未配置地址或所有地址已达使用上限,退出填地址");
return;
}
let _0x1eda4c = await this.v2Api("api/" + this.activityType + "/saveAddress", {
"name": this.address.receiver,
"tel": this.address.phone,
"province": this.address.province,
"city": this.address.city,
"county": this.address.county,
"addressDetail": this.address.address,
"isDefault": false
});
this.putMsg(_0x1eda4c.data?.["msg"] || _0x1eda4c.data);
let _0xbbf6e2 = await this.v2Api("api/" + this.activityType + "/getAddressList");
for (let _0x591e7d of _0xbbf6e2?.["data"] || []) {
_0x591e7d.tel?.["includes"](this.address.phone) && (await this.receivePrize({
"addressId": _0x591e7d.id
}));
await this.v2Api("api/" + this.activityType + "/delAddress", {
"id": _0x591e7d.id
});
}
} else await this.receivePrize();
return;
}
if (this.mode === "hdb") {
await this.login();
await this.reportPVUV();
await this.loadFrontAct();
await this.loadFrontAward();
let _0x18a1c4 = await this.hdbApi("getMyPoint"),
_0x39e04a = _0x18a1c4?.["result"] ?? 0;
if (_0x39e04a <= 0) return this.putMsg("无积分"), this.exit();
this.activityType = "PointExchange";
this.activityUrl.includes("exchangeJDmarket") && (this.activityType = "PointLimitedTimeExchange");
let _0x46a19a = await this.hdbApi("load" + this.activityType + "Awards", {
"timeIndex": 0
}),
_0x48db9f = _0x46a19a?.["result"]?.["awards"] ?? [];
_0x48db9f = _0x48db9f.filter(_0xf42f8f => _0xf42f8f?.["awardSurplusQuantity"] > 0);
if (_0x48db9f.length === 0) return this.putMsg("垃圾或已领完"), this.stop();
this.debug(_0x48db9f);
_0x48db9f = _0x48db9f.filter(_0x2aa90f => _0x2aa90f.awardSurplusQuantity > 0 && _0x39e04a >= _0x2aa90f.pointNum && _0x2aa90f.hasExchange === 0);
this.debug(_0x48db9f);
if (_0x48db9f.length === 0) return this.putMsg("无可兑换奖励"), this.exit();
if (this.openCard === 0) await this.bindWithVender();
for (let _0xa47e7a of _0x48db9f.reverse()) {
this.debug(_0xa47e7a);
await this.hdbExchange(_0xa47e7a.id);
}
return;
}
if (this.mode === "jinggeng") {
this.userId = this.userId || this.getQueryString(this.activityUrl, "userId");
this.activityId = this.activityId || this.getQueryString(this.activityUrl, "actId");
if (!this.userId || !this.activityId) return this.putMsg("参数错误"), this.stop();
await this.setMixNick();
let _0x46bc0d = await this.jinggengShopInfo(),
_0x4c313f = _0x46bc0d("#actType", "body").attr("value");
if (["JD_GOODS", "JD_COUPON", "JD_POINTTOBUY"].includes(_0x4c313f)) {
this.putMsg("垃圾或领完");
this.stop();
return;
}
let _0x562c93 = parseInt(this.rule?.["match"](/(?<=每人可兑换)\d{1,2}/)[0] || "1");
this.debug(_0x562c93);
for (let _0x33627c = 0; _0x33627c < _0x562c93; _0x33627c++) {
let _0x5130ee = await this.jinggengApi("postQlExchange");
if (_0x5130ee && _0x5130ee.succ) {
let _0x3bad82 = _0x5130ee.msg ?? "{}",
_0x4b3730 = JSON.parse(_0x3bad82);
if (_0x4b3730?.["isSendSucc"]) {
let _0x12c62d = _0x4b3730?.["drawAwardDto"]?.["awardName"];
this.putMsg(_0x4b3730?.["drawAwardDto"]?.["awardDenomination"] + " " + _0x12c62d);
_0x4b3730?.["drawAwardDto"]?.["awardType"] === "JD_GOODS" && (this.addressId = _0x4b3730?.["drawAwardDto"]?.["actLogId"], this.prizeName = _0x12c62d, await this.saveAddress());
}
await this.sleep(2000, 3000);
continue;
}
this.putMsg(_0x5130ee?.["msg"] || "兑换失败");
await this.wxStopSync(_0x5130ee?.["msg"]);
return;
}
return;
}
if (["10079"].includes(this.activityType)) {
await this.login();
let _0x3f3457 = await this.taskGet("api/pointsExchange/activity");
this.debug(_0x3f3457);
if (!_0x3f3457 || _0x3f3457.resp_code !== 0) return this.putMsg(_0x3f3457?.["resp_msg"] || "查询失败"), await this.wxStopSync(_0x3f3457?.["resp_msg"]);
let _0x15da66 = _0x3f3457.data.pointsExchangePrizeVos ?? [];
_0x15da66 = _0x15da66.filter(_0xf0643c => _0xf0643c.stock !== 0 && !_0x1c00c6.notPointDrawGiftNameList.some(_0x3cf8aa => _0xf0643c.prizeName.includes(_0x3cf8aa)));
if (_0x15da66.length === 0) return this.putMsg("垃圾或领完"), this.stop();
_0x15da66 = _0x15da66.filter(_0x51fa03 => _0x51fa03.status === 1);
if (_0x15da66.length === 0) return this.putMsg("已兑换"), this.exit();
let _0xab7f1b = _0x3f3457.data.myPoints;
if (_0xab7f1b === 0) return this.putMsg("无积分");
_0x15da66 = _0x15da66.filter(_0x240cc5 => _0xab7f1b >= _0x240cc5.num);
if (_0x15da66.length === 0 || _0xab7f1b < _0x15da66[0].num) return this.putMsg("积分不足");
if (["1005", "1006", "1002"].includes(this.joinCode)) {
await this.getShopOpenCardInfo();
await this.bindWithVender();
if (this.canNotOpenCard) return this.putMsg(this.joinDes);
await this.login(false);
}
for (let _0x432d2a of _0x15da66.reverse()) {
let _0x9c7b2 = await this.lzkjApi("api/pointsExchange/exchange", {
"prizeInfoId": _0x432d2a.prizeInfoId,
"status": 1
});
this.debug(_0x9c7b2);
if (_0x9c7b2 && _0x9c7b2.resp_code === 0) {
this.prizeName = _0x9c7b2.data?.["prizeName"];
_0xab7f1b -= _0x432d2a.num;
_0x15da66 = _0x15da66.filter(_0x5183af => _0xab7f1b >= _0x5183af.num);
this.putMsg(this.prizeName);
this.addressId = _0x9c7b2.data?.["addressId"];
_0x9c7b2.data?.["prizeType"] === 3 && (await this.saveAddress());
return;
}
let _0x316c00 = _0x9c7b2?.["resp_msg"] || "兑换失败";
this.putMsg(_0x316c00);
await this.wxStopSync(_0x316c00);
}
return;
}
if (!["pointExgBeans", "pointExgECard", "pointExgHb", "pointExgShiWu"].some(_0x346efb => this.activityUrl.includes(_0x346efb))) return this.putMsg("暂不支持该行活动,请联系作者"), this.stop();
this.activityId = this.getQueryString(this.activityUrl, "giftId");
await this.wxCommonInfo();
await this.getSimpleActInfoVo();
if (this.index === 0) {
await this.getShopInfo();
if (this.shopName && [26, 128, 129].includes(this.activityType) && _0x1c00c6.notPointDrawList.some(_0x2fcee9 => this.shopName.includes(_0x2fcee9))) {
this.putMsg("已屏蔽");
this.stop();
return;
}
}
this.defenseUrls.length === 0 ? await this.getMyPing() : await this.initPinToken();
await this.accessLog();
let _0x1913fd = await this.wxApi("mc/wxPointShop/getBuyerPoints", {
"venderId": this.venderId,
"buyerPin": this.secretPin
});
this.debug(_0x1913fd);
let _0x266b2e = parseInt(_0x1913fd?.["data"]?.["grade"] ?? 1),
_0xc21407 = parseInt(_0x1913fd?.["data"]?.["buyerPoints"] ?? 0);
if (_0xc21407 <= 0) {
this.putMsg("无积分");
return;
}
if (_0x266b2e === 1 && this.needPoint && this.needPoint > _0xc21407) return this.putMsg("积分不足");
let _0x36d595, _0x1d46f5;
if (this.activityUrl.includes("pointExgECard")) _0x36d595 = "mc/equity/selectEquityForC", _0x1d46f5 = {
"giftId": this.activityId,
"venderId": this.venderId,
"buyerPin": this.secretPin
};else {
if (this.activityUrl.includes("pointExgHb")) {
_0x36d595 = "mc/hb/selectHbForC";
_0x1d46f5 = {
"giftId": this.activityId,
"venderId": this.venderId,
"buyerPin": this.secretPin
};
} else {
if (this.activityUrl.includes("pointExgShiWu")) {
for (let _0x316321 of _0x1c00c6.notPointDrawGiftNameList) {
_0x56fba7.activity.shopName.includes(_0x316321) && (this.putMsg("已屏蔽"), this.stop());
}
_0x36d595 = "mc/shiWu/selectShiWu";
_0x1d46f5 = {
"giftId": this.activityId,
"venderId": this.venderId
};
} else {
if (this.activityUrl.includes("pointExgBeans")) {
if (_0x56fba7.activity.shopName.includes("同仁堂")) {
this.putMsg("已屏蔽");
this.stop();
return;
}
_0x36d595 = "mc/beans/selectBeansForC";
_0x1d46f5 = {
"giftId": this.activityId,
"venderId": this.venderId,
"buyerPin": this.secretPin,
"beansLevel": _0x266b2e
};
} else {
return this.putMsg("暂不支持该行活动,请联系作者"), this.stop();
}
}
}
}
let _0x11c1cf = await this.wxApi(_0x36d595, _0x1d46f5);
this.debug(_0x11c1cf);
if (!_0x11c1cf || !_0x11c1cf.result) {
return this.putMsg(_0x11c1cf?.["errorMessage"] || "查询失败"), await this.wxStopSync(_0x11c1cf?.["errorMessage"]);
}
let _0x15ad11, _0x2cd6a8, _0x2c380a, _0x5f192e, _0x54ce75, _0x3f3e0e, _0x3c3fce, _0x2dcb42;
if (this.activityUrl.includes("pointExgShiWu")) {
_0x15ad11 = _0x11c1cf.data?.["mcGiftBaseInfo"]?.["actrule"];
_0x2cd6a8 = _0x11c1cf.data?.["mcGiftBaseInfo"]?.["upTime"];
_0x2c380a = _0x11c1cf.data?.["mcGiftBaseInfo"]?.["downTime"];
_0x5f192e = _0x11c1cf.data?.["mcGiftBaseInfo"]?.["giftName"];
_0x54ce75 = _0x11c1cf.data?.["mcShiWu"];
_0x3f3e0e = _0x11c1cf.data?.["mcGiftBaseInfo"]?.["num"] === _0x11c1cf.data?.["mcGiftBaseInfo"]?.["usedNum"];
this.needPoint = _0x11c1cf.data?.["mcGiftBaseInfo"]["point" + _0x266b2e];
} else {
_0x15ad11 = _0x11c1cf.data?.["actrule"];
_0x2cd6a8 = _0x11c1cf.data?.["upTime"];
_0x2c380a = _0x11c1cf.data?.["downTime"];
_0x5f192e = _0x11c1cf.data?.["giftName"];
_0x3c3fce = _0x11c1cf.data?.["exgStyle"] ?? 0;
let {
oneLevel = 0,
twoLevel = 0,
threeLevel = 0
} = _0x11c1cf.data;
_0x2dcb42 = [oneLevel, threeLevel, twoLevel].filter(_0x234363 => _0x234363 !== 0 && _0x234363);
this.needPoint = _0x11c1cf.data["point" + _0x266b2e];
_0x3f3e0e = _0x11c1cf.data?.["num"] === _0x11c1cf.data?.["usedNum"];
_0x11c1cf.data?.["beansLevelCount"] > 0 && (this.needPoint = _0x11c1cf.data["point" + _0x266b2e] * _0x11c1cf.data?.["beansLevelCount"]);
}
_0x56fba7.activity.startTime = _0x2cd6a8;
_0x56fba7.activity.endTime = _0x2c380a;
if (_0x2cd6a8 && _0x2cd6a8 > this.timestamp()) {
return this.putMsg("未开始"), this.stop();
}
if (_0x2c380a && _0x2c380a < this.timestamp()) {
return this.putMsg("已结束"), await this.writeLongCacheByStop(), this.stop();
}
if (!this.needPoint) return this.putMsg("等级不符"), this.exit();
this.debug("needPoint", this.needPoint);
if (_0x3f3e0e) return this.putMsg("已抢光,明日再来"), this.stop();
if (this.needPoint > _0xc21407) return this.putMsg("积分:" + _0xc21407 + ",需要:" + this.needPoint);
for (let _0x290702 of _0x1c00c6.notPointDrawGiftNameList) {
if (_0x5f192e.includes(_0x290702)) {
this.putMsg("已屏蔽");
this.stop();
return;
}
}
if (this.activityUrl.includes("pointExgHb")) {
let _0x2999c5 = await this.wxApi("mc/wxPointShop/exgHB", {
"giftId": this.activityId,
"venderId": this.venderId,
"buyerPin": this.secretPin
});
return this.putMsg(_0x2999c5?.["errorMessage"] || "兑换成功");
} else {
if (this.activityUrl.includes("pointExgECard")) {
let _0x3bdedb = await this.wxApi("mc/wxPointShop/exgECard", {
"giftId": this.activityId,
"venderId": this.venderId,
"buyerPin": this.secretPin,
"buyerNick": this.nickname
});
return this.putMsg(_0x3bdedb?.["errorMessage"] || "兑换成功");
} else {
if (this.activityUrl.includes("pointExgShiWu")) {
let _0x5520d9 = await this.wxApi("mc/wxPointShop/selectAddressList", {
"venderId": this.venderId,
"buyerPin": this.secretPin
});
if (_0x5520d9 && _0x5520d9.ok && _0x5520d9.count > 0) {
for (let _0x5b1d87 of _0x5520d9.data) {}
}
this.getAddress();
if (!this.address) {
this.putMsg("未配置地址或所有地址已达使用上限,退出填地址");
return;
}
this.log("使用地址", this.address);
let _0x4b0cff = await this.wxApi("mc/wxPointShop/saveAddress", {
"venderId": this.venderId,
"buyerPin": this.secretPin,
"address": this.address.address,
"city": this.address.city,
"county": this.address.county,
"province": this.address.province,
"receiver": this.address.receiver,
"receiverPhone": this.address.phone
});
if (!_0x4b0cff || !_0x4b0cff.result) return this.putMsg(_0x4b0cff?.["errorMessage"] || "保存地址失败");
let _0xf1ab5d = _0x4b0cff.data.addressId;
this.putMsg("已填地址");
let _0x50c6f3 = await this.wxApi("mc/wxPointShop/exgShiWu", {
"buyerPin": this.secretPin,
"buyerNick": this.nickname,
"giftId": this.activityId,
"venderId": this.venderId,
"addressId": _0xf1ab5d
});
if (_0x50c6f3 && _0x50c6f3.result) {
let _0x1c4569 = this.formatDate(Date.now(), "yyyy-MM-dd HH:mm:ss") + "," + _0x5f192e + "," + this.pin + "," + this.address?.["phone"] + "," + this.address?.["address"] + "," + _0x517e36.envInfo.name + "," + (this.shopId ?? this.venderId) + "," + this.activityUrl + "\n";
return this.appendFileSync("", "gifts.csv", _0x1c4569), this.putMsg("兑换成功");
}
let _0x3f798f = _0x50c6f3?.["errorMessage"] || "兑换失败";
this.putMsg(_0x3f798f);
await this.wxStopSync(_0x3f798f);
return;
}
}
}
let _0x29e1ee = parseInt(_0xc21407 / _0x11c1cf.data["point" + _0x266b2e]);
if (_0x11c1cf.data?.["canExgByPeopDay"] && _0x29e1ee > _0x11c1cf.data?.["canExgByPeopDay"]) _0x29e1ee = _0x11c1cf.data?.["canExgByPeopDay"];
let _0xec79bb = _0x11c1cf.data?.["beansLevelCount"];
if (_0x29e1ee < _0xec79bb) {
return this.putMsg("积分不足");
}
_0x29e1ee = _0xec79bb === 0 ? _0x29e1ee : _0xec79bb;
if (_0x3c3fce === 1) {
_0x29e1ee = _0x2dcb42?.["filter"](_0x2149ab => _0xc21407 >= _0x2149ab * _0x11c1cf.data["point" + _0x266b2e])?.["sort"]((_0x200736, _0x58b29b) => _0x58b29b - _0x200736)?.[0] ?? 0;
}
this.debug(_0x29e1ee);
if (_0x29e1ee <= 0) return this.putMsg("积分不足");
let _0x5d9b6a = await this.wxApi("mc/wxPointShop/exgBeans", {
"buyerPin": this.secretPin,
"buyerNick": this.nickname,
"giftId": this.activityId,
"venderId": this.venderId,
"beansLevel": _0x266b2e,
"exgBeanNum": _0x29e1ee
});
if (_0x5d9b6a && _0x5d9b6a.result) return this.putMsg(_0x29e1ee + "京豆");
let _0x52ce6d = _0x5d9b6a?.["errorMessage"] || "兑换失败";
this.putMsg(_0x52ce6d);
await this.wxStopSync(_0x52ce6d);
}
}
_0x517e36.activity = {
"activityUrl": activityUrl
};
_0x517e36.TaskClass = _0x20828e;
_0x517e36.run({
"whitelist": ["1-20000"],
"main_thread": 3
});

196
jd_wx_secondDraw.js Normal file
View File

@ -0,0 +1,196 @@
/*
读秒手速beta v1.0.0
https://lzkj-isv.isvjcloud.com/wxSecond/activity/c8943bae199447c6911d488be4b453c4?activityId=c8943bae199447c6911d488be4b453c4
export B_WX_SECOND_DRAW_URL=""
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_SECOND_DRAW_URL);
mode && (activityUrl = "https://lzkj-isv.isvjcloud.com/wxSecond/activity/c8943bae199447c6911d488be4b453c4?activityId=c8943bae199447c6911d488be4b453c4");
const {
RunMode: lIIlIIl,
UserMode: IIlI1ill
} = require("./bear");
lIIlIIl.envInfo = {
"name": "读秒手速beta",
"runName": "jd_wx_secondDraw",
"version": "1.0.0"
};
class IIlIiiii extends IIlI1ill {
constructor(Il111i1, ii1i1lll) {
super(Il111i1, ii1i1lll);
}
async ["userTask"]() {
await this.isvObfuscator();
await this.getDefenseUrls();
await this.wxCommonInfo();
await this.getSimpleActInfoVo();
this.index === 0 && (await this.getShopInfo());
let lIl1lili = await this.wxApi("wxSecond/getData", {
"activityId": this.activityId,
"pin": this.secretPin
});
this.debug(lIl1lili);
if (!lIl1lili || !lIl1lili.result) {
let ilIlIli = lIl1lili?.["errorMessage"] || "获取数据失败";
this.putMsg(ilIlIli);
this.wxStop(ilIlIli);
return;
}
let {
score: llil1l,
secondActive: lllIIiI1,
brushBane: liiiI11,
bid: l11lilI,
uuid: lIlI1iIi,
prizeList: lIIli
} = this.activityInfo,
IIlI111l = lllIIiI1?.["startTime"] || 0,
l1llll1I = lllIIiI1?.["endTime"] || 0,
ilIil1l1 = lllIIiI1?.["targetTime"] || 0;
IIlI1ill.activity.startTime = IIlI111l;
IIlI1ill.activity.endTime = l1llll1I;
if (IIlI111l && IIlI111l > this.timestamp()) {
this.log("活动未开始");
this.wxStop();
return;
}
if (l1llll1I && l1llll1I < this.timestamp()) {
this.log("活动已结束");
this.wxStop();
return;
}
lIIli = lIIli?.["filter"](I11I1l1 => [6, 7, 9, 13, 14, 15, 16].includes(I11I1l1.type)) ?? [];
if (lIIli.length === 0) {
this.log("垃圾或领完");
this.wxStop();
return;
}
let iIlIlI1l = await this.wxApi("wxSecond/getTaskDay", {
"activityId": this.activityId,
"pin": this.secretPin,
"uuid": lIlI1iIi
});
if (iIlIlI1l && iIlIlI1l.result) {
let lI1iii1I = iIlIlI1l.data || [];
for (let I1IliIIi of lI1iii1I) {
let ii1i1IIi = I1IliIIi.taskType;
for (let l1lil111 = 0; l1lil111 < I1IliIIi.dayMaxNumber && I1IliIIi.finishNumber === 0; l1lil111++) {
if ([2, 5].includes(ii1i1IIi)) {
let iii1liIl = I1IliIIi.activityTaskGoods.slice(l1lil111 * I1IliIIi.commodity, l1lil111 * I1IliIIi.commodity + I1IliIIi.commodity).filter(IiiiiIII => IiiiiIII.complete === 0);
for (let iiIliIi1 of iii1liIl) {
let l11l1ll1 = await this.wxApi("wxSecond/finishTask", {
"activityId": this.activityId,
"pin": this.secretPin,
"uuid": lIlI1iIi,
"taskType": ii1i1IIi,
"skuId": iiIliIi1.skuId
});
this.debug(l11l1ll1);
getTaskGoods && getTaskGoods.result && (llil1l += l11l1ll1.data?.["score"] ?? 0);
await this.sleep(500);
}
await this.sleep(500);
}
}
await this.sleep(500);
}
}
let ilIill1I = await this.wxApi("wxSecond/getTask", {
"activityId": this.activityId,
"pin": this.secretPin,
"uuid": lIlI1iIi
});
if (ilIill1I && ilIill1I.result) {
let iIllIll = ilIill1I.data || [];
for (let IlI11Il of iIllIll) {
let Iill1lI1 = IlI11Il.taskType;
if ([3].includes(Iill1lI1)) for (let iII111li = 0; iII111li < IlI11Il.dayMaxNumber && IlI11Il.finishNumber === 0; iII111li++) {
let iIiIiiI1 = await this.wxApi("wxSecond/finishTask", {
"activityId": this.activityId,
"pin": this.secretPin,
"uuid": lIlI1iIi,
"taskType": Iill1lI1,
"skuId": good.skuId
});
this.debug(iIiIiiI1);
iIiIiiI1 && iIiIiiI1.result && (llil1l += iIiIiiI1.data?.["score"] ?? 0);
await this.sleep(500);
}
if ([12].includes(Iill1lI1)) {
for (let i1lilli1 = 0; i1lilli1 < IlI11Il.dayMaxNumber && IlI11Il.finishNumber === 0; i1lilli1++) {
let IlIi1l1 = await this.wxApi("wxSecond/finishTask", {
"activityId": this.activityId,
"pin": this.secretPin,
"uuid": lIlI1iIi,
"taskType": Iill1lI1,
"skuId": ""
});
this.debug(IlIi1l1);
IlIi1l1 && IlIi1l1.result && (llil1l += IlIi1l1.data?.["score"] ?? 0);
await this.sleep(500);
}
}
await this.sleep(500);
}
}
if (llil1l === 0) {
this.log("无次数");
return;
}
llil1l = Math.min(llil1l, 7);
while (llil1l-- > 0) {
let i1llIII1 = await this.wxApi("wxSecond/checkAuth", {
"activityId": this.activityId,
"pin": this.secretPin,
"brushBane": liiiI11,
"bid": l11lilI
});
this.debug(i1llIII1);
if (!i1llIII1 || !i1llIII1.result) {
let iliI11i1 = i1llIII1?.["errorMessage"] || "获取数据失败";
this.putMsg(iliI11i1);
this.wxStop(iliI11i1);
return;
}
let lli1I11I = i1llIII1.data?.["brushResult"],
ii11IlI1 = await this.wxApi("wxSecond/start", {
"activityId": this.activityId,
"pin": this.secretPin,
"brushBane": liiiI11,
"bid": l11lilI,
"uuid": lIlI1iIi,
"seconds": ilIil1l1,
"brushResult": lli1I11I
});
this.debug(ii11IlI1);
if (ii11IlI1 && ii11IlI1.result) {
this.putMsg(ii11IlI1.data?.["draw"]?.["name"] || "空气");
if ((ii11IlI1.data?.["type"] === 7 || ii11IlI1.data?.["drawInfoType"] === 7) && ii11IlI1.data.needWriteAddress === "y") {
this.addressId = ii11IlI1.data.addressId;
this.prizeName = ii11IlI1.data?.["draw"]?.["name"];
await this.addAddress();
}
continue;
}
let Iiil1lIi = ii11IlI1?.["errorMessage"] || "游戏失败";
this.putMsg(Iiil1lIi);
this.wxStop(Iiil1lIi);
}
}
}
lIIlIIl.activity = {
"activityUrl": activityUrl
};
lIIlIIl.TaskClass = IIlIiiii;
lIIlIIl.run({
"whitelist": ["1-2000"],
"main_thread": 3
});

169
jd_wx_shopGift.js Normal file
View File

@ -0,0 +1,169 @@
/*
无线关注beta v2.0.0
https://cjhy-isv.isvjcloud.com/wxShopGift/activity?activityId=8c0c442d784745908c61ffd1561e80a7
https://lzkj-isv.isvjd.com/wxShopGift/activity?activityId=48c48940394147bc9aecfc313970952d
https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10058&templateId=7498bc9d-0be3-480d-ae9d-59b8a074566a&activityId=1735146557846773761&nodeId=101001&giftType=1&isGiftTrue=true&prd=cjwx
https://gzsl-isv.isvjcloud.com/wuxian/mobileForApp/dist/views/pages/newShopGiftBag.html?activityType=JRCX_183&activityId=1000337645
https://gzsl-isv.isvjcloud.com/wuxian/mobileForApp/dist/views/pages/shopGiftBag.html?activityType=JRCX_44&activityId=1000118676
https://txzj-isv.isvjcloud.com/shop_gift?code=OWt0dHBFaENNdGN3dWc0bmFB
export B_WX_SHOP_GIFT_URL=""
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_SHOP_GIFT_URL);
if (mode) {
activityUrl = "https://lzkj-isv.isvjd.com/wxShopGift/activity?activityId=48c48940394147bc9aecfc313970952d";
activityUrl = "https://lzkj-isv.isvjd.com/wxShopGift/activity?activityId=6d1a4409036b462e915e3a29c5c97c01";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10058&templateId=7498bc9d-0be3-480d-ae9d-59b8a074566a&activityId=1735146557846773761&nodeId=101001&giftType=1&isGiftTrue=true&prd=cjwx";
activityUrl = "https://gzsl-isv.isvjcloud.com/wuxian/mobileForApp/dist/views/pages/newShopGiftBag.html?activityType=JRCX_183&activityId=1000337645";
activityUrl = "https://gzsl-isv.isvjcloud.com/wuxian/mobileForApp/dist/views/pages/shopGiftBag.html?activityType=JRCX_44&activityId=1000118676";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10058&templateId=7498bc9d-0be3-480d-ae9d-59b8a074566a&activityId=1791015101848346625&nodeId=101001&giftType=1&isGiftTrue=true&prd=cjwx";
activityUrl = "https://txzj-isv.isvjcloud.com/shop_gift?code=b0U0MjlrRkhNNEV3dWc4aWJn";
activityUrl = "https://txzj-isv.isvjcloud.com/shop_gift?code=OWt0dHBFaENNdGN3dWc0bmFB";
}
const {
RunMode: iII1Iil1,
UserMode: IIIlIi11
} = require("./bear");
iII1Iil1.envInfo = {
"name": "无线关注beta",
"runName": "jd_wx_shopGift",
"version": "2.0.0"
};
class Ii1iliII extends IIIlIi11 {
constructor(Ii1illII, llli111i) {
super(Ii1illII, llli111i);
}
async ["userTask"]() {
await this.isvObfuscator();
if (this.mode === "txzj") {
if (!this.activityId) return this.putMsg("活动链接错误"), this.stop();
let IliIi1i = await this.taskPost("front/jd_store_user_info", {
"token": this.isvToken
});
if (!IliIi1i || IliIi1i.code !== "success") {
let II11Il1 = IliIi1i.msg || "获取用户信息失败";
return this.putMsg(II11Il1), this.wxStop(II11Il1);
}
let i111lIl = await this.taskGet(this.activityUrl),
I1ill11l = this.textToHtml(i111lIl),
l1III11l = I1ill11l(".animated").attr("data-code");
if (!l1III11l) return this.putMsg("活动已结束"), this.stop();
let ll11liiI = await this.taskPost("shop_gift/send_prize", {
"code": l1III11l
});
this.debug(ll11liiI);
if (ll11liiI && ll11liiI.code === "success") {
this.putMsg("领取成功");
return;
}
let IlllI1l = ll11liiI?.["msg"] || "领取失败";
this.putMsg(IlllI1l);
this.wxStop(IlllI1l);
return;
}
await this.getDefenseUrls();
if (this.mode === "gzsl") {
let l1iiIlIl = await this.gzslApi("getShopGiftActivity", {
"venderId": this.activityId
});
if (l1iiIlIl?.["status"] != "1") {
let i1l11Il = l1iiIlIl?.["msg"] || "获取礼包信息失败";
this.putMsg(i1l11Il);
this.wxStop(i1l11Il);
return;
}
let iilIiiii = l1iiIlIl?.["activity"] || {};
this.shopId = iilIiiii.shopId;
this.venderId = iilIiiii.venderId;
this.rule = iilIiiii.rule;
this.shopName = iilIiiii.detail;
let ll1iI1iI = iilIiiii.prizes || [],
{
startTime: liliii1I,
endTime: iIiIIiiI
} = iilIiiii;
IIIlIi11.activity.shopId = this.shopId;
IIIlIi11.activity.venderId = this.shopId;
IIIlIi11.activity.shopName = this.shopName;
IIIlIi11.activity.startTime = liliii1I;
IIIlIi11.activity.endTime = iIiIIiiI;
if (liliii1I && liliii1I > this.timestamp()) {
this.putMsg("活动未开始");
this.stop();
return;
}
if (iIiIIiiI && iIiIIiiI < this.timestamp()) {
this.putMsg("活动已结束");
this.stop();
return;
}
ll1iI1iI = ll1iI1iI.filter(i1i1iI1I => !["2"].includes(i1i1iI1I.source));
if (ll1iI1iI.length === 0) {
this.putMsg("垃圾或领完");
this.stop();
return;
}
let II11il11 = await this.gzslApi("getShopGiftPrize", {}, true);
II11il11?.["status"] === "1" ? this.putMsg("领取成功") : (this.putMsg(II11il11?.["msg"] || "领取失败"), this.wxStop(II11il11?.["msg"]));
return;
}
if (["10058"].includes(this.activityType)) {
await this.login();
let III11l1I = await this.lzkjApi("api/shopGift/drawShopGift", {
"flag": true,
"memberUser": 0,
"name": "",
"visitor": "",
"position": ""
});
this.debug(III11l1I);
if (III11l1I && III11l1I.resp_code === 0) {
this.putMsg("领取成功");
return;
}
let ll1i1I1i = III11l1I?.["resp_msg"] || "领取失败";
this.putMsg(ll1i1I1i);
this.wxStop(ll1i1I1i);
return;
}
await this.wxCommonInfo();
await this.getSimpleActInfoVo();
this.defenseUrls.length === 0 ? await this.getMyPing() : await this.initPinToken();
await this.accessLog();
let i111ilIl = await this.activityContent({
"buyerPin": this.secretPin
});
if (!i111ilIl?.["result"] || !i111ilIl?.["data"]) {
this.putMsg(i111ilIl?.["errorMessage"]);
return;
}
let li1ll1Il = await this.wxApi("wxShopGift/draw", {
"activityId": this.activityId,
"buyerPin": this.secretPin,
"hasFollow": true
});
this.debug(li1ll1Il);
if (li1ll1Il && li1ll1Il.result) this.putMsg("领取成功");else {
let Ii1iIlli = li1ll1Il?.["errorMessage"];
this.putMsg(Ii1iIlli);
this.wxStop(Ii1iIlli);
return;
}
}
}
iII1Iil1.activity = {
"activityUrl": activityUrl
};
iII1Iil1.TaskClass = Ii1iliII;
iII1Iil1.run({
"whitelist": ["1-2000"],
"main_thread": 3
});

248
jd_wx_sign.js Normal file
View File

@ -0,0 +1,248 @@
/*
签到有礼beta v2.0.0
https://cjhy-isv.isvjcloud.com/sign/signActivity?activityId=4879ca4f9b4d4e9580ac09eca30b44ac
https://lzkj-isv.isvjd.com/prod/cc/interaction/v2/10023/1001/?activityId=1752260456689242113&shopId=1000001706
https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10002&activityId=1764492473030377474&templateId=20201228083300lxqdsl011&nodeId=101001003&prd=cjwx
https://jinggeng-rc.isvjcloud.com/ql/front/showSign?id=9e80802c8dc9f04d018df48f286509c1&user_id=10028198
https://txzj-isv.isvjcloud.com/sign_in/home?a=UHpDWkVHNFhlTzhGZ2MrYUV3
export B_WX_SIGN_URL=""
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.B_WX_SIGN_URL);
if (mode) {
activityUrl = "https://lzkj-isv.isvjd.com/prod/cc/interaction/v2/10023/1001/?activityId=1763116670225666049&shopId=10034889";
activityUrl = "https://cjhy-isv.isvjcloud.com/sign/signActivity?activityId=4879ca4f9b4d4e9580ac09eca30b44ac";
activityUrl = "https://jinggeng-rc.isvjcloud.com/ql/front/showSign?id=9e80802c8dc9f04d018df48f286509c1&user_id=10028198";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10002&activityId=1764492473030377474&templateId=20201228083300lxqdsl011&nodeId=101001003&prd=cjwx";
activityUrl = "https://cjhy-isv.isvjcloud.com/sign/signActivity?activityId=4879ca4f9b4d4e9580ac09eca30b44ac";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10023&activityId=1752867173633544194&templateId=2023110802rlqd&nodeId=101001&prd=cjwx";
activityUrl = "https://txzj-isv.isvjcloud.com/sign_in/home?a=UHpDWkVHNFhlTzhGZ2MrYUV3";
activityUrl = "https://lzkj-isv.isvjcloud.com/sign/signActivity2?activityId=f6bfaa803f59453b897876ccccd08cef&venderId=1000084244&adsource=tg_storePage";
activityUrl = "https://txzj-isv.isvjcloud.com/sign_in/home?a=TUdPWlJXOFFlK29GZ2MrZUV3";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10040&activityId=1772829299506323457&templateId=20210518190900qrqd011&nodeId=101001&prd=cjwx";
activityUrl = "https://jingyun-rc.isvjcloud.com/h5/pages/SignIn/SignIn?id=2085faf335324522080865dbc20ba790&userId=1000007503";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10023&templateId=20210518190900rlqd011&activityId=1791052003950125057";
activityUrl = "https://jingyun-rc.isvjcloud.com/sign_h5/pages/BudweiserSignIn/SignIn?id=0c9992da962de13b2f205b1000dac90d&userId=1000002552";
activityUrl = "https://cjhy-isv.isvjcloud.com/sign/signActivity?activityId=b3a4db52e1dc43598b71c946bdcae9bd";
}
const {
RunMode: I,
UserMode: J
} = require("./bear");
I.envInfo = {
"name": "签到有礼beta",
"runName": "jd_wx_sign",
"version": "2.0.0"
};
let K = process.env.B_WX_SHOP_SIGN_BEAN_GOODS ? process.env.B_WX_SHOP_SIGN_BEAN_GOODS : false,
M = ["10001", "10002", "10003", "10004", "10023", "10040"];
process.env.B_WX_SIGN_ACTIVITY_TYPES ? process.env.B_WX_SIGN_ACTIVITY_TYPES.split(/[@,&|]/).forEach(e => M.push(e)) : "";
class N extends J {
constructor(e, f) {
super(e, f);
}
async ["v2Sign"](e = true) {
let g = await this.v2Api("api/" + this.activityType + "/sign");
this.debug(g);
if (g && g.code === 200) this.putMsg(g.data?.["prizeName"] || "签到成功");else {
if (g?.["message"]["includes"]("不是店铺会员") && e) {
await this.bindWithVender();
await this.sign(false);
}
}
}
async ["signPost"](e = true) {
let g = await this.hdbApi(this.hdbPrefix ? this.hdbPrefix + "front/cusActivity/cusSignPost" : "signPost");
if (g && g.succ) {
g?.["result"]?.["awardRes"]?.["needSend"] && this.putMsg(g.result?.["awardRes"]?.["dmActivityLog"]?.["awardName"] || "空气");
let j = g.result?.["signLog"]?.["continueCount"];
this.putMsg("已连续签到" + j + "天");
return;
}
let h = g?.["message"];
if (e && h?.["includes"]("关注店铺") && (await this.follow())) {
return await this.signPost(false);
}
this.putMsg(h);
this.wxStop(h);
return;
}
async ["userTask"]() {
await this.isvObfuscator();
if (this.mode === "txzj") {
if (!this.activityId) return this.putMsg("活动链接错误"), this.stop();
let h = await this.taskPost("front/jd_store_user_info", {
"token": this.isvToken
});
if (!h || h.code !== "success") {
let k = h.msg || "获取用户信息失败";
return this.putMsg(k), this.wxStop(k);
}
let i = await this.taskPost("sign_in/receive_prize", {
"pid": this.activityId
});
this.debug(i);
if (i && i.code === "success") {
this.putMsg("签到成功");
if (i?.["data"]?.["prize_title"]) switch (i?.["data"]?.["prize_title"]["type"]) {
case "coupon":
this.putMsg("优惠券");
break;
case "bean":
this.putMsg((i.data.prize_title?.["prize_title"] || i.data.prize_title?.["once_num"]) + "京豆");
break;
case "integral":
this.putMsg((i.data.prize_title?.["prize_title"] || i.data.prize_title?.["once_num"]) + "积分");
break;
case "goods":
this.putMsg("" + i.data.prize_title.prize_name);
break;
default:
this.putMsg(JSON.stringify(i?.["data"]?.["prize_title"]));
}
return;
}
let j = i?.["msg"] || "签到失败";
this.putMsg(j);
this.wxStop(j);
return;
}
if (this.mode === "v2") {
await this.login();
await this.v2Sign();
let m = await this.v2Api("api/" + this.activityType + "/calendar");
this.debug(m);
if (m && m.code === 200) {
let n = m.data.continuousSignDays;
this.putMsg("已连续签到" + n + "天");
}
return;
}
if (this.mode === "jinggeng") {
this.userId = this.userId || this.getQueryString(this.activityUrl, "userId");
this.activityId = this.activityId || this.getQueryString(this.activityUrl, "actId");
await this.setMixNick();
await this.jinggengShopInfo();
await this.taskPost("front/followShop", {
"userId": this.userId
});
let p = await this.jinggengApi("saveSignIn");
this.debug(p);
if (p && p.succ) {
if (p?.["msg"]?.["includes"]("签到成功但不需要发奖")) this.putMsg("签到成功");else {
let s = JSON.parse(p.msg);
s?.["isSendSucc"] ? this.putMsg(s?.["actLogDto"]?.["remark"]) : this.putMsg("空气");
}
return;
}
let q = p?.["msg"] || "签到失败";
this.putMsg(q);
this.wxStop(q);
return;
}
if (this.mode === "hdb") {
return this.hdbPrefix = "", this.activityUrl?.["includes"]("BudweiserSignIn") && (this.hdbEncript = true, this.hdbLoginPath = "sign_java/front/fans/login", this.hdbPrefix = "sign_java/"), await this.login(), await this.reportPVUV(this.hdbPrefix + "front/activity/reportPVUV"), await this.loadFrontAct(this.hdbPrefix + "front/activity/loadFrontAct"), await this.signPost();
}
await this.getDefenseUrls();
if (M.includes(this.activityType)) {
await this.login();
let v = ["10001", "10002", "10003", "10004"].includes(this.activityType) ? "api/task/sign/add" : "api/task/daySign/getSignClick",
w = await this.lzkjApi(v);
this.debug(w);
if (w && w.resp_code === 0) {
this.putMsg("签到成功");
let y = w?.["data"]?.["prizeName"];
this.putMsg(y);
w.data && w.data?.["prizeName"] && w.data?.["prizeType"] === 3 && w.data?.["addressId"] && w.data?.["dayTime"] === this.formatDate(Date.now(), "yyyy-MM-dd") && (this.addressId = w.data.addressId, this.prizeName = w.data?.["prizeName"], await this.saveAddress());
return;
}
let x = w?.["resp_msg"] || "签到失败";
this.putMsg(x);
this.wxStop(x);
return;
}
await this.wxCommonInfo();
await this.getSimpleActInfoVo();
this.defenseUrls.length === 0 ? await this.getMyPing() : await this.initPinToken();
await this.accessLog();
this.isSevenDay = this.activityUrl?.["includes"]("sevenDay");
this.isCj = this.activityUrl?.["includes"]("//cjhy");
if (this.index === 0) {
let z = await this.wxApi(this.isSevenDay ? "sign/sevenDay/wx/getActivity" : "sign/wx/getActivity", {
"actId": this.activityId,
"venderId": this.venderId
});
this.debug(z);
if (!z || !z.isOk) {
let A = z?.["msg"] || "活动已结束";
this.putMsg(A);
this.wxStop(A);
} else {
let B = z?.["act"]?.["startTime"],
C = z?.["act"]?.["endTime"];
J.activity.startTime = B;
J.activity.endTime = C;
if (B && B > this.timestamp()) {
return this.putMsg("活动未开始"), this.stop();
}
if (C && C < this.timestamp()) return this.putMsg("活动已结束"), this.stop();
let D = [];
if (this.isSevenDay) {
for (let Q of z?.["act"]?.["giftBean"]?.["giftConditions"] || []) {
Q.gift && (Q.gift.dayNum = Q.dayNum, D.push(Q.gift));
}
} else {
z?.["act"]?.["wxSignActivityGiftBean"]?.["hasGiftEveryDay"] === "y" && D.push(z?.["act"]?.["wxSignActivityGiftBean"]?.["gift"]);
if (z?.["act"]?.["wxSignActivityGiftBean"]?.["giftConditions"]?.["length"] > 0) {
for (let R of z?.["act"]?.["wxSignActivityGiftBean"]?.["giftConditions"] || []) {
R.gift && (R.gift.dayNum = R.dayNum, D.push(R.gift));
}
}
}
D = D.filter(T => ["6", "7", "9", "13", "14", "15", "16"].includes(T.giftType) && !T.insufficient);
if (D.length === 0) return this.putMsg("垃圾或领完"), this.stop();
if (K && D.filter(T => ["6", "7", "13", "14", "15", "16"].includes(T.giftType)).length === 0) return this.putMsg("垃圾或领完"), this.stop();
}
}
this.debug(this.isSevenDay ? "sign/sevenDay/wx/signUp" : "sign/wx/signUp");
let f = await this.wxApi(this.isSevenDay ? "sign/sevenDay/wx/signUp" : "sign/wx/signUp", {
"actId": this.activityId,
"pin": this.secretPin
});
this.debug(f);
if (f && f.isOk) {
this.putMsg("签到成功");
let U = this.isSevenDay ? f.signResult?.["gift"] : f.gift,
V = "";
if (U) {
let W = this.isSevenDay ? f.signResult?.["gift"]?.["giftName"] : f?.["gift"]?.["giftName"],
X = this.isCj ? f?.["signResult"]?.["send"] ? "" : "(已发完)" : f?.["isSend"] ? "" : "(已发完)";
V = "" + W + X;
this.addressId = f?.["addressId"];
f?.["needWriteAddress"] === "y" && this.addressId && (this.prizeName = W, await this.saveAddress());
}
this.putMsg(V);
return;
}
let g = f?.["msg"] || f?.["errMsg"] || "签到失败";
this.putMsg(g);
this.wxStop(g);
}
}
I.activity = {
"activityUrl": activityUrl
};
I.TaskClass = N;
I.run({
"whitelist": ["1-100000"],
"main_thread": 5,
"wxProxyCheck": 2
});

541
jd_wx_team.js Normal file
View File

@ -0,0 +1,541 @@
/*
组队瓜分beta v2.0.1
https://cjhy-isv.isvjcloud.com/wxTeam/activity?activityId=6d08fc8fad484372a99351bcf60e87ac
https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10033&templateId=2021062190900zdgf081&activityId=1717808855827406850&nodeId=101001&prd=cjwx
https://hdb-isv.isvjcloud.com/h5/pages/partitionTeam/partitionTeam?id=5f1c0796be4f651574e9e0f5a7e8f8af&userId=182482
https://jingyun-rc.isvjcloud.com/h5/pages/partitionTeam/partitionTeam?id=ef8d69fd0410fe9da216f1c964c54c3f&userId=13082769
https://jinggeng-isv.isvjcloud.com/ql/front/showPartition?id=9e80802f8a49b510018a4a5422db2b78&user_id=172541
export B_WX_TEAM_URL=""
export B_TEAM_LEADER_NUM="10" //车头数量 默认10
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_TEAM_URL);
if (mode) {
activityUrl = "https://cjhy-isv.isvjcloud.com/wxTeam/activity?activityId=6d08fc8fad484372a99351bcf60e87ac";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10033&templateId=2021062190900zdgf081&activityId=1717808855827406850&nodeId=101001&prd=cjwx";
activityUrl = "https://cjhydz-isv.isvjcloud.com/wxTeam/activity?activityId=54e4903a3bfc4e10a6ecdeaa58abaed1";
activityUrl = "https://jingyun-rc.isvjcloud.com/h5/pages/partitionTeam/partitionTeam?id=ef8d69fd0410fe9da216f1c964c54c3f&userId=13082769";
activityUrl = "https://jingyun-rc.isvjcloud.com/h5/pages/partitionTeam/partitionTeam?id=b44c5677f7363015af66dea0a932dd4f&userId=1000451545";
activityUrl = "https://hdb-isv.isvjcloud.com/h5/pages/partitionTeam/partitionTeam?id=5f1c0796be4f651574e9e0f5a7e8f8af&userId=182482";
activityUrl = "https://jinggeng-isv.isvjcloud.com/ql/front/showPartition?id=9e80802f8a49b510018a4a5422db2b78&user_id=172541";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/?activityType=10033&templateId=2021062190900zdgf081&activityId=1730058154674954241&nodeId=101001&prd=cjwx&shareuserid4minipg=BbrGRKytrjDMjC1fQeEoy2pCfN5ZmfvMwbWBLt73u98ENlAanVdw4/1A%207yG9wzk&shopid=1000102709&shopid=1000102709&shopid=1000102709&shopid=1000102709&shopid=1000102709&shopid=1000102709&shopid=1000102709&=&=&=&=&=&&shareUserId=1730262436920238081&shopid=1000102709";
activityUrl = "https://jingyun-rc.isvjcloud.com/h5/pages/partitionTeam/partitionTeam?id=4641a455f3611a88d3538d86f403e317&userId=13082769";
activityUrl = "https://cjhydz-isv.isvjcloud.com/wxTeam/activity?activityId=31a27ba5e17344e2a35f9d1eb9a8a826";
activityUrl = "https://cjhydz-isv.isvjcloud.com/wxTeam/activity?activityId=8827e30a920a41119f5d07f55a7e1060";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10033&templateId=2021062190900zdgf081&activityId=1744920180164960258&prd=cjwx";
activityUrl = "https://jingyun-rc.isvjcloud.com/h5/pages/partitionTeam/partitionTeam?id=34ccb6e412f39d0e620012efef471549&userId=61627";
activityUrl = "https://jingyun-rc.isvjcloud.com/h5/pages/partitionTeam/partitionTeam?id=db8e1dee18da0e3a784873fa62f579a8&userId=13082769&teamId=db8e1dee18da0e3a784873fa62f579a886";
activityUrl = "https://cjhydz-isv.isvjcloud.com/wxTeam/activity?activityId=6fb5fd5ab88e4c87be19ae8571052957";
activityUrl = "https://cjhydz-isv.isvjcloud.com/wxTeam/activity?activityId=982597cea4ec4ea1997f7c69e5f7143e";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interaction/v1/index?activityType=10033&activityId=1776856935890481154&templateId=2021062190900zdgf08&nodeId=101001&prd=crm";
activityUrl = "https://jingyun-rc.isvjcloud.com/h5/pages/partitionTeam/partitionTeam?id=d9e4888b159f560683efa86734d8a0b3&userId=1000007503&actForm=single&teamId=d9e4888b159f560683efa86734d8a0b31218";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10033&templateId=2021062190900zdgf081&activityId=1782628595081019394&nodeId=101001&prd=cjwx";
activityUrl = "https://cjhydz-isv.isvjcloud.com/wxTeam/activity?activityId=f47d2818bc8140d181844044f2aeb1d5";
activityUrl = "https://cjhydz-isv.isvjcloud.com/wxTeam/activity?activityId=644a01191a234c729066967c9cfb9877";
activityUrl = "https://cjhydz-isv.isvjcloud.com/wxTeam/activity?activityId=434e32054d3d4744a9caee80ffa70cce";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10033&activityId=1796452463138701313&templateId=2021062190900zdgf081&nodeId=101001&prd=cjwx";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10033&templateId=10202401041003302zdgfjp&activityId=1798545988361469954&nodeId=101001&prd=cjwx";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10033&activityId=1789853943779532801&templateId=2021062190900zdgf081&nodeId=101001&prd=cjwx";
activityUrl = "https://jinggeng-isv.isvjcloud.com/ql/front/showPartition?id=9e808086900394930190064ac05e41f7&user_id=1000003065";
activityUrl = "https://jingyun-rc.isvjcloud.com/h5/pages/partitionTeam/partitionTeam?id=ce4e9365871c0fd4ac075f00f1a01f69&userId=1000007503&actForm=single&teamId=ce4e9365871c0fd4ac075f00f1a01f691789";
activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/?activityType=10033&templateId=10202401031003302zdgfjp&activityId=1805130307891695618&nodeId=101001&prd=cjwx";
}
const {
RunMode: aa,
UserMode: ab,
baseCommonEnv: ac,
baseCommonEnvKey: ad
} = require("./bear");
aa.envInfo = {
"name": "组队瓜分beta",
"runName": "jd_wx_team",
"version": "2.0.1"
};
ac.leaderNum = parseInt(process.env.B_TEAM_LEADER_NUM || 17);
ad.B_TEAM_LEADER_NUM = "leaderNum";
class ae extends ab {
async ["saveCaptain"](e = true) {
let g = await this.wxApi(this.type + "/saveCaptain", {
"activityId": this.activityId,
"pin": this.secretPin,
"venderId": this.venderId,
"pinImg": "https://img10.360buyimg.com/imgzone/jfs/t1/21383/2/6633/3879/5c5138d8E0967ccf2/91da57c5e2166005.jpg"
});
this.debug(g);
if (g && g.result) {
this.signUuid = g.data?.["signUuid"];
this.log("助力码[" + this.signUuid + "]");
this.putMsg("建队");
return;
}
let h = g?.["errorMessage"] ?? "";
if (h.includes("店铺会员") && ab.activity.openCard && e) {
await this.bindWithVender();
if (this.canNotOpenCard) return this.reseCookieStatus();
return await this.saveCaptain(false);
} else h.includes("活动未开始") && (ab.activity.noStart = true, this.stop());
this.log(h);
await this.wxStopSync(h);
this.needHelp = false;
}
async ["saveMember"](e = true) {
let g = await this.wxApi(this.type + "/saveMember", {
"activityId": this.activityId,
"pin": this.secretPin,
"venderId": this.venderId,
"pinImg": "https://img10.360buyimg.com/imgzone/jfs/t1/21383/2/6633/3879/5c5138d8E0967ccf2/91da57c5e2166005.jpg",
"signUuid": this.toHelpUser.signUuid
});
this.debug(g);
if (g && g.result) {
this.log("加入[" + this.toHelpUser.pin + "]成功");
this.toHelpUser.helpedCount += 1;
if (this.toHelpUser.helpedCount >= ab.activity.maxHelpCount) {
this.toHelpUser.needHelp = false;
this.toHelpUser.putMsg("已组满");
await this.toHelpUser.writeLongCache();
}
await this.writeLongCache(this.activityId + "_invite");
return;
}
let h = g?.["errorMessage"] ?? "";
if (h.includes("满员")) {
this.toHelpUser.needHelp = false;
await this.toHelpUser.writeLongCache();
this.reseInviteStatus();
return;
} else {
if (h.includes("已经加入")) this.canHelp = false, await this.writeLongCache(this.activityId + "_invite");else {
if (h.includes("店铺会员") && ab.activity.openCard && e) {
await this.bindWithVender();
if (this.canNotOpenCard) return this.reseCookieStatus();
return await this.saveMember(false);
}
}
}
this.canHelp = false;
this.log(h);
await this.wxStopSync(h);
}
async ["getActContent"]() {
let f = await this.activityContent();
if (!f?.["result"] || !f?.["data"]) {
this.putMsg(f?.["errorMessage"]);
return;
}
this.signUuid = f.data?.["signUuid"];
let g = f.data?.["active"] ?? {},
h = g?.["maxGroup"] ?? 5,
{
prizeType: i,
startTime: j,
endTime: k
} = g;
ab.activity.startTime = j;
ab.activity.endTime = k;
i == 6 && (ab.activity.openCard = true);
ab.activity.maxHelpCount = h * 4;
let l = f.data?.["successRetList"] ?? [],
m = f.data?.["list"] ?? [],
n = f.data?.["joinMap"]?.["memberList"] ?? [];
if (n.length > 0) {
this.canHelp = false;
await this.writeLongCache(this.activityId + "_invite");
}
this.helpedCount = Math.abs(Math.max(l?.["length"] * 4 + (m?.["length"] > 0 ? m.length - 1 : 0), 0));
this.debug(this.helpedCount);
const o = this.formatDate(j, "yyyy-MM-dd HH:mm:ss") + "至" + this.formatDate(k, "yyyy-MM-dd HH:mm:ss");
ab.activity.timeStr = o;
if (j && j > Date.now()) {
let s = j - Date.now();
s < 60 * 1000 * 4 ? (this.log("活动即将开始,等待" + s / 1000 + "s"), await this.sleep(s)) : (this.putMsg("活动未开始"), i == 6 && (ab.activity.noStart = true), this.stop());
}
k && k < Date.now() && (this.putMsg("活动已结束"), await this.writeLongCacheByStop(), this.stop());
if (this.helpedCount >= ab.activity.maxHelpCount) {
this.needHelp = false;
this.putMsg("已组满");
await this.writeLongCache();
return;
}
this.signUuid ? this.log("助力码[" + this.signUuid + "]") : await this.saveCaptain();
}
async ["activityInfo"]() {
let f = await this.lzkjApi("api/task/" + this.type + "/activity", {
"shareUserId": this.shareUserId || ""
});
if (f && f.resp_code === 0) {
let i = f.data?.["groupNumber"] ?? 5;
ab.activity.maxHelpCount = i * 4;
this.helpedCount = 0;
let j = f.data?.["captainList"] ?? [];
this.createTeamNum = i - j.length;
let k = f.data?.["prizeType"] ?? 0;
k == 1 && (ab.activity.openCard = true);
ab.activity.customThread = 1;
if (j.length > 0) {
this.teamId = j[j.length - 1].id;
let m = j[j.length - 1]?.["teamList"] ?? [];
this.helpedCount = m.length > 0 ? m.length - 1 : 0;
}
let l = f.data?.["captain"];
l && (await this.writeLongCache(this.activityId + "_invite"), this.canHelp = false);
if (this.createTeamNum === 0 && this.helpedCount === 4) {
this.putMsg("已组满");
this.needHelp = false;
await this.writeLongCache();
this.exit();
}
return;
}
let g = f?.["resp_msg"];
this.log(g);
}
async ["saveCaptain100"](e = true) {
let g = await this.lzkjApi("api/task/" + this.type + "/saveCaptain");
this.debug(g);
if (g && g.resp_code === 0) {
this.putMsg("建队");
this.createTeamNum -= 1;
this.helpedCount = 0;
return;
}
let h = g?.["resp_msg"];
if (h?.["includes"]("会员") && ab.activity.openCard && e) {
await this.bindWithVender();
if (this.canNotOpenCard) return this.reseCookieStatus();
return await this.login(false), await this.saveCaptain100(false);
}
this.log(h);
await this.wxStopSync(h);
}
async ["saveMember100"](e = true, f = 0) {
let h = await this.lzkjApi("api/task/" + this.type + "/saveMember", {
"shareUserId": this.toHelpUser.shareUserId,
"teamId": this.toHelpUser.teamId
});
this.debug(h);
if (h && h.resp_code === 0) {
let j = h.data?.["canSend"];
switch (j) {
case undefined:
break;
case 4:
return this.putMsg("今日奖品已发完"), this.stop();
case 5:
case 6:
return this.putMsg("活动奖品已发完"), this.stop();
case 8:
case 9:
f++, this.log("活动人气爆棚", "retry:" + f);
if (f > 10) return this.putMsg("活动人气爆棚"), this.exit();
return await this.saveMember100(e, f);
default:
this.putMsg("canSend:" + j);
break;
}
if (h.data == true) {
this.toHelpUser.putMsg("已组满");
this.toHelpUser.needHelp = false;
await this.toHelpUser.writeLongCache();
this.reseInviteStatus();
return;
} else {
if (h.data?.["memberList"]) {
this.log("加入[" + this.toHelpUser.pin + "]成功");
await this.writeLongCache(this.activityId + "_invite");
this.toHelpUser.helpedCount += 1;
if (this.toHelpUser.helpedCount >= ab.activity.maxHelpCount) {
if (this.toHelpUser.createTeamNum > 0) {
return;
}
this.toHelpUser.needHelp = false;
this.toHelpUser.putMsg("已组满");
await this.toHelpUser.writeLongCache();
}
return;
} else {
if (JSON.stringify(h.data) == "{}") {
this.canHelp = false;
this.log("已加入或不能参加");
await this.writeLongCache(this.activityId + "_invite");
}
}
}
return;
}
let i = h?.["resp_msg"];
if (i?.["includes"]("会员") && ab.activity.openCard && e) {
await this.bindWithVender();
if (this.canNotOpenCard) return this.reseCookieStatus();
return await this.login(false), await this.saveMember100(false);
}
if (i?.["includes"]("已加入其他队伍")) {
await this.writeLongCache(this.activityId + "_invite");
}
this.canHelp = false;
this.log(i);
await this.wxStopSync(i);
}
async ["getTeamInfo"]() {
await this.getUserId();
if (!this.teamId) {
await this.activityInfo();
}
}
async ["loadPartitionTeamSetting"]() {
let f = await this.hdbApi("loadPartitionTeamSetting");
this.debug(f);
if (f && f?.["succ"]) {
let {
surPlusTeamNum: h,
hasInviteTeam: i,
hasJoinTeam: j,
partitionTeamSetting = {},
myTeamLog = {}
} = f.result;
if (j > 0) {
this.canHelp = false;
}
let {
inviterTimes: k,
teamCondition: l
} = partitionTeamSetting,
{
teamMemberNum = 0,
teamId = ""
} = myTeamLog ?? {};
ab.activity.maxHelpCount = l - 1;
this.helpedCount = Math.abs(Math.max(teamMemberNum - 1, 0));
this.createTeamNum = h;
this.log(this.helpedCount, ab.activity.maxHelpCount);
if (h <= 0) {
this.putMsg("已组满");
await this.writeLongCache();
this.needHelp = false;
return;
}
if (!teamId) return await this.startPartitionTeam();
if (teamMemberNum >= l) {
await this.startPartitionTeam();
return;
} else this.teamId = teamId;
this.debug("helpedCount", this.helpedCount, this.createTeamNum, this.teamId, ab.activity.maxHelpCount);
return;
}
let g = f?.["message"];
this.log(g);
this.needHelp = false;
}
async ["startPartitionTeam"](e = true) {
let g = await this.hdbApi("startPartitionTeam");
this.debug(g);
if (g && g?.["succ"]) {
this.teamId = g.result.teamId;
this.putMsg("建队");
this.createTeamNum -= 1;
this.helpedCount = 0;
return;
}
let h = g?.["message"];
if (h?.["includes"]("关注店铺") && (await this.follow())) return await this.sleep(1000), await this.startPartitionTeam();
if (h?.["includes"]("会员") && e) {
await this.bindWithVender();
if (this.canNotOpenCard) return this.reseCookieStatus();
return await this.sleep(1000), await this.startPartitionTeam(false);
}
this.needHelp = false;
this.log(h);
}
async ["joinPartitionTeam"](e = true) {
let g = await this.hdbApi("joinPartitionTeam", {
"teamId": this.toHelpUser.teamId,
"tidaType": "joinPartitionTeam"
});
this.debug(g);
if (g && g?.["succ"]) {
this.log("加入[" + this.toHelpUser.pin + "]成功");
this.toHelpUser.helpedCount += 1;
if (this.toHelpUser.helpedCount >= ab.activity.maxHelpCount) {
if (this.toHelpUser.createTeamNum > 0) return await this.toHelpUser.startPartitionTeam();
this.toHelpUser.needHelp = false;
this.toHelpUser.putMsg("已组满");
await this.toHelpUser.writeLongCache();
}
await this.writeLongCache(this.activityId + "_invite");
return;
}
let h = g?.["message"];
if (h?.["includes"]("关注店铺") && (await this.follow())) return await this.sleep(1000), await this.joinPartitionTeam();
if (h?.["includes"]("会员") && e) {
await this.bindWithVender();
if (this.canNotOpenCard) return this.reseCookieStatus();
return await this.sleep(1000), await this.joinPartitionTeam(false);
}
if (h?.["includes"]("已满员")) {
await this.toHelpUser.writeLongCache();
this.reseInviteStatus();
return;
}
this.canHelp = false;
this.log(h);
await this.wxStopSync(h);
}
async ["postPartition"](e = true) {
let g = await this.jinggengApi("postPartition");
this.debug(g);
if (g && (g?.["succ"] || g?.["msg"]?.["includes"]("请先完成现有组队") || g?.["msg"]?.["includes"]("机会用完了"))) {
let i = g.data?.["partitionSetting"]?.["creatTeamNum"] ?? 0,
j = g.data?.["partitionSetting"]?.["teamNum"] ?? 0,
k = g.data?.["partitionTeamLogParams"] ?? [];
this.teamId = k[0].jdCombatTeamLogs[0].teamId;
this.createTeamNum = i - k.length;
ab.activity.maxHelpCount = j - 1;
this.helpedCount = Math.abs(Math.max(k[0].jdCombatTeamLogs.length - 1, 0));
this.debug("helpedCount", this.helpedCount, this.createTeamNum, this.teamId, ab.activity.maxHelpCount);
if (this.createTeamNum <= 0 && this.helpedCount >= ab.activity.maxHelpCount) {
this.needHelp = false;
this.putMsg("已组满");
await this.writeLongCache();
return;
}
this.putMsg("建队");
return;
}
let h = g?.["msg"] || "建队失败";
if (h?.["includes"]("关注店铺") && e) return await this.taskPost("front/followShop", {
"userId": this.userId
}), await this.sleep(1000), await this.postPartition(false);
this.putMsg(h);
await this.wxStopSync(h);
this.needHelp = false;
return;
}
async ["postPartitionJoin"](e = true) {
let g = await this.jinggengApi("postPartition", {
"teamId": this.toHelpUser.teamId
});
if (g && g?.["succ"]) {
this.log("加入[" + this.toHelpUser.pin + "]成功");
this.toHelpUser.helpedCount += 1;
if (this.toHelpUser.helpedCount >= ab.activity.maxHelpCount) {
if (this.toHelpUser.createTeamNum > 0) return await this.toHelpUser.postPartition();
this.toHelpUser.needHelp = false;
this.toHelpUser.putMsg("已组满");
await this.toHelpUser.writeLongCache();
}
await this.writeLongCache(this.activityId + "_invite");
return;
}
let h = g?.["msg"] || "入队失败";
if (h?.["includes"]("满员")) {
this.toHelpUser.needHelp = false;
await this.toHelpUser.writeLongCache();
this.reseInviteStatus();
return;
}
if (h?.["includes"]("关注店铺") && e) return await this.taskPost("front/followShop", {
"userId": this.userId
}), await this.postPartitionJoin(false);
h?.["includes"]("组队机会已用完") && (await this.writeLongCache(this.activityId + "_invite"));
this.canHelp = false;
this.log(h);
await this.wxStopSync(h);
}
async ["inviteTask"](e) {
await this.hitCache(this.activityId + "_invite", this.pin, "已加入队伍", true);
this.retryCount = 2;
this.proxyRetryCount = 5;
this.toHelpUser = e;
if (!this.toHelpUser.needHelp) return;
await this.isvObfuscator();
if (this.mode === "jinggeng") {
await this.setMixNick();
await this.postPartitionJoin();
return;
}
if (this.mode == "hdb") {
const h = await this.login();
if (!(h && h.code)) return;
await this.loadFrontAct();
await this.reportPVUV();
await this.joinPartitionTeam();
return;
}
await this.getDefenseUrls();
if (["10033"].includes(this.activityType)) {
await this.login();
if (["1005", "1006", "1002"].includes(this.joinCode)) {
if (!ab.activity.openCard) return this.log(this.joinDes), this.reseCookieStatus();
await this.bindWithVender();
if (this.canNotOpenCard) return this.log(this.joinDes), this.reseCookieStatus();
await this.login(false);
}
await this.toHelpUser.activityInfo();
await this.saveMember100();
return;
}
await this.wxCommonInfo();
await this.getSimpleActInfoVo();
this.defenseUrls.length === 0 ? await this.getMyPing() : await this.initPinToken();
await this.accessLog();
await this.saveMember();
}
async ["userTask"]() {
await this.hitCache();
this.inviteMode = 2;
if (this.index >= ac.leaderNum) return this.stop();
await this.isvObfuscator();
if (this.mode === "jinggeng") {
await this.setMixNick();
await this.postPartition();
return;
}
if (this.mode == "hdb") {
const g = await this.login();
if (!(g && g.code)) return;
await this.loadFrontAct();
await this.reportPVUV();
await this.loadPartitionTeamSetting();
return;
}
await this.getDefenseUrls();
if (["10033"].includes(this.activityType)) {
await this.login();
await this.activityInfo();
if (["1005", "1006", "1002"].includes(this.joinCode)) {
if (!ab.activity.openCard) return this.log(this.joinDes), this.reseCookieStatus();
await this.bindWithVender();
if (this.canNotOpenCard) return this.log(this.joinDes), this.reseCookieStatus();
await this.login(false);
}
this.debug(this.createTeamNum, this.helpedCount);
!this.teamId && (await this.saveCaptain100());
await this.getTeamInfo();
!this.teamId && (this.needHelp = false);
return;
}
await this.wxCommonInfo();
await this.getSimpleActInfoVo();
this.defenseUrls.length === 0 ? await this.getMyPing() : await this.initPinToken();
await this.accessLog();
await this.getActContent();
}
}
aa.activity = {
"activityUrl": activityUrl
};
aa.TaskClass = ae;
aa.run({
"whitelist": ["1-20000"],
"thread": 50,
"main_thread": 20,
"inviteTask": true
});

76
jd_wx_voteDraw.js Normal file
View File

@ -0,0 +1,76 @@
/*
投票抽奖beta v1.0.0
https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10044&templateId=20210714190900tpyl011&activityId=1732698027993563138&nodeId=101001&prd=cjwx
export B_WX_VOTE_DRAW_URL=""
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_VOTE_DRAW_URL);
mode && (activityUrl = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10044&templateId=20210714190900tpyl011&activityId=1732698027993563138&nodeId=101001&prd=cjwx");
const {
RunMode: iIll1II,
UserMode: l1II11iI
} = require("./bear");
iIll1II.envInfo = {
"name": "投票抽奖beta",
"runName": "jd_wx_voteDraw",
"version": "1.0.0"
};
class iililIii extends l1II11iI {
constructor(lii1Ii1I, Iilii) {
super(lii1Ii1I, Iilii);
}
async ["userTask"]() {
await this.isvObfuscator();
await this.getDefenseUrls();
if (["10044"].includes(this.activityType)) {
await this.login();
let i1I1IlI1 = await this.lzkjApi("api/task/votePolitely/activity");
this.debug(i1I1IlI1);
if (!i1I1IlI1 || i1I1IlI1.resp_code !== 0) {
this.putMsg(i1I1IlI1?.["resp_msg"]);
this.wxStop(i1I1IlI1?.["resp_msg"]);
return;
}
let lii1i1iI = i1I1IlI1?.["data"]?.["voteSelectList"] ?? [],
I1I1i1iI = i1I1IlI1?.["data"]?.["canDraw"];
this.debug(lii1i1iI);
if (lii1i1iI?.["length"] === 0) {
let Iiiil111 = [i1I1IlI1.data.rule[0].text];
i1I1IlI1.data.votingForm === 2 && Iiiil111.push(i1I1IlI1.data.rule[1].text);
let iliIi11I = await this.lzkjApi("api/task/votePolitely/savePkResult", {
"selectVote": Iiiil111
});
this.debug(iliIi11I);
if (iliIi11I && iliIi11I.resp_code === 0) {
I1I1i1iI = true;
} else this.putMsg(iliIi11I?.["resp_msg"]), this.wxStop(iliIi11I?.["resp_msg"]);
}
if (!I1I1i1iI) return;
let il1ii1iI = await this.lzkjApi("api/prize/draw");
this.debug(il1ii1iI);
if (!il1ii1iI || il1ii1iI.resp_code !== 0) {
this.putMsg(il1ii1iI?.["resp_msg"]);
this.stop(il1ii1iI?.["resp_msg"]);
return;
}
this.putMsg(il1ii1iI.data?.["prizeName"] || "空气");
il1ii1iI.data && il1ii1iI.data?.["prizeName"] && il1ii1iI.data?.["prizeType"] === 3 && il1ii1iI.data?.["addressId"] && il1ii1iI.data?.["dayTime"] === this.formatDate(Date.now(), "yyyy-MM-dd") && (this.addressId = il1ii1iI.data.addressId, this.prizeName = il1ii1iI.data?.["prizeName"], await this.saveAddress());
}
}
}
iIll1II.activity = {
"activityUrl": activityUrl
};
iIll1II.TaskClass = iililIii;
iIll1II.run({
"whitelist": ["1-2000"],
"main_thread": 3
});

486
m_jd_wx_addCart.js Normal file
View File

@ -0,0 +1,486 @@
let IIll1I11 = __dirname.includes("bear"),
iIlIlI = decodeURIComponent(process.argv.splice(2)?.[0] || process.env.M_WX_ADD_CART_URL);
if (IIll1I11) {
iIlIlI = "https://cjhy-isv.isvjcloud.com/wxCollectionActivity/activity?activityId=8d0f86f522d34fd6828e3c75fe4091f0";
iIlIlI = "https://lzkj-isv.isvjd.com/wxCollectionActivity/activity2/0d5b8e8cb94a46bbbe4aff25dc1e9c0d?activityId=0d5b8e8cb94a46bbbe4aff25dc1e9c0d";
iIlIlI = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10024&templateId=7f4116e9-34b2-4f6d-9684-d7ca7c4b3d69&activityId=1711295984027947010&nodeId=101001&prd=cjwx";
iIlIlI = "https://lzkj-isv.isvjcloud.com/prod/cc/interaction/v1/index?activityType=10024&templateId=20210518190900jgyl01&activityId=1714916689487958018&nodeId=101001&prd=crm";
iIlIlI = "https://jingyun-rc.isvjcloud.com/h5/pages/plusGift/plusGift5?id=8e2fcea1fb4f64a11795ffbae977ba58&userId=1000350703";
iIlIlI = "https://hdb-isv.isvjcloud.com/h5/pages/plusGift/plusGift1?id=dffb05f66b3f1361ddec86a315c052e4&userId=1000461510";
iIlIlI = "https://gzsl-isv.isvjcloud.com/wuxian/mobileForApp/dist/views/pages/extraGift.html?activityType=JG_1&activityId=644508";
iIlIlI = "https://jinggeng-isv.isvjcloud.com/ql/front/showCart?id=9e8080b38b49247b018b4ab08b970281&user_id=1000453449";
iIlIlI = "https://jinggeng-isv.isvjcloud.com/ql/front/showCart?id=9e8080348b68fabe018b7e9eb6a306d9&user_id=1000361845";
iIlIlI = "https://lzkj-isv.isvjd.com/wxCollectionActivity/activity2?activityId=00175a1d132542c1a8d6321501cf3d3d";
iIlIlI = "https://hdb-isv.isvjcloud.com/h5/pages/plusGift/plusGift3?id=755f118f0066f6ffe910fc7c849e3ff5&userId=1000111946";
iIlIlI = "https://lzkj-isv.isvjd.com/wxCollectionActivity/activity2/d4f29769aea4402fbe787652f7210d1a?activityId=d4f29769aea4402fbe787652f7210d1a";
iIlIlI = "https://lzkj-isv.isvjd.com/wxCollectionActivity/activity2/6bfcc3e5963e42f4a5a49a434668dd83?activityId=6bfcc3e5963e42f4a5a49a434668dd83";
iIlIlI = "https://cjhy-isv.isvjcloud.com/wxCollectionActivity/activity?activityId=a13e2f5048f644e8abbfbc990f8034fb";
iIlIlI = "https://lzkj-isv.isvjd.com/wxCollectionActivity/activity2/0a65517110924fb893dbcd469bc44ad2?activityId=0a65517110924fb893dbcd469bc44ad2";
iIlIlI = "https://lzkj-isv.isvjd.com/wxCollectionActivity/activity2/fdc4d1c08a594a8d8769072c0452bf7e?activityId=fdc4d1c08a594a8d8769072c0452bf7e";
iIlIlI = "https://cjhy-isv.isvjcloud.com/wxCollectionActivity/activity?activityId=891b965fba8a4c599a04ea6b00dbff1c";
iIlIlI = "https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10024&templateId=20210518190900jgyl011&activityId=1740268731560538114&nodeId=101001&prd=cjwx";
iIlIlI = "https://cjhy-isv.isvjcloud.com/wxCollectionActivity/activity?activityId=8e61f7b04b184767836879c5d0030ddf";
}
const II1Ill11 = parseInt(process.env.M_WX_ADD_CART_BEAN_NUM || 2),
{
RunMode: i11Iiii,
UserMode: ilII1l1
} = require("./bear");
i11Iiii.envInfo = {
"name": "加购有礼beta",
"runName": "jd_wx_addCart",
"version": "1.0.0"
};
class iiilI111 extends ilII1l1 {
constructor(il1iiii, lI1IiIl) {
super(il1iiii, lI1IiIl);
}
async ["userTask"]() {
await this.isvObfuscator();
if (this.mode === "gzsl") {
let illliiii = await this.gzslApi("getGoodsGiftActivity", {
"venderId": this.activityId
});
this.debug(illliiii);
if (illliiii && illliiii.status === "1") {
let iIlII1I = illliiii.activity?.["startTime"],
i1llllll = illliiii.activity?.["endTime"];
this.shopId = illliiii.activity?.["shopId"];
this.venderId = illliiii.activity?.["venderId"];
this.shopName = illliiii.activity?.["detail"];
ilII1l1.activity.shopId = this.shopId;
ilII1l1.activity.venderId = this.venderId;
ilII1l1.activity.shopName = this.shopName;
ilII1l1.activity.startTime = iIlII1I;
ilII1l1.activity.endTime = i1llllll;
if (iIlII1I && iIlII1I > this.timestamp()) {
this.putMsg("活动未开始");
this.stop();
return;
}
if (i1llllll && i1llllll < this.timestamp()) {
this.putMsg("活动已结束");
this.stop();
return;
}
let Ii1iI111 = await this.gzslApi("getGoodsGiftPrizeAndWare", {}, true);
this.debug(Ii1iI111);
if (Ii1iI111 && Ii1iI111.status === "1") {
this.putMsg(Ii1iI111.data || "空气");
return;
}
let ilIli1ii = Ii1iI111?.["msg"] || "领取失败";
this.putMsg(ilIli1ii);
this.wxStop(ilIli1ii);
return;
}
return;
}
if (this.mode === "jinggeng") {
await this.setMixNick();
let lliiIiI = await this.jinggengShopInfo(),
iiIi11Il = parseInt(lliiIiI(".lastnum").text()),
I1IIIII1 = parseInt(lliiIiI("#addnum").text());
if (isNaN(iiIi11Il) || isNaN(I1IIIII1)) {
let ii1iil1l = lliiIiI("#description").text();
this.debug("重匹规则", ii1iil1l);
const lIliilIi = ii1iil1l.match(/加购(\d+)个宝贝/);
if (!lIliilIi) {
this.putMsg("未匹配到加购数量");
return;
}
iiIi11Il = parseInt(lIliilIi[1]);
I1IIIII1 = lliiIiI(".btnState2").length;
}
this.debug("needCollectionSize:" + iiIi11Il, "hasCollectionSize:" + I1IIIII1);
if (I1IIIII1 >= iiIi11Il) {
this.putMsg("已领取过");
return;
}
const iiIIi1ll = lliiIiI(".btnState1").map((iiiiili, I1lI1l11) => lliiIiI(I1lI1l11).attr("id") || lliiIiI(I1lI1l11).attr("onclick")?.["match"](/\(([^)]+)\)/)?.[1]).get();
this.debug(iiIIi1ll);
while (I1IIIII1 < iiIi11Il && iiIIi1ll.length > 0) {
await this.sleep(2000);
let IIiIIii1 = await this.jinggengApi("postAddCart", {
"itemId": iiIIi1ll.shift()
});
this.debug(IIiIIii1);
if (IIiIIii1 && IIiIIii1.succ) {
I1IIIII1++;
let I1Il1lII = IIiIIii1.msg,
Iii1Ii1I = this.parseJSON(I1Il1lII);
if (Iii1Ii1I) {
if (Iii1Ii1I?.["actLogDto"]?.["remark"]) {
this.putMsg(Iii1Ii1I?.["actLogDto"]?.["remark"]);
return;
}
}
} else {
this.putMsg(IIiIIii1?.["msg"] || "加购失败");
return;
}
}
return;
}
if (this.mode == "hdb") {
await this.login();
await this.reportPVUV();
await this.loadFrontAct();
await this.loadFrontAward();
let II1II1I = await this.hdbApi("loadAddCartSetting");
!(II1II1I && II1II1I.succ) && this.putMsg(II1II1I?.["message"]);
if (II1II1I?.["result"]?.["hasReceiveAward"]) {
this.putMsg("已领取");
return;
}
let llIiiI11 = II1II1I.result?.["addCartSetting"]?.["itemAmount"] ?? 5;
if (this.openCard === 0 && this.prizeList && this.prizeList.filter(ili1iiIl => ["JD_MARKET"].includes(ili1iiIl.awardType)).length > 0) {
await this.bindWithVender();
if (this.canNotOpenCard) return this.reseCookieStatus();
}
let iii1iIIi = await this.hdbApi("loadFrontItems");
!(iii1iIIi && iii1iIIi.succ) && this.putMsg(iii1iIIi?.["message"]);
let I11llIlI = iii1iIIi?.["result"] ?? [],
l111ill1 = I11llIlI.filter(IiI1I1I1 => IiI1I1I1.isFinish == 1).length,
l1il11li = I11llIlI.filter(ilIIliI1 => ilIIliI1.isFinish == 0);
while (l111ill1 < llIiiI11 && l1il11li.length > 0) {
let l1Il1lli = l1il11li.shift().skuId;
this.debug("加购skuId:" + l1Il1lli);
let iililIll = 4;
while (iililIll-- > 0) {
let iIIIi1l1 = await this.hdbApi("reportActionLog", {
"skuId": l1Il1lli,
"actionType": "addCart"
});
if (iIIIi1l1 && iIIIi1l1.succ) {
l111ill1++;
await this.sleep(1000);
break;
}
let Ii1li1Il = iIIIi1l1?.["message"];
if (Ii1li1Il?.["includes"]("关注店铺") && (await this.follow())) {
await this.sleep(1000);
continue;
}
if (Ii1li1Il?.["includes"]("会员") && retry) {
await this.bindWithVender();
if (this.canNotOpenCard) return this.reseCookieStatus();
await this.sleep(1000);
continue;
}
this.wxStop(Ii1li1Il);
this.putMsg(Ii1li1Il);
return;
}
}
if (l111ill1 < llIiiI11) {
this.log("加购数量不足,不领取");
return;
}
this.debug("加购完成 " + l111ill1 + " - " + llIiiI11);
let iiilIii = 2;
while (iiilIii-- > 0) {
let lIIli11l = await this.hdbApi("postAddCartFrontAct");
this.debug(lIIli11l);
if (lIIli11l && lIIli11l.succ) {
if (lIIli11l.result.succ) {
this.putMsg(lIIli11l.result?.["dmActivityLog"]?.["awardName"] || "空气");
return;
} else this.putMsg(lIIli11l.result?.["errorMsg"] || lIIli11l.result?.["message"]);
}
let IilIIli1 = lIIli11l?.["message"];
if (IilIIli1?.["includes"]("关注店铺") && (await this.follow())) {
await this.sleep(1000);
continue;
}
this.putMsg(IilIIli1);
this.wxStop(IilIIli1);
return;
}
return;
}
await this.getDefenseUrls();
if (["10024"].includes(this.activityType)) {
await this.login();
let iIIlIIil = await this.lzkjApi("api/prize/drawPrize");
if (iIIlIIil && iIIlIIil.resp_code === 0) {
if (iIIlIIil.data?.["drawNumber"] > 0) {
this.putMsg("已领取");
return;
}
let ilIIliIl = iIIlIIil.data?.["prizeInfo"] || [];
ilIIliIl = ilIIliIl.filter(il1liI1i => il1liI1i.prizeType == 1);
this.openCard = ilIIliIl.some(IillilIl => IillilIl.beanNum >= II1Ill11);
}
let liIli1ii = await this.lzkjApi("api/task/" + this.type + "/activity");
if (liIli1ii && liIli1ii.resp_code === 0) {
let ili1lIIl = liIli1ii.data?.["addWares"] || {},
Il1llli = ili1lIIl?.["skuInfoVO"] || [],
lllilliI = ili1lIIl?.["completeCount"] || 0,
iil11i1l = ili1lIIl?.["finishNum"] || 0,
I1l11Ill = ili1lIIl?.["oneClickPurchase"] || 0,
Iiilllil = ili1lIIl?.["taskId"],
iiiII11i = liIli1ii.data?.["prizeResultNum"] || 10;
Il1llli = Il1llli.filter(iil11lI1 => iil11lI1.status === 0);
if (iiiII11i <= 0) {
this.putMsg("已领完");
this.stop();
return;
}
if (iil11i1l - lllilliI > Il1llli.length) {
this.putMsg("加购商品数量错误");
this.stop();
return;
}
if (["1005", "1006", "1002"].includes(this.joinCode)) {
if (!this.openCard) return this.putMsg(this.joinDes);
await this.getShopOpenCardInfo();
await this.bindWithVender();
if (this.canNotOpenCard) return this.putMsg(this.joinDes);
await this.login(false);
}
if (I1l11Ill === 0) {
this.debug("一键加购");
let iIllill1 = await this.lzkjApi("api/task/" + this.type + "/toDo", {
"taskId": Iiilllil,
"skuId": ""
});
if (iIllill1 && iIllill1.resp_code === 0) {
this.putMsg(iIllill1.data?.["prizeName"]);
return;
}
let iI1lIIl = iIllill1?.["resp_msg"];
this.putMsg(iI1lIIl);
this.wxStop(iI1lIIl);
return;
}
let ll11ili = 0;
for (let ii11I1II = 0; ii11I1II < Il1llli.length; ii11I1II++) {
let iilI1I1I = await this.lzkjApi("api/task/" + this.type + "/toDo", {
"taskId": Iiilllil,
"skuId": Il1llli[ii11I1II].skuId
});
if (iilI1I1I && iilI1I1I.resp_code === 0) {
if (iilI1I1I.data) {
this.putMsg(iilI1I1I.data?.["prizeName"]);
return;
}
continue;
}
let illi11II = iilI1I1I?.["resp_msg"];
this.putMsg(illi11II);
if (illi11II && illi11II.includes("会员等级不足")) return;
ll11ili++;
if (ll11ili > 3) return;
this.wxStop(illi11II);
}
} else this.putMsg(liIli1ii?.["resp_msg"] || "获取任务错误"), this.wxStop(liIli1ii?.["resp_msg"]);
return;
}
await this.wxCommonInfo();
await this.getSimpleActInfoVo();
this.index === 0 && (await this.getShopInfo());
this.defenseUrls.length === 0 ? await this.getMyPing() : await this.initPinToken();
await this.accessLog();
let II1IiIli = await this.activityContent();
if (!II1IiIli?.["result"] || !II1IiIli?.["data"]) {
this.putMsg(II1IiIli?.["errorMessage"]);
return;
}
let l1II1111 = II1IiIli.data?.["cpvos"] ?? [],
ll111lII = II1IiIli.data?.["drawInfo"] ?? {},
liIllllI = II1IiIli.data?.["drawInfo"]?.["drawInfo"]?.["beanNum"],
liiiIll = II1IiIli.data?.["needCollectionSize"],
IlliIlIi = II1IiIli.data?.["hasCollectionSize"] ?? 0,
i11I1iII = II1IiIli.data?.["oneKeyAddCart"] ?? 0,
Ili11i1I = l1II1111.filter(l1Il111i => !l1Il111i.collection);
if (![6, 7, 9, 13, 14, 15, 16].includes(ll111lII.drawInfoType)) {
this.putMsg("垃圾或领完");
this.stop();
return;
}
if (liiiIll - IlliIlIi > Ili11i1I.length) {
this.putMsg("加购商品数量错误");
this.stop();
return;
}
let l1111l1I = this.activityType === 6 ? "addCart" : "collection",
ilI1I11I = this.domain.includes("cjhy") ? false : true;
if (i11I1iII === 1) {
let lil1I1iI = 5;
while (lil1I1iI-- > 0) {
let l1i1I11 = await this.wxApi("wxCollectionActivity/oneKeyAddCart", {
"activityId": this.activityId,
"pin": this.secretPin,
"productIds": JSON.stringify(Ili11i1I.map(iiiiIII => iiiiIII.skuId))
});
this.debug(l1i1I11);
if (l1i1I11 && l1i1I11.result) {
IlliIlIi = liiiIll;
break;
}
let i1lIII11 = l1i1I11?.["errorMessage"];
if (!i1lIII11) break;
if (i1lIII11.includes("购物车已经满了")) continue;
if (i1lIII11.includes("会员") && liIllllI && liIllllI >= II1Ill11) {
await this.getShopOpenCardInfo();
let I1iiIli1 = await this.bindWithVender();
if (I1iiIli1 && I1iiIli1.success && ["0", "9003"].includes(I1iiIli1.busiCode)) continue;
}
this.putMsg(i1lIII11);
this.wxStop(i1lIII11);
return;
}
} else {
if (Ili11i1I.length === 0 && ilI1I11I) {
Ili11i1I.push(l1II1111[0]);
}
while ((ilI1I11I || IlliIlIi < liiiIll) && Ili11i1I.length > 0) {
ilI1I11I = false;
let ii1li1ii = Ili11i1I.shift().productId;
this.debug("加购productId:" + ii1li1ii);
let llI11I1I = 5;
while (llI11I1I-- > 0) {
let liIlil11 = await this.wxApi("wxCollectionActivity/" + l1111l1I, {
"activityId": this.activityId,
"pin": this.secretPin,
"productId": ii1li1ii
});
this.debug(liIlil11);
if (liIlil11 && liIlil11.result) {
IlliIlIi = liIlil11.data?.["hasAddCartSize"] ?? IlliIlIi + 1;
break;
}
let IIll1ii = liIlil11?.["errorMessage"];
if (!IIll1ii) break;
if (IIll1ii.includes("购物车已经满了")) continue;
if (IIll1ii.includes("会员") && liIllllI && liIllllI >= II1Ill11) {
await this.getShopOpenCardInfo();
let l1IlIi1 = await this.bindWithVender();
if (l1IlIi1 && l1IlIi1.success && ["0", "9003"].includes(l1IlIi1.busiCode)) {
continue;
}
}
this.putMsg(IIll1ii);
this.wxStop(IIll1ii);
return;
}
}
}
if (IlliIlIi < liiiIll) {
this.log("加购数量不足,不领取");
return;
}
this.debug("加购完成 " + IlliIlIi + " - " + liiiIll);
let i1liIlII = await this.wxApi("wxCollectionActivity/getPrize", {
"activityId": this.activityId,
"pin": this.secretPin
});
this.debug(i1liIlII);
if (i1liIlII && i1liIlII.result && i1liIlII.data?.["drawOk"]) {
this.putMsg(i1liIlII.data.name);
return;
}
let l1l1li11 = i1liIlII?.["errorMessage"] || i1liIlII?.["data"]?.["errorMessage"];
if (!l1l1li11) return;
this.putMsg(l1l1li11);
this.wxStop(l1l1li11);
if (l1l1li11.includes("日奖品全部被领取")) {}
}
}
i11Iiii.activity = {
"activityUrl": iIlIlI
};
i11Iiii.TaskClass = iiilI111;
i11Iiii.run({
"whitelist": ["1-300"],
"main_thread": 3
});

27
m_jd_wx_luckDraw.js Normal file

File diff suppressed because one or more lines are too long

278
m_jd_wx_shopSign.js Normal file
View File

@ -0,0 +1,278 @@
/*
签到有礼beta v2.0.0
https://cjhy-isv.isvjcloud.com/sign/signActivity?activityId=4879ca4f9b4d4e9580ac09eca30b44ac
https://lzkj-isv.isvjd.com/prod/cc/interaction/v2/10023/1001/?activityId=1752260456689242113&shopId=1000001706
https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10002&activityId=1764492473030377474&templateId=20201228083300lxqdsl011&nodeId=101001003&prd=cjwx
https://jinggeng-rc.isvjcloud.com/ql/front/showSign?id=9e80802c8dc9f04d018df48f286509c1&user_id=10028198
https://txzj-isv.isvjcloud.com/sign_in/home?a=UHpDWkVHNFhlTzhGZ2MrYUV3
export B_WX_SIGN_URL=""
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_SHOP_SIGN_URL);
if (mode) {
}
const {
RunMode: I,
UserMode: J
} = require("./bear");
I.envInfo = {
"name": "签到有礼beta",
"runName": "jd_wx_sign",
"version": "2.0.0"
};
let K = process.env.B_WX_SHOP_SIGN_BEAN_GOODS ? process.env.B_WX_SHOP_SIGN_BEAN_GOODS : false,
M = ["10001", "10002", "10003", "10004", "10023", "10040"];
process.env.B_WX_SIGN_ACTIVITY_TYPES ? process.env.B_WX_SIGN_ACTIVITY_TYPES.split(/[@,&|]/).forEach(e => M.push(e)) : "";
class N extends J {
constructor(e, f) {
super(e, f);
}
async ["v2Sign"](e = true) {
let g = await this.v2Api("api/" + this.activityType + "/sign");
this.debug(g);
if (g && g.code === 200) this.putMsg(g.data?.["prizeName"] || "签到成功"); else {
if (g?.["message"]["includes"]("不是店铺会员") && e) {
await this.bindWithVender();
await this.sign(false);
}
}
}
async ["signPost"](e = true) {
let g = await this.hdbApi(this.hdbPrefix ? this.hdbPrefix + "front/cusActivity/cusSignPost" : "signPost");
if (g && g.succ) {
g?.["result"]?.["awardRes"]?.["needSend"] && this.putMsg(g.result?.["awardRes"]?.["dmActivityLog"]?.["awardName"] || "空气");
let j = g.result?.["signLog"]?.["continueCount"];
this.putMsg("已连续签到" + j + "天");
return;
}
let h = g?.["message"];
if (e && h?.["includes"]("关注店铺") && (await this.follow())) {
return await this.signPost(false);
}
this.putMsg(h);
this.wxStop(h);
return;
}
async ["userTask"]() {
await this.isvObfuscator();
if (this.mode === "txzj") {
if (!this.activityId) return this.putMsg("活动链接错误"), this.stop();
let h = await this.taskPost("front/jd_store_user_info", {
"token": this.isvToken
});
if (!h || h.code !== "success") {
let k = h.msg || "获取用户信息失败";
return this.putMsg(k), this.wxStop(k);
}
let i = await this.taskPost("sign_in/receive_prize", {
"pid": this.activityId
});
this.debug(i);
if (i && i.code === "success") {
this.putMsg("签到成功");
if (i?.["data"]?.["prize_title"]) switch (i?.["data"]?.["prize_title"]["type"]) {
case "coupon":
this.putMsg("优惠券");
break;
case "bean":
this.putMsg((i.data.prize_title?.["prize_title"] || i.data.prize_title?.["once_num"]) + "京豆");
break;
case "integral":
this.putMsg((i.data.prize_title?.["prize_title"] || i.data.prize_title?.["once_num"]) + "积分");
break;
case "goods":
this.putMsg("" + i.data.prize_title.prize_name);
break;
default:
this.putMsg(JSON.stringify(i?.["data"]?.["prize_title"]));
}
return;
}
let j = i?.["msg"] || "签到失败";
this.putMsg(j);
this.wxStop(j);
return;
}
if (this.mode === "v2") {
await this.login();
await this.v2Sign();
let m = await this.v2Api("api/" + this.activityType + "/calendar");
this.debug(m);
if (m && m.code === 200) {
let n = m.data.continuousSignDays;
this.putMsg("已连续签到" + n + "天");
}
return;
}
if (this.mode === "jinggeng") {
this.userId = this.userId || this.getQueryString(this.activityUrl, "userId");
this.activityId = this.activityId || this.getQueryString(this.activityUrl, "actId");
await this.setMixNick();
await this.jinggengShopInfo();
await this.taskPost("front/followShop", {
"userId": this.userId
});
let p = await this.jinggengApi("saveSignIn");
this.debug(p);
if (p && p.succ) {
if (p?.["msg"]?.["includes"]("签到成功但不需要发奖")) this.putMsg("签到成功"); else {
let s = JSON.parse(p.msg);
s?.["isSendSucc"] ? this.putMsg(s?.["actLogDto"]?.["remark"]) : this.putMsg("空气");
}
return;
}
let q = p?.["msg"] || "签到失败";
this.putMsg(q);
this.wxStop(q);
return;
}
if (this.mode === "hdb") {
return this.hdbPrefix = "", this.activityUrl?.["includes"]("BudweiserSignIn") && (this.hdbEncript = true, this.hdbLoginPath = "sign_java/front/fans/login", this.hdbPrefix = "sign_java/"), await this.login(), await this.reportPVUV(this.hdbPrefix + "front/activity/reportPVUV"), await this.loadFrontAct(this.hdbPrefix + "front/activity/loadFrontAct"), await this.signPost();
}
await this.getDefenseUrls();
if (M.includes(this.activityType)) {
await this.login();
let v = ["10001", "10002", "10003", "10004"].includes(this.activityType) ? "api/task/sign/add" : "api/task/daySign/getSignClick",
w = await this.lzkjApi(v);
this.debug(w);
if (w && w.resp_code === 0) {
this.putMsg("签到成功");
let y = w?.["data"]?.["prizeName"];
this.putMsg(y);
w.data && w.data?.["prizeName"] && w.data?.["prizeType"] === 3 && w.data?.["addressId"] && w.data?.["dayTime"] === this.formatDate(Date.now(), "yyyy-MM-dd") && (this.addressId = w.data.addressId, this.prizeName = w.data?.["prizeName"], await this.saveAddress());
return;
}
let x = w?.["resp_msg"] || "签到失败";
this.putMsg(x);
this.wxStop(x);
return;
}
await this.wxCommonInfo();
await this.getSimpleActInfoVo();
this.defenseUrls.length === 0 ? await this.getMyPing() : await this.initPinToken();
await this.accessLog();
this.isSevenDay = this.activityUrl?.["includes"]("sevenDay");
this.isCj = this.activityUrl?.["includes"]("//cjhy");
if (this.index === 0) {
let z = await this.wxApi(this.isSevenDay ? "sign/sevenDay/wx/getActivity" : "sign/wx/getActivity", {
"actId": this.activityId,
"venderId": this.venderId
});
this.debug(z);
if (!z || !z.isOk) {
let A = z?.["msg"] || "活动已结束";
this.putMsg(A);
this.wxStop(A);
} else {
let B = z?.["act"]?.["startTime"],
C = z?.["act"]?.["endTime"];
J.activity.startTime = B;
J.activity.endTime = C;
if (B && B > this.timestamp()) {
return this.putMsg("活动未开始"), this.stop();
}
if (C && C < this.timestamp()) return this.putMsg("活动已结束"), this.stop();
let D = [];
if (this.isSevenDay) {
for (let Q of z?.["act"]?.["giftBean"]?.["giftConditions"] || []) {
Q.gift && (Q.gift.dayNum = Q.dayNum, D.push(Q.gift));
}
} else {
z?.["act"]?.["wxSignActivityGiftBean"]?.["hasGiftEveryDay"] === "y" && D.push(z?.["act"]?.["wxSignActivityGiftBean"]?.["gift"]);
if (z?.["act"]?.["wxSignActivityGiftBean"]?.["giftConditions"]?.["length"] > 0) {
for (let R of z?.["act"]?.["wxSignActivityGiftBean"]?.["giftConditions"] || []) {
R.gift && (R.gift.dayNum = R.dayNum, D.push(R.gift));
}
}
}
D = D.filter(T => ["6", "7", "9", "13", "14", "15", "16"].includes(T.giftType) && !T.insufficient);
if (D.length === 0) return this.putMsg("垃圾或领完"), this.stop();
if (K && D.filter(T => ["6", "7", "13", "14", "15", "16"].includes(T.giftType)).length === 0) return this.putMsg("垃圾或领完"), this.stop();
}
}
this.debug(this.isSevenDay ? "sign/sevenDay/wx/signUp" : "sign/wx/signUp");
let f = await this.wxApi(this.isSevenDay ? "sign/sevenDay/wx/signUp" : "sign/wx/signUp", {
"actId": this.activityId,
"pin": this.secretPin
});
this.debug(f);
if (f && f.isOk) {
this.putMsg("签到成功");
let U = this.isSevenDay ? f.signResult?.["gift"] : f.gift,
V = "";
if (U) {
let W = this.isSevenDay ? f.signResult?.["gift"]?.["giftName"] : f?.["gift"]?.["giftName"],
X = this.isCj ? f?.["signResult"]?.["send"] ? "" : "(已发完)" : f?.["isSend"] ? "" : "(已发完)";
V = "" + W + X;
this.addressId = f?.["addressId"];
f?.["needWriteAddress"] === "y" && this.addressId && (this.prizeName = W, await this.saveAddress());
}
this.putMsg(V);
return;
}
let g = f?.["msg"] || f?.["errMsg"] || "签到失败";
this.putMsg(g);
this.wxStop(g);
}
}
I.activity = {
"activityUrl": activityUrl
};
I.TaskClass = N;
I.run({
"whitelist": ["1-100000"],
"main_thread": 5,
"wxProxyCheck": 2
});

872
sendNotify.js Normal file

File diff suppressed because one or more lines are too long