Skip to content

Commit

Permalink
Update jd_bean_change.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ccwav committed Oct 23, 2021
1 parent 7981d56 commit d04c20d
Showing 1 changed file with 62 additions and 60 deletions.
122 changes: 62 additions & 60 deletions jd_bean_change.js
Original file line number Diff line number Diff line change
Expand Up @@ -628,63 +628,65 @@ async function showMsg() {
TempBaipiao += `【京喜工厂】${$.jxFactoryReceive} 可以兑换了!\n`;

}

const response = await PetRequest('energyCollect');
const initPetTownRes = await PetRequest('initPetTown');
if (initPetTownRes.code === '0' && initPetTownRes.resultCode === '0' && initPetTownRes.message === 'success') {
$.petInfo = initPetTownRes.result;
if ($.petInfo.userStatus === 0) {
ReturnMessage += `【东东萌宠】活动未开启!\n`;
} else if ($.petInfo.petStatus === 5) {
ReturnMessage += `【东东萌宠】${$.petInfo.goodsInfo.goodsName}已可领取!\n`;
TempBaipiao += `【东东萌宠】${$.petInfo.goodsInfo.goodsName}已可领取!\n`;
if (userIndex2 != -1) {
ReceiveMessageGp2 += `【账号${IndexGp2} ${$.nickName || $.UserName}${$.petInfo.goodsInfo.goodsName}可以兑换了! (东东萌宠)\n`;
}
if (userIndex3 != -1) {
ReceiveMessageGp3 += `【账号${IndexGp3} ${$.nickName || $.UserName}${$.petInfo.goodsInfo.goodsName}可以兑换了! (东东萌宠)\n`;
}
if (userIndex4 != -1) {
ReceiveMessageGp4 += `【账号${IndexGp4} ${$.nickName || $.UserName}${$.petInfo.goodsInfo.goodsName}可以兑换了! (东东萌宠)\n`;
}
if (userIndex2 == -1 && userIndex3 == -1 && userIndex4 == -1) {
allReceiveMessage += `【账号${IndexAll} ${$.nickName || $.UserName}${$.petInfo.goodsInfo.goodsName}可以兑换了! (东东萌宠)\n`;
}
} else if ($.petInfo.petStatus === 6) {
TempBaipiao += `【东东萌宠】未选择物品! \n`;
if (userIndex2 != -1) {
WarnMessageGp2 += `【账号${IndexGp2} ${$.nickName || $.UserName}】未选择物品! (东东萌宠)\n`;
}
if (userIndex3 != -1) {
WarnMessageGp3 += `【账号${IndexGp3} ${$.nickName || $.UserName}】未选择物品! (东东萌宠)\n`;
}
if (userIndex4 != -1) {
WarnMessageGp4 += `【账号${IndexGp4} ${$.nickName || $.UserName}】未选择物品! (东东萌宠)\n`;
}
if (userIndex2 == -1 && userIndex3 == -1 && userIndex4 == -1) {
allWarnMessage += `【账号${IndexAll} ${$.nickName || $.UserName}】未选择物品! (东东萌宠)\n`;
}
} else if (response.resultCode === '0') {
ReturnMessage += `【东东萌宠】${$.petInfo.goodsInfo.goodsName}`;
ReturnMessage += `(${(response.result.medalPercent).toFixed(0)}%,${response.result.medalNum}/${response.result.medalNum+response.result.needCollectMedalNum}块)\n`;
} else if (!$.petInfo.goodsInfo) {
ReturnMessage += `【东东萌宠】暂未选购新的商品!\n`;
TempBaipiao += `【东东萌宠】暂未选购新的商品! \n`;
if (userIndex2 != -1) {
WarnMessageGp2 += `【账号${IndexGp2} ${$.nickName || $.UserName}】暂未选购新的商品! (东东萌宠)\n`;
}
if (userIndex3 != -1) {
WarnMessageGp3 += `【账号${IndexGp3} ${$.nickName || $.UserName}】暂未选购新的商品! (东东萌宠)\n`;
}
if (userIndex4 != -1) {
WarnMessageGp4 += `【账号${IndexGp4} ${$.nickName || $.UserName}】暂未选购新的商品! (东东萌宠)\n`;
}
if (userIndex2 == -1 && userIndex3 == -1 && userIndex4 == -1) {
allWarnMessage += `【账号${IndexAll} ${$.nickName || $.UserName}】暂未选购新的商品! (东东萌宠)\n`;
}
if(initPetTownRes){
if (initPetTownRes.code === '0' && initPetTownRes.resultCode === '0' && initPetTownRes.message === 'success') {
$.petInfo = initPetTownRes.result;
if ($.petInfo.userStatus === 0) {
ReturnMessage += `【东东萌宠】活动未开启!\n`;
} else if ($.petInfo.petStatus === 5) {
ReturnMessage += `【东东萌宠】${$.petInfo.goodsInfo.goodsName}已可领取!\n`;
TempBaipiao += `【东东萌宠】${$.petInfo.goodsInfo.goodsName}已可领取!\n`;
if (userIndex2 != -1) {
ReceiveMessageGp2 += `【账号${IndexGp2} ${$.nickName || $.UserName}${$.petInfo.goodsInfo.goodsName}可以兑换了! (东东萌宠)\n`;
}
if (userIndex3 != -1) {
ReceiveMessageGp3 += `【账号${IndexGp3} ${$.nickName || $.UserName}${$.petInfo.goodsInfo.goodsName}可以兑换了! (东东萌宠)\n`;
}
if (userIndex4 != -1) {
ReceiveMessageGp4 += `【账号${IndexGp4} ${$.nickName || $.UserName}${$.petInfo.goodsInfo.goodsName}可以兑换了! (东东萌宠)\n`;
}
if (userIndex2 == -1 && userIndex3 == -1 && userIndex4 == -1) {
allReceiveMessage += `【账号${IndexAll} ${$.nickName || $.UserName}${$.petInfo.goodsInfo.goodsName}可以兑换了! (东东萌宠)\n`;
}
} else if ($.petInfo.petStatus === 6) {
TempBaipiao += `【东东萌宠】未选择物品! \n`;
if (userIndex2 != -1) {
WarnMessageGp2 += `【账号${IndexGp2} ${$.nickName || $.UserName}】未选择物品! (东东萌宠)\n`;
}
if (userIndex3 != -1) {
WarnMessageGp3 += `【账号${IndexGp3} ${$.nickName || $.UserName}】未选择物品! (东东萌宠)\n`;
}
if (userIndex4 != -1) {
WarnMessageGp4 += `【账号${IndexGp4} ${$.nickName || $.UserName}】未选择物品! (东东萌宠)\n`;
}
if (userIndex2 == -1 && userIndex3 == -1 && userIndex4 == -1) {
allWarnMessage += `【账号${IndexAll} ${$.nickName || $.UserName}】未选择物品! (东东萌宠)\n`;
}
} else if (response.resultCode === '0') {
ReturnMessage += `【东东萌宠】${$.petInfo.goodsInfo.goodsName}`;
ReturnMessage += `(${(response.result.medalPercent).toFixed(0)}%,${response.result.medalNum}/${response.result.medalNum+response.result.needCollectMedalNum}块)\n`;
} else if (!$.petInfo.goodsInfo) {
ReturnMessage += `【东东萌宠】暂未选购新的商品!\n`;
TempBaipiao += `【东东萌宠】暂未选购新的商品! \n`;
if (userIndex2 != -1) {
WarnMessageGp2 += `【账号${IndexGp2} ${$.nickName || $.UserName}】暂未选购新的商品! (东东萌宠)\n`;
}
if (userIndex3 != -1) {
WarnMessageGp3 += `【账号${IndexGp3} ${$.nickName || $.UserName}】暂未选购新的商品! (东东萌宠)\n`;
}
if (userIndex4 != -1) {
WarnMessageGp4 += `【账号${IndexGp4} ${$.nickName || $.UserName}】暂未选购新的商品! (东东萌宠)\n`;
}
if (userIndex2 == -1 && userIndex3 == -1 && userIndex4 == -1) {
allWarnMessage += `【账号${IndexAll} ${$.nickName || $.UserName}】暂未选购新的商品! (东东萌宠)\n`;
}

}
}
}

ReturnMessage += `🧧🧧🧧红包明细🧧🧧🧧\n`;
ReturnMessage += `${$.message}`;

Expand Down Expand Up @@ -889,7 +891,7 @@ async function jdCash() {
try {
if (err) {
console.log(`${JSON.stringify(err)}`)
console.log(`${$.name} API请求失败,请检查网路重试`)
console.log(`jdCash API请求失败,请检查网路重试`)
} else {
if (safeGet(data)) {
data = JSON.parse(data);
Expand Down Expand Up @@ -1103,7 +1105,7 @@ function getJingBeanBalanceDetail(page) {
try {
if (err) {
console.log(`${JSON.stringify(err)}`)
console.log(`${$.name} API请求失败,请检查网路重试`)
console.log(`getJingBeanBalanceDetail API请求失败,请检查网路重试`)
} else {
if (data) {
data = JSON.parse(data);
Expand Down Expand Up @@ -1141,7 +1143,7 @@ function queryexpirejingdou() {
try {
if (err) {
console.log(`${JSON.stringify(err)}`)
console.log(`${$.name} API请求失败,请检查网路重试`)
console.log(`queryexpirejingdou API请求失败,请检查网路重试`)
} else {
if (data) {
// console.log(data)
Expand Down Expand Up @@ -1189,7 +1191,7 @@ function redPacket() {
try {
if (err) {
console.log(`${JSON.stringify(err)}`)
console.log(`${$.name} API请求失败,请检查网路重试`)
console.log(`redPacket API请求失败,请检查网路重试`)
} else {
if (data) {
data = JSON.parse(data).data;
Expand Down Expand Up @@ -1303,7 +1305,7 @@ function getMs() {
try {
if (err) {
console.log(`${err},${jsonParse(resp.body)['message']}`)
console.log(`${$.name} API请求失败,请检查网路重试`)
console.log(`getMs API请求失败,请检查网路重试`)
} else {
if (safeGet(data)) {
data = JSON.parse(data)
Expand Down Expand Up @@ -1495,7 +1497,7 @@ function cash() {
try {
if (err) {
console.log(`${JSON.stringify(err)}`)
console.log(`${$.name} API请求失败,请检查网路重试`)
console.log(`cash API请求失败,请检查网路重试`)
} else {
if (safeGet(data)) {
data = JSON.parse(data);
Expand Down Expand Up @@ -1568,7 +1570,7 @@ async function JxmcGetRequest() {
try {
if (err) {
console.log(`${JSON.stringify(err)}`)
console.log(`API请求失败,请检查网路重试`)
console.log(`JxmcGetRequest API请求失败,请检查网路重试`)
$.runFlag = false;
console.log(`请求失败`)
} else {
Expand Down Expand Up @@ -1689,7 +1691,7 @@ function GetCommodityDetails() {
try {
if (err) {
console.log(`${JSON.stringify(err)}`)
console.log(`${$.name} API请求失败,请检查网路重试`)
console.log(`GetCommodityDetails API请求失败,请检查网路重试`)
} else {
if (safeGet(data)) {
data = JSON.parse(data);
Expand Down

0 comments on commit d04c20d

Please sign in to comment.