Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lukesyy committed Jan 10, 2022
1 parent ce8ab40 commit 2779475
Show file tree
Hide file tree
Showing 10 changed files with 3,452 additions and 158 deletions.
115 changes: 28 additions & 87 deletions JS_USER_AGENTS.js

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"jd_nhs_red": [0,12,23],
"jd_city": 6,
"jd_ddworld_exchange": [0],
"jd_m_sign":[0],
"jd_computer": [0],
Expand Down Expand Up @@ -27,6 +29,7 @@
"jd_jdzz": [1],
"jd_jin_tie": [1],
"jd_joy_feedPets": 1,
"jd_joy_park": [3, 6, 9, 12, 15, 18, 21],
"jd_joy_park_task": [6, 12, 18],
"jd_jxmc": [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22],
"jd_kd": [3],
Expand All @@ -42,13 +45,12 @@
"jd_sgmh": [8],
"jd_shop": [1],
"jd_speed_redpocke": [2, 22],
"jd_superBrand": [14,20],
"jd_superBrand": [10,14,20],
"jd_tyt": [6, 10, 14, 18, 22],
"jd_wish": [1, 3],
"jd_wsdlb": [6, 12, 18],
"jd_z_health_energy": [6, 8, 10, 12, 14, 16, 18, 20, 22],
"jd_zjb": [7],
"jd_car": [7],
"jd_zsign":[10],
"jd_sxLottery":[10],
"jd_genz":[13],
Expand All @@ -59,6 +61,10 @@
"jd_fanli": [10],
"jd_lxLottery": [10],
"jd_mofang_ex": [10],
"jd_mpdzcar": [10],
"jd_mpdzcar_game": [5,9,13],
"jd_mpdzcar_help": [7],
"jd_zhanianshou": [10, 13, 19],
"jd_gold_sign": [9],
"jx_sign_xd": [5,13],
"jd_bean_change": [17],
Expand All @@ -83,4 +89,4 @@
"timeout": 55
}
}
}
}
102 changes: 89 additions & 13 deletions jd_bean_change.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ let DisableCash = "false";
let llShowMonth = false;
let Today = new Date();
let strAllNotify="";
let strSubNotify="";
let llPetError=false;
let strGuoqi="";
let RemainMessage = '\n';
Expand All @@ -69,6 +70,7 @@ RemainMessage += '【东东萌宠】京东->我的->东东萌宠,完成是京东
RemainMessage += '【领现金】京东->我的->东东萌宠->领现金(微信提现+京东红包)\n';
RemainMessage += '【东东农场】京东->我的->东东农场,完成是京东红包,可以用于京东app的任意商品\n';
RemainMessage += '【京喜工厂】京喜->我的->京喜工厂,完成是商品红包,用于购买指定商品(不兑换会过期)\n';
RemainMessage += '【京东金融】京东金融app->我的->养猪猪,完成是白条支付券,支付方式选白条支付时立减.\n';
RemainMessage += '【其他】京喜红包只能在京喜使用,其他同理';

let WP_APP_TOKEN_ONE = "";
Expand Down Expand Up @@ -129,21 +131,21 @@ if ($.isNode() && process.env.BEANCHANGE_DISABLECASH) {
//EnableMonth = process.env.BEANCHANGE_ENABLEMONTH;
//}

if ($.isNode() && process.env.BEANCHANGE_ALLNOTIFY) {

/* var strTempNotify=process.env.BEANCHANGE_ALLNOTIFY ? process.env.BEANCHANGE_ALLNOTIFY.split('&') : [];
if (strTempNotify.length > 0) {
for (var TempNotifyl in strTempNotify) {
strAllNotify+=strTempNotify[TempNotifyl]+'\n';
}
} */
if ($.isNode() && process.env.BEANCHANGE_ALLNOTIFY) {
strAllNotify=process.env.BEANCHANGE_ALLNOTIFY;
console.log(`检测到设定了公告,将在推送信息中置顶显示...`);
strAllNotify = `【✨✨✨✨公告✨✨✨✨】\n`+strAllNotify;
console.log(strAllNotify);
console.log(strAllNotify+"\n");
strAllNotify +=`\n🎏🎏🎏🎏🎏🎏🎏🎏🎏🎏🎏🎏🎏`
}

if ($.isNode() && process.env.BEANCHANGE_SUBNOTIFY) {
strSubNotify=process.env.BEANCHANGE_SUBNOTIFY;
strSubNotify+="\n";
console.log(`检测到预览置顶内容,将在一对一推送的预览显示...\n`);
}


if (EnableMonth == "true" && Today.getDate() == 1 && Today.getHours() > 17)
llShowMonth = true;

Expand Down Expand Up @@ -218,6 +220,7 @@ if ($.isNode()) {
$.todayinJxBean=0;
$.todayOutJxBean=0;
$.xibeanCount = 0;
$.PigPet = '';
TempBaipiao = "";
strGuoqi="";
console.log(`******开始查询【京东账号${$.index}${$.nickName || $.UserName}*********`);
Expand Down Expand Up @@ -268,6 +271,7 @@ if ($.isNode()) {
await GetJxBeanInfo();
await jxbean();
}
await GetPigPetInfo();
await showMsg();
if (intPerSent > 0) {
if ((i + 1) % intPerSent == 0) {
Expand Down Expand Up @@ -590,7 +594,7 @@ async function showMsg() {
}
ReturnMessage += `\n`;
ReturnMessage += `【当前喜豆】${$.xibeanCount}喜豆(≈${($.xibeanCount/ 100).toFixed(2)}元)\n`;
strsummary += `【当前喜豆】${$.xibeanCount}喜豆(≈${($.xibeanCount/ 100).toFixed(2)}元)\n`;
strsummary += `【当前喜豆】${$.xibeanCount}(≈${($.xibeanCount/ 100).toFixed(2)}元)\n`;
}


Expand Down Expand Up @@ -729,6 +733,24 @@ async function showMsg() {

}

if ($.PigPet) {
if (userIndex2 != -1) {
ReceiveMessageGp2 += `【账号${IndexGp2} ${$.nickName || $.UserName}${$.PigPet} (金融养猪)\n`;
}
if (userIndex3 != -1) {
ReceiveMessageGp3 += `【账号${IndexGp3} ${$.nickName || $.UserName}${$.PigPet} (金融养猪)\n`;
}
if (userIndex4 != -1) {
ReceiveMessageGp4 += `【账号${IndexGp4} ${$.nickName || $.UserName}${$.PigPet} (金融养猪)\n`;
}
if (userIndex2 == -1 && userIndex3 == -1 && userIndex4 == -1) {
allReceiveMessage += `【账号${IndexAll} ${$.nickName || $.UserName}${$.PigPet} (金融养猪)\n`;
}

TempBaipiao += `【金融养猪】${$.PigPet} 可以兑换了!\n`;

}

llPetError=false;
const response = await PetRequest('energyCollect');
const initPetTownRes = await PetRequest('initPetTown');
Expand Down Expand Up @@ -816,7 +838,7 @@ async function showMsg() {
ReturnMessage=`【账号名称】${$.nickName || $.UserName}\n`+ReturnMessage;

if (TempBaipiao) {
strsummary=TempBaipiao +strsummary;
strsummary=strSubNotify+TempBaipiao +strsummary;
TempBaipiao = `【⏰商品白嫖活动提醒⏰】\n` + TempBaipiao;
ReturnMessage = TempBaipiao + `\n` + ReturnMessage;
}
Expand Down Expand Up @@ -1469,8 +1491,8 @@ function getMs() {
console.log(`getMs API请求失败,请检查网路重试`)
} else {
if (safeGet(data)) {
data = JSON.parse(data)
if (data.code === 2041 || data.code === 2042) {
data = JSON.parse(data);
if (data.result.assignment.assignmentPoints) {
$.JdMsScore = data.result.assignment.assignmentPoints || 0
}
}
Expand Down Expand Up @@ -2307,6 +2329,60 @@ function timeFormat(time) {
return date.getFullYear() + '-' + ((date.getMonth() + 1) >= 10 ? (date.getMonth() + 1) : '0' + (date.getMonth() + 1)) + '-' + (date.getDate() >= 10 ? date.getDate() : '0' + date.getDate());
}


function GetPigPetInfo() {
return new Promise(async resolve => {
const body = {
"shareId": "",
"source": 2,
"channelLV": "juheye",
"riskDeviceParam": "{}",
}
$.post(taskPetPigUrl('pigPetLogin', body), async(err, resp, data) => {
try {
if (err) {
console.log(`${JSON.stringify(err)}`)
console.log(`GetPigPetInfo API请求失败,请检查网路重试`)
} else {
if (data) {
data = JSON.parse(data);
if (data.resultData.resultData.wished && data.resultData.resultData.wishAward) {
$.PigPet=`${data.resultData.resultData.wishAward.name}`
}
} else {
console.log(`GetPigPetInfo: 京东服务器返回空数据`)
}
}
} catch (e) {
$.logErr(e, resp)
}
finally {
resolve();
}
})
})
}


function taskPetPigUrl(function_id, body) {
return {
url: `https://ms.jr.jd.com/gw/generic/uc/h5/m/${function_id}?_=${Date.now()}`,
body: `reqData=${encodeURIComponent(JSON.stringify(body))}`,
headers: {
'Accept': `*/*`,
'Origin': `https://u.jr.jd.com`,
'Accept-Encoding': `gzip, deflate, br`,
'Cookie': cookie,
'Content-Type': `application/x-www-form-urlencoded;charset=UTF-8`,
'Host': `ms.jr.jd.com`,
'Connection': `keep-alive`,
'User-Agent': UA,
'Referer': `https://u.jr.jd.com/`,
'Accept-Language': `zh-cn`
}
}
}

function GetDateTime(date) {

var timeString = "";
Expand Down
Loading

0 comments on commit 2779475

Please sign in to comment.