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

Function addCart

jd_jump.js:306–325  ·  view source on GitHub ↗
(skuList)

Source from the content-addressed store, hash-verified

304}
305
306async function addCart(skuList) {
307 let body = `{"activityId":"${$.jumpId}","skuList":${JSON.stringify(skuList)}}`;
308 const myRequest = getPostRequest('addCart', body);
309 return new Promise(async resolve => {
310 $.post(myRequest, (err, resp, data) => {
311 try {
312 if (data) {
313 data = JSON.parse(data);
314 if (data.success === true) {
315 console.log(`任务执行成功`);
316 }
317 }
318 } catch (e) {
319 $.logErr(e, resp)
320 } finally {
321 resolve();
322 }
323 })
324 })
325}
326
327//获取任务列表
328async function getTaskList() {

Callers 1

doTaskFunction · 0.85

Calls 4

getPostRequestFunction · 0.70
postMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected