()
| 254 | } |
| 255 | } |
| 256 | async function doTask() { |
| 257 | if ($.taskVos && $.taskVos.length > 0) { |
| 258 | for (let item of $.taskVos) { |
| 259 | if (item.taskType === 1) { |
| 260 | //关注店铺任务 |
| 261 | if (item.status === 1) { |
| 262 | console.log(`准备做此任务:${item.taskName}`); |
| 263 | for (let task of item.followShopVo) { |
| 264 | if (task.status === 1) { |
| 265 | await jdfactory_collectScore(task.taskToken); |
| 266 | } |
| 267 | } |
| 268 | } else { |
| 269 | console.log(`${item.taskName}已做完`) |
| 270 | } |
| 271 | } |
| 272 | if (item.taskType === 2) { |
| 273 | //看看商品任务 |
| 274 | if (item.status === 1) { |
| 275 | console.log(`准备做此任务:${item.taskName}`); |
| 276 | for (let task of item.productInfoVos) { |
| 277 | if (task.status === 1) { |
| 278 | await jdfactory_collectScore(task.taskToken); |
| 279 | } |
| 280 | } |
| 281 | } else { |
| 282 | console.log(`${item.taskName}已做完`) |
| 283 | } |
| 284 | } |
| 285 | if (item.taskType === 3) { |
| 286 | //逛会场任务 |
| 287 | if (item.status === 1) { |
| 288 | console.log(`准备做此任务:${item.taskName}`); |
| 289 | for (let task of item.shoppingActivityVos) { |
| 290 | if (task.status === 1) { |
| 291 | await jdfactory_collectScore(task.taskToken); |
| 292 | } |
| 293 | } |
| 294 | } else { |
| 295 | console.log(`${item.taskName}已做完`) |
| 296 | } |
| 297 | } |
| 298 | if (item.taskType === 10) { |
| 299 | if (item.status === 1) { |
| 300 | if (item.threeMealInfoVos[0].status === 1) { |
| 301 | //可以做此任务 |
| 302 | console.log(`准备做此任务:${item.taskName}`); |
| 303 | await jdfactory_collectScore(item.threeMealInfoVos[0].taskToken); |
| 304 | } else if (item.threeMealInfoVos[0].status === 0) { |
| 305 | console.log(`${item.taskName} 任务已错过时间`) |
| 306 | } |
| 307 | } else if (item.status === 2){ |
| 308 | console.log(`${item.taskName}已完成`); |
| 309 | } |
| 310 | } |
| 311 | if (item.taskType === 21) { |
| 312 | //开通会员任务 |
| 313 | if (item.status === 1) { |
no test coverage detected