()
| 227 | } |
| 228 | //日常任务 |
| 229 | async function petTask() { |
| 230 | for (let item of $.getPetTaskConfigRes.datas) { |
| 231 | const joinedCount = item.joinedCount || 0; |
| 232 | if (item['receiveStatus'] === 'chance_full') { |
| 233 | console.log(`${item.taskName} 任务已完成`) |
| 234 | continue |
| 235 | } |
| 236 | //每日签到 |
| 237 | if (item['taskType'] === 'SignEveryDay') { |
| 238 | if (item['receiveStatus'] === 'chance_left') { |
| 239 | console.log('每日签到未完成,需要自己手动去微信小程序【来客有礼】签到,可获得京豆奖励') |
| 240 | } else if (item['receiveStatus'] === 'unreceive') { |
| 241 | //已签到,领取签到后的狗粮 |
| 242 | const res = await getFood('SignEveryDay'); |
| 243 | console.log(`领取每日签到狗粮结果:${res.data}`); |
| 244 | } |
| 245 | } |
| 246 | //每日赛跑 |
| 247 | if (item['taskType'] === 'race') { |
| 248 | if (item['receiveStatus'] === 'chance_left') { |
| 249 | console.log('每日赛跑未完成') |
| 250 | } else if (item['receiveStatus'] === 'unreceive') { |
| 251 | const res = await getFood('race'); |
| 252 | console.log(`领取每日赛跑狗粮结果:${res.data}`); |
| 253 | } |
| 254 | } |
| 255 | //每日兑换 |
| 256 | if (item['taskType'] === 'exchange') { |
| 257 | if (item['receiveStatus'] === 'chance_left') { |
| 258 | console.log('每日兑换未完成') |
| 259 | } else if (item['receiveStatus'] === 'unreceive') { |
| 260 | const res = await getFood('exchange'); |
| 261 | console.log(`领取每日兑换狗粮结果:${res.data}`); |
| 262 | } |
| 263 | } |
| 264 | //每日帮好友喂一次狗粮 |
| 265 | if (item['taskType'] === 'HelpFeed') { |
| 266 | if (item['receiveStatus'] === 'chance_left') { |
| 267 | console.log('每日帮好友喂一次狗粮未完成') |
| 268 | } else if (item['receiveStatus'] === 'unreceive') { |
| 269 | const res = await getFood('HelpFeed'); |
| 270 | console.log(`领取每日帮好友喂一次狗粮 狗粮结果:${res.data}`); |
| 271 | } |
| 272 | } |
| 273 | //每日喂狗粮 |
| 274 | if (item['taskType'] === 'FeedEveryDay') { |
| 275 | if (item['receiveStatus'] === 'chance_left') { |
| 276 | console.log(`\n${item['taskName']}任务进行中\n`) |
| 277 | } else if (item['receiveStatus'] === 'unreceive') { |
| 278 | const res = await getFood('FeedEveryDay'); |
| 279 | console.log(`领取每日喂狗粮 结果:${res.data}`); |
| 280 | } |
| 281 | } |
| 282 | // |
| 283 | //邀请用户助力,领狗粮.(需手动去做任务) |
| 284 | if (item['taskType'] === 'InviteUser') { |
| 285 | if (item['receiveStatus'] === 'chance_left') { |
| 286 | console.log('未完成,需要自己手动去邀请好友给你助力,可以获得狗粮') |
no test coverage detected