增加收取美妆币功能
This commit is contained in:
20
jd_beauty.js
20
jd_beauty.js
@@ -64,7 +64,9 @@ const JD_API_HOST = 'https://api.m.jd.com/client.action';
|
||||
if ($.accountCheck) {
|
||||
await jdBeauty();
|
||||
}
|
||||
if($.accountCheck){ helpInfo = $.helpInfo;}
|
||||
if ($.accountCheck) {
|
||||
helpInfo = $.helpInfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
})()
|
||||
@@ -106,14 +108,15 @@ async function accountCheck(){
|
||||
$.accountCheck = false;
|
||||
// $.init=true;
|
||||
client.close();
|
||||
console.log(`${vo.msg},跳过此账号`)};
|
||||
console.log(`${vo.msg},跳过此账号`)
|
||||
}
|
||||
} else if (vo.action === "get_user") {
|
||||
// $.init=true;
|
||||
$.accountCheck = true;
|
||||
client.close();
|
||||
console.log(`${vo.msg},账号正常`);
|
||||
}
|
||||
};
|
||||
}
|
||||
client.onclose = (e) => {
|
||||
$.hasDone = true;
|
||||
// console.log(client.readyState);
|
||||
@@ -160,7 +163,7 @@ async function mr() {
|
||||
client.send(`ping`)
|
||||
await $.wait(1000)
|
||||
}
|
||||
console.log(helpInfo);
|
||||
console.log('helpInfo', helpInfo);
|
||||
for (let help of helpInfo) {
|
||||
client.send(help);
|
||||
}
|
||||
@@ -192,6 +195,7 @@ async function mr() {
|
||||
await $.wait(1000)
|
||||
// 获得福利中心
|
||||
client.send(`{"msg":{"type":"action","args":{},"action":"get_benefit"}}`)
|
||||
client.send(`{"msg":{"type":"action","args":{},"action":"collect_coins"}}`);
|
||||
};
|
||||
|
||||
client.onclose = () => {
|
||||
@@ -433,6 +437,14 @@ async function mr() {
|
||||
console.log(`生产信息获取失败,错误信息${vo.msg}`)
|
||||
}
|
||||
break
|
||||
case "collect_coins":
|
||||
if (vo.code === '200' || vo.code === 200) {
|
||||
// console.log(`product_produce:${JSON.stringify(vo)}`)
|
||||
console.log(`收取成功,获得${vo['data']['coins']}美妆币,当前总美妆币:${vo['data']['user_coins']}\n`)
|
||||
} else {
|
||||
console.log(`收取美妆币失败,错误信息${vo.msg}`)
|
||||
}
|
||||
break
|
||||
case "product_producing":
|
||||
if (vo.code === '200' || vo.code === 200) {
|
||||
for (let product of vo.data) {
|
||||
|
||||
@@ -101,7 +101,7 @@ const JD_API_HOST = 'https://api.m.jd.com/api';
|
||||
// console.log(nowTs, $.startTime, $.endTime)
|
||||
for (let id of $.newAcids) {
|
||||
// $.activityId = id;
|
||||
await receiveRedRain(id);
|
||||
if (id) await receiveRedRain(id);
|
||||
}
|
||||
// await showMsg();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user