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

Function tryGoodList

jd_try.js:346–360  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

344}
345
346async function tryGoodList() {
347 console.log(`⏰ 即将申请 ${$.goodList.length} 个商品`)
348 $.running = true
349 $.stopMsg = '申请完毕'
350 for (let i = 0; i < $.goodList.length && $.running; i++) {
351 let good = $.goodList[i]
352 if (!await canTry(good)) continue
353 // 如果没有关注且关注失败
354 if (good.shopId && !await isFollowed(good) && !await followShop(good)) continue
355 // 两个申请间隔不能太短,放在下面有利于确保 follwShop 完成
356 await $.wait(5000)
357 // 关注完毕,即将试用
358 await doTry(good)
359 }
360}
361
362async function doTry(good) {
363 return new Promise((resolve, reject) => {

Callers 1

jd_try.jsFile · 0.85

Calls 6

canTryFunction · 0.85
isFollowedFunction · 0.85
doTryFunction · 0.85
followShopFunction · 0.70
logMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected