Browse Source

完善清理活动

main
haptear 3 years ago
parent
commit
f0b5ee537b
  1. 30
      58tc.js

30
58tc.js

@ -246,6 +246,20 @@ class UserInfo {
//打扫房间 //打扫房间
async houseClean () { async houseClean () {
let furnitureId = await this.houseGetCleanId();
while (furnitureId != '0') {
url = `https://lovely-house.58.com/housework/clean`
body = `furnitureId=${index}`
urlObject = populateUrlObject(url, this.cookie, body)
await httpRequest('post', urlObject)
result = httpResult;
//if(result.code == 0)
//break;
furnitureId = await houseGetCleanId();
}
}
async houseGetCleanId () {
let url = `https://lovely-house.58.com/housework/get` let url = `https://lovely-house.58.com/housework/get`
let body = `` let body = ``
let urlObject = populateUrlObject(url, this.cookie, body) let urlObject = populateUrlObject(url, this.cookie, body)
@ -255,19 +269,11 @@ class UserInfo {
//console.log(result) //console.log(result)
if (result.code == 0) { if (result.code == 0) {
if (!result.result || !result.result.houseworkTaskVOList || result.result.houseworkTaskVOList.length == 0) if (!result.result || !result.result.houseworkTaskVOList || result.result.houseworkTaskVOList.length == 0)
return; return '0';
for (let index = 1; index < 10; index++) { console.log(`账号[${this.index}] 清理房间 ${result.result.houseworkTaskVOList[0].tip}`);
url = `https://lovely-house.58.com/housework/clean` return result.result.houseworkTaskVOList[0].furnitureId;
body = `furnitureId=${index}`
urlObject = populateUrlObject(url, this.cookie, body)
await httpRequest('post', urlObject)
result = httpResult;
//if(result.code == 0)
//break;
}
} else {
console.log(`账号[${this.index}]查询打扫房间状态失败: ${result.message}`)
} }
return '0';
} }
async houseWithdrawPage () { async houseWithdrawPage () {

Loading…
Cancel
Save