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

Function getShopList

activity/jd_5g.js:359–384  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

357 })
358}
359function getShopList() {
360 return new Promise((resolve) => {
361 $.get(taskUrl('task/shopInfo'), async (err, resp, data) => {
362 try {
363 if (err) {
364 console.log(`${JSON.stringify(err)}`)
365 console.log(`${$.name} API请求失败,请检查网路重试`)
366 } else {
367 data = JSON.parse(data);
368 if (data && data['code'] === 200) {
369 for(let vo of data.data){
370 await browseShop(vo['shopId'])
371 await getShopPrize(vo['shopId'])
372 }
373 } else {
374 console.log(JSON.stringify(data))
375 }
376 }
377 } catch (e) {
378 $.logErr(e, resp);
379 } finally {
380 resolve();
381 }
382 })
383 })
384}
385function browseShop(id) {
386 return new Promise((resolve) => {
387 $.post(taskPostUrl('task/browseShop', `shopId=${id}`), async (err, resp, data) => {

Callers 1

jdFiveFunction · 0.70

Calls 6

taskUrlFunction · 0.70
browseShopFunction · 0.70
getShopPrizeFunction · 0.70
getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected