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

Function getGoodsList

activity/jd_tcl.js:256–279  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

254}
255
256function getGoodsList() {
257 return new Promise((resolve) => {
258 $.post(taskUrl('/ql/front/tcl002/showgoodsload'), async (err, resp, data) => {
259 try {
260 if (err) {
261 console.log(`${JSON.stringify(err)}`);
262 console.log(`${$.name} API请求失败,请检查网路重试`);
263 } else {
264 data = $.toObj(data)
265 for (let vo of data.data) {
266 if (!vo.itemFlag) {
267 await goPlus(vo.skuId)
268 await $.wait(1000)
269 }
270 }
271 }
272 } catch (e) {
273 $.logErr(e, resp);
274 } finally {
275 resolve(data);
276 }
277 });
278 });
279}
280
281function goPlus(goodId) {
282 return new Promise((resolve) => {

Callers 1

mainFunction · 0.85

Calls 7

goPlusFunction · 0.85
taskUrlFunction · 0.70
postMethod · 0.45
logMethod · 0.45
toObjMethod · 0.45
waitMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected