MCPcopy Create free account
hub / github.com/Semporia/Scripts / getTaskList

Function getTaskList

jd_bean_home.js:326–360  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

324}
325
326function getTaskList() {
327 return new Promise(resolve => {
328 const body = {"rnVersion": "4.7", "rnClient": "2", "source": "AppHome"};
329 $.post(taskUrl('findBeanHome', body), async (err, resp, data) => {
330 try {
331 if (err) {
332 console.log(`${JSON.stringify(err)}`)
333 console.log(`${$.name} API请求失败,请检查网路重试`)
334 } else {
335 if (safeGet(data)) {
336 data = JSON.parse(data);
337 let beanTask = data.data.floorList.filter(vo => vo.floorName === "种豆得豆定制化场景")[0]
338 if (!beanTask.viewed) {
339 await receiveTask()
340 await $.wait(3000)
341 }
342
343 let tasks = data.data.floorList.filter(vo => vo.floorName === "赚京豆")[0]['stageList']
344 for (let i = 0; i < tasks.length; ++i) {
345 const vo = tasks[i]
346 if (vo.viewed) continue
347 await receiveTask(vo.stageId, `4_${vo.stageId}`)
348 await $.wait(3000)
349 }
350 await award()
351 }
352 }
353 } catch (e) {
354 $.logErr(e, resp)
355 } finally {
356 resolve();
357 }
358 })
359 })
360}
361
362function receiveTask(itemId = "zddd", type = "3") {
363 return new Promise(resolve => {

Callers 1

jdBeanHomeFunction · 0.70

Calls 8

receiveTaskFunction · 0.85
taskUrlFunction · 0.70
safeGetFunction · 0.70
awardFunction · 0.70
postMethod · 0.45
logMethod · 0.45
waitMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected